##// END OF EJS Templates
angular: start transitioning to component approach
ergo -
Show More
@@ -0,0 +1,2 b''
1 {% extends "/layout_base.jinja2" %}
2 {% block non_angular_content %}{% endblock %}
@@ -0,0 +1,36 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
6 // #
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
19
20 angular.module('appenlight.components.appenlightApp', [])
21 .component('appenlightApp', {
22 templateUrl: 'templates/components/appenlight-app.html',
23 controller: AppEnlightAppController
24 });
25
26 AppEnlightAppController.$inject = ['$scope','$state', 'stateHolder', 'AeConfig'];
27
28 function AppEnlightAppController($scope, $state, stateHolder, AeConfig){
29 console.log('app start');
30 // to keep bw compatibility
31 $scope.$state = $state;
32 $scope.stateHolder = stateHolder;
33 $scope.flash = stateHolder.flashMessages.list;
34 $scope.closeAlert = stateHolder.flashMessages.closeAlert;
35 $scope.AeConfig = AeConfig;
36 }
@@ -0,0 +1,32 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
6 // #
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
19
20 angular.module('appenlight.components.appenlightHeader', [])
21 .component('appenlightFooter', {
22 templateUrl: 'templates/components/appenlight-footer.html',
23 controller: AppEnlightFooterController
24 });
25
26 ChannelstreamController.$inject = ['stateHolder', 'AeConfig'];
27
28 function AppEnlightFooterController(stateHolder, AeConfig){
29 var vm = this;
30 vm.AeConfig = AeConfig;
31 vm.stateHolder = stateHolder;
32 }
@@ -0,0 +1,5 b''
1 <channelstream config="AeConfig"></channelstream>
2 <appenlight-header></appenlight-header>
3 <div id="outer-content">
4 <div ui-view class="container"></div>
5 </div>
@@ -0,0 +1,101 b''
1 <!-- Fixed navbar -->
2 <div id="top-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation">
3 <div class="pattern">
4 <div class="container">
5 <div class="navbar-header pull-left">
6 <a data-ui-sref="front_dashboard" class="navbar-brand">
7 <div id="logo-normal" class="hidden-sm hidden-xs"></div>
8 <div id="logo-icon" class="visible-sm visible-xs"></div>
9 </a>
10 </div>
11
12 <div class="container-fluid">
13 <div>
14 <ul class="nav navbar-nav navbar-right" ng-if="$ctrl.stateHolder.AeUser.id !== null">
15 <li id="user-notifications" class="dropdown ng-cloak" data-uib-dropdown>
16
17 <a class="dropdown-toggle" data-uib-dropdown-toggle>
18 <span class="badge">{{$ctrl.assignedReports.length}}</span>
19 <span class="fa fa-envelope-o"></span>
20 </a>
21 <ul class="dropdown-menu">
22 <li role="presentation" class="dropdown-header">Assigned reports</li>
23 <li data-ng-repeat="report in $ctrl.assignedReports" role="presentation">
24 <a href="{{report.front_url}}" role="menuitem" tabindex="-1">
25 <small>{{ report.error || 'Slow Report: ' + report.view_name |truncate:65}}</small>
26 </a>
27
28 </li>
29 <li data-ng-if="$ctrl.assignedReports.length == 0"><a><small>No reports</small></a></li>
30 </ul>
31 </li>
32 <li id="alert-notifications" class="dropdown ng-cloak" data-uib-dropdown auto-close="outsideClick">
33 <a class="dropdown-toggle" data-uib-dropdown-toggle>
34 <span class="badge {{ activeEvents ? 'danger' : '' }}">{{$ctrl.activeEvents}}</span>
35 <span class="fa fa-bell-o"></span></a>
36 <ul class="dropdown-menu">
37 <li role="presentation" class="dropdown-header">
38 <a data-ui-sref="events" class="btn btn-xs btn-default">Show me more</a></li>
39 <li role="presentation" class="dropdown-header">Latest events</li>
40 <li data-ng-repeat="event in $ctrl.latestEvents" role="presentation">
41 <a data-ng-click="$ctrl.clickedEvent(event)"><small class="resource-name">For {{ event.resource_name }}</small><br/>
42 <small>{{ event.text |truncate:65}}</small><br/>
43 <small class="date" data-uib-tooltip="{{event.start_date}}">created: <iso-to-relative-time time="{{event.start_date}}"/></small>
44 <small class="date" data-ng-show="event.end_date" data-uib-tooltip="{{event.end_date}}">closed: <iso-to-relative-time time="{{event.end_date}}"/></small>
45 </a>
46 </li>
47 <li data-ng-if="$ctrl.latestEvents.length == 0"><a><small>No events</small></a></li>
48 </ul>
49 </li>
50
51 <li id="dashboards" class="dropdown" data-uib-dropdown>
52 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Dashboards">
53 <span class="fa fa-bar-chart-o "></span></a>
54 <ul class="dropdown-menu">
55 <li role="presentation"><a data-ui-sref="front_dashboard">Main dashboard</a></li>
56 <li role="presentation" ng-repeat="item in $ctrl.AeConfig.topNav.menu_dashboards_items">
57 <a data-ui-sref="{{ item.sref }}">{{ item.label }}</a>
58 </li>
59 </ul>
60 </li>
61
62 <li class="dropdown" data-uib-dropdown>
63 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Reports">
64 <span class="fa fa-exclamation-triangle"></span></a>
65 <ul class="dropdown-menu">
66 <li role="presentation">
67 <a data-ui-sref="report.list({resource:$ctrl.stateHolder.resource})">Error Reports</a>
68 </li>
69 <li role="presentation">
70 <a data-ui-sref="report.list_slow({resource:$ctrl.stateHolder.resource})">Slowness Reports</a>
71 </li>
72
73 </ul>
74 </li>
75
76 <li>
77 <a data-ui-sref="logs({resource:$ctrl.stateHolder.resource})" data-uib-tooltip="Logs" tooltip-placement="bottom"><span class="fa fa-list-alt "></span></a></li>
78 <li>
79 <a data-ui-sref="user" data-uib-tooltip="Settings" tooltip-placement="bottom"><span class="fa fa-cog "></span></a>
80 </li>
81 <li class="dropdown" data-uib-dropdown data-ng-if="$ctrl.AeConfig.topNav.menu_admin_items.length">
82 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Admin Settings">
83 <span class="fa fa-wrench"></span></a>
84 <ul class="dropdown-menu">
85 <li role="presentation" ng-repeat="item in $ctrl.AeConfig.topNav.menu_admin_items">
86 <a data-ui-sref="{{ item.sref }}">{{ item.label }}</a>
87 </li>
88 </ul>
89 </li>
90 <li><a href="{{ $ctrl.AeConfig.urls.otherRoutes.signOut }}" target="_self"
91 data-uib-tooltip="Sign out" tooltip-placement="bottom">
92 <span class="fa fa-power-off "></span></a></li>
93 </ul>
94 <ul class="nav navbar-nav pull-right" ng-if="$ctrl.stateHolder.AeUser.id === null">
95 <li><a href="{{ $ctrl.AeConfig.urls.otherRoutes.register }}" target="_self" class="btn btn-orange">Sign In</a></li>
96 </ul>
97 </div><!-- /.navbar-collapse -->
98 </div><!-- /.container-fluid -->
99 </div>
100 </div>
101 </div>
@@ -1,13000 +1,13189 b''
1 // Underscore.js 1.6.0
1 // Underscore.js 1.6.0
2 // http://underscorejs.org
2 // http://underscorejs.org
3 // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
3 // (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
4 // Underscore may be freely distributed under the MIT license.
4 // Underscore may be freely distributed under the MIT license.
5
5
6 (function() {
6 (function() {
7
7
8 // Baseline setup
8 // Baseline setup
9 // --------------
9 // --------------
10
10
11 // Establish the root object, `window` in the browser, or `exports` on the server.
11 // Establish the root object, `window` in the browser, or `exports` on the server.
12 var root = this;
12 var root = this;
13
13
14 // Save the previous value of the `_` variable.
14 // Save the previous value of the `_` variable.
15 var previousUnderscore = root._;
15 var previousUnderscore = root._;
16
16
17 // Establish the object that gets returned to break out of a loop iteration.
17 // Establish the object that gets returned to break out of a loop iteration.
18 var breaker = {};
18 var breaker = {};
19
19
20 // Save bytes in the minified (but not gzipped) version:
20 // Save bytes in the minified (but not gzipped) version:
21 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
21 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
22
22
23 // Create quick reference variables for speed access to core prototypes.
23 // Create quick reference variables for speed access to core prototypes.
24 var
24 var
25 push = ArrayProto.push,
25 push = ArrayProto.push,
26 slice = ArrayProto.slice,
26 slice = ArrayProto.slice,
27 concat = ArrayProto.concat,
27 concat = ArrayProto.concat,
28 toString = ObjProto.toString,
28 toString = ObjProto.toString,
29 hasOwnProperty = ObjProto.hasOwnProperty;
29 hasOwnProperty = ObjProto.hasOwnProperty;
30
30
31 // All **ECMAScript 5** native function implementations that we hope to use
31 // All **ECMAScript 5** native function implementations that we hope to use
32 // are declared here.
32 // are declared here.
33 var
33 var
34 nativeForEach = ArrayProto.forEach,
34 nativeForEach = ArrayProto.forEach,
35 nativeMap = ArrayProto.map,
35 nativeMap = ArrayProto.map,
36 nativeReduce = ArrayProto.reduce,
36 nativeReduce = ArrayProto.reduce,
37 nativeReduceRight = ArrayProto.reduceRight,
37 nativeReduceRight = ArrayProto.reduceRight,
38 nativeFilter = ArrayProto.filter,
38 nativeFilter = ArrayProto.filter,
39 nativeEvery = ArrayProto.every,
39 nativeEvery = ArrayProto.every,
40 nativeSome = ArrayProto.some,
40 nativeSome = ArrayProto.some,
41 nativeIndexOf = ArrayProto.indexOf,
41 nativeIndexOf = ArrayProto.indexOf,
42 nativeLastIndexOf = ArrayProto.lastIndexOf,
42 nativeLastIndexOf = ArrayProto.lastIndexOf,
43 nativeIsArray = Array.isArray,
43 nativeIsArray = Array.isArray,
44 nativeKeys = Object.keys,
44 nativeKeys = Object.keys,
45 nativeBind = FuncProto.bind;
45 nativeBind = FuncProto.bind;
46
46
47 // Create a safe reference to the Underscore object for use below.
47 // Create a safe reference to the Underscore object for use below.
48 var _ = function(obj) {
48 var _ = function(obj) {
49 if (obj instanceof _) return obj;
49 if (obj instanceof _) return obj;
50 if (!(this instanceof _)) return new _(obj);
50 if (!(this instanceof _)) return new _(obj);
51 this._wrapped = obj;
51 this._wrapped = obj;
52 };
52 };
53
53
54 // Export the Underscore object for **Node.js**, with
54 // Export the Underscore object for **Node.js**, with
55 // backwards-compatibility for the old `require()` API. If we're in
55 // backwards-compatibility for the old `require()` API. If we're in
56 // the browser, add `_` as a global object via a string identifier,
56 // the browser, add `_` as a global object via a string identifier,
57 // for Closure Compiler "advanced" mode.
57 // for Closure Compiler "advanced" mode.
58 if (typeof exports !== 'undefined') {
58 if (typeof exports !== 'undefined') {
59 if (typeof module !== 'undefined' && module.exports) {
59 if (typeof module !== 'undefined' && module.exports) {
60 exports = module.exports = _;
60 exports = module.exports = _;
61 }
61 }
62 exports._ = _;
62 exports._ = _;
63 } else {
63 } else {
64 root._ = _;
64 root._ = _;
65 }
65 }
66
66
67 // Current version.
67 // Current version.
68 _.VERSION = '1.6.0';
68 _.VERSION = '1.6.0';
69
69
70 // Collection Functions
70 // Collection Functions
71 // --------------------
71 // --------------------
72
72
73 // The cornerstone, an `each` implementation, aka `forEach`.
73 // The cornerstone, an `each` implementation, aka `forEach`.
74 // Handles objects with the built-in `forEach`, arrays, and raw objects.
74 // Handles objects with the built-in `forEach`, arrays, and raw objects.
75 // Delegates to **ECMAScript 5**'s native `forEach` if available.
75 // Delegates to **ECMAScript 5**'s native `forEach` if available.
76 var each = _.each = _.forEach = function(obj, iterator, context) {
76 var each = _.each = _.forEach = function(obj, iterator, context) {
77 if (obj == null) return obj;
77 if (obj == null) return obj;
78 if (nativeForEach && obj.forEach === nativeForEach) {
78 if (nativeForEach && obj.forEach === nativeForEach) {
79 obj.forEach(iterator, context);
79 obj.forEach(iterator, context);
80 } else if (obj.length === +obj.length) {
80 } else if (obj.length === +obj.length) {
81 for (var i = 0, length = obj.length; i < length; i++) {
81 for (var i = 0, length = obj.length; i < length; i++) {
82 if (iterator.call(context, obj[i], i, obj) === breaker) return;
82 if (iterator.call(context, obj[i], i, obj) === breaker) return;
83 }
83 }
84 } else {
84 } else {
85 var keys = _.keys(obj);
85 var keys = _.keys(obj);
86 for (var i = 0, length = keys.length; i < length; i++) {
86 for (var i = 0, length = keys.length; i < length; i++) {
87 if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
87 if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return;
88 }
88 }
89 }
89 }
90 return obj;
90 return obj;
91 };
91 };
92
92
93 // Return the results of applying the iterator to each element.
93 // Return the results of applying the iterator to each element.
94 // Delegates to **ECMAScript 5**'s native `map` if available.
94 // Delegates to **ECMAScript 5**'s native `map` if available.
95 _.map = _.collect = function(obj, iterator, context) {
95 _.map = _.collect = function(obj, iterator, context) {
96 var results = [];
96 var results = [];
97 if (obj == null) return results;
97 if (obj == null) return results;
98 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
98 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
99 each(obj, function(value, index, list) {
99 each(obj, function(value, index, list) {
100 results.push(iterator.call(context, value, index, list));
100 results.push(iterator.call(context, value, index, list));
101 });
101 });
102 return results;
102 return results;
103 };
103 };
104
104
105 var reduceError = 'Reduce of empty array with no initial value';
105 var reduceError = 'Reduce of empty array with no initial value';
106
106
107 // **Reduce** builds up a single result from a list of values, aka `inject`,
107 // **Reduce** builds up a single result from a list of values, aka `inject`,
108 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
108 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
109 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
109 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
110 var initial = arguments.length > 2;
110 var initial = arguments.length > 2;
111 if (obj == null) obj = [];
111 if (obj == null) obj = [];
112 if (nativeReduce && obj.reduce === nativeReduce) {
112 if (nativeReduce && obj.reduce === nativeReduce) {
113 if (context) iterator = _.bind(iterator, context);
113 if (context) iterator = _.bind(iterator, context);
114 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
114 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
115 }
115 }
116 each(obj, function(value, index, list) {
116 each(obj, function(value, index, list) {
117 if (!initial) {
117 if (!initial) {
118 memo = value;
118 memo = value;
119 initial = true;
119 initial = true;
120 } else {
120 } else {
121 memo = iterator.call(context, memo, value, index, list);
121 memo = iterator.call(context, memo, value, index, list);
122 }
122 }
123 });
123 });
124 if (!initial) throw new TypeError(reduceError);
124 if (!initial) throw new TypeError(reduceError);
125 return memo;
125 return memo;
126 };
126 };
127
127
128 // The right-associative version of reduce, also known as `foldr`.
128 // The right-associative version of reduce, also known as `foldr`.
129 // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
129 // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
130 _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
130 _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
131 var initial = arguments.length > 2;
131 var initial = arguments.length > 2;
132 if (obj == null) obj = [];
132 if (obj == null) obj = [];
133 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
133 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
134 if (context) iterator = _.bind(iterator, context);
134 if (context) iterator = _.bind(iterator, context);
135 return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
135 return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
136 }
136 }
137 var length = obj.length;
137 var length = obj.length;
138 if (length !== +length) {
138 if (length !== +length) {
139 var keys = _.keys(obj);
139 var keys = _.keys(obj);
140 length = keys.length;
140 length = keys.length;
141 }
141 }
142 each(obj, function(value, index, list) {
142 each(obj, function(value, index, list) {
143 index = keys ? keys[--length] : --length;
143 index = keys ? keys[--length] : --length;
144 if (!initial) {
144 if (!initial) {
145 memo = obj[index];
145 memo = obj[index];
146 initial = true;
146 initial = true;
147 } else {
147 } else {
148 memo = iterator.call(context, memo, obj[index], index, list);
148 memo = iterator.call(context, memo, obj[index], index, list);
149 }
149 }
150 });
150 });
151 if (!initial) throw new TypeError(reduceError);
151 if (!initial) throw new TypeError(reduceError);
152 return memo;
152 return memo;
153 };
153 };
154
154
155 // Return the first value which passes a truth test. Aliased as `detect`.
155 // Return the first value which passes a truth test. Aliased as `detect`.
156 _.find = _.detect = function(obj, predicate, context) {
156 _.find = _.detect = function(obj, predicate, context) {
157 var result;
157 var result;
158 any(obj, function(value, index, list) {
158 any(obj, function(value, index, list) {
159 if (predicate.call(context, value, index, list)) {
159 if (predicate.call(context, value, index, list)) {
160 result = value;
160 result = value;
161 return true;
161 return true;
162 }
162 }
163 });
163 });
164 return result;
164 return result;
165 };
165 };
166
166
167 // Return all the elements that pass a truth test.
167 // Return all the elements that pass a truth test.
168 // Delegates to **ECMAScript 5**'s native `filter` if available.
168 // Delegates to **ECMAScript 5**'s native `filter` if available.
169 // Aliased as `select`.
169 // Aliased as `select`.
170 _.filter = _.select = function(obj, predicate, context) {
170 _.filter = _.select = function(obj, predicate, context) {
171 var results = [];
171 var results = [];
172 if (obj == null) return results;
172 if (obj == null) return results;
173 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context);
173 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context);
174 each(obj, function(value, index, list) {
174 each(obj, function(value, index, list) {
175 if (predicate.call(context, value, index, list)) results.push(value);
175 if (predicate.call(context, value, index, list)) results.push(value);
176 });
176 });
177 return results;
177 return results;
178 };
178 };
179
179
180 // Return all the elements for which a truth test fails.
180 // Return all the elements for which a truth test fails.
181 _.reject = function(obj, predicate, context) {
181 _.reject = function(obj, predicate, context) {
182 return _.filter(obj, function(value, index, list) {
182 return _.filter(obj, function(value, index, list) {
183 return !predicate.call(context, value, index, list);
183 return !predicate.call(context, value, index, list);
184 }, context);
184 }, context);
185 };
185 };
186
186
187 // Determine whether all of the elements match a truth test.
187 // Determine whether all of the elements match a truth test.
188 // Delegates to **ECMAScript 5**'s native `every` if available.
188 // Delegates to **ECMAScript 5**'s native `every` if available.
189 // Aliased as `all`.
189 // Aliased as `all`.
190 _.every = _.all = function(obj, predicate, context) {
190 _.every = _.all = function(obj, predicate, context) {
191 predicate || (predicate = _.identity);
191 predicate || (predicate = _.identity);
192 var result = true;
192 var result = true;
193 if (obj == null) return result;
193 if (obj == null) return result;
194 if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context);
194 if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context);
195 each(obj, function(value, index, list) {
195 each(obj, function(value, index, list) {
196 if (!(result = result && predicate.call(context, value, index, list))) return breaker;
196 if (!(result = result && predicate.call(context, value, index, list))) return breaker;
197 });
197 });
198 return !!result;
198 return !!result;
199 };
199 };
200
200
201 // Determine if at least one element in the object matches a truth test.
201 // Determine if at least one element in the object matches a truth test.
202 // Delegates to **ECMAScript 5**'s native `some` if available.
202 // Delegates to **ECMAScript 5**'s native `some` if available.
203 // Aliased as `any`.
203 // Aliased as `any`.
204 var any = _.some = _.any = function(obj, predicate, context) {
204 var any = _.some = _.any = function(obj, predicate, context) {
205 predicate || (predicate = _.identity);
205 predicate || (predicate = _.identity);
206 var result = false;
206 var result = false;
207 if (obj == null) return result;
207 if (obj == null) return result;
208 if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context);
208 if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context);
209 each(obj, function(value, index, list) {
209 each(obj, function(value, index, list) {
210 if (result || (result = predicate.call(context, value, index, list))) return breaker;
210 if (result || (result = predicate.call(context, value, index, list))) return breaker;
211 });
211 });
212 return !!result;
212 return !!result;
213 };
213 };
214
214
215 // Determine if the array or object contains a given value (using `===`).
215 // Determine if the array or object contains a given value (using `===`).
216 // Aliased as `include`.
216 // Aliased as `include`.
217 _.contains = _.include = function(obj, target) {
217 _.contains = _.include = function(obj, target) {
218 if (obj == null) return false;
218 if (obj == null) return false;
219 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
219 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
220 return any(obj, function(value) {
220 return any(obj, function(value) {
221 return value === target;
221 return value === target;
222 });
222 });
223 };
223 };
224
224
225 // Invoke a method (with arguments) on every item in a collection.
225 // Invoke a method (with arguments) on every item in a collection.
226 _.invoke = function(obj, method) {
226 _.invoke = function(obj, method) {
227 var args = slice.call(arguments, 2);
227 var args = slice.call(arguments, 2);
228 var isFunc = _.isFunction(method);
228 var isFunc = _.isFunction(method);
229 return _.map(obj, function(value) {
229 return _.map(obj, function(value) {
230 return (isFunc ? method : value[method]).apply(value, args);
230 return (isFunc ? method : value[method]).apply(value, args);
231 });
231 });
232 };
232 };
233
233
234 // Convenience version of a common use case of `map`: fetching a property.
234 // Convenience version of a common use case of `map`: fetching a property.
235 _.pluck = function(obj, key) {
235 _.pluck = function(obj, key) {
236 return _.map(obj, _.property(key));
236 return _.map(obj, _.property(key));
237 };
237 };
238
238
239 // Convenience version of a common use case of `filter`: selecting only objects
239 // Convenience version of a common use case of `filter`: selecting only objects
240 // containing specific `key:value` pairs.
240 // containing specific `key:value` pairs.
241 _.where = function(obj, attrs) {
241 _.where = function(obj, attrs) {
242 return _.filter(obj, _.matches(attrs));
242 return _.filter(obj, _.matches(attrs));
243 };
243 };
244
244
245 // Convenience version of a common use case of `find`: getting the first object
245 // Convenience version of a common use case of `find`: getting the first object
246 // containing specific `key:value` pairs.
246 // containing specific `key:value` pairs.
247 _.findWhere = function(obj, attrs) {
247 _.findWhere = function(obj, attrs) {
248 return _.find(obj, _.matches(attrs));
248 return _.find(obj, _.matches(attrs));
249 };
249 };
250
250
251 // Return the maximum element or (element-based computation).
251 // Return the maximum element or (element-based computation).
252 // Can't optimize arrays of integers longer than 65,535 elements.
252 // Can't optimize arrays of integers longer than 65,535 elements.
253 // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
253 // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797)
254 _.max = function(obj, iterator, context) {
254 _.max = function(obj, iterator, context) {
255 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
255 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
256 return Math.max.apply(Math, obj);
256 return Math.max.apply(Math, obj);
257 }
257 }
258 var result = -Infinity, lastComputed = -Infinity;
258 var result = -Infinity, lastComputed = -Infinity;
259 each(obj, function(value, index, list) {
259 each(obj, function(value, index, list) {
260 var computed = iterator ? iterator.call(context, value, index, list) : value;
260 var computed = iterator ? iterator.call(context, value, index, list) : value;
261 if (computed > lastComputed) {
261 if (computed > lastComputed) {
262 result = value;
262 result = value;
263 lastComputed = computed;
263 lastComputed = computed;
264 }
264 }
265 });
265 });
266 return result;
266 return result;
267 };
267 };
268
268
269 // Return the minimum element (or element-based computation).
269 // Return the minimum element (or element-based computation).
270 _.min = function(obj, iterator, context) {
270 _.min = function(obj, iterator, context) {
271 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
271 if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
272 return Math.min.apply(Math, obj);
272 return Math.min.apply(Math, obj);
273 }
273 }
274 var result = Infinity, lastComputed = Infinity;
274 var result = Infinity, lastComputed = Infinity;
275 each(obj, function(value, index, list) {
275 each(obj, function(value, index, list) {
276 var computed = iterator ? iterator.call(context, value, index, list) : value;
276 var computed = iterator ? iterator.call(context, value, index, list) : value;
277 if (computed < lastComputed) {
277 if (computed < lastComputed) {
278 result = value;
278 result = value;
279 lastComputed = computed;
279 lastComputed = computed;
280 }
280 }
281 });
281 });
282 return result;
282 return result;
283 };
283 };
284
284
285 // Shuffle an array, using the modern version of the
285 // Shuffle an array, using the modern version of the
286 // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
286 // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
287 _.shuffle = function(obj) {
287 _.shuffle = function(obj) {
288 var rand;
288 var rand;
289 var index = 0;
289 var index = 0;
290 var shuffled = [];
290 var shuffled = [];
291 each(obj, function(value) {
291 each(obj, function(value) {
292 rand = _.random(index++);
292 rand = _.random(index++);
293 shuffled[index - 1] = shuffled[rand];
293 shuffled[index - 1] = shuffled[rand];
294 shuffled[rand] = value;
294 shuffled[rand] = value;
295 });
295 });
296 return shuffled;
296 return shuffled;
297 };
297 };
298
298
299 // Sample **n** random values from a collection.
299 // Sample **n** random values from a collection.
300 // If **n** is not specified, returns a single random element.
300 // If **n** is not specified, returns a single random element.
301 // The internal `guard` argument allows it to work with `map`.
301 // The internal `guard` argument allows it to work with `map`.
302 _.sample = function(obj, n, guard) {
302 _.sample = function(obj, n, guard) {
303 if (n == null || guard) {
303 if (n == null || guard) {
304 if (obj.length !== +obj.length) obj = _.values(obj);
304 if (obj.length !== +obj.length) obj = _.values(obj);
305 return obj[_.random(obj.length - 1)];
305 return obj[_.random(obj.length - 1)];
306 }
306 }
307 return _.shuffle(obj).slice(0, Math.max(0, n));
307 return _.shuffle(obj).slice(0, Math.max(0, n));
308 };
308 };
309
309
310 // An internal function to generate lookup iterators.
310 // An internal function to generate lookup iterators.
311 var lookupIterator = function(value) {
311 var lookupIterator = function(value) {
312 if (value == null) return _.identity;
312 if (value == null) return _.identity;
313 if (_.isFunction(value)) return value;
313 if (_.isFunction(value)) return value;
314 return _.property(value);
314 return _.property(value);
315 };
315 };
316
316
317 // Sort the object's values by a criterion produced by an iterator.
317 // Sort the object's values by a criterion produced by an iterator.
318 _.sortBy = function(obj, iterator, context) {
318 _.sortBy = function(obj, iterator, context) {
319 iterator = lookupIterator(iterator);
319 iterator = lookupIterator(iterator);
320 return _.pluck(_.map(obj, function(value, index, list) {
320 return _.pluck(_.map(obj, function(value, index, list) {
321 return {
321 return {
322 value: value,
322 value: value,
323 index: index,
323 index: index,
324 criteria: iterator.call(context, value, index, list)
324 criteria: iterator.call(context, value, index, list)
325 };
325 };
326 }).sort(function(left, right) {
326 }).sort(function(left, right) {
327 var a = left.criteria;
327 var a = left.criteria;
328 var b = right.criteria;
328 var b = right.criteria;
329 if (a !== b) {
329 if (a !== b) {
330 if (a > b || a === void 0) return 1;
330 if (a > b || a === void 0) return 1;
331 if (a < b || b === void 0) return -1;
331 if (a < b || b === void 0) return -1;
332 }
332 }
333 return left.index - right.index;
333 return left.index - right.index;
334 }), 'value');
334 }), 'value');
335 };
335 };
336
336
337 // An internal function used for aggregate "group by" operations.
337 // An internal function used for aggregate "group by" operations.
338 var group = function(behavior) {
338 var group = function(behavior) {
339 return function(obj, iterator, context) {
339 return function(obj, iterator, context) {
340 var result = {};
340 var result = {};
341 iterator = lookupIterator(iterator);
341 iterator = lookupIterator(iterator);
342 each(obj, function(value, index) {
342 each(obj, function(value, index) {
343 var key = iterator.call(context, value, index, obj);
343 var key = iterator.call(context, value, index, obj);
344 behavior(result, key, value);
344 behavior(result, key, value);
345 });
345 });
346 return result;
346 return result;
347 };
347 };
348 };
348 };
349
349
350 // Groups the object's values by a criterion. Pass either a string attribute
350 // Groups the object's values by a criterion. Pass either a string attribute
351 // to group by, or a function that returns the criterion.
351 // to group by, or a function that returns the criterion.
352 _.groupBy = group(function(result, key, value) {
352 _.groupBy = group(function(result, key, value) {
353 _.has(result, key) ? result[key].push(value) : result[key] = [value];
353 _.has(result, key) ? result[key].push(value) : result[key] = [value];
354 });
354 });
355
355
356 // Indexes the object's values by a criterion, similar to `groupBy`, but for
356 // Indexes the object's values by a criterion, similar to `groupBy`, but for
357 // when you know that your index values will be unique.
357 // when you know that your index values will be unique.
358 _.indexBy = group(function(result, key, value) {
358 _.indexBy = group(function(result, key, value) {
359 result[key] = value;
359 result[key] = value;
360 });
360 });
361
361
362 // Counts instances of an object that group by a certain criterion. Pass
362 // Counts instances of an object that group by a certain criterion. Pass
363 // either a string attribute to count by, or a function that returns the
363 // either a string attribute to count by, or a function that returns the
364 // criterion.
364 // criterion.
365 _.countBy = group(function(result, key) {
365 _.countBy = group(function(result, key) {
366 _.has(result, key) ? result[key]++ : result[key] = 1;
366 _.has(result, key) ? result[key]++ : result[key] = 1;
367 });
367 });
368
368
369 // Use a comparator function to figure out the smallest index at which
369 // Use a comparator function to figure out the smallest index at which
370 // an object should be inserted so as to maintain order. Uses binary search.
370 // an object should be inserted so as to maintain order. Uses binary search.
371 _.sortedIndex = function(array, obj, iterator, context) {
371 _.sortedIndex = function(array, obj, iterator, context) {
372 iterator = lookupIterator(iterator);
372 iterator = lookupIterator(iterator);
373 var value = iterator.call(context, obj);
373 var value = iterator.call(context, obj);
374 var low = 0, high = array.length;
374 var low = 0, high = array.length;
375 while (low < high) {
375 while (low < high) {
376 var mid = (low + high) >>> 1;
376 var mid = (low + high) >>> 1;
377 iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
377 iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid;
378 }
378 }
379 return low;
379 return low;
380 };
380 };
381
381
382 // Safely create a real, live array from anything iterable.
382 // Safely create a real, live array from anything iterable.
383 _.toArray = function(obj) {
383 _.toArray = function(obj) {
384 if (!obj) return [];
384 if (!obj) return [];
385 if (_.isArray(obj)) return slice.call(obj);
385 if (_.isArray(obj)) return slice.call(obj);
386 if (obj.length === +obj.length) return _.map(obj, _.identity);
386 if (obj.length === +obj.length) return _.map(obj, _.identity);
387 return _.values(obj);
387 return _.values(obj);
388 };
388 };
389
389
390 // Return the number of elements in an object.
390 // Return the number of elements in an object.
391 _.size = function(obj) {
391 _.size = function(obj) {
392 if (obj == null) return 0;
392 if (obj == null) return 0;
393 return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
393 return (obj.length === +obj.length) ? obj.length : _.keys(obj).length;
394 };
394 };
395
395
396 // Array Functions
396 // Array Functions
397 // ---------------
397 // ---------------
398
398
399 // Get the first element of an array. Passing **n** will return the first N
399 // Get the first element of an array. Passing **n** will return the first N
400 // values in the array. Aliased as `head` and `take`. The **guard** check
400 // values in the array. Aliased as `head` and `take`. The **guard** check
401 // allows it to work with `_.map`.
401 // allows it to work with `_.map`.
402 _.first = _.head = _.take = function(array, n, guard) {
402 _.first = _.head = _.take = function(array, n, guard) {
403 if (array == null) return void 0;
403 if (array == null) return void 0;
404 if ((n == null) || guard) return array[0];
404 if ((n == null) || guard) return array[0];
405 if (n < 0) return [];
405 if (n < 0) return [];
406 return slice.call(array, 0, n);
406 return slice.call(array, 0, n);
407 };
407 };
408
408
409 // Returns everything but the last entry of the array. Especially useful on
409 // Returns everything but the last entry of the array. Especially useful on
410 // the arguments object. Passing **n** will return all the values in
410 // the arguments object. Passing **n** will return all the values in
411 // the array, excluding the last N. The **guard** check allows it to work with
411 // the array, excluding the last N. The **guard** check allows it to work with
412 // `_.map`.
412 // `_.map`.
413 _.initial = function(array, n, guard) {
413 _.initial = function(array, n, guard) {
414 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
414 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
415 };
415 };
416
416
417 // Get the last element of an array. Passing **n** will return the last N
417 // Get the last element of an array. Passing **n** will return the last N
418 // values in the array. The **guard** check allows it to work with `_.map`.
418 // values in the array. The **guard** check allows it to work with `_.map`.
419 _.last = function(array, n, guard) {
419 _.last = function(array, n, guard) {
420 if (array == null) return void 0;
420 if (array == null) return void 0;
421 if ((n == null) || guard) return array[array.length - 1];
421 if ((n == null) || guard) return array[array.length - 1];
422 return slice.call(array, Math.max(array.length - n, 0));
422 return slice.call(array, Math.max(array.length - n, 0));
423 };
423 };
424
424
425 // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
425 // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.
426 // Especially useful on the arguments object. Passing an **n** will return
426 // Especially useful on the arguments object. Passing an **n** will return
427 // the rest N values in the array. The **guard**
427 // the rest N values in the array. The **guard**
428 // check allows it to work with `_.map`.
428 // check allows it to work with `_.map`.
429 _.rest = _.tail = _.drop = function(array, n, guard) {
429 _.rest = _.tail = _.drop = function(array, n, guard) {
430 return slice.call(array, (n == null) || guard ? 1 : n);
430 return slice.call(array, (n == null) || guard ? 1 : n);
431 };
431 };
432
432
433 // Trim out all falsy values from an array.
433 // Trim out all falsy values from an array.
434 _.compact = function(array) {
434 _.compact = function(array) {
435 return _.filter(array, _.identity);
435 return _.filter(array, _.identity);
436 };
436 };
437
437
438 // Internal implementation of a recursive `flatten` function.
438 // Internal implementation of a recursive `flatten` function.
439 var flatten = function(input, shallow, output) {
439 var flatten = function(input, shallow, output) {
440 if (shallow && _.every(input, _.isArray)) {
440 if (shallow && _.every(input, _.isArray)) {
441 return concat.apply(output, input);
441 return concat.apply(output, input);
442 }
442 }
443 each(input, function(value) {
443 each(input, function(value) {
444 if (_.isArray(value) || _.isArguments(value)) {
444 if (_.isArray(value) || _.isArguments(value)) {
445 shallow ? push.apply(output, value) : flatten(value, shallow, output);
445 shallow ? push.apply(output, value) : flatten(value, shallow, output);
446 } else {
446 } else {
447 output.push(value);
447 output.push(value);
448 }
448 }
449 });
449 });
450 return output;
450 return output;
451 };
451 };
452
452
453 // Flatten out an array, either recursively (by default), or just one level.
453 // Flatten out an array, either recursively (by default), or just one level.
454 _.flatten = function(array, shallow) {
454 _.flatten = function(array, shallow) {
455 return flatten(array, shallow, []);
455 return flatten(array, shallow, []);
456 };
456 };
457
457
458 // Return a version of the array that does not contain the specified value(s).
458 // Return a version of the array that does not contain the specified value(s).
459 _.without = function(array) {
459 _.without = function(array) {
460 return _.difference(array, slice.call(arguments, 1));
460 return _.difference(array, slice.call(arguments, 1));
461 };
461 };
462
462
463 // Split an array into two arrays: one whose elements all satisfy the given
463 // Split an array into two arrays: one whose elements all satisfy the given
464 // predicate, and one whose elements all do not satisfy the predicate.
464 // predicate, and one whose elements all do not satisfy the predicate.
465 _.partition = function(array, predicate) {
465 _.partition = function(array, predicate) {
466 var pass = [], fail = [];
466 var pass = [], fail = [];
467 each(array, function(elem) {
467 each(array, function(elem) {
468 (predicate(elem) ? pass : fail).push(elem);
468 (predicate(elem) ? pass : fail).push(elem);
469 });
469 });
470 return [pass, fail];
470 return [pass, fail];
471 };
471 };
472
472
473 // Produce a duplicate-free version of the array. If the array has already
473 // Produce a duplicate-free version of the array. If the array has already
474 // been sorted, you have the option of using a faster algorithm.
474 // been sorted, you have the option of using a faster algorithm.
475 // Aliased as `unique`.
475 // Aliased as `unique`.
476 _.uniq = _.unique = function(array, isSorted, iterator, context) {
476 _.uniq = _.unique = function(array, isSorted, iterator, context) {
477 if (_.isFunction(isSorted)) {
477 if (_.isFunction(isSorted)) {
478 context = iterator;
478 context = iterator;
479 iterator = isSorted;
479 iterator = isSorted;
480 isSorted = false;
480 isSorted = false;
481 }
481 }
482 var initial = iterator ? _.map(array, iterator, context) : array;
482 var initial = iterator ? _.map(array, iterator, context) : array;
483 var results = [];
483 var results = [];
484 var seen = [];
484 var seen = [];
485 each(initial, function(value, index) {
485 each(initial, function(value, index) {
486 if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
486 if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) {
487 seen.push(value);
487 seen.push(value);
488 results.push(array[index]);
488 results.push(array[index]);
489 }
489 }
490 });
490 });
491 return results;
491 return results;
492 };
492 };
493
493
494 // Produce an array that contains the union: each distinct element from all of
494 // Produce an array that contains the union: each distinct element from all of
495 // the passed-in arrays.
495 // the passed-in arrays.
496 _.union = function() {
496 _.union = function() {
497 return _.uniq(_.flatten(arguments, true));
497 return _.uniq(_.flatten(arguments, true));
498 };
498 };
499
499
500 // Produce an array that contains every item shared between all the
500 // Produce an array that contains every item shared between all the
501 // passed-in arrays.
501 // passed-in arrays.
502 _.intersection = function(array) {
502 _.intersection = function(array) {
503 var rest = slice.call(arguments, 1);
503 var rest = slice.call(arguments, 1);
504 return _.filter(_.uniq(array), function(item) {
504 return _.filter(_.uniq(array), function(item) {
505 return _.every(rest, function(other) {
505 return _.every(rest, function(other) {
506 return _.contains(other, item);
506 return _.contains(other, item);
507 });
507 });
508 });
508 });
509 };
509 };
510
510
511 // Take the difference between one array and a number of other arrays.
511 // Take the difference between one array and a number of other arrays.
512 // Only the elements present in just the first array will remain.
512 // Only the elements present in just the first array will remain.
513 _.difference = function(array) {
513 _.difference = function(array) {
514 var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
514 var rest = concat.apply(ArrayProto, slice.call(arguments, 1));
515 return _.filter(array, function(value){ return !_.contains(rest, value); });
515 return _.filter(array, function(value){ return !_.contains(rest, value); });
516 };
516 };
517
517
518 // Zip together multiple lists into a single array -- elements that share
518 // Zip together multiple lists into a single array -- elements that share
519 // an index go together.
519 // an index go together.
520 _.zip = function() {
520 _.zip = function() {
521 var length = _.max(_.pluck(arguments, 'length').concat(0));
521 var length = _.max(_.pluck(arguments, 'length').concat(0));
522 var results = new Array(length);
522 var results = new Array(length);
523 for (var i = 0; i < length; i++) {
523 for (var i = 0; i < length; i++) {
524 results[i] = _.pluck(arguments, '' + i);
524 results[i] = _.pluck(arguments, '' + i);
525 }
525 }
526 return results;
526 return results;
527 };
527 };
528
528
529 // Converts lists into objects. Pass either a single array of `[key, value]`
529 // Converts lists into objects. Pass either a single array of `[key, value]`
530 // pairs, or two parallel arrays of the same length -- one of keys, and one of
530 // pairs, or two parallel arrays of the same length -- one of keys, and one of
531 // the corresponding values.
531 // the corresponding values.
532 _.object = function(list, values) {
532 _.object = function(list, values) {
533 if (list == null) return {};
533 if (list == null) return {};
534 var result = {};
534 var result = {};
535 for (var i = 0, length = list.length; i < length; i++) {
535 for (var i = 0, length = list.length; i < length; i++) {
536 if (values) {
536 if (values) {
537 result[list[i]] = values[i];
537 result[list[i]] = values[i];
538 } else {
538 } else {
539 result[list[i][0]] = list[i][1];
539 result[list[i][0]] = list[i][1];
540 }
540 }
541 }
541 }
542 return result;
542 return result;
543 };
543 };
544
544
545 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
545 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
546 // we need this function. Return the position of the first occurrence of an
546 // we need this function. Return the position of the first occurrence of an
547 // item in an array, or -1 if the item is not included in the array.
547 // item in an array, or -1 if the item is not included in the array.
548 // Delegates to **ECMAScript 5**'s native `indexOf` if available.
548 // Delegates to **ECMAScript 5**'s native `indexOf` if available.
549 // If the array is large and already in sort order, pass `true`
549 // If the array is large and already in sort order, pass `true`
550 // for **isSorted** to use binary search.
550 // for **isSorted** to use binary search.
551 _.indexOf = function(array, item, isSorted) {
551 _.indexOf = function(array, item, isSorted) {
552 if (array == null) return -1;
552 if (array == null) return -1;
553 var i = 0, length = array.length;
553 var i = 0, length = array.length;
554 if (isSorted) {
554 if (isSorted) {
555 if (typeof isSorted == 'number') {
555 if (typeof isSorted == 'number') {
556 i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
556 i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted);
557 } else {
557 } else {
558 i = _.sortedIndex(array, item);
558 i = _.sortedIndex(array, item);
559 return array[i] === item ? i : -1;
559 return array[i] === item ? i : -1;
560 }
560 }
561 }
561 }
562 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
562 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted);
563 for (; i < length; i++) if (array[i] === item) return i;
563 for (; i < length; i++) if (array[i] === item) return i;
564 return -1;
564 return -1;
565 };
565 };
566
566
567 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
567 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
568 _.lastIndexOf = function(array, item, from) {
568 _.lastIndexOf = function(array, item, from) {
569 if (array == null) return -1;
569 if (array == null) return -1;
570 var hasIndex = from != null;
570 var hasIndex = from != null;
571 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
571 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) {
572 return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
572 return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item);
573 }
573 }
574 var i = (hasIndex ? from : array.length);
574 var i = (hasIndex ? from : array.length);
575 while (i--) if (array[i] === item) return i;
575 while (i--) if (array[i] === item) return i;
576 return -1;
576 return -1;
577 };
577 };
578
578
579 // Generate an integer Array containing an arithmetic progression. A port of
579 // Generate an integer Array containing an arithmetic progression. A port of
580 // the native Python `range()` function. See
580 // the native Python `range()` function. See
581 // [the Python documentation](http://docs.python.org/library/functions.html#range).
581 // [the Python documentation](http://docs.python.org/library/functions.html#range).
582 _.range = function(start, stop, step) {
582 _.range = function(start, stop, step) {
583 if (arguments.length <= 1) {
583 if (arguments.length <= 1) {
584 stop = start || 0;
584 stop = start || 0;
585 start = 0;
585 start = 0;
586 }
586 }
587 step = arguments[2] || 1;
587 step = arguments[2] || 1;
588
588
589 var length = Math.max(Math.ceil((stop - start) / step), 0);
589 var length = Math.max(Math.ceil((stop - start) / step), 0);
590 var idx = 0;
590 var idx = 0;
591 var range = new Array(length);
591 var range = new Array(length);
592
592
593 while(idx < length) {
593 while(idx < length) {
594 range[idx++] = start;
594 range[idx++] = start;
595 start += step;
595 start += step;
596 }
596 }
597
597
598 return range;
598 return range;
599 };
599 };
600
600
601 // Function (ahem) Functions
601 // Function (ahem) Functions
602 // ------------------
602 // ------------------
603
603
604 // Reusable constructor function for prototype setting.
604 // Reusable constructor function for prototype setting.
605 var ctor = function(){};
605 var ctor = function(){};
606
606
607 // Create a function bound to a given object (assigning `this`, and arguments,
607 // Create a function bound to a given object (assigning `this`, and arguments,
608 // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
608 // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if
609 // available.
609 // available.
610 _.bind = function(func, context) {
610 _.bind = function(func, context) {
611 var args, bound;
611 var args, bound;
612 if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
612 if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
613 if (!_.isFunction(func)) throw new TypeError;
613 if (!_.isFunction(func)) throw new TypeError;
614 args = slice.call(arguments, 2);
614 args = slice.call(arguments, 2);
615 return bound = function() {
615 return bound = function() {
616 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
616 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
617 ctor.prototype = func.prototype;
617 ctor.prototype = func.prototype;
618 var self = new ctor;
618 var self = new ctor;
619 ctor.prototype = null;
619 ctor.prototype = null;
620 var result = func.apply(self, args.concat(slice.call(arguments)));
620 var result = func.apply(self, args.concat(slice.call(arguments)));
621 if (Object(result) === result) return result;
621 if (Object(result) === result) return result;
622 return self;
622 return self;
623 };
623 };
624 };
624 };
625
625
626 // Partially apply a function by creating a version that has had some of its
626 // Partially apply a function by creating a version that has had some of its
627 // arguments pre-filled, without changing its dynamic `this` context. _ acts
627 // arguments pre-filled, without changing its dynamic `this` context. _ acts
628 // as a placeholder, allowing any combination of arguments to be pre-filled.
628 // as a placeholder, allowing any combination of arguments to be pre-filled.
629 _.partial = function(func) {
629 _.partial = function(func) {
630 var boundArgs = slice.call(arguments, 1);
630 var boundArgs = slice.call(arguments, 1);
631 return function() {
631 return function() {
632 var position = 0;
632 var position = 0;
633 var args = boundArgs.slice();
633 var args = boundArgs.slice();
634 for (var i = 0, length = args.length; i < length; i++) {
634 for (var i = 0, length = args.length; i < length; i++) {
635 if (args[i] === _) args[i] = arguments[position++];
635 if (args[i] === _) args[i] = arguments[position++];
636 }
636 }
637 while (position < arguments.length) args.push(arguments[position++]);
637 while (position < arguments.length) args.push(arguments[position++]);
638 return func.apply(this, args);
638 return func.apply(this, args);
639 };
639 };
640 };
640 };
641
641
642 // Bind a number of an object's methods to that object. Remaining arguments
642 // Bind a number of an object's methods to that object. Remaining arguments
643 // are the method names to be bound. Useful for ensuring that all callbacks
643 // are the method names to be bound. Useful for ensuring that all callbacks
644 // defined on an object belong to it.
644 // defined on an object belong to it.
645 _.bindAll = function(obj) {
645 _.bindAll = function(obj) {
646 var funcs = slice.call(arguments, 1);
646 var funcs = slice.call(arguments, 1);
647 if (funcs.length === 0) throw new Error('bindAll must be passed function names');
647 if (funcs.length === 0) throw new Error('bindAll must be passed function names');
648 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
648 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
649 return obj;
649 return obj;
650 };
650 };
651
651
652 // Memoize an expensive function by storing its results.
652 // Memoize an expensive function by storing its results.
653 _.memoize = function(func, hasher) {
653 _.memoize = function(func, hasher) {
654 var memo = {};
654 var memo = {};
655 hasher || (hasher = _.identity);
655 hasher || (hasher = _.identity);
656 return function() {
656 return function() {
657 var key = hasher.apply(this, arguments);
657 var key = hasher.apply(this, arguments);
658 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
658 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
659 };
659 };
660 };
660 };
661
661
662 // Delays a function for the given number of milliseconds, and then calls
662 // Delays a function for the given number of milliseconds, and then calls
663 // it with the arguments supplied.
663 // it with the arguments supplied.
664 _.delay = function(func, wait) {
664 _.delay = function(func, wait) {
665 var args = slice.call(arguments, 2);
665 var args = slice.call(arguments, 2);
666 return setTimeout(function(){ return func.apply(null, args); }, wait);
666 return setTimeout(function(){ return func.apply(null, args); }, wait);
667 };
667 };
668
668
669 // Defers a function, scheduling it to run after the current call stack has
669 // Defers a function, scheduling it to run after the current call stack has
670 // cleared.
670 // cleared.
671 _.defer = function(func) {
671 _.defer = function(func) {
672 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
672 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
673 };
673 };
674
674
675 // Returns a function, that, when invoked, will only be triggered at most once
675 // Returns a function, that, when invoked, will only be triggered at most once
676 // during a given window of time. Normally, the throttled function will run
676 // during a given window of time. Normally, the throttled function will run
677 // as much as it can, without ever going more than once per `wait` duration;
677 // as much as it can, without ever going more than once per `wait` duration;
678 // but if you'd like to disable the execution on the leading edge, pass
678 // but if you'd like to disable the execution on the leading edge, pass
679 // `{leading: false}`. To disable execution on the trailing edge, ditto.
679 // `{leading: false}`. To disable execution on the trailing edge, ditto.
680 _.throttle = function(func, wait, options) {
680 _.throttle = function(func, wait, options) {
681 var context, args, result;
681 var context, args, result;
682 var timeout = null;
682 var timeout = null;
683 var previous = 0;
683 var previous = 0;
684 options || (options = {});
684 options || (options = {});
685 var later = function() {
685 var later = function() {
686 previous = options.leading === false ? 0 : _.now();
686 previous = options.leading === false ? 0 : _.now();
687 timeout = null;
687 timeout = null;
688 result = func.apply(context, args);
688 result = func.apply(context, args);
689 context = args = null;
689 context = args = null;
690 };
690 };
691 return function() {
691 return function() {
692 var now = _.now();
692 var now = _.now();
693 if (!previous && options.leading === false) previous = now;
693 if (!previous && options.leading === false) previous = now;
694 var remaining = wait - (now - previous);
694 var remaining = wait - (now - previous);
695 context = this;
695 context = this;
696 args = arguments;
696 args = arguments;
697 if (remaining <= 0) {
697 if (remaining <= 0) {
698 clearTimeout(timeout);
698 clearTimeout(timeout);
699 timeout = null;
699 timeout = null;
700 previous = now;
700 previous = now;
701 result = func.apply(context, args);
701 result = func.apply(context, args);
702 context = args = null;
702 context = args = null;
703 } else if (!timeout && options.trailing !== false) {
703 } else if (!timeout && options.trailing !== false) {
704 timeout = setTimeout(later, remaining);
704 timeout = setTimeout(later, remaining);
705 }
705 }
706 return result;
706 return result;
707 };
707 };
708 };
708 };
709
709
710 // Returns a function, that, as long as it continues to be invoked, will not
710 // Returns a function, that, as long as it continues to be invoked, will not
711 // be triggered. The function will be called after it stops being called for
711 // be triggered. The function will be called after it stops being called for
712 // N milliseconds. If `immediate` is passed, trigger the function on the
712 // N milliseconds. If `immediate` is passed, trigger the function on the
713 // leading edge, instead of the trailing.
713 // leading edge, instead of the trailing.
714 _.debounce = function(func, wait, immediate) {
714 _.debounce = function(func, wait, immediate) {
715 var timeout, args, context, timestamp, result;
715 var timeout, args, context, timestamp, result;
716
716
717 var later = function() {
717 var later = function() {
718 var last = _.now() - timestamp;
718 var last = _.now() - timestamp;
719 if (last < wait) {
719 if (last < wait) {
720 timeout = setTimeout(later, wait - last);
720 timeout = setTimeout(later, wait - last);
721 } else {
721 } else {
722 timeout = null;
722 timeout = null;
723 if (!immediate) {
723 if (!immediate) {
724 result = func.apply(context, args);
724 result = func.apply(context, args);
725 context = args = null;
725 context = args = null;
726 }
726 }
727 }
727 }
728 };
728 };
729
729
730 return function() {
730 return function() {
731 context = this;
731 context = this;
732 args = arguments;
732 args = arguments;
733 timestamp = _.now();
733 timestamp = _.now();
734 var callNow = immediate && !timeout;
734 var callNow = immediate && !timeout;
735 if (!timeout) {
735 if (!timeout) {
736 timeout = setTimeout(later, wait);
736 timeout = setTimeout(later, wait);
737 }
737 }
738 if (callNow) {
738 if (callNow) {
739 result = func.apply(context, args);
739 result = func.apply(context, args);
740 context = args = null;
740 context = args = null;
741 }
741 }
742
742
743 return result;
743 return result;
744 };
744 };
745 };
745 };
746
746
747 // Returns a function that will be executed at most one time, no matter how
747 // Returns a function that will be executed at most one time, no matter how
748 // often you call it. Useful for lazy initialization.
748 // often you call it. Useful for lazy initialization.
749 _.once = function(func) {
749 _.once = function(func) {
750 var ran = false, memo;
750 var ran = false, memo;
751 return function() {
751 return function() {
752 if (ran) return memo;
752 if (ran) return memo;
753 ran = true;
753 ran = true;
754 memo = func.apply(this, arguments);
754 memo = func.apply(this, arguments);
755 func = null;
755 func = null;
756 return memo;
756 return memo;
757 };
757 };
758 };
758 };
759
759
760 // Returns the first function passed as an argument to the second,
760 // Returns the first function passed as an argument to the second,
761 // allowing you to adjust arguments, run code before and after, and
761 // allowing you to adjust arguments, run code before and after, and
762 // conditionally execute the original function.
762 // conditionally execute the original function.
763 _.wrap = function(func, wrapper) {
763 _.wrap = function(func, wrapper) {
764 return _.partial(wrapper, func);
764 return _.partial(wrapper, func);
765 };
765 };
766
766
767 // Returns a function that is the composition of a list of functions, each
767 // Returns a function that is the composition of a list of functions, each
768 // consuming the return value of the function that follows.
768 // consuming the return value of the function that follows.
769 _.compose = function() {
769 _.compose = function() {
770 var funcs = arguments;
770 var funcs = arguments;
771 return function() {
771 return function() {
772 var args = arguments;
772 var args = arguments;
773 for (var i = funcs.length - 1; i >= 0; i--) {
773 for (var i = funcs.length - 1; i >= 0; i--) {
774 args = [funcs[i].apply(this, args)];
774 args = [funcs[i].apply(this, args)];
775 }
775 }
776 return args[0];
776 return args[0];
777 };
777 };
778 };
778 };
779
779
780 // Returns a function that will only be executed after being called N times.
780 // Returns a function that will only be executed after being called N times.
781 _.after = function(times, func) {
781 _.after = function(times, func) {
782 return function() {
782 return function() {
783 if (--times < 1) {
783 if (--times < 1) {
784 return func.apply(this, arguments);
784 return func.apply(this, arguments);
785 }
785 }
786 };
786 };
787 };
787 };
788
788
789 // Object Functions
789 // Object Functions
790 // ----------------
790 // ----------------
791
791
792 // Retrieve the names of an object's properties.
792 // Retrieve the names of an object's properties.
793 // Delegates to **ECMAScript 5**'s native `Object.keys`
793 // Delegates to **ECMAScript 5**'s native `Object.keys`
794 _.keys = function(obj) {
794 _.keys = function(obj) {
795 if (!_.isObject(obj)) return [];
795 if (!_.isObject(obj)) return [];
796 if (nativeKeys) return nativeKeys(obj);
796 if (nativeKeys) return nativeKeys(obj);
797 var keys = [];
797 var keys = [];
798 for (var key in obj) if (_.has(obj, key)) keys.push(key);
798 for (var key in obj) if (_.has(obj, key)) keys.push(key);
799 return keys;
799 return keys;
800 };
800 };
801
801
802 // Retrieve the values of an object's properties.
802 // Retrieve the values of an object's properties.
803 _.values = function(obj) {
803 _.values = function(obj) {
804 var keys = _.keys(obj);
804 var keys = _.keys(obj);
805 var length = keys.length;
805 var length = keys.length;
806 var values = new Array(length);
806 var values = new Array(length);
807 for (var i = 0; i < length; i++) {
807 for (var i = 0; i < length; i++) {
808 values[i] = obj[keys[i]];
808 values[i] = obj[keys[i]];
809 }
809 }
810 return values;
810 return values;
811 };
811 };
812
812
813 // Convert an object into a list of `[key, value]` pairs.
813 // Convert an object into a list of `[key, value]` pairs.
814 _.pairs = function(obj) {
814 _.pairs = function(obj) {
815 var keys = _.keys(obj);
815 var keys = _.keys(obj);
816 var length = keys.length;
816 var length = keys.length;
817 var pairs = new Array(length);
817 var pairs = new Array(length);
818 for (var i = 0; i < length; i++) {
818 for (var i = 0; i < length; i++) {
819 pairs[i] = [keys[i], obj[keys[i]]];
819 pairs[i] = [keys[i], obj[keys[i]]];
820 }
820 }
821 return pairs;
821 return pairs;
822 };
822 };
823
823
824 // Invert the keys and values of an object. The values must be serializable.
824 // Invert the keys and values of an object. The values must be serializable.
825 _.invert = function(obj) {
825 _.invert = function(obj) {
826 var result = {};
826 var result = {};
827 var keys = _.keys(obj);
827 var keys = _.keys(obj);
828 for (var i = 0, length = keys.length; i < length; i++) {
828 for (var i = 0, length = keys.length; i < length; i++) {
829 result[obj[keys[i]]] = keys[i];
829 result[obj[keys[i]]] = keys[i];
830 }
830 }
831 return result;
831 return result;
832 };
832 };
833
833
834 // Return a sorted list of the function names available on the object.
834 // Return a sorted list of the function names available on the object.
835 // Aliased as `methods`
835 // Aliased as `methods`
836 _.functions = _.methods = function(obj) {
836 _.functions = _.methods = function(obj) {
837 var names = [];
837 var names = [];
838 for (var key in obj) {
838 for (var key in obj) {
839 if (_.isFunction(obj[key])) names.push(key);
839 if (_.isFunction(obj[key])) names.push(key);
840 }
840 }
841 return names.sort();
841 return names.sort();
842 };
842 };
843
843
844 // Extend a given object with all the properties in passed-in object(s).
844 // Extend a given object with all the properties in passed-in object(s).
845 _.extend = function(obj) {
845 _.extend = function(obj) {
846 each(slice.call(arguments, 1), function(source) {
846 each(slice.call(arguments, 1), function(source) {
847 if (source) {
847 if (source) {
848 for (var prop in source) {
848 for (var prop in source) {
849 obj[prop] = source[prop];
849 obj[prop] = source[prop];
850 }
850 }
851 }
851 }
852 });
852 });
853 return obj;
853 return obj;
854 };
854 };
855
855
856 // Return a copy of the object only containing the whitelisted properties.
856 // Return a copy of the object only containing the whitelisted properties.
857 _.pick = function(obj) {
857 _.pick = function(obj) {
858 var copy = {};
858 var copy = {};
859 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
859 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
860 each(keys, function(key) {
860 each(keys, function(key) {
861 if (key in obj) copy[key] = obj[key];
861 if (key in obj) copy[key] = obj[key];
862 });
862 });
863 return copy;
863 return copy;
864 };
864 };
865
865
866 // Return a copy of the object without the blacklisted properties.
866 // Return a copy of the object without the blacklisted properties.
867 _.omit = function(obj) {
867 _.omit = function(obj) {
868 var copy = {};
868 var copy = {};
869 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
869 var keys = concat.apply(ArrayProto, slice.call(arguments, 1));
870 for (var key in obj) {
870 for (var key in obj) {
871 if (!_.contains(keys, key)) copy[key] = obj[key];
871 if (!_.contains(keys, key)) copy[key] = obj[key];
872 }
872 }
873 return copy;
873 return copy;
874 };
874 };
875
875
876 // Fill in a given object with default properties.
876 // Fill in a given object with default properties.
877 _.defaults = function(obj) {
877 _.defaults = function(obj) {
878 each(slice.call(arguments, 1), function(source) {
878 each(slice.call(arguments, 1), function(source) {
879 if (source) {
879 if (source) {
880 for (var prop in source) {
880 for (var prop in source) {
881 if (obj[prop] === void 0) obj[prop] = source[prop];
881 if (obj[prop] === void 0) obj[prop] = source[prop];
882 }
882 }
883 }
883 }
884 });
884 });
885 return obj;
885 return obj;
886 };
886 };
887
887
888 // Create a (shallow-cloned) duplicate of an object.
888 // Create a (shallow-cloned) duplicate of an object.
889 _.clone = function(obj) {
889 _.clone = function(obj) {
890 if (!_.isObject(obj)) return obj;
890 if (!_.isObject(obj)) return obj;
891 return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
891 return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
892 };
892 };
893
893
894 // Invokes interceptor with the obj, and then returns obj.
894 // Invokes interceptor with the obj, and then returns obj.
895 // The primary purpose of this method is to "tap into" a method chain, in
895 // The primary purpose of this method is to "tap into" a method chain, in
896 // order to perform operations on intermediate results within the chain.
896 // order to perform operations on intermediate results within the chain.
897 _.tap = function(obj, interceptor) {
897 _.tap = function(obj, interceptor) {
898 interceptor(obj);
898 interceptor(obj);
899 return obj;
899 return obj;
900 };
900 };
901
901
902 // Internal recursive comparison function for `isEqual`.
902 // Internal recursive comparison function for `isEqual`.
903 var eq = function(a, b, aStack, bStack) {
903 var eq = function(a, b, aStack, bStack) {
904 // Identical objects are equal. `0 === -0`, but they aren't identical.
904 // Identical objects are equal. `0 === -0`, but they aren't identical.
905 // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
905 // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
906 if (a === b) return a !== 0 || 1 / a == 1 / b;
906 if (a === b) return a !== 0 || 1 / a == 1 / b;
907 // A strict comparison is necessary because `null == undefined`.
907 // A strict comparison is necessary because `null == undefined`.
908 if (a == null || b == null) return a === b;
908 if (a == null || b == null) return a === b;
909 // Unwrap any wrapped objects.
909 // Unwrap any wrapped objects.
910 if (a instanceof _) a = a._wrapped;
910 if (a instanceof _) a = a._wrapped;
911 if (b instanceof _) b = b._wrapped;
911 if (b instanceof _) b = b._wrapped;
912 // Compare `[[Class]]` names.
912 // Compare `[[Class]]` names.
913 var className = toString.call(a);
913 var className = toString.call(a);
914 if (className != toString.call(b)) return false;
914 if (className != toString.call(b)) return false;
915 switch (className) {
915 switch (className) {
916 // Strings, numbers, dates, and booleans are compared by value.
916 // Strings, numbers, dates, and booleans are compared by value.
917 case '[object String]':
917 case '[object String]':
918 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
918 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
919 // equivalent to `new String("5")`.
919 // equivalent to `new String("5")`.
920 return a == String(b);
920 return a == String(b);
921 case '[object Number]':
921 case '[object Number]':
922 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
922 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
923 // other numeric values.
923 // other numeric values.
924 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
924 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
925 case '[object Date]':
925 case '[object Date]':
926 case '[object Boolean]':
926 case '[object Boolean]':
927 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
927 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
928 // millisecond representations. Note that invalid dates with millisecond representations
928 // millisecond representations. Note that invalid dates with millisecond representations
929 // of `NaN` are not equivalent.
929 // of `NaN` are not equivalent.
930 return +a == +b;
930 return +a == +b;
931 // RegExps are compared by their source patterns and flags.
931 // RegExps are compared by their source patterns and flags.
932 case '[object RegExp]':
932 case '[object RegExp]':
933 return a.source == b.source &&
933 return a.source == b.source &&
934 a.global == b.global &&
934 a.global == b.global &&
935 a.multiline == b.multiline &&
935 a.multiline == b.multiline &&
936 a.ignoreCase == b.ignoreCase;
936 a.ignoreCase == b.ignoreCase;
937 }
937 }
938 if (typeof a != 'object' || typeof b != 'object') return false;
938 if (typeof a != 'object' || typeof b != 'object') return false;
939 // Assume equality for cyclic structures. The algorithm for detecting cyclic
939 // Assume equality for cyclic structures. The algorithm for detecting cyclic
940 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
940 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
941 var length = aStack.length;
941 var length = aStack.length;
942 while (length--) {
942 while (length--) {
943 // Linear search. Performance is inversely proportional to the number of
943 // Linear search. Performance is inversely proportional to the number of
944 // unique nested structures.
944 // unique nested structures.
945 if (aStack[length] == a) return bStack[length] == b;
945 if (aStack[length] == a) return bStack[length] == b;
946 }
946 }
947 // Objects with different constructors are not equivalent, but `Object`s
947 // Objects with different constructors are not equivalent, but `Object`s
948 // from different frames are.
948 // from different frames are.
949 var aCtor = a.constructor, bCtor = b.constructor;
949 var aCtor = a.constructor, bCtor = b.constructor;
950 if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
950 if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) &&
951 _.isFunction(bCtor) && (bCtor instanceof bCtor))
951 _.isFunction(bCtor) && (bCtor instanceof bCtor))
952 && ('constructor' in a && 'constructor' in b)) {
952 && ('constructor' in a && 'constructor' in b)) {
953 return false;
953 return false;
954 }
954 }
955 // Add the first object to the stack of traversed objects.
955 // Add the first object to the stack of traversed objects.
956 aStack.push(a);
956 aStack.push(a);
957 bStack.push(b);
957 bStack.push(b);
958 var size = 0, result = true;
958 var size = 0, result = true;
959 // Recursively compare objects and arrays.
959 // Recursively compare objects and arrays.
960 if (className == '[object Array]') {
960 if (className == '[object Array]') {
961 // Compare array lengths to determine if a deep comparison is necessary.
961 // Compare array lengths to determine if a deep comparison is necessary.
962 size = a.length;
962 size = a.length;
963 result = size == b.length;
963 result = size == b.length;
964 if (result) {
964 if (result) {
965 // Deep compare the contents, ignoring non-numeric properties.
965 // Deep compare the contents, ignoring non-numeric properties.
966 while (size--) {
966 while (size--) {
967 if (!(result = eq(a[size], b[size], aStack, bStack))) break;
967 if (!(result = eq(a[size], b[size], aStack, bStack))) break;
968 }
968 }
969 }
969 }
970 } else {
970 } else {
971 // Deep compare objects.
971 // Deep compare objects.
972 for (var key in a) {
972 for (var key in a) {
973 if (_.has(a, key)) {
973 if (_.has(a, key)) {
974 // Count the expected number of properties.
974 // Count the expected number of properties.
975 size++;
975 size++;
976 // Deep compare each member.
976 // Deep compare each member.
977 if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
977 if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break;
978 }
978 }
979 }
979 }
980 // Ensure that both objects contain the same number of properties.
980 // Ensure that both objects contain the same number of properties.
981 if (result) {
981 if (result) {
982 for (key in b) {
982 for (key in b) {
983 if (_.has(b, key) && !(size--)) break;
983 if (_.has(b, key) && !(size--)) break;
984 }
984 }
985 result = !size;
985 result = !size;
986 }
986 }
987 }
987 }
988 // Remove the first object from the stack of traversed objects.
988 // Remove the first object from the stack of traversed objects.
989 aStack.pop();
989 aStack.pop();
990 bStack.pop();
990 bStack.pop();
991 return result;
991 return result;
992 };
992 };
993
993
994 // Perform a deep comparison to check if two objects are equal.
994 // Perform a deep comparison to check if two objects are equal.
995 _.isEqual = function(a, b) {
995 _.isEqual = function(a, b) {
996 return eq(a, b, [], []);
996 return eq(a, b, [], []);
997 };
997 };
998
998
999 // Is a given array, string, or object empty?
999 // Is a given array, string, or object empty?
1000 // An "empty" object has no enumerable own-properties.
1000 // An "empty" object has no enumerable own-properties.
1001 _.isEmpty = function(obj) {
1001 _.isEmpty = function(obj) {
1002 if (obj == null) return true;
1002 if (obj == null) return true;
1003 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
1003 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
1004 for (var key in obj) if (_.has(obj, key)) return false;
1004 for (var key in obj) if (_.has(obj, key)) return false;
1005 return true;
1005 return true;
1006 };
1006 };
1007
1007
1008 // Is a given value a DOM element?
1008 // Is a given value a DOM element?
1009 _.isElement = function(obj) {
1009 _.isElement = function(obj) {
1010 return !!(obj && obj.nodeType === 1);
1010 return !!(obj && obj.nodeType === 1);
1011 };
1011 };
1012
1012
1013 // Is a given value an array?
1013 // Is a given value an array?
1014 // Delegates to ECMA5's native Array.isArray
1014 // Delegates to ECMA5's native Array.isArray
1015 _.isArray = nativeIsArray || function(obj) {
1015 _.isArray = nativeIsArray || function(obj) {
1016 return toString.call(obj) == '[object Array]';
1016 return toString.call(obj) == '[object Array]';
1017 };
1017 };
1018
1018
1019 // Is a given variable an object?
1019 // Is a given variable an object?
1020 _.isObject = function(obj) {
1020 _.isObject = function(obj) {
1021 return obj === Object(obj);
1021 return obj === Object(obj);
1022 };
1022 };
1023
1023
1024 // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
1024 // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp.
1025 each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
1025 each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) {
1026 _['is' + name] = function(obj) {
1026 _['is' + name] = function(obj) {
1027 return toString.call(obj) == '[object ' + name + ']';
1027 return toString.call(obj) == '[object ' + name + ']';
1028 };
1028 };
1029 });
1029 });
1030
1030
1031 // Define a fallback version of the method in browsers (ahem, IE), where
1031 // Define a fallback version of the method in browsers (ahem, IE), where
1032 // there isn't any inspectable "Arguments" type.
1032 // there isn't any inspectable "Arguments" type.
1033 if (!_.isArguments(arguments)) {
1033 if (!_.isArguments(arguments)) {
1034 _.isArguments = function(obj) {
1034 _.isArguments = function(obj) {
1035 return !!(obj && _.has(obj, 'callee'));
1035 return !!(obj && _.has(obj, 'callee'));
1036 };
1036 };
1037 }
1037 }
1038
1038
1039 // Optimize `isFunction` if appropriate.
1039 // Optimize `isFunction` if appropriate.
1040 if (typeof (/./) !== 'function') {
1040 if (typeof (/./) !== 'function') {
1041 _.isFunction = function(obj) {
1041 _.isFunction = function(obj) {
1042 return typeof obj === 'function';
1042 return typeof obj === 'function';
1043 };
1043 };
1044 }
1044 }
1045
1045
1046 // Is a given object a finite number?
1046 // Is a given object a finite number?
1047 _.isFinite = function(obj) {
1047 _.isFinite = function(obj) {
1048 return isFinite(obj) && !isNaN(parseFloat(obj));
1048 return isFinite(obj) && !isNaN(parseFloat(obj));
1049 };
1049 };
1050
1050
1051 // Is the given value `NaN`? (NaN is the only number which does not equal itself).
1051 // Is the given value `NaN`? (NaN is the only number which does not equal itself).
1052 _.isNaN = function(obj) {
1052 _.isNaN = function(obj) {
1053 return _.isNumber(obj) && obj != +obj;
1053 return _.isNumber(obj) && obj != +obj;
1054 };
1054 };
1055
1055
1056 // Is a given value a boolean?
1056 // Is a given value a boolean?
1057 _.isBoolean = function(obj) {
1057 _.isBoolean = function(obj) {
1058 return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
1058 return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
1059 };
1059 };
1060
1060
1061 // Is a given value equal to null?
1061 // Is a given value equal to null?
1062 _.isNull = function(obj) {
1062 _.isNull = function(obj) {
1063 return obj === null;
1063 return obj === null;
1064 };
1064 };
1065
1065
1066 // Is a given variable undefined?
1066 // Is a given variable undefined?
1067 _.isUndefined = function(obj) {
1067 _.isUndefined = function(obj) {
1068 return obj === void 0;
1068 return obj === void 0;
1069 };
1069 };
1070
1070
1071 // Shortcut function for checking if an object has a given property directly
1071 // Shortcut function for checking if an object has a given property directly
1072 // on itself (in other words, not on a prototype).
1072 // on itself (in other words, not on a prototype).
1073 _.has = function(obj, key) {
1073 _.has = function(obj, key) {
1074 return hasOwnProperty.call(obj, key);
1074 return hasOwnProperty.call(obj, key);
1075 };
1075 };
1076
1076
1077 // Utility Functions
1077 // Utility Functions
1078 // -----------------
1078 // -----------------
1079
1079
1080 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
1080 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
1081 // previous owner. Returns a reference to the Underscore object.
1081 // previous owner. Returns a reference to the Underscore object.
1082 _.noConflict = function() {
1082 _.noConflict = function() {
1083 root._ = previousUnderscore;
1083 root._ = previousUnderscore;
1084 return this;
1084 return this;
1085 };
1085 };
1086
1086
1087 // Keep the identity function around for default iterators.
1087 // Keep the identity function around for default iterators.
1088 _.identity = function(value) {
1088 _.identity = function(value) {
1089 return value;
1089 return value;
1090 };
1090 };
1091
1091
1092 _.constant = function(value) {
1092 _.constant = function(value) {
1093 return function () {
1093 return function () {
1094 return value;
1094 return value;
1095 };
1095 };
1096 };
1096 };
1097
1097
1098 _.property = function(key) {
1098 _.property = function(key) {
1099 return function(obj) {
1099 return function(obj) {
1100 return obj[key];
1100 return obj[key];
1101 };
1101 };
1102 };
1102 };
1103
1103
1104 // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
1104 // Returns a predicate for checking whether an object has a given set of `key:value` pairs.
1105 _.matches = function(attrs) {
1105 _.matches = function(attrs) {
1106 return function(obj) {
1106 return function(obj) {
1107 if (obj === attrs) return true; //avoid comparing an object to itself.
1107 if (obj === attrs) return true; //avoid comparing an object to itself.
1108 for (var key in attrs) {
1108 for (var key in attrs) {
1109 if (attrs[key] !== obj[key])
1109 if (attrs[key] !== obj[key])
1110 return false;
1110 return false;
1111 }
1111 }
1112 return true;
1112 return true;
1113 }
1113 }
1114 };
1114 };
1115
1115
1116 // Run a function **n** times.
1116 // Run a function **n** times.
1117 _.times = function(n, iterator, context) {
1117 _.times = function(n, iterator, context) {
1118 var accum = Array(Math.max(0, n));
1118 var accum = Array(Math.max(0, n));
1119 for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
1119 for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i);
1120 return accum;
1120 return accum;
1121 };
1121 };
1122
1122
1123 // Return a random integer between min and max (inclusive).
1123 // Return a random integer between min and max (inclusive).
1124 _.random = function(min, max) {
1124 _.random = function(min, max) {
1125 if (max == null) {
1125 if (max == null) {
1126 max = min;
1126 max = min;
1127 min = 0;
1127 min = 0;
1128 }
1128 }
1129 return min + Math.floor(Math.random() * (max - min + 1));
1129 return min + Math.floor(Math.random() * (max - min + 1));
1130 };
1130 };
1131
1131
1132 // A (possibly faster) way to get the current timestamp as an integer.
1132 // A (possibly faster) way to get the current timestamp as an integer.
1133 _.now = Date.now || function() { return new Date().getTime(); };
1133 _.now = Date.now || function() { return new Date().getTime(); };
1134
1134
1135 // List of HTML entities for escaping.
1135 // List of HTML entities for escaping.
1136 var entityMap = {
1136 var entityMap = {
1137 escape: {
1137 escape: {
1138 '&': '&amp;',
1138 '&': '&amp;',
1139 '<': '&lt;',
1139 '<': '&lt;',
1140 '>': '&gt;',
1140 '>': '&gt;',
1141 '"': '&quot;',
1141 '"': '&quot;',
1142 "'": '&#x27;'
1142 "'": '&#x27;'
1143 }
1143 }
1144 };
1144 };
1145 entityMap.unescape = _.invert(entityMap.escape);
1145 entityMap.unescape = _.invert(entityMap.escape);
1146
1146
1147 // Regexes containing the keys and values listed immediately above.
1147 // Regexes containing the keys and values listed immediately above.
1148 var entityRegexes = {
1148 var entityRegexes = {
1149 escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
1149 escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'),
1150 unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
1150 unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g')
1151 };
1151 };
1152
1152
1153 // Functions for escaping and unescaping strings to/from HTML interpolation.
1153 // Functions for escaping and unescaping strings to/from HTML interpolation.
1154 _.each(['escape', 'unescape'], function(method) {
1154 _.each(['escape', 'unescape'], function(method) {
1155 _[method] = function(string) {
1155 _[method] = function(string) {
1156 if (string == null) return '';
1156 if (string == null) return '';
1157 return ('' + string).replace(entityRegexes[method], function(match) {
1157 return ('' + string).replace(entityRegexes[method], function(match) {
1158 return entityMap[method][match];
1158 return entityMap[method][match];
1159 });
1159 });
1160 };
1160 };
1161 });
1161 });
1162
1162
1163 // If the value of the named `property` is a function then invoke it with the
1163 // If the value of the named `property` is a function then invoke it with the
1164 // `object` as context; otherwise, return it.
1164 // `object` as context; otherwise, return it.
1165 _.result = function(object, property) {
1165 _.result = function(object, property) {
1166 if (object == null) return void 0;
1166 if (object == null) return void 0;
1167 var value = object[property];
1167 var value = object[property];
1168 return _.isFunction(value) ? value.call(object) : value;
1168 return _.isFunction(value) ? value.call(object) : value;
1169 };
1169 };
1170
1170
1171 // Add your own custom functions to the Underscore object.
1171 // Add your own custom functions to the Underscore object.
1172 _.mixin = function(obj) {
1172 _.mixin = function(obj) {
1173 each(_.functions(obj), function(name) {
1173 each(_.functions(obj), function(name) {
1174 var func = _[name] = obj[name];
1174 var func = _[name] = obj[name];
1175 _.prototype[name] = function() {
1175 _.prototype[name] = function() {
1176 var args = [this._wrapped];
1176 var args = [this._wrapped];
1177 push.apply(args, arguments);
1177 push.apply(args, arguments);
1178 return result.call(this, func.apply(_, args));
1178 return result.call(this, func.apply(_, args));
1179 };
1179 };
1180 });
1180 });
1181 };
1181 };
1182
1182
1183 // Generate a unique integer id (unique within the entire client session).
1183 // Generate a unique integer id (unique within the entire client session).
1184 // Useful for temporary DOM ids.
1184 // Useful for temporary DOM ids.
1185 var idCounter = 0;
1185 var idCounter = 0;
1186 _.uniqueId = function(prefix) {
1186 _.uniqueId = function(prefix) {
1187 var id = ++idCounter + '';
1187 var id = ++idCounter + '';
1188 return prefix ? prefix + id : id;
1188 return prefix ? prefix + id : id;
1189 };
1189 };
1190
1190
1191 // By default, Underscore uses ERB-style template delimiters, change the
1191 // By default, Underscore uses ERB-style template delimiters, change the
1192 // following template settings to use alternative delimiters.
1192 // following template settings to use alternative delimiters.
1193 _.templateSettings = {
1193 _.templateSettings = {
1194 evaluate : /<%([\s\S]+?)%>/g,
1194 evaluate : /<%([\s\S]+?)%>/g,
1195 interpolate : /<%=([\s\S]+?)%>/g,
1195 interpolate : /<%=([\s\S]+?)%>/g,
1196 escape : /<%-([\s\S]+?)%>/g
1196 escape : /<%-([\s\S]+?)%>/g
1197 };
1197 };
1198
1198
1199 // When customizing `templateSettings`, if you don't want to define an
1199 // When customizing `templateSettings`, if you don't want to define an
1200 // interpolation, evaluation or escaping regex, we need one that is
1200 // interpolation, evaluation or escaping regex, we need one that is
1201 // guaranteed not to match.
1201 // guaranteed not to match.
1202 var noMatch = /(.)^/;
1202 var noMatch = /(.)^/;
1203
1203
1204 // Certain characters need to be escaped so that they can be put into a
1204 // Certain characters need to be escaped so that they can be put into a
1205 // string literal.
1205 // string literal.
1206 var escapes = {
1206 var escapes = {
1207 "'": "'",
1207 "'": "'",
1208 '\\': '\\',
1208 '\\': '\\',
1209 '\r': 'r',
1209 '\r': 'r',
1210 '\n': 'n',
1210 '\n': 'n',
1211 '\t': 't',
1211 '\t': 't',
1212 '\u2028': 'u2028',
1212 '\u2028': 'u2028',
1213 '\u2029': 'u2029'
1213 '\u2029': 'u2029'
1214 };
1214 };
1215
1215
1216 var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
1216 var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g;
1217
1217
1218 // JavaScript micro-templating, similar to John Resig's implementation.
1218 // JavaScript micro-templating, similar to John Resig's implementation.
1219 // Underscore templating handles arbitrary delimiters, preserves whitespace,
1219 // Underscore templating handles arbitrary delimiters, preserves whitespace,
1220 // and correctly escapes quotes within interpolated code.
1220 // and correctly escapes quotes within interpolated code.
1221 _.template = function(text, data, settings) {
1221 _.template = function(text, data, settings) {
1222 var render;
1222 var render;
1223 settings = _.defaults({}, settings, _.templateSettings);
1223 settings = _.defaults({}, settings, _.templateSettings);
1224
1224
1225 // Combine delimiters into one regular expression via alternation.
1225 // Combine delimiters into one regular expression via alternation.
1226 var matcher = new RegExp([
1226 var matcher = new RegExp([
1227 (settings.escape || noMatch).source,
1227 (settings.escape || noMatch).source,
1228 (settings.interpolate || noMatch).source,
1228 (settings.interpolate || noMatch).source,
1229 (settings.evaluate || noMatch).source
1229 (settings.evaluate || noMatch).source
1230 ].join('|') + '|$', 'g');
1230 ].join('|') + '|$', 'g');
1231
1231
1232 // Compile the template source, escaping string literals appropriately.
1232 // Compile the template source, escaping string literals appropriately.
1233 var index = 0;
1233 var index = 0;
1234 var source = "__p+='";
1234 var source = "__p+='";
1235 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
1235 text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
1236 source += text.slice(index, offset)
1236 source += text.slice(index, offset)
1237 .replace(escaper, function(match) { return '\\' + escapes[match]; });
1237 .replace(escaper, function(match) { return '\\' + escapes[match]; });
1238
1238
1239 if (escape) {
1239 if (escape) {
1240 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
1240 source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
1241 }
1241 }
1242 if (interpolate) {
1242 if (interpolate) {
1243 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
1243 source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
1244 }
1244 }
1245 if (evaluate) {
1245 if (evaluate) {
1246 source += "';\n" + evaluate + "\n__p+='";
1246 source += "';\n" + evaluate + "\n__p+='";
1247 }
1247 }
1248 index = offset + match.length;
1248 index = offset + match.length;
1249 return match;
1249 return match;
1250 });
1250 });
1251 source += "';\n";
1251 source += "';\n";
1252
1252
1253 // If a variable is not specified, place data values in local scope.
1253 // If a variable is not specified, place data values in local scope.
1254 if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
1254 if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n';
1255
1255
1256 source = "var __t,__p='',__j=Array.prototype.join," +
1256 source = "var __t,__p='',__j=Array.prototype.join," +
1257 "print=function(){__p+=__j.call(arguments,'');};\n" +
1257 "print=function(){__p+=__j.call(arguments,'');};\n" +
1258 source + "return __p;\n";
1258 source + "return __p;\n";
1259
1259
1260 try {
1260 try {
1261 render = new Function(settings.variable || 'obj', '_', source);
1261 render = new Function(settings.variable || 'obj', '_', source);
1262 } catch (e) {
1262 } catch (e) {
1263 e.source = source;
1263 e.source = source;
1264 throw e;
1264 throw e;
1265 }
1265 }
1266
1266
1267 if (data) return render(data, _);
1267 if (data) return render(data, _);
1268 var template = function(data) {
1268 var template = function(data) {
1269 return render.call(this, data, _);
1269 return render.call(this, data, _);
1270 };
1270 };
1271
1271
1272 // Provide the compiled function source as a convenience for precompilation.
1272 // Provide the compiled function source as a convenience for precompilation.
1273 template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
1273 template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}';
1274
1274
1275 return template;
1275 return template;
1276 };
1276 };
1277
1277
1278 // Add a "chain" function, which will delegate to the wrapper.
1278 // Add a "chain" function, which will delegate to the wrapper.
1279 _.chain = function(obj) {
1279 _.chain = function(obj) {
1280 return _(obj).chain();
1280 return _(obj).chain();
1281 };
1281 };
1282
1282
1283 // OOP
1283 // OOP
1284 // ---------------
1284 // ---------------
1285 // If Underscore is called as a function, it returns a wrapped object that
1285 // If Underscore is called as a function, it returns a wrapped object that
1286 // can be used OO-style. This wrapper holds altered versions of all the
1286 // can be used OO-style. This wrapper holds altered versions of all the
1287 // underscore functions. Wrapped objects may be chained.
1287 // underscore functions. Wrapped objects may be chained.
1288
1288
1289 // Helper function to continue chaining intermediate results.
1289 // Helper function to continue chaining intermediate results.
1290 var result = function(obj) {
1290 var result = function(obj) {
1291 return this._chain ? _(obj).chain() : obj;
1291 return this._chain ? _(obj).chain() : obj;
1292 };
1292 };
1293
1293
1294 // Add all of the Underscore functions to the wrapper object.
1294 // Add all of the Underscore functions to the wrapper object.
1295 _.mixin(_);
1295 _.mixin(_);
1296
1296
1297 // Add all mutator Array functions to the wrapper.
1297 // Add all mutator Array functions to the wrapper.
1298 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
1298 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
1299 var method = ArrayProto[name];
1299 var method = ArrayProto[name];
1300 _.prototype[name] = function() {
1300 _.prototype[name] = function() {
1301 var obj = this._wrapped;
1301 var obj = this._wrapped;
1302 method.apply(obj, arguments);
1302 method.apply(obj, arguments);
1303 if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
1303 if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0];
1304 return result.call(this, obj);
1304 return result.call(this, obj);
1305 };
1305 };
1306 });
1306 });
1307
1307
1308 // Add all accessor Array functions to the wrapper.
1308 // Add all accessor Array functions to the wrapper.
1309 each(['concat', 'join', 'slice'], function(name) {
1309 each(['concat', 'join', 'slice'], function(name) {
1310 var method = ArrayProto[name];
1310 var method = ArrayProto[name];
1311 _.prototype[name] = function() {
1311 _.prototype[name] = function() {
1312 return result.call(this, method.apply(this._wrapped, arguments));
1312 return result.call(this, method.apply(this._wrapped, arguments));
1313 };
1313 };
1314 });
1314 });
1315
1315
1316 _.extend(_.prototype, {
1316 _.extend(_.prototype, {
1317
1317
1318 // Start chaining a wrapped Underscore object.
1318 // Start chaining a wrapped Underscore object.
1319 chain: function() {
1319 chain: function() {
1320 this._chain = true;
1320 this._chain = true;
1321 return this;
1321 return this;
1322 },
1322 },
1323
1323
1324 // Extracts the result from a wrapped and chained object.
1324 // Extracts the result from a wrapped and chained object.
1325 value: function() {
1325 value: function() {
1326 return this._wrapped;
1326 return this._wrapped;
1327 }
1327 }
1328
1328
1329 });
1329 });
1330
1330
1331 // AMD registration happens at the end for compatibility with AMD loaders
1331 // AMD registration happens at the end for compatibility with AMD loaders
1332 // that may not enforce next-turn semantics on modules. Even though general
1332 // that may not enforce next-turn semantics on modules. Even though general
1333 // practice for AMD registration is to be anonymous, underscore registers
1333 // practice for AMD registration is to be anonymous, underscore registers
1334 // as a named module because, like jQuery, it is a base library that is
1334 // as a named module because, like jQuery, it is a base library that is
1335 // popular enough to be bundled in a third party lib, but not be part of
1335 // popular enough to be bundled in a third party lib, but not be part of
1336 // an AMD load request. Those cases could generate an error when an
1336 // an AMD load request. Those cases could generate an error when an
1337 // anonymous define() is called outside of a loader request.
1337 // anonymous define() is called outside of a loader request.
1338 if (typeof define === 'function' && define.amd) {
1338 if (typeof define === 'function' && define.amd) {
1339 define('underscore', [], function() {
1339 define('underscore', [], function() {
1340 return _;
1340 return _;
1341 });
1341 });
1342 }
1342 }
1343 }).call(this);
1343 }).call(this);
1344
1344
1345 ;/*
1345 ;/*
1346 AngularJS v1.5.5
1346 AngularJS v1.5.5
1347 (c) 2010-2016 Google, Inc. http://angularjs.org
1347 (c) 2010-2016 Google, Inc. http://angularjs.org
1348 License: MIT
1348 License: MIT
1349 */
1349 */
1350 (function(v){'use strict';function O(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.5/"+(a?a+"/":"")+b;for(b=1;b<arguments.length;b++){d=d+(1==b?"?":"&")+"p"+(b-1)+"=";var c=encodeURIComponent,e;e=arguments[b];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;d+=c(e)}return Error(d)}}function ya(a){if(null==a||Va(a))return!1;if(K(a)||F(a)||B&&a instanceof B)return!0;
1350 (function(v){'use strict';function O(a){return function(){var b=arguments[0],d;d="["+(a?a+":":"")+b+"] http://errors.angularjs.org/1.5.5/"+(a?a+"/":"")+b;for(b=1;b<arguments.length;b++){d=d+(1==b?"?":"&")+"p"+(b-1)+"=";var c=encodeURIComponent,e;e=arguments[b];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;d+=c(e)}return Error(d)}}function ya(a){if(null==a||Va(a))return!1;if(K(a)||F(a)||B&&a instanceof B)return!0;
1351 var b="length"in Object(a)&&a.length;return Q(b)&&(0<=b&&(b-1 in a||a instanceof Array)||"function"==typeof a.item)}function q(a,b,d){var c,e;if(a)if(E(a))for(c in a)"prototype"==c||"length"==c||"name"==c||a.hasOwnProperty&&!a.hasOwnProperty(c)||b.call(d,a[c],c,a);else if(K(a)||ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==q)a.forEach(b,d,a);else if(oc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&
1351 var b="length"in Object(a)&&a.length;return Q(b)&&(0<=b&&(b-1 in a||a instanceof Array)||"function"==typeof a.item)}function q(a,b,d){var c,e;if(a)if(E(a))for(c in a)"prototype"==c||"length"==c||"name"==c||a.hasOwnProperty&&!a.hasOwnProperty(c)||b.call(d,a[c],c,a);else if(K(a)||ya(a)){var f="object"!==typeof a;c=0;for(e=a.length;c<e;c++)(f||c in a)&&b.call(d,a[c],c,a)}else if(a.forEach&&a.forEach!==q)a.forEach(b,d,a);else if(oc(a))for(c in a)b.call(d,a[c],c,a);else if("function"===typeof a.hasOwnProperty)for(c in a)a.hasOwnProperty(c)&&
1352 b.call(d,a[c],c,a);else for(c in a)ua.call(a,c)&&b.call(d,a[c],c,a);return a}function pc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function qc(a){return function(b,d){a(d,b)}}function Xd(){return++nb}function Nb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(G(g)||E(g))for(var h=Object.keys(g),k=0,l=h.length;k<l;k++){var n=h[k],m=g[n];d&&G(m)?fa(m)?a[n]=new Date(m.valueOf()):Wa(m)?a[n]=new RegExp(m):m.nodeName?a[n]=m.cloneNode(!0):
1352 b.call(d,a[c],c,a);else for(c in a)ua.call(a,c)&&b.call(d,a[c],c,a);return a}function pc(a,b,d){for(var c=Object.keys(a).sort(),e=0;e<c.length;e++)b.call(d,a[c[e]],c[e]);return c}function qc(a){return function(b,d){a(d,b)}}function Xd(){return++nb}function Nb(a,b,d){for(var c=a.$$hashKey,e=0,f=b.length;e<f;++e){var g=b[e];if(G(g)||E(g))for(var h=Object.keys(g),k=0,l=h.length;k<l;k++){var n=h[k],m=g[n];d&&G(m)?fa(m)?a[n]=new Date(m.valueOf()):Wa(m)?a[n]=new RegExp(m):m.nodeName?a[n]=m.cloneNode(!0):
1353 Ob(m)?a[n]=m.clone():(G(a[n])||(a[n]=K(m)?[]:{}),Nb(a[n],[m],!0)):a[n]=m}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function R(a){return Nb(a,za.call(arguments,1),!1)}function Yd(a){return Nb(a,za.call(arguments,1),!0)}function X(a){return parseInt(a,10)}function Pb(a,b){return R(Object.create(a),b)}function C(){}function Xa(a){return a}function da(a){return function(){return a}}function rc(a){return E(a.toString)&&a.toString!==ma}function y(a){return"undefined"===typeof a}function x(a){return"undefined"!==
1353 Ob(m)?a[n]=m.clone():(G(a[n])||(a[n]=K(m)?[]:{}),Nb(a[n],[m],!0)):a[n]=m}}c?a.$$hashKey=c:delete a.$$hashKey;return a}function R(a){return Nb(a,za.call(arguments,1),!1)}function Yd(a){return Nb(a,za.call(arguments,1),!0)}function X(a){return parseInt(a,10)}function Pb(a,b){return R(Object.create(a),b)}function C(){}function Xa(a){return a}function da(a){return function(){return a}}function rc(a){return E(a.toString)&&a.toString!==ma}function y(a){return"undefined"===typeof a}function x(a){return"undefined"!==
1354 typeof a}function G(a){return null!==a&&"object"===typeof a}function oc(a){return null!==a&&"object"===typeof a&&!sc(a)}function F(a){return"string"===typeof a}function Q(a){return"number"===typeof a}function fa(a){return"[object Date]"===ma.call(a)}function E(a){return"function"===typeof a}function Wa(a){return"[object RegExp]"===ma.call(a)}function Va(a){return a&&a.window===a}function Ya(a){return a&&a.$evalAsync&&a.$watch}function Da(a){return"boolean"===typeof a}function Zd(a){return a&&Q(a.length)&&
1354 typeof a}function G(a){return null!==a&&"object"===typeof a}function oc(a){return null!==a&&"object"===typeof a&&!sc(a)}function F(a){return"string"===typeof a}function Q(a){return"number"===typeof a}function fa(a){return"[object Date]"===ma.call(a)}function E(a){return"function"===typeof a}function Wa(a){return"[object RegExp]"===ma.call(a)}function Va(a){return a&&a.window===a}function Ya(a){return a&&a.$evalAsync&&a.$watch}function Da(a){return"boolean"===typeof a}function Zd(a){return a&&Q(a.length)&&
1355 $d.test(ma.call(a))}function Ob(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ae(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function va(a){return P(a.nodeName||a[0]&&a[0].nodeName)}function Za(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function qa(a,b){function d(a,b){var d=b.$$hashKey,e;if(K(a)){e=0;for(var f=a.length;e<f;e++)b.push(c(a[e]))}else if(oc(a))for(e in a)b[e]=c(a[e]);else if(a&&"function"===typeof a.hasOwnProperty)for(e in a)a.hasOwnProperty(e)&&
1355 $d.test(ma.call(a))}function Ob(a){return!(!a||!(a.nodeName||a.prop&&a.attr&&a.find))}function ae(a){var b={};a=a.split(",");var d;for(d=0;d<a.length;d++)b[a[d]]=!0;return b}function va(a){return P(a.nodeName||a[0]&&a[0].nodeName)}function Za(a,b){var d=a.indexOf(b);0<=d&&a.splice(d,1);return d}function qa(a,b){function d(a,b){var d=b.$$hashKey,e;if(K(a)){e=0;for(var f=a.length;e<f;e++)b.push(c(a[e]))}else if(oc(a))for(e in a)b[e]=c(a[e]);else if(a&&"function"===typeof a.hasOwnProperty)for(e in a)a.hasOwnProperty(e)&&
1356 (b[e]=c(a[e]));else for(e in a)ua.call(a,e)&&(b[e]=c(a[e]));d?b.$$hashKey=d:delete b.$$hashKey;return b}function c(a){if(!G(a))return a;var b=f.indexOf(a);if(-1!==b)return g[b];if(Va(a)||Ya(a))throw Aa("cpws");var b=!1,c=e(a);void 0===c&&(c=K(a)?[]:Object.create(sc(a)),b=!0);f.push(a);g.push(c);return b?d(a,c):c}function e(a){switch(ma.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(c(a.buffer));
1356 (b[e]=c(a[e]));else for(e in a)ua.call(a,e)&&(b[e]=c(a[e]));d?b.$$hashKey=d:delete b.$$hashKey;return b}function c(a){if(!G(a))return a;var b=f.indexOf(a);if(-1!==b)return g[b];if(Va(a)||Ya(a))throw Aa("cpws");var b=!1,c=e(a);void 0===c&&(c=K(a)?[]:Object.create(sc(a)),b=!0);f.push(a);g.push(c);return b?d(a,c):c}function e(a){switch(ma.call(a)){case "[object Int8Array]":case "[object Int16Array]":case "[object Int32Array]":case "[object Float32Array]":case "[object Float64Array]":case "[object Uint8Array]":case "[object Uint8ClampedArray]":case "[object Uint16Array]":case "[object Uint32Array]":return new a.constructor(c(a.buffer));
1357 case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(E(a.cloneNode))return a.cloneNode(!0)}var f=[],
1357 case "[object ArrayBuffer]":if(!a.slice){var b=new ArrayBuffer(a.byteLength);(new Uint8Array(b)).set(new Uint8Array(a));return b}return a.slice(0);case "[object Boolean]":case "[object Number]":case "[object String]":case "[object Date]":return new a.constructor(a.valueOf());case "[object RegExp]":return b=new RegExp(a.source,a.toString().match(/[^\/]*$/)[0]),b.lastIndex=a.lastIndex,b;case "[object Blob]":return new a.constructor([a],{type:a.type})}if(E(a.cloneNode))return a.cloneNode(!0)}var f=[],
1358 g=[];if(b){if(Zd(b)||"[object ArrayBuffer]"===ma.call(b))throw Aa("cpta");if(a===b)throw Aa("cpi");K(b)?b.length=0:q(b,function(a,d){"$$hashKey"!==d&&delete b[d]});f.push(a);g.push(b);return d(a,b)}return c(a)}function ha(a,b){if(K(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(G(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function pa(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d==typeof b&&
1358 g=[];if(b){if(Zd(b)||"[object ArrayBuffer]"===ma.call(b))throw Aa("cpta");if(a===b)throw Aa("cpi");K(b)?b.length=0:q(b,function(a,d){"$$hashKey"!==d&&delete b[d]});f.push(a);g.push(b);return d(a,b)}return c(a)}function ha(a,b){if(K(a)){b=b||[];for(var d=0,c=a.length;d<c;d++)b[d]=a[d]}else if(G(a))for(d in b=b||{},a)if("$"!==d.charAt(0)||"$"!==d.charAt(1))b[d]=a[d];return b||a}function pa(a,b){if(a===b)return!0;if(null===a||null===b)return!1;if(a!==a&&b!==b)return!0;var d=typeof a,c;if(d==typeof b&&
1359 "object"==d)if(K(a)){if(!K(b))return!1;if((d=a.length)==b.length){for(c=0;c<d;c++)if(!pa(a[c],b[c]))return!1;return!0}}else{if(fa(a))return fa(b)?pa(a.getTime(),b.getTime()):!1;if(Wa(a))return Wa(b)?a.toString()==b.toString():!1;if(Ya(a)||Ya(b)||Va(a)||Va(b)||K(b)||fa(b)||Wa(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!E(a[c])){if(!pa(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&x(b[c])&&!E(b[c]))return!1;return!0}return!1}function $a(a,b,d){return a.concat(za.call(b,
1359 "object"==d)if(K(a)){if(!K(b))return!1;if((d=a.length)==b.length){for(c=0;c<d;c++)if(!pa(a[c],b[c]))return!1;return!0}}else{if(fa(a))return fa(b)?pa(a.getTime(),b.getTime()):!1;if(Wa(a))return Wa(b)?a.toString()==b.toString():!1;if(Ya(a)||Ya(b)||Va(a)||Va(b)||K(b)||fa(b)||Wa(b))return!1;d=T();for(c in a)if("$"!==c.charAt(0)&&!E(a[c])){if(!pa(a[c],b[c]))return!1;d[c]=!0}for(c in b)if(!(c in d)&&"$"!==c.charAt(0)&&x(b[c])&&!E(b[c]))return!1;return!0}return!1}function $a(a,b,d){return a.concat(za.call(b,
1360 d))}function tc(a,b){var d=2<arguments.length?za.call(arguments,2):[];return!E(b)||b instanceof RegExp?b:d.length?function(){return arguments.length?b.apply(a,$a(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function be(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:Va(b)?d="$WINDOW":b&&v.document===b?d="$DOCUMENT":Ya(b)&&(d="$SCOPE");return d}function ab(a,b){if(!y(a))return Q(b)||(b=b?2:null),JSON.stringify(a,be,
1360 d))}function tc(a,b){var d=2<arguments.length?za.call(arguments,2):[];return!E(b)||b instanceof RegExp?b:d.length?function(){return arguments.length?b.apply(a,$a(d,arguments,0)):b.apply(a,d)}:function(){return arguments.length?b.apply(a,arguments):b.call(a)}}function be(a,b){var d=b;"string"===typeof a&&"$"===a.charAt(0)&&"$"===a.charAt(1)?d=void 0:Va(b)?d="$WINDOW":b&&v.document===b?d="$DOCUMENT":Ya(b)&&(d="$SCOPE");return d}function ab(a,b){if(!y(a))return Q(b)||(b=b?2:null),JSON.stringify(a,be,
1361 b)}function uc(a){return F(a)?JSON.parse(a):a}function vc(a,b){a=a.replace(ce,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+a)/6E4;return isNaN(d)?b:d}function Qb(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=vc(b,c);d*=b-c;a=new Date(a.getTime());a.setMinutes(a.getMinutes()+d);return a}function wa(a){a=B(a).clone();try{a.empty()}catch(b){}var d=B("<div>").append(a).html();try{return a[0].nodeType===Ma?P(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+P(b)})}catch(c){return P(d)}}
1361 b)}function uc(a){return F(a)?JSON.parse(a):a}function vc(a,b){a=a.replace(ce,"");var d=Date.parse("Jan 01, 1970 00:00:00 "+a)/6E4;return isNaN(d)?b:d}function Qb(a,b,d){d=d?-1:1;var c=a.getTimezoneOffset();b=vc(b,c);d*=b-c;a=new Date(a.getTime());a.setMinutes(a.getMinutes()+d);return a}function wa(a){a=B(a).clone();try{a.empty()}catch(b){}var d=B("<div>").append(a).html();try{return a[0].nodeType===Ma?P(d):d.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+P(b)})}catch(c){return P(d)}}
1362 function wc(a){try{return decodeURIComponent(a)}catch(b){}}function xc(a){var b={};q((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,ua.call(b,e)?K(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Rb(a){var b=[];q(a,function(a,c){K(a)?q(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}
1362 function wc(a){try{return decodeURIComponent(a)}catch(b){}}function xc(a){var b={};q((a||"").split("&"),function(a){var c,e,f;a&&(e=a=a.replace(/\+/g,"%20"),c=a.indexOf("="),-1!==c&&(e=a.substring(0,c),f=a.substring(c+1)),e=wc(e),x(e)&&(f=x(f)?wc(f):!0,ua.call(b,e)?K(b[e])?b[e].push(f):b[e]=[b[e],f]:b[e]=f))});return b}function Rb(a){var b=[];q(a,function(a,c){K(a)?q(a,function(a){b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))}):b.push(ja(c,!0)+(!0===a?"":"="+ja(a,!0)))});return b.length?b.join("&"):""}
1363 function ob(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function de(a,b){var d,c,e=Na.length;for(c=0;c<e;++c)if(d=Na[c]+b,F(d=a.getAttribute(d)))return d;return null}function ee(a,b){var d,c,e={};q(Na,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});
1363 function ob(a){return ja(a,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ja(a,b){return encodeURIComponent(a).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,b?"%20":"+")}function de(a,b){var d,c,e=Na.length;for(c=0;c<e;++c)if(d=Na[c]+b,F(d=a.getAttribute(d)))return d;return null}function ee(a,b){var d,c,e={};q(Na,function(b){b+="app";!d&&a.hasAttribute&&a.hasAttribute(b)&&(d=a,c=a.getAttribute(b))});
1364 q(Na,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});d&&(e.strictDi=null!==de(d,"strict-di"),b(d,c?[c]:[],e))}function yc(a,b,d){G(d)||(d={});d=R({strictDi:!1},d);var c=function(){a=B(a);if(a.injector()){var c=a[0]===v.document?"document":wa(a);throw Aa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);
1364 q(Na,function(b){b+="app";var e;!d&&(e=a.querySelector("["+b.replace(":","\\:")+"]"))&&(d=e,c=e.getAttribute(b))});d&&(e.strictDi=null!==de(d,"strict-di"),b(d,c?[c]:[],e))}function yc(a,b,d){G(d)||(d={});d=R({strictDi:!1},d);var c=function(){a=B(a);if(a.injector()){var c=a[0]===v.document?"document":wa(a);throw Aa("btstrpd",c.replace(/</,"&lt;").replace(/>/,"&gt;"));}b=b||[];b.unshift(["$provide",function(b){b.value("$rootElement",a)}]);d.debugInfoEnabled&&b.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);
1365 b.unshift("ng");c=bb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;v&&e.test(v.name)&&(d.debugInfoEnabled=!0,v.name=v.name.replace(e,""));if(v&&!f.test(v.name))return c();v.name=v.name.replace(f,"");ea.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};E(ea.resumeDeferredBootstrap)&&ea.resumeDeferredBootstrap()}function fe(){v.name=
1365 b.unshift("ng");c=bb(b,d.strictDi);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;v&&e.test(v.name)&&(d.debugInfoEnabled=!0,v.name=v.name.replace(e,""));if(v&&!f.test(v.name))return c();v.name=v.name.replace(f,"");ea.resumeBootstrap=function(a){q(a,function(a){b.push(a)});return c()};E(ea.resumeDeferredBootstrap)&&ea.resumeDeferredBootstrap()}function fe(){v.name=
1366 "NG_ENABLE_DEBUG_INFO!"+v.name;v.location.reload()}function ge(a){a=ea.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(he,function(a,c){return(c?b:"")+a.toLowerCase()})}function ie(){var a;if(!Ac){var b=pb();(Z=y(b)?v.jQuery:b?v[b]:void 0)&&Z.fn.on?(B=Z,R(Z.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),a=Z.cleanData,Z.cleanData=function(b){for(var c,
1366 "NG_ENABLE_DEBUG_INFO!"+v.name;v.location.reload()}function ge(a){a=ea.element(a).injector();if(!a)throw Aa("test");return a.get("$$testability")}function zc(a,b){b=b||"_";return a.replace(he,function(a,c){return(c?b:"")+a.toLowerCase()})}function ie(){var a;if(!Ac){var b=pb();(Z=y(b)?v.jQuery:b?v[b]:void 0)&&Z.fn.on?(B=Z,R(Z.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),a=Z.cleanData,Z.cleanData=function(b){for(var c,
1367 e=0,f;null!=(f=b[e]);e++)(c=Z._data(f,"events"))&&c.$destroy&&Z(f).triggerHandler("$destroy");a(b)}):B=U;ea.element=B;Ac=!0}}function qb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Pa(a,b,d){d&&K(a)&&(a=a[a.length-1]);qb(E(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Qa(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c=
1367 e=0,f;null!=(f=b[e]);e++)(c=Z._data(f,"events"))&&c.$destroy&&Z(f).triggerHandler("$destroy");a(b)}):B=U;ea.element=B;Ac=!0}}function qb(a,b,d){if(!a)throw Aa("areq",b||"?",d||"required");return a}function Pa(a,b,d){d&&K(a)&&(a=a[a.length-1]);qb(E(a),b,"not a function, got "+(a&&"object"===typeof a?a.constructor.name||"Object":typeof a));return a}function Qa(a,b){if("hasOwnProperty"===a)throw Aa("badname",b);}function Bc(a,b,d){if(!b)return a;b=b.split(".");for(var c,e=a,f=b.length,g=0;g<f;g++)c=
1368 b[g],a&&(a=(e=a)[c]);return!d&&E(a)?tc(e,a):a}function rb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=B(za.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function je(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=O("$injector"),c=O("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||O;return b(a,"module",function(){var a={};return function(f,g,h){if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&
1368 b[g],a&&(a=(e=a)[c]);return!d&&E(a)?tc(e,a):a}function rb(a){for(var b=a[0],d=a[a.length-1],c,e=1;b!==d&&(b=b.nextSibling);e++)if(c||a[e]!==b)c||(c=B(za.call(a,0,e))),c.push(b);return c||a}function T(){return Object.create(null)}function je(a){function b(a,b,c){return a[b]||(a[b]=c())}var d=O("$injector"),c=O("ng");a=b(a,"angular",Object);a.$$minErr=a.$$minErr||O;return b(a,"module",function(){var a={};return function(f,g,h){if("hasOwnProperty"===f)throw c("badname","module");g&&a.hasOwnProperty(f)&&
1369 (a[f]=null);return b(a,f,function(){function a(b,d,e,f){f||(f=c);return function(){f[e||"push"]([b,d,arguments]);return M}}function b(a,d){return function(b,e){e&&E(e)&&(e.$$moduleName=f);c.push([a,d,arguments]);return M}}if(!g)throw d("nomod",f);var c=[],e=[],r=[],N=a("$injector","invoke","push",e),M={_invokeQueue:c,_configBlocks:e,_runBlocks:r,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide",
1369 (a[f]=null);return b(a,f,function(){function a(b,d,e,f){f||(f=c);return function(){f[e||"push"]([b,d,arguments]);return M}}function b(a,d){return function(b,e){e&&E(e)&&(e.$$moduleName=f);c.push([a,d,arguments]);return M}}if(!g)throw d("nomod",f);var c=[],e=[],r=[],N=a("$injector","invoke","push",e),M={_invokeQueue:c,_configBlocks:e,_runBlocks:r,requires:g,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide",
1370 "constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:N,run:function(a){r.push(a);return this}};h&&N(h);return M})}})}function ke(a){R(a,{bootstrap:yc,copy:qa,extend:R,merge:Yd,equals:pa,element:B,forEach:q,injector:bb,noop:C,bind:tc,toJson:ab,fromJson:uc,identity:Xa,isUndefined:y,
1370 "constant","unshift"),decorator:b("$provide","decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),component:b("$compileProvider","component"),config:N,run:function(a){r.push(a);return this}};h&&N(h);return M})}})}function ke(a){R(a,{bootstrap:yc,copy:qa,extend:R,merge:Yd,equals:pa,element:B,forEach:q,injector:bb,noop:C,bind:tc,toJson:ab,fromJson:uc,identity:Xa,isUndefined:y,
1371 isDefined:x,isString:F,isFunction:E,isObject:G,isNumber:Q,isElement:Ob,isArray:K,version:le,isDate:fa,lowercase:P,uppercase:sb,callbacks:{counter:0},getTestability:ge,$$minErr:O,$$csp:Ea,reloadWithDebugInfo:fe});Sb=je(v);Sb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:me});a.provider("$compile",Cc).directive({a:ne,input:Dc,textarea:Dc,form:oe,script:pe,select:qe,style:re,option:se,ngBind:te,ngBindHtml:ue,ngBindTemplate:ve,ngClass:we,ngClassEven:xe,ngClassOdd:ye,ngCloak:ze,ngController:Ae,
1371 isDefined:x,isString:F,isFunction:E,isObject:G,isNumber:Q,isElement:Ob,isArray:K,version:le,isDate:fa,lowercase:P,uppercase:sb,callbacks:{counter:0},getTestability:ge,$$minErr:O,$$csp:Ea,reloadWithDebugInfo:fe});Sb=je(v);Sb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:me});a.provider("$compile",Cc).directive({a:ne,input:Dc,textarea:Dc,form:oe,script:pe,select:qe,style:re,option:se,ngBind:te,ngBindHtml:ue,ngBindTemplate:ve,ngClass:we,ngClassEven:xe,ngClassOdd:ye,ngCloak:ze,ngController:Ae,
1372 ngForm:Be,ngHide:Ce,ngIf:De,ngInclude:Ee,ngInit:Fe,ngNonBindable:Ge,ngPluralize:He,ngRepeat:Ie,ngShow:Je,ngStyle:Ke,ngSwitch:Le,ngSwitchWhen:Me,ngSwitchDefault:Ne,ngOptions:Oe,ngTransclude:Pe,ngModel:Qe,ngList:Re,ngChange:Se,pattern:Ec,ngPattern:Ec,required:Fc,ngRequired:Fc,minlength:Gc,ngMinlength:Gc,maxlength:Hc,ngMaxlength:Hc,ngValue:Te,ngModelOptions:Ue}).directive({ngInclude:Ve}).directive(tb).directive(Ic);a.provider({$anchorScroll:We,$animate:Xe,$animateCss:Ye,$$animateJs:Ze,$$animateQueue:$e,
1372 ngForm:Be,ngHide:Ce,ngIf:De,ngInclude:Ee,ngInit:Fe,ngNonBindable:Ge,ngPluralize:He,ngRepeat:Ie,ngShow:Je,ngStyle:Ke,ngSwitch:Le,ngSwitchWhen:Me,ngSwitchDefault:Ne,ngOptions:Oe,ngTransclude:Pe,ngModel:Qe,ngList:Re,ngChange:Se,pattern:Ec,ngPattern:Ec,required:Fc,ngRequired:Fc,minlength:Gc,ngMinlength:Gc,maxlength:Hc,ngMaxlength:Hc,ngValue:Te,ngModelOptions:Ue}).directive({ngInclude:Ve}).directive(tb).directive(Ic);a.provider({$anchorScroll:We,$animate:Xe,$animateCss:Ye,$$animateJs:Ze,$$animateQueue:$e,
1373 $$AnimateRunner:af,$$animateAsyncRun:bf,$browser:cf,$cacheFactory:df,$controller:ef,$document:ff,$exceptionHandler:gf,$filter:Jc,$$forceReflow:hf,$interpolate:jf,$interval:kf,$http:lf,$httpParamSerializer:mf,$httpParamSerializerJQLike:nf,$httpBackend:of,$xhrFactory:pf,$location:qf,$log:rf,$parse:sf,$rootScope:tf,$q:uf,$$q:vf,$sce:wf,$sceDelegate:xf,$sniffer:yf,$templateCache:zf,$templateRequest:Af,$$testability:Bf,$timeout:Cf,$window:Df,$$rAF:Ef,$$jqLite:Ff,$$HashMap:Gf,$$cookieReader:Hf})}])}function cb(a){return a.replace(If,
1373 $$AnimateRunner:af,$$animateAsyncRun:bf,$browser:cf,$cacheFactory:df,$controller:ef,$document:ff,$exceptionHandler:gf,$filter:Jc,$$forceReflow:hf,$interpolate:jf,$interval:kf,$http:lf,$httpParamSerializer:mf,$httpParamSerializerJQLike:nf,$httpBackend:of,$xhrFactory:pf,$location:qf,$log:rf,$parse:sf,$rootScope:tf,$q:uf,$$q:vf,$sce:wf,$sceDelegate:xf,$sniffer:yf,$templateCache:zf,$templateRequest:Af,$$testability:Bf,$timeout:Cf,$window:Df,$$rAF:Ef,$$jqLite:Ff,$$HashMap:Gf,$$cookieReader:Hf})}])}function cb(a){return a.replace(If,
1374 function(a,d,c,e){return e?c.toUpperCase():c}).replace(Jf,"Moz$1")}function Kc(a){a=a.nodeType;return 1===a||!a||9===a}function Lc(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(Tb.test(a)){d=d||e.appendChild(b.createElement("div"));c=(Kf.exec(a)||["",""])[1].toLowerCase();c=ia[c]||ia._default;d.innerHTML=c[1]+a.replace(Lf,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=$a(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});
1374 function(a,d,c,e){return e?c.toUpperCase():c}).replace(Jf,"Moz$1")}function Kc(a){a=a.nodeType;return 1===a||!a||9===a}function Lc(a,b){var d,c,e=b.createDocumentFragment(),f=[];if(Tb.test(a)){d=d||e.appendChild(b.createElement("div"));c=(Kf.exec(a)||["",""])[1].toLowerCase();c=ia[c]||ia._default;d.innerHTML=c[1]+a.replace(Lf,"<$1></$2>")+c[2];for(c=c[0];c--;)d=d.lastChild;f=$a(f,d.childNodes);d=e.firstChild;d.textContent=""}else f.push(b.createTextNode(a));e.textContent="";e.innerHTML="";q(f,function(a){e.appendChild(a)});
1375 return e}function Mc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;F(a)&&(a=V(a),b=!0);if(!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new U(a)}if(b){b=v.document;var d;a=(d=Mf.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Nc(this,a)}function Vb(a){return a.cloneNode(!0)}function ub(a,b){b||db(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c<e;c++)db(d[c])}function Oc(a,
1375 return e}function Mc(a,b){var d=a.parentNode;d&&d.replaceChild(b,a);b.appendChild(a)}function U(a){if(a instanceof U)return a;var b;F(a)&&(a=V(a),b=!0);if(!(this instanceof U)){if(b&&"<"!=a.charAt(0))throw Ub("nosel");return new U(a)}if(b){b=v.document;var d;a=(d=Mf.exec(a))?[b.createElement(d[1])]:(d=Lc(a,b))?d.childNodes:[]}Nc(this,a)}function Vb(a){return a.cloneNode(!0)}function ub(a,b){b||db(a);if(a.querySelectorAll)for(var d=a.querySelectorAll("*"),c=0,e=d.length;c<e;c++)db(d[c])}function Oc(a,
1376 b,d,c){if(x(c))throw Ub("offargs");var e=(c=vb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];x(d)&&Za(c||[],d);x(d)&&c&&0<c.length||(a.removeEventListener(b,f,!1),delete e[b])};q(b.split(" "),function(a){g(a);wb[a]&&g(wb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f,!1),delete e[b]}function db(a,b){var d=a.ng339,c=d&&eb[d];c&&(b?delete c.data[b]:(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),Oc(a)),delete eb[d],a.ng339=void 0))}function vb(a,b){var d=
1376 b,d,c){if(x(c))throw Ub("offargs");var e=(c=vb(a))&&c.events,f=c&&c.handle;if(f)if(b){var g=function(b){var c=e[b];x(d)&&Za(c||[],d);x(d)&&c&&0<c.length||(a.removeEventListener(b,f,!1),delete e[b])};q(b.split(" "),function(a){g(a);wb[a]&&g(wb[a])})}else for(b in e)"$destroy"!==b&&a.removeEventListener(b,f,!1),delete e[b]}function db(a,b){var d=a.ng339,c=d&&eb[d];c&&(b?delete c.data[b]:(c.handle&&(c.events.$destroy&&c.handle({},"$destroy"),Oc(a)),delete eb[d],a.ng339=void 0))}function vb(a,b){var d=
1377 a.ng339,d=d&&eb[d];b&&!d&&(a.ng339=d=++Nf,d=eb[d]={events:{},data:{},handle:void 0});return d}function Wb(a,b,d){if(Kc(a)){var c=x(d),e=!c&&b&&!G(b),f=!b;a=(a=vb(a,!e))&&a.data;if(c)a[b]=d;else{if(f)return a;if(e)return a&&a[b];R(a,b)}}}function xb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function yb(a,b){b&&a.setAttribute&&q(b.split(" "),function(b){a.setAttribute("class",V((" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
1377 a.ng339,d=d&&eb[d];b&&!d&&(a.ng339=d=++Nf,d=eb[d]={events:{},data:{},handle:void 0});return d}function Wb(a,b,d){if(Kc(a)){var c=x(d),e=!c&&b&&!G(b),f=!b;a=(a=vb(a,!e))&&a.data;if(c)a[b]=d;else{if(f)return a;if(e)return a&&a[b];R(a,b)}}}function xb(a,b){return a.getAttribute?-1<(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+b+" "):!1}function yb(a,b){b&&a.setAttribute&&q(b.split(" "),function(b){a.setAttribute("class",V((" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g,
1378 " ").replace(" "+V(b)+" "," ")))})}function zb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");q(b.split(" "),function(a){a=V(a);-1===d.indexOf(" "+a+" ")&&(d+=a+" ")});a.setAttribute("class",V(d))}}function Nc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function Pc(a,b){return Ab(a,"$"+(b||"ngController")+"Controller")}function Ab(a,
1378 " ").replace(" "+V(b)+" "," ")))})}function zb(a,b){if(b&&a.setAttribute){var d=(" "+(a.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");q(b.split(" "),function(a){a=V(a);-1===d.indexOf(" "+a+" ")&&(d+=a+" ")});a.setAttribute("class",V(d))}}function Nc(a,b){if(b)if(b.nodeType)a[a.length++]=b;else{var d=b.length;if("number"===typeof d&&b.window!==b){if(d)for(var c=0;c<d;c++)a[a.length++]=b[c]}else a[a.length++]=b}}function Pc(a,b){return Ab(a,"$"+(b||"ngController")+"Controller")}function Ab(a,
1379 b,d){9==a.nodeType&&(a=a.documentElement);for(b=K(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(x(d=B.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function Qc(a){for(ub(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Bb(a,b){b||ub(a);var d=a.parentNode;d&&d.removeChild(a)}function Of(a,b){b=b||v;if("complete"===b.document.readyState)b.setTimeout(a);else B(b).on("load",a)}function Rc(a,b){var d=Cb[b.toLowerCase()];return d&&Sc[va(a)]&&d}function Pf(a,b){var d=function(c,
1379 b,d){9==a.nodeType&&(a=a.documentElement);for(b=K(b)?b:[b];a;){for(var c=0,e=b.length;c<e;c++)if(x(d=B.data(a,b[c])))return d;a=a.parentNode||11===a.nodeType&&a.host}}function Qc(a){for(ub(a,!0);a.firstChild;)a.removeChild(a.firstChild)}function Bb(a,b){b||ub(a);var d=a.parentNode;d&&d.removeChild(a)}function Of(a,b){b=b||v;if("complete"===b.document.readyState)b.setTimeout(a);else B(b).on("load",a)}function Rc(a,b){var d=Cb[b.toLowerCase()];return d&&Sc[va(a)]&&d}function Pf(a,b){var d=function(c,
1380 d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(y(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var k=f.specialHandlerWrapper||Qf;1<g&&(f=ha(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||k(a,c,f[l])}};d.elem=
1380 d){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=b[d||c.type],g=f?f.length:0;if(g){if(y(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};var k=f.specialHandlerWrapper||Qf;1<g&&(f=ha(f));for(var l=0;l<g;l++)c.isImmediatePropagationStopped()||k(a,c,f[l])}};d.elem=
1381 a;return d}function Qf(a,b,d){d.call(a,b)}function Rf(a,b,d){var c=b.relatedTarget;c&&(c===a||Sf.call(a,c))||d.call(a,b)}function Ff(){this.$get=function(){return R(U,{hasClass:function(a,b){a.attr&&(a=a[0]);return xb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return zb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return yb(a,b)}})}}function Fa(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"==d||"object"==d&&null!==a?a.$$hashKey=
1381 a;return d}function Qf(a,b,d){d.call(a,b)}function Rf(a,b,d){var c=b.relatedTarget;c&&(c===a||Sf.call(a,c))||d.call(a,b)}function Ff(){this.$get=function(){return R(U,{hasClass:function(a,b){a.attr&&(a=a[0]);return xb(a,b)},addClass:function(a,b){a.attr&&(a=a[0]);return zb(a,b)},removeClass:function(a,b){a.attr&&(a=a[0]);return yb(a,b)}})}}function Fa(a,b){var d=a&&a.$$hashKey;if(d)return"function"===typeof d&&(d=a.$$hashKey()),d;d=typeof a;return d="function"==d||"object"==d&&null!==a?a.$$hashKey=
1382 d+":"+(b||Xd)():d+":"+a}function Ra(a,b){if(b){var d=0;this.nextUid=function(){return++d}}q(a,this.put,this)}function Tc(a){a=Function.prototype.toString.call(a).replace(Tf,"");return a.match(Uf)||a.match(Vf)}function Wf(a){return(a=Tc(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function bb(a,b){function d(a){return function(b,c){if(G(b))q(b,qc(a));else return a(b,c)}}function c(a,b){Qa(a,"service");if(E(b)||K(b))b=r.instantiate(b);if(!b.$get)throw Ga("pget",a);return m[a+"Provider"]=
1382 d+":"+(b||Xd)():d+":"+a}function Ra(a,b){if(b){var d=0;this.nextUid=function(){return++d}}q(a,this.put,this)}function Tc(a){a=Function.prototype.toString.call(a).replace(Tf,"");return a.match(Uf)||a.match(Vf)}function Wf(a){return(a=Tc(a))?"function("+(a[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function bb(a,b){function d(a){return function(b,c){if(G(b))q(b,qc(a));else return a(b,c)}}function c(a,b){Qa(a,"service");if(E(b)||K(b))b=r.instantiate(b);if(!b.$get)throw Ga("pget",a);return m[a+"Provider"]=
1383 b}function e(a,b){return function(){var c=w.invoke(b,this);if(y(c))throw Ga("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){qb(y(a)||K(a),"modulesToLoad","not an array");var b=[],c;q(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{F(a)?(c=Sb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):E(a)?b.push(r.invoke(a)):K(a)?b.push(r.invoke(a)):
1383 b}function e(a,b){return function(){var c=w.invoke(b,this);if(y(c))throw Ga("undef",a);return c}}function f(a,b,d){return c(a,{$get:!1!==d?e(a,b):b})}function g(a){qb(y(a)||K(a),"modulesToLoad","not an array");var b=[],c;q(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=r.get(e[0]);f[e[1]].apply(f,e[2])}}if(!n.get(a)){n.put(a,!0);try{F(a)?(c=Sb(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):E(a)?b.push(r.invoke(a)):K(a)?b.push(r.invoke(a)):
1384 Pa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ga("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e)}catch(f){throw a[b]===k&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=bb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];
1384 Pa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||e);}}});return b}function h(a,c){function d(b,e){if(a.hasOwnProperty(b)){if(a[b]===k)throw Ga("cdep",b+" <- "+l.join(" <- "));return a[b]}try{return l.unshift(b),a[b]=k,a[b]=c(b,e)}catch(f){throw a[b]===k&&delete a[b],f;}finally{l.shift()}}function e(a,c,f){var g=[];a=bb.$$annotate(a,b,f);for(var h=0,k=a.length;h<k;h++){var l=a[h];
1385 if("string"!==typeof l)throw Ga("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);K(a)&&(a=a[a.length-1]);d=11>=Ca?!1:"function"===typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a));return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=K(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,
1385 if("string"!==typeof l)throw Ga("itkn",l);g.push(c&&c.hasOwnProperty(l)?c[l]:d(l,f))}return g}return{invoke:function(a,b,c,d){"string"===typeof c&&(d=c,c=null);c=e(a,c,d);K(a)&&(a=a[a.length-1]);d=11>=Ca?!1:"function"===typeof a&&/^(?:class\s|constructor\()/.test(Function.prototype.toString.call(a));return d?(c.unshift(null),new (Function.prototype.bind.apply(a,c))):a.apply(b,c)},instantiate:function(a,b,c){var d=K(a)?a[a.length-1]:a;a=e(a,b,c);a.unshift(null);return new (Function.prototype.bind.apply(d,
1386 a))},get:d,annotate:bb.$$annotate,has:function(b){return m.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],n=new Ra([],!0),m={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,da(b),!1)}),constant:d(function(a,b){Qa(a,"constant");m[a]=b;N[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=w.invoke(d,c);return w.invoke(b,null,
1386 a))},get:d,annotate:bb.$$annotate,has:function(b){return m.hasOwnProperty(b+"Provider")||a.hasOwnProperty(b)}}}b=!0===b;var k={},l=[],n=new Ra([],!0),m={$provide:{provider:d(c),factory:d(f),service:d(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:d(function(a,b){return f(a,da(b),!1)}),constant:d(function(a,b){Qa(a,"constant");m[a]=b;N[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=w.invoke(d,c);return w.invoke(b,null,
1387 {$delegate:a})}}}},r=m.$injector=h(m,function(a,b){ea.isString(b)&&l.push(b);throw Ga("unpr",l.join(" <- "));}),N={},M=h(N,function(a,b){var c=r.get(a+"Provider",b);return w.invoke(c.$get,c,void 0,a)}),w=M;m.$injectorProvider={$get:da(M)};var p=g(a),w=M.get("$injector");w.strictDi=b;q(p,function(a){a&&w.invoke(a)});return w}function We(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,
1387 {$delegate:a})}}}},r=m.$injector=h(m,function(a,b){ea.isString(b)&&l.push(b);throw Ga("unpr",l.join(" <- "));}),N={},M=h(N,function(a,b){var c=r.get(a+"Provider",b);return w.invoke(c.$get,c,void 0,a)}),w=M;m.$injectorProvider={$get:da(M)};var p=g(a),w=M.get("$injector");w.strictDi=b;q(p,function(a){a&&w.invoke(a)});return w}function We(){var a=!0;this.disableAutoScrolling=function(){a=!1};this.$get=["$window","$location","$rootScope",function(b,d,c){function e(a){var b=null;Array.prototype.some.call(a,
1388 function(a){if("a"===va(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;E(c)?c=c():Ob(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):Q(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===
1388 function(a){if("a"===va(a))return b=a,!0});return b}function f(a){if(a){a.scrollIntoView();var c;c=g.yOffset;E(c)?c=c():Ob(c)?(c=c[0],c="fixed"!==b.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):Q(c)||(c=0);c&&(a=a.getBoundingClientRect().top,b.scrollBy(0,a-c))}else b.scrollTo(0,0)}function g(a){a=F(a)?a:d.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=b.document;a&&c.$watch(function(){return d.hash()},function(a,b){a===
1389 b&&""===a||Of(function(){c.$evalAsync(g)})});return g}]}function fb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;K(a)&&(a=a.join(" "));K(b)&&(b=b.join(" "));return a+" "+b}function Xf(a){F(a)&&(a=a.split(" "));var b=T();q(a,function(a){a.length&&(b[a]=!0)});return b}function Ha(a){return G(a)?a:{}}function Yf(a,b,d,c){function e(a){try{a.apply(null,za.call(arguments,1))}finally{if(M--,0===M)for(;w.length;)try{w.pop()()}catch(b){d.error(b)}}}function f(){u=null;g();h()}function g(){p=I();
1389 b&&""===a||Of(function(){c.$evalAsync(g)})});return g}]}function fb(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;K(a)&&(a=a.join(" "));K(b)&&(b=b.join(" "));return a+" "+b}function Xf(a){F(a)&&(a=a.split(" "));var b=T();q(a,function(a){a.length&&(b[a]=!0)});return b}function Ha(a){return G(a)?a:{}}function Yf(a,b,d,c){function e(a){try{a.apply(null,za.call(arguments,1))}finally{if(M--,0===M)for(;w.length;)try{w.pop()()}catch(b){d.error(b)}}}function f(){u=null;g();h()}function g(){p=I();
1390 p=y(p)?null:p;pa(p,L)&&(p=L);L=p}function h(){if(t!==k.url()||H!==p)t=k.url(),H=p,q(J,function(a){a(k.url(),p)})}var k=this,l=a.location,n=a.history,m=a.setTimeout,r=a.clearTimeout,N={};k.isMock=!1;var M=0,w=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){M++};k.notifyWhenNoOutstandingRequests=function(a){0===M?a():w.push(a)};var p,H,t=l.href,z=b.find("base"),u=null,I=c.history?function(){try{return n.state}catch(a){}}:C;g();H=p;k.url=function(b,d,e){y(e)&&(e=null);l!==
1390 p=y(p)?null:p;pa(p,L)&&(p=L);L=p}function h(){if(t!==k.url()||H!==p)t=k.url(),H=p,q(J,function(a){a(k.url(),p)})}var k=this,l=a.location,n=a.history,m=a.setTimeout,r=a.clearTimeout,N={};k.isMock=!1;var M=0,w=[];k.$$completeOutstandingRequest=e;k.$$incOutstandingRequestCount=function(){M++};k.notifyWhenNoOutstandingRequests=function(a){0===M?a():w.push(a)};var p,H,t=l.href,z=b.find("base"),u=null,I=c.history?function(){try{return n.state}catch(a){}}:C;g();H=p;k.url=function(b,d,e){y(e)&&(e=null);l!==
1391 a.location&&(l=a.location);n!==a.history&&(n=a.history);if(b){var f=H===e;if(t===b&&(!c.history||f))return k;var h=t&&Ia(t)===Ia(b);t=b;H=e;if(!c.history||h&&f){if(!h||u)u=b;d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b;l.href!==b&&(u=b)}else n[d?"replaceState":"pushState"](e,"",b),g(),H=p;return k}return u||l.href.replace(/%27/g,"'")};k.state=function(){return p};var J=[],D=!1,L=null;k.onUrlChange=function(b){if(!D){if(c.history)B(a).on("popstate",f);B(a).on("hashchange",
1391 a.location&&(l=a.location);n!==a.history&&(n=a.history);if(b){var f=H===e;if(t===b&&(!c.history||f))return k;var h=t&&Ia(t)===Ia(b);t=b;H=e;if(!c.history||h&&f){if(!h||u)u=b;d?l.replace(b):h?(d=l,e=b.indexOf("#"),e=-1===e?"":b.substr(e),d.hash=e):l.href=b;l.href!==b&&(u=b)}else n[d?"replaceState":"pushState"](e,"",b),g(),H=p;return k}return u||l.href.replace(/%27/g,"'")};k.state=function(){return p};var J=[],D=!1,L=null;k.onUrlChange=function(b){if(!D){if(c.history)B(a).on("popstate",f);B(a).on("hashchange",
1392 f);D=!0}J.push(b);return b};k.$$applicationDestroyed=function(){B(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=z.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};k.defer=function(a,b){var c;M++;c=m(function(){delete N[c];e(a)},b||0);N[c]=!0;return c};k.defer.cancel=function(a){return N[a]?(delete N[a],r(a),e(C),!0):!1}}function cf(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Yf(a,c,b,d)}]}function df(){this.$get=
1392 f);D=!0}J.push(b);return b};k.$$applicationDestroyed=function(){B(a).off("hashchange popstate",f)};k.$$checkUrlChange=h;k.baseHref=function(){var a=z.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};k.defer=function(a,b){var c;M++;c=m(function(){delete N[c];e(a)},b||0);N[c]=!0;return c};k.defer.cancel=function(a){return N[a]?(delete N[a],r(a),e(C),!0):!1}}function cf(){this.$get=["$window","$log","$sniffer","$document",function(a,b,d,c){return new Yf(a,c,b,d)}]}function df(){this.$get=
1393 function(){function a(a,c){function e(a){a!=m&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw O("$cacheFactory")("iid",a);var g=0,h=R({},c,{id:a}),k=T(),l=c&&c.capacity||Number.MAX_VALUE,n=T(),m=null,r=null;return b[a]={put:function(a,b){if(!y(b)){if(l<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in k||g++;k[a]=b;g>l&&this.remove(r.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return k[a]},
1393 function(){function a(a,c){function e(a){a!=m&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,m),m=a,m.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(a in b)throw O("$cacheFactory")("iid",a);var g=0,h=R({},c,{id:a}),k=T(),l=c&&c.capacity||Number.MAX_VALUE,n=T(),m=null,r=null;return b[a]={put:function(a,b){if(!y(b)){if(l<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in k||g++;k[a]=b;g>l&&this.remove(r.key);return b}},get:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return k[a]},
1394 remove:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;b==m&&(m=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}a in k&&(delete k[a],g--)},removeAll:function(){k=T();g=0;n=T();m=r=null},destroy:function(){n=h=k=null;delete b[a]},info:function(){return R({},h,{size:g})}}}var b={};a.info=function(){var a={};q(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function zf(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Cc(a,b){function d(a,
1394 remove:function(a){if(l<Number.MAX_VALUE){var b=n[a];if(!b)return;b==m&&(m=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}a in k&&(delete k[a],g--)},removeAll:function(){k=T();g=0;n=T();m=r=null},destroy:function(){n=h=k=null;delete b[a]},info:function(){return R({},h,{size:g})}}}var b={};a.info=function(){var a={};q(b,function(b,e){a[e]=b.info()});return a};a.get=function(a){return b[a]};return a}}function zf(){this.$get=["$cacheFactory",function(a){return a("templates")}]}function Cc(a,b){function d(a,
1395 b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,e=T();q(a,function(a,f){if(a in n)e[f]=n[a];else{var g=a.match(d);if(!g)throw ga("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(n[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==P(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,g=/(([\w\-]+)(?:\:([^;]+))?;?)/,
1395 b,c){var d=/^\s*([@&<]|=(\*?))(\??)\s*(\w*)\s*$/,e=T();q(a,function(a,f){if(a in n)e[f]=n[a];else{var g=a.match(d);if(!g)throw ga("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f};g[4]&&(n[a]=e[f])}});return e}function c(a){var b=a.charAt(0);if(!b||b!==P(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,g=/(([\w\-]+)(?:\:([^;]+))?;?)/,
1396 h=ae("ngSrc,ngSrcset,src,srcset"),k=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,l=/^(on[a-z]+|formaction)$/,n=T();this.directive=function M(b,d){Qa(b,"directive");F(b)?(c(b),qb(d,"directiveFactory"),e.hasOwnProperty(b)||(e[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];q(e[b],function(e,f){try{var g=a.invoke(e);E(g)?g={compile:da(g)}:!g.compile&&g.link&&(g.compile=da(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||b;g.require=g.require||g.controller&&g.name;g.restrict=
1396 h=ae("ngSrc,ngSrcset,src,srcset"),k=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,l=/^(on[a-z]+|formaction)$/,n=T();this.directive=function M(b,d){Qa(b,"directive");F(b)?(c(b),qb(d,"directiveFactory"),e.hasOwnProperty(b)||(e[b]=[],a.factory(b+"Directive",["$injector","$exceptionHandler",function(a,c){var d=[];q(e[b],function(e,f){try{var g=a.invoke(e);E(g)?g={compile:da(g)}:!g.compile&&g.link&&(g.compile=da(g.link));g.priority=g.priority||0;g.index=f;g.name=g.name||b;g.require=g.require||g.controller&&g.name;g.restrict=
1397 g.restrict||"EA";g.$$moduleName=e.$$moduleName;d.push(g)}catch(h){c(h)}});return d}])),e[b].push(d)):q(b,qc(M));return this};this.component=function(a,b){function c(a){function e(b){return E(b)||K(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Uc(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
1397 g.restrict||"EA";g.$$moduleName=e.$$moduleName;d.push(g)}catch(h){c(h)}});return d}])),e[b].push(d)):q(b,qc(M));return this};this.component=function(a,b){function c(a){function e(b){return E(b)||K(b)?function(c,d){return a.invoke(b,this,{$element:c,$attrs:d})}:b}var f=b.template||b.templateUrl?b.template:"",g={controller:d,controllerAs:Uc(b.controller)||b.controllerAs||"$ctrl",template:e(f),templateUrl:e(b.templateUrl),transclude:b.transclude,scope:{},bindToController:b.bindings||{},restrict:"E",
1398 require:b.require};q(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}var d=b.controller||function(){};q(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,E(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return x(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var m=!0;this.debugInfoEnabled=
1398 require:b.require};q(b,function(a,b){"$"===b.charAt(0)&&(g[b]=a)});return g}var d=b.controller||function(){};q(b,function(a,b){"$"===b.charAt(0)&&(c[b]=a,E(d)&&(d[b]=a))});c.$inject=["$injector"];return this.directive(a,c)};this.aHrefSanitizationWhitelist=function(a){return x(a)?(b.aHrefSanitizationWhitelist(a),this):b.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b.imgSrcSanitizationWhitelist(a),this):b.imgSrcSanitizationWhitelist()};var m=!0;this.debugInfoEnabled=
1399 function(a){return x(a)?(m=a,this):m};var r=10;this.onChangesTtl=function(a){return arguments.length?(r=a,this):r};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(a,b,c,n,t,z,u,I,J,D){function L(){try{if(!--qa)throw Z=void 0,ga("infchng",r);u.$apply(function(){for(var a=0,b=Z.length;a<b;++a)Z[a]();Z=void 0})}finally{qa++}}function S(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<
1399 function(a){return x(a)?(m=a,this):m};var r=10;this.onChangesTtl=function(a){return arguments.length?(r=a,this):r};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$sce","$animate","$$sanitizeUri",function(a,b,c,n,t,z,u,I,J,D){function L(){try{if(!--qa)throw Z=void 0,ga("infchng",r);u.$apply(function(){for(var a=0,b=Z.length;a<b;++a)Z[a]();Z=void 0})}finally{qa++}}function S(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<
1400 e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function $(a,b,c){na.innerHTML="<span "+b+">";b=na.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function A(a,b){try{a.addClass(b)}catch(c){}}function ba(a,b,c,d,e){a instanceof B||(a=B(a));for(var f=/\S+/,g=0,h=a.length;g<h;g++){var k=a[g];k.nodeType===Ma&&k.nodeValue.match(f)&&Mc(k,a[g]=v.document.createElement("span"))}var l=s(a,b,a,c,d,e);ba.$$addScopeClass(a);var m=null;return function(b,
1400 e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a}function $(a,b,c){na.innerHTML="<span "+b+">";b=na.firstChild.attributes;var d=b[0];b.removeNamedItem(d.name);d.value=c;a.attributes.setNamedItem(d)}function A(a,b){try{a.addClass(b)}catch(c){}}function ba(a,b,c,d,e){a instanceof B||(a=B(a));for(var f=/\S+/,g=0,h=a.length;g<h;g++){var k=a[g];k.nodeType===Ma&&k.nodeValue.match(f)&&Mc(k,a[g]=v.document.createElement("span"))}var l=s(a,b,a,c,d,e);ba.$$addScopeClass(a);var m=null;return function(b,
1401 c,d){qb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var f=d.parentBoundTranscludeFn,g=d.transcludeControllers;d=d.futureParentElement;f&&f.$$boundTransclude&&(f=f.$$boundTransclude);m||(m=(d=d&&d[0])?"foreignobject"!==va(d)&&ma.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==m?B(ca(m,B("<div>").append(a).html())):c?Oa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);ba.$$addScopeInfo(d,b);c&&c(d,b);l&&l(b,d,d,f);return d}}function s(a,b,c,d,e,f){function g(a,
1401 c,d){qb(b,"scope");e&&e.needsNewScope&&(b=b.$parent.$new());d=d||{};var f=d.parentBoundTranscludeFn,g=d.transcludeControllers;d=d.futureParentElement;f&&f.$$boundTransclude&&(f=f.$$boundTransclude);m||(m=(d=d&&d[0])?"foreignobject"!==va(d)&&ma.call(d).match(/SVG/)?"svg":"html":"html");d="html"!==m?B(ca(m,B("<div>").append(a).html())):c?Oa.clone.call(a):a;if(g)for(var h in g)d.data("$"+h+"Controller",g[h].instance);ba.$$addScopeInfo(d,b);c&&c(d,b);l&&l(b,d,d,f);return d}}function s(a,b,c,d,e,f){function g(a,
1402 c,d,e){var f,k,l,m,n,t,p;if(r)for(p=Array(c.length),m=0;m<h.length;m+=3)f=h[m],p[f]=c[f];else p=c;m=0;for(n=h.length;m<n;)k=p[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),ba.$$addScopeInfo(B(k),l)):l=a,t=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,t)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k,l,m,n,r,t=0;t<a.length;t++){k=new S;l=x(a[t],[],k,0===t?d:void 0,e);(f=l.length?Ba(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&ba.$$addScopeClass(k.$$element);
1402 c,d,e){var f,k,l,m,n,t,p;if(r)for(p=Array(c.length),m=0;m<h.length;m+=3)f=h[m],p[f]=c[f];else p=c;m=0;for(n=h.length;m<n;)k=p[h[m++]],c=h[m++],f=h[m++],c?(c.scope?(l=a.$new(),ba.$$addScopeInfo(B(k),l)):l=a,t=c.transcludeOnThisElement?ka(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ka(a,b):null,c(f,l,k,d,t)):f&&f(a,k.childNodes,void 0,e)}for(var h=[],k,l,m,n,r,t=0;t<a.length;t++){k=new S;l=x(a[t],[],k,0===t?d:void 0,e);(f=l.length?Ba(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&ba.$$addScopeClass(k.$$element);
1403 k=f&&f.terminal||!(m=a[t].childNodes)||!m.length?null:s(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,r=r||f;f=null}return n?g:null}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function x(a,b,c,d,e){var h=c.$attr,k;switch(a.nodeType){case 1:la(b,
1403 k=f&&f.terminal||!(m=a[t].childNodes)||!m.length?null:s(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,r=r||f;f=null}return n?g:null}function ka(a,b,c){function d(e,f,g,h,k){e||(e=a.$new(!1,k),e.$$transcluded=!0);return b(e,f,{parentBoundTranscludeFn:c,transcludeControllers:g,futureParentElement:h})}var e=d.$$slots=T(),f;for(f in b.$$slots)e[f]=b.$$slots[f]?ka(a,b.$$slots[f],c):null;return d}function x(a,b,c,d,e){var h=c.$attr,k;switch(a.nodeType){case 1:la(b,
1404 xa(va(a)),"E",d,e);for(var l,m,n,t=a.attributes,r=0,p=t&&t.length;r<p;r++){var I=!1,D=!1;l=t[r];k=l.name;m=V(l.value);l=xa(k);if(n=ya.test(l))k=k.replace(Vc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});(l=l.match(Aa))&&Q(l[1])&&(I=k,D=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=xa(k.toLowerCase());h[l]=k;if(n||!c.hasOwnProperty(l))c[l]=m,Rc(a,l)&&(c[l]=!0);fa(a,b,m,l,n);la(b,l,"A",d,e,I,D)}a=a.className;G(a)&&(a=a.animVal);if(F(a)&&""!==a)for(;k=g.exec(a);)l=xa(k[2]),
1404 xa(va(a)),"E",d,e);for(var l,m,n,t=a.attributes,r=0,p=t&&t.length;r<p;r++){var I=!1,D=!1;l=t[r];k=l.name;m=V(l.value);l=xa(k);if(n=ya.test(l))k=k.replace(Vc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});(l=l.match(Aa))&&Q(l[1])&&(I=k,D=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=xa(k.toLowerCase());h[l]=k;if(n||!c.hasOwnProperty(l))c[l]=m,Rc(a,l)&&(c[l]=!0);fa(a,b,m,l,n);la(b,l,"A",d,e,I,D)}a=a.className;G(a)&&(a=a.animVal);if(F(a)&&""!==a)for(;k=g.exec(a);)l=xa(k[2]),
1405 la(b,l,"C",d,e)&&(c[l]=V(k[3])),a=a.substr(k.index+k[0].length);break;case Ma:if(11===Ca)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Ma;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);X(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=xa(k[1]),la(b,l,"M",d,e)&&(c[l]=V(k[2]))}catch(J){}}b.sort(Y);return b}function Wc(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&
1405 la(b,l,"C",d,e)&&(c[l]=V(k[3])),a=a.substr(k.index+k[0].length);break;case Ma:if(11===Ca)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Ma;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);X(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=xa(k[1]),la(b,l,"M",d,e)&&(c[l]=V(k[2]))}catch(J){}}b.sort(Y);return b}function Wc(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",b,c);1==a.nodeType&&(a.hasAttribute(b)&&
1406 e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=Wc(e[0],b,c);return a(d,e,f,g,h)}}function Yb(a,b,c,d,e,f){var g;return a?ba(b,c,d,e,f):function(){g||(g=ba(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function Ba(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=A.require;a.directiveName=M;if(D===A||A.$$isolateScope)a=ha(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));
1406 e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=Wc(e[0],b,c);return a(d,e,f,g,h)}}function Yb(a,b,c,d,e,f){var g;return a?ba(b,c,d,e,f):function(){g||(g=ba(b,c,d,e,f),b=c=f=null);return g.apply(this,arguments)}}function Ba(a,b,d,e,f,g,h,k,l){function m(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=A.require;a.directiveName=M;if(D===A||A.$$isolateScope)a=ha(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));
1407 b.require=A.require;b.directiveName=M;if(D===A||A.$$isolateScope)b=ha(b,{isolateScope:!0});k.push(b)}}function n(a,c,e,f,g){function l(a,b,c,d){var e;Ya(a)||(d=c,c=b,b=a,a=void 0);H&&(e=u);c||(c=H?z.parent():z);if(d){var f=g.$$slots[d];if(f)return f(a,b,e,c,$);if(y(f))throw ga("noslot",d,wa(z));}else return g(a,b,e,c,$)}var m,t,p,A,w,u,L,z;b===e?(f=d,z=d.$$element):(z=B(e),f=new S(z,d));w=c;D?A=c.$new(!0):r&&(w=c.$parent);g&&(L=l,L.$$boundTransclude=g,L.isSlotFilled=function(a){return!!g.$$slots[a]});
1407 b.require=A.require;b.directiveName=M;if(D===A||A.$$isolateScope)b=ha(b,{isolateScope:!0});k.push(b)}}function n(a,c,e,f,g){function l(a,b,c,d){var e;Ya(a)||(d=c,c=b,b=a,a=void 0);H&&(e=u);c||(c=H?z.parent():z);if(d){var f=g.$$slots[d];if(f)return f(a,b,e,c,$);if(y(f))throw ga("noslot",d,wa(z));}else return g(a,b,e,c,$)}var m,t,p,A,w,u,L,z;b===e?(f=d,z=d.$$element):(z=B(e),f=new S(z,d));w=c;D?A=c.$new(!0):r&&(w=c.$parent);g&&(L=l,L.$$boundTransclude=g,L.isSlotFilled=function(a){return!!g.$$slots[a]});
1408 I&&(u=O(z,f,L,I,A,c,D));D&&(ba.$$addScopeInfo(z,A,!0,!(J&&(J===D||J===D.$$originalDirective))),ba.$$addScopeClass(z,!0),A.$$isolateBindings=D.$$isolateBindings,t=ia(c,f,A,A.$$isolateBindings,D),t.removeWatches&&A.$on("$destroy",t.removeWatches));for(m in u){t=I[m];p=u[m];var Xb=t.$$bindings.bindToController;p.bindingInfo=p.identifier&&Xb?ia(w,f,p.instance,Xb,t):{};var M=p();M!==p.instance&&(p.instance=M,z.data("$"+t.name+"Controller",M),p.bindingInfo.removeWatches&&p.bindingInfo.removeWatches(),p.bindingInfo=
1408 I&&(u=O(z,f,L,I,A,c,D));D&&(ba.$$addScopeInfo(z,A,!0,!(J&&(J===D||J===D.$$originalDirective))),ba.$$addScopeClass(z,!0),A.$$isolateBindings=D.$$isolateBindings,t=ia(c,f,A,A.$$isolateBindings,D),t.removeWatches&&A.$on("$destroy",t.removeWatches));for(m in u){t=I[m];p=u[m];var Xb=t.$$bindings.bindToController;p.bindingInfo=p.identifier&&Xb?ia(w,f,p.instance,Xb,t):{};var M=p();M!==p.instance&&(p.instance=M,z.data("$"+t.name+"Controller",M),p.bindingInfo.removeWatches&&p.bindingInfo.removeWatches(),p.bindingInfo=
1409 ia(w,f,p.instance,Xb,t))}q(I,function(a,b){var c=a.require;a.bindToController&&!K(c)&&G(c)&&R(u[b].instance,gb(b,c,z,u))});q(u,function(a){var b=a.instance;E(b.$onChanges)&&b.$onChanges(a.bindingInfo.initialChanges);E(b.$onInit)&&b.$onInit();E(b.$onDestroy)&&w.$on("$destroy",function(){b.$onDestroy()})});m=0;for(t=h.length;m<t;m++)p=h[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);var $=c;D&&(D.template||null===D.templateUrl)&&($=A);a&&a($,e.childNodes,void 0,g);for(m=
1409 ia(w,f,p.instance,Xb,t))}q(I,function(a,b){var c=a.require;a.bindToController&&!K(c)&&G(c)&&R(u[b].instance,gb(b,c,z,u))});q(u,function(a){var b=a.instance;E(b.$onChanges)&&b.$onChanges(a.bindingInfo.initialChanges);E(b.$onInit)&&b.$onInit();E(b.$onDestroy)&&w.$on("$destroy",function(){b.$onDestroy()})});m=0;for(t=h.length;m<t;m++)p=h[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);var $=c;D&&(D.template||null===D.templateUrl)&&($=A);a&&a($,e.childNodes,void 0,g);for(m=
1410 k.length-1;0<=m;m--)p=k[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);q(u,function(a){a=a.instance;E(a.$postLink)&&a.$postLink()})}l=l||{};for(var t=-Number.MAX_VALUE,r=l.newScopeDirective,I=l.controllerDirectives,D=l.newIsolateScopeDirective,J=l.templateDirective,w=l.nonTlbTranscludeDirective,u=!1,L=!1,H=l.hasElementTranscludeDirective,z=d.$$element=B(b),A,M,$,s=e,Sa,ka=!1,C=!1,v,F=0,Ba=a.length;F<Ba;F++){A=a[F];var P=A.$$start,Q=A.$$end;P&&(z=Wc(b,P,Q));$=void 0;
1410 k.length-1;0<=m;m--)p=k[m],ja(p,p.isolateScope?A:c,z,f,p.require&&gb(p.directiveName,p.require,z,u),L);q(u,function(a){a=a.instance;E(a.$postLink)&&a.$postLink()})}l=l||{};for(var t=-Number.MAX_VALUE,r=l.newScopeDirective,I=l.controllerDirectives,D=l.newIsolateScopeDirective,J=l.templateDirective,w=l.nonTlbTranscludeDirective,u=!1,L=!1,H=l.hasElementTranscludeDirective,z=d.$$element=B(b),A,M,$,s=e,Sa,ka=!1,C=!1,v,F=0,Ba=a.length;F<Ba;F++){A=a[F];var P=A.$$start,Q=A.$$end;P&&(z=Wc(b,P,Q));$=void 0;
1411 if(t>A.priority)break;if(v=A.scope)A.templateUrl||(G(v)?(W("new/isolated scope",D||r,A,z),D=A):W("new/isolated scope",D,A,z)),r=r||A;M=A.name;if(!ka&&(A.replace&&(A.templateUrl||A.template)||A.transclude&&!A.$$tlb)){for(v=F+1;ka=a[v++];)if(ka.transclude&&!ka.$$tlb||ka.replace&&(ka.templateUrl||ka.template)){C=!0;break}ka=!0}!A.templateUrl&&A.controller&&(v=A.controller,I=I||T(),W("'"+M+"' controller",I[M],A,z),I[M]=A);if(v=A.transclude)if(u=!0,A.$$tlb||(W("transclusion",w,A,z),w=A),"element"==v)H=
1411 if(t>A.priority)break;if(v=A.scope)A.templateUrl||(G(v)?(W("new/isolated scope",D||r,A,z),D=A):W("new/isolated scope",D,A,z)),r=r||A;M=A.name;if(!ka&&(A.replace&&(A.templateUrl||A.template)||A.transclude&&!A.$$tlb)){for(v=F+1;ka=a[v++];)if(ka.transclude&&!ka.$$tlb||ka.replace&&(ka.templateUrl||ka.template)){C=!0;break}ka=!0}!A.templateUrl&&A.controller&&(v=A.controller,I=I||T(),W("'"+M+"' controller",I[M],A,z),I[M]=A);if(v=A.transclude)if(u=!0,A.$$tlb||(W("transclusion",w,A,z),w=A),"element"==v)H=
1412 !0,t=A.priority,$=z,z=d.$$element=B(ba.$$createComment(M,d[M])),b=z[0],da(f,za.call($,0),b),$[0].$$parentNode=$[0].parentNode,s=Yb(C,$,e,t,g&&g.name,{nonTlbTranscludeDirective:w});else{var la=T();$=B(Vb(b)).contents();if(G(v)){$=[];var Y=T(),X=T();q(v,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Y[a]=b;la[b]=null;X[b]=c});q(z.contents(),function(a){var b=Y[xa(va(a))];b?(X[b]=!0,la[b]=la[b]||[],la[b].push(a)):$.push(a)});q(X,function(a,b){if(!a)throw ga("reqslot",b);});for(var Z in la)la[Z]&&
1412 !0,t=A.priority,$=z,z=d.$$element=B(ba.$$createComment(M,d[M])),b=z[0],da(f,za.call($,0),b),$[0].$$parentNode=$[0].parentNode,s=Yb(C,$,e,t,g&&g.name,{nonTlbTranscludeDirective:w});else{var la=T();$=B(Vb(b)).contents();if(G(v)){$=[];var Y=T(),X=T();q(v,function(a,b){var c="?"===a.charAt(0);a=c?a.substring(1):a;Y[a]=b;la[b]=null;X[b]=c});q(z.contents(),function(a){var b=Y[xa(va(a))];b?(X[b]=!0,la[b]=la[b]||[],la[b].push(a)):$.push(a)});q(X,function(a,b){if(!a)throw ga("reqslot",b);});for(var Z in la)la[Z]&&
1413 (la[Z]=Yb(C,la[Z],e))}z.empty();s=Yb(C,$,e,void 0,void 0,{needsNewScope:A.$$isolateScope||A.$$newScope});s.$$slots=la}if(A.template)if(L=!0,W("template",J,A,z),J=A,v=E(A.template)?A.template(z,d):A.template,v=ta(v),A.replace){g=A;$=Tb.test(v)?Yc(ca(A.templateNamespace,V(v))):[];b=$[0];if(1!=$.length||1!==b.nodeType)throw ga("tplrt",M,"");da(f,z,b);Ba={$attr:{}};v=x(b,[],Ba);var ea=a.splice(F+1,a.length-(F+1));(D||r)&&Zc(v,D,r);a=a.concat(v).concat(ea);U(d,Ba);Ba=a.length}else z.html(v);if(A.templateUrl)L=
1413 (la[Z]=Yb(C,la[Z],e))}z.empty();s=Yb(C,$,e,void 0,void 0,{needsNewScope:A.$$isolateScope||A.$$newScope});s.$$slots=la}if(A.template)if(L=!0,W("template",J,A,z),J=A,v=E(A.template)?A.template(z,d):A.template,v=ta(v),A.replace){g=A;$=Tb.test(v)?Yc(ca(A.templateNamespace,V(v))):[];b=$[0];if(1!=$.length||1!==b.nodeType)throw ga("tplrt",M,"");da(f,z,b);Ba={$attr:{}};v=x(b,[],Ba);var ea=a.splice(F+1,a.length-(F+1));(D||r)&&Zc(v,D,r);a=a.concat(v).concat(ea);U(d,Ba);Ba=a.length}else z.html(v);if(A.templateUrl)L=
1414 !0,W("template",J,A,z),J=A,A.replace&&(g=A),n=aa(a.splice(F,a.length-F),z,d,f,u&&s,h,k,{controllerDirectives:I,newScopeDirective:r!==A&&r,newIsolateScopeDirective:D,templateDirective:J,nonTlbTranscludeDirective:w}),Ba=a.length;else if(A.compile)try{Sa=A.compile(z,d,s),E(Sa)?m(null,Sa,P,Q):Sa&&m(Sa.pre,Sa.post,P,Q)}catch(fa){c(fa,wa(z))}A.terminal&&(n.terminal=!0,t=Math.max(t,A.priority))}n.scope=r&&!0===r.scope;n.transcludeOnThisElement=u;n.templateOnThisElement=L;n.transclude=s;l.hasElementTranscludeDirective=
1414 !0,W("template",J,A,z),J=A,A.replace&&(g=A),n=aa(a.splice(F,a.length-F),z,d,f,u&&s,h,k,{controllerDirectives:I,newScopeDirective:r!==A&&r,newIsolateScopeDirective:D,templateDirective:J,nonTlbTranscludeDirective:w}),Ba=a.length;else if(A.compile)try{Sa=A.compile(z,d,s),E(Sa)?m(null,Sa,P,Q):Sa&&m(Sa.pre,Sa.post,P,Q)}catch(fa){c(fa,wa(z))}A.terminal&&(n.terminal=!0,t=Math.max(t,A.priority))}n.scope=r&&!0===r.scope;n.transcludeOnThisElement=u;n.templateOnThisElement=L;n.transclude=s;l.hasElementTranscludeDirective=
1415 H;return n}function gb(a,b,c,d){var e;if(F(b)){var f=b.match(k);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ga("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=gb(a,b[g],c,d);else G(b)&&(e={},q(b,function(b,f){e[f]=gb(a,b,c,d)}));return e||null}function O(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,
1415 H;return n}function gb(a,b,c,d){var e;if(F(b)){var f=b.match(k);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;if(!e){var h="$"+b+"Controller";e=g?c.inheritedData(h):c.data(h)}if(!e&&!f)throw ga("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=gb(a,b[g],c,d);else G(b)&&(e={},q(b,function(b,f){e[f]=gb(a,b,c,d)}));return e||null}function O(a,b,c,d,e,f,g){var h=T(),k;for(k in d){var l=d[k],m={$scope:l===g||l.$$isolateScope?e:f,
1416 $element:a,$attrs:b,$transclude:c},n=l.controller;"@"==n&&(n=b[l.name]);m=z(n,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function Zc(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=Pb(a[d],{$$isolateScope:b,$$newScope:c})}function la(b,f,g,h,k,l,m){if(f===k)return null;k=null;if(e.hasOwnProperty(f)){var n;f=a.get(f+"Directive");for(var t=0,r=f.length;t<r;t++)try{if(n=f[t],(y(h)||h>n.priority)&&-1!=n.restrict.indexOf(g)){l&&(n=Pb(n,{$$start:l,$$end:m}));if(!n.$$bindings){var I=
1416 $element:a,$attrs:b,$transclude:c},n=l.controller;"@"==n&&(n=b[l.name]);m=z(n,m,!0,l.controllerAs);h[l.name]=m;a.data("$"+l.name+"Controller",m.instance)}return h}function Zc(a,b,c){for(var d=0,e=a.length;d<e;d++)a[d]=Pb(a[d],{$$isolateScope:b,$$newScope:c})}function la(b,f,g,h,k,l,m){if(f===k)return null;k=null;if(e.hasOwnProperty(f)){var n;f=a.get(f+"Directive");for(var t=0,r=f.length;t<r;t++)try{if(n=f[t],(y(h)||h>n.priority)&&-1!=n.restrict.indexOf(g)){l&&(n=Pb(n,{$$start:l,$$end:m}));if(!n.$$bindings){var I=
1417 n,D=n,A=n.name,J={isolateScope:null,bindToController:null};G(D.scope)&&(!0===D.bindToController?(J.bindToController=d(D.scope,A,!0),J.isolateScope={}):J.isolateScope=d(D.scope,A,!1));G(D.bindToController)&&(J.bindToController=d(D.bindToController,A,!0));if(G(J.bindToController)){var w=D.controller,z=D.controllerAs;if(!w)throw ga("noctrl",A);if(!Uc(w,z))throw ga("noident",A);}var u=I.$$bindings=J;G(u.isolateScope)&&(n.$$isolateBindings=u.isolateScope)}b.push(n);k=n}}catch(L){c(L)}}return k}function Q(b){if(e.hasOwnProperty(b))for(var c=
1417 n,D=n,A=n.name,J={isolateScope:null,bindToController:null};G(D.scope)&&(!0===D.bindToController?(J.bindToController=d(D.scope,A,!0),J.isolateScope={}):J.isolateScope=d(D.scope,A,!1));G(D.bindToController)&&(J.bindToController=d(D.bindToController,A,!0));if(G(J.bindToController)){var w=D.controller,z=D.controllerAs;if(!w)throw ga("noctrl",A);if(!Uc(w,z))throw ga("noident",A);}var u=I.$$bindings=J;G(u.isolateScope)&&(n.$$isolateBindings=u.isolateScope)}b.push(n);k=n}}catch(L){c(L)}}return k}function Q(b){if(e.hasOwnProperty(b))for(var c=
1418 a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function U(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,f){"class"==f?(A(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function aa(a,b,c,d,e,f,
1418 a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function U(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;q(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});q(b,function(b,f){"class"==f?(A(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function aa(a,b,c,d,e,f,
1419 g,h){var k=[],l,m,t=b[0],p=a.shift(),r=Pb(p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),I=E(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,D=p.templateNamespace;b.empty();n(I).then(function(n){var J,w;n=ta(n);if(p.replace){n=Tb.test(n)?Yc(ca(D,V(n))):[];J=n[0];if(1!=n.length||1!==J.nodeType)throw ga("tplrt",p.name,I);n={$attr:{}};da(d,b,J);var z=x(J,[],n);G(p.scope)&&Zc(z,!0);a=z.concat(a);U(c,n)}else J=t,b.html(n);a.unshift(r);l=Ba(a,J,c,e,b,p,f,g,h);q(d,function(a,c){a==
1419 g,h){var k=[],l,m,t=b[0],p=a.shift(),r=Pb(p,{templateUrl:null,transclude:null,replace:null,$$originalDirective:p}),I=E(p.templateUrl)?p.templateUrl(b,c):p.templateUrl,D=p.templateNamespace;b.empty();n(I).then(function(n){var J,w;n=ta(n);if(p.replace){n=Tb.test(n)?Yc(ca(D,V(n))):[];J=n[0];if(1!=n.length||1!==J.nodeType)throw ga("tplrt",p.name,I);n={$attr:{}};da(d,b,J);var z=x(J,[],n);G(p.scope)&&Zc(z,!0);a=z.concat(a);U(c,n)}else J=t,b.html(n);a.unshift(r);l=Ba(a,J,c,e,b,p,f,g,h);q(d,function(a,c){a==
1420 J&&(d[c]=b[0])});for(m=s(b[0].childNodes,e);k.length;){n=k.shift();w=k.shift();var u=k.shift(),L=k.shift(),z=b[0];if(!n.$$destroyed){if(w!==t){var S=w.className;h.hasElementTranscludeDirective&&p.replace||(z=Vb(J));da(u,B(w),z);A(B(z),S)}w=l.transcludeOnThisElement?ka(n,l.transclude,L):L;l(m,n,z,d,w)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(l.transcludeOnThisElement&&(a=ka(b,l.transclude,e)),l(m,b,c,d,a)))}}function Y(a,b){var c=b.priority-a.priority;return 0!==
1420 J&&(d[c]=b[0])});for(m=s(b[0].childNodes,e);k.length;){n=k.shift();w=k.shift();var u=k.shift(),L=k.shift(),z=b[0];if(!n.$$destroyed){if(w!==t){var S=w.className;h.hasElementTranscludeDirective&&p.replace||(z=Vb(J));da(u,B(w),z);A(B(z),S)}w=l.transcludeOnThisElement?ka(n,l.transclude,L):L;l(m,n,z,d,w)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(l.transcludeOnThisElement&&(a=ka(b,l.transclude,e)),l(m,b,c,d,a)))}}function Y(a,b){var c=b.priority-a.priority;return 0!==
1421 c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function W(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ga("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,wa(d));}function X(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&ba.$$addBindingClass(a);return function(a,c){var e=c.parent();b||ba.$$addBindingClass(e);ba.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ca(a,b){a=
1421 c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function W(a,b,c,d){function e(a){return a?" (module: "+a+")":""}if(b)throw ga("multidir",b.name,e(b.$$moduleName),c.name,e(c.$$moduleName),a,wa(d));}function X(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&ba.$$addBindingClass(a);return function(a,c){var e=c.parent();b||ba.$$addBindingClass(e);ba.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function ca(a,b){a=
1422 P(a||"html");switch(a){case "svg":case "math":var c=v.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function ea(a,b){if("srcdoc"==b)return I.HTML;var c=va(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return I.RESOURCE_URL}function fa(a,c,d,e,f){var g=ea(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===va(a))throw ga("selmulti",wa(a));c.push({priority:100,compile:function(){return{pre:function(a,
1422 P(a||"html");switch(a){case "svg":case "math":var c=v.document.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function ea(a,b){if("srcdoc"==b)return I.HTML;var c=va(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return I.RESOURCE_URL}function fa(a,c,d,e,f){var g=ea(a,e);f=h[e]||f;var k=b(d,!0,g,f);if(k){if("multiple"===e&&"select"===va(a))throw ga("selmulti",wa(a));c.push({priority:100,compile:function(){return{pre:function(a,
1423 c,h){c=h.$$observers||(h.$$observers=T());if(l.test(e))throw ga("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function da(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=
1423 c,h){c=h.$$observers||(h.$$observers=T());if(l.test(e))throw ga("nodomevents");var m=h[e];m!==d&&(k=m&&b(m,!0,g,f),d=m);k&&(h[e]=k(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(k,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function da(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var k=a.length;g<k;g++,h++)h<k?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=
1424 c);break}f&&f.replaceChild(c,d);a=v.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);B.hasData(d)&&(B.data(c,B.data(d)),B(d).off("$destroy"));B.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function ha(a,b){return R(function(){return a.apply(null,arguments)},a,b)}function ja(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,wa(d))}}function ia(a,c,d,e,f){function g(b,c,e){E(d.$onChanges)&&c!==e&&(Z||(a.$$postDigest(L),Z=[]),m||(m={},Z.push(h)),m[b]&&
1424 c);break}f&&f.replaceChild(c,d);a=v.document.createDocumentFragment();for(g=0;g<e;g++)a.appendChild(b[g]);B.hasData(d)&&(B.data(c,B.data(d)),B(d).off("$destroy"));B.cleanData(a.querySelectorAll("*"));for(g=1;g<e;g++)delete b[g];b[0]=c;b.length=1}function ha(a,b){return R(function(){return a.apply(null,arguments)},a,b)}function ja(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,wa(d))}}function ia(a,c,d,e,f){function g(b,c,e){E(d.$onChanges)&&c!==e&&(Z||(a.$$postDigest(L),Z=[]),m||(m={},Z.push(h)),m[b]&&
1425 (e=m[b].previousValue),m[b]=new Db(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;q(e,function(e,h){var m=e.attrName,n=e.optional,p,r,I,D;switch(e.mode){case "@":n||ua.call(c,m)||(d[h]=c[m]=void 0);c.$observe(m,function(a){if(F(a)||Da(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;p=c[m];F(p)?d[h]=b(p)(a):Da(p)&&(d[h]=p);l[h]=new Db(Zb,d[h]);break;case "=":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);D=r.literal?pa:function(a,b){return a===b||a!==a&&b!==b};
1425 (e=m[b].previousValue),m[b]=new Db(e,c))}function h(){d.$onChanges(m);m=void 0}var k=[],l={},m;q(e,function(e,h){var m=e.attrName,n=e.optional,p,r,I,D;switch(e.mode){case "@":n||ua.call(c,m)||(d[h]=c[m]=void 0);c.$observe(m,function(a){if(F(a)||Da(a))g(h,a,d[h]),d[h]=a});c.$$observers[m].$$scope=a;p=c[m];F(p)?d[h]=b(p)(a):Da(p)&&(d[h]=p);l[h]=new Db(Zb,d[h]);break;case "=":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);D=r.literal?pa:function(a,b){return a===b||a!==a&&b!==b};
1426 I=r.assign||function(){p=d[h]=r(a);throw ga("nonassign",c[m],m,f.name);};p=d[h]=r(a);n=function(b){D(b,d[h])||(D(b,p)?I(a,b=d[h]):d[h]=b);return p=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(t(c[m],n),null,r.literal);k.push(n);break;case "<":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);d[h]=r(a);l[h]=new Db(Zb,d[h]);n=a.$watch(r,function(a,b){a===b&&(b=d[h]);g(h,a,b);d[h]=a},r.literal);k.push(n);break;case "&":r=c.hasOwnProperty(m)?t(c[m]):C;if(r===
1426 I=r.assign||function(){p=d[h]=r(a);throw ga("nonassign",c[m],m,f.name);};p=d[h]=r(a);n=function(b){D(b,d[h])||(D(b,p)?I(a,b=d[h]):d[h]=b);return p=b};n.$stateful=!0;n=e.collection?a.$watchCollection(c[m],n):a.$watch(t(c[m],n),null,r.literal);k.push(n);break;case "<":if(!ua.call(c,m)){if(n)break;c[m]=void 0}if(n&&!c[m])break;r=t(c[m]);d[h]=r(a);l[h]=new Db(Zb,d[h]);n=a.$watch(r,function(a,b){a===b&&(b=d[h]);g(h,a,b);d[h]=a},r.literal);k.push(n);break;case "&":r=c.hasOwnProperty(m)?t(c[m]):C;if(r===
1427 C&&n)break;d[h]=function(b){return r(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var oa=/^\w/,na=v.document.createElement("div"),qa=r,Z;S.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&J.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&J.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=$c(a,b);c&&c.length&&J.addClass(this.$$element,c);(c=$c(b,a))&&c.length&&J.removeClass(this.$$element,
1427 C&&n)break;d[h]=function(b){return r(a,b)}}});return{initialChanges:l,removeWatches:k.length&&function(){for(var a=0,b=k.length;a<b;++a)k[a]()}}}var oa=/^\w/,na=v.document.createElement("div"),qa=r,Z;S.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&J.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&J.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=$c(a,b);c&&c.length&&J.addClass(this.$$element,c);(c=$c(b,a))&&c.length&&J.removeClass(this.$$element,
1428 c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=ad[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=zc(a,"-"));f=va(this.$$element);if("a"===f&&("href"===a||"xlinkHref"===a)||"img"===f&&"src"===a)this[a]=b=D(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=V(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var m=2*l,f=f+D(V(g[m]),!0),f=
1428 c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=ad[a],h=a;f?(this.$$element.prop(a,b),e=f):g&&(this[g]=b,h=g);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=zc(a,"-"));f=va(this.$$element);if("a"===f&&("href"===a||"xlinkHref"===a)||"img"===f&&"src"===a)this[a]=b=D(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=V(b),k=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,k=/\s/.test(g)?k:/(,)/,g=g.split(k),k=Math.floor(g.length/2),l=0;l<k;l++)var m=2*l,f=f+D(V(g[m]),!0),f=
1429 f+(" "+V(g[m+1]));g=V(g[2*l]).split(/\s/);f+=D(V(g[0]),!0);2===g.length&&(f+=" "+V(g[1]));this[a]=b=f}!1!==d&&(null===b||y(b)?this.$$element.removeAttr(e):oa.test(e)?this.$$element.attr(e,b):$(this.$$element[0],e,b));(a=this.$$observers)&&q(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);u.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||y(c[a])||b(c[a])});return function(){Za(e,b)}}};var ra=b.startSymbol(),
1429 f+(" "+V(g[m+1]));g=V(g[2*l]).split(/\s/);f+=D(V(g[0]),!0);2===g.length&&(f+=" "+V(g[1]));this[a]=b=f}!1!==d&&(null===b||y(b)?this.$$element.removeAttr(e):oa.test(e)?this.$$element.attr(e,b):$(this.$$element[0],e,b));(a=this.$$observers)&&q(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=T()),e=d[a]||(d[a]=[]);e.push(b);u.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||y(c[a])||b(c[a])});return function(){Za(e,b)}}};var ra=b.startSymbol(),
1430 sa=b.endSymbol(),ta="{{"==ra&&"}}"==sa?Xa:function(a){return a.replace(/\{\{/g,ra).replace(/}}/g,sa)},ya=/^ngAttr[A-Z]/,Aa=/^(.+)Start$/;ba.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:C;ba.$$addBindingClass=m?function(a){A(a,"ng-binding")}:C;ba.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:C;ba.$$addScopeClass=m?function(a,b){A(a,b?"ng-isolate-scope":"ng-scope")}:C;ba.$$createComment=
1430 sa=b.endSymbol(),ta="{{"==ra&&"}}"==sa?Xa:function(a){return a.replace(/\{\{/g,ra).replace(/}}/g,sa)},ya=/^ngAttr[A-Z]/,Aa=/^(.+)Start$/;ba.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:C;ba.$$addBindingClass=m?function(a){A(a,"ng-binding")}:C;ba.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:C;ba.$$addScopeClass=m?function(a,b){A(a,b?"ng-isolate-scope":"ng-scope")}:C;ba.$$createComment=
1431 function(a,b){var c="";m&&(c=" "+(a||"")+": "+(b||"")+" ");return v.document.createComment(c)};return ba}]}function Db(a,b){this.previousValue=a;this.currentValue=b}function xa(a){return cb(a.replace(Vc,""))}function $c(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],h=0;h<e.length;h++)if(g==e[h])continue a;d+=(0<d.length?" ":"")+g}return d}function Yc(a){a=B(a);var b=a.length;if(1>=b)return a;for(;b--;)8===a[b].nodeType&&Zf.call(a,b,1);return a}function Uc(a,
1431 function(a,b){var c="";m&&(c=" "+(a||"")+": "+(b||"")+" ");return v.document.createComment(c)};return ba}]}function Db(a,b){this.previousValue=a;this.currentValue=b}function xa(a){return cb(a.replace(Vc,""))}function $c(a,b){var d="",c=a.split(/\s+/),e=b.split(/\s+/),f=0;a:for(;f<c.length;f++){for(var g=c[f],h=0;h<e.length;h++)if(g==e[h])continue a;d+=(0<d.length?" ":"")+g}return d}function Yc(a){a=B(a);var b=a.length;if(1>=b)return a;for(;b--;)8===a[b].nodeType&&Zf.call(a,b,1);return a}function Uc(a,
1432 b){if(b&&F(b))return b;if(F(a)){var d=bd.exec(a);if(d)return d[3]}}function ef(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,c){Qa(b,"controller");G(b)?R(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!G(a.$scope))throw O("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,n,m;h=!0===h;k&&F(k)&&(m=k);if(F(f)){k=f.match(bd);if(!k)throw $f("ctrlfmt",f);n=k[1];m=
1432 b){if(b&&F(b))return b;if(F(a)){var d=bd.exec(a);if(d)return d[3]}}function ef(){var a={},b=!1;this.has=function(b){return a.hasOwnProperty(b)};this.register=function(b,c){Qa(b,"controller");G(b)?R(a,b):a[b]=c};this.allowGlobals=function(){b=!0};this.$get=["$injector","$window",function(d,c){function e(a,b,c,d){if(!a||!G(a.$scope))throw O("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,g,h,k){var l,n,m;h=!0===h;k&&F(k)&&(m=k);if(F(f)){k=f.match(bd);if(!k)throw $f("ctrlfmt",f);n=k[1];m=
1433 m||k[3];f=a.hasOwnProperty(n)?a[n]:Bc(g.$scope,n,!0)||(b?Bc(c,n,!0):void 0);Pa(f,n,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),m&&e(g,m,l,n||f.name),R(function(){var a=d.invoke(f,l,g,n);a!==l&&(G(a)||E(a))&&(l=a,m&&e(g,m,l,n||f.name));return l},{instance:l,identifier:m});l=d.instantiate(f,g,n);m&&e(g,m,l,n||f.name);return l}}]}function ff(){this.$get=["$window",function(a){return B(a.document)}]}function gf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,
1433 m||k[3];f=a.hasOwnProperty(n)?a[n]:Bc(g.$scope,n,!0)||(b?Bc(c,n,!0):void 0);Pa(f,n,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,l=Object.create(h||null),m&&e(g,m,l,n||f.name),R(function(){var a=d.invoke(f,l,g,n);a!==l&&(G(a)||E(a))&&(l=a,m&&e(g,m,l,n||f.name));return l},{instance:l,identifier:m});l=d.instantiate(f,g,n);m&&e(g,m,l,n||f.name);return l}}]}function ff(){this.$get=["$window",function(a){return B(a.document)}]}function gf(){this.$get=["$log",function(a){return function(b,d){a.error.apply(a,
1434 arguments)}}]}function $b(a){return G(a)?fa(a)?a.toISOString():ab(a):a}function mf(){this.$get=function(){return function(a){if(!a)return"";var b=[];pc(a,function(a,c){null===a||y(a)||(K(a)?q(a,function(a){b.push(ja(c)+"="+ja($b(a)))}):b.push(ja(c)+"="+ja($b(a))))});return b.join("&")}}}function nf(){this.$get=function(){return function(a){function b(a,e,f){null===a||y(a)||(K(a)?q(a,function(a,c){b(a,e+"["+(G(a)?c:"")+"]")}):G(a)&&!fa(a)?pc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+
1434 arguments)}}]}function $b(a){return G(a)?fa(a)?a.toISOString():ab(a):a}function mf(){this.$get=function(){return function(a){if(!a)return"";var b=[];pc(a,function(a,c){null===a||y(a)||(K(a)?q(a,function(a){b.push(ja(c)+"="+ja($b(a)))}):b.push(ja(c)+"="+ja($b(a))))});return b.join("&")}}}function nf(){this.$get=function(){return function(a){function b(a,e,f){null===a||y(a)||(K(a)?q(a,function(a,c){b(a,e+"["+(G(a)?c:"")+"]")}):G(a)&&!fa(a)?pc(a,function(a,c){b(a,e+(f?"":"[")+c+(f?"":"]"))}):d.push(ja(e)+
1435 "="+ja($b(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function ac(a,b){if(F(a)){var d=a.replace(ag,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(cd))||(c=(c=d.match(bg))&&cg[c[0]].test(d));c&&(a=uc(d))}}return a}function dd(a){var b=T(),d;F(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=P(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):G(a)&&q(a,function(a,d){var f=P(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function ed(a){var b;
1435 "="+ja($b(a))))}if(!a)return"";var d=[];b(a,"",!0);return d.join("&")}}}function ac(a,b){if(F(a)){var d=a.replace(ag,"").trim();if(d){var c=b("Content-Type");(c=c&&0===c.indexOf(cd))||(c=(c=d.match(bg))&&cg[c[0]].test(d));c&&(a=uc(d))}}return a}function dd(a){var b=T(),d;F(a)?q(a.split("\n"),function(a){d=a.indexOf(":");var e=P(V(a.substr(0,d)));a=V(a.substr(d+1));e&&(b[e]=b[e]?b[e]+", "+a:a)}):G(a)&&q(a,function(a,d){var f=P(d),g=V(a);f&&(b[f]=b[f]?b[f]+", "+g:g)});return b}function ed(a){var b;
1436 return function(d){b||(b=dd(a));return d?(d=b[P(d)],void 0===d&&(d=null),d):b}}function fd(a,b,d,c){if(E(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function lf(){var a=this.defaults={transformResponse:[ac],transformRequest:[function(a){return G(a)&&"[object File]"!==ma.call(a)&&"[object Blob]"!==ma.call(a)&&"[object FormData]"!==ma.call(a)?ab(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ha(bc),put:ha(bc),patch:ha(bc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
1436 return function(d){b||(b=dd(a));return d?(d=b[P(d)],void 0===d&&(d=null),d):b}}function fd(a,b,d,c){if(E(c))return c(a,b,d);q(c,function(c){a=c(a,b,d)});return a}function lf(){var a=this.defaults={transformResponse:[ac],transformRequest:[function(a){return G(a)&&"[object File]"!==ma.call(a)&&"[object Blob]"!==ma.call(a)&&"[object FormData]"!==ma.call(a)?ab(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ha(bc),put:ha(bc),patch:ha(bc)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
1437 paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return x(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function n(b){function c(a){var b=R({},a);b.data=fd(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};q(a,function(a,
1437 paramSerializer:"$httpParamSerializer"},b=!1;this.useApplyAsync=function(a){return x(a)?(b=!!a,this):b};var d=!0;this.useLegacyPromiseExtensions=function(a){return x(a)?(d=!!a,this):d};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,g,h,k,l){function n(b){function c(a){var b=R({},a);b.data=fd(a.data,a.headers,a.status,f.transformResponse);a=a.status;return 200<=a&&300>a?b:k.reject(b)}function e(a,b){var c,d={};q(a,function(a,
1438 e){E(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!G(b))throw O("$http")("badreq",b);if(!F(b.url))throw O("$http")("badreq",b.url);var f=R({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=R({},b.headers),f,g,h,c=R({},c.common,c[P(b.method)]);a:for(f in c){g=P(f);for(h in d)if(P(h)===g)continue a;d[f]=c[f]}return e(d,ha(b))}(b);f.method=sb(f.method);f.paramSerializer=F(f.paramSerializer)?
1438 e){E(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!G(b))throw O("$http")("badreq",b);if(!F(b.url))throw O("$http")("badreq",b.url);var f=R({method:"get",transformRequest:a.transformRequest,transformResponse:a.transformResponse,paramSerializer:a.paramSerializer},b);f.headers=function(b){var c=a.headers,d=R({},b.headers),f,g,h,c=R({},c.common,c[P(b.method)]);a:for(f in c){g=P(f);for(h in d)if(P(h)===g)continue a;d[f]=c[f]}return e(d,ha(b))}(b);f.method=sb(f.method);f.paramSerializer=F(f.paramSerializer)?
1439 l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=fd(b.data,ed(d),void 0,b.transformRequest);y(e)&&q(d,function(a,b){"content-type"===P(b)&&delete d[b]});y(b.withCredentials)&&!y(a.withCredentials)&&(b.withCredentials=a.withCredentials);return m(b,e).then(c,c)},void 0],h=k.when(f);for(q(M,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var n=g.shift(),
1439 l.get(f.paramSerializer):f.paramSerializer;var g=[function(b){var d=b.headers,e=fd(b.data,ed(d),void 0,b.transformRequest);y(e)&&q(d,function(a,b){"content-type"===P(b)&&delete d[b]});y(b.withCredentials)&&!y(a.withCredentials)&&(b.withCredentials=a.withCredentials);return m(b,e).then(c,c)},void 0],h=k.when(f);for(q(M,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){b=g.shift();var n=g.shift(),
1440 h=h.then(b,n)}d?(h.success=function(a){Pa(a,"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Pa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=gd("success"),h.error=gd("error"));return h}function m(c,d){function g(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function l(a,c,d,e){function f(){m(c,a,d,e)}L&&(200<=a&&300>a?L.put(A,[a,c,dd(d),
1440 h=h.then(b,n)}d?(h.success=function(a){Pa(a,"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Pa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=gd("success"),h.error=gd("error"));return h}function m(c,d){function g(a){if(a){var c={};q(a,function(a,d){c[d]=function(c){function d(){a(c)}b?h.$applyAsync(d):h.$$phase?d():h.$apply(d)}});return c}}function l(a,c,d,e){function f(){m(c,a,d,e)}L&&(200<=a&&300>a?L.put(A,[a,c,dd(d),
1441 e]):L.remove(A));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function m(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:ed(d),config:c,statusText:e})}function u(a){m(a.data,a.status,ha(a.headers()),a.statusText)}function I(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var J=k.defer(),D=J.promise,L,S,M=c.headers,A=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);D.then(I,I);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&
1441 e]):L.remove(A));b?h.$applyAsync(f):(f(),h.$$phase||h.$apply())}function m(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?J.resolve:J.reject)({data:a,status:b,headers:ed(d),config:c,statusText:e})}function u(a){m(a.data,a.status,ha(a.headers()),a.statusText)}function I(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var J=k.defer(),D=J.promise,L,S,M=c.headers,A=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);D.then(I,I);!c.cache&&!a.cache||!1===c.cache||"GET"!==c.method&&
1442 "JSONP"!==c.method||(L=G(c.cache)?c.cache:G(a.cache)?a.cache:N);L&&(S=L.get(A),x(S)?S&&E(S.then)?S.then(u,u):K(S)?m(S[1],S[0],ha(S[2]),S[3]):m(S,200,{},"OK"):L.put(A,D));y(S)&&((S=hd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(M[c.xsrfHeaderName||a.xsrfHeaderName]=S),e(c.method,A,d,l,M,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return D}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var N=g("$http");a.paramSerializer=
1442 "JSONP"!==c.method||(L=G(c.cache)?c.cache:G(a.cache)?a.cache:N);L&&(S=L.get(A),x(S)?S&&E(S.then)?S.then(u,u):K(S)?m(S[1],S[0],ha(S[2]),S[3]):m(S,200,{},"OK"):L.put(A,D));y(S)&&((S=hd(c.url)?f()[c.xsrfCookieName||a.xsrfCookieName]:void 0)&&(M[c.xsrfHeaderName||a.xsrfHeaderName]=S),e(c.method,A,d,l,M,c.timeout,c.withCredentials,c.responseType,g(c.eventHandlers),g(c.uploadEventHandlers)));return D}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var N=g("$http");a.paramSerializer=
1443 F(a.paramSerializer)?l.get(a.paramSerializer):a.paramSerializer;var M=[];q(c,function(a){M.unshift(F(a)?l.get(a):l.invoke(a))});n.pendingRequests=[];(function(a){q(arguments,function(a){n[a]=function(b,c){return n(R({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){n[a]=function(b,c,d){return n(R({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function pf(){this.$get=function(){return function(){return new v.XMLHttpRequest}}}
1443 F(a.paramSerializer)?l.get(a.paramSerializer):a.paramSerializer;var M=[];q(c,function(a){M.unshift(F(a)?l.get(a):l.invoke(a))});n.pendingRequests=[];(function(a){q(arguments,function(a){n[a]=function(b,c){return n(R({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){q(arguments,function(a){n[a]=function(b,c,d){return n(R({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=a;return n}]}function pf(){this.$get=function(){return function(){return new v.XMLHttpRequest}}}
1444 function of(){this.$get=["$browser","$window","$document","$xhrFactory",function(a,b,d,c){return dg(a,c,a.defer,b.angular.callbacks,d[0])}]}function dg(a,b,d,c,e){function f(a,b,d){var f=e.createElement("script"),n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var g=-1,N="unknown";a&&("load"!==a.type||c[b].called||(a={type:"error"}),N=a.type,g="error"===a.type?404:200);d&&d(g,N)};f.addEventListener("load",
1444 function of(){this.$get=["$browser","$window","$document","$xhrFactory",function(a,b,d,c){return dg(a,c,a.defer,b.angular.callbacks,d[0])}]}function dg(a,b,d,c,e){function f(a,b,d){var f=e.createElement("script"),n=null;f.type="text/javascript";f.src=a;f.async=!0;n=function(a){f.removeEventListener("load",n,!1);f.removeEventListener("error",n,!1);e.body.removeChild(f);f=null;var g=-1,N="unknown";a&&("load"!==a.type||c[b].called||(a={type:"error"}),N=a.type,g="error"===a.type?404:200);d&&d(g,N)};f.addEventListener("load",
1445 n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,h,k,l,n,m,r,N,M,w){function p(){z&&z();u&&u.abort()}function H(b,c,e,f,g){x(J)&&d.cancel(J);z=u=null;b(c,e,f,g);a.$$completeOutstandingRequest(C)}a.$$incOutstandingRequestCount();h=h||a.url();if("jsonp"==P(e)){var t="_"+(c.counter++).toString(36);c[t]=function(a){c[t].data=a;c[t].called=!0};var z=f(h.replace("JSON_CALLBACK","angular.callbacks."+t),t,function(a,b){H(l,a,c[t].data,"",b);c[t]=C})}else{var u=b(e,h);
1445 n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,h,k,l,n,m,r,N,M,w){function p(){z&&z();u&&u.abort()}function H(b,c,e,f,g){x(J)&&d.cancel(J);z=u=null;b(c,e,f,g);a.$$completeOutstandingRequest(C)}a.$$incOutstandingRequestCount();h=h||a.url();if("jsonp"==P(e)){var t="_"+(c.counter++).toString(36);c[t]=function(a){c[t].data=a;c[t].called=!0};var z=f(h.replace("JSON_CALLBACK","angular.callbacks."+t),t,function(a,b){H(l,a,c[t].data,"",b);c[t]=C})}else{var u=b(e,h);
1446 u.open(e,h,!0);q(n,function(a,b){x(a)&&u.setRequestHeader(b,a)});u.onload=function(){var a=u.statusText||"",b="response"in u?u.response:u.responseText,c=1223===u.status?204:u.status;0===c&&(c=b?200:"file"==ra(h).protocol?404:0);H(l,c,b,u.getAllResponseHeaders(),a)};e=function(){H(l,-1,null,null,"")};u.onerror=e;u.onabort=e;q(M,function(a,b){u.addEventListener(b,a)});q(w,function(a,b){u.upload.addEventListener(b,a)});r&&(u.withCredentials=!0);if(N)try{u.responseType=N}catch(I){if("json"!==N)throw I;
1446 u.open(e,h,!0);q(n,function(a,b){x(a)&&u.setRequestHeader(b,a)});u.onload=function(){var a=u.statusText||"",b="response"in u?u.response:u.responseText,c=1223===u.status?204:u.status;0===c&&(c=b?200:"file"==ra(h).protocol?404:0);H(l,c,b,u.getAllResponseHeaders(),a)};e=function(){H(l,-1,null,null,"")};u.onerror=e;u.onabort=e;q(M,function(a,b){u.addEventListener(b,a)});q(w,function(a,b){u.upload.addEventListener(b,a)});r&&(u.withCredentials=!0);if(N)try{u.responseType=N}catch(I){if("json"!==N)throw I;
1447 }u.send(y(k)?null:k)}if(0<m)var J=d(p,m);else m&&E(m.then)&&m.then(p)}}function jf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(r,b)}function h(a,b,c,d){var e;return e=a.$watch(function(a){e();return d(a)},b,c)}function k(f,k,m,r){function H(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);
1447 }u.send(y(k)?null:k)}if(0<m)var J=d(p,m);else m&&E(m.then)&&m.then(p)}}function jf(){var a="{{",b="}}";this.startSymbol=function(b){return b?(a=b,this):a};this.endSymbol=function(a){return a?(b=a,this):b};this.$get=["$parse","$exceptionHandler","$sce",function(d,c,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,a).replace(r,b)}function h(a,b,c,d){var e;return e=a.$watch(function(a){e();return d(a)},b,c)}function k(f,k,m,r){function H(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);
1448 var d;if(r&&!x(a))d=a;else if(null==a)d="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=ab(a)}d=a}return d}catch(g){c(Ja.interr(f,g))}}if(!f.length||-1===f.indexOf(a)){var t;k||(k=g(f),t=da(k),t.exp=f,t.expressions=[],t.$$watchDelegate=h);return t}r=!!r;var z,u,I=0,J=[],D=[];t=f.length;for(var L=[],S=[];I<t;)if(-1!=(z=f.indexOf(a,I))&&-1!=(u=f.indexOf(b,z+l)))I!==z&&L.push(g(f.substring(I,z))),I=f.substring(z+l,u),J.push(I),D.push(d(I,H)),I=u+n,S.push(L.length),L.push("");
1448 var d;if(r&&!x(a))d=a;else if(null==a)d="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=ab(a)}d=a}return d}catch(g){c(Ja.interr(f,g))}}if(!f.length||-1===f.indexOf(a)){var t;k||(k=g(f),t=da(k),t.exp=f,t.expressions=[],t.$$watchDelegate=h);return t}r=!!r;var z,u,I=0,J=[],D=[];t=f.length;for(var L=[],S=[];I<t;)if(-1!=(z=f.indexOf(a,I))&&-1!=(u=f.indexOf(b,z+l)))I!==z&&L.push(g(f.substring(I,z))),I=f.substring(z+l,u),J.push(I),D.push(d(I,H)),I=u+n,S.push(L.length),L.push("");
1449 else{I!==t&&L.push(g(f.substring(I)));break}m&&1<L.length&&Ja.throwNoconcat(f);if(!k||J.length){var q=function(a){for(var b=0,c=J.length;b<c;b++){if(r&&y(a[b]))return;L[S[b]]=a[b]}return L.join("")};return R(function(a){var b=0,d=J.length,e=Array(d);try{for(;b<d;b++)e[b]=D[b](a);return q(e)}catch(g){c(Ja.interr(f,g))}},{exp:f,expressions:J,$$watchDelegate:function(a,b){var c;return a.$watchGroup(D,function(d,e){var f=q(d);E(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,n=b.length,m=new RegExp(a.replace(/./g,
1449 else{I!==t&&L.push(g(f.substring(I)));break}m&&1<L.length&&Ja.throwNoconcat(f);if(!k||J.length){var q=function(a){for(var b=0,c=J.length;b<c;b++){if(r&&y(a[b]))return;L[S[b]]=a[b]}return L.join("")};return R(function(a){var b=0,d=J.length,e=Array(d);try{for(;b<d;b++)e[b]=D[b](a);return q(e)}catch(g){c(Ja.interr(f,g))}},{exp:f,expressions:J,$$watchDelegate:function(a,b){var c;return a.$watchGroup(D,function(d,e){var f=q(d);E(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=a.length,n=b.length,m=new RegExp(a.replace(/./g,
1450 f),"g"),r=new RegExp(b.replace(/./g,f),"g");k.startSymbol=function(){return a};k.endSymbol=function(){return b};return k}]}function kf(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,k,l,n){function m(){r?f.apply(null,N):f(p)}var r=4<arguments.length,N=r?za.call(arguments,4):[],q=b.setInterval,w=b.clearInterval,p=0,H=x(n)&&!n,t=(H?c:d).defer(),z=t.promise;l=x(l)?l:0;z.$$intervalId=q(function(){H?e.defer(m):a.$evalAsync(m);t.notify(p++);0<l&&p>=l&&(t.resolve(p),
1450 f),"g"),r=new RegExp(b.replace(/./g,f),"g");k.startSymbol=function(){return a};k.endSymbol=function(){return b};return k}]}function kf(){this.$get=["$rootScope","$window","$q","$$q","$browser",function(a,b,d,c,e){function f(f,k,l,n){function m(){r?f.apply(null,N):f(p)}var r=4<arguments.length,N=r?za.call(arguments,4):[],q=b.setInterval,w=b.clearInterval,p=0,H=x(n)&&!n,t=(H?c:d).defer(),z=t.promise;l=x(l)?l:0;z.$$intervalId=q(function(){H?e.defer(m):a.$evalAsync(m);t.notify(p++);0<l&&p>=l&&(t.resolve(p),
1451 w(z.$$intervalId),delete g[z.$$intervalId]);H||a.$apply()},k);g[z.$$intervalId]=t;return z}var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function cc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=ob(a[b]);return a.join("/")}function id(a,b){var d=ra(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=X(d.port)||eg[d.protocol]||null}function jd(a,b){var d="/"!==a.charAt(0);
1451 w(z.$$intervalId),delete g[z.$$intervalId]);H||a.$apply()},k);g[z.$$intervalId]=t;return z}var g={};f.cancel=function(a){return a&&a.$$intervalId in g?(g[a.$$intervalId].reject("canceled"),b.clearInterval(a.$$intervalId),delete g[a.$$intervalId],!0):!1};return f}]}function cc(a){a=a.split("/");for(var b=a.length;b--;)a[b]=ob(a[b]);return a.join("/")}function id(a,b){var d=ra(a);b.$$protocol=d.protocol;b.$$host=d.hostname;b.$$port=X(d.port)||eg[d.protocol]||null}function jd(a,b){var d="/"!==a.charAt(0);
1452 d&&(a="/"+a);var c=ra(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function na(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function hb(a){return a.replace(/(#.+)|#$/,"$1")}function dc(a,b,d){this.$$html5=!0;d=d||"";id(a,this);this.$$parse=function(a){var d=na(b,
1452 d&&(a="/"+a);var c=ra(a);b.$$path=decodeURIComponent(d&&"/"===c.pathname.charAt(0)?c.pathname.substring(1):c.pathname);b.$$search=xc(c.search);b.$$hash=decodeURIComponent(c.hash);b.$$path&&"/"!=b.$$path.charAt(0)&&(b.$$path="/"+b.$$path)}function na(a,b){if(0===b.indexOf(a))return b.substr(a.length)}function Ia(a){var b=a.indexOf("#");return-1==b?a:a.substr(0,b)}function hb(a){return a.replace(/(#.+)|#$/,"$1")}function dc(a,b,d){this.$$html5=!0;d=d||"";id(a,this);this.$$parse=function(a){var d=na(b,
1453 a);if(!F(d))throw Eb("ipthprfx",a,b);jd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Rb(this.$$search),d=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;x(f=na(a,c))?(g=f,g=x(f=na(d,f))?b+(na("/",f)||f):a+g):x(f=na(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function ec(a,b,d){id(a,this);
1453 a);if(!F(d))throw Eb("ipthprfx",a,b);jd(d,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Rb(this.$$search),d=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(a?"?"+a:"")+d;this.$$absUrl=b+this.$$url.substr(1)};this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;x(f=na(a,c))?(g=f,g=x(f=na(d,f))?b+(na("/",f)||f):a+g):x(f=na(b,c))?g=b+f:b==c+"/"&&(g=b);g&&this.$$parse(g);return!!g}}function ec(a,b,d){id(a,this);
1454 this.$$parse=function(c){var e=na(a,c)||na(b,c),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(a=c,this.replace())):(f=na(d,e),y(f)&&(f=e));jd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=
1454 this.$$parse=function(c){var e=na(a,c)||na(b,c),f;y(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",y(e)&&(a=c,this.replace())):(f=na(d,e),y(f)&&(f=e));jd(f,this);c=this.$$path;var e=a,g=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));g.exec(f)||(c=(f=g.exec(c))?f[1]:c);this.$$path=c;this.$$compose()};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+(this.$$url?d+this.$$url:"")};this.$$parseLinkUrl=
1455 function(b,d){return Ia(a)==Ia(b)?(this.$$parse(b),!0):!1}}function kd(a,b,d){this.$$html5=!0;ec.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Ia(c)?f=c:(g=na(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Fb(a){return function(){return this[a]}}function ld(a,
1455 function(b,d){return Ia(a)==Ia(b)?(this.$$parse(b),!0):!1}}function kd(a,b,d){this.$$html5=!0;ec.apply(this,arguments);this.$$parseLinkUrl=function(c,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;a==Ia(c)?f=c:(g=na(b,c))?f=a+d+g:b===c+"/"&&(f=b);f&&this.$$parse(f);return!!f};this.$$compose=function(){var b=Rb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=cc(this.$$path)+(b?"?"+b:"")+e;this.$$absUrl=a+d+this.$$url}}function Fb(a){return function(){return this[a]}}function ld(a,
1456 b){return function(d){if(y(d))return this[a];this[a]=b(d);this.$$compose();return this}}function qf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return x(b)?(a=b,this):a};this.html5Mode=function(a){return Da(a)?(b.enabled=a,this):G(a)?(Da(a.enabled)&&(b.enabled=a.enabled),Da(a.requireBase)&&(b.requireBase=a.requireBase),Da(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,
1456 b){return function(d){if(y(d))return this[a];this[a]=b(d);this.$$compose();return this}}function qf(){var a="",b={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(b){return x(b)?(a=b,this):a};this.html5Mode=function(a){return Da(a)?(b.enabled=a,this):G(a)?(Da(a.enabled)&&(b.enabled=a.enabled),Da(a.requireBase)&&(b.requireBase=a.requireBase),Da(a.rewriteLinks)&&(b.rewriteLinks=a.rewriteLinks),this):b};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(d,
1457 c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,n;n=c.baseHref();var m=c.url(),r;if(b.enabled){if(!n&&b.requireBase)throw Eb("nobase");r=m.substring(0,m.indexOf("/",m.indexOf("//")+2))+(n||"/");n=e.history?dc:kd}else r=Ia(m),n=ec;var N=r.substr(0,Ia(r).lastIndexOf("/")+1);l=new n(r,N,"#"+a);l.$$parseLinkUrl(m,m);l.$$state=c.state();
1457 c,e,f,g){function h(a,b,d){var e=l.url(),f=l.$$state;try{c.url(a,b,d),l.$$state=c.state()}catch(g){throw l.url(e),l.$$state=f,g;}}function k(a,b){d.$broadcast("$locationChangeSuccess",l.absUrl(),a,l.$$state,b)}var l,n;n=c.baseHref();var m=c.url(),r;if(b.enabled){if(!n&&b.requireBase)throw Eb("nobase");r=m.substring(0,m.indexOf("/",m.indexOf("//")+2))+(n||"/");n=e.history?dc:kd}else r=Ia(m),n=ec;var N=r.substr(0,Ia(r).lastIndexOf("/")+1);l=new n(r,N,"#"+a);l.$$parseLinkUrl(m,m);l.$$state=c.state();
1458 var q=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=B(a.target);"a"!==va(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");G(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=ra(h.animVal).href);q.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=
1458 var q=/^\s*(javascript|mailto):/i;f.on("click",function(a){if(b.rewriteLinks&&!a.ctrlKey&&!a.metaKey&&!a.shiftKey&&2!=a.which&&2!=a.button){for(var e=B(a.target);"a"!==va(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),k=e.attr("href")||e.attr("xlink:href");G(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=ra(h.animVal).href);q.test(h)||!h||e.attr("target")||a.isDefaultPrevented()||!l.$$parseLinkUrl(h,k)||(a.preventDefault(),l.absUrl()!=c.url()&&(d.$apply(),g.angular["ff-684208-preventDefault"]=
1459 !0))}});hb(l.absUrl())!=hb(m)&&c.url(l.absUrl(),!0);var w=!0;c.onUrlChange(function(a,b){y(na(N,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=hb(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(w=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=hb(c.url()),b=hb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(w||
1459 !0))}});hb(l.absUrl())!=hb(m)&&c.url(l.absUrl(),!0);var w=!0;c.onUrlChange(function(a,b){y(na(N,a))?g.location.href=a:(d.$evalAsync(function(){var c=l.absUrl(),e=l.$$state,f;a=hb(a);l.$$parse(a);l.$$state=b;f=d.$broadcast("$locationChangeStart",a,c,b,e).defaultPrevented;l.absUrl()===a&&(f?(l.$$parse(c),l.$$state=e,h(c,!1,e)):(w=!1,k(c,e)))}),d.$$phase||d.$digest())});d.$watch(function(){var a=hb(c.url()),b=hb(l.absUrl()),f=c.state(),g=l.$$replace,m=a!==b||l.$$html5&&e.history&&f!==l.$$state;if(w||
1460 m)w=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))});l.$$replace=!1});return l}]}function rf(){var a=!0,b=this;this.debugEnabled=function(b){return x(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&
1460 m)w=!1,d.$evalAsync(function(){var b=l.absUrl(),c=d.$broadcast("$locationChangeStart",b,a,l.$$state,f).defaultPrevented;l.absUrl()===b&&(c?(l.$$parse(a),l.$$state=f):(m&&h(b,g,f===l.$$state?null:l.$$state),k(a,f)))});l.$$replace=!1});return l}]}function rf(){var a=!0,b=this;this.debugEnabled=function(b){return x(b)?(a=b,this):a};this.$get=["$window",function(d){function c(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&
1461 (a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||C;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];q(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Ta(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===
1461 (a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=d.console||{},e=b[a]||b.log||C;a=!1;try{a=!!e.apply}catch(k){}return a?function(){var a=[];q(arguments,function(b){a.push(c(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){a&&c.apply(b,arguments)}}()}}]}function Ta(a,b){if("__defineGetter__"===a||"__defineSetter__"===a||"__lookupGetter__"===a||"__lookupSetter__"===
1462 a||"__proto__"===a)throw ca("isecfld",b);return a}function fg(a){return a+""}function sa(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a.window===a)throw ca("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ca("isecdom",b);if(a===Object)throw ca("isecobj",b);}return a}function md(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a===gg||a===hg||a===ig)throw ca("isecff",b);}}function Gb(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||
1462 a||"__proto__"===a)throw ca("isecfld",b);return a}function fg(a){return a+""}function sa(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a.window===a)throw ca("isecwindow",b);if(a.children&&(a.nodeName||a.prop&&a.attr&&a.find))throw ca("isecdom",b);if(a===Object)throw ca("isecobj",b);}return a}function md(a,b){if(a){if(a.constructor===a)throw ca("isecfn",b);if(a===gg||a===hg||a===ig)throw ca("isecff",b);}}function Gb(a,b){if(a&&(a===(0).constructor||a===(!1).constructor||a==="".constructor||
1463 a==={}.constructor||a===[].constructor||a===Function.constructor))throw ca("isecaf",b);}function jg(a,b){return"undefined"!==typeof a?a:b}function nd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function aa(a,b){var d,c;switch(a.type){case s.Program:d=!0;q(a.body,function(a){aa(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:aa(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;
1463 a==={}.constructor||a===[].constructor||a===Function.constructor))throw ca("isecaf",b);}function jg(a,b){return"undefined"!==typeof a?a:b}function nd(a,b){return"undefined"===typeof a?b:"undefined"===typeof b?a:a+b}function aa(a,b){var d,c;switch(a.type){case s.Program:d=!0;q(a.body,function(a){aa(a.expression,b);d=d&&a.expression.constant});a.constant=d;break;case s.Literal:a.constant=!0;a.toWatch=[];break;case s.UnaryExpression:aa(a.argument,b);a.constant=a.argument.constant;a.toWatch=a.argument.toWatch;
1464 break;case s.BinaryExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:aa(a.test,b);aa(a.alternate,b);aa(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=
1464 break;case s.BinaryExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.left.toWatch.concat(a.right.toWatch);break;case s.LogicalExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;a.toWatch=a.constant?[]:[a];break;case s.ConditionalExpression:aa(a.test,b);aa(a.alternate,b);aa(a.consequent,b);a.constant=a.test.constant&&a.alternate.constant&&a.consequent.constant;a.toWatch=a.constant?[]:[a];break;case s.Identifier:a.constant=
1465 !1;a.toWatch=[a];break;case s.MemberExpression:aa(a.object,b);a.computed&&aa(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];q(a.arguments,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;
1465 !1;a.toWatch=[a];break;case s.MemberExpression:aa(a.object,b);a.computed&&aa(a.property,b);a.constant=a.object.constant&&(!a.computed||a.property.constant);a.toWatch=[a];break;case s.CallExpression:d=a.filter?!b(a.callee.name).$stateful:!1;c=[];q(a.arguments,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=a.filter&&!b(a.callee.name).$stateful?c:[a];break;case s.AssignmentExpression:aa(a.left,b);aa(a.right,b);a.constant=a.left.constant&&a.right.constant;
1466 a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];q(a.elements,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];q(a.properties,function(a){aa(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1;a.toWatch=[];break;case s.LocalsExpression:a.constant=!1,a.toWatch=[]}}function od(a){if(1==a.length){a=a[0].expression;
1466 a.toWatch=[a];break;case s.ArrayExpression:d=!0;c=[];q(a.elements,function(a){aa(a,b);d=d&&a.constant;a.constant||c.push.apply(c,a.toWatch)});a.constant=d;a.toWatch=c;break;case s.ObjectExpression:d=!0;c=[];q(a.properties,function(a){aa(a.value,b);d=d&&a.value.constant;a.value.constant||c.push.apply(c,a.value.toWatch)});a.constant=d;a.toWatch=c;break;case s.ThisExpression:a.constant=!1;a.toWatch=[];break;case s.LocalsExpression:a.constant=!1,a.toWatch=[]}}function od(a){if(1==a.length){a=a[0].expression;
1467 var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function pd(a){return a.type===s.Identifier||a.type===s.MemberExpression}function qd(a){if(1===a.body.length&&pd(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function sd(a,
1467 var b=a.toWatch;return 1!==b.length?b:b[0]!==a?b:void 0}}function pd(a){return a.type===s.Identifier||a.type===s.MemberExpression}function qd(a){if(1===a.body.length&&pd(a.body[0].expression))return{type:s.AssignmentExpression,left:a.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(a){return 0===a.body.length||1===a.body.length&&(a.body[0].expression.type===s.Literal||a.body[0].expression.type===s.ArrayExpression||a.body[0].expression.type===s.ObjectExpression)}function sd(a,
1468 b){this.astBuilder=a;this.$filter=b}function td(a,b){this.astBuilder=a;this.$filter=b}function Hb(a){return"constructor"==a}function fc(a){return E(a.valueOf)?a.valueOf():kg.call(a)}function sf(){var a=T(),b=T(),d={"true":!0,"false":!1,"null":null,undefined:void 0},c,e;this.addLiteral=function(a,b){d[a]=b};this.setIdentifierFns=function(a,b){c=a;e=b;return this};this.$get=["$filter",function(f){function g(c,d,e){var g,k,D;e=e||H;switch(typeof c){case "string":D=c=c.trim();var q=e?b:a;g=q[D];if(!g){":"===
1468 b){this.astBuilder=a;this.$filter=b}function td(a,b){this.astBuilder=a;this.$filter=b}function Hb(a){return"constructor"==a}function fc(a){return E(a.valueOf)?a.valueOf():kg.call(a)}function sf(){var a=T(),b=T(),d={"true":!0,"false":!1,"null":null,undefined:void 0},c,e;this.addLiteral=function(a,b){d[a]=b};this.setIdentifierFns=function(a,b){c=a;e=b;return this};this.$get=["$filter",function(f){function g(c,d,e){var g,k,D;e=e||H;switch(typeof c){case "string":D=c=c.trim();var q=e?b:a;g=q[D];if(!g){":"===
1469 c.charAt(0)&&":"===c.charAt(1)&&(k=!0,c=c.substring(2));g=e?p:w;var S=new gc(g);g=(new hc(S,f,g)).parse(c);g.constant?g.$$watchDelegate=r:k?g.$$watchDelegate=g.literal?m:n:g.inputs&&(g.$$watchDelegate=l);e&&(g=h(g));q[D]=g}return N(g,d);case "function":return N(c,d);default:return N(C,d)}}function h(a){function b(c,d,e,f){var g=H;H=!0;try{return a(c,d,e,f)}finally{H=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=h(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&
1469 c.charAt(0)&&":"===c.charAt(1)&&(k=!0,c=c.substring(2));g=e?p:w;var S=new gc(g);g=(new hc(S,f,g)).parse(c);g.constant?g.$$watchDelegate=r:k?g.$$watchDelegate=g.literal?m:n:g.inputs&&(g.$$watchDelegate=l);e&&(g=h(g));q[D]=g}return N(g,d);case "function":return N(c,d);default:return N(C,d)}}function h(a){function b(c,d,e,f){var g=H;H=!0;try{return a(c,d,e,f)}finally{H=g}}if(!a)return a;b.$$watchDelegate=a.$$watchDelegate;b.assign=h(a.assign);b.constant=a.constant;b.literal=a.literal;for(var c=0;a.inputs&&
1470 c<a.inputs.length;++c)a.inputs[c]=h(a.inputs[c]);b.inputs=a.inputs;return b}function k(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function l(a,b,c,d,e){var f=d.inputs,g;if(1===f.length){var h=k,f=f[0];return a.$watch(function(a){var b=f(a);k(b,h)||(g=d(a,void 0,void 0,[b]),h=b&&fc(b));return g},b,c,e)}for(var l=[],m=[],n=0,r=f.length;n<r;n++)l[n]=k,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var h=f[c](a);
1470 c<a.inputs.length;++c)a.inputs[c]=h(a.inputs[c]);b.inputs=a.inputs;return b}function k(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function l(a,b,c,d,e){var f=d.inputs,g;if(1===f.length){var h=k,f=f[0];return a.$watch(function(a){var b=f(a);k(b,h)||(g=d(a,void 0,void 0,[b]),h=b&&fc(b));return g},b,c,e)}for(var l=[],m=[],n=0,r=f.length;n<r;n++)l[n]=k,m[n]=null;return a.$watch(function(a){for(var b=!1,c=0,e=f.length;c<e;c++){var h=f[c](a);
1471 if(b||(b=!k(h,l[c])))m[c]=h,l[c]=h&&fc(h)}b&&(g=d(a,void 0,void 0,m));return g},b,c,e)}function n(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;E(b)&&b.apply(this,arguments);x(a)&&d.$$postDigest(function(){x(f)&&e()})},c)}function m(a,b,c,d){function e(a){var b=!0;q(a,function(a){x(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;E(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function r(a,b,c,d){var e;
1471 if(b||(b=!k(h,l[c])))m[c]=h,l[c]=h&&fc(h)}b&&(g=d(a,void 0,void 0,m));return g},b,c,e)}function n(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;E(b)&&b.apply(this,arguments);x(a)&&d.$$postDigest(function(){x(f)&&e()})},c)}function m(a,b,c,d){function e(a){var b=!0;q(a,function(a){x(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;E(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function r(a,b,c,d){var e;
1472 return e=a.$watch(function(a){e();return d(a)},b,c)}function N(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,c=c!==m&&c!==n?function(c,e,f,g){f=d&&g?g[0]:a(c,e,f,g);return b(f,c,e)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return x(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==l?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=l,d=!a.inputs,c.inputs=a.inputs?a.inputs:[a]);return c}var M=Ea().noUnsafeEval,w={csp:M,expensiveChecks:!1,literals:qa(d),isIdentifierStart:E(c)&&c,
1472 return e=a.$watch(function(a){e();return d(a)},b,c)}function N(a,b){if(!b)return a;var c=a.$$watchDelegate,d=!1,c=c!==m&&c!==n?function(c,e,f,g){f=d&&g?g[0]:a(c,e,f,g);return b(f,c,e)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return x(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==l?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=l,d=!a.inputs,c.inputs=a.inputs?a.inputs:[a]);return c}var M=Ea().noUnsafeEval,w={csp:M,expensiveChecks:!1,literals:qa(d),isIdentifierStart:E(c)&&c,
1473 isIdentifierContinue:E(e)&&e},p={csp:M,expensiveChecks:!0,literals:qa(d),isIdentifierStart:E(c)&&c,isIdentifierContinue:E(e)&&e},H=!1;g.$$runningExpensiveChecks=function(){return H};return g}]}function uf(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return ud(function(b){a.$evalAsync(b)},b)}]}function vf(){this.$get=["$browser","$exceptionHandler",function(a,b){return ud(function(b){a.defer(b)},b)}]}function ud(a,b){function d(){this.$$state={status:0}}function c(a,b){return function(c){b.call(a,
1473 isIdentifierContinue:E(e)&&e},p={csp:M,expensiveChecks:!0,literals:qa(d),isIdentifierStart:E(c)&&c,isIdentifierContinue:E(e)&&e},H=!1;g.$$runningExpensiveChecks=function(){return H};return g}]}function uf(){this.$get=["$rootScope","$exceptionHandler",function(a,b){return ud(function(b){a.$evalAsync(b)},b)}]}function vf(){this.$get=["$browser","$exceptionHandler",function(a,b){return ud(function(b){a.defer(b)},b)}]}function ud(a,b){function d(){this.$$state={status:0}}function c(a,b){return function(c){b.call(a,
1474 c)}}function e(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,a(function(){var a,d,e;e=c.pending;c.processScheduled=!1;c.pending=void 0;for(var f=0,g=e.length;f<g;++f){d=e[f][0];a=e[f][c.status];try{E(a)?d.resolve(a(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),b(h)}}}))}function f(){this.promise=new d}var g=O("$q",TypeError);R(d.prototype,{then:function(a,b,c){if(y(a)&&y(b)&&y(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
1474 c)}}function e(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,a(function(){var a,d,e;e=c.pending;c.processScheduled=!1;c.pending=void 0;for(var f=0,g=e.length;f<g;++f){d=e[f][0];a=e[f][c.status];try{E(a)?d.resolve(a(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),b(h)}}}))}function f(){this.promise=new d}var g=O("$q",TypeError);R(d.prototype,{then:function(a,b,c){if(y(a)&&y(b)&&y(c))return this;var d=new f;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
1475 a,b,c]);0<this.$$state.status&&e(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});R(f.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(a){function d(a){k||(k=!0,h.$$resolve(a))}function f(a){k||(k=!0,h.$$reject(a))}var g,h=this,k=!1;try{if(G(a)||E(a))g=a&&a.then;E(g)?
1475 a,b,c]);0<this.$$state.status&&e(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}});R(f.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(a){function d(a){k||(k=!0,h.$$resolve(a))}function f(a){k||(k=!0,h.$$reject(a))}var g,h=this,k=!1;try{if(G(a)||E(a))g=a&&a.then;E(g)?
1476 (this.promise.$$state.status=-1,g.call(a,d,f,c(this,this.notify))):(this.promise.$$state.value=a,this.promise.$$state.status=1,e(this.promise.$$state))}catch(l){f(l),b(l)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;e(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;f<g;f++){e=d[f][0];
1476 (this.promise.$$state.status=-1,g.call(a,d,f,c(this,this.notify))):(this.promise.$$state.value=a,this.promise.$$state.status=1,e(this.promise.$$state))}catch(l){f(l),b(l)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;e(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&a(function(){for(var a,e,f=0,g=d.length;f<g;f++){e=d[f][0];
1477 a=d[f][3];try{e.notify(E(a)?a(c):c)}catch(h){b(h)}}})}});var h=function(a,b){var c=new f;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{E(c)&&(d=c())}catch(e){return h(e,!1)}return d&&E(d.then)?d.then(function(){return h(a,b)},function(a){return h(a,!1)}):h(a,b)},l=function(a,b,c,d){var e=new f;e.resolve(a);return e.promise.then(b,c,d)},n=function(a){if(!E(a))throw g("norslvr",a);var b=new f;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};n.prototype=
1477 a=d[f][3];try{e.notify(E(a)?a(c):c)}catch(h){b(h)}}})}});var h=function(a,b){var c=new f;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{E(c)&&(d=c())}catch(e){return h(e,!1)}return d&&E(d.then)?d.then(function(){return h(a,b)},function(a){return h(a,!1)}):h(a,b)},l=function(a,b,c,d){var e=new f;e.resolve(a);return e.promise.then(b,c,d)},n=function(a){if(!E(a))throw g("norslvr",a);var b=new f;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};n.prototype=
1478 d.prototype;n.defer=function(){var a=new f;a.resolve=c(a,a.resolve);a.reject=c(a,a.reject);a.notify=c(a,a.notify);return a};n.reject=function(a){var b=new f;b.reject(a);return b.promise};n.when=l;n.resolve=l;n.all=function(a){var b=new f,c=0,d=K(a)?[]:{};q(a,function(a,e){c++;l(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return n}function Ef(){this.$get=["$window","$timeout",function(a,
1478 d.prototype;n.defer=function(){var a=new f;a.resolve=c(a,a.resolve);a.reject=c(a,a.reject);a.notify=c(a,a.notify);return a};n.reject=function(a){var b=new f;b.reject(a);return b.promise};n.when=l;n.resolve=l;n.all=function(a){var b=new f,c=0,d=K(a)?[]:{};q(a,function(a,e){c++;l(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return n}function Ef(){this.$get=["$window","$timeout",function(a,
1479 b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function tf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=
1479 b){var d=a.requestAnimationFrame||a.webkitRequestAnimationFrame,c=a.cancelAnimationFrame||a.webkitCancelAnimationFrame||a.webkitCancelRequestAnimationFrame,e=!!d,f=e?function(a){var b=d(a);return function(){c(b)}}:function(a){var c=b(a,16.66,!1);return function(){b.cancel(c)}};f.supported=e;return f}]}function tf(){function a(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=
1480 null}b.prototype=a;return b}var b=10,d=O("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,h){function k(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=
1480 null}b.prototype=a;return b}var b=10,d=O("$rootScope"),c=null,e=null;this.digestTtl=function(a){arguments.length&&(b=a);return b};this.$get=["$exceptionHandler","$parse","$browser",function(f,g,h){function k(a){a.currentScope.$$destroyed=!0}function l(a){9===Ca&&(a.$$childHead&&l(a.$$childHead),a.$$nextSibling&&l(a.$$nextSibling));a.$parent=a.$$nextSibling=a.$$prevSibling=a.$$childHead=a.$$childTail=a.$root=a.$$watchers=null}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=
1481 this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function m(a){if(H.$$phase)throw d("inprog",H.$$phase);H.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function N(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function w(){for(;u.length;)try{u.shift()()}catch(a){f(a)}e=
1481 this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function m(a){if(H.$$phase)throw d("inprog",H.$$phase);H.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function N(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function s(){}function w(){for(;u.length;)try{u.shift()()}catch(a){f(a)}e=
1482 null}function p(){null===e&&(e=h.defer(function(){H.$apply(w)}))}n.prototype={constructor:n,$new:function(b,c){var d;c=c||this;b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,d,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,
1482 null}function p(){null===e&&(e=h.defer(function(){H.$apply(w)}))}n.prototype={constructor:n,$new:function(b,c){var d;c=c||this;b?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=a(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(b||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,d,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,d,f,
1483 a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||a,eq:!!d};c=null;E(b)||(l.fn=C);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=Za(k,l)&&r(h,-1);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});q(a,function(a,
1483 a);var h=this,k=h.$$watchers,l={fn:b,last:s,get:f,exp:e||a,eq:!!d};c=null;E(b)||(l.fn=C);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=Za(k,l)&&r(h,-1);c=null}},$watchGroup:function(a,b){function c(){h=!1;k?(k=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,k=!0;if(!a.length){var l=!0;g.$evalAsync(function(){l&&b(e,e,g)});return function(){l=!1}}if(1===a.length)return this.$watch(a[0],function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});q(a,function(a,
1484 b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!y(e)){if(G(e))if(ya(e))for(f!==m&&(f=m,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==r&&(f=r={},t=0,l++);a=0;for(b in e)ua.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>
1484 b){var k=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(k)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!y(e)){if(G(e))if(ya(e))for(f!==m&&(f=m,t=f.length=0,l++),a=e.length,t!==a&&(l++,f.length=t=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(l++,f[b]=g);else{f!==r&&(f=r={},t=0,l++);a=0;for(b in e)ua.call(e,b)&&(a++,g=e[b],h=f[b],b in f?(d=h!==h&&g!==g,d||h===g||(l++,f[b]=g)):(t++,f[b]=g,l++));if(t>
1485 a)for(b in l++,f)ua.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,n=g(a,c),m=[],r={},p=!0,t=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,h,d);if(k)if(G(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ua.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,k,l,n,r,p,q,N=b,u,x=[],y,v;m("$digest");h.$$checkUrlChange();this===H&&null!==e&&(h.defer.cancel(e),w());c=null;do{q=!1;
1485 a)for(b in l++,f)ua.call(e,b)||(t--,delete f[b])}else f!==e&&(f=e,l++);return l}}c.$stateful=!0;var d=this,e,f,h,k=1<b.length,l=0,n=g(a,c),m=[],r={},p=!0,t=0;return this.$watch(n,function(){p?(p=!1,b(e,e,d)):b(e,h,d);if(k)if(G(e))if(ya(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h={},e)ua.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var a,g,k,l,n,r,p,q,N=b,u,x=[],y,v;m("$digest");h.$$checkUrlChange();this===H&&null!==e&&(h.defer.cancel(e),w());c=null;do{q=!1;
1486 for(u=this;t.length;){try{v=t.shift(),v.scope.$eval(v.expression,v.locals)}catch(C){f(C)}c=null}a:do{if(r=u.$$watchers)for(p=r.length;p--;)try{if(a=r[p])if(n=a.get,(g=n(u))!==(k=a.last)&&!(a.eq?pa(g,k):"number"===typeof g&&"number"===typeof k&&isNaN(g)&&isNaN(k)))q=!0,c=a,a.last=a.eq?qa(g,null):g,l=a.fn,l(g,k===s?g:k,u),5>N&&(y=4-N,x[y]||(x[y]=[]),x[y].push({msg:E(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}));else if(a===c){q=!1;break a}}catch(F){f(F)}if(!(r=u.$$watchersCount&&
1486 for(u=this;t.length;){try{v=t.shift(),v.scope.$eval(v.expression,v.locals)}catch(C){f(C)}c=null}a:do{if(r=u.$$watchers)for(p=r.length;p--;)try{if(a=r[p])if(n=a.get,(g=n(u))!==(k=a.last)&&!(a.eq?pa(g,k):"number"===typeof g&&"number"===typeof k&&isNaN(g)&&isNaN(k)))q=!0,c=a,a.last=a.eq?qa(g,null):g,l=a.fn,l(g,k===s?g:k,u),5>N&&(y=4-N,x[y]||(x[y]=[]),x[y].push({msg:E(a.exp)?"fn: "+(a.exp.name||a.exp.toString()):a.exp,newVal:g,oldVal:k}));else if(a===c){q=!1;break a}}catch(F){f(F)}if(!(r=u.$$watchersCount&&
1487 u.$$childHead||u!==this&&u.$$nextSibling))for(;u!==this&&!(r=u.$$nextSibling);)u=u.$parent}while(u=r);if((q||t.length)&&!N--)throw H.$$phase=null,d("infdig",b,x);}while(q||t.length);for(H.$$phase=null;z.length;)try{z.shift()()}catch(B){f(B)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===H&&h.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)N(this,this.$$listenerCount[b],b);a&&a.$$childHead==
1487 u.$$childHead||u!==this&&u.$$nextSibling))for(;u!==this&&!(r=u.$$nextSibling);)u=u.$parent}while(u=r);if((q||t.length)&&!N--)throw H.$$phase=null,d("infdig",b,x);}while(q||t.length);for(H.$$phase=null;z.length;)try{z.shift()()}catch(B){f(B)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===H&&h.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)N(this,this.$$listenerCount[b],b);a&&a.$$childHead==
1488 this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=C;this.$on=this.$watch=this.$watchGroup=function(){return C};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){H.$$phase||
1488 this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=C;this.$on=this.$watch=this.$watchGroup=function(){return C};this.$$listeners={};this.$$nextSibling=null;l(this)}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){H.$$phase||
1489 t.length||h.defer(function(){t.length&&H.$digest()});t.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){z.push(a)},$apply:function(a){try{m("$apply");try{return this.$eval(a)}finally{H.$$phase=null}}catch(b){f(b)}finally{try{H.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&u.push(b);a=g(a);p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=
1489 t.length||h.defer(function(){t.length&&H.$digest()});t.push({scope:this,expression:g(a),locals:b})},$$postDigest:function(a){z.push(a)},$apply:function(a){try{m("$apply");try{return this.$eval(a)}finally{H.$$phase=null}}catch(b){f(b)}finally{try{H.$digest()}catch(c){throw f(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&u.push(b);a=g(a);p()},$on:function(a,b){var c=this.$$listeners[a];c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=
1490 0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,N(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=$a([h],arguments,1),l,n;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(m){f(m)}else d.splice(l,1),l--,n--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);
1490 0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,N(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,g=!1,h={name:a,targetScope:e,stopPropagation:function(){g=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},k=$a([h],arguments,1),l,n;do{d=e.$$listeners[a]||c;h.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(m){f(m)}else d.splice(l,1),l--,n--;if(g)return h.currentScope=null,h;e=e.$parent}while(e);
1491 h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=$a([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=
1491 h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var g=$a([e],arguments,1),h,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(k=d.length;h<k;h++)if(d[h])try{d[h].apply(null,g)}catch(l){f(l)}else d.splice(h,1),h--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=
1492 null;return e}};var H=new n,t=H.$$asyncQueue=[],z=H.$$postDigestQueue=[],u=H.$$applyAsyncQueue=[];return H}]}function me(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return x(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f;f=ra(d).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function lg(a){if("self"===a)return a;
1492 null;return e}};var H=new n,t=H.$$asyncQueue=[],z=H.$$postDigestQueue=[],u=H.$$applyAsyncQueue=[];return H}]}function me(){var a=/^\s*(https?|ftp|mailto|tel|file):/,b=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(b){return x(b)?(a=b,this):a};this.imgSrcSanitizationWhitelist=function(a){return x(a)?(b=a,this):b};this.$get=function(){return function(d,c){var e=c?b:a,f;f=ra(d).href;return""===f||f.match(e)?d:"unsafe:"+f}}}function lg(a){if("self"===a)return a;
1493 if(F(a)){if(-1<a.indexOf("***"))throw ta("iwcard",a);a=vd(a).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+a+"$")}if(Wa(a))return new RegExp("^"+a.source+"$");throw ta("imatcher");}function wd(a){var b=[];x(a)&&q(a,function(a){b.push(lg(a))});return b}function xf(){this.SCE_CONTEXTS=oa;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=wd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=wd(a));return b};this.$get=["$injector",
1493 if(F(a)){if(-1<a.indexOf("***"))throw ta("iwcard",a);a=vd(a).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+a+"$")}if(Wa(a))return new RegExp("^"+a.source+"$");throw ta("imatcher");}function wd(a){var b=[];x(a)&&q(a,function(a){b.push(lg(a))});return b}function xf(){this.SCE_CONTEXTS=oa;var a=["self"],b=[];this.resourceUrlWhitelist=function(b){arguments.length&&(a=wd(b));return a};this.resourceUrlBlacklist=function(a){arguments.length&&(b=wd(a));return b};this.$get=["$injector",
1494 function(d){function c(a,b){return"self"===a?hd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw ta("unsafe");};d.has("$sanitize")&&(f=d.get("$sanitize"));var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=
1494 function(d){function c(a,b){return"self"===a?hd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw ta("unsafe");};d.has("$sanitize")&&(f=d.get("$sanitize"));var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=
1495 e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw ta("icontext",a,b);if(null===b||y(b)||""===b)return b;if("string"!==typeof b)throw ta("itype",a);return new c(b)},getTrusted:function(d,e){if(null===e||y(e)||""===e)return e;var g=h.hasOwnProperty(d)?h[d]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(d===oa.RESOURCE_URL){var g=ra(e.toString()),m,r,q=!1;m=0;for(r=a.length;m<r;m++)if(c(a[m],g)){q=!0;break}if(q)for(m=0,r=b.length;m<r;m++)if(c(b[m],
1495 e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw ta("icontext",a,b);if(null===b||y(b)||""===b)return b;if("string"!==typeof b)throw ta("itype",a);return new c(b)},getTrusted:function(d,e){if(null===e||y(e)||""===e)return e;var g=h.hasOwnProperty(d)?h[d]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(d===oa.RESOURCE_URL){var g=ra(e.toString()),m,r,q=!1;m=0;for(r=a.length;m<r;m++)if(c(a[m],g)){q=!0;break}if(q)for(m=0,r=b.length;m<r;m++)if(c(b[m],
1496 g)){q=!1;break}if(q)return e;throw ta("insecurl",e.toString());}if(d===oa.HTML)return f(e);throw ta("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function wf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw ta("iequirks");var c=ha(oa);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},
1496 g)){q=!1;break}if(q)return e;throw ta("insecurl",e.toString());}if(d===oa.HTML)return f(e);throw ta("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function wf(){var a=!0;this.enabled=function(b){arguments.length&&(a=!!b);return a};this.$get=["$parse","$sceDelegate",function(b,d){if(a&&8>Ca)throw ta("iequirks");var c=ha(oa);c.isEnabled=function(){return a};c.trustAs=d.trustAs;c.getTrusted=d.getTrusted;c.valueOf=d.valueOf;a||(c.trustAs=c.getTrusted=function(a,b){return b},
1497 c.valueOf=Xa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;q(oa,function(a,b){var d=P(b);c[cb("parse_as_"+d)]=function(b){return e(a,b)};c[cb("get_trusted_"+d)]=function(b){return f(a,b)};c[cb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function yf(){this.$get=["$window","$document",function(a,b){var d={},c=!(a.chrome&&a.chrome.app&&a.chrome.app.runtime)&&a.history&&a.history.pushState,
1497 c.valueOf=Xa);c.parseAs=function(a,d){var e=b(d);return e.literal&&e.constant?e:b(d,function(b){return c.getTrusted(a,b)})};var e=c.parseAs,f=c.getTrusted,g=c.trustAs;q(oa,function(a,b){var d=P(b);c[cb("parse_as_"+d)]=function(b){return e(a,b)};c[cb("get_trusted_"+d)]=function(b){return f(a,b)};c[cb("trust_as_"+d)]=function(b){return g(a,b)}});return c}]}function yf(){this.$get=["$window","$document",function(a,b){var d={},c=!(a.chrome&&a.chrome.app&&a.chrome.app.runtime)&&a.history&&a.history.pushState,
1498 e=X((/android (\d+)/.exec(P((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h,k=/^(Moz|webkit|ms)(?=[A-Z])/,l=g.body&&g.body.style,n=!1,m=!1;if(l){for(var r in l)if(n=k.exec(r)){h=n[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");n=!!("transition"in l||h+"Transition"in l);m=!!("animation"in l||h+"Animation"in l);!e||n&&m||(n=F(l.webkitTransition),m=F(l.webkitAnimation))}return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===
1498 e=X((/android (\d+)/.exec(P((a.navigator||{}).userAgent))||[])[1]),f=/Boxee/i.test((a.navigator||{}).userAgent),g=b[0]||{},h,k=/^(Moz|webkit|ms)(?=[A-Z])/,l=g.body&&g.body.style,n=!1,m=!1;if(l){for(var r in l)if(n=k.exec(r)){h=n[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");n=!!("transition"in l||h+"Transition"in l);m=!!("animation"in l||h+"Animation"in l);!e||n&&m||(n=F(l.webkitTransition),m=F(l.webkitAnimation))}return{history:!(!c||4>e||f),hasEvent:function(a){if("input"===
1499 a&&11>=Ca)return!1;if(y(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:h,transitions:n,animations:m,android:e}}]}function Af(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++;F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;K(k)?k=k.filter(function(a){return a!==ac}):k===ac&&(k=null);return d.get(g,
1499 a&&11>=Ca)return!1;if(y(d[a])){var b=g.createElement("div");d[a]="on"+a in b}return d[a]},csp:Ea(),vendorPrefix:h,transitions:n,animations:m,android:e}}]}function Af(){var a;this.httpOptions=function(b){return b?(a=b,this):a};this.$get=["$templateCache","$http","$q","$sce",function(b,d,c,e){function f(g,h){f.totalPendingRequests++;F(g)&&b.get(g)||(g=e.getTrustedResourceUrl(g));var k=d.defaults&&d.defaults.transformResponse;K(k)?k=k.filter(function(a){return a!==ac}):k===ac&&(k=null);return d.get(g,
1500 R({cache:b,transformResponse:k},a))["finally"](function(){f.totalPendingRequests--}).then(function(a){b.put(g,a.data);return a.data},function(a){if(!h)throw mg("tpload",g,a.status,a.statusText);return c.reject(a)})}f.totalPendingRequests=0;return f}]}function Bf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=ea.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+
1500 R({cache:b,transformResponse:k},a))["finally"](function(){f.totalPendingRequests--}).then(function(a){b.put(g,a.data);return a.data},function(a){if(!h)throw mg("tpload",g,a.status,a.statusText);return c.reject(a)})}f.totalPendingRequests=0;return f}]}function Bf(){this.$get=["$rootScope","$browser","$location",function(a,b,d){return{findBindings:function(a,b,d){a=a.getElementsByClassName("ng-binding");var g=[];q(a,function(a){var c=ea.element(a).data("$binding");c&&q(c,function(c){d?(new RegExp("(^|\\s)"+
1501 vd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(d?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function Cf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",
1501 vd(b)+"(\\s|\\||$)")).test(c)&&g.push(a):-1!=c.indexOf(b)&&g.push(a)})});return g},findModels:function(a,b,d){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var k=a.querySelectorAll("["+g[h]+"model"+(d?"=":"*=")+'"'+b+'"]');if(k.length)return k}},getLocation:function(){return d.url()},setLocation:function(b){b!==d.url()&&(d.url(b),a.$digest())},whenStable:function(a){b.notifyWhenNoOutstandingRequests(a)}}}]}function Cf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",
1502 function(a,b,d,c,e){function f(f,k,l){E(f)||(l=k,k=f,f=C);var n=za.call(arguments,3),m=x(l)&&!l,r=(m?c:d).defer(),q=r.promise,s;s=b.defer(function(){try{r.resolve(f.apply(null,n))}catch(b){r.reject(b),e(b)}finally{delete g[q.$$timeoutId]}m||a.$apply()},k);q.$$timeoutId=s;g[s]=r;return q}var g={};f.cancel=function(a){return a&&a.$$timeoutId in g?(g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1};return f}]}function ra(a){Ca&&(Y.setAttribute("href",a),a=
1502 function(a,b,d,c,e){function f(f,k,l){E(f)||(l=k,k=f,f=C);var n=za.call(arguments,3),m=x(l)&&!l,r=(m?c:d).defer(),q=r.promise,s;s=b.defer(function(){try{r.resolve(f.apply(null,n))}catch(b){r.reject(b),e(b)}finally{delete g[q.$$timeoutId]}m||a.$apply()},k);q.$$timeoutId=s;g[s]=r;return q}var g={};f.cancel=function(a){return a&&a.$$timeoutId in g?(g[a.$$timeoutId].reject("canceled"),delete g[a.$$timeoutId],b.defer.cancel(a.$$timeoutId)):!1};return f}]}function ra(a){Ca&&(Y.setAttribute("href",a),a=
1503 Y.href);Y.setAttribute("href",a);return{href:Y.href,protocol:Y.protocol?Y.protocol.replace(/:$/,""):"",host:Y.host,search:Y.search?Y.search.replace(/^\?/,""):"",hash:Y.hash?Y.hash.replace(/^#/,""):"",hostname:Y.hostname,port:Y.port,pathname:"/"===Y.pathname.charAt(0)?Y.pathname:"/"+Y.pathname}}function hd(a){a=F(a)?ra(a):a;return a.protocol===xd.protocol&&a.host===xd.host}function Df(){this.$get=da(v)}function yd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},
1503 Y.href);Y.setAttribute("href",a);return{href:Y.href,protocol:Y.protocol?Y.protocol.replace(/:$/,""):"",host:Y.host,search:Y.search?Y.search.replace(/^\?/,""):"",hash:Y.hash?Y.hash.replace(/^#/,""):"",hostname:Y.hostname,port:Y.port,pathname:"/"===Y.pathname.charAt(0)?Y.pathname:"/"+Y.pathname}}function hd(a){a=F(a)?ra(a):a;return a.protocol===xd.protocol&&a.host===xd.host}function Df(){this.$get=da(v)}function yd(a){function b(a){try{return decodeURIComponent(a)}catch(b){return a}}var d=a[0]||{},
1504 c={},e="";return function(){var a,g,h,k,l;a=d.cookie||"";if(a!==e)for(e=a,a=e.split("; "),c={},h=0;h<a.length;h++)g=a[h],k=g.indexOf("="),0<k&&(l=b(g.substring(0,k)),y(c[l])&&(c[l]=b(g.substring(k+1))));return c}}function Hf(){this.$get=yd}function Jc(a){function b(d,c){if(G(d)){var e={};q(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",zd);b("date",Ad);b("filter",ng);
1504 c={},e="";return function(){var a,g,h,k,l;a=d.cookie||"";if(a!==e)for(e=a,a=e.split("; "),c={},h=0;h<a.length;h++)g=a[h],k=g.indexOf("="),0<k&&(l=b(g.substring(0,k)),y(c[l])&&(c[l]=b(g.substring(k+1))));return c}}function Hf(){this.$get=yd}function Jc(a){function b(d,c){if(G(d)){var e={};q(d,function(a,c){e[c]=b(c,a)});return e}return a.factory(d+"Filter",c)}this.register=b;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];b("currency",zd);b("date",Ad);b("filter",ng);
1505 b("json",og);b("limitTo",pg);b("lowercase",qg);b("number",Bd);b("orderBy",Cd);b("uppercase",rg)}function ng(){return function(a,b,d){if(!ya(a)){if(null==a)return a;throw O("filter")("notarray",a);}var c;switch(ic(b)){case "function":break;case "boolean":case "null":case "number":case "string":c=!0;case "object":b=sg(b,d,c);break;default:return a}return Array.prototype.filter.call(a,b)}}function sg(a,b,d){var c=G(a)&&"$"in a;!0===b?b=pa:E(b)||(b=function(a,b){if(y(a))return!1;if(null===a||null===b)return a===
1505 b("json",og);b("limitTo",pg);b("lowercase",qg);b("number",Bd);b("orderBy",Cd);b("uppercase",rg)}function ng(){return function(a,b,d){if(!ya(a)){if(null==a)return a;throw O("filter")("notarray",a);}var c;switch(ic(b)){case "function":break;case "boolean":case "null":case "number":case "string":c=!0;case "object":b=sg(b,d,c);break;default:return a}return Array.prototype.filter.call(a,b)}}function sg(a,b,d){var c=G(a)&&"$"in a;!0===b?b=pa:E(b)||(b=function(a,b){if(y(a))return!1;if(null===a||null===b)return a===
1506 b;if(G(b)||G(a)&&!rc(a))return!1;a=P(""+a);b=P(""+b);return-1!==a.indexOf(b)});return function(e){return c&&!G(e)?Ka(e,a.$,b,!1):Ka(e,a,b,d)}}function Ka(a,b,d,c,e){var f=ic(a),g=ic(b);if("string"===g&&"!"===b.charAt(0))return!Ka(a,b.substring(1),d,c);if(K(a))return a.some(function(a){return Ka(a,b,d,c)});switch(f){case "object":var h;if(c){for(h in a)if("$"!==h.charAt(0)&&Ka(a[h],b,d,!0))return!0;return e?!1:Ka(a,b,d,!1)}if("object"===g){for(h in b)if(e=b[h],!E(e)&&!y(e)&&(f="$"===h,!Ka(f?a:a[h],
1506 b;if(G(b)||G(a)&&!rc(a))return!1;a=P(""+a);b=P(""+b);return-1!==a.indexOf(b)});return function(e){return c&&!G(e)?Ka(e,a.$,b,!1):Ka(e,a,b,d)}}function Ka(a,b,d,c,e){var f=ic(a),g=ic(b);if("string"===g&&"!"===b.charAt(0))return!Ka(a,b.substring(1),d,c);if(K(a))return a.some(function(a){return Ka(a,b,d,c)});switch(f){case "object":var h;if(c){for(h in a)if("$"!==h.charAt(0)&&Ka(a[h],b,d,!0))return!0;return e?!1:Ka(a,b,d,!1)}if("object"===g){for(h in b)if(e=b[h],!E(e)&&!y(e)&&(f="$"===h,!Ka(f?a:a[h],
1507 e,d,f,f)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function ic(a){return null===a?"null":typeof a}function zd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){y(c)&&(c=b.CURRENCY_SYM);y(e)&&(e=b.PATTERNS[1].maxFrac);return null==a?a:Dd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(/\u00A4/g,c)}}function Bd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Dd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function tg(a){var b=0,d,c,e,f,g;-1<
1507 e,d,f,f)))return!1;return!0}return d(a,b);case "function":return!1;default:return d(a,b)}}function ic(a){return null===a?"null":typeof a}function zd(a){var b=a.NUMBER_FORMATS;return function(a,c,e){y(c)&&(c=b.CURRENCY_SYM);y(e)&&(e=b.PATTERNS[1].maxFrac);return null==a?a:Dd(a,b.PATTERNS[1],b.GROUP_SEP,b.DECIMAL_SEP,e).replace(/\u00A4/g,c)}}function Bd(a){var b=a.NUMBER_FORMATS;return function(a,c){return null==a?a:Dd(a,b.PATTERNS[0],b.GROUP_SEP,b.DECIMAL_SEP,c)}}function tg(a){var b=0,d,c,e,f,g;-1<
1508 (c=a.indexOf(Ed))&&(a=a.replace(Ed,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==jc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==jc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Fd&&(d=d.splice(0,Fd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function ug(a,b,d,c){var e=a.d,f=e.length-a.i;b=y(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=
1508 (c=a.indexOf(Ed))&&(a=a.replace(Ed,""));0<(e=a.search(/e/i))?(0>c&&(c=e),c+=+a.slice(e+1),a=a.substring(0,e)):0>c&&(c=a.length);for(e=0;a.charAt(e)==jc;e++);if(e==(g=a.length))d=[0],c=1;else{for(g--;a.charAt(g)==jc;)g--;c-=e;d=[];for(f=0;e<=g;e++,f++)d[f]=+a.charAt(e)}c>Fd&&(d=d.splice(0,Fd-1),b=c-1,c=1);return{d:d,e:b,i:c}}function ug(a,b,d,c){var e=a.d,f=e.length-a.i;b=y(b)?Math.min(Math.max(d,f),c):+b;d=b+a.i;c=e[d];if(0<d){e.splice(Math.max(a.i,d));for(var g=d;g<e.length;g++)e[g]=0}else for(f=
1509 Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Dd(a,b,d,c,e){if(!F(a)&&!Q(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,h=Math.abs(a)+"",k="";if(f)k="\u221e";else{g=tg(h);ug(g,e,b.minFrac,b.maxFrac);k=g.d;h=g.i;e=g.e;f=[];for(g=k.reduce(function(a,
1509 Math.max(0,f),a.i=1,e.length=Math.max(1,d=b+1),e[0]=0,g=1;g<d;g++)e[g]=0;if(5<=c)if(0>d-1){for(c=0;c>d;c--)e.unshift(0),a.i++;e.unshift(1);a.i++}else e[d-1]++;for(;f<Math.max(0,b);f++)e.push(0);if(b=e.reduceRight(function(a,b,c,d){b+=a;d[c]=b%10;return Math.floor(b/10)},0))e.unshift(b),a.i++}function Dd(a,b,d,c,e){if(!F(a)&&!Q(a)||isNaN(a))return"";var f=!isFinite(a),g=!1,h=Math.abs(a)+"",k="";if(f)k="\u221e";else{g=tg(h);ug(g,e,b.minFrac,b.maxFrac);k=g.d;h=g.i;e=g.e;f=[];for(g=k.reduce(function(a,
1510 b){return a&&!b},!0);0>h;)k.unshift(0),h++;0<h?f=k.splice(h):(f=k,k=[0]);h=[];for(k.length>=b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ib(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=jc+a;d&&(a=a.substr(a.length-b));return e+a}function W(a,b,d,c,e){d=
1510 b){return a&&!b},!0);0>h;)k.unshift(0),h++;0<h?f=k.splice(h):(f=k,k=[0]);h=[];for(k.length>=b.lgSize&&h.unshift(k.splice(-b.lgSize).join(""));k.length>b.gSize;)h.unshift(k.splice(-b.gSize).join(""));k.length&&h.unshift(k.join(""));k=h.join(d);f.length&&(k+=c+f.join(""));e&&(k+="e+"+e)}return 0>a&&!g?b.negPre+k+b.negSuf:b.posPre+k+b.posSuf}function Ib(a,b,d,c){var e="";if(0>a||c&&0>=a)c?a=-a+1:(a=-a,e="-");for(a=""+a;a.length<b;)a=jc+a;d&&(a=a.substr(a.length-b));return e+a}function W(a,b,d,c,e){d=
1511 d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12==d&&(f=12);return Ib(f,b,c,e)}}function ib(a,b,d){return function(c,e){var f=c["get"+a](),g=sb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Gd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Hd(a){return function(b){var d=Gd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ib(b,a)}}function kc(a,b){return 0>=a.getFullYear()?
1511 d||0;return function(f){f=f["get"+a]();if(0<d||f>-d)f+=d;0===f&&-12==d&&(f=12);return Ib(f,b,c,e)}}function ib(a,b,d){return function(c,e){var f=c["get"+a](),g=sb((d?"STANDALONE":"")+(b?"SHORT":"")+a);return e[g][f]}}function Gd(a){var b=(new Date(a,0,1)).getDay();return new Date(a,0,(4>=b?5:12)-b)}function Hd(a){return function(b){var d=Gd(b.getFullYear());b=+new Date(b.getFullYear(),b.getMonth(),b.getDate()+(4-b.getDay()))-+d;b=1+Math.round(b/6048E5);return Ib(b,a)}}function kc(a,b){return 0>=a.getFullYear()?
1512 b.ERAS[0]:b.ERAS[1]}function Ad(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=X(b[9]+b[10]),g=X(b[9]+b[11]));h.call(a,X(b[1]),X(b[2])-1,X(b[3]));f=X(b[4]||0)-f;g=X(b[5]||0)-g;h=X(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=
1512 b.ERAS[0]:b.ERAS[1]}function Ad(a){function b(a){var b;if(b=a.match(d)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,k=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=X(b[9]+b[10]),g=X(b[9]+b[11]));h.call(a,X(b[1]),X(b[2])-1,X(b[3]));f=X(b[4]||0)-f;g=X(b[5]||0)-g;h=X(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));k.call(a,f,g,h,b)}return a}var d=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,d,f){var g="",h=
1513 [],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;F(c)&&(c=vg.test(c)?X(c):b(c));Q(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=wg.exec(d))?(h=$a(h,l,1),d=h.pop()):(h.push(d),d=null);var n=c.getTimezoneOffset();f&&(n=vc(f,n),c=Qb(c,f,!0));q(h,function(b){k=xg[b];g+=k?k(c,a.DATETIME_FORMATS,n):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function og(){return function(a,b){y(b)&&(b=2);return ab(a,b)}}function pg(){return function(a,b,d){b=Infinity===
1513 [],k,l;d=d||"mediumDate";d=a.DATETIME_FORMATS[d]||d;F(c)&&(c=vg.test(c)?X(c):b(c));Q(c)&&(c=new Date(c));if(!fa(c)||!isFinite(c.getTime()))return c;for(;d;)(l=wg.exec(d))?(h=$a(h,l,1),d=h.pop()):(h.push(d),d=null);var n=c.getTimezoneOffset();f&&(n=vc(f,n),c=Qb(c,f,!0));q(h,function(b){k=xg[b];g+=k?k(c,a.DATETIME_FORMATS,n):"''"===b?"'":b.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function og(){return function(a,b){y(b)&&(b=2);return ab(a,b)}}function pg(){return function(a,b,d){b=Infinity===
1514 Math.abs(Number(b))?Number(b):X(b);if(isNaN(b))return a;Q(a)&&(a=a.toString());if(!K(a)&&!F(a))return a;d=!d||isNaN(d)?0:X(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)}}function Cd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Xa;if(E(b))h=b;else if(F(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h,
1514 Math.abs(Number(b))?Number(b):X(b);if(isNaN(b))return a;Q(a)&&(a=a.toString());if(!K(a)&&!F(a))return a;d=!d||isNaN(d)?0:X(d);d=0>d?Math.max(0,a.length+d):d;return 0<=b?a.slice(d,d+b):0===d?a.slice(b,a.length):a.slice(Math.max(0,d+b),d)}}function Cd(a){function b(b,d){d=d?-1:1;return b.map(function(b){var c=1,h=Xa;if(E(b))h=b;else if(F(b)){if("+"==b.charAt(0)||"-"==b.charAt(0))c="-"==b.charAt(0)?-1:1,b=b.substring(1);if(""!==b&&(h=a(b),h.constant))var k=h(),h=function(a){return a[k]}}return{get:h,
1515 descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!ya(a))throw O("orderBy")("notarray",a);K(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}},descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===
1515 descending:c*d}})}function d(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}return function(a,e,f){if(null==a)return a;if(!ya(a))throw O("orderBy")("notarray",a);K(e)||(e=[e]);0===e.length&&(e=["+"]);var g=b(e,f);g.push({get:function(){return{}},descending:f?-1:1});a=Array.prototype.map.call(a,function(a,b){return{value:a,predicateValues:g.map(function(c){var e=c.get(a);c=typeof e;if(null===e)c="string",e="null";else if("string"===c)e=e.toLowerCase();else if("object"===
1516 c)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),d(e)))break a;if(rc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],q=0;c.type===f.type?c.value!==f.value&&(q=c.value<f.value?-1:1):q=c.type<f.type?-1:1;if(c=q*g[d].descending)break}return c});return a=a.map(function(a){return a.value})}}function La(a){E(a)&&(a={link:a});a.restrict=a.restrict||"AC";return da(a)}function Id(a,
1516 c)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),d(e)))break a;if(rc(e)&&(e=e.toString(),d(e)))break a;e=b}return{value:e,type:c}})}});a.sort(function(a,b){for(var c=0,d=0,e=g.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],q=0;c.type===f.type?c.value!==f.value&&(q=c.value<f.value?-1:1):q=c.type<f.type?-1:1;if(c=q*g[d].descending)break}return c});return a=a.map(function(a){return a.value})}}function La(a){E(a)&&(a={link:a});a.restrict=a.restrict||"AC";return da(a)}function Id(a,
1517 b,d,c,e){var f=this,g=[];f.$error={};f.$$success={};f.$pending=void 0;f.$name=e(b.name||b.ngForm||"")(d);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Jb;f.$rollbackViewValue=function(){q(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){q(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Qa(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a);a.$$parentForm=f};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];
1517 b,d,c,e){var f=this,g=[];f.$error={};f.$$success={};f.$pending=void 0;f.$name=e(b.name||b.ngForm||"")(d);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Jb;f.$rollbackViewValue=function(){q(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){q(g,function(a){a.$commitViewValue()})};f.$addControl=function(a){Qa(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a);a.$$parentForm=f};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];
1518 f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];q(f.$pending,function(b,c){f.$setValidity(c,null,a)});q(f.$error,function(b,c){f.$setValidity(c,null,a)});q(f.$$success,function(b,c){f.$setValidity(c,null,a)});Za(g,a);a.$$parentForm=Jb};Jd({ctrl:this,$element:a,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Za(d,c),0===d.length&&delete a[b])},$animate:c});f.$setDirty=function(){c.removeClass(a,Ua);
1518 f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];q(f.$pending,function(b,c){f.$setValidity(c,null,a)});q(f.$error,function(b,c){f.$setValidity(c,null,a)});q(f.$$success,function(b,c){f.$setValidity(c,null,a)});Za(g,a);a.$$parentForm=Jb};Jd({ctrl:this,$element:a,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=[c]},unset:function(a,b,c){var d=a[b];d&&(Za(d,c),0===d.length&&delete a[b])},$animate:c});f.$setDirty=function(){c.removeClass(a,Ua);
1519 c.addClass(a,Kb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){c.setClass(a,Ua,Kb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;q(g,function(a){a.$setPristine()})};f.$setUntouched=function(){q(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){c.addClass(a,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function lc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function jb(a,b,d,c,e,f){var g=P(b[0].type);
1519 c.addClass(a,Kb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){c.setClass(a,Ua,Kb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;q(g,function(a){a.$setPristine()})};f.$setUntouched=function(){q(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){c.addClass(a,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function lc(a){a.$formatters.push(function(b){return a.$isEmpty(b)?b:b.toString()})}function jb(a,b,d,c,e,f){var g=P(b[0].type);
1520 if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0});b.on("compositionend",function(){h=!1;l()})}var k,l=function(a){k&&(f.defer.cancel(k),k=null);if(!h){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<
1520 if(!e.android){var h=!1;b.on("compositionstart",function(){h=!0});b.on("compositionend",function(){h=!1;l()})}var k,l=function(a){k&&(f.defer.cancel(k),k=null);if(!h){var e=b.val();a=a&&a.type;"password"===g||d.ngTrim&&"false"===d.ngTrim||(e=V(e));(c.$viewValue!==e||""===e&&c.$$hasNativeValidators)&&c.$setViewValue(e,a)}};if(e.hasEvent("input"))b.on("input",l);else{var n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};b.on("keydown",function(a){var b=a.keyCode;91===b||15<
1521 b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",n)}b.on("change",l);if(Kd[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Lb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(F(d)){'"'==d.charAt(0)&&
1521 b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))b.on("paste cut",n)}b.on("change",l);if(Kd[g]&&c.$$hasNativeValidators&&g===d.type)b.on("keydown wheel mousedown",function(a){if(!k){var b=this.validity,c=b.badInput,d=b.typeMismatch;k=f.defer(function(){k=null;b.badInput===c&&b.typeMismatch===d||l(a)})}});c.$render=function(){var a=c.$isEmpty(c.$viewValue)?"":c.$viewValue;b.val()!==a&&b.val(a)}}function Lb(a,b){return function(d,c){var e,f;if(fa(d))return d;if(F(d)){'"'==d.charAt(0)&&
1522 '"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(yg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(a,b,d,c){return function(e,f,g,h,k,l,n){function m(a){return a&&
1522 '"'==d.charAt(d.length-1)&&(d=d.substring(1,d.length-1));if(yg.test(d))return new Date(d);a.lastIndex=0;if(e=a.exec(d))return e.shift(),f=c?{yyyy:c.getFullYear(),MM:c.getMonth()+1,dd:c.getDate(),HH:c.getHours(),mm:c.getMinutes(),ss:c.getSeconds(),sss:c.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},q(e,function(a,c){c<b.length&&(f[b[c]]=+a)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(a,b,d,c){return function(e,f,g,h,k,l,n){function m(a){return a&&
1523 !(a.getTime&&a.getTime()!==a.getTime())}function r(a){return x(a)&&!fa(a)?d(a)||void 0:a}Ld(e,f,g,h);jb(e,f,g,h,k,l);var q=h&&h.$options&&h.$options.timezone,s;h.$$parserName=a;h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a))return a=d(a,s),q&&(a=Qb(a,q)),a});h.$formatters.push(function(a){if(a&&!fa(a))throw lb("datefmt",a);if(m(a))return(s=a)&&q&&(s=Qb(s,q,!0)),n("date")(a,c,q);s=null;return""});if(x(g.min)||g.ngMin){var w;h.$validators.min=function(a){return!m(a)||y(w)||d(a)>=
1523 !(a.getTime&&a.getTime()!==a.getTime())}function r(a){return x(a)&&!fa(a)?d(a)||void 0:a}Ld(e,f,g,h);jb(e,f,g,h,k,l);var q=h&&h.$options&&h.$options.timezone,s;h.$$parserName=a;h.$parsers.push(function(a){if(h.$isEmpty(a))return null;if(b.test(a))return a=d(a,s),q&&(a=Qb(a,q)),a});h.$formatters.push(function(a){if(a&&!fa(a))throw lb("datefmt",a);if(m(a))return(s=a)&&q&&(s=Qb(s,q,!0)),n("date")(a,c,q);s=null;return""});if(x(g.min)||g.ngMin){var w;h.$validators.min=function(a){return!m(a)||y(w)||d(a)>=
1524 w};g.$observe("min",function(a){w=r(a);h.$validate()})}if(x(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!m(a)||y(p)||d(a)<=p};g.$observe("max",function(a){p=r(a);h.$validate()})}}}function Ld(a,b,d,c){(c.$$hasNativeValidators=G(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function Md(a,b,d,c,e){if(x(c)){a=a(c);if(!a.constant)throw lb("constexpr",d,c);return a(b)}return e}function mc(a,b){a="ngClass"+a;return["$animate",
1524 w};g.$observe("min",function(a){w=r(a);h.$validate()})}if(x(g.max)||g.ngMax){var p;h.$validators.max=function(a){return!m(a)||y(p)||d(a)<=p};g.$observe("max",function(a){p=r(a);h.$validate()})}}}function Ld(a,b,d,c){(c.$$hasNativeValidators=G(b[0].validity))&&c.$parsers.push(function(a){var c=b.prop("validity")||{};return c.badInput||c.typeMismatch?void 0:a})}function Md(a,b,d,c,e){if(x(c)){a=a(c);if(!a.constant)throw lb("constexpr",d,c);return a(b)}return e}function mc(a,b){a="ngClass"+a;return["$animate",
1525 function(d){function c(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return K(a)?(q(a,function(a){b=b.concat(e(a))}),b):F(a)?a.split(" "):G(a)?(q(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function k(a){a=l(a,1);h.$addClass(a)}function l(a,b){var c=g.data("$classCounts")||T(),d=[];q(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",
1525 function(d){function c(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],n=0;n<b.length;n++)if(e==b[n])continue a;c.push(e)}return c}function e(a){var b=[];return K(a)?(q(a,function(a){b=b.concat(e(a))}),b):F(a)?a.split(" "):G(a)?(q(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function k(a){a=l(a,1);h.$addClass(a)}function l(a,b){var c=g.data("$classCounts")||T(),d=[];q(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",
1526 c);return d.join(" ")}function n(a,b){var e=c(b,a),f=c(a,b),e=l(e,1),f=l(f,-1);e&&e.length&&d.addClass(g,e);f&&f.length&&d.removeClass(g,f)}function m(a){if(!0===b||f.$index%2===b){var c=e(a||[]);if(!r)k(c);else if(!pa(a,r)){var d=e(r);n(d,c)}}r=K(a)?a.map(function(a){return ha(a)}):ha(a)}var r;f.$watch(h[a],m,!0);h.$observe("class",function(b){m(f.$eval(h[a]))});"ngClass"!==a&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var m=e(f.$eval(h[a]));g===b?k(m):(g=l(m,-1),h.$removeClass(g))}})}}}]}
1526 c);return d.join(" ")}function n(a,b){var e=c(b,a),f=c(a,b),e=l(e,1),f=l(f,-1);e&&e.length&&d.addClass(g,e);f&&f.length&&d.removeClass(g,f)}function m(a){if(!0===b||f.$index%2===b){var c=e(a||[]);if(!r)k(c);else if(!pa(a,r)){var d=e(r);n(d,c)}}r=K(a)?a.map(function(a){return ha(a)}):ha(a)}var r;f.$watch(h[a],m,!0);h.$observe("class",function(b){m(f.$eval(h[a]))});"ngClass"!==a&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var m=e(f.$eval(h[a]));g===b?k(m):(g=l(m,-1),h.$removeClass(g))}})}}}]}
1527 function Jd(a){function b(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function d(a,c){a=a?"-"+zc(a,"-"):"";b(mb+a,!0===c);b(Nd+a,!1===c)}var c=a.ctrl,e=a.$element,f={},g=a.set,h=a.unset,k=a.$animate;f[Nd]=!(f[mb]=e.hasClass(mb));c.$setValidity=function(a,e,f){y(e)?(c.$pending||(c.$pending={}),g(c.$pending,a,f)):(c.$pending&&h(c.$pending,a,f),Od(c.$pending)&&(c.$pending=void 0));Da(e)?e?(h(c.$error,a,f),g(c.$$success,a,f)):(g(c.$error,a,f),h(c.$$success,a,f)):(h(c.$error,
1527 function Jd(a){function b(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function d(a,c){a=a?"-"+zc(a,"-"):"";b(mb+a,!0===c);b(Nd+a,!1===c)}var c=a.ctrl,e=a.$element,f={},g=a.set,h=a.unset,k=a.$animate;f[Nd]=!(f[mb]=e.hasClass(mb));c.$setValidity=function(a,e,f){y(e)?(c.$pending||(c.$pending={}),g(c.$pending,a,f)):(c.$pending&&h(c.$pending,a,f),Od(c.$pending)&&(c.$pending=void 0));Da(e)?e?(h(c.$error,a,f),g(c.$$success,a,f)):(g(c.$error,a,f),h(c.$$success,a,f)):(h(c.$error,
1528 a,f),h(c.$$success,a,f));c.$pending?(b(Pd,!0),c.$valid=c.$invalid=void 0,d("",null)):(b(Pd,!1),c.$valid=Od(c.$error),c.$invalid=!c.$valid,d("",c.$valid));e=c.$pending&&c.$pending[a]?void 0:c.$error[a]?!1:c.$$success[a]?!0:null;d(a,e);c.$$parentForm.$setValidity(a,e,c)}}function Od(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var zg=/^\/(.+)\/([a-z]*)$/,ua=Object.prototype.hasOwnProperty,P=function(a){return F(a)?a.toLowerCase():a},sb=function(a){return F(a)?a.toUpperCase():a},Ca,
1528 a,f),h(c.$$success,a,f));c.$pending?(b(Pd,!0),c.$valid=c.$invalid=void 0,d("",null)):(b(Pd,!1),c.$valid=Od(c.$error),c.$invalid=!c.$valid,d("",c.$valid));e=c.$pending&&c.$pending[a]?void 0:c.$error[a]?!1:c.$$success[a]?!0:null;d(a,e);c.$$parentForm.$setValidity(a,e,c)}}function Od(a){if(a)for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}var zg=/^\/(.+)\/([a-z]*)$/,ua=Object.prototype.hasOwnProperty,P=function(a){return F(a)?a.toLowerCase():a},sb=function(a){return F(a)?a.toUpperCase():a},Ca,
1529 B,Z,za=[].slice,Zf=[].splice,Ag=[].push,ma=Object.prototype.toString,sc=Object.getPrototypeOf,Aa=O("ng"),ea=v.angular||(v.angular={}),Sb,nb=0;Ca=v.document.documentMode;C.$inject=[];Xa.$inject=[];var K=Array.isArray,$d=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,V=function(a){return F(a)?a.trim():a},vd=function(a){return a.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ea=function(){if(!x(Ea.rules)){var a=v.document.querySelector("[ng-csp]")||
1529 B,Z,za=[].slice,Zf=[].splice,Ag=[].push,ma=Object.prototype.toString,sc=Object.getPrototypeOf,Aa=O("ng"),ea=v.angular||(v.angular={}),Sb,nb=0;Ca=v.document.documentMode;C.$inject=[];Xa.$inject=[];var K=Array.isArray,$d=/^\[object (?:Uint8|Uint8Clamped|Uint16|Uint32|Int8|Int16|Int32|Float32|Float64)Array\]$/,V=function(a){return F(a)?a.trim():a},vd=function(a){return a.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Ea=function(){if(!x(Ea.rules)){var a=v.document.querySelector("[ng-csp]")||
1530 v.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ea.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ea;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ea.rules},pb=function(){if(x(pb.name_))return pb.name_;var a,b,d=Na.length,c,e;for(b=0;b<d;++b)if(c=Na[b],a=v.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+
1530 v.document.querySelector("[data-ng-csp]");if(a){var b=a.getAttribute("ng-csp")||a.getAttribute("data-ng-csp");Ea.rules={noUnsafeEval:!b||-1!==b.indexOf("no-unsafe-eval"),noInlineStyle:!b||-1!==b.indexOf("no-inline-style")}}else{a=Ea;try{new Function(""),b=!1}catch(d){b=!0}a.rules={noUnsafeEval:b,noInlineStyle:!1}}}return Ea.rules},pb=function(){if(x(pb.name_))return pb.name_;var a,b,d=Na.length,c,e;for(b=0;b<d;++b)if(c=Na[b],a=v.document.querySelector("["+c.replace(":","\\:")+"jq]")){e=a.getAttribute(c+
1531 "jq");break}return pb.name_=e},ce=/:/g,Na=["ng-","data-ng-","ng:","x-ng-"],he=/[A-Z]/g,Ac=!1,Ma=3,le={full:"1.5.5",major:1,minor:5,dot:5,codeName:"material-conspiration"};U.expando="ng339";var eb=U.cache={},Nf=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var If=/([\:\-\_]+(.))/g,Jf=/^moz([A-Z])/,wb={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=O("jqLite"),Mf=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Kf=/<([\w:-]+)/,Lf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
1531 "jq");break}return pb.name_=e},ce=/:/g,Na=["ng-","data-ng-","ng:","x-ng-"],he=/[A-Z]/g,Ac=!1,Ma=3,le={full:"1.5.5",major:1,minor:5,dot:5,codeName:"material-conspiration"};U.expando="ng339";var eb=U.cache={},Nf=1;U._data=function(a){return this.cache[a[this.expando]]||{}};var If=/([\:\-\_]+(.))/g,Jf=/^moz([A-Z])/,wb={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=O("jqLite"),Mf=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Tb=/<|&#?\w+;/,Kf=/<([\w:-]+)/,Lf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
1532 ia={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option;ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead;ia.th=ia.td;var Sf=v.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Oa=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===
1532 ia={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ia.optgroup=ia.option;ia.tbody=ia.tfoot=ia.colgroup=ia.caption=ia.thead;ia.th=ia.td;var Sf=v.Node.prototype.contains||function(a){return!!(this.compareDocumentPosition(a)&16)},Oa=U.prototype={ready:function(a){function b(){d||(d=!0,a())}var d=!1;"complete"===
1533 v.document.readyState?v.setTimeout(b):(this.on("DOMContentLoaded",b),U(v).on("load",b))},toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?B(this[a]):B(this[this.length+a])},length:0,push:Ag,sort:[].sort,splice:[].splice},Cb={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Cb[P(a)]=a});var Sc={};q("input select option textarea button form details".split(" "),function(a){Sc[a]=!0});var ad={ngMinlength:"minlength",
1533 v.document.readyState?v.setTimeout(b):(this.on("DOMContentLoaded",b),U(v).on("load",b))},toString:function(){var a=[];q(this,function(b){a.push(""+b)});return"["+a.join(", ")+"]"},eq:function(a){return 0<=a?B(this[a]):B(this[this.length+a])},length:0,push:Ag,sort:[].sort,splice:[].splice},Cb={};q("multiple selected checked disabled readOnly required open".split(" "),function(a){Cb[P(a)]=a});var Sc={};q("input select option textarea button form details".split(" "),function(a){Sc[a]=!0});var ad={ngMinlength:"minlength",
1534 ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};q({data:Wb,removeData:db,hasData:function(a){for(var b in eb[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)db(a[b])}},function(a,b){U[b]=a});q({data:Wb,inheritedData:Ab,scope:function(a){return B.data(a,"$scope")||Ab(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return B.data(a,"$isolateScope")||B.data(a,"$isolateScopeNoTemplate")},controller:Pc,injector:function(a){return Ab(a,
1534 ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};q({data:Wb,removeData:db,hasData:function(a){for(var b in eb[a.ng339])return!0;return!1},cleanData:function(a){for(var b=0,d=a.length;b<d;b++)db(a[b])}},function(a,b){U[b]=a});q({data:Wb,inheritedData:Ab,scope:function(a){return B.data(a,"$scope")||Ab(a.parentNode||a,["$isolateScope","$scope"])},isolateScope:function(a){return B.data(a,"$isolateScope")||B.data(a,"$isolateScopeNoTemplate")},controller:Pc,injector:function(a){return Ab(a,
1535 "$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:xb,css:function(a,b,d){b=cb(b);if(x(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Ma&&2!==c&&8!==c)if(c=P(b),Cb[c])if(x(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||C).specified?c:void 0;else if(x(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?void 0:a},prop:function(a,b,d){if(x(d))a[b]=
1535 "$injector")},removeAttr:function(a,b){a.removeAttribute(b)},hasClass:xb,css:function(a,b,d){b=cb(b);if(x(d))a.style[b]=d;else return a.style[b]},attr:function(a,b,d){var c=a.nodeType;if(c!==Ma&&2!==c&&8!==c)if(c=P(b),Cb[c])if(x(d))d?(a[b]=!0,a.setAttribute(b,c)):(a[b]=!1,a.removeAttribute(c));else return a[b]||(a.attributes.getNamedItem(b)||C).specified?c:void 0;else if(x(d))a.setAttribute(b,d);else if(a.getAttribute)return a=a.getAttribute(b,2),null===a?void 0:a},prop:function(a,b,d){if(x(d))a[b]=
1536 d;else return a[b]},text:function(){function a(a,d){if(y(d)){var c=a.nodeType;return 1===c||c===Ma?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(y(b)){if(a.multiple&&"select"===va(a)){var d=[];q(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(y(b))return a.innerHTML;ub(a,!0);a.innerHTML=b},empty:Qc},function(a,b){U.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Qc&&y(2==a.length&&
1536 d;else return a[b]},text:function(){function a(a,d){if(y(d)){var c=a.nodeType;return 1===c||c===Ma?a.textContent:""}a.textContent=d}a.$dv="";return a}(),val:function(a,b){if(y(b)){if(a.multiple&&"select"===va(a)){var d=[];q(a.options,function(a){a.selected&&d.push(a.value||a.text)});return 0===d.length?null:d}return a.value}a.value=b},html:function(a,b){if(y(b))return a.innerHTML;ub(a,!0);a.innerHTML=b},empty:Qc},function(a,b){U.prototype[b]=function(b,c){var e,f,g=this.length;if(a!==Qc&&y(2==a.length&&
1537 a!==xb&&a!==Pc?b:c)){if(G(b)){for(e=0;e<g;e++)if(a===Wb)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=y(e)?Math.min(g,1):g;for(f=0;f<g;f++){var h=a(this[f],b,c);e=e?e+h:h}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});q({removeData:db,on:function(a,b,d,c){if(x(c))throw Ub("onargs");if(Kc(a)){c=vb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=Pf(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,h=function(b,c,g){var h=e[b];h||(h=e[b]=[],h.specialHandlerWrapper=
1537 a!==xb&&a!==Pc?b:c)){if(G(b)){for(e=0;e<g;e++)if(a===Wb)a(this[e],b);else for(f in b)a(this[e],f,b[f]);return this}e=a.$dv;g=y(e)?Math.min(g,1):g;for(f=0;f<g;f++){var h=a(this[f],b,c);e=e?e+h:h}return e}for(e=0;e<g;e++)a(this[e],b,c);return this}});q({removeData:db,on:function(a,b,d,c){if(x(c))throw Ub("onargs");if(Kc(a)){c=vb(a,!0);var e=c.events,f=c.handle;f||(f=c.handle=Pf(a,e));c=0<=b.indexOf(" ")?b.split(" "):[b];for(var g=c.length,h=function(b,c,g){var h=e[b];h||(h=e[b]=[],h.specialHandlerWrapper=
1538 c,"$destroy"===b||g||a.addEventListener(b,f,!1));h.push(d)};g--;)b=c[g],wb[b]?(h(wb[b],Rf),h(b,void 0,!0)):h(b)}},off:Oc,one:function(a,b,d){a=B(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;ub(a);q(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];q(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,
1538 c,"$destroy"===b||g||a.addEventListener(b,f,!1));h.push(d)};g--;)b=c[g],wb[b]?(h(wb[b],Rf),h(b,void 0,!0)):h(b)}},off:Oc,one:function(a,b,d){a=B(a);a.on(b,function e(){a.off(b,d);a.off(b,e)});a.on(b,d)},replaceWith:function(a,b){var d,c=a.parentNode;ub(a);q(new U(b),function(b){d?c.insertBefore(b,d.nextSibling):c.replaceChild(b,a);d=b})},children:function(a){var b=[];q(a.childNodes,function(a){1===a.nodeType&&b.push(a)});return b},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,
1539 b){var d=a.nodeType;if(1===d||11===d){b=new U(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;q(new U(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){Mc(a,B(b).eq(0).clone()[0])},remove:Bb,detach:function(a){Bb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;b=new U(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,b,d){b&&q(b.split(" "),
1539 b){var d=a.nodeType;if(1===d||11===d){b=new U(b);for(var d=0,c=b.length;d<c;d++)a.appendChild(b[d])}},prepend:function(a,b){if(1===a.nodeType){var d=a.firstChild;q(new U(b),function(b){a.insertBefore(b,d)})}},wrap:function(a,b){Mc(a,B(b).eq(0).clone()[0])},remove:Bb,detach:function(a){Bb(a,!0)},after:function(a,b){var d=a,c=a.parentNode;b=new U(b);for(var e=0,f=b.length;e<f;e++){var g=b[e];c.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,b,d){b&&q(b.split(" "),
1540 function(b){var e=d;y(e)&&(e=!xb(a,b));(e?zb:yb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Vb,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=vb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
1540 function(b){var e=d;y(e)&&(e=!xb(a,b));(e?zb:yb)(a,b)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,b){return a.getElementsByTagName?a.getElementsByTagName(b):[]},clone:Vb,triggerHandler:function(a,b,d){var c,e,f=b.type||b,g=vb(a);if(g=(g=g&&g.events)&&g[f])c={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
1541 !0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:C,type:f,target:a},b.type&&(c=R(c,b)),b=ha(g),e=d?[c].concat(d):[c],q(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,h=this.length;g<h;g++)y(f)?(f=a(this[g],b,c,e),x(f)&&(f=B(f))):Nc(f,a(this[g],b,c,e));return x(f)?f:this};U.prototype.bind=U.prototype.on;U.prototype.unbind=U.prototype.off});Ra.prototype={put:function(a,
1541 !0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:C,type:f,target:a},b.type&&(c=R(c,b)),b=ha(g),e=d?[c].concat(d):[c],q(b,function(b){c.isImmediatePropagationStopped()||b.apply(a,e)})}},function(a,b){U.prototype[b]=function(b,c,e){for(var f,g=0,h=this.length;g<h;g++)y(f)?(f=a(this[g],b,c,e),x(f)&&(f=B(f))):Nc(f,a(this[g],b,c,e));return x(f)?f:this};U.prototype.bind=U.prototype.on;U.prototype.unbind=U.prototype.off});Ra.prototype={put:function(a,
1542 b){this[Fa(a,this.nextUid)]=b},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var b=this[a=Fa(a,this.nextUid)];delete this[a];return b}};var Gf=[function(){this.$get=[function(){return Ra}]}],Uf=/^([^\(]+?)=>/,Vf=/^[^\(]*\(\s*([^\)]*)\)/m,Bg=/,/,Cg=/^\s*(_?)(\S+?)\1\s*$/,Tf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=O("$injector");bb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw F(d)&&d||(d=a.name||Wf(a)),Ga("strictdi",d);
1542 b){this[Fa(a,this.nextUid)]=b},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var b=this[a=Fa(a,this.nextUid)];delete this[a];return b}};var Gf=[function(){this.$get=[function(){return Ra}]}],Uf=/^([^\(]+?)=>/,Vf=/^[^\(]*\(\s*([^\)]*)\)/m,Bg=/,/,Cg=/^\s*(_?)(\S+?)\1\s*$/,Tf=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=O("$injector");bb.$$annotate=function(a,b,d){var c;if("function"===typeof a){if(!(c=a.$inject)){c=[];if(a.length){if(b)throw F(d)&&d||(d=a.name||Wf(a)),Ga("strictdi",d);
1543 b=Tc(a);q(b[1].split(Bg),function(a){a.replace(Cg,function(a,b,d){c.push(d)})})}a.$inject=c}}else K(a)?(b=a.length-1,Pa(a[b],"fn"),c=a.slice(0,b)):Pa(a,"fn",!0);return c};var Qd=O("$animate"),Ze=function(){this.$get=C},$e=function(){var a=new Ra,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=F(b)?b.split(" "):K(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=Xf(b.attr("class")),e="",f="";q(c,
1543 b=Tc(a);q(b[1].split(Bg),function(a){a.replace(Cg,function(a,b,d){c.push(d)})})}a.$inject=c}}else K(a)?(b=a.length-1,Pa(a[b],"fn"),c=a.slice(0,b)):Pa(a,"fn",!0);return c};var Qd=O("$animate"),Ze=function(){this.$get=C},$e=function(){var a=new Ra,b=[];this.$get=["$$AnimateRunner","$rootScope",function(d,c){function e(a,b,c){var d=!1;b&&(b=F(b)?b.split(" "):K(b)?b:[],q(b,function(b){b&&(d=!0,a[b]=c)}));return d}function f(){q(b,function(b){var c=a.get(b);if(c){var d=Xf(b.attr("class")),e="",f="";q(c,
1544 function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&zb(a,e);f&&yb(a,f)});a.remove(b)}});b.length=0}return{enabled:C,on:C,off:C,pin:C,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Xe=["$provide",function(a){var b=this;this.$$registeredAnimations=
1544 function(a,b){a!==!!d[b]&&(a?e+=(e.length?" ":"")+b:f+=(f.length?" ":"")+b)});q(b,function(a){e&&zb(a,e);f&&yb(a,f)});a.remove(b)}});b.length=0}return{enabled:C,on:C,off:C,pin:C,push:function(g,h,k,l){l&&l();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(h=k.addClass,l=k.removeClass,k=a.get(g)||{},h=e(k,h,!0),l=e(k,l,!1),h||l)a.put(g,k),b.push(g),1===b.length&&c.$$postDigest(f);g=new d;g.complete();return g}}}]},Xe=["$provide",function(a){var b=this;this.$$registeredAnimations=
1545 Object.create(null);this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Qd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e;a.factory(e,c)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Qd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h<d.length;h++){var k=
1545 Object.create(null);this.register=function(d,c){if(d&&"."!==d.charAt(0))throw Qd("notcsel",d);var e=d+"-animation";b.$$registeredAnimations[d.substr(1)]=e;a.factory(e,c)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Qd("nongcls","ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function b(a,c,d){if(d){var h;a:{for(h=0;h<d.length;h++){var k=
1546 d[h];if(1===k.nodeType){h=k;break a}}h=void 0}!h||h.parentNode||h.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"enter",Ha(h))},move:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"move",Ha(h))},leave:function(b,c){return a.push(b,"leave",Ha(c),function(){b.remove()})},addClass:function(b,
1546 d[h];if(1===k.nodeType){h=k;break a}}h=void 0}!h||h.parentNode||h.previousElementSibling||(d=null)}d?d.after(a):c.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"enter",Ha(h))},move:function(e,f,g,h){f=f&&B(f);g=g&&B(g);f=f||g.parent();b(e,f,g);return a.push(e,"move",Ha(h))},leave:function(b,c){return a.push(b,"leave",Ha(c),function(){b.remove()})},addClass:function(b,
1547 c,g){g=Ha(g);g.addClass=fb(g.addclass,c);return a.push(b,"addClass",g)},removeClass:function(b,c,g){g=Ha(g);g.removeClass=fb(g.removeClass,c);return a.push(b,"removeClass",g)},setClass:function(b,c,g,h){h=Ha(h);h.addClass=fb(h.addClass,c);h.removeClass=fb(h.removeClass,g);return a.push(b,"setClass",h)},animate:function(b,c,g,h,k){k=Ha(k);k.from=k.from?R(k.from,c):c;k.to=k.to?R(k.to,g):g;k.tempClasses=fb(k.tempClasses,h||"ng-inline-animate");return a.push(b,"animate",k)}}}]}],bf=function(){this.$get=
1547 c,g){g=Ha(g);g.addClass=fb(g.addclass,c);return a.push(b,"addClass",g)},removeClass:function(b,c,g){g=Ha(g);g.removeClass=fb(g.removeClass,c);return a.push(b,"removeClass",g)},setClass:function(b,c,g,h){h=Ha(h);h.addClass=fb(h.addClass,c);h.removeClass=fb(h.removeClass,g);return a.push(b,"setClass",h)},animate:function(b,c,g,h,k){k=Ha(k);k.from=k.from?R(k.from,c):c;k.to=k.to?R(k.to,g):g;k.tempClasses=fb(k.tempClasses,h||"ng-inline-animate");return a.push(b,"animate",k)}}}]}],bf=function(){this.$get=
1548 ["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},af=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){var d=c[0];d&&d.hidden?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);
1548 ["$$rAF",function(a){function b(b){d.push(b);1<d.length||a(function(){for(var a=0;a<d.length;a++)d[a]();d=[]})}var d=[];return function(){var a=!1;b(function(){a=!0});return function(d){a?d():b(d)}}}]},af=function(){this.$get=["$q","$sniffer","$$animateAsyncRun","$document","$timeout",function(a,b,d,c,e){function f(a){this.setHost(a);var b=d();this._doneCallbacks=[];this._tick=function(a){var d=c[0];d&&d.hidden?e(a,0,!1):b(a)};this._state=0}f.chain=function(a,b){function c(){if(d===a.length)b(!0);
1549 else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;q(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:C,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},
1549 else a[d](function(a){!1===a?b(!1):(d++,c())})}var d=0;c()};f.all=function(a,b){function c(f){e=e&&f;++d===a.length&&b(e)}var d=0,e=!0;q(a,function(a){a.done(c)})};f.prototype={setHost:function(a){this.host=a||{}},done:function(a){2===this._state?a():this._doneCallbacks.push(a)},progress:C,getPromise:function(){if(!this.promise){var b=this;this.promise=a(function(a,c){b.done(function(b){!1===b?c():a()})})}return this.promise},then:function(a,b){return this.getPromise().then(a,b)},"catch":function(a){return this.getPromise()["catch"](a)},
1550 "finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=
1550 "finally":function(a){return this.getPromise()["finally"](a)},pause:function(){this.host.pause&&this.host.pause()},resume:function(){this.host.resume&&this.host.resume()},end:function(){this.host.end&&this.host.end();this._resolve(!0)},cancel:function(){this.host.cancel&&this.host.cancel();this._resolve(!1)},complete:function(a){var b=this;0===b._state&&(b._state=1,b._tick(function(){b._resolve(a)}))},_resolve:function(a){2!==this._state&&(q(this._doneCallbacks,function(b){b(a)}),this._doneCallbacks.length=
1551 0,this._state=2)}};return f}]},Ye=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);h||k.complete();h=!0});return k}var g=e||{};g.$$prepared||(g=qa(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var h,k=new d;return{start:f,end:f}}}]},ga=O("$compile"),Zb=new function(){};
1551 0,this._state=2)}};return f}]},Ye=function(){this.$get=["$$rAF","$q","$$AnimateRunner",function(a,b,d){return function(b,e){function f(){a(function(){g.addClass&&(b.addClass(g.addClass),g.addClass=null);g.removeClass&&(b.removeClass(g.removeClass),g.removeClass=null);g.to&&(b.css(g.to),g.to=null);h||k.complete();h=!0});return k}var g=e||{};g.$$prepared||(g=qa(g));g.cleanupStyles&&(g.from=g.to=null);g.from&&(b.css(g.from),g.from=null);var h,k=new d;return{start:f,end:f}}}]},ga=O("$compile"),Zb=new function(){};
1552 Cc.$inject=["$provide","$$sanitizeUriProvider"];Db.prototype.isFirstChange=function(){return this.previousValue===Zb};var Vc=/^((?:x|data)[\:\-_])/i,$f=O("$controller"),bd=/^(\S+)(\s+as\s+([\w$]+))?$/,hf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof B&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},cd="application/json",bc={"Content-Type":cd+";charset=utf-8"},bg=/^\[|^\{(?!\{)/,cg={"[":/]$/,"{":/}$/},ag=/^\)\]\}',?\n/,Dg=O("$http"),gd=function(a){return function(){throw Dg("legacy",
1552 Cc.$inject=["$provide","$$sanitizeUriProvider"];Db.prototype.isFirstChange=function(){return this.previousValue===Zb};var Vc=/^((?:x|data)[\:\-_])/i,$f=O("$controller"),bd=/^(\S+)(\s+as\s+([\w$]+))?$/,hf=function(){this.$get=["$document",function(a){return function(b){b?!b.nodeType&&b instanceof B&&(b=b[0]):b=a[0].body;return b.offsetWidth+1}}]},cd="application/json",bc={"Content-Type":cd+";charset=utf-8"},bg=/^\[|^\{(?!\{)/,cg={"[":/]$/,"{":/}$/},ag=/^\)\]\}',?\n/,Dg=O("$http"),gd=function(a){return function(){throw Dg("legacy",
1553 a);}},Ja=ea.$interpolateMinErr=O("$interpolate");Ja.throwNoconcat=function(a){throw Ja("noconcat",a);};Ja.interr=function(a,b){return Ja("interr",a,b.toString())};var Eg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,eg={http:80,https:443,ftp:21},Eb=O("$location"),Fg={$$html5:!1,$$replace:!1,absUrl:Fb("$$absUrl"),url:function(a){if(y(a))return this.$$url;var b=Eg.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Fb("$$protocol"),
1553 a);}},Ja=ea.$interpolateMinErr=O("$interpolate");Ja.throwNoconcat=function(a){throw Ja("noconcat",a);};Ja.interr=function(a,b){return Ja("interr",a,b.toString())};var Eg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,eg={http:80,https:443,ftp:21},Eb=O("$location"),Fg={$$html5:!1,$$replace:!1,absUrl:Fb("$$absUrl"),url:function(a){if(y(a))return this.$$url;var b=Eg.exec(a);(b[1]||""===a)&&this.path(decodeURIComponent(b[1]));(b[2]||b[1]||""===a)&&this.search(b[3]||"");this.hash(b[5]||"");return this},protocol:Fb("$$protocol"),
1554 host:Fb("$$host"),port:Fb("$$port"),path:ld("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(F(a)||Q(a))a=a.toString(),this.$$search=xc(a);else if(G(a))a=qa(a,{}),q(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw Eb("isrcharg");break;default:y(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:ld("$$hash",function(a){return null!==
1554 host:Fb("$$host"),port:Fb("$$port"),path:ld("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,b){switch(arguments.length){case 0:return this.$$search;case 1:if(F(a)||Q(a))a=a.toString(),this.$$search=xc(a);else if(G(a))a=qa(a,{}),q(a,function(b,c){null==b&&delete a[c]}),this.$$search=a;else throw Eb("isrcharg");break;default:y(b)||null===b?delete this.$$search[a]:this.$$search[a]=b}this.$$compose();return this},hash:ld("$$hash",function(a){return null!==
1555 a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};q([kd,ec,dc],function(a){a.prototype=Object.create(Fg);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Eb("nostate");this.$$state=y(b)?null:b;return this}});var ca=O("$parse"),gg=Function.prototype.call,hg=Function.prototype.apply,ig=Function.prototype.bind,Mb=T();q("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var Gg={n:"\n",f:"\f",r:"\r",
1555 a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};q([kd,ec,dc],function(a){a.prototype=Object.create(Fg);a.prototype.state=function(b){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Eb("nostate");this.$$state=y(b)?null:b;return this}});var ca=O("$parse"),gg=Function.prototype.call,hg=Function.prototype.apply,ig=Function.prototype.bind,Mb=T();q("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var Gg={n:"\n",f:"\f",r:"\r",
1556 t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;
1556 t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdentifierStart(this.peekMultichar()))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;
1557 else{var b=a+this.peek(),d=b+this.peek(2),c=Mb[b],e=Mb[d];Mb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||
1557 else{var b=a+this.peek(),d=b+this.peek(2),c=Mb[b],e=Mb[d];Mb[a]||c||e?(a=e?d:c?b:a,this.tokens.push({index:this.index,text:a,operator:!0}),this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,b){return-1!==b.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||
1558 "\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,
1558 "\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdentifierStart:function(a){return this.options.isIdentifierStart?this.options.isIdentifierStart(a,this.codePointAt(a)):this.isValidIdentifierStart(a)},isValidIdentifierStart:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isIdentifierContinue:function(a){return this.options.isIdentifierContinue?this.options.isIdentifierContinue(a,this.codePointAt(a)):this.isValidIdentifierContinue(a)},isValidIdentifierContinue:function(a,b){return this.isValidIdentifierStart(a,
1559 b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=x(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ca("lexerr",
1559 b)||this.isNumber(a)},codePointAt:function(a){return 1===a.length?a.charCodeAt(0):(a.charCodeAt(0)<<10)+a.charCodeAt(1)-56613888},peekMultichar:function(){var a=this.text.charAt(this.index),b=this.peek();if(!b)return a;var d=a.charCodeAt(0),c=b.charCodeAt(0);return 55296<=d&&56319>=d&&56320<=c&&57343>=c?a+b:a},isExpOperator:function(a){return"-"===a||"+"===a||this.isNumber(a)},throwError:function(a,b,d){d=d||this.index;b=x(b)?"s "+b+"-"+this.index+" ["+this.text.substring(b,d)+"]":" "+d;throw ca("lexerr",
1560 a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=P(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"==d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},
1560 a,b,this.text);},readNumber:function(){for(var a="",b=this.index;this.index<this.text.length;){var d=P(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var c=this.peek();if("e"==d&&this.isExpOperator(c))a+=d;else if(this.isExpOperator(d)&&c&&this.isNumber(c)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||c&&this.isNumber(c)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:b,text:a,constant:!0,value:Number(a)})},
1561 readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||
1561 readIdent:function(){var a=this.index;for(this.index+=this.peekMultichar().length;this.index<this.text.length;){var b=this.peekMultichar();if(!this.isIdentifierContinue(b))break;this.index+=b.length}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var b=this.index;this.index++;for(var d="",c=a,e=!1;this.index<this.text.length;){var f=this.text.charAt(this.index),c=c+f;if(e)"u"===f?(e=this.text.substring(this.index+1,this.index+5),e.match(/[\da-f]{4}/i)||
1562 this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=Gg[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var s=function(a,b){this.lexer=a;this.options=b};s.Program="Program";s.ExpressionStatement="ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";
1562 this.throwError("Invalid unicode escape [\\u"+e+"]"),this.index+=4,d+=String.fromCharCode(parseInt(e,16))):d+=Gg[f]||f,e=!1;else if("\\"===f)e=!0;else{if(f===a){this.index++;this.tokens.push({index:b,text:c,constant:!0,value:d});return}d+=f}this.index++}this.throwError("Unterminated quote",b)}};var s=function(a,b){this.lexer=a;this.options=b};s.Program="Program";s.ExpressionStatement="ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";
1563 s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.LocalsExpression="LocalsExpression";s.NGValueParameter="NGValueParameter";s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);
1563 s.LogicalExpression="LogicalExpression";s.BinaryExpression="BinaryExpression";s.UnaryExpression="UnaryExpression";s.CallExpression="CallExpression";s.MemberExpression="MemberExpression";s.Identifier="Identifier";s.Literal="Literal";s.ArrayExpression="ArrayExpression";s.Property="Property";s.ObjectExpression="ObjectExpression";s.ThisExpression="ThisExpression";s.LocalsExpression="LocalsExpression";s.NGValueParameter="NGValueParameter";s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);
1564 a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},
1564 a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:s.Program,body:a}},expressionStatement:function(){return{type:s.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=this.filter(a);return a},expression:function(){return this.assignment()},
1565 assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
1565 assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:s.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),b,d;return this.expect("?")&&(b=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:b,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:s.LogicalExpression,operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=
1566 this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
1566 this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),b;b=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),b;b=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),
1567 b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
1567 b;b=this.expect("+","-");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),b;b=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:b.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:s.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):
1568 this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=qa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:s.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,
1568 this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.selfReferential.hasOwnProperty(this.peek().text)?a=qa(this.selfReferential[this.consume().text]):this.options.literals.hasOwnProperty(this.peek().text)?a={type:s.Literal,value:this.options.literals[this.consume().text]}:this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var b;b=this.expect("(","[",".");)"("===b.text?(a={type:s.CallExpression,
1569 callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==
1569 callee:a,arguments:this.parseArguments()},this.consume(")")):"["===b.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===b.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var b={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return b},parseArguments:function(){var a=[];if(")"!==
1570 this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},
1570 this.peekToken().text){do a.push(this.expression());while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:s.Identifier,name:a.text}},constant:function(){return{type:s.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:s.ArrayExpression,elements:a}},
1571 object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw ca("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===
1571 object:function(){var a=[],b;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;b={type:s.Property,kind:"init"};this.peek().constant?b.key=this.constant():this.peek().identifier?b.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");b.value=this.expression();a.push(b)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,b){throw ca("syntax",b.text,a,b.index+1,this.text,this.text.substring(b.index));},consume:function(a){if(0===
1572 this.tokens.length)throw ca("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?
1572 this.tokens.length)throw ca("ueoe",this.text);var b=this.expect(a);b||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return b},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,b,d,c){return this.peekAhead(0,a,b,d,c)},peekAhead:function(a,b,d,c,e){if(this.tokens.length>a){a=this.tokens[a];var f=a.text;if(f===b||f===d||f===c||f===e||!(b||d||c||e))return a}return!1},expect:function(a,b,d,c){return(a=this.peek(a,b,d,c))?
1573 (this.tokens.shift(),a):!1},selfReferential:{"this":{type:s.ThisExpression},$locals:{type:s.LocalsExpression}}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};aa(c,d.$filter);var e="",f;this.stage="assign";if(f=qd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=od(c.body);
1573 (this.tokens.shift(),a):!1},selfReferential:{"this":{type:s.ThisExpression},$locals:{type:s.LocalsExpression}}};sd.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:b,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};aa(c,d.$filter);var e="",f;this.stage="assign";if(f=qd(c))this.state.computing="assign",e=this.nextId(),this.recurse(f,e),this.return_(e),e="fn.assign="+this.generateFunction("assign","s,v,l");f=od(c.body);
1574 d.stage="inputs";q(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext",
1574 d.stage="inputs";q(f,function(a,b){var c="fn"+b;d.state[c]={vars:[],body:[],own:{}};d.state.computing=c;var e=d.nextId();d.recurse(a,e);d.return_(e);d.state.inputs.push(c);a.watchId=b});this.state.computing="fn";this.stage="main";this.recurse(c);e='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+e+this.watchFns()+"return fn;";e=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue","ensureSafeAssignContext",
1575 "ifDefined","plus","text",e))(this.$filter,Ta,sa,md,fg,Gb,jg,nd,a);this.state=this.stage=void 0;e.literal=rd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;q(this.state.filters,
1575 "ifDefined","plus","text",e))(this.$filter,Ta,sa,md,fg,Gb,jg,nd,a);this.state=this.stage=void 0;e.literal=rd(c);e.constant=c.constant;return e},USE:"use",STRICT:"strict",watchFns:function(){var a=[],b=this.state.inputs,d=this;q(b,function(b){a.push("var "+b+"="+d.generateFunction(b,"s"))});b.length&&a.push("fn.inputs=["+b.join(",")+"];");return a.join("")},generateFunction:function(a,b){return"function("+b+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],b=this;q(this.state.filters,
1576 function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,n;c=c||C;if(!f&&x(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:q(a.body,function(b,c){k.recurse(b.expression,
1576 function(d,c){a.push(d+"=$filter("+b.escape(c)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,b,d,c,e,f){var g,h,k=this,l,n;c=c||C;if(!f&&x(a.watchId))b=b||this.nextId(),this.if_("i",this.lazyAssign(b,this.computedMember("i",a.watchId)),this.lazyRecurse(a,b,d,c,e,!0));else switch(a.type){case s.Program:q(a.body,function(b,c){k.recurse(b.expression,
1577 void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:n=this.escape(a.value);this.assign(b,n);c(n);break;case s.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});n=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,n);c(n);break;case s.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});n="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,
1577 void 0,void 0,function(a){h=a});c!==a.body.length-1?k.current().body.push(h,";"):k.return_(h)});break;case s.Literal:n=this.escape(a.value);this.assign(b,n);c(n);break;case s.UnaryExpression:this.recurse(a.argument,void 0,void 0,function(a){h=a});n=a.operator+"("+this.ifDefined(h,0)+")";this.assign(b,n);c(n);break;case s.BinaryExpression:this.recurse(a.left,void 0,void 0,function(a){g=a});this.recurse(a.right,void 0,void 0,function(a){h=a});n="+"===a.operator?this.plus(g,h):"-"===a.operator?this.ifDefined(g,
1578 0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,n);c(n);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
1578 0)+a.operator+this.ifDefined(h,0):"("+g+")"+a.operator+"("+h+")";this.assign(b,n);c(n);break;case s.LogicalExpression:b=b||this.nextId();k.recurse(a.left,b);k.if_("&&"===a.operator?b:k.not(b),k.lazyRecurse(a.right,b));c(b);break;case s.ConditionalExpression:b=b||this.nextId();k.recurse(a.test,b);k.if_(b,k.lazyRecurse(a.alternate,b),k.lazyRecurse(a.consequent,b));c(b);break;case s.Identifier:b=b||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
1579 a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ta(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Hb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
1579 a.name)+"?l:s"),d.computed=!1,d.name=a.name);Ta(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){e&&1!==e&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(b,k.nonComputedMember("s",a.name))})},b&&k.lazyAssign(b,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Hb(a.name))&&k.addEnsureSafeObject(b);c(b);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
1580 this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),n=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,n),d&&(d.computed=!0,d.name=h);else{Ta(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),
1580 this.nextId();b=b||this.nextId();k.recurse(a.object,g,void 0,function(){k.if_(k.notNull(g),function(){e&&1!==e&&k.addEnsureSafeAssignContext(g);if(a.computed)h=k.nextId(),k.recurse(a.property,h),k.getStringValue(h),k.addEnsureSafeMemberName(h),e&&1!==e&&k.if_(k.not(k.computedMember(g,h)),k.lazyAssign(k.computedMember(g,h),"{}")),n=k.ensureSafeObject(k.computedMember(g,h)),k.assign(b,n),d&&(d.computed=!0,d.name=h);else{Ta(a.property.name);e&&1!==e&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),
1581 k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));n=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Hb(a.property.name))n=k.ensureSafeObject(n);k.assign(b,n);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),n=h+"("+l.join(",")+")",k.assign(b,n),c(b)):(h=k.nextId(),g={},l=
1581 k.lazyAssign(k.nonComputedMember(g,a.property.name),"{}"));n=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Hb(a.property.name))n=k.ensureSafeObject(n);k.assign(b,n);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(b,"undefined")});c(b)},!!e);break;case s.CallExpression:b=b||this.nextId();a.filter?(h=k.filter(a.callee.name),l=[],q(a.arguments,function(a){var b=k.nextId();k.recurse(a,b);l.push(b)}),n=h+"("+l.join(",")+")",k.assign(b,n),c(b)):(h=k.nextId(),g={},l=
1582 [],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);q(a.arguments,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),n=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):n=h+"("+l.join(",")+")";n=k.ensureSafeObject(n);k.assign(b,n)},function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!pd(a.left))throw ca("lval");
1582 [],k.recurse(a.callee,h,g,function(){k.if_(k.notNull(h),function(){k.addEnsureSafeFunction(h);q(a.arguments,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),n=k.member(g.context,g.name,g.computed)+"("+l.join(",")+")"):n=h+"("+l.join(",")+")";n=k.ensureSafeObject(n);k.assign(b,n)},function(){k.assign(b,"undefined")});c(b)}));break;case s.AssignmentExpression:h=this.nextId();g={};if(!pd(a.left))throw ca("lval");
1583 this.recurse(a.left,void 0,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);n=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,n);c(b||n)})},1);break;case s.ArrayExpression:l=[];q(a.elements,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(a)})});n="["+l.join(",")+"]";this.assign(b,n);c(n);break;case s.ObjectExpression:l=[];q(a.properties,function(a){k.recurse(a.value,
1583 this.recurse(a.left,void 0,g,function(){k.if_(k.notNull(g.context),function(){k.recurse(a.right,h);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);n=k.member(g.context,g.name,g.computed)+a.operator+h;k.assign(b,n);c(b||n)})},1);break;case s.ArrayExpression:l=[];q(a.elements,function(a){k.recurse(a,k.nextId(),void 0,function(a){l.push(a)})});n="["+l.join(",")+"]";this.assign(b,n);c(n);break;case s.ObjectExpression:l=[];q(a.properties,function(a){k.recurse(a.value,
1584 k.nextId(),void 0,function(b){l.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});n="{"+l.join(",")+"}";this.assign(b,n);c(n);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.LocalsExpression:this.assign(b,"l");c("l");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,
1584 k.nextId(),void 0,function(b){l.push(k.escape(a.key.type===s.Identifier?a.key.name:""+a.key.value)+":"+b)})});n="{"+l.join(",")+"}";this.assign(b,n);c(n);break;case s.ThisExpression:this.assign(b,"s");c("s");break;case s.LocalsExpression:this.assign(b,"l");c("l");break;case s.NGValueParameter:this.assign(b,"v"),c("v")}},getHasOwnProperty:function(a,b){var d=a+"."+b,c=this.current().own;c.hasOwnProperty(d)||(c[d]=this.nextId(!1,a+"&&("+this.escape(b)+" in "+a+")"));return c[d]},assign:function(a,b){if(a)return this.current().body.push(a,
1585 "=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+
1585 "=",b,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,b){return"ifDefined("+a+","+this.escape(b)+")"},plus:function(a,b){return"plus("+a+","+b+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,b,d){if(!0===a)b();else{var c=this.current().body;c.push("if(",a,"){");b();c.push("}");d&&(c.push("else{"),d(),c.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+
1586 "!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/[$_a-zA-Z][$_a-zA-Z0-9]*/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),
1586 "!=null"},nonComputedMember:function(a,b){var d=/[^$_a-zA-Z0-9]/g;return/[$_a-zA-Z][$_a-zA-Z0-9]*/.test(b)?a+"."+b:a+'["'+b.replace(d,this.stringEscapeFn)+'"]'},computedMember:function(a,b){return a+"["+b+"]"},member:function(a,b,d){return d?this.computedMember(a,b):this.nonComputedMember(a,b)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),
1587 ";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=
1587 ";")},addEnsureSafeAssignContext:function(a){this.current().body.push(this.ensureSafeAssignContext(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},getStringValue:function(a){this.assign(a,"getStringValue("+a+")")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,b,d,c,e,f){var g=
1588 this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(Q(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,
1588 this;return function(){g.recurse(a,b,d,c,e,f)}},lazyAssign:function(a,b){var d=this;return function(){d.assign(a,b)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(F(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(Q(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,
1589 b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;aa(c,d.$filter);var e,f;if(e=qd(c))f=this.recurse(e);e=od(c.body);var g;e&&(g=[],q(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];q(c.body,function(a){h.push(d.recurse(a.expression))});e=0===c.body.length?C:1===
1589 b){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(b?"="+b:""));return d},current:function(){return this.state[this.state.computing]}};td.prototype={compile:function(a,b){var d=this,c=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=b;aa(c,d.$filter);var e,f;if(e=qd(c))f=this.recurse(e);e=od(c.body);var g;e&&(g=[],q(e,function(a,b){var c=d.recurse(a);a.input=c;g.push(c);a.watchId=b}));var h=[];q(c.body,function(a){h.push(d.recurse(a.expression))});e=0===c.body.length?C:1===
1590 c.body.length?h[0]:function(a,b){var c;q(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=rd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
1590 c.body.length?h[0]:function(a,b){var c;q(h,function(d){c=d(a,b)});return c};f&&(e.assign=function(a,b,c){return f(a,c,b)});g&&(e.inputs=g);e.literal=rd(c);e.constant=c.constant;return e},recurse:function(a,b,d){var c,e,f=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,b);case s.UnaryExpression:return e=this.recurse(a.argument),this["unary"+a.operator](e,b);case s.BinaryExpression:return c=this.recurse(a.left),e=this.recurse(a.right),
1591 this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Ta(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Hb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Ta(a.property.name,f.expression),
1591 this["binary"+a.operator](c,e,b);case s.LogicalExpression:return c=this.recurse(a.left),e=this.recurse(a.right),this["binary"+a.operator](c,e,b);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),b);case s.Identifier:return Ta(a.name,f.expression),f.identifier(a.name,f.expensiveChecks||Hb(a.name),b,d,f.expression);case s.MemberExpression:return c=this.recurse(a.object,!1,!!d),a.computed||(Ta(a.property.name,f.expression),
1592 e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var m=[],r=0;r<g.length;++r)m.push(g[r](a,c,d,f));a=e.apply(void 0,m,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,
1592 e=a.property.name),a.computed&&(e=this.recurse(a.property)),a.computed?this.computedMember(c,e,b,d,f.expression):this.nonComputedMember(c,e,f.expensiveChecks,b,d,f.expression);case s.CallExpression:return g=[],q(a.arguments,function(a){g.push(f.recurse(a))}),a.filter&&(e=this.$filter(a.callee.name)),a.filter||(e=this.recurse(a.callee,!0)),a.filter?function(a,c,d,f){for(var m=[],r=0;r<g.length;++r)m.push(g[r](a,c,d,f));a=e.apply(void 0,m,f);return b?{context:void 0,name:void 0,value:a}:a}:function(a,
1593 c,d,n){var m=e(a,c,d,n),r;if(null!=m.value){sa(m.context,f.expression);md(m.value,f.expression);r=[];for(var q=0;q<g.length;++q)r.push(sa(g[q](a,c,d,n),f.expression));r=sa(m.value.apply(m.context,r),f.expression)}return b?{value:r}:r};case s.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,g,n){var m=c(a,d,g,n);a=e(a,d,g,n);sa(m.value,f.expression);Gb(m.context);m.context[m.name]=a;return b?{value:a}:a};case s.ArrayExpression:return g=[],q(a.elements,function(a){g.push(f.recurse(a))}),
1593 c,d,n){var m=e(a,c,d,n),r;if(null!=m.value){sa(m.context,f.expression);md(m.value,f.expression);r=[];for(var q=0;q<g.length;++q)r.push(sa(g[q](a,c,d,n),f.expression));r=sa(m.value.apply(m.context,r),f.expression)}return b?{value:r}:r};case s.AssignmentExpression:return c=this.recurse(a.left,!0,1),e=this.recurse(a.right),function(a,d,g,n){var m=c(a,d,g,n);a=e(a,d,g,n);sa(m.value,f.expression);Gb(m.context);m.context[m.name]=a;return b?{value:a}:a};case s.ArrayExpression:return g=[],q(a.elements,function(a){g.push(f.recurse(a))}),
1594 function(a,c,d,e){for(var f=[],r=0;r<g.length;++r)f.push(g[r](a,c,d,e));return b?{value:f}:f};case s.ObjectExpression:return g=[],q(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},r=0;r<g.length;++r)f[g[r].key]=g[r].value(a,c,d,e);return b?{value:f}:f};case s.ThisExpression:return function(a){return b?{value:a}:a};case s.LocalsExpression:return function(a,c){return b?{value:c}:c};case s.NGValueParameter:return function(a,
1594 function(a,c,d,e){for(var f=[],r=0;r<g.length;++r)f.push(g[r](a,c,d,e));return b?{value:f}:f};case s.ObjectExpression:return g=[],q(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:f.recurse(a.value)})}),function(a,c,d,e){for(var f={},r=0;r<g.length;++r)f[g[r].key]=g[r].value(a,c,d,e);return b?{value:f}:f};case s.ThisExpression:return function(a){return b?{value:a}:a};case s.LocalsExpression:return function(a,c){return b?{value:c}:c};case s.NGValueParameter:return function(a,
1595 c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?-d:0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);h=nd(h,c);return d?{value:h}:h}},"binary-":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);
1595 c,d){return b?{value:d}:d}}},"unary+":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?+d:0;return b?{value:d}:d}},"unary-":function(a,b){return function(d,c,e,f){d=a(d,c,e,f);d=x(d)?-d:0;return b?{value:d}:d}},"unary!":function(a,b){return function(d,c,e,f){d=!a(d,c,e,f);return b?{value:d}:d}},"binary+":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);h=nd(h,c);return d?{value:h}:h}},"binary-":function(a,b,d){return function(c,e,f,g){var h=a(c,e,f,g);c=b(c,e,f,g);
1596 h=(x(h)?h:0)-(x(c)?c:0);return d?{value:h}:h}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,
1596 h=(x(h)?h:0)-(x(c)?c:0);return d?{value:h}:h}},"binary*":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)*b(c,e,f,g);return d?{value:c}:c}},"binary/":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)/b(c,e,f,g);return d?{value:c}:c}},"binary%":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)%b(c,e,f,g);return d?{value:c}:c}},"binary===":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)===b(c,e,f,g);return d?{value:c}:c}},"binary!==":function(a,b,d){return function(c,e,f,g){c=a(c,
1597 e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,
1597 e,f,g)!==b(c,e,f,g);return d?{value:c}:c}},"binary==":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)==b(c,e,f,g);return d?{value:c}:c}},"binary!=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)!=b(c,e,f,g);return d?{value:c}:c}},"binary<":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)<b(c,e,f,g);return d?{value:c}:c}},"binary>":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>b(c,e,f,g);return d?{value:c}:c}},"binary<=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,
1598 g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,
1598 g)<=b(c,e,f,g);return d?{value:c}:c}},"binary>=":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)>=b(c,e,f,g);return d?{value:c}:c}},"binary&&":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)&&b(c,e,f,g);return d?{value:c}:c}},"binary||":function(a,b,d){return function(c,e,f,g){c=a(c,e,f,g)||b(c,e,f,g);return d?{value:c}:c}},"ternary?:":function(a,b,d,c){return function(e,f,g,h){e=a(e,f,g,h)?b(e,f,g,h):d(e,f,g,h);return c?{value:e}:e}},value:function(a,b){return function(){return b?{context:void 0,
1599 name:void 0,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f=g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:void 0;b&&sa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),n,m;null!=l&&(n=b(f,g,h,k),n+="",Ta(n,e),c&&1!==c&&(Gb(l),l&&!l[n]&&(l[n]={})),m=l[n],sa(m,e));return d?{context:l,name:n,value:m}:m}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&(Gb(g),
1599 name:void 0,value:a}:a}},identifier:function(a,b,d,c,e){return function(f,g,h,k){f=g&&a in g?g:f;c&&1!==c&&f&&!f[a]&&(f[a]={});g=f?f[a]:void 0;b&&sa(g,e);return d?{context:f,name:a,value:g}:g}},computedMember:function(a,b,d,c,e){return function(f,g,h,k){var l=a(f,g,h,k),n,m;null!=l&&(n=b(f,g,h,k),n+="",Ta(n,e),c&&1!==c&&(Gb(l),l&&!l[n]&&(l[n]={})),m=l[n],sa(m,e));return d?{context:l,name:n,value:m}:m}},nonComputedMember:function(a,b,d,c,e,f){return function(g,h,k,l){g=a(g,h,k,l);e&&1!==e&&(Gb(g),
1600 g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:void 0;(d||Hb(b))&&sa(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var hc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(a,d);this.astCompiler=d.csp?new td(this.ast,b):new sd(this.ast,b)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var kg=Object.prototype.valueOf,ta=O("$sce"),oa={HTML:"html",CSS:"css",
1600 g&&!g[b]&&(g[b]={}));h=null!=g?g[b]:void 0;(d||Hb(b))&&sa(h,f);return c?{context:g,name:b,value:h}:h}},inputs:function(a,b){return function(d,c,e,f){return f?f[b]:a(d,c,e)}}};var hc=function(a,b,d){this.lexer=a;this.$filter=b;this.options=d;this.ast=new s(a,d);this.astCompiler=d.csp?new td(this.ast,b):new sd(this.ast,b)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};var kg=Object.prototype.valueOf,ta=O("$sce"),oa={HTML:"html",CSS:"css",
1601 URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},mg=O("$compile"),Y=v.document.createElement("a"),xd=ra(v.location.href);yd.$inject=["$document"];Jc.$inject=["$provide"];var Fd=22,Ed=".",jc="0";zd.$inject=["$locale"];Bd.$inject=["$locale"];var xg={yyyy:W("FullYear",4,0,!1,!0),yy:W("FullYear",2,0,!0,!0),y:W("FullYear",1,0,!1,!0),MMMM:ib("Month"),MMM:ib("Month",!0),MM:W("Month",2,1),M:W("Month",1,1),LLLL:ib("Month",!1,!0),dd:W("Date",2),d:W("Date",1),HH:W("Hours",2),H:W("Hours",1),hh:W("Hours",2,-12),
1601 URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},mg=O("$compile"),Y=v.document.createElement("a"),xd=ra(v.location.href);yd.$inject=["$document"];Jc.$inject=["$provide"];var Fd=22,Ed=".",jc="0";zd.$inject=["$locale"];Bd.$inject=["$locale"];var xg={yyyy:W("FullYear",4,0,!1,!0),yy:W("FullYear",2,0,!0,!0),y:W("FullYear",1,0,!1,!0),MMMM:ib("Month"),MMM:ib("Month",!0),MM:W("Month",2,1),M:W("Month",1,1),LLLL:ib("Month",!1,!0),dd:W("Date",2),d:W("Date",1),HH:W("Hours",2),H:W("Hours",1),hh:W("Hours",2,-12),
1602 h:W("Hours",1,-12),mm:W("Minutes",2),m:W("Minutes",1),ss:W("Seconds",2),s:W("Seconds",1),sss:W("Milliseconds",3),EEEE:ib("Day"),EEE:ib("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ib(Math[0<a?"floor":"ceil"](a/60),2)+Ib(Math.abs(a%60),2))},ww:Hd(2),w:Hd(1),G:kc,GG:kc,GGG:kc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},wg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
1602 h:W("Hours",1,-12),mm:W("Minutes",2),m:W("Minutes",1),ss:W("Seconds",2),s:W("Seconds",1),sss:W("Milliseconds",3),EEEE:ib("Day"),EEE:ib("Day",!0),a:function(a,b){return 12>a.getHours()?b.AMPMS[0]:b.AMPMS[1]},Z:function(a,b,d){a=-1*d;return a=(0<=a?"+":"")+(Ib(Math[0<a?"floor":"ceil"](a/60),2)+Ib(Math.abs(a%60),2))},ww:Hd(2),w:Hd(1),G:kc,GG:kc,GGG:kc,GGGG:function(a,b){return 0>=a.getFullYear()?b.ERANAMES[0]:b.ERANAMES[1]}},wg=/((?:[^yMLdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|L+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
1603 vg=/^\-?\d+$/;Ad.$inject=["$locale"];var qg=da(P),rg=da(sb);Cd.$inject=["$parse"];var ne=da({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ma.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),tb={};q(Cb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=xa("ng-"+b),e=d;"checked"===a&&(e=function(a,
1603 vg=/^\-?\d+$/;Ad.$inject=["$locale"];var qg=da(P),rg=da(sb);Cd.$inject=["$parse"];var ne=da({restrict:"E",compile:function(a,b){if(!b.href&&!b.xlinkHref)return function(a,b){if("a"===b[0].nodeName.toLowerCase()){var e="[object SVGAnimatedString]"===ma.call(b.prop("href"))?"xlink:href":"href";b.on("click",function(a){b.attr(e)||a.preventDefault()})}}}}),tb={};q(Cb,function(a,b){function d(a,d,e){a.$watch(e[c],function(a){e.$set(b,!!a)})}if("multiple"!=a){var c=xa("ng-"+b),e=d;"checked"===a&&(e=function(a,
1604 b,e){e.ngModel!==e[c]&&d(a,b,e)});tb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(ad,function(a,b){tb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(zg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=xa("ng-"+a);tb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===
1604 b,e){e.ngModel!==e[c]&&d(a,b,e)});tb[c]=function(){return{restrict:"A",priority:100,link:e}}}});q(ad,function(a,b){tb[b]=function(){return{priority:100,link:function(a,c,e){if("ngPattern"===b&&"/"==e.ngPattern.charAt(0)&&(c=e.ngPattern.match(zg))){e.$set("ngPattern",new RegExp(c[1],c[2]));return}a.$watch(e[b],function(a){e.$set(b,a)})}}}});q(["src","srcset","href"],function(a){var b=xa("ng-"+a);tb[b]=function(){return{priority:99,link:function(d,c,e){var f=a,g=a;"href"===a&&"[object SVGAnimatedString]"===
1605 ma.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Jb={$addControl:C,$$renameControl:function(a,b){a.$name=b},$removeControl:C,$setValidity:C,$setDirty:C,$setPristine:C,$setSubmitted:C};Id.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Rd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||C}return{name:"form",
1605 ma.call(c.prop("href"))&&(g="xlinkHref",e.$attr[g]="xlink:href",f=null);e.$observe(b,function(b){b?(e.$set(g,b),Ca&&f&&c.prop(f,e[g])):"href"===a&&e.$set(g,null)})}}}});var Jb={$addControl:C,$$renameControl:function(a,b){a.$name=b},$removeControl:C,$setValidity:C,$setDirty:C,$setPristine:C,$setSubmitted:C};Id.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Rd=function(a){return["$timeout","$parse",function(b,d){function c(a){return""===a?d('this[""]').assign:d(a).assign||C}return{name:"form",
1606 restrict:a?"EAC":"E",require:["form","^^?form"],controller:Id,compile:function(d,f){d.addClass(Ua).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var m=f[0];if(!("action"in e)){var r=function(b){a.$apply(function(){m.$commitViewValue();m.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",r,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",r,!1)},0,!1)})}(f[1]||m.$$parentForm).$addControl(m);var q=g?c(m.$name):C;g&&
1606 restrict:a?"EAC":"E",require:["form","^^?form"],controller:Id,compile:function(d,f){d.addClass(Ua).addClass(mb);var g=f.name?"name":a&&f.ngForm?"ngForm":!1;return{pre:function(a,d,e,f){var m=f[0];if(!("action"in e)){var r=function(b){a.$apply(function(){m.$commitViewValue();m.$setSubmitted()});b.preventDefault()};d[0].addEventListener("submit",r,!1);d.on("$destroy",function(){b(function(){d[0].removeEventListener("submit",r,!1)},0,!1)})}(f[1]||m.$$parentForm).$addControl(m);var q=g?c(m.$name):C;g&&
1607 (q(a,m),e.$observe(g,function(b){m.$name!==b&&(q(a,void 0),m.$$parentForm.$$renameControl(m,b),q=c(m.$name),q(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);q(a,void 0);R(m,Jb)})}}}}}]},oe=Rd(),Be=Rd(!0),yg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,Hg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ig=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
1607 (q(a,m),e.$observe(g,function(b){m.$name!==b&&(q(a,void 0),m.$$parentForm.$$renameControl(m,b),q=c(m.$name),q(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);q(a,void 0);R(m,Jb)})}}}}}]},oe=Rd(),Be=Rd(!0),yg=/^\d{4,}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+(?:[+-][0-2]\d:[0-5]\d|Z)$/,Hg=/^[a-z][a-z\d.+-]*:\/*(?:[^:@]+(?::[^@]+)?@)?(?:[^\s:/?#]+|\[[a-f\d:]+\])(?::\d+)?(?:\/[^?#]*)?(?:\?[^#]*)?(?:#.*)?$/i,Ig=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,
1608 Jg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Sd=/^(\d{4,})-(\d{2})-(\d{2})$/,Td=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,nc=/^(\d{4,})-W(\d\d)$/,Ud=/^(\d{4,})-(\d\d)$/,Vd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Kd=T();q(["date","datetime-local","month","time","week"],function(a){Kd[a]=!0});var Wd={text:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c)},date:kb("date",Sd,Lb(Sd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Td,Lb(Td,"yyyy MM dd HH mm ss sss".split(" ")),
1608 Jg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Sd=/^(\d{4,})-(\d{2})-(\d{2})$/,Td=/^(\d{4,})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,nc=/^(\d{4,})-W(\d\d)$/,Ud=/^(\d{4,})-(\d\d)$/,Vd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Kd=T();q(["date","datetime-local","month","time","week"],function(a){Kd[a]=!0});var Wd={text:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c)},date:kb("date",Sd,Lb(Sd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Td,Lb(Td,"yyyy MM dd HH mm ss sss".split(" ")),
1609 "yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Vd,Lb(Vd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",nc,function(a,b){if(fa(a))return a;if(F(a)){nc.lastIndex=0;var d=nc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Gd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:kb("month",Ud,Lb(Ud,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Ld(a,b,d,c);jb(a,b,d,c,e,f);c.$$parserName=
1609 "yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Vd,Lb(Vd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",nc,function(a,b){if(fa(a))return a;if(F(a)){nc.lastIndex=0;var d=nc.exec(a);if(d){var c=+d[1],e=+d[2],f=d=0,g=0,h=0,k=Gd(c),e=7*(e-1);b&&(d=b.getHours(),f=b.getMinutes(),g=b.getSeconds(),h=b.getMilliseconds());return new Date(c,0,k.getDate()+e,d,f,g,h)}}return NaN},"yyyy-Www"),month:kb("month",Ud,Lb(Ud,["yyyy","MM"]),"yyyy-MM"),number:function(a,b,d,c,e,f){Ld(a,b,d,c);jb(a,b,d,c,e,f);c.$$parserName=
1610 "number";c.$parsers.push(function(a){if(c.$isEmpty(a))return null;if(Jg.test(a))return parseFloat(a)});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!Q(a))throw lb("numfmt",a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||y(g)||a>=g};d.$observe("min",function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));g=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}if(x(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||y(h)||a<=h};d.$observe("max",
1610 "number";c.$parsers.push(function(a){if(c.$isEmpty(a))return null;if(Jg.test(a))return parseFloat(a)});c.$formatters.push(function(a){if(!c.$isEmpty(a)){if(!Q(a))throw lb("numfmt",a);a=a.toString()}return a});if(x(d.min)||d.ngMin){var g;c.$validators.min=function(a){return c.$isEmpty(a)||y(g)||a>=g};d.$observe("min",function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));g=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}if(x(d.max)||d.ngMax){var h;c.$validators.max=function(a){return c.$isEmpty(a)||y(h)||a<=h};d.$observe("max",
1611 function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));h=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}},url:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Hg.test(d)}},email:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},radio:function(a,b,d,c){y(d.name)&&b.attr("name",++nb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,
1611 function(a){x(a)&&!Q(a)&&(a=parseFloat(a,10));h=Q(a)&&!isNaN(a)?a:void 0;c.$validate()})}},url:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="url";c.$validators.url=function(a,b){var d=a||b;return c.$isEmpty(d)||Hg.test(d)}},email:function(a,b,d,c,e,f){jb(a,b,d,c,e,f);lc(c);c.$$parserName="email";c.$validators.email=function(a,b){var d=a||b;return c.$isEmpty(d)||Ig.test(d)}},radio:function(a,b,d,c){y(d.name)&&b.attr("name",++nb);b.on("click",function(a){b[0].checked&&c.$setViewValue(d.value,
1612 a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Md(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Md(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return pa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:C,button:C,submit:C,reset:C,
1612 a&&a.type)});c.$render=function(){b[0].checked=d.value==c.$viewValue};d.$observe("value",c.$render)},checkbox:function(a,b,d,c,e,f,g,h){var k=Md(h,a,"ngTrueValue",d.ngTrueValue,!0),l=Md(h,a,"ngFalseValue",d.ngFalseValue,!1);b.on("click",function(a){c.$setViewValue(b[0].checked,a&&a.type)});c.$render=function(){b[0].checked=c.$viewValue};c.$isEmpty=function(a){return!1===a};c.$formatters.push(function(a){return pa(a,k)});c.$parsers.push(function(a){return a?k:l})},hidden:C,button:C,submit:C,reset:C,
1613 file:C},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Wd[P(g.type)]||Wd.text)(e,f,g,h[0],b,a,d,c)}}}}],Kg=/^(true|false|\d+)$/,Te=function(){return{restrict:"A",priority:100,compile:function(a,b){return Kg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},te=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);
1613 file:C},Dc=["$browser","$sniffer","$filter","$parse",function(a,b,d,c){return{restrict:"E",require:["?ngModel"],link:{pre:function(e,f,g,h){h[0]&&(Wd[P(g.type)]||Wd.text)(e,f,g,h[0],b,a,d,c)}}}}],Kg=/^(true|false|\d+)$/,Te=function(){return{restrict:"A",priority:100,compile:function(a,b){return Kg.test(b.ngValue)?function(a,b,e){e.$set("value",a.$eval(e.ngValue))}:function(a,b,e){a.$watch(e.ngValue,function(a){e.$set("value",a)})}}}},te=["$compile",function(a){return{restrict:"AC",compile:function(b){a.$$addBindingClass(b);
1614 return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=y(a)?"":a})}}}}],ve=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=y(a)?"":a})}}}}],ue=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=
1614 return function(b,c,e){a.$$addBindingInfo(c,e.ngBind);c=c[0];b.$watch(e.ngBind,function(a){c.textContent=y(a)?"":a})}}}}],ve=["$interpolate","$compile",function(a,b){return{compile:function(d){b.$$addBindingClass(d);return function(c,d,f){c=a(d.attr(f.$attr.ngBindTemplate));b.$$addBindingInfo(d,c.expressions);d=d[0];f.$observe("ngBindTemplate",function(a){d.textContent=y(a)?"":a})}}}}],ue=["$sce","$parse","$compile",function(a,b,d){return{restrict:"A",compile:function(c,e){var f=b(e.ngBindHtml),g=
1615 b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Se=da({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),we=mc("",!0),ye=mc("Odd",0),xe=mc("Even",1),ze=La({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ae=[function(){return{restrict:"A",scope:!0,controller:"@",
1615 b(e.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(c);return function(b,c,e){d.$$addBindingInfo(c,e.ngBindHtml);b.$watch(g,function(){c.html(a.getTrustedHtml(f(b))||"")})}}}}],Se=da({restrict:"A",require:"ngModel",link:function(a,b,d,c){c.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),we=mc("",!0),ye=mc("Odd",0),xe=mc("Even",1),ze=La({compile:function(a,b){b.$set("ngCloak",void 0);a.removeClass("ng-cloak")}}),Ae=[function(){return{restrict:"A",scope:!0,controller:"@",
1616 priority:500}}],Ic={},Lg={blur:!0,focus:!0};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Lg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var De=["$animate","$compile",function(a,
1616 priority:500}}],Ic={},Lg={blur:!0,focus:!0};q("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var b=xa("ng-"+a);Ic[b]=["$parse","$rootScope",function(d,c){return{restrict:"A",compile:function(e,f){var g=d(f[b],null,!0);return function(b,d){d.on(a,function(d){var e=function(){g(b,{$event:d})};Lg[a]&&c.$$phase?b.$evalAsync(e):b.$apply(e)})}}}}]});var De=["$animate","$compile",function(a,
1617 b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=rb(h.clone),a.leave(l).then(function(){l=null}),h=null))})}}}],Ee=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,
1617 b){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(d,c,e,f,g){var h,k,l;d.$watch(e.ngIf,function(d){d?k||g(function(d,f){k=f;d[d.length++]=b.$$createComment("end ngIf",e.ngIf);h={clone:d};a.enter(d,c.parent(),c)}):(l&&(l.remove(),l=null),k&&(k.$destroy(),k=null),h&&(l=rb(h.clone),a.leave(l).then(function(){l=null}),h=null))})}}}],Ee=["$templateRequest","$anchorScroll","$animate",function(a,b,d){return{restrict:"ECA",priority:400,terminal:!0,
1618 transclude:"element",controller:ea.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,n,m,r){var q=0,s,w,p,y=function(){w&&(w.remove(),w=null);s&&(s.$destroy(),s=null);p&&(d.leave(p).then(function(){w=null}),w=p,p=null)};c.$watch(f,function(f){var n=function(){!x(h)||h&&!c.$eval(h)||b()},u=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&u===q){var b=c.$new();m.template=a;a=r(b,function(a){y();d.enter(a,null,e).then(n)});s=b;p=a;s.$emit("$includeContentLoaded",
1618 transclude:"element",controller:ea.noop,compile:function(c,e){var f=e.ngInclude||e.src,g=e.onload||"",h=e.autoscroll;return function(c,e,n,m,r){var q=0,s,w,p,y=function(){w&&(w.remove(),w=null);s&&(s.$destroy(),s=null);p&&(d.leave(p).then(function(){w=null}),w=p,p=null)};c.$watch(f,function(f){var n=function(){!x(h)||h&&!c.$eval(h)||b()},u=++q;f?(a(f,!0).then(function(a){if(!c.$$destroyed&&u===q){var b=c.$new();m.template=a;a=r(b,function(a){y();d.enter(a,null,e).then(n)});s=b;p=a;s.$emit("$includeContentLoaded",
1619 f);c.$eval(g)}},function(){c.$$destroyed||u!==q||(y(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(y(),m.template=null)})}}}}],Ve=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ma.call(d[0]).match(/SVG/)?(d.empty(),a(Lc(e.template,v.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Fe=La({priority:450,compile:function(){return{pre:function(a,
1619 f);c.$eval(g)}},function(){c.$$destroyed||u!==q||(y(),c.$emit("$includeContentError",f))}),c.$emit("$includeContentRequested",f)):(y(),m.template=null)})}}}}],Ve=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(b,d,c,e){ma.call(d[0]).match(/SVG/)?(d.empty(),a(Lc(e.template,v.document).childNodes)(b,function(a){d.append(a)},{futureParentElement:d})):(d.html(e.template),a(d.contents())(b))}}}],Fe=La({priority:450,compile:function(){return{pre:function(a,
1620 b,d){a.$eval(d.ngInit)}}}}),Re=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!y(a)){var b=[];a&&q(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){if(K(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Nd="ng-invalid",Ua="ng-pristine",Kb="ng-dirty",Pd="ng-pending",lb=O("ngModel"),Mg=["$scope",
1620 b,d){a.$eval(d.ngInit)}}}}),Re=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,b,d,c){var e=b.attr(d.$attr.ngList)||", ",f="false"!==d.ngTrim,g=f?V(e):e;c.$parsers.push(function(a){if(!y(a)){var b=[];a&&q(a.split(g),function(a){a&&b.push(f?V(a):a)});return b}});c.$formatters.push(function(a){if(K(a))return a.join(e)});c.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Nd="ng-invalid",Ua="ng-pristine",Kb="ng-dirty",Pd="ng-pending",lb=O("ngModel"),Mg=["$scope",
1621 "$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=l(d.name||"",!1)(a);
1621 "$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,b,d,c,e,f,g,h,k,l){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=void 0;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=void 0;this.$name=l(d.name||"",!1)(a);
1622 this.$$parentForm=Jb;var n=e(d.ngModel),m=n.assign,r=n,s=m,v=null,w,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");r=function(a){var c=n(a);E(c)&&(c=b(a));return c};s=function(a,b){E(n(a))?f(a,{$$$p:b}):m(a,b)}}else if(!n.assign)throw lb("nonassign",d.ngModel,wa(c));};this.$render=C;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),
1622 this.$$parentForm=Jb;var n=e(d.ngModel),m=n.assign,r=n,s=m,v=null,w,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var b=e(d.ngModel+"()"),f=e(d.ngModel+"($$$p)");r=function(a){var c=n(a);E(c)&&(c=b(a));return c};s=function(a,b){E(n(a))?f(a,{$$$p:b}):m(a,b)}}else if(!n.assign)throw lb("nonassign",d.ngModel,wa(c));};this.$render=C;this.$isEmpty=function(a){return y(a)||""===a||null===a||a!==a};this.$$updateEmptyClasses=function(a){p.$isEmpty(a)?(f.removeClass(c,"ng-not-empty"),
1623 f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var H=0;Jd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;f.removeClass(c,Kb);f.addClass(c,Ua)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;f.removeClass(c,Ua);f.addClass(c,Kb);p.$$parentForm.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};
1623 f.addClass(c,"ng-empty")):(f.removeClass(c,"ng-empty"),f.addClass(c,"ng-not-empty"))};var H=0;Jd({ctrl:this,$element:c,set:function(a,b){a[b]=!0},unset:function(a,b){delete a[b]},$animate:f});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;f.removeClass(c,Kb);f.addClass(c,Ua)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;f.removeClass(c,Ua);f.addClass(c,Kb);p.$$parentForm.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;f.setClass(c,"ng-untouched","ng-touched")};
1624 this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(v);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!Q(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:void 0,p.$modelValue!==c&&p.$$writeModelToScope())})}};
1624 this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;f.setClass(c,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){g.cancel(v);p.$viewValue=p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!Q(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,b=p.$valid,c=p.$modelValue,d=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(e){d||b===e||(p.$modelValue=e?a:void 0,p.$modelValue!==c&&p.$$writeModelToScope())})}};
1625 this.$$runValidators=function(a,b,c){function d(){var c=!0;q(p.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(q(p.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!E(h.then))throw lb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},C):g(!0)}function f(a,b){h===H&&p.$setValidity(a,b)}function g(a){h===H&&c(a)}H++;var h=
1625 this.$$runValidators=function(a,b,c){function d(){var c=!0;q(p.$validators,function(d,e){var g=d(a,b);c=c&&g;f(e,g)});return c?!0:(q(p.$asyncValidators,function(a,b){f(b,null)}),!1)}function e(){var c=[],d=!0;q(p.$asyncValidators,function(e,g){var h=e(a,b);if(!h||!E(h.then))throw lb("nopromise",h);f(g,void 0);c.push(h.then(function(){f(g,!0)},function(){d=!1;f(g,!1)}))});c.length?k.all(c).then(function(){g(d)},C):g(!0)}function f(a,b){h===H&&p.$setValidity(a,b)}function g(a){h===H&&c(a)}H++;var h=
1626 H;(function(){var a=p.$$parserName||"parse";if(y(w))f(a,null);else return w||(q(p.$validators,function(a,b){f(b,null)}),q(p.$asyncValidators,function(a,b){f(b,null)})),f(a,w),w;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(v);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;
1626 H;(function(){var a=p.$$parserName||"parse";if(y(w))f(a,null);else return w||(q(p.$validators,function(a,b){f(b,null)}),q(p.$asyncValidators,function(a,b){f(b,null)})),f(a,w),w;return!0})()?d()?e():g(!1):g(!1)};this.$commitViewValue=function(){var a=p.$viewValue;g.cancel(v);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$updateEmptyClasses(a),p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var b=p.$$lastCommittedViewValue;
1627 if(w=y(b)?void 0:!0)for(var c=0;c<p.$parsers.length;c++)if(b=p.$parsers[c](b),y(b)){w=!1;break}Q(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=r(a));var d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=b;e&&(p.$modelValue=b,p.$modelValue!==d&&p.$$writeModelToScope());p.$$runValidators(b,p.$$lastCommittedViewValue,function(a){e||(p.$modelValue=a?b:void 0,p.$modelValue!==d&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,p.$modelValue);q(p.$viewChangeListeners,
1627 if(w=y(b)?void 0:!0)for(var c=0;c<p.$parsers.length;c++)if(b=p.$parsers[c](b),y(b)){w=!1;break}Q(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=r(a));var d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=b;e&&(p.$modelValue=b,p.$modelValue!==d&&p.$$writeModelToScope());p.$$runValidators(b,p.$$lastCommittedViewValue,function(a){e||(p.$modelValue=a?b:void 0,p.$modelValue!==d&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,p.$modelValue);q(p.$viewChangeListeners,
1628 function(a){try{a()}catch(c){b(c)}})};this.$setViewValue=function(a,b){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(b)};this.$$debounceViewValueCommit=function(b){var c=0,d=p.$options;d&&x(d.debounce)&&(d=d.debounce,Q(d)?c=d:Q(d[b])?c=d[b]:Q(d["default"])&&(c=d["default"]));g.cancel(v);c?v=g(function(){p.$commitViewValue()},c):h.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var b=r(a);if(b!==p.$modelValue&&(p.$modelValue===
1628 function(a){try{a()}catch(c){b(c)}})};this.$setViewValue=function(a,b){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(b)};this.$$debounceViewValueCommit=function(b){var c=0,d=p.$options;d&&x(d.debounce)&&(d=d.debounce,Q(d)?c=d:Q(d[b])?c=d[b]:Q(d["default"])&&(c=d["default"]));g.cancel(v);c?v=g(function(){p.$commitViewValue()},c):h.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var b=r(a);if(b!==p.$modelValue&&(p.$modelValue===
1629 p.$modelValue||b===b)){p.$modelValue=p.$$rawModelValue=b;w=void 0;for(var c=p.$formatters,d=c.length,e=b;d--;)e=c[d](e);p.$viewValue!==e&&(p.$$updateEmptyClasses(e),p.$viewValue=p.$$lastCommittedViewValue=e,p.$render(),p.$$runValidators(b,e,C))}return b})}],Qe=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Mg,priority:1,compile:function(b){b.addClass(Ua).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||
1629 p.$modelValue||b===b)){p.$modelValue=p.$$rawModelValue=b;w=void 0;for(var c=p.$formatters,d=c.length,e=b;d--;)e=c[d](e);p.$viewValue!==e&&(p.$$updateEmptyClasses(e),p.$viewValue=p.$$lastCommittedViewValue=e,p.$render(),p.$$runValidators(b,e,C))}return b})}],Qe=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:Mg,priority:1,compile:function(b){b.addClass(Ua).addClass("ng-untouched").addClass(mb);return{pre:function(a,b,e,f){var g=f[0];b=f[1]||
1630 g.$$parentForm;g.$$setOptions(f[2]&&f[2].$options);b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){var g=f[0];if(g.$options&&g.$options.updateOn)c.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(g.$setTouched):b.$apply(g.$setTouched))})}}}}}],Ng=/(\s+|^)default(\s+|$)/,Ue=function(){return{restrict:"A",
1630 g.$$parentForm;g.$$setOptions(f[2]&&f[2].$options);b.$addControl(g);e.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},post:function(b,c,e,f){var g=f[0];if(g.$options&&g.$options.updateOn)c.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});c.on("blur",function(){g.$touched||(a.$$phase?b.$evalAsync(g.$setTouched):b.$apply(g.$setTouched))})}}}}}],Ng=/(\s+|^)default(\s+|$)/,Ue=function(){return{restrict:"A",
1631 controller:["$scope","$attrs",function(a,b){var d=this;this.$options=qa(a.$eval(b.ngModelOptions));x(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=V(this.$options.updateOn.replace(Ng,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ge=La({terminal:!0,priority:1E3}),Og=O("ngOptions"),Pg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
1631 controller:["$scope","$attrs",function(a,b){var d=this;this.$options=qa(a.$eval(b.ngModelOptions));x(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=V(this.$options.updateOn.replace(Ng,function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ge=La({terminal:!0,priority:1E3}),Og=O("ngOptions"),Pg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,
1632 Oe=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!q&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var m=a.match(Pg);if(!m)throw Og("iexp",a,wa(b));var r=m[5]||m[7],q=m[6];a=/ as /.test(m[0])&&m[1];var s=m[9];b=d(m[2]?m[1]:r);var w=a&&d(a)||b,p=s&&d(s),v=s?function(a,b){return p(c,b)}:function(a){return Fa(a)},
1632 Oe=["$compile","$document","$parse",function(a,b,d){function c(a,b,c){function e(a,b,c,d,f){this.selectValue=a;this.viewValue=b;this.label=c;this.group=d;this.disabled=f}function f(a){var b;if(!q&&ya(a))b=a;else{b=[];for(var c in a)a.hasOwnProperty(c)&&"$"!==c.charAt(0)&&b.push(c)}return b}var m=a.match(Pg);if(!m)throw Og("iexp",a,wa(b));var r=m[5]||m[7],q=m[6];a=/ as /.test(m[0])&&m[1];var s=m[9];b=d(m[2]?m[1]:r);var w=a&&d(a)||b,p=s&&d(s),v=s?function(a,b){return p(c,b)}:function(a){return Fa(a)},
1633 t=function(a,b){return v(a,L(a,b))},z=d(m[2]||m[1]),u=d(m[3]||""),y=d(m[4]||""),x=d(m[8]),D={},L=q?function(a,b){D[q]=b;D[r]=a;return D}:function(a){D[r]=a;return D};return{trackBy:s,getTrackByValue:t,getWatchables:d(x,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var h=a===d?g:d[g],l=a[h],h=L(l,h),l=v(l,h);b.push(l);if(m[2]||m[1])l=z(c,h),b.push(l);m[4]&&(h=y(c,h),b.push(h))}return b}),getOptions:function(){for(var a=[],b={},d=x(c)||[],g=f(d),h=g.length,m=0;m<h;m++){var p=d===
1633 t=function(a,b){return v(a,L(a,b))},z=d(m[2]||m[1]),u=d(m[3]||""),y=d(m[4]||""),x=d(m[8]),D={},L=q?function(a,b){D[q]=b;D[r]=a;return D}:function(a){D[r]=a;return D};return{trackBy:s,getTrackByValue:t,getWatchables:d(x,function(a){var b=[];a=a||[];for(var d=f(a),e=d.length,g=0;g<e;g++){var h=a===d?g:d[g],l=a[h],h=L(l,h),l=v(l,h);b.push(l);if(m[2]||m[1])l=z(c,h),b.push(l);m[4]&&(h=y(c,h),b.push(h))}return b}),getOptions:function(){for(var a=[],b={},d=x(c)||[],g=f(d),h=g.length,m=0;m<h;m++){var p=d===
1634 g?m:g[m],q=L(d[p],p),r=w(c,q),p=v(r,q),D=z(c,q),N=u(c,q),q=y(c,q),r=new e(p,r,D,N,q);a.push(r);b[p]=r}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[t(a)]},getViewValueFromOption:function(a){return s?ea.copy(a.viewValue):a.viewValue}}}}}var e=v.document.createElement("option"),f=v.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=C},post:function(d,h,k,l){function n(a,b){a.element=
1634 g?m:g[m],q=L(d[p],p),r=w(c,q),p=v(r,q),D=z(c,q),N=u(c,q),q=y(c,q),r=new e(p,r,D,N,q);a.push(r);b[p]=r}return{items:a,selectValueMap:b,getOptionFromViewValue:function(a){return b[t(a)]},getViewValueFromOption:function(a){return s?ea.copy(a.viewValue):a.viewValue}}}}}var e=v.document.createElement("option"),f=v.document.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","ngModel"],link:{pre:function(a,b,c,d){d[0].registerOption=C},post:function(d,h,k,l){function n(a,b){a.element=
1635 b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);a.value!==b.value&&(b.value=a.selectValue)}function m(){var a=u&&r.readValue();if(u)for(var b=u.items.length-1;0<=b;b--){var c=u.items[b];c.group?Bb(c.element.parentNode):Bb(c.element)}u=I.getOptions();var d={};t&&h.prepend(w);u.items.forEach(function(a){var b;if(x(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),E.appendChild(b),b.label=a.group,d[a.group]=b);var c=e.cloneNode(!1)}else b=E,c=e.cloneNode(!1);b.appendChild(c);
1635 b;b.disabled=a.disabled;a.label!==b.label&&(b.label=a.label,b.textContent=a.label);a.value!==b.value&&(b.value=a.selectValue)}function m(){var a=u&&r.readValue();if(u)for(var b=u.items.length-1;0<=b;b--){var c=u.items[b];c.group?Bb(c.element.parentNode):Bb(c.element)}u=I.getOptions();var d={};t&&h.prepend(w);u.items.forEach(function(a){var b;if(x(a.group)){b=d[a.group];b||(b=f.cloneNode(!1),E.appendChild(b),b.label=a.group,d[a.group]=b);var c=e.cloneNode(!1)}else b=E,c=e.cloneNode(!1);b.appendChild(c);
1636 n(a,c)});h[0].appendChild(E);s.$render();s.$isEmpty(a)||(b=r.readValue(),(I.trackBy||v?pa(a,b):a===b)||(s.$setViewValue(b),s.$render()))}var r=l[0],s=l[1],v=k.multiple,w;l=0;for(var p=h.children(),y=p.length;l<y;l++)if(""===p[l].value){w=p.eq(l);break}var t=!!w,z=B(e.cloneNode(!1));z.val("?");var u,I=c(k.ngOptions,h,d),E=b[0].createDocumentFragment();v?(s.$isEmpty=function(a){return!a||0===a.length},r.writeValue=function(a){u.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){if(a=
1636 n(a,c)});h[0].appendChild(E);s.$render();s.$isEmpty(a)||(b=r.readValue(),(I.trackBy||v?pa(a,b):a===b)||(s.$setViewValue(b),s.$render()))}var r=l[0],s=l[1],v=k.multiple,w;l=0;for(var p=h.children(),y=p.length;l<y;l++)if(""===p[l].value){w=p.eq(l);break}var t=!!w,z=B(e.cloneNode(!1));z.val("?");var u,I=c(k.ngOptions,h,d),E=b[0].createDocumentFragment();v?(s.$isEmpty=function(a){return!a||0===a.length},r.writeValue=function(a){u.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){if(a=
1637 u.getOptionFromViewValue(a))a.element.selected=!0})},r.readValue=function(){var a=h.val()||[],b=[];q(a,function(a){(a=u.selectValueMap[a])&&!a.disabled&&b.push(u.getViewValueFromOption(a))});return b},I.trackBy&&d.$watchCollection(function(){if(K(s.$viewValue))return s.$viewValue.map(function(a){return I.getTrackByValue(a)})},function(){s.$render()})):(r.writeValue=function(a){var b=u.getOptionFromViewValue(a);b?(h[0].value!==b.selectValue&&(z.remove(),t||w.remove(),h[0].value=b.selectValue,b.element.selected=
1637 u.getOptionFromViewValue(a))a.element.selected=!0})},r.readValue=function(){var a=h.val()||[],b=[];q(a,function(a){(a=u.selectValueMap[a])&&!a.disabled&&b.push(u.getViewValueFromOption(a))});return b},I.trackBy&&d.$watchCollection(function(){if(K(s.$viewValue))return s.$viewValue.map(function(a){return I.getTrackByValue(a)})},function(){s.$render()})):(r.writeValue=function(a){var b=u.getOptionFromViewValue(a);b?(h[0].value!==b.selectValue&&(z.remove(),t||w.remove(),h[0].value=b.selectValue,b.element.selected=
1638 !0),b.element.setAttribute("selected","selected")):null===a||t?(z.remove(),t||h.prepend(w),h.val(""),w.prop("selected",!0),w.attr("selected",!0)):(t||w.remove(),h.prepend(z),h.val("?"),z.prop("selected",!0),z.attr("selected",!0))},r.readValue=function(){var a=u.selectValueMap[h.val()];return a&&!a.disabled?(t||w.remove(),z.remove(),u.getViewValueFromOption(a)):null},I.trackBy&&d.$watch(function(){return I.getTrackByValue(s.$viewValue)},function(){s.$render()}));t?(w.remove(),a(w)(d),w.removeClass("ng-scope")):
1638 !0),b.element.setAttribute("selected","selected")):null===a||t?(z.remove(),t||h.prepend(w),h.val(""),w.prop("selected",!0),w.attr("selected",!0)):(t||w.remove(),h.prepend(z),h.val("?"),z.prop("selected",!0),z.attr("selected",!0))},r.readValue=function(){var a=u.selectValueMap[h.val()];return a&&!a.disabled?(t||w.remove(),z.remove(),u.getViewValueFromOption(a)):null},I.trackBy&&d.$watch(function(){return I.getTrackByValue(s.$viewValue)},function(){s.$render()}));t?(w.remove(),a(w)(d),w.removeClass("ng-scope")):
1639 w=B(e.cloneNode(!1));h.empty();m();d.$watchCollection(I.getWatchables,m)}}}}],He=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,h){function k(a){g.text(a||"")}var l=h.count,n=h.$attr.when&&g.attr(h.$attr.when),m=h.offset||0,r=f.$eval(n)||{},s={},v=b.startSymbol(),w=b.endSymbol(),p=v+l+"-"+m+w,x=ea.noop,t;q(h,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+P(c[2]),r[c]=g.attr(h.$attr[b]))});q(r,function(a,d){s[d]=b(a.replace(c,p))});f.$watch(l,
1639 w=B(e.cloneNode(!1));h.empty();m();d.$watchCollection(I.getWatchables,m)}}}}],He=["$locale","$interpolate","$log",function(a,b,d){var c=/{}/g,e=/^when(Minus)?(.+)$/;return{link:function(f,g,h){function k(a){g.text(a||"")}var l=h.count,n=h.$attr.when&&g.attr(h.$attr.when),m=h.offset||0,r=f.$eval(n)||{},s={},v=b.startSymbol(),w=b.endSymbol(),p=v+l+"-"+m+w,x=ea.noop,t;q(h,function(a,b){var c=e.exec(b);c&&(c=(c[1]?"-":"")+P(c[2]),r[c]=g.attr(h.$attr[b]))});q(r,function(a,d){s[d]=b(a.replace(c,p))});f.$watch(l,
1640 function(b){var c=parseFloat(b),e=isNaN(c);e||c in r||(c=a.pluralCat(c-m));c===t||e&&Q(t)&&isNaN(t)||(x(),e=s[c],y(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+n),x=C,k()):x=f.$watch(e,k),t=c)})}}}],Ie=["$parse","$animate","$compile",function(a,b,d){var c=O("ngRepeat"),e=function(a,b,c,d,e,n,m){a[c]=d;e&&(a[e]=n);a.$index=b;a.$first=0===b;a.$last=b===m-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,
1640 function(b){var c=parseFloat(b),e=isNaN(c);e||c in r||(c=a.pluralCat(c-m));c===t||e&&Q(t)&&isNaN(t)||(x(),e=s[c],y(e)?(null!=b&&d.debug("ngPluralize: no rule defined for '"+c+"' in "+n),x=C,k()):x=f.$watch(e,k),t=c)})}}}],Ie=["$parse","$animate","$compile",function(a,b,d){var c=O("ngRepeat"),e=function(a,b,c,d,e,n,m){a[c]=d;e&&(a[e]=n);a.$index=b;a.$first=0===b;a.$last=b===m-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(b&1))};return{restrict:"A",multiElement:!0,transclude:"element",priority:1E3,
1641 terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=d.$$createComment("end ngRepeat",h),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!l)throw c("iexp",h);var n=l[1],m=l[2],r=l[3],s=l[4],l=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!l)throw c("iidexp",n);var v=l[3]||l[1],w=l[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw c("badident",
1641 terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,k=d.$$createComment("end ngRepeat",h),l=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!l)throw c("iexp",h);var n=l[1],m=l[2],r=l[3],s=l[4],l=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!l)throw c("iidexp",n);var v=l[3]||l[1],w=l[2];if(r&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(r)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(r)))throw c("badident",
1642 r);var p,y,t,z,u={$id:Fa};s?p=a(s):(t=function(a,b){return Fa(b)},z=function(a){return a});return function(a,d,f,g,l){p&&(y=function(b,c,d){w&&(u[w]=b);u[v]=c;u.$index=d;return p(a,u)});var n=T();a.$watchCollection(m,function(f){var g,m,p=d[0],s,u=T(),x,D,E,C,F,B,G;r&&(a[r]=f);if(ya(f))F=f,m=y||t;else for(G in m=y||z,F=[],f)ua.call(f,G)&&"$"!==G.charAt(0)&&F.push(G);x=F.length;G=Array(x);for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],C=m(D,E,g),n[C])B=n[C],delete n[C],u[C]=B,G[g]=B;else{if(u[C])throw q(G,
1642 r);var p,y,t,z,u={$id:Fa};s?p=a(s):(t=function(a,b){return Fa(b)},z=function(a){return a});return function(a,d,f,g,l){p&&(y=function(b,c,d){w&&(u[w]=b);u[v]=c;u.$index=d;return p(a,u)});var n=T();a.$watchCollection(m,function(f){var g,m,p=d[0],s,u=T(),x,D,E,C,F,B,G;r&&(a[r]=f);if(ya(f))F=f,m=y||t;else for(G in m=y||z,F=[],f)ua.call(f,G)&&"$"!==G.charAt(0)&&F.push(G);x=F.length;G=Array(x);for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],C=m(D,E,g),n[C])B=n[C],delete n[C],u[C]=B,G[g]=B;else{if(u[C])throw q(G,
1643 function(a){a&&a.scope&&(n[a.id]=a)}),c("dupes",h,C,E);G[g]={id:C,scope:void 0,clone:void 0};u[C]=!0}for(s in n){B=n[s];C=rb(B.clone);b.leave(C);if(C[0].parentNode)for(g=0,m=C.length;g<m;g++)C[g].$$NG_REMOVED=!0;B.scope.$destroy()}for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],B=G[g],B.scope){s=p;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);B.clone[0]!=s&&b.move(rb(B.clone),null,p);p=B.clone[B.clone.length-1];e(B.scope,g,v,E,w,D,x)}else l(function(a,c){B.scope=c;var d=k.cloneNode(!1);a[a.length++]=d;b.enter(a,
1643 function(a){a&&a.scope&&(n[a.id]=a)}),c("dupes",h,C,E);G[g]={id:C,scope:void 0,clone:void 0};u[C]=!0}for(s in n){B=n[s];C=rb(B.clone);b.leave(C);if(C[0].parentNode)for(g=0,m=C.length;g<m;g++)C[g].$$NG_REMOVED=!0;B.scope.$destroy()}for(g=0;g<x;g++)if(D=f===F?g:F[g],E=f[D],B=G[g],B.scope){s=p;do s=s.nextSibling;while(s&&s.$$NG_REMOVED);B.clone[0]!=s&&b.move(rb(B.clone),null,p);p=B.clone[B.clone.length-1];e(B.scope,g,v,E,w,D,x)}else l(function(a,c){B.scope=c;var d=k.cloneNode(!1);a[a.length++]=d;b.enter(a,
1644 null,p);p=d;B.clone=a;u[B.id]=B;e(B.scope,g,v,E,w,D,x)});n=u})}}}}],Je=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ce=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ke=La(function(a,b,d){a.$watch(d.ngStyle,function(a,
1644 null,p);p=d;B.clone=a;u[B.id]=B;e(B.scope,g,v,E,w,D,x)});n=u})}}}}],Je=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngShow,function(b){a[b?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ce=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(b,d,c){b.$watch(c.ngHide,function(b){a[b?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ke=La(function(a,b,d){a.$watch(d.ngStyle,function(a,
1645 d){d&&a!==d&&q(d,function(a,c){b.css(c,"")});a&&b.css(a)},!0)}),Le=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],h=[],k=[],l=[],n=function(a,b){return function(){a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=k.length;d<e;++d)a.cancel(k[d]);d=k.length=0;for(e=l.length;d<e;++d){var s=rb(h[d].clone);l[d].$destroy();(k[d]=a.leave(s)).then(n(k,d))}h.length=0;l.length=0;(g=f.cases["!"+
1645 d){d&&a!==d&&q(d,function(a,c){b.css(c,"")});a&&b.css(a)},!0)}),Le=["$animate","$compile",function(a,b){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(d,c,e,f){var g=[],h=[],k=[],l=[],n=function(a,b){return function(){a.splice(b,1)}};d.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=k.length;d<e;++d)a.cancel(k[d]);d=k.length=0;for(e=l.length;d<e;++d){var s=rb(h[d].clone);l[d].$destroy();(k[d]=a.leave(s)).then(n(k,d))}h.length=0;l.length=0;(g=f.cases["!"+
1646 c]||f.cases["?"])&&q(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Me=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["!"+d.ngSwitchWhen]=c.cases["!"+d.ngSwitchWhen]||[];c.cases["!"+d.ngSwitchWhen].push({transclude:e,element:b})}}),Ne=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
1646 c]||f.cases["?"])&&q(g,function(c){c.transclude(function(d,e){l.push(e);var f=c.element;d[d.length++]=b.$$createComment("end ngSwitchWhen");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Me=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,b,d,c,e){c.cases["!"+d.ngSwitchWhen]=c.cases["!"+d.ngSwitchWhen]||[];c.cases["!"+d.ngSwitchWhen].push({transclude:e,element:b})}}),Ne=La({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
1647 b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),Qg=O("ngTransclude"),Pe=La({restrict:"EAC",link:function(a,b,d,c,e){d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");if(!e)throw Qg("orphan",wa(b));e(function(a){a.length&&(b.empty(),b.append(a))},null,d.ngTransclude||d.ngTranscludeSlot)}}),pe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"==d.type&&a.put(d.id,b[0].text)}}}],Rg={$setViewValue:C,$render:C},
1647 b,d,c,e){c.cases["?"]=c.cases["?"]||[];c.cases["?"].push({transclude:e,element:b})}}),Qg=O("ngTransclude"),Pe=La({restrict:"EAC",link:function(a,b,d,c,e){d.ngTransclude===d.$attr.ngTransclude&&(d.ngTransclude="");if(!e)throw Qg("orphan",wa(b));e(function(a){a.length&&(b.empty(),b.append(a))},null,d.ngTransclude||d.ngTranscludeSlot)}}),pe=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(b,d){"text/ng-template"==d.type&&a.put(d.id,b[0].text)}}}],Rg={$setViewValue:C,$render:C},
1648 Sg=["$element","$scope",function(a,b){var d=this,c=new Ra;d.ngModelCtrl=Rg;d.unknownOption=B(v.document.createElement("option"));d.renderUnknownOption=function(b){b="? "+Fa(b)+" ?";d.unknownOption.val(b);a.prepend(d.unknownOption);a.val(b)};b.$on("$destroy",function(){d.renderUnknownOption=C});d.removeUnknownOption=function(){d.unknownOption.parent()&&d.unknownOption.remove()};d.readValue=function(){d.removeUnknownOption();return a.val()};d.writeValue=function(b){d.hasOption(b)?(d.removeUnknownOption(),
1648 Sg=["$element","$scope",function(a,b){var d=this,c=new Ra;d.ngModelCtrl=Rg;d.unknownOption=B(v.document.createElement("option"));d.renderUnknownOption=function(b){b="? "+Fa(b)+" ?";d.unknownOption.val(b);a.prepend(d.unknownOption);a.val(b)};b.$on("$destroy",function(){d.renderUnknownOption=C});d.removeUnknownOption=function(){d.unknownOption.parent()&&d.unknownOption.remove()};d.readValue=function(){d.removeUnknownOption();return a.val()};d.writeValue=function(b){d.hasOption(b)?(d.removeUnknownOption(),
1649 a.val(b),""===b&&d.emptyOption.prop("selected",!0)):null==b&&d.emptyOption?(d.removeUnknownOption(),a.val("")):d.renderUnknownOption(b)};d.addOption=function(a,b){if(8!==b[0].nodeType){Qa(a,'"option value"');""===a&&(d.emptyOption=b);var g=c.get(a)||0;c.put(a,g+1);d.ngModelCtrl.$render();b[0].hasAttribute("selected")&&(b[0].selected=!0)}};d.removeOption=function(a){var b=c.get(a);b&&(1===b?(c.remove(a),""===a&&(d.emptyOption=void 0)):c.put(a,b-1))};d.hasOption=function(a){return!!c.get(a)};d.registerOption=
1649 a.val(b),""===b&&d.emptyOption.prop("selected",!0)):null==b&&d.emptyOption?(d.removeUnknownOption(),a.val("")):d.renderUnknownOption(b)};d.addOption=function(a,b){if(8!==b[0].nodeType){Qa(a,'"option value"');""===a&&(d.emptyOption=b);var g=c.get(a)||0;c.put(a,g+1);d.ngModelCtrl.$render();b[0].hasAttribute("selected")&&(b[0].selected=!0)}};d.removeOption=function(a){var b=c.get(a);b&&(1===b?(c.remove(a),""===a&&(d.emptyOption=void 0)):c.put(a,b-1))};d.hasOption=function(a){return!!c.get(a)};d.registerOption=
1650 function(a,b,c,h,k){if(h){var l;c.$observe("value",function(a){x(l)&&d.removeOption(l);l=a;d.addOption(a,b)})}else k?a.$watch(k,function(a,e){c.$set("value",a);e!==a&&d.removeOption(e);d.addOption(a,b)}):d.addOption(c.value,b);b.on("$destroy",function(){d.removeOption(c.value);d.ngModelCtrl.$render()})}}],qe=function(){return{restrict:"E",require:["select","?ngModel"],controller:Sg,priority:1,link:{pre:function(a,b,d,c){var e=c[1];if(e){var f=c[0];f.ngModelCtrl=e;b.on("change",function(){a.$apply(function(){e.$setViewValue(f.readValue())})});
1650 function(a,b,c,h,k){if(h){var l;c.$observe("value",function(a){x(l)&&d.removeOption(l);l=a;d.addOption(a,b)})}else k?a.$watch(k,function(a,e){c.$set("value",a);e!==a&&d.removeOption(e);d.addOption(a,b)}):d.addOption(c.value,b);b.on("$destroy",function(){d.removeOption(c.value);d.ngModelCtrl.$render()})}}],qe=function(){return{restrict:"E",require:["select","?ngModel"],controller:Sg,priority:1,link:{pre:function(a,b,d,c){var e=c[1];if(e){var f=c[0];f.ngModelCtrl=e;b.on("change",function(){a.$apply(function(){e.$setViewValue(f.readValue())})});
1651 if(d.multiple){f.readValue=function(){var a=[];q(b.find("option"),function(b){b.selected&&a.push(b.value)});return a};f.writeValue=function(a){var c=new Ra(a);q(b.find("option"),function(a){a.selected=x(c.get(a.value))})};var g,h=NaN;a.$watch(function(){h!==e.$viewValue||pa(g,e.$viewValue)||(g=ha(e.$viewValue),e.$render());h=e.$viewValue});e.$isEmpty=function(a){return!a||0===a.length}}}},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},se=["$interpolate",
1651 if(d.multiple){f.readValue=function(){var a=[];q(b.find("option"),function(b){b.selected&&a.push(b.value)});return a};f.writeValue=function(a){var c=new Ra(a);q(b.find("option"),function(a){a.selected=x(c.get(a.value))})};var g,h=NaN;a.$watch(function(){h!==e.$viewValue||pa(g,e.$viewValue)||(g=ha(e.$viewValue),e.$render());h=e.$viewValue});e.$isEmpty=function(a){return!a||0===a.length}}}},post:function(a,b,d,c){var e=c[1];if(e){var f=c[0];e.$render=function(){f.writeValue(e.$viewValue)}}}}}},se=["$interpolate",
1652 function(a){return{restrict:"E",priority:100,compile:function(b,d){if(x(d.value))var c=a(d.value,!0);else{var e=a(b.text(),!0);e||d.$set("value",b.text())}return function(a,b,d){var k=b.parent();(k=k.data("$selectController")||k.parent().data("$selectController"))&&k.registerOption(a,b,d,c,e)}}}}],re=da({restrict:"E",terminal:!1}),Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required=function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",
1652 function(a){return{restrict:"E",priority:100,compile:function(b,d){if(x(d.value))var c=a(d.value,!0);else{var e=a(b.text(),!0);e||d.$set("value",b.text())}return function(a,b,d){var k=b.parent();(k=k.data("$selectController")||k.parent().data("$selectController"))&&k.registerOption(a,b,d,c,e)}}}}],re=da({restrict:"E",terminal:!1}),Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){c&&(d.required=!0,c.$validators.required=function(a,b){return!d.required||!c.$isEmpty(b)},d.$observe("required",
1653 function(){c.$validate()}))}}},Ec=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){F(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw O("ngPattern")("noregexp",f,a,wa(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||y(e)||e.test(b)}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=
1653 function(){c.$validate()}))}}},Ec=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e,f=d.ngPattern||d.pattern;d.$observe("pattern",function(a){F(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw O("ngPattern")("noregexp",f,a,wa(b));e=a||void 0;c.$validate()});c.$validators.pattern=function(a,b){return c.$isEmpty(b)||y(e)||e.test(b)}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=-1;d.$observe("maxlength",function(a){a=
1654 X(a);e=isNaN(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=X(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};v.angular.bootstrap?v.console&&console.log("WARNING: Tried to load angular more than once."):(ie(),ke(ea),ea.module("ngLocale",[],["$provide",function(a){function b(a){a+=
1654 X(a);e=isNaN(a)?-1:a;c.$validate()});c.$validators.maxlength=function(a,b){return 0>e||c.$isEmpty(b)||b.length<=e}}}}},Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,b,d,c){if(c){var e=0;d.$observe("minlength",function(a){e=X(a)||0;c.$validate()});c.$validators.minlength=function(a,b){return c.$isEmpty(b)||b.length>=e}}}}};v.angular.bootstrap?v.console&&console.log("WARNING: Tried to load angular more than once."):(ie(),ke(ea),ea.module("ngLocale",[],["$provide",function(a){function b(a){a+=
1655 "";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),
1655 "";var b=a.indexOf(".");return-1==b?0:a.length-b-1}a.value("$locale",{DATETIME_FORMATS:{AMPMS:["AM","PM"],DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"],FIRSTDAYOFWEEK:6,MONTH:"January February March April May June July August September October November December".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),STANDALONEMONTH:"January February March April May June July August September October November December".split(" "),
1656 WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,
1656 WEEKENDRANGE:[5,6],fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",medium:"MMM d, y h:mm:ss a",mediumDate:"MMM d, y",mediumTime:"h:mm:ss a","short":"M/d/yy h:mm a",shortDate:"M/d/yy",shortTime:"h:mm a"},NUMBER_FORMATS:{CURRENCY_SYM:"$",DECIMAL_SEP:".",GROUP_SEP:",",PATTERNS:[{gSize:3,lgSize:3,maxFrac:3,minFrac:0,minInt:1,negPre:"-",negSuf:"",posPre:"",posSuf:""},{gSize:3,lgSize:3,maxFrac:2,minFrac:2,minInt:1,negPre:"-\u00a4",negSuf:"",posPre:"\u00a4",posSuf:""}]},id:"en-us",localeID:"en_US",pluralCat:function(a,
1657 c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),B(v.document).ready(function(){ee(v.document,yc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
1657 c){var e=a|0,f=c;void 0===f&&(f=Math.min(b(a),3));Math.pow(10,f);return 1==e&&0==f?"one":"other"}})}]),B(v.document).ready(function(){ee(v.document,yc)}))})(window);!window.angular.$$csp().noInlineStyle&&window.angular.element(document.head).prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
1658 //# sourceMappingURL=angular.min.js.map
1658 //# sourceMappingURL=angular.min.js.map
1659
1659
1660 ;/*
1660 ;/*
1661 AngularJS v1.5.5
1661 AngularJS v1.5.5
1662 (c) 2010-2016 Google, Inc. http://angularjs.org
1662 (c) 2010-2016 Google, Inc. http://angularjs.org
1663 License: MIT
1663 License: MIT
1664 */
1664 */
1665 (function(n,c){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
1665 (function(n,c){'use strict';function l(b,a,g){var d=g.baseHref(),k=b[0];return function(b,e,f){var g,h;f=f||{};h=f.expires;g=c.isDefined(f.path)?f.path:d;c.isUndefined(e)&&(h="Thu, 01 Jan 1970 00:00:00 GMT",e="");c.isString(h)&&(h=new Date(h));e=encodeURIComponent(b)+"="+encodeURIComponent(e);e=e+(g?";path="+g:"")+(f.domain?";domain="+f.domain:"");e+=h?";expires="+h.toUTCString():"";e+=f.secure?";secure":"";f=e.length+1;4096<f&&a.warn("Cookie '"+b+"' possibly not set or overflowed because it was too large ("+
1666 f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,void 0,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
1666 f+" > 4096 bytes)!");k.cookie=e}}c.module("ngCookies",["ng"]).provider("$cookies",[function(){var b=this.defaults={};this.$get=["$$cookieReader","$$cookieWriter",function(a,g){return{get:function(d){return a()[d]},getObject:function(d){return(d=this.get(d))?c.fromJson(d):d},getAll:function(){return a()},put:function(d,a,m){g(d,a,m?c.extend({},b,m):b)},putObject:function(d,b,a){this.put(d,c.toJson(b),a)},remove:function(a,k){g(a,void 0,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
1667 ["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
1667 ["$cookies",function(b){return{get:function(a){return b.getObject(a)},put:function(a,c){b.putObject(a,c)},remove:function(a){b.remove(a)}}}]);l.$inject=["$document","$log","$browser"];c.module("ngCookies").provider("$$cookieWriter",function(){this.$get=l})})(window,window.angular);
1668 //# sourceMappingURL=angular-cookies.min.js.map
1668 //# sourceMappingURL=angular-cookies.min.js.map
1669
1669
1670 ;/*
1670 ;/*
1671 AngularJS v1.5.5
1671 AngularJS v1.5.5
1672 (c) 2010-2016 Google, Inc. http://angularjs.org
1672 (c) 2010-2016 Google, Inc. http://angularjs.org
1673 License: MIT
1673 License: MIT
1674 */
1674 */
1675 (function(C,d){'use strict';function z(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,y){function k(){n&&(g.cancel(n),n=null);l&&(l.$destroy(),l=null);m&&(n=g.leave(m),n.then(function(){n=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),f=r.current;m=y(b,function(b){g.enter(b,null,m||c).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||h()});k()});l=f.scope=b;l.$emit("$viewContentLoaded");
1675 (function(C,d){'use strict';function z(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,y){function k(){n&&(g.cancel(n),n=null);l&&(l.$destroy(),l=null);m&&(n=g.leave(m),n.then(function(){n=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(d.isDefined(b&&b.$template)){var b=a.$new(),f=r.current;m=y(b,function(b){g.enter(b,null,m||c).then(function(){!d.isDefined(t)||t&&!a.$eval(t)||h()});k()});l=f.scope=b;l.$emit("$viewContentLoaded");
1676 l.$eval(u)}else k()}var l,m,n,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,h,g){return{restrict:"ECA",priority:-400,link:function(a,c){var b=g.current,f=b.locals;c.html(f.$template);var y=d(c.contents());if(b.controller){f.$scope=a;var k=h(b.controller,f);b.controllerAs&&(a[b.controllerAs]=k);c.data("$ngControllerController",k);c.children().data("$ngControllerController",k)}a[b.resolveAs||"$resolve"]=f;y(a)}}}var w=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,
1676 l.$eval(u)}else k()}var l,m,n,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(d,h,g){return{restrict:"ECA",priority:-400,link:function(a,c){var b=g.current,f=b.locals;c.html(f.$template);var y=d(c.contents());if(b.controller){f.$scope=a;var k=h(b.controller,f);b.controllerAs&&(a[b.controllerAs]=k);c.data("$ngControllerController",k);c.children().data("$ngControllerController",k)}a[b.resolveAs||"$resolve"]=f;y(a)}}}var w=d.module("ngRoute",["ng"]).provider("$route",function(){function r(a,
1677 c){return d.extend(Object.create(a),c)}function h(a,d){var b=d.caseInsensitiveMatch,f={originalPath:a,regexp:a},g=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g,function(a,d,b,c){a="?"===c||"*?"===c?"?":null;c="*"===c||"*?"===c?"*":null;g.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=new RegExp("^"+a+"$",b?"i":"");return f}var g={};this.when=function(a,c){var b=
1677 c){return d.extend(Object.create(a),c)}function h(a,d){var b=d.caseInsensitiveMatch,f={originalPath:a,regexp:a},g=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)(\*\?|[\?\*])?/g,function(a,d,b,c){a="?"===c||"*?"===c?"?":null;c="*"===c||"*?"===c?"*":null;g.push({name:b,optional:!!a});d=d||"";return""+(a?"":d)+"(?:"+(a?d:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=new RegExp("^"+a+"$",b?"i":"");return f}var g={};this.when=function(a,c){var b=
1678 d.copy(c);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=d.extend(b,a&&h(a,b));if(a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[f]=d.extend({redirectTo:a},h(f,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest",
1678 d.copy(c);d.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);d.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=d.extend(b,a&&h(a,b));if(a){var f="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[f]=d.extend({redirectTo:a},h(f,b))}return this};this.caseInsensitiveMatch=!1;this.otherwise=function(a){"string"===typeof a&&(a={redirectTo:a});this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$templateRequest",
1679 "$sce",function(a,c,b,f,h,k,x){function l(b){var e=s.current;(w=(p=n())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!u)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function m(){var v=s.current,e=p;if(w)v.params=e.params,d.copy(v.params,b),a.$broadcast("$routeUpdate",v);else if(e||v)u=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?c.path(t(e.redirectTo,e.params)).search(e.params).replace():c.url(e.redirectTo(e.pathParams,
1679 "$sce",function(a,c,b,f,h,k,x){function l(b){var e=s.current;(w=(p=n())&&e&&p.$$route===e.$$route&&d.equals(p.pathParams,e.pathParams)&&!p.reloadOnSearch&&!u)||!e&&!p||a.$broadcast("$routeChangeStart",p,e).defaultPrevented&&b&&b.preventDefault()}function m(){var v=s.current,e=p;if(w)v.params=e.params,d.copy(v.params,b),a.$broadcast("$routeUpdate",v);else if(e||v)u=!1,(s.current=e)&&e.redirectTo&&(d.isString(e.redirectTo)?c.path(t(e.redirectTo,e.params)).search(e.params).replace():c.url(e.redirectTo(e.pathParams,
1680 c.path(),c.search())).replace()),f.when(e).then(function(){if(e){var a=d.extend({},e.resolve),b,c;d.forEach(a,function(b,e){a[e]=d.isString(b)?h.get(b):h.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(c=e.templateUrl)&&(d.isFunction(c)&&(c=c(e.params)),d.isDefined(c)&&(e.loadedTemplateUrl=x.valueOf(c),b=k(c)));d.isDefined(b)&&(a.$template=b);return f.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",
1680 c.path(),c.search())).replace()),f.when(e).then(function(){if(e){var a=d.extend({},e.resolve),b,c;d.forEach(a,function(b,e){a[e]=d.isString(b)?h.get(b):h.invoke(b,null,null,e)});d.isDefined(b=e.template)?d.isFunction(b)&&(b=b(e.params)):d.isDefined(c=e.templateUrl)&&(d.isFunction(c)&&(c=c(e.params)),d.isDefined(c)&&(e.loadedTemplateUrl=x.valueOf(c),b=k(c)));d.isDefined(b)&&(a.$template=b);return f.all(a)}}).then(function(c){e==s.current&&(e&&(e.locals=c,d.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",
1681 e,v))},function(b){e==s.current&&a.$broadcast("$routeChangeError",e,v,b)})}function n(){var a,b;d.forEach(g,function(f,g){var q;if(q=!b){var h=c.path();q=f.keys;var l={};if(f.regexp)if(h=f.regexp.exec(h)){for(var k=1,n=h.length;k<n;++k){var m=q[k-1],p=h[k];m&&p&&(l[m.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(f,{params:d.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var c=[];d.forEach((a||"").split(":"),function(a,
1681 e,v))},function(b){e==s.current&&a.$broadcast("$routeChangeError",e,v,b)})}function n(){var a,b;d.forEach(g,function(f,g){var q;if(q=!b){var h=c.path();q=f.keys;var l={};if(f.regexp)if(h=f.regexp.exec(h)){for(var k=1,n=h.length;k<n;++k){var m=q[k-1],p=h[k];m&&p&&(l[m.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(f,{params:d.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var c=[];d.forEach((a||"").split(":"),function(a,
1682 d){if(0===d)c.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];c.push(b[g]);c.push(f[2]||"");delete b[g]}});return c.join("")}var u=!1,p,w,s={routes:g,reload:function(){u=!0;var b={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;u=!1}};a.$evalAsync(function(){l(b);b.defaultPrevented||m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),c.path(t(this.current.$$route.originalPath,a)),c.search(a);else throw B("norout");
1682 d){if(0===d)c.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),g=f[1];c.push(b[g]);c.push(f[2]||"");delete b[g]}});return c.join("")}var u=!1,p,w,s={routes:g,reload:function(){u=!0;var b={defaultPrevented:!1,preventDefault:function(){this.defaultPrevented=!0;u=!1}};a.$evalAsync(function(){l(b);b.defaultPrevented||m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=d.extend({},this.current.params,a),c.path(t(this.current.$$route.originalPath,a)),c.search(a);else throw B("norout");
1683 }};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]}),B=d.$$minErr("ngRoute");w.provider("$routeParams",function(){this.$get=function(){return{}}});w.directive("ngView",z);w.directive("ngView",A);z.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
1683 }};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]}),B=d.$$minErr("ngRoute");w.provider("$routeParams",function(){this.$get=function(){return{}}});w.directive("ngView",z);w.directive("ngView",A);z.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
1684 //# sourceMappingURL=angular-route.min.js.map
1684 //# sourceMappingURL=angular-route.min.js.map
1685
1685
1686 ;/*
1686 ;/*
1687 AngularJS v1.5.5
1687 AngularJS v1.5.5
1688 (c) 2010-2016 Google, Inc. http://angularjs.org
1688 (c) 2010-2016 Google, Inc. http://angularjs.org
1689 License: MIT
1689 License: MIT
1690 */
1690 */
1691 (function(P,d){'use strict';function G(t,g){g=g||{};d.forEach(g,function(d,q){delete g[q]});for(var q in t)!t.hasOwnProperty(q)||"$"===q.charAt(0)&&"$"===q.charAt(1)||(g[q]=t[q]);return g}var z=d.$$minErr("$resource"),M=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,g=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
1691 (function(P,d){'use strict';function G(t,g){g=g||{};d.forEach(g,function(d,q){delete g[q]});for(var q in t)!t.hasOwnProperty(q)||"$"===q.charAt(0)&&"$"===q.charAt(1)||(g[q]=t[q]);return g}var z=d.$$minErr("$resource"),M=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;d.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,g=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
1692 this.$get=["$http","$log","$q","$timeout",function(q,L,H,I){function A(d,h){return encodeURIComponent(d).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,h?"%20":"+")}function B(d,h){this.template=d;this.defaults=v({},g.defaults,h);this.urlParams={}}function J(e,h,n,k){function c(a,b){var c={};b=v({},h,b);u(b,function(b,h){x(b)&&(b=b());var f;if(b&&b.charAt&&"@"==b.charAt(0)){f=a;var l=b.substr(1);if(null==l||""===l||"hasOwnProperty"===l||!M.test("."+
1692 this.$get=["$http","$log","$q","$timeout",function(q,L,H,I){function A(d,h){return encodeURIComponent(d).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,h?"%20":"+")}function B(d,h){this.template=d;this.defaults=v({},g.defaults,h);this.urlParams={}}function J(e,h,n,k){function c(a,b){var c={};b=v({},h,b);u(b,function(b,h){x(b)&&(b=b());var f;if(b&&b.charAt&&"@"==b.charAt(0)){f=a;var l=b.substr(1);if(null==l||""===l||"hasOwnProperty"===l||!M.test("."+
1693 l))throw z("badmember",l);for(var l=l.split("."),m=0,k=l.length;m<k&&d.isDefined(f);m++){var r=l[m];f=null!==f?f[r]:void 0}}else f=b;c[h]=f});return c}function N(a){return a.resource}function m(a){G(a||{},this)}var t=new B(e,k);n=v({},g.defaults.actions,n);m.prototype.toJSON=function(){var a=v({},this);delete a.$promise;delete a.$resolved;return a};u(n,function(a,b){var h=/^(POST|PUT|PATCH)$/i.test(a.method),e=a.timeout,E=d.isDefined(a.cancellable)?a.cancellable:k&&d.isDefined(k.cancellable)?k.cancellable:
1693 l))throw z("badmember",l);for(var l=l.split("."),m=0,k=l.length;m<k&&d.isDefined(f);m++){var r=l[m];f=null!==f?f[r]:void 0}}else f=b;c[h]=f});return c}function N(a){return a.resource}function m(a){G(a||{},this)}var t=new B(e,k);n=v({},g.defaults.actions,n);m.prototype.toJSON=function(){var a=v({},this);delete a.$promise;delete a.$resolved;return a};u(n,function(a,b){var h=/^(POST|PUT|PATCH)$/i.test(a.method),e=a.timeout,E=d.isDefined(a.cancellable)?a.cancellable:k&&d.isDefined(k.cancellable)?k.cancellable:
1694 g.defaults.cancellable;e&&!d.isNumber(e)&&(L.debug("ngResource:\n Only numeric values are allowed as `timeout`.\n Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete a.timeout,e=null);m[b]=function(f,l,k,g){var r={},n,w,C;switch(arguments.length){case 4:C=g,w=k;case 3:case 2:if(x(l)){if(x(f)){w=f;C=l;break}w=l;C=k}else{r=f;n=l;w=k;break}case 1:x(f)?
1694 g.defaults.cancellable;e&&!d.isNumber(e)&&(L.debug("ngResource:\n Only numeric values are allowed as `timeout`.\n Promises are not supported in $resource, because the same value would be used for multiple requests. If you are looking for a way to cancel requests, you should use the `cancellable` option."),delete a.timeout,e=null);m[b]=function(f,l,k,g){var r={},n,w,C;switch(arguments.length){case 4:C=g,w=k;case 3:case 2:if(x(l)){if(x(f)){w=f;C=l;break}w=l;C=k}else{r=f;n=l;w=k;break}case 1:x(f)?
1695 w=f:h?n=f:r=f;break;case 0:break;default:throw z("badargs",arguments.length);}var D=this instanceof m,p=D?n:a.isArray?[]:new m(n),s={},A=a.interceptor&&a.interceptor.response||N,B=a.interceptor&&a.interceptor.responseError||void 0,y,F;u(a,function(a,b){switch(b){default:s[b]=O(a);case "params":case "isArray":case "interceptor":case "cancellable":}});!D&&E&&(y=H.defer(),s.timeout=y.promise,e&&(F=I(y.resolve,e)));h&&(s.data=n);t.setUrlParams(s,v({},c(n,a.params||{}),r),a.url);r=q(s).then(function(f){var c=
1695 w=f:h?n=f:r=f;break;case 0:break;default:throw z("badargs",arguments.length);}var D=this instanceof m,p=D?n:a.isArray?[]:new m(n),s={},A=a.interceptor&&a.interceptor.response||N,B=a.interceptor&&a.interceptor.responseError||void 0,y,F;u(a,function(a,b){switch(b){default:s[b]=O(a);case "params":case "isArray":case "interceptor":case "cancellable":}});!D&&E&&(y=H.defer(),s.timeout=y.promise,e&&(F=I(y.resolve,e)));h&&(s.data=n);t.setUrlParams(s,v({},c(n,a.params||{}),r),a.url);r=q(s).then(function(f){var c=
1696 f.data;if(c){if(d.isArray(c)!==!!a.isArray)throw z("badcfg",b,a.isArray?"array":"object",d.isArray(c)?"array":"object",s.method,s.url);if(a.isArray)p.length=0,u(c,function(b){"object"===typeof b?p.push(new m(b)):p.push(b)});else{var l=p.$promise;G(c,p);p.$promise=l}}f.resource=p;return f},function(b){(C||K)(b);return H.reject(b)});r["finally"](function(){p.$resolved=!0;!D&&E&&(p.$cancelRequest=d.noop,I.cancel(F),y=F=s.timeout=null)});r=r.then(function(b){var a=A(b);(w||K)(a,b.headers);return a},B);
1696 f.data;if(c){if(d.isArray(c)!==!!a.isArray)throw z("badcfg",b,a.isArray?"array":"object",d.isArray(c)?"array":"object",s.method,s.url);if(a.isArray)p.length=0,u(c,function(b){"object"===typeof b?p.push(new m(b)):p.push(b)});else{var l=p.$promise;G(c,p);p.$promise=l}}f.resource=p;return f},function(b){(C||K)(b);return H.reject(b)});r["finally"](function(){p.$resolved=!0;!D&&E&&(p.$cancelRequest=d.noop,I.cancel(F),y=F=s.timeout=null)});r=r.then(function(b){var a=A(b);(w||K)(a,b.headers);return a},B);
1697 return D?r:(p.$promise=r,p.$resolved=!1,E&&(p.$cancelRequest=y.resolve),p)};m.prototype["$"+b]=function(a,c,d){x(a)&&(d=c,c=a,a={});a=m[b].call(this,a,this,c,d);return a.$promise||a}});m.bind=function(a){return J(e,v({},h,a),n)};return m}var K=d.noop,u=d.forEach,v=d.extend,O=d.copy,x=d.isFunction;B.prototype={setUrlParams:function(e,h,n){var k=this,c=n||k.template,g,m,q="",a=k.urlParams={};u(c.split(/\W/),function(b){if("hasOwnProperty"===b)throw z("badname");!/^\d+$/.test(b)&&b&&(new RegExp("(^|[^\\\\]):"+
1697 return D?r:(p.$promise=r,p.$resolved=!1,E&&(p.$cancelRequest=y.resolve),p)};m.prototype["$"+b]=function(a,c,d){x(a)&&(d=c,c=a,a={});a=m[b].call(this,a,this,c,d);return a.$promise||a}});m.bind=function(a){return J(e,v({},h,a),n)};return m}var K=d.noop,u=d.forEach,v=d.extend,O=d.copy,x=d.isFunction;B.prototype={setUrlParams:function(e,h,n){var k=this,c=n||k.template,g,m,q="",a=k.urlParams={};u(c.split(/\W/),function(b){if("hasOwnProperty"===b)throw z("badname");!/^\d+$/.test(b)&&b&&(new RegExp("(^|[^\\\\]):"+
1698 b+"(\\W|$)")).test(c)&&(a[b]={isQueryParamValue:(new RegExp("\\?.*=:"+b+"(?:\\W|$)")).test(c)})});c=c.replace(/\\:/g,":");c=c.replace(t,function(a){q=a;return""});h=h||{};u(k.urlParams,function(a,e){g=h.hasOwnProperty(e)?h[e]:k.defaults[e];d.isDefined(g)&&null!==g?(m=a.isQueryParamValue?A(g,!0):A(g,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(a,b){return m+b})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(a,b,c){return"/"==
1698 b+"(\\W|$)")).test(c)&&(a[b]={isQueryParamValue:(new RegExp("\\?.*=:"+b+"(?:\\W|$)")).test(c)})});c=c.replace(/\\:/g,":");c=c.replace(t,function(a){q=a;return""});h=h||{};u(k.urlParams,function(a,e){g=h.hasOwnProperty(e)?h[e]:k.defaults[e];d.isDefined(g)&&null!==g?(m=a.isQueryParamValue?A(g,!0):A(g,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(a,b){return m+b})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(a,b,c){return"/"==
1699 c.charAt(0)?c:b+c})});k.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");e.url=q+c.replace(/\/\\\./,"/.");u(h,function(a,c){k.urlParams[c]||(e.params=e.params||{},e.params[c]=a)})}};return J}]})})(window,window.angular);
1699 c.charAt(0)?c:b+c})});k.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");e.url=q+c.replace(/\/\\\./,"/.");u(h,function(a,c){k.urlParams[c]||(e.params=e.params||{},e.params[c]=a)})}};return J}]})})(window,window.angular);
1700 //# sourceMappingURL=angular-resource.min.js.map
1700 //# sourceMappingURL=angular-resource.min.js.map
1701
1701
1702 ;/*
1702 ;/*
1703 AngularJS v1.5.5
1703 AngularJS v1.5.5
1704 (c) 2010-2016 Google, Inc. http://angularjs.org
1704 (c) 2010-2016 Google, Inc. http://angularjs.org
1705 License: MIT
1705 License: MIT
1706 */
1706 */
1707 (function(S,q){'use strict';function Aa(a,b,c){if(!a)throw Ma("areq",b||"?",c||"required");return a}function Ba(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;ba(a)&&(a=a.join(" "));ba(b)&&(b=b.join(" "));return a+" "+b}function Na(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function X(a,b,c){var d="";a=ba(a)?a:a&&P(a)&&a.length?a.split(/\s+/):[];r(a,function(a,f){a&&0<a.length&&(d+=0<f?" ":"",d+=c?b+a:a+b)});return d}function Oa(a){if(a instanceof G)switch(a.length){case 0:return[];
1707 (function(S,q){'use strict';function Aa(a,b,c){if(!a)throw Ma("areq",b||"?",c||"required");return a}function Ba(a,b){if(!a&&!b)return"";if(!a)return b;if(!b)return a;ba(a)&&(a=a.join(" "));ba(b)&&(b=b.join(" "));return a+" "+b}function Na(a){var b={};a&&(a.to||a.from)&&(b.to=a.to,b.from=a.from);return b}function X(a,b,c){var d="";a=ba(a)?a:a&&P(a)&&a.length?a.split(/\s+/):[];r(a,function(a,f){a&&0<a.length&&(d+=0<f?" ":"",d+=c?b+a:a+b)});return d}function Oa(a){if(a instanceof G)switch(a.length){case 0:return[];
1708 case 1:if(1===a[0].nodeType)return a;break;default:return G(ca(a))}if(1===a.nodeType)return G(a)}function ca(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1==c.nodeType)return c}}function Pa(a,b,c){r(b,function(b){a.addClass(b,c)})}function Qa(a,b,c){r(b,function(b){a.removeClass(b,c)})}function U(a){return function(b,c){c.addClass&&(Pa(a,b,c.addClass),c.addClass=null);c.removeClass&&(Qa(a,b,c.removeClass),c.removeClass=null)}}function pa(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
1708 case 1:if(1===a[0].nodeType)return a;break;default:return G(ca(a))}if(1===a.nodeType)return G(a)}function ca(a){if(!a[0])return a;for(var b=0;b<a.length;b++){var c=a[b];if(1==c.nodeType)return c}}function Pa(a,b,c){r(b,function(b){a.addClass(b,c)})}function Qa(a,b,c){r(b,function(b){a.removeClass(b,c)})}function U(a){return function(b,c){c.addClass&&(Pa(a,b,c.addClass),c.addClass=null);c.removeClass&&(Qa(a,b,c.removeClass),c.removeClass=null)}}function pa(a){a=a||{};if(!a.$$prepared){var b=a.domOperation||
1709 Q;a.domOperation=function(){a.$$domOperationFired=!0;b();b=Q};a.$$prepared=!0}return a}function ga(a,b){Ca(a,b);Da(a,b)}function Ca(a,b){b.from&&(a.css(b.from),b.from=null)}function Da(a,b){b.to&&(a.css(b.to),b.to=null)}function V(a,b,c){var d=b.options||{};c=c.options||{};var e=(d.addClass||"")+" "+(c.addClass||""),f=(d.removeClass||"")+" "+(c.removeClass||"");a=Ra(a.attr("class"),e,f);c.preparationClasses&&(d.preparationClasses=Y(c.preparationClasses,d.preparationClasses),delete c.preparationClasses);
1709 Q;a.domOperation=function(){a.$$domOperationFired=!0;b();b=Q};a.$$prepared=!0}return a}function ga(a,b){Ca(a,b);Da(a,b)}function Ca(a,b){b.from&&(a.css(b.from),b.from=null)}function Da(a,b){b.to&&(a.css(b.to),b.to=null)}function V(a,b,c){var d=b.options||{};c=c.options||{};var e=(d.addClass||"")+" "+(c.addClass||""),f=(d.removeClass||"")+" "+(c.removeClass||"");a=Ra(a.attr("class"),e,f);c.preparationClasses&&(d.preparationClasses=Y(c.preparationClasses,d.preparationClasses),delete c.preparationClasses);
1710 e=d.domOperation!==Q?d.domOperation:null;Ea(d,c);e&&(d.domOperation=e);d.addClass=a.addClass?a.addClass:null;d.removeClass=a.removeClass?a.removeClass:null;b.addClass=d.addClass;b.removeClass=d.removeClass;return d}function Ra(a,b,c){function d(a){P(a)&&(a=a.split(" "));var b={};r(a,function(a){a.length&&(b[a]=!0)});return b}var e={};a=d(a);b=d(b);r(b,function(a,b){e[b]=1});c=d(c);r(c,function(a,b){e[b]=1===e[b]?null:-1});var f={addClass:"",removeClass:""};r(e,function(b,c){var d,e;1===b?(d="addClass",
1710 e=d.domOperation!==Q?d.domOperation:null;Ea(d,c);e&&(d.domOperation=e);d.addClass=a.addClass?a.addClass:null;d.removeClass=a.removeClass?a.removeClass:null;b.addClass=d.addClass;b.removeClass=d.removeClass;return d}function Ra(a,b,c){function d(a){P(a)&&(a=a.split(" "));var b={};r(a,function(a){a.length&&(b[a]=!0)});return b}var e={};a=d(a);b=d(b);r(b,function(a,b){e[b]=1});c=d(c);r(c,function(a,b){e[b]=1===e[b]?null:-1});var f={addClass:"",removeClass:""};r(e,function(b,c){var d,e;1===b?(d="addClass",
1711 e=!a[c]):-1===b&&(d="removeClass",e=a[c]);e&&(f[d].length&&(f[d]+=" "),f[d]+=c)});return f}function D(a){return a instanceof q.element?a[0]:a}function Sa(a,b,c){var d="";b&&(d=X(b,"ng-",!0));c.addClass&&(d=Y(d,X(c.addClass,"-add")));c.removeClass&&(d=Y(d,X(c.removeClass,"-remove")));d.length&&(c.preparationClasses=d,a.addClass(d))}function qa(a,b){var c=b?"-"+b+"s":"";la(a,[ma,c]);return[ma,c]}function ta(a,b){var c=b?"paused":"",d=Z+"PlayState";la(a,[d,c]);return[d,c]}function la(a,b){a.style[b[0]]=
1711 e=!a[c]):-1===b&&(d="removeClass",e=a[c]);e&&(f[d].length&&(f[d]+=" "),f[d]+=c)});return f}function D(a){return a instanceof q.element?a[0]:a}function Sa(a,b,c){var d="";b&&(d=X(b,"ng-",!0));c.addClass&&(d=Y(d,X(c.addClass,"-add")));c.removeClass&&(d=Y(d,X(c.removeClass,"-remove")));d.length&&(c.preparationClasses=d,a.addClass(d))}function qa(a,b){var c=b?"-"+b+"s":"";la(a,[ma,c]);return[ma,c]}function ta(a,b){var c=b?"paused":"",d=Z+"PlayState";la(a,[d,c]);return[d,c]}function la(a,b){a.style[b[0]]=
1712 b[1]}function Y(a,b){return a?b?a+" "+b:a:b}function Fa(a,b,c){var d=Object.create(null),e=a.getComputedStyle(b)||{};r(c,function(a,b){var c=e[a];if(c){var s=c.charAt(0);if("-"===s||"+"===s||0<=s)c=Ta(c);0===c&&(c=null);d[b]=c}});return d}function Ta(a){var b=0;a=a.split(/\s*,\s*/);r(a,function(a){"s"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function ua(a){return 0===a||null!=a}function Ga(a,b){var c=T,d=a+"s";b?c+="Duration":d+=" linear all";
1712 b[1]}function Y(a,b){return a?b?a+" "+b:a:b}function Fa(a,b,c){var d=Object.create(null),e=a.getComputedStyle(b)||{};r(c,function(a,b){var c=e[a];if(c){var s=c.charAt(0);if("-"===s||"+"===s||0<=s)c=Ta(c);0===c&&(c=null);d[b]=c}});return d}function Ta(a){var b=0;a=a.split(/\s*,\s*/);r(a,function(a){"s"==a.charAt(a.length-1)&&(a=a.substring(0,a.length-1));a=parseFloat(a)||0;b=b?Math.max(a,b):a});return b}function ua(a){return 0===a||null!=a}function Ga(a,b){var c=T,d=a+"s";b?c+="Duration":d+=" linear all";
1713 return[c,d]}function Ha(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},count:function(b){return(b=a[b])?b.total:0},get:function(b){return(b=a[b])&&b.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function Ia(a,b,c){r(c,function(c){a[c]=da(a[c])?a[c]:b.style.getPropertyValue(c)})}var Q=q.noop,Ja=q.copy,Ea=q.extend,G=q.element,r=q.forEach,ba=q.isArray,P=q.isString,va=q.isObject,C=q.isUndefined,da=q.isDefined,Ka=q.isFunction,wa=q.isElement,T,xa,Z,ya;C(S.ontransitionend)&&
1713 return[c,d]}function Ha(){var a=Object.create(null);return{flush:function(){a=Object.create(null)},count:function(b){return(b=a[b])?b.total:0},get:function(b){return(b=a[b])&&b.value},put:function(b,c){a[b]?a[b].total++:a[b]={total:1,value:c}}}}function Ia(a,b,c){r(c,function(c){a[c]=da(a[c])?a[c]:b.style.getPropertyValue(c)})}var Q=q.noop,Ja=q.copy,Ea=q.extend,G=q.element,r=q.forEach,ba=q.isArray,P=q.isString,va=q.isObject,C=q.isUndefined,da=q.isDefined,Ka=q.isFunction,wa=q.isElement,T,xa,Z,ya;C(S.ontransitionend)&&
1714 da(S.onwebkittransitionend)?(T="WebkitTransition",xa="webkitTransitionEnd transitionend"):(T="transition",xa="transitionend");C(S.onanimationend)&&da(S.onwebkitanimationend)?(Z="WebkitAnimation",ya="webkitAnimationEnd animationend"):(Z="animation",ya="animationend");var ra=Z+"Delay",za=Z+"Duration",ma=T+"Delay",La=T+"Duration",Ma=q.$$minErr("ng"),Ua={transitionDuration:La,transitionDelay:ma,transitionProperty:T+"Property",animationDuration:za,animationDelay:ra,animationIterationCount:Z+"IterationCount"},
1714 da(S.onwebkittransitionend)?(T="WebkitTransition",xa="webkitTransitionEnd transitionend"):(T="transition",xa="transitionend");C(S.onanimationend)&&da(S.onwebkitanimationend)?(Z="WebkitAnimation",ya="webkitAnimationEnd animationend"):(Z="animation",ya="animationend");var ra=Z+"Delay",za=Z+"Duration",ma=T+"Delay",La=T+"Duration",Ma=q.$$minErr("ng"),Ua={transitionDuration:La,transitionDelay:ma,transitionProperty:T+"Property",animationDuration:za,animationDelay:ra,animationIterationCount:Z+"IterationCount"},
1715 Va={transitionDuration:La,transitionDelay:ma,animationDuration:za,animationDelay:ra};q.module("ngAnimate",[]).directive("ngAnimateSwap",["$animate","$rootScope",function(a,b){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(b,d,e,f,z){var B,s;b.$watchCollection(e.ngAnimateSwap||e["for"],function(e){B&&a.leave(B);s&&(s.$destroy(),s=null);if(e||0===e)s=b.$new(),z(s,function(b){B=b;a.enter(b,null,d)})})}}}]).directive("ngAnimateChildren",["$interpolate",function(a){return{link:function(b,
1715 Va={transitionDuration:La,transitionDelay:ma,animationDuration:za,animationDelay:ra};q.module("ngAnimate",[]).directive("ngAnimateSwap",["$animate","$rootScope",function(a,b){return{restrict:"A",transclude:"element",terminal:!0,priority:600,link:function(b,d,e,f,z){var B,s;b.$watchCollection(e.ngAnimateSwap||e["for"],function(e){B&&a.leave(B);s&&(s.$destroy(),s=null);if(e||0===e)s=b.$new(),z(s,function(b){B=b;a.enter(b,null,d)})})}}}]).directive("ngAnimateChildren",["$interpolate",function(a){return{link:function(b,
1716 c,d){function e(a){c.data("$$ngAnimateChildren","on"===a||"true"===a)}var f=d.ngAnimateChildren;q.isString(f)&&0===f.length?c.data("$$ngAnimateChildren",!0):(e(a(f)(b)),d.$observe("ngAnimateChildren",e))}}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),z=0;z<b.length;z++)b[z]();e||a(function(){e||c()})}}var d,e;d=b.queue=[];b.waitUntilQuiet=function(b){e&&e();e=a(function(){e=null;b();c()})};return b}]).provider("$$animateQueue",
1716 c,d){function e(a){c.data("$$ngAnimateChildren","on"===a||"true"===a)}var f=d.ngAnimateChildren;q.isString(f)&&0===f.length?c.data("$$ngAnimateChildren",!0):(e(a(f)(b)),d.$observe("ngAnimateChildren",e))}}}]).factory("$$rAFScheduler",["$$rAF",function(a){function b(a){d=d.concat(a);c()}function c(){if(d.length){for(var b=d.shift(),z=0;z<b.length;z++)b[z]();e||a(function(){e||c()})}}var d,e;d=b.queue=[];b.waitUntilQuiet=function(b){e&&e();e=a(function(){e=null;b();c()})};return b}]).provider("$$animateQueue",
1717 ["$animateProvider",function(a){function b(a){if(!a)return null;a=a.split(" ");var b=Object.create(null);r(a,function(a){b[a]=!0});return b}function c(a,c){if(a&&c){var d=b(c);return a.split(" ").some(function(a){return d[a]})}}function d(a,b,c,d){return f[a].some(function(a){return a(b,c,d)})}function e(a,b){var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var f=this.rules={skip:[],cancel:[],join:[]};f.join.push(function(a,b,c){return!b.structural&&e(b)});f.skip.push(function(a,
1717 ["$animateProvider",function(a){function b(a){if(!a)return null;a=a.split(" ");var b=Object.create(null);r(a,function(a){b[a]=!0});return b}function c(a,c){if(a&&c){var d=b(c);return a.split(" ").some(function(a){return d[a]})}}function d(a,b,c,d){return f[a].some(function(a){return a(b,c,d)})}function e(a,b){var c=0<(a.addClass||"").length,d=0<(a.removeClass||"").length;return b?c&&d:c||d}var f=this.rules={skip:[],cancel:[],join:[]};f.join.push(function(a,b,c){return!b.structural&&e(b)});f.skip.push(function(a,
1718 b,c){return!b.structural&&!e(b)});f.skip.push(function(a,b,c){return"leave"==c.event&&b.structural});f.skip.push(function(a,b,c){return c.structural&&2===c.state&&!b.structural});f.cancel.push(function(a,b,c){return c.structural&&b.structural});f.cancel.push(function(a,b,c){return 2===c.state&&b.structural});f.cancel.push(function(a,b,d){if(d.structural)return!1;a=b.addClass;b=b.removeClass;var e=d.addClass;d=d.removeClass;return C(a)&&C(b)||C(e)&&C(d)?!1:c(a,d)||c(b,e)});this.$get=["$$rAF","$rootScope",
1718 b,c){return!b.structural&&!e(b)});f.skip.push(function(a,b,c){return"leave"==c.event&&b.structural});f.skip.push(function(a,b,c){return c.structural&&2===c.state&&!b.structural});f.cancel.push(function(a,b,c){return c.structural&&b.structural});f.cancel.push(function(a,b,c){return 2===c.state&&b.structural});f.cancel.push(function(a,b,d){if(d.structural)return!1;a=b.addClass;b=b.removeClass;var e=d.addClass;d=d.removeClass;return C(a)&&C(b)||C(e)&&C(d)?!1:c(a,d)||c(b,e)});this.$get=["$$rAF","$rootScope",
1719 "$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow",function(b,c,f,v,I,Wa,u,sa,w,x){function R(){var a=!1;return function(b){a?b():c.$$postDigest(function(){a=!0;b()})}}function J(a,b,c){var g=D(b),d=D(a),k=[];(a=h[c])&&r(a,function(a){ia.call(a.node,g)?k.push(a.callback):"leave"===c&&ia.call(a.node,d)&&k.push(a.callback)});return k}function k(a,b,c){var g=ca(b);return a.filter(function(a){return!(a.node===g&&(!c||a.callback===c))})}
1719 "$rootElement","$document","$$HashMap","$$animation","$$AnimateRunner","$templateRequest","$$jqLite","$$forceReflow",function(b,c,f,v,I,Wa,u,sa,w,x){function R(){var a=!1;return function(b){a?b():c.$$postDigest(function(){a=!0;b()})}}function J(a,b,c){var g=D(b),d=D(a),k=[];(a=h[c])&&r(a,function(a){ia.call(a.node,g)?k.push(a.callback):"leave"===c&&ia.call(a.node,d)&&k.push(a.callback)});return k}function k(a,b,c){var g=ca(b);return a.filter(function(a){return!(a.node===g&&(!c||a.callback===c))})}
1720 function p(a,k,h){function l(c,g,d,h){f(function(){var c=J(oa,a,g);c.length?b(function(){r(c,function(b){b(a,d,h)});"close"!==d||a[0].parentNode||N.off(a)}):"close"!==d||a[0].parentNode||N.off(a)});c.progress(g,d,h)}function A(b){var c=a,g=m;g.preparationClasses&&(c.removeClass(g.preparationClasses),g.preparationClasses=null);g.activeClasses&&(c.removeClass(g.activeClasses),g.activeClasses=null);F(a,m);ga(a,m);m.domOperation();p.complete(!b)}var m=Ja(h),x,oa;if(a=Oa(a))x=D(a),oa=a.parent();var m=
1720 function p(a,k,h){function l(c,g,d,h){f(function(){var c=J(oa,a,g);c.length?b(function(){r(c,function(b){b(a,d,h)});"close"!==d||a[0].parentNode||N.off(a)}):"close"!==d||a[0].parentNode||N.off(a)});c.progress(g,d,h)}function A(b){var c=a,g=m;g.preparationClasses&&(c.removeClass(g.preparationClasses),g.preparationClasses=null);g.activeClasses&&(c.removeClass(g.activeClasses),g.activeClasses=null);F(a,m);ga(a,m);m.domOperation();p.complete(!b)}var m=Ja(h),x,oa;if(a=Oa(a))x=D(a),oa=a.parent();var m=
1721 pa(m),p=new u,f=R();ba(m.addClass)&&(m.addClass=m.addClass.join(" "));m.addClass&&!P(m.addClass)&&(m.addClass=null);ba(m.removeClass)&&(m.removeClass=m.removeClass.join(" "));m.removeClass&&!P(m.removeClass)&&(m.removeClass=null);m.from&&!va(m.from)&&(m.from=null);m.to&&!va(m.to)&&(m.to=null);if(!x)return A(),p;h=[x.className,m.addClass,m.removeClass].join(" ");if(!Xa(h))return A(),p;var s=0<=["enter","move","leave"].indexOf(k),t=v[0].hidden,w=!g||t||H.get(x);h=!w&&y.get(x)||{};var I=!!h.state;w||
1721 pa(m),p=new u,f=R();ba(m.addClass)&&(m.addClass=m.addClass.join(" "));m.addClass&&!P(m.addClass)&&(m.addClass=null);ba(m.removeClass)&&(m.removeClass=m.removeClass.join(" "));m.removeClass&&!P(m.removeClass)&&(m.removeClass=null);m.from&&!va(m.from)&&(m.from=null);m.to&&!va(m.to)&&(m.to=null);if(!x)return A(),p;h=[x.className,m.addClass,m.removeClass].join(" ");if(!Xa(h))return A(),p;var s=0<=["enter","move","leave"].indexOf(k),t=v[0].hidden,w=!g||t||H.get(x);h=!w&&y.get(x)||{};var I=!!h.state;w||
1722 I&&1==h.state||(w=!K(a,oa,k));if(w)return t&&l(p,k,"start"),A(),t&&l(p,k,"close"),p;s&&L(a);t={structural:s,element:a,event:k,addClass:m.addClass,removeClass:m.removeClass,close:A,options:m,runner:p};if(I){if(d("skip",a,t,h)){if(2===h.state)return A(),p;V(a,h,t);return h.runner}if(d("cancel",a,t,h))if(2===h.state)h.runner.end();else if(h.structural)h.close();else return V(a,h,t),h.runner;else if(d("join",a,t,h))if(2===h.state)V(a,t,{});else return Sa(a,s?k:null,m),k=t.event=h.event,m=V(a,h,t),h.runner}else V(a,
1722 I&&1==h.state||(w=!K(a,oa,k));if(w)return t&&l(p,k,"start"),A(),t&&l(p,k,"close"),p;s&&L(a);t={structural:s,element:a,event:k,addClass:m.addClass,removeClass:m.removeClass,close:A,options:m,runner:p};if(I){if(d("skip",a,t,h)){if(2===h.state)return A(),p;V(a,h,t);return h.runner}if(d("cancel",a,t,h))if(2===h.state)h.runner.end();else if(h.structural)h.close();else return V(a,h,t),h.runner;else if(d("join",a,t,h))if(2===h.state)V(a,t,{});else return Sa(a,s?k:null,m),k=t.event=h.event,m=V(a,h,t),h.runner}else V(a,
1723 t,{});(I=t.structural)||(I="animate"===t.event&&0<Object.keys(t.options.to||{}).length||e(t));if(!I)return A(),O(a),p;var ia=(h.counter||0)+1;t.counter=ia;M(a,1,t);c.$$postDigest(function(){var b=y.get(x),c=!b,b=b||{},g=0<(a.parent()||[]).length&&("animate"===b.event||b.structural||e(b));if(c||b.counter!==ia||!g){c&&(F(a,m),ga(a,m));if(c||s&&b.event!==k)m.domOperation(),p.end();g||O(a)}else k=!b.structural&&e(b,!0)?"setClass":b.event,M(a,2),b=Wa(a,k,b.options),p.setHost(b),l(p,k,"start",{}),b.done(function(b){A(!b);
1723 t,{});(I=t.structural)||(I="animate"===t.event&&0<Object.keys(t.options.to||{}).length||e(t));if(!I)return A(),O(a),p;var ia=(h.counter||0)+1;t.counter=ia;M(a,1,t);c.$$postDigest(function(){var b=y.get(x),c=!b,b=b||{},g=0<(a.parent()||[]).length&&("animate"===b.event||b.structural||e(b));if(c||b.counter!==ia||!g){c&&(F(a,m),ga(a,m));if(c||s&&b.event!==k)m.domOperation(),p.end();g||O(a)}else k=!b.structural&&e(b,!0)?"setClass":b.event,M(a,2),b=Wa(a,k,b.options),p.setHost(b),l(p,k,"start",{}),b.done(function(b){A(!b);
1724 (b=y.get(x))&&b.counter===ia&&O(D(a));l(p,k,"close",{})})});return p}function L(a){a=D(a).querySelectorAll("[data-ng-animate]");r(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate")),c=y.get(a);if(c)switch(b){case 2:c.runner.end();case 1:y.remove(a)}})}function O(a){a=D(a);a.removeAttribute("data-ng-animate");y.remove(a)}function l(a,b){return D(a)===D(b)}function K(a,b,c){c=G(v[0].body);var g=l(a,c)||"HTML"===a[0].nodeName,d=l(a,f),h=!1,k,e=H.get(D(a));(a=G.data(a[0],"$ngAnimatePin"))&&
1724 (b=y.get(x))&&b.counter===ia&&O(D(a));l(p,k,"close",{})})});return p}function L(a){a=D(a).querySelectorAll("[data-ng-animate]");r(a,function(a){var b=parseInt(a.getAttribute("data-ng-animate")),c=y.get(a);if(c)switch(b){case 2:c.runner.end();case 1:y.remove(a)}})}function O(a){a=D(a);a.removeAttribute("data-ng-animate");y.remove(a)}function l(a,b){return D(a)===D(b)}function K(a,b,c){c=G(v[0].body);var g=l(a,c)||"HTML"===a[0].nodeName,d=l(a,f),h=!1,k,e=H.get(D(a));(a=G.data(a[0],"$ngAnimatePin"))&&
1725 (b=a);for(b=D(b);b;){d||(d=l(b,f));if(1!==b.nodeType)break;a=y.get(b)||{};if(!h){var p=H.get(b);if(!0===p&&!1!==e){e=!0;break}else!1===p&&(e=!1);h=a.structural}if(C(k)||!0===k)a=G.data(b,"$$ngAnimateChildren"),da(a)&&(k=a);if(h&&!1===k)break;g||(g=l(b,c));if(g&&d)break;if(!d&&(a=G.data(b,"$ngAnimatePin"))){b=D(a);continue}b=b.parentNode}return(!h||k)&&!0!==e&&d&&g}function M(a,b,c){c=c||{};c.state=b;a=D(a);a.setAttribute("data-ng-animate",b);c=(b=y.get(a))?Ea(b,c):c;y.put(a,c)}var y=new I,H=new I,
1725 (b=a);for(b=D(b);b;){d||(d=l(b,f));if(1!==b.nodeType)break;a=y.get(b)||{};if(!h){var p=H.get(b);if(!0===p&&!1!==e){e=!0;break}else!1===p&&(e=!1);h=a.structural}if(C(k)||!0===k)a=G.data(b,"$$ngAnimateChildren"),da(a)&&(k=a);if(h&&!1===k)break;g||(g=l(b,c));if(g&&d)break;if(!d&&(a=G.data(b,"$ngAnimatePin"))){b=D(a);continue}b=b.parentNode}return(!h||k)&&!0!==e&&d&&g}function M(a,b,c){c=c||{};c.state=b;a=D(a);a.setAttribute("data-ng-animate",b);c=(b=y.get(a))?Ea(b,c):c;y.put(a,c)}var y=new I,H=new I,
1726 g=null,oa=c.$watch(function(){return 0===sa.totalPendingRequests},function(a){a&&(oa(),c.$$postDigest(function(){c.$$postDigest(function(){null===g&&(g=!0)})}))}),h={},A=a.classNameFilter(),Xa=A?function(a){return A.test(a)}:function(){return!0},F=U(w),ia=S.Node.prototype.contains||function(a){return this===a||!!(this.compareDocumentPosition(a)&16)},N={on:function(a,b,c){var g=ca(b);h[a]=h[a]||[];h[a].push({node:g,callback:c});G(b).on("$destroy",function(){y.get(g)||N.off(a,b,c)})},off:function(a,
1726 g=null,oa=c.$watch(function(){return 0===sa.totalPendingRequests},function(a){a&&(oa(),c.$$postDigest(function(){c.$$postDigest(function(){null===g&&(g=!0)})}))}),h={},A=a.classNameFilter(),Xa=A?function(a){return A.test(a)}:function(){return!0},F=U(w),ia=S.Node.prototype.contains||function(a){return this===a||!!(this.compareDocumentPosition(a)&16)},N={on:function(a,b,c){var g=ca(b);h[a]=h[a]||[];h[a].push({node:g,callback:c});G(b).on("$destroy",function(){y.get(g)||N.off(a,b,c)})},off:function(a,
1727 b,c){if(1!==arguments.length||q.isString(arguments[0])){var g=h[a];g&&(h[a]=1===arguments.length?null:k(g,b,c))}else for(g in b=arguments[0],h)h[g]=k(h[g],b)},pin:function(a,b){Aa(wa(a),"element","not an element");Aa(wa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,g){c=c||{};c.domOperation=g;return p(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!g;else if(wa(a)){var d=D(a),h=H.get(d);1===c?b=!h:H.put(d,!b)}else b=g=!!a;return b}};return N}]}]).provider("$$animation",
1727 b,c){if(1!==arguments.length||q.isString(arguments[0])){var g=h[a];g&&(h[a]=1===arguments.length?null:k(g,b,c))}else for(g in b=arguments[0],h)h[g]=k(h[g],b)},pin:function(a,b){Aa(wa(a),"element","not an element");Aa(wa(b),"parentElement","not an element");a.data("$ngAnimatePin",b)},push:function(a,b,c,g){c=c||{};c.domOperation=g;return p(a,b,c)},enabled:function(a,b){var c=arguments.length;if(0===c)b=!!g;else if(wa(a)){var d=D(a),h=H.get(d);1===c?b=!h:H.put(d,!b)}else b=g=!!a;return b}};return N}]}]).provider("$$animation",
1728 ["$animateProvider",function(a){function b(a){return a.data("$$animationRunner")}var c=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(a,e,f,z,B,s){function v(a){function b(a){if(a.processed)return a;a.processed=!0;var d=a.domNode,L=d.parentNode;e.put(d,a);for(var f;L;){if(f=e.get(L)){f.processed||(f=b(f));break}L=L.parentNode}(f||c).children.push(a);return a}var c={children:[]},d,e=new B;for(d=0;d<a.length;d++){var f=a[d];e.put(f.domNode,
1728 ["$animateProvider",function(a){function b(a){return a.data("$$animationRunner")}var c=this.drivers=[];this.$get=["$$jqLite","$rootScope","$injector","$$AnimateRunner","$$HashMap","$$rAFScheduler",function(a,e,f,z,B,s){function v(a){function b(a){if(a.processed)return a;a.processed=!0;var d=a.domNode,L=d.parentNode;e.put(d,a);for(var f;L;){if(f=e.get(L)){f.processed||(f=b(f));break}L=L.parentNode}(f||c).children.push(a);return a}var c={children:[]},d,e=new B;for(d=0;d<a.length;d++){var f=a[d];e.put(f.domNode,
1729 a[d]={domNode:f.domNode,fn:f.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var e=0,f=[];for(d=0;d<c.length;d++){var x=c[d];0>=a&&(a=e,e=0,b.push(f),f=[]);f.push(x.fn);x.children.forEach(function(a){e++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var I=[],q=U(a);return function(u,B,w){function x(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];r(a,function(a){var c=
1729 a[d]={domNode:f.domNode,fn:f.fn,children:[]})}for(d=0;d<a.length;d++)b(a[d]);return function(a){var b=[],c=[],d;for(d=0;d<a.children.length;d++)c.push(a.children[d]);a=c.length;var e=0,f=[];for(d=0;d<c.length;d++){var x=c[d];0>=a&&(a=e,e=0,b.push(f),f=[]);f.push(x.fn);x.children.forEach(function(a){e++;c.push(a)});a--}f.length&&b.push(f);return b}(c)}var I=[],q=U(a);return function(u,B,w){function x(a){a=a.hasAttribute("ng-animate-ref")?[a]:a.querySelectorAll("[ng-animate-ref]");var b=[];r(a,function(a){var c=
1730 a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function R(a){var b=[],c={};r(a,function(a,g){var d=D(a.element),e=0<=["enter","move"].indexOf(a.event),d=a.structural?x(d):[];if(d.length){var k=e?"to":"from";r(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][k]={animationID:g,element:G(a)}})}else b.push(a)});var d={},e={};r(c,function(c,h){var k=c.from,f=c.to;if(k&&f){var p=a[k.animationID],y=a[f.animationID],l=k.animationID.toString();if(!e[l]){var x=e[l]=
1730 a.getAttribute("ng-animate-ref");c&&c.length&&b.push(a)});return b}function R(a){var b=[],c={};r(a,function(a,g){var d=D(a.element),e=0<=["enter","move"].indexOf(a.event),d=a.structural?x(d):[];if(d.length){var k=e?"to":"from";r(d,function(a){var b=a.getAttribute("ng-animate-ref");c[b]=c[b]||{};c[b][k]={animationID:g,element:G(a)}})}else b.push(a)});var d={},e={};r(c,function(c,h){var k=c.from,f=c.to;if(k&&f){var p=a[k.animationID],y=a[f.animationID],l=k.animationID.toString();if(!e[l]){var x=e[l]=
1731 {structural:!0,beforeStart:function(){p.beforeStart();y.beforeStart()},close:function(){p.close();y.close()},classes:J(p.classes,y.classes),from:p,to:y,anchors:[]};x.classes.length?b.push(x):(b.push(p),b.push(y))}e[l].anchors.push({out:k.element,"in":f.element})}else k=k?k.animationID:f.animationID,f=k.toString(),d[f]||(d[f]=!0,b.push(a[k]))});return b}function J(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var k=a[d];if("ng-"!==k.substring(0,3))for(var e=0;e<b.length;e++)if(k===
1731 {structural:!0,beforeStart:function(){p.beforeStart();y.beforeStart()},close:function(){p.close();y.close()},classes:J(p.classes,y.classes),from:p,to:y,anchors:[]};x.classes.length?b.push(x):(b.push(p),b.push(y))}e[l].anchors.push({out:k.element,"in":f.element})}else k=k?k.animationID:f.animationID,f=k.toString(),d[f]||(d[f]=!0,b.push(a[k]))});return b}function J(a,b){a=a.split(" ");b=b.split(" ");for(var c=[],d=0;d<a.length;d++){var k=a[d];if("ng-"!==k.substring(0,3))for(var e=0;e<b.length;e++)if(k===
1732 b[e]){c.push(k);break}}return c.join(" ")}function k(a){for(var b=c.length-1;0<=b;b--){var d=c[b];if(f.has(d)&&(d=f.get(d)(a)))return d}}function p(a,c){a.from&&a.to?(b(a.from.element).setHost(c),b(a.to.element).setHost(c)):b(a.element).setHost(c)}function L(){var a=b(u);!a||"leave"===B&&w.$$domOperationFired||a.end()}function O(b){u.off("$destroy",L);u.removeData("$$animationRunner");q(u,w);ga(u,w);w.domOperation();y&&a.removeClass(u,y);u.removeClass("ng-animate");K.complete(!b)}w=pa(w);var l=0<=
1732 b[e]){c.push(k);break}}return c.join(" ")}function k(a){for(var b=c.length-1;0<=b;b--){var d=c[b];if(f.has(d)&&(d=f.get(d)(a)))return d}}function p(a,c){a.from&&a.to?(b(a.from.element).setHost(c),b(a.to.element).setHost(c)):b(a.element).setHost(c)}function L(){var a=b(u);!a||"leave"===B&&w.$$domOperationFired||a.end()}function O(b){u.off("$destroy",L);u.removeData("$$animationRunner");q(u,w);ga(u,w);w.domOperation();y&&a.removeClass(u,y);u.removeClass("ng-animate");K.complete(!b)}w=pa(w);var l=0<=
1733 ["enter","move","leave"].indexOf(B),K=new z({end:function(){O()},cancel:function(){O(!0)}});if(!c.length)return O(),K;u.data("$$animationRunner",K);var M=Ba(u.attr("class"),Ba(w.addClass,w.removeClass)),y=w.tempClasses;y&&(M+=" "+y,w.tempClasses=null);var H;l&&(H="ng-"+B+"-prepare",a.addClass(u,H));I.push({element:u,classes:M,event:B,structural:l,options:w,beforeStart:function(){u.addClass("ng-animate");y&&a.addClass(u,y);H&&(a.removeClass(u,H),H=null)},close:O});u.on("$destroy",L);if(1<I.length)return K;
1733 ["enter","move","leave"].indexOf(B),K=new z({end:function(){O()},cancel:function(){O(!0)}});if(!c.length)return O(),K;u.data("$$animationRunner",K);var M=Ba(u.attr("class"),Ba(w.addClass,w.removeClass)),y=w.tempClasses;y&&(M+=" "+y,w.tempClasses=null);var H;l&&(H="ng-"+B+"-prepare",a.addClass(u,H));I.push({element:u,classes:M,event:B,structural:l,options:w,beforeStart:function(){u.addClass("ng-animate");y&&a.addClass(u,y);H&&(a.removeClass(u,H),H=null)},close:O});u.on("$destroy",L);if(1<I.length)return K;
1734 e.$$postDigest(function(){var a=[];r(I,function(c){b(c.element)?a.push(c):c.close()});I.length=0;var c=R(a),d=[];r(c,function(a){d.push({domNode:D(a.from?a.from.element:a.element),fn:function(){a.beforeStart();var c,d=a.close;if(b(a.anchors?a.from.element||a.to.element:a.element)){var g=k(a);g&&(c=g.start)}c?(c=c(),c.done(function(a){d(!a)}),p(a,c)):d()}})});s(v(d))});return K}}]}]).provider("$animateCss",["$animateProvider",function(a){var b=Ha(),c=Ha();this.$get=["$window","$$jqLite","$$AnimateRunner",
1734 e.$$postDigest(function(){var a=[];r(I,function(c){b(c.element)?a.push(c):c.close()});I.length=0;var c=R(a),d=[];r(c,function(a){d.push({domNode:D(a.from?a.from.element:a.element),fn:function(){a.beforeStart();var c,d=a.close;if(b(a.anchors?a.from.element||a.to.element:a.element)){var g=k(a);g&&(c=g.start)}c?(c=c(),c.done(function(a){d(!a)}),p(a,c)):d()}})});s(v(d))});return K}}]}]).provider("$animateCss",["$animateProvider",function(a){var b=Ha(),c=Ha();this.$get=["$window","$$jqLite","$$AnimateRunner",
1735 "$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,e,f,z,B,s,v,I){function q(a,b){var c=a.parentNode;return(c.$$ngAnimateParentKey||(c.$$ngAnimateParentKey=++R))+"-"+a.getAttribute("class")+"-"+b}function u(k,f,x,s){var l;0<b.count(x)&&(l=c.get(x),l||(f=X(f,"-stagger"),e.addClass(k,f),l=Fa(a,k,s),l.animationDuration=Math.max(l.animationDuration,0),l.transitionDuration=Math.max(l.transitionDuration,0),e.removeClass(k,f),c.put(x,l)));return l||{}}function sa(a){J.push(a);
1735 "$timeout","$$forceReflow","$sniffer","$$rAFScheduler","$$animateQueue",function(a,e,f,z,B,s,v,I){function q(a,b){var c=a.parentNode;return(c.$$ngAnimateParentKey||(c.$$ngAnimateParentKey=++R))+"-"+a.getAttribute("class")+"-"+b}function u(k,f,x,s){var l;0<b.count(x)&&(l=c.get(x),l||(f=X(f,"-stagger"),e.addClass(k,f),l=Fa(a,k,s),l.animationDuration=Math.max(l.animationDuration,0),l.transitionDuration=Math.max(l.transitionDuration,0),e.removeClass(k,f),c.put(x,l)));return l||{}}function sa(a){J.push(a);
1736 v.waitUntilQuiet(function(){b.flush();c.flush();for(var a=B(),d=0;d<J.length;d++)J[d](a);J.length=0})}function w(c,e,f){e=b.get(f);e||(e=Fa(a,c,Ua),"infinite"===e.animationIterationCount&&(e.animationIterationCount=1));b.put(f,e);c=e;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var x=U(e),R=0,J=[];return function(a,c){function d(){l()}function v(){l(!0)}function l(b){if(!(R||
1736 v.waitUntilQuiet(function(){b.flush();c.flush();for(var a=B(),d=0;d<J.length;d++)J[d](a);J.length=0})}function w(c,e,f){e=b.get(f);e||(e=Fa(a,c,Ua),"infinite"===e.animationIterationCount&&(e.animationIterationCount=1));b.put(f,e);c=e;f=c.animationDelay;e=c.transitionDelay;c.maxDelay=f&&e?Math.max(f,e):f||e;c.maxDuration=Math.max(c.animationDuration*c.animationIterationCount,c.transitionDuration);return c}var x=U(e),R=0,J=[];return function(a,c){function d(){l()}function v(){l(!0)}function l(b){if(!(R||
1737 G&&N)){R=!0;N=!1;g.$$skipPreparationClasses||e.removeClass(a,fa);e.removeClass(a,da);ta(h,!1);qa(h,!1);r(A,function(a){h.style[a[0]]=""});x(a,g);ga(a,g);Object.keys(J).length&&r(J,function(a,b){a?h.style.setProperty(b,a):h.style.removeProperty(b)});if(g.onDone)g.onDone();ea&&ea.length&&a.off(ea.join(" "),y);var c=a.data("$$animateCss");c&&(z.cancel(c[0].timer),a.removeData("$$animateCss"));C&&C.complete(!b)}}function K(a){n.blockTransition&&qa(h,a);n.blockKeyframeAnimation&&ta(h,!!a)}function M(){C=
1737 G&&N)){R=!0;N=!1;g.$$skipPreparationClasses||e.removeClass(a,fa);e.removeClass(a,da);ta(h,!1);qa(h,!1);r(A,function(a){h.style[a[0]]=""});x(a,g);ga(a,g);Object.keys(J).length&&r(J,function(a,b){a?h.style.setProperty(b,a):h.style.removeProperty(b)});if(g.onDone)g.onDone();ea&&ea.length&&a.off(ea.join(" "),y);var c=a.data("$$animateCss");c&&(z.cancel(c[0].timer),a.removeData("$$animateCss"));C&&C.complete(!b)}}function K(a){n.blockTransition&&qa(h,a);n.blockKeyframeAnimation&&ta(h,!!a)}function M(){C=
1738 new f({end:d,cancel:v});sa(Q);l();return{$$willAnimate:!1,start:function(){return C},end:d}}function y(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(3));Math.max(a-V,0)>=S&&b>=m&&(G=!0,l())}function H(){function b(){if(!R){K(!1);r(A,function(a){h.style[a[0]]=a[1]});x(a,g);e.addClass(a,da);if(n.recalculateTimingStyles){na=h.className+" "+fa;ja=q(h,na);E=w(h,na,ja);$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;if(0===m){l();return}n.hasTransitions=
1738 new f({end:d,cancel:v});sa(Q);l();return{$$willAnimate:!1,start:function(){return C},end:d}}function y(a){a.stopPropagation();var b=a.originalEvent||a;a=b.$manualTimeStamp||Date.now();b=parseFloat(b.elapsedTime.toFixed(3));Math.max(a-V,0)>=S&&b>=m&&(G=!0,l())}function H(){function b(){if(!R){K(!1);r(A,function(a){h.style[a[0]]=a[1]});x(a,g);e.addClass(a,da);if(n.recalculateTimingStyles){na=h.className+" "+fa;ja=q(h,na);E=w(h,na,ja);$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;if(0===m){l();return}n.hasTransitions=
1739 0<E.transitionDuration;n.hasAnimations=0<E.animationDuration}n.applyAnimationDelay&&($="boolean"!==typeof g.delay&&ua(g.delay)?parseFloat(g.delay):$,ha=Math.max($,0),E.animationDelay=$,aa=[ra,$+"s"],A.push(aa),h.style[aa[0]]=aa[1]);S=1E3*ha;U=1E3*m;if(g.easing){var d,f=g.easing;n.hasTransitions&&(d=T+"TimingFunction",A.push([d,f]),h.style[d]=f);n.hasAnimations&&(d=Z+"TimingFunction",A.push([d,f]),h.style[d]=f)}E.transitionDuration&&ea.push(xa);E.animationDuration&&ea.push(ya);V=Date.now();var H=S+
1739 0<E.transitionDuration;n.hasAnimations=0<E.animationDuration}n.applyAnimationDelay&&($="boolean"!==typeof g.delay&&ua(g.delay)?parseFloat(g.delay):$,ha=Math.max($,0),E.animationDelay=$,aa=[ra,$+"s"],A.push(aa),h.style[aa[0]]=aa[1]);S=1E3*ha;U=1E3*m;if(g.easing){var d,f=g.easing;n.hasTransitions&&(d=T+"TimingFunction",A.push([d,f]),h.style[d]=f);n.hasAnimations&&(d=Z+"TimingFunction",A.push([d,f]),h.style[d]=f)}E.transitionDuration&&ea.push(xa);E.animationDuration&&ea.push(ya);V=Date.now();var H=S+
1740 1.5*U;d=V+H;var f=a.data("$$animateCss")||[],s=!0;if(f.length){var p=f[0];(s=d>p.expectedEndTime)?z.cancel(p.timer):f.push(l)}s&&(H=z(c,H,!1),f[0]={timer:H,expectedEndTime:d},f.push(l),a.data("$$animateCss",f));if(ea.length)a.on(ea.join(" "),y);g.to&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.to)),Da(a,g))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d<b.length;d++)b[d]();a.removeData("$$animateCss")}}if(!R)if(h.parentNode){var d=function(a){if(G)N&&a&&(N=!1,l());else if(N=!a,E.animationDuration)if(a=
1740 1.5*U;d=V+H;var f=a.data("$$animateCss")||[],s=!0;if(f.length){var p=f[0];(s=d>p.expectedEndTime)?z.cancel(p.timer):f.push(l)}s&&(H=z(c,H,!1),f[0]={timer:H,expectedEndTime:d},f.push(l),a.data("$$animateCss",f));if(ea.length)a.on(ea.join(" "),y);g.to&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.to)),Da(a,g))}}function c(){var b=a.data("$$animateCss");if(b){for(var d=1;d<b.length;d++)b[d]();a.removeData("$$animateCss")}}if(!R)if(h.parentNode){var d=function(a){if(G)N&&a&&(N=!1,l());else if(N=!a,E.animationDuration)if(a=
1741 ta(h,N),N)A.push(a);else{var b=A,c=b.indexOf(a);0<=a&&b.splice(c,1)}},f=0<ca&&(E.transitionDuration&&0===W.transitionDuration||E.animationDuration&&0===W.animationDuration)&&Math.max(W.animationDelay,W.transitionDelay);f?z(b,Math.floor(f*ca*1E3),!1):b();P.resume=function(){d(!0)};P.pause=function(){d(!1)}}else l()}var g=c||{};g.$$prepared||(g=pa(Ja(g)));var J={},h=D(a);if(!h||!h.parentNode||!I.enabled())return M();var A=[],B=a.attr("class"),F=Na(g),R,N,G,C,P,ha,S,m,U,V,ea=[];if(0===g.duration||!s.animations&&
1741 ta(h,N),N)A.push(a);else{var b=A,c=b.indexOf(a);0<=a&&b.splice(c,1)}},f=0<ca&&(E.transitionDuration&&0===W.transitionDuration||E.animationDuration&&0===W.animationDuration)&&Math.max(W.animationDelay,W.transitionDelay);f?z(b,Math.floor(f*ca*1E3),!1):b();P.resume=function(){d(!0)};P.pause=function(){d(!1)}}else l()}var g=c||{};g.$$prepared||(g=pa(Ja(g)));var J={},h=D(a);if(!h||!h.parentNode||!I.enabled())return M();var A=[],B=a.attr("class"),F=Na(g),R,N,G,C,P,ha,S,m,U,V,ea=[];if(0===g.duration||!s.animations&&
1742 !s.transitions)return M();var ka=g.event&&ba(g.event)?g.event.join(" "):g.event,Y="",t="";ka&&g.structural?Y=X(ka,"ng-",!0):ka&&(Y=ka);g.addClass&&(t+=X(g.addClass,"-add"));g.removeClass&&(t.length&&(t+=" "),t+=X(g.removeClass,"-remove"));g.applyClassesEarly&&t.length&&x(a,g);var fa=[Y,t].join(" ").trim(),na=B+" "+fa,da=X(fa,"-active"),B=F.to&&0<Object.keys(F.to).length;if(!(0<(g.keyframeStyle||"").length||B||fa))return M();var ja,W;0<g.stagger?(F=parseFloat(g.stagger),W={transitionDelay:F,animationDelay:F,
1742 !s.transitions)return M();var ka=g.event&&ba(g.event)?g.event.join(" "):g.event,Y="",t="";ka&&g.structural?Y=X(ka,"ng-",!0):ka&&(Y=ka);g.addClass&&(t+=X(g.addClass,"-add"));g.removeClass&&(t.length&&(t+=" "),t+=X(g.removeClass,"-remove"));g.applyClassesEarly&&t.length&&x(a,g);var fa=[Y,t].join(" ").trim(),na=B+" "+fa,da=X(fa,"-active"),B=F.to&&0<Object.keys(F.to).length;if(!(0<(g.keyframeStyle||"").length||B||fa))return M();var ja,W;0<g.stagger?(F=parseFloat(g.stagger),W={transitionDelay:F,animationDelay:F,
1743 transitionDuration:0,animationDuration:0}):(ja=q(h,na),W=u(h,fa,ja,Va));g.$$skipPreparationClasses||e.addClass(a,fa);g.transitionStyle&&(F=[T,g.transitionStyle],la(h,F),A.push(F));0<=g.duration&&(F=0<h.style[T].length,F=Ga(g.duration,F),la(h,F),A.push(F));g.keyframeStyle&&(F=[Z,g.keyframeStyle],la(h,F),A.push(F));var ca=W?0<=g.staggerIndex?g.staggerIndex:b.count(ja):0;(ka=0===ca)&&!g.skipBlocking&&qa(h,9999);var E=w(h,na,ja),$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;var n={};n.hasTransitions=
1743 transitionDuration:0,animationDuration:0}):(ja=q(h,na),W=u(h,fa,ja,Va));g.$$skipPreparationClasses||e.addClass(a,fa);g.transitionStyle&&(F=[T,g.transitionStyle],la(h,F),A.push(F));0<=g.duration&&(F=0<h.style[T].length,F=Ga(g.duration,F),la(h,F),A.push(F));g.keyframeStyle&&(F=[Z,g.keyframeStyle],la(h,F),A.push(F));var ca=W?0<=g.staggerIndex?g.staggerIndex:b.count(ja):0;(ka=0===ca)&&!g.skipBlocking&&qa(h,9999);var E=w(h,na,ja),$=E.maxDelay;ha=Math.max($,0);m=E.maxDuration;var n={};n.hasTransitions=
1744 0<E.transitionDuration;n.hasAnimations=0<E.animationDuration;n.hasTransitionAll=n.hasTransitions&&"all"==E.transitionProperty;n.applyTransitionDuration=B&&(n.hasTransitions&&!n.hasTransitionAll||n.hasAnimations&&!n.hasTransitions);n.applyAnimationDuration=g.duration&&n.hasAnimations;n.applyTransitionDelay=ua(g.delay)&&(n.applyTransitionDuration||n.hasTransitions);n.applyAnimationDelay=ua(g.delay)&&n.hasAnimations;n.recalculateTimingStyles=0<t.length;if(n.applyTransitionDuration||n.applyAnimationDuration)m=
1744 0<E.transitionDuration;n.hasAnimations=0<E.animationDuration;n.hasTransitionAll=n.hasTransitions&&"all"==E.transitionProperty;n.applyTransitionDuration=B&&(n.hasTransitions&&!n.hasTransitionAll||n.hasAnimations&&!n.hasTransitions);n.applyAnimationDuration=g.duration&&n.hasAnimations;n.applyTransitionDelay=ua(g.delay)&&(n.applyTransitionDuration||n.hasTransitions);n.applyAnimationDelay=ua(g.delay)&&n.hasAnimations;n.recalculateTimingStyles=0<t.length;if(n.applyTransitionDuration||n.applyAnimationDuration)m=
1745 g.duration?parseFloat(g.duration):m,n.applyTransitionDuration&&(n.hasTransitions=!0,E.transitionDuration=m,F=0<h.style[T+"Property"].length,A.push(Ga(m,F))),n.applyAnimationDuration&&(n.hasAnimations=!0,E.animationDuration=m,A.push([za,m+"s"]));if(0===m&&!n.recalculateTimingStyles)return M();if(null!=g.delay){var aa;"boolean"!==typeof g.delay&&(aa=parseFloat(g.delay),ha=Math.max(aa,0));n.applyTransitionDelay&&A.push([ma,aa+"s"]);n.applyAnimationDelay&&A.push([ra,aa+"s"])}null==g.duration&&0<E.transitionDuration&&
1745 g.duration?parseFloat(g.duration):m,n.applyTransitionDuration&&(n.hasTransitions=!0,E.transitionDuration=m,F=0<h.style[T+"Property"].length,A.push(Ga(m,F))),n.applyAnimationDuration&&(n.hasAnimations=!0,E.animationDuration=m,A.push([za,m+"s"]));if(0===m&&!n.recalculateTimingStyles)return M();if(null!=g.delay){var aa;"boolean"!==typeof g.delay&&(aa=parseFloat(g.delay),ha=Math.max(aa,0));n.applyTransitionDelay&&A.push([ma,aa+"s"]);n.applyAnimationDelay&&A.push([ra,aa+"s"])}null==g.duration&&0<E.transitionDuration&&
1746 (n.recalculateTimingStyles=n.recalculateTimingStyles||ka);S=1E3*ha;U=1E3*m;g.skipBlocking||(n.blockTransition=0<E.transitionDuration,n.blockKeyframeAnimation=0<E.animationDuration&&0<W.animationDelay&&0===W.animationDuration);g.from&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.from)),Ca(a,g));n.blockTransition||n.blockKeyframeAnimation?K(m):g.skipBlocking||qa(h,!1);return{$$willAnimate:!0,end:d,start:function(){if(!R)return P={end:d,cancel:v,resume:null,pause:null},C=new f(P),sa(H),C}}}}]}]).provider("$$animateCssDriver",
1746 (n.recalculateTimingStyles=n.recalculateTimingStyles||ka);S=1E3*ha;U=1E3*m;g.skipBlocking||(n.blockTransition=0<E.transitionDuration,n.blockKeyframeAnimation=0<E.animationDuration&&0<W.animationDelay&&0===W.animationDuration);g.from&&(g.cleanupStyles&&Ia(J,h,Object.keys(g.from)),Ca(a,g));n.blockTransition||n.blockKeyframeAnimation?K(m):g.skipBlocking||qa(h,!1);return{$$willAnimate:!0,end:d,start:function(){if(!R)return P={end:d,cancel:v,resume:null,pause:null},C=new f(P),sa(H),C}}}}]}]).provider("$$animateCssDriver",
1747 ["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,e,f,z,B){function s(a){return a.replace(/\bng-\S+\b/g,"")}function v(a,b){P(a)&&(a=a.split(" "));P(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function I(c,e,f){function k(a){var b={},c=D(a).getBoundingClientRect();r(["width","height","top","left"],function(a){var d=c[a];
1747 ["$$animationProvider",function(a){a.drivers.push("$$animateCssDriver");this.$get=["$animateCss","$rootScope","$$AnimateRunner","$rootElement","$sniffer","$$jqLite","$document",function(a,c,d,e,f,z,B){function s(a){return a.replace(/\bng-\S+\b/g,"")}function v(a,b){P(a)&&(a=a.split(" "));P(b)&&(b=b.split(" "));return a.filter(function(a){return-1===b.indexOf(a)}).join(" ")}function I(c,e,f){function k(a){var b={},c=D(a).getBoundingClientRect();r(["width","height","top","left"],function(a){var d=c[a];
1748 switch(a){case "top":d+=C.scrollTop;break;case "left":d+=C.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function p(){var c=s(f.attr("class")||""),d=v(c,l),c=v(l,c),d=a(z,{to:k(f),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function B(){z.remove();e.removeClass("ng-animate-shim");f.removeClass("ng-animate-shim")}var z=G(D(e).cloneNode(!0)),l=s(z.attr("class")||"");e.addClass("ng-animate-shim");f.addClass("ng-animate-shim");z.addClass("ng-anchor");
1748 switch(a){case "top":d+=C.scrollTop;break;case "left":d+=C.scrollLeft}b[a]=Math.floor(d)+"px"});return b}function p(){var c=s(f.attr("class")||""),d=v(c,l),c=v(l,c),d=a(z,{to:k(f),addClass:"ng-anchor-in "+d,removeClass:"ng-anchor-out "+c,delay:!0});return d.$$willAnimate?d:null}function B(){z.remove();e.removeClass("ng-animate-shim");f.removeClass("ng-animate-shim")}var z=G(D(e).cloneNode(!0)),l=s(z.attr("class")||"");e.addClass("ng-animate-shim");f.addClass("ng-animate-shim");z.addClass("ng-anchor");
1749 w.append(z);var K;c=function(){var c=a(z,{addClass:"ng-anchor-out",delay:!0,from:k(e)});return c.$$willAnimate?c:null}();if(!c&&(K=p(),!K))return B();var M=c||K;return{start:function(){function a(){c&&c.end()}var b,c=M.start();c.done(function(){c=null;if(!K&&(K=p()))return c=K.start(),c.done(function(){c=null;B();b.complete()}),c;B();b.complete()});return b=new d({end:a,cancel:a})}}}function q(a,b,c,e){var f=u(a,Q),s=u(b,Q),z=[];r(e,function(a){(a=I(c,a.out,a["in"]))&&z.push(a)});if(f||s||0!==z.length)return{start:function(){function a(){r(b,
1749 w.append(z);var K;c=function(){var c=a(z,{addClass:"ng-anchor-out",delay:!0,from:k(e)});return c.$$willAnimate?c:null}();if(!c&&(K=p(),!K))return B();var M=c||K;return{start:function(){function a(){c&&c.end()}var b,c=M.start();c.done(function(){c=null;if(!K&&(K=p()))return c=K.start(),c.done(function(){c=null;B();b.complete()}),c;B();b.complete()});return b=new d({end:a,cancel:a})}}}function q(a,b,c,e){var f=u(a,Q),s=u(b,Q),z=[];r(e,function(a){(a=I(c,a.out,a["in"]))&&z.push(a)});if(f||s||0!==z.length)return{start:function(){function a(){r(b,
1750 function(a){a.end()})}var b=[];f&&b.push(f.start());s&&b.push(s.start());r(z,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function u(c){var d=c.element,e=c.options||{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=e.domOperation));e.preparationClasses&&(e.event=Y(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!f.animations&&!f.transitions)return Q;var C=B[0].body;
1750 function(a){a.end()})}var b=[];f&&b.push(f.start());s&&b.push(s.start());r(z,function(a){b.push(a.start())});var c=new d({end:a,cancel:a});d.all(b,function(a){c.complete(a)});return c}}}function u(c){var d=c.element,e=c.options||{};c.structural&&(e.event=c.event,e.structural=!0,e.applyClassesEarly=!0,"leave"===c.event&&(e.onDone=e.domOperation));e.preparationClasses&&(e.event=Y(e.event,e.preparationClasses));c=a(d,e);return c.$$willAnimate?c:null}if(!f.animations&&!f.transitions)return Q;var C=B[0].body;
1751 c=D(e);var w=G(c.parentNode&&11===c.parentNode.nodeType||C.contains(c)?c:C);U(z);return function(a){return a.from&&a.to?q(a.from,a.to,a.classes,a.anchors):u(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=ba(c)?c:c.split(" ");for(var d=[],e={},f=0;f<c.length;f++){var r=c[f],q=a.$$registeredAnimations[r];q&&!e[r]&&(d.push(b.get(q)),e[r]=!0)}return d}var f=U(d);return function(a,b,d,v){function q(){v.domOperation();
1751 c=D(e);var w=G(c.parentNode&&11===c.parentNode.nodeType||C.contains(c)?c:C);U(z);return function(a){return a.from&&a.to?q(a.from,a.to,a.classes,a.anchors):u(a)}}]}]).provider("$$animateJs",["$animateProvider",function(a){this.$get=["$injector","$$AnimateRunner","$$jqLite",function(b,c,d){function e(c){c=ba(c)?c:c.split(" ");for(var d=[],e={},f=0;f<c.length;f++){var r=c[f],q=a.$$registeredAnimations[r];q&&!e[r]&&(d.push(b.get(q)),e[r]=!0)}return d}var f=U(d);return function(a,b,d,v){function q(){v.domOperation();
1752 f(a,v)}function D(a,b,d,e,g){switch(d){case "animate":b=[b,e.from,e.to,g];break;case "setClass":b=[b,x,G,g];break;case "addClass":b=[b,x,g];break;case "removeClass":b=[b,G,g];break;default:b=[b,g]}b.push(e);if(a=a.apply(a,b))if(Ka(a.start)&&(a=a.start()),a instanceof c)a.done(g);else if(Ka(a))return a;return Q}function u(a,b,d,e,g){var f=[];r(e,function(e){var k=e[g];k&&f.push(function(){var e,g,f=!1,h=function(a){f||(f=!0,(g||Q)(a),e.complete(!a))};e=new c({end:function(){h()},cancel:function(){h(!0)}});
1752 f(a,v)}function D(a,b,d,e,g){switch(d){case "animate":b=[b,e.from,e.to,g];break;case "setClass":b=[b,x,G,g];break;case "addClass":b=[b,x,g];break;case "removeClass":b=[b,G,g];break;default:b=[b,g]}b.push(e);if(a=a.apply(a,b))if(Ka(a.start)&&(a=a.start()),a instanceof c)a.done(g);else if(Ka(a))return a;return Q}function u(a,b,d,e,g){var f=[];r(e,function(e){var k=e[g];k&&f.push(function(){var e,g,f=!1,h=function(a){f||(f=!0,(g||Q)(a),e.complete(!a))};e=new c({end:function(){h()},cancel:function(){h(!0)}});
1753 g=D(k,a,b,d,function(a){h(!1===a)});return e})});return f}function C(a,b,d,e,g){var f=u(a,b,d,e,g);if(0===f.length){var h,k;"beforeSetClass"===g?(h=u(a,"removeClass",d,e,"beforeRemoveClass"),k=u(a,"addClass",d,e,"beforeAddClass")):"setClass"===g&&(h=u(a,"removeClass",d,e,"removeClass"),k=u(a,"addClass",d,e,"addClass"));h&&(f=f.concat(h));k&&(f=f.concat(k))}if(0!==f.length)return function(a){var b=[];f.length&&r(f,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){r(b,function(b){a?
1753 g=D(k,a,b,d,function(a){h(!1===a)});return e})});return f}function C(a,b,d,e,g){var f=u(a,b,d,e,g);if(0===f.length){var h,k;"beforeSetClass"===g?(h=u(a,"removeClass",d,e,"beforeRemoveClass"),k=u(a,"addClass",d,e,"beforeAddClass")):"setClass"===g&&(h=u(a,"removeClass",d,e,"removeClass"),k=u(a,"addClass",d,e,"addClass"));h&&(f=f.concat(h));k&&(f=f.concat(k))}if(0!==f.length)return function(a){var b=[];f.length&&r(f,function(a){b.push(a())});b.length?c.all(b,a):a();return function(a){r(b,function(b){a?
1754 b.cancel():b.end()})}}}var w=!1;3===arguments.length&&va(d)&&(v=d,d=null);v=pa(v);d||(d=a.attr("class")||"",v.addClass&&(d+=" "+v.addClass),v.removeClass&&(d+=" "+v.removeClass));var x=v.addClass,G=v.removeClass,J=e(d),k,p;if(J.length){var L,O;"leave"==b?(O="leave",L="afterLeave"):(O="before"+b.charAt(0).toUpperCase()+b.substr(1),L=b);"enter"!==b&&"move"!==b&&(k=C(a,b,v,J,O));p=C(a,b,v,J,L)}if(k||p){var l;return{$$willAnimate:!0,end:function(){l?l.end():(w=!0,q(),ga(a,v),l=new c,l.complete(!0));return l},
1754 b.cancel():b.end()})}}}var w=!1;3===arguments.length&&va(d)&&(v=d,d=null);v=pa(v);d||(d=a.attr("class")||"",v.addClass&&(d+=" "+v.addClass),v.removeClass&&(d+=" "+v.removeClass));var x=v.addClass,G=v.removeClass,J=e(d),k,p;if(J.length){var L,O;"leave"==b?(O="leave",L="afterLeave"):(O="before"+b.charAt(0).toUpperCase()+b.substr(1),L=b);"enter"!==b&&"move"!==b&&(k=C(a,b,v,J,O));p=C(a,b,v,J,L)}if(k||p){var l;return{$$willAnimate:!0,end:function(){l?l.end():(w=!0,q(),ga(a,v),l=new c,l.complete(!0));return l},
1755 start:function(){function b(c){w=!0;q();ga(a,v);l.complete(c)}if(l)return l;l=new c;var d,e=[];k&&e.push(function(a){d=k(a)});e.length?e.push(function(a){q();a(!0)}):q();p&&e.push(function(a){d=p(a)});l.setHost({end:function(){w||((d||Q)(void 0),b(void 0))},cancel:function(){w||((d||Q)(!0),b(!0))}});c.chain(e,b);return l}}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,
1755 start:function(){function b(c){w=!0;q();ga(a,v);l.complete(c)}if(l)return l;l=new c;var d,e=[];k&&e.push(function(a){d=k(a)});e.length?e.push(function(a){q();a(!0)}):q();p&&e.push(function(a){d=p(a)});l.setHost({end:function(){w||((d||Q)(void 0),b(void 0))},cancel:function(){w||((d||Q)(!0),b(!0))}});c.chain(e,b);return l}}}}}]}]).provider("$$animateJsDriver",["$$animationProvider",function(a){a.drivers.push("$$animateJsDriver");this.$get=["$$animateJs","$$AnimateRunner",function(a,c){function d(c){return a(c.element,
1756 c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),q=d(a.to);if(b||q)return{start:function(){function a(){return function(){r(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());q&&d.push(q.start());c.all(d,function(a){e.complete(a)});var e=new c({end:a(),cancel:a()});return e}}}else return d(a)}}]}])})(window,window.angular);
1756 c.event,c.classes,c.options)}return function(a){if(a.from&&a.to){var b=d(a.from),q=d(a.to);if(b||q)return{start:function(){function a(){return function(){r(d,function(a){a.end()})}}var d=[];b&&d.push(b.start());q&&d.push(q.start());c.all(d,function(a){e.complete(a)});var e=new c({end:a(),cancel:a()});return e}}}else return d(a)}}]}])})(window,window.angular);
1757 //# sourceMappingURL=angular-animate.min.js.map
1757 //# sourceMappingURL=angular-animate.min.js.map
1758
1758
1759 ;/*
1759 ;/*
1760 * angular-ui-bootstrap
1760 * angular-ui-bootstrap
1761 * http://angular-ui.github.io/bootstrap/
1761 * http://angular-ui.github.io/bootstrap/
1762
1762
1763 * Version: 1.3.2 - 2016-04-14
1763 * Version: 1.3.2 - 2016-04-14
1764 * License: MIT
1764 * License: MIT
1765 */angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.uibAccordionTransclude]},function(a){if(a){var c=angular.element(b[0].querySelector("[uib-accordion-header]"));c.html(""),c.append(a)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b<q.length;b++)q[b].slide.active=b===a}function h(c,d,i){if(!u){if(angular.extend(c,{direction:i}),angular.extend(q[s].slide||{},{direction:i}),e.enabled(b)&&!a.$currentTransition&&q[d].element&&p.slides.length>1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b<q.length;b++)if(q[b].slide===a)return b}function j(){n&&(c.cancel(n),n=null)}function k(b){b.length||(a.$currentTransition=null,f())}function l(){j();var b=+a.interval;!isNaN(b)&&b>0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a<q.length;a++)if(q[a].slide.index===s)return a},p.next=a.next=function(){var b=(p.getCurrentIndex()+1)%q.length;return 0===b&&a.noWrap()?void a.pause():p.select(q[b],"next")},p.prev=a.prev=function(){var b=p.getCurrentIndex()-1<0?q.length-1:p.getCurrentIndex()-1;return a.noWrap()&&b===q.length-1?void a.pause():p.select(q[b],"prev")},p.removeSlide=function(b){var c=i(b),d=t.indexOf(q[c]);-1!==d&&t.splice(d,1),q.splice(c,1),q.length>0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b<q.length;b++)if(q[b].slide.index===a){a=b;break}var c=q[a];c&&(g(a),p.select(q[a]),s=a)}})}]).directive("uibCarousel",function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",function(){return{require:"^uibCarousel",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)})}}}).animation(".item",["$animateCss",function(a){function b(a,b,c){a.removeClass(b),c&&c()}var c="uib-slideDirection";return{beforeAddClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i+" "+h,f);return d.addClass(h),a(d,{addClass:i}).start().done(j),function(){g=!0}}f()},beforeRemoveClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i,f);return a(d,{addClass:i}).start().done(j),function(){g=!0}}f()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter",function(a,b,c,d){function e(a,b){var c=[],e=a.split(""),f=a.indexOf("'");if(f>-1){var g=!1;a=a.split("");for(var h=f;h<a.length;h++)g?("'"===a[h]&&(h+1<a.length&&"'"===a[h+1]?(a[h+1]="$",e[h+1]=""):(e[h]="",g=!1)),a[h]="$"):"'"===a[h]&&(a[h]="$",e[h]="",g=!0);a=a.join("")}return angular.forEach(n,function(d){var f=a.indexOf(d.key);if(f>-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=j(b,a.getTimezoneOffset());return k(a,c*(d-a.getTimezoneOffset()))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)<m.modes.indexOf(m[b])||"maxMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)>m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date,this.activeDate=n.$modelValue?k.fromTimezone(new Date(n.$modelValue),o.timezone):k.fromTimezone(new Date,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode");a.$broadcast("uib:datepicker.focus")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('<div class="uib-position-scrollbar-measure"></div>');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX);
1765 */angular.module("ui.bootstrap",["ui.bootstrap.tpls","ui.bootstrap.collapse","ui.bootstrap.accordion","ui.bootstrap.alert","ui.bootstrap.buttons","ui.bootstrap.carousel","ui.bootstrap.dateparser","ui.bootstrap.isClass","ui.bootstrap.datepicker","ui.bootstrap.position","ui.bootstrap.datepickerPopup","ui.bootstrap.debounce","ui.bootstrap.dropdown","ui.bootstrap.stackedMap","ui.bootstrap.modal","ui.bootstrap.paging","ui.bootstrap.pager","ui.bootstrap.pagination","ui.bootstrap.tooltip","ui.bootstrap.popover","ui.bootstrap.progressbar","ui.bootstrap.rating","ui.bootstrap.tabs","ui.bootstrap.timepicker","ui.bootstrap.typeahead"]),angular.module("ui.bootstrap.tpls",["uib/template/accordion/accordion-group.html","uib/template/accordion/accordion.html","uib/template/alert/alert.html","uib/template/carousel/carousel.html","uib/template/carousel/slide.html","uib/template/datepicker/datepicker.html","uib/template/datepicker/day.html","uib/template/datepicker/month.html","uib/template/datepicker/year.html","uib/template/datepickerPopup/popup.html","uib/template/modal/backdrop.html","uib/template/modal/window.html","uib/template/pager/pager.html","uib/template/pagination/pagination.html","uib/template/tooltip/tooltip-html-popup.html","uib/template/tooltip/tooltip-popup.html","uib/template/tooltip/tooltip-template-popup.html","uib/template/popover/popover-html.html","uib/template/popover/popover-template.html","uib/template/popover/popover.html","uib/template/progressbar/bar.html","uib/template/progressbar/progress.html","uib/template/progressbar/progressbar.html","uib/template/rating/rating.html","uib/template/tabs/tab.html","uib/template/tabs/tabset.html","uib/template/timepicker/timepicker.html","uib/template/typeahead/typeahead-match.html","uib/template/typeahead/typeahead-popup.html"]),angular.module("ui.bootstrap.collapse",[]).directive("uibCollapse",["$animate","$q","$parse","$injector",function(a,b,c,d){var e=d.has("$animateCss")?d.get("$animateCss"):null;return{link:function(d,f,g){function h(){f.hasClass("collapse")&&f.hasClass("in")||b.resolve(l(d)).then(function(){f.removeClass("collapse").addClass("collapsing").attr("aria-expanded",!0).attr("aria-hidden",!1),e?e(f,{addClass:"in",easing:"ease",to:{height:f[0].scrollHeight+"px"}}).start()["finally"](i):a.addClass(f,"in",{to:{height:f[0].scrollHeight+"px"}}).then(i)})}function i(){f.removeClass("collapsing").addClass("collapse").css({height:"auto"}),m(d)}function j(){return f.hasClass("collapse")||f.hasClass("in")?void b.resolve(n(d)).then(function(){f.css({height:f[0].scrollHeight+"px"}).removeClass("collapse").addClass("collapsing").attr("aria-expanded",!1).attr("aria-hidden",!0),e?e(f,{removeClass:"in",to:{height:"0"}}).start()["finally"](k):a.removeClass(f,"in",{to:{height:"0"}}).then(k)}):k()}function k(){f.css({height:"0"}),f.removeClass("collapsing").addClass("collapse"),o(d)}var l=c(g.expanding),m=c(g.expanded),n=c(g.collapsing),o=c(g.collapsed);d.$eval(g.uibCollapse)||f.addClass("in").addClass("collapse").attr("aria-expanded",!0).attr("aria-hidden",!1).css({height:"auto"}),d.$watch(g.uibCollapse,function(a){a?j():h()})}}}]),angular.module("ui.bootstrap.accordion",["ui.bootstrap.collapse"]).constant("uibAccordionConfig",{closeOthers:!0}).controller("UibAccordionController",["$scope","$attrs","uibAccordionConfig",function(a,b,c){this.groups=[],this.closeOthers=function(d){var e=angular.isDefined(b.closeOthers)?a.$eval(b.closeOthers):c.closeOthers;e&&angular.forEach(this.groups,function(a){a!==d&&(a.isOpen=!1)})},this.addGroup=function(a){var b=this;this.groups.push(a),a.$on("$destroy",function(c){b.removeGroup(a)})},this.removeGroup=function(a){var b=this.groups.indexOf(a);-1!==b&&this.groups.splice(b,1)}}]).directive("uibAccordion",function(){return{controller:"UibAccordionController",controllerAs:"accordion",transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion.html"}}}).directive("uibAccordionGroup",function(){return{require:"^uibAccordion",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/accordion/accordion-group.html"},scope:{heading:"@",panelClass:"@?",isOpen:"=?",isDisabled:"=?"},controller:function(){this.setHeading=function(a){this.heading=a}},link:function(a,b,c,d){d.addGroup(a),a.openClass=c.openClass||"panel-open",a.panelClass=c.panelClass||"panel-default",a.$watch("isOpen",function(c){b.toggleClass(a.openClass,!!c),c&&d.closeOthers(a)}),a.toggleOpen=function(b){a.isDisabled||b&&32!==b.which||(a.isOpen=!a.isOpen)};var e="accordiongroup-"+a.$id+"-"+Math.floor(1e4*Math.random());a.headingId=e+"-tab",a.panelId=e+"-panel"}}}).directive("uibAccordionHeading",function(){return{transclude:!0,template:"",replace:!0,require:"^uibAccordionGroup",link:function(a,b,c,d,e){d.setHeading(e(a,angular.noop))}}}).directive("uibAccordionTransclude",function(){return{require:"^uibAccordionGroup",link:function(a,b,c,d){a.$watch(function(){return d[c.uibAccordionTransclude]},function(a){if(a){var c=angular.element(b[0].querySelector("[uib-accordion-header]"));c.html(""),c.append(a)}})}}}),angular.module("ui.bootstrap.alert",[]).controller("UibAlertController",["$scope","$attrs","$interpolate","$timeout",function(a,b,c,d){a.closeable=!!b.close;var e=angular.isDefined(b.dismissOnTimeout)?c(b.dismissOnTimeout)(a.$parent):null;e&&d(function(){a.close()},parseInt(e,10))}]).directive("uibAlert",function(){return{controller:"UibAlertController",controllerAs:"alert",templateUrl:function(a,b){return b.templateUrl||"uib/template/alert/alert.html"},transclude:!0,replace:!0,scope:{type:"@",close:"&"}}}),angular.module("ui.bootstrap.buttons",[]).constant("uibButtonConfig",{activeClass:"active",toggleEvent:"click"}).controller("UibButtonsController",["uibButtonConfig",function(a){this.activeClass=a.activeClass||"active",this.toggleEvent=a.toggleEvent||"click"}]).directive("uibBtnRadio",["$parse",function(a){return{require:["uibBtnRadio","ngModel"],controller:"UibButtonsController",controllerAs:"buttons",link:function(b,c,d,e){var f=e[0],g=e[1],h=a(d.uibUncheckable);c.find("input").css({display:"none"}),g.$render=function(){c.toggleClass(f.activeClass,angular.equals(g.$modelValue,b.$eval(d.uibBtnRadio)))},c.on(f.toggleEvent,function(){if(!d.disabled){var a=c.hasClass(f.activeClass);a&&!angular.isDefined(d.uncheckable)||b.$apply(function(){g.$setViewValue(a?null:b.$eval(d.uibBtnRadio)),g.$render()})}}),d.uibUncheckable&&b.$watch(h,function(a){d.$set("uncheckable",a?"":void 0)})}}}]).directive("uibBtnCheckbox",function(){return{require:["uibBtnCheckbox","ngModel"],controller:"UibButtonsController",controllerAs:"button",link:function(a,b,c,d){function e(){return g(c.btnCheckboxTrue,!0)}function f(){return g(c.btnCheckboxFalse,!1)}function g(b,c){return angular.isDefined(b)?a.$eval(b):c}var h=d[0],i=d[1];b.find("input").css({display:"none"}),i.$render=function(){b.toggleClass(h.activeClass,angular.equals(i.$modelValue,e()))},b.on(h.toggleEvent,function(){c.disabled||a.$apply(function(){i.$setViewValue(b.hasClass(h.activeClass)?f():e()),i.$render()})})}}}),angular.module("ui.bootstrap.carousel",[]).controller("UibCarouselController",["$scope","$element","$interval","$timeout","$animate",function(a,b,c,d,e){function f(){for(;t.length;)t.shift()}function g(a){for(var b=0;b<q.length;b++)q[b].slide.active=b===a}function h(c,d,i){if(!u){if(angular.extend(c,{direction:i}),angular.extend(q[s].slide||{},{direction:i}),e.enabled(b)&&!a.$currentTransition&&q[d].element&&p.slides.length>1){q[d].element.data(r,c.direction);var j=p.getCurrentIndex();angular.isNumber(j)&&q[j].element&&q[j].element.data(r,c.direction),a.$currentTransition=!0,e.on("addClass",q[d].element,function(b,c){if("close"===c&&(a.$currentTransition=null,e.off("addClass",b),t.length)){var d=t.pop().slide,g=d.index,i=g>p.getCurrentIndex()?"next":"prev";f(),h(d,g,i)}})}a.active=c.index,s=c.index,g(d),l()}}function i(a){for(var b=0;b<q.length;b++)if(q[b].slide===a)return b}function j(){n&&(c.cancel(n),n=null)}function k(b){b.length||(a.$currentTransition=null,f())}function l(){j();var b=+a.interval;!isNaN(b)&&b>0&&(n=c(m,b))}function m(){var b=+a.interval;o&&!isNaN(b)&&b>0&&q.length?a.next():a.pause()}var n,o,p=this,q=p.slides=a.slides=[],r="uib-slideDirection",s=a.active,t=[],u=!1;p.addSlide=function(b,c){q.push({slide:b,element:c}),q.sort(function(a,b){return+a.slide.index-+b.slide.index}),(b.index===a.active||1===q.length&&!angular.isNumber(a.active))&&(a.$currentTransition&&(a.$currentTransition=null),s=b.index,a.active=b.index,g(s),p.select(q[i(b)]),1===q.length&&a.play())},p.getCurrentIndex=function(){for(var a=0;a<q.length;a++)if(q[a].slide.index===s)return a},p.next=a.next=function(){var b=(p.getCurrentIndex()+1)%q.length;return 0===b&&a.noWrap()?void a.pause():p.select(q[b],"next")},p.prev=a.prev=function(){var b=p.getCurrentIndex()-1<0?q.length-1:p.getCurrentIndex()-1;return a.noWrap()&&b===q.length-1?void a.pause():p.select(q[b],"prev")},p.removeSlide=function(b){var c=i(b),d=t.indexOf(q[c]);-1!==d&&t.splice(d,1),q.splice(c,1),q.length>0&&s===c?c>=q.length?(s=q.length-1,a.active=s,g(s),p.select(q[q.length-1])):(s=c,a.active=s,g(s),p.select(q[c])):s>c&&(s--,a.active=s),0===q.length&&(s=null,a.active=null,f())},p.select=a.select=function(b,c){var d=i(b.slide);void 0===c&&(c=d>p.getCurrentIndex()?"next":"prev"),b.slide.index===s||a.$currentTransition?b&&b.slide.index!==s&&a.$currentTransition&&t.push(q[d]):h(b.slide,d,c)},a.indexOfSlide=function(a){return+a.slide.index},a.isActive=function(b){return a.active===b.slide.index},a.isPrevDisabled=function(){return 0===a.active&&a.noWrap()},a.isNextDisabled=function(){return a.active===q.length-1&&a.noWrap()},a.pause=function(){a.noPause||(o=!1,j())},a.play=function(){o||(o=!0,l())},a.$on("$destroy",function(){u=!0,j()}),a.$watch("noTransition",function(a){e.enabled(b,!a)}),a.$watch("interval",l),a.$watchCollection("slides",k),a.$watch("active",function(a){if(angular.isNumber(a)&&s!==a){for(var b=0;b<q.length;b++)if(q[b].slide.index===a){a=b;break}var c=q[a];c&&(g(a),p.select(q[a]),s=a)}})}]).directive("uibCarousel",function(){return{transclude:!0,replace:!0,controller:"UibCarouselController",controllerAs:"carousel",templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/carousel.html"},scope:{active:"=",interval:"=",noTransition:"=",noPause:"=",noWrap:"&"}}}).directive("uibSlide",function(){return{require:"^uibCarousel",transclude:!0,replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/carousel/slide.html"},scope:{actual:"=?",index:"=?"},link:function(a,b,c,d){d.addSlide(a,b),a.$on("$destroy",function(){d.removeSlide(a)})}}}).animation(".item",["$animateCss",function(a){function b(a,b,c){a.removeClass(b),c&&c()}var c="uib-slideDirection";return{beforeAddClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i+" "+h,f);return d.addClass(h),a(d,{addClass:i}).start().done(j),function(){g=!0}}f()},beforeRemoveClass:function(d,e,f){if("active"===e){var g=!1,h=d.data(c),i="next"===h?"left":"right",j=b.bind(this,d,i,f);return a(d,{addClass:i}).start().done(j),function(){g=!0}}f()}}}]),angular.module("ui.bootstrap.dateparser",[]).service("uibDateParser",["$log","$locale","dateFilter","orderByFilter",function(a,b,c,d){function e(a,b){var c=[],e=a.split(""),f=a.indexOf("'");if(f>-1){var g=!1;a=a.split("");for(var h=f;h<a.length;h++)g?("'"===a[h]&&(h+1<a.length&&"'"===a[h+1]?(a[h+1]="$",e[h+1]=""):(e[h]="",g=!1)),a[h]="$"):"'"===a[h]&&(a[h]="$",e[h]="",g=!0);a=a.join("")}return angular.forEach(n,function(d){var f=a.indexOf(d.key);if(f>-1){a=a.split(""),e[f]="("+d.regex+")",a[f]="$";for(var g=f+1,h=f+d.key.length;h>g;g++)e[g]="",a[g]="$";a=a.join(""),c.push({index:f,key:d.key,apply:d[b],matcher:d.regex})}}),{regex:new RegExp("^"+e.join("")+"$"),map:d(c,"index")}}function f(a,b,c){return 1>c?!1:1===b&&c>28?29===c&&(a%4===0&&a%100!==0||a%400===0):3===b||5===b||8===b||10===b?31>c:!0}function g(a){return parseInt(a,10)}function h(a,b){return a&&b?l(a,b):a}function i(a,b){return a&&b?l(a,b,!0):a}function j(a,b){var c=Date.parse("Jan 01, 1970 00:00:00 "+a)/6e4;return isNaN(c)?b:c}function k(a,b){return a=new Date(a.getTime()),a.setMinutes(a.getMinutes()+b),a}function l(a,b,c){c=c?-1:1;var d=j(b,a.getTimezoneOffset());return k(a,c*(d-a.getTimezoneOffset()))}var m,n,o=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;this.init=function(){m=b.id,this.parsers={},this.formatters={},n=[{key:"yyyy",regex:"\\d{4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yyyy")}},{key:"yy",regex:"\\d{2}",apply:function(a){a=+a,this.year=69>a?a+2e3:a+1900},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"yy")}},{key:"y",regex:"\\d{1,4}",apply:function(a){this.year=+a},formatter:function(a){var b=new Date;return b.setFullYear(Math.abs(a.getFullYear())),c(b,"y")}},{key:"M!",regex:"0?[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){var b=a.getMonth();return/^[0-9]$/.test(b)?c(a,"MM"):c(a,"M")}},{key:"MMMM",regex:b.DATETIME_FORMATS.MONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.MONTH.indexOf(a)},formatter:function(a){return c(a,"MMMM")}},{key:"MMM",regex:b.DATETIME_FORMATS.SHORTMONTH.join("|"),apply:function(a){this.month=b.DATETIME_FORMATS.SHORTMONTH.indexOf(a)},formatter:function(a){return c(a,"MMM")}},{key:"MM",regex:"0[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"MM")}},{key:"M",regex:"[1-9]|1[0-2]",apply:function(a){this.month=a-1},formatter:function(a){return c(a,"M")}},{key:"d!",regex:"[0-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){var b=a.getDate();return/^[1-9]$/.test(b)?c(a,"dd"):c(a,"d")}},{key:"dd",regex:"[0-2][0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"dd")}},{key:"d",regex:"[1-2]?[0-9]{1}|3[0-1]{1}",apply:function(a){this.date=+a},formatter:function(a){return c(a,"d")}},{key:"EEEE",regex:b.DATETIME_FORMATS.DAY.join("|"),formatter:function(a){return c(a,"EEEE")}},{key:"EEE",regex:b.DATETIME_FORMATS.SHORTDAY.join("|"),formatter:function(a){return c(a,"EEE")}},{key:"HH",regex:"(?:0|1)[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"HH")}},{key:"hh",regex:"0[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"hh")}},{key:"H",regex:"1?[0-9]|2[0-3]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"H")}},{key:"h",regex:"[0-9]|1[0-2]",apply:function(a){this.hours=+a},formatter:function(a){return c(a,"h")}},{key:"mm",regex:"[0-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"mm")}},{key:"m",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.minutes=+a},formatter:function(a){return c(a,"m")}},{key:"sss",regex:"[0-9][0-9][0-9]",apply:function(a){this.milliseconds=+a},formatter:function(a){return c(a,"sss")}},{key:"ss",regex:"[0-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"ss")}},{key:"s",regex:"[0-9]|[1-5][0-9]",apply:function(a){this.seconds=+a},formatter:function(a){return c(a,"s")}},{key:"a",regex:b.DATETIME_FORMATS.AMPMS.join("|"),apply:function(a){12===this.hours&&(this.hours=0),"PM"===a&&(this.hours+=12)},formatter:function(a){return c(a,"a")}},{key:"Z",regex:"[+-]\\d{4}",apply:function(a){var b=a.match(/([+-])(\d{2})(\d{2})/),c=b[1],d=b[2],e=b[3];this.hours+=g(c+d),this.minutes+=g(c+e)},formatter:function(a){return c(a,"Z")}},{key:"ww",regex:"[0-4][0-9]|5[0-3]",formatter:function(a){return c(a,"ww")}},{key:"w",regex:"[0-9]|[1-4][0-9]|5[0-3]",formatter:function(a){return c(a,"w")}},{key:"GGGG",regex:b.DATETIME_FORMATS.ERANAMES.join("|").replace(/\s/g,"\\s"),formatter:function(a){return c(a,"GGGG")}},{key:"GGG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GGG")}},{key:"GG",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"GG")}},{key:"G",regex:b.DATETIME_FORMATS.ERAS.join("|"),formatter:function(a){return c(a,"G")}}]},this.init(),this.filter=function(a,c){if(!angular.isDate(a)||isNaN(a)||!c)return"";c=b.DATETIME_FORMATS[c]||c,b.id!==m&&this.init(),this.formatters[c]||(this.formatters[c]=e(c,"formatter"));var d=this.formatters[c],f=d.map,g=c;return f.reduce(function(b,c,d){var e=g.match(new RegExp("(.*)"+c.key));e&&angular.isString(e[1])&&(b+=e[1],g=g.replace(e[1]+c.key,""));var h=d===f.length-1?g:"";return c.apply?b+c.apply.call(null,a)+h:b+h},"")},this.parse=function(c,d,g){if(!angular.isString(c)||!d)return c;d=b.DATETIME_FORMATS[d]||d,d=d.replace(o,"\\$&"),b.id!==m&&this.init(),this.parsers[d]||(this.parsers[d]=e(d,"apply"));var h=this.parsers[d],i=h.regex,j=h.map,k=c.match(i),l=!1;if(k&&k.length){var n,p;angular.isDate(g)&&!isNaN(g.getTime())?n={year:g.getFullYear(),month:g.getMonth(),date:g.getDate(),hours:g.getHours(),minutes:g.getMinutes(),seconds:g.getSeconds(),milliseconds:g.getMilliseconds()}:(g&&a.warn("dateparser:","baseDate is not a valid date"),n={year:1900,month:0,date:1,hours:0,minutes:0,seconds:0,milliseconds:0});for(var q=1,r=k.length;r>q;q++){var s=j[q-1];"Z"===s.matcher&&(l=!0),s.apply&&s.apply.call(n,k[q])}var t=l?Date.prototype.setUTCFullYear:Date.prototype.setFullYear,u=l?Date.prototype.setUTCHours:Date.prototype.setHours;return f(n.year,n.month,n.date)&&(!angular.isDate(g)||isNaN(g.getTime())||l?(p=new Date(0),t.call(p,n.year,n.month,n.date),u.call(p,n.hours||0,n.minutes||0,n.seconds||0,n.milliseconds||0)):(p=new Date(g),t.call(p,n.year,n.month,n.date),u.call(p,n.hours,n.minutes,n.seconds,n.milliseconds))),p}},this.toTimezone=h,this.fromTimezone=i,this.timezoneToOffset=j,this.addDateMinutes=k,this.convertTimezoneToLocal=l}]),angular.module("ui.bootstrap.isClass",[]).directive("uibIsClass",["$animate",function(a){var b=/^\s*([\s\S]+?)\s+on\s+([\s\S]+?)\s*$/,c=/^\s*([\s\S]+?)\s+for\s+([\s\S]+?)\s*$/;return{restrict:"A",compile:function(d,e){function f(a,b,c){i.push(a),j.push({scope:a,element:b}),o.forEach(function(b,c){g(b,a)}),a.$on("$destroy",h)}function g(b,d){var e=b.match(c),f=d.$eval(e[1]),g=e[2],h=k[b];if(!h){var i=function(b){var c=null;j.some(function(a){var d=a.scope.$eval(m);return d===b?(c=a,!0):void 0}),h.lastActivated!==c&&(h.lastActivated&&a.removeClass(h.lastActivated.element,f),c&&a.addClass(c.element,f),h.lastActivated=c)};k[b]=h={lastActivated:null,scope:d,watchFn:i,compareWithExp:g,watcher:d.$watch(g,i)}}h.watchFn(d.$eval(g))}function h(a){var b=a.targetScope,c=i.indexOf(b);if(i.splice(c,1),j.splice(c,1),i.length){var d=i[0];angular.forEach(k,function(a){a.scope===b&&(a.watcher=d.$watch(a.compareWithExp,a.watchFn),a.scope=d)})}else k={}}var i=[],j=[],k={},l=e.uibIsClass.match(b),m=l[2],n=l[1],o=n.split(",");return f}}}]),angular.module("ui.bootstrap.datepicker",["ui.bootstrap.dateparser","ui.bootstrap.isClass"]).value("$datepickerSuppressError",!1).value("$datepickerLiteralWarning",!0).constant("uibDatepickerConfig",{datepickerMode:"day",formatDay:"dd",formatMonth:"MMMM",formatYear:"yyyy",formatDayHeader:"EEE",formatDayTitle:"MMMM yyyy",formatMonthTitle:"yyyy",maxDate:null,maxMode:"year",minDate:null,minMode:"day",ngModelOptions:{},shortcutPropagation:!1,showWeeks:!0,yearColumns:5,yearRows:4}).controller("UibDatepickerController",["$scope","$attrs","$parse","$interpolate","$locale","$log","dateFilter","uibDatepickerConfig","$datepickerLiteralWarning","$datepickerSuppressError","uibDateParser",function(a,b,c,d,e,f,g,h,i,j,k){function l(b){a.datepickerMode=b,a.datepickerOptions.datepickerMode=b}var m=this,n={$setViewValue:angular.noop},o={},p=[];!!b.datepickerOptions;a.datepickerOptions||(a.datepickerOptions={}),this.modes=["day","month","year"],["customClass","dateDisabled","datepickerMode","formatDay","formatDayHeader","formatDayTitle","formatMonth","formatMonthTitle","formatYear","maxDate","maxMode","minDate","minMode","showWeeks","shortcutPropagation","startingDay","yearColumns","yearRows"].forEach(function(b){switch(b){case"customClass":case"dateDisabled":a[b]=a.datepickerOptions[b]||angular.noop;break;case"datepickerMode":a.datepickerMode=angular.isDefined(a.datepickerOptions.datepickerMode)?a.datepickerOptions.datepickerMode:h.datepickerMode;break;case"formatDay":case"formatDayHeader":case"formatDayTitle":case"formatMonth":case"formatMonthTitle":case"formatYear":m[b]=angular.isDefined(a.datepickerOptions[b])?d(a.datepickerOptions[b])(a.$parent):h[b];break;case"showWeeks":case"shortcutPropagation":case"yearColumns":case"yearRows":m[b]=angular.isDefined(a.datepickerOptions[b])?a.datepickerOptions[b]:h[b];break;case"startingDay":angular.isDefined(a.datepickerOptions.startingDay)?m.startingDay=a.datepickerOptions.startingDay:angular.isNumber(h.startingDay)?m.startingDay=h.startingDay:m.startingDay=(e.DATETIME_FORMATS.FIRSTDAYOFWEEK+8)%7;break;case"maxDate":case"minDate":a.$watch("datepickerOptions."+b,function(a){a?angular.isDate(a)?m[b]=k.fromTimezone(new Date(a),o.timezone):(i&&f.warn("Literal date support has been deprecated, please switch to date object usage"),m[b]=new Date(g(a,"medium"))):m[b]=h[b]?k.fromTimezone(new Date(h[b]),o.timezone):null,m.refreshView()});break;case"maxMode":case"minMode":a.datepickerOptions[b]?a.$watch(function(){return a.datepickerOptions[b]},function(c){m[b]=a[b]=angular.isDefined(c)?c:datepickerOptions[b],("minMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)<m.modes.indexOf(m[b])||"maxMode"===b&&m.modes.indexOf(a.datepickerOptions.datepickerMode)>m.modes.indexOf(m[b]))&&(a.datepickerMode=m[b],a.datepickerOptions.datepickerMode=m[b])}):m[b]=a[b]=h[b]||null}}),a.uniqueId="datepicker-"+a.$id+"-"+Math.floor(1e4*Math.random()),a.disabled=angular.isDefined(b.disabled)||!1,angular.isDefined(b.ngDisabled)&&p.push(a.$parent.$watch(b.ngDisabled,function(b){a.disabled=b,m.refreshView()})),a.isActive=function(b){return 0===m.compare(b.date,m.activeDate)?(a.activeDateId=b.uid,!0):!1},this.init=function(b){n=b,o=b.$options||h.ngModelOptions,a.datepickerOptions.initDate?(m.activeDate=k.fromTimezone(a.datepickerOptions.initDate,o.timezone)||new Date,a.$watch("datepickerOptions.initDate",function(a){a&&(n.$isEmpty(n.$modelValue)||n.$invalid)&&(m.activeDate=k.fromTimezone(a,o.timezone),m.refreshView())})):m.activeDate=new Date,this.activeDate=n.$modelValue?k.fromTimezone(new Date(n.$modelValue),o.timezone):k.fromTimezone(new Date,o.timezone),n.$render=function(){m.render()}},this.render=function(){if(n.$viewValue){var a=new Date(n.$viewValue),b=!isNaN(a);b?this.activeDate=k.fromTimezone(a,o.timezone):j||f.error('Datepicker directive: "ng-model" value must be a Date object')}this.refreshView()},this.refreshView=function(){if(this.element){a.selectedDt=null,this._refreshView(),a.activeDt&&(a.activeDateId=a.activeDt.uid);var b=n.$viewValue?new Date(n.$viewValue):null;b=k.fromTimezone(b,o.timezone),n.$setValidity("dateDisabled",!b||this.element&&!this.isDisabled(b))}},this.createDateObject=function(b,c){var d=n.$viewValue?new Date(n.$viewValue):null;d=k.fromTimezone(d,o.timezone);var e=new Date;e=k.fromTimezone(e,o.timezone);var f=this.compare(b,e),g={date:b,label:k.filter(b,c),selected:d&&0===this.compare(b,d),disabled:this.isDisabled(b),past:0>f,current:0===f,future:f>0,customClass:this.customClass(b)||null};return d&&0===this.compare(b,d)&&(a.selectedDt=g),m.activeDate&&0===this.compare(g.date,m.activeDate)&&(a.activeDt=g),g},this.isDisabled=function(b){return a.disabled||this.minDate&&this.compare(b,this.minDate)<0||this.maxDate&&this.compare(b,this.maxDate)>0||a.dateDisabled&&a.dateDisabled({date:b,mode:a.datepickerMode})},this.customClass=function(b){return a.customClass({date:b,mode:a.datepickerMode})},this.split=function(a,b){for(var c=[];a.length>0;)c.push(a.splice(0,b));return c},a.select=function(b){if(a.datepickerMode===m.minMode){var c=n.$viewValue?k.fromTimezone(new Date(n.$viewValue),o.timezone):new Date(0,0,0,0,0,0,0);c.setFullYear(b.getFullYear(),b.getMonth(),b.getDate()),c=k.toTimezone(c,o.timezone),n.$setViewValue(c),n.$render()}else m.activeDate=b,l(m.modes[m.modes.indexOf(a.datepickerMode)-1]),a.$emit("uib:datepicker.mode");a.$broadcast("uib:datepicker.focus")},a.move=function(a){var b=m.activeDate.getFullYear()+a*(m.step.years||0),c=m.activeDate.getMonth()+a*(m.step.months||0);m.activeDate.setFullYear(b,c,1),m.refreshView()},a.toggleMode=function(b){b=b||1,a.datepickerMode===m.maxMode&&1===b||a.datepickerMode===m.minMode&&-1===b||(l(m.modes[m.modes.indexOf(a.datepickerMode)+b]),a.$emit("uib:datepicker.mode"))},a.keys={13:"enter",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down"};var q=function(){m.element[0].focus()};a.$on("uib:datepicker.focus",q),a.keydown=function(b){var c=a.keys[b.which];if(c&&!b.shiftKey&&!b.altKey&&!a.disabled)if(b.preventDefault(),m.shortcutPropagation||b.stopPropagation(),"enter"===c||"space"===c){if(m.isDisabled(m.activeDate))return;a.select(m.activeDate)}else!b.ctrlKey||"up"!==c&&"down"!==c?(m.handleKeyDown(c,b),m.refreshView()):a.toggleMode("up"===c?1:-1)},a.$on("$destroy",function(){for(;p.length;)p.shift()()})}]).controller("UibDaypickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a,b){return 1!==b||a%4!==0||a%100===0&&a%400!==0?f[b]:29}function e(a){var b=new Date(a);b.setDate(b.getDate()+4-(b.getDay()||7));var c=b.getTime();return b.setMonth(0),b.setDate(1),Math.floor(Math.round((c-b)/864e5)/7)+1}var f=[31,28,31,30,31,30,31,31,30,31,30,31];this.step={months:1},this.element=b,this.init=function(b){angular.extend(b,this),a.showWeeks=b.showWeeks,b.refreshView()},this.getDates=function(a,b){for(var c,d=new Array(b),e=new Date(a),f=0;b>f;)c=new Date(e),d[f++]=c,e.setDate(e.getDate()+1);return d},this._refreshView=function(){var b=this.activeDate.getFullYear(),d=this.activeDate.getMonth(),f=new Date(this.activeDate);f.setFullYear(b,d,1);var g=this.startingDay-f.getDay(),h=g>0?7-g:-g,i=new Date(f);h>0&&i.setDate(-h+1);for(var j=this.getDates(i,42),k=0;42>k;k++)j[k]=angular.extend(this.createDateObject(j[k],this.formatDay),{secondary:j[k].getMonth()!==d,uid:a.uniqueId+"-"+k});a.labels=new Array(7);for(var l=0;7>l;l++)a.labels[l]={abbr:c(j[l].date,this.formatDayHeader),full:c(j[l].date,"EEEE")};if(a.title=c(this.activeDate,this.formatDayTitle),a.rows=this.split(j,7),a.showWeeks){a.weekNumbers=[];for(var m=(11-this.startingDay)%7,n=a.rows.length,o=0;n>o;o++)a.weekNumbers.push(e(a.rows[o][m].date))}},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth(),a.getDate()),d=new Date(b.getFullYear(),b.getMonth(),b.getDate());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getDate();if("left"===a)c-=1;else if("up"===a)c-=7;else if("right"===a)c+=1;else if("down"===a)c+=7;else if("pageup"===a||"pagedown"===a){var e=this.activeDate.getMonth()+("pageup"===a?-1:1);this.activeDate.setMonth(e,1),c=Math.min(d(this.activeDate.getFullYear(),this.activeDate.getMonth()),c)}else"home"===a?c=1:"end"===a&&(c=d(this.activeDate.getFullYear(),this.activeDate.getMonth()));this.activeDate.setDate(c)}}]).controller("UibMonthpickerController",["$scope","$element","dateFilter",function(a,b,c){this.step={years:1},this.element=b,this.init=function(a){angular.extend(a,this),a.refreshView()},this._refreshView=function(){for(var b,d=new Array(12),e=this.activeDate.getFullYear(),f=0;12>f;f++)b=new Date(this.activeDate),b.setFullYear(e,f,1),d[f]=angular.extend(this.createDateObject(b,this.formatMonth),{uid:a.uniqueId+"-"+f});a.title=c(this.activeDate,this.formatMonthTitle),a.rows=this.split(d,3)},this.compare=function(a,b){var c=new Date(a.getFullYear(),a.getMonth()),d=new Date(b.getFullYear(),b.getMonth());return c.setFullYear(a.getFullYear()),d.setFullYear(b.getFullYear()),c-d},this.handleKeyDown=function(a,b){var c=this.activeDate.getMonth();if("left"===a)c-=1;else if("up"===a)c-=3;else if("right"===a)c+=1;else if("down"===a)c+=3;else if("pageup"===a||"pagedown"===a){var d=this.activeDate.getFullYear()+("pageup"===a?-1:1);this.activeDate.setFullYear(d)}else"home"===a?c=0:"end"===a&&(c=11);this.activeDate.setMonth(c)}}]).controller("UibYearpickerController",["$scope","$element","dateFilter",function(a,b,c){function d(a){return parseInt((a-1)/f,10)*f+1}var e,f;this.element=b,this.yearpickerInit=function(){e=this.yearColumns,f=this.yearRows*e,this.step={years:f}},this._refreshView=function(){for(var b,c=new Array(f),g=0,h=d(this.activeDate.getFullYear());f>g;g++)b=new Date(this.activeDate),b.setFullYear(h+g,0,1),c[g]=angular.extend(this.createDateObject(b,this.formatYear),{uid:a.uniqueId+"-"+g});a.title=[c[0].label,c[f-1].label].join(" - "),a.rows=this.split(c,e),a.columns=e},this.compare=function(a,b){return a.getFullYear()-b.getFullYear()},this.handleKeyDown=function(a,b){var c=this.activeDate.getFullYear();"left"===a?c-=1:"up"===a?c-=e:"right"===a?c+=1:"down"===a?c+=e:"pageup"===a||"pagedown"===a?c+=("pageup"===a?-1:1)*f:"home"===a?c=d(this.activeDate.getFullYear()):"end"===a&&(c=d(this.activeDate.getFullYear())+f-1),this.activeDate.setFullYear(c)}}]).directive("uibDatepicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/datepicker.html"},scope:{datepickerOptions:"=?"},require:["uibDatepicker","^ngModel"],controller:"UibDatepickerController",controllerAs:"datepicker",link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}).directive("uibDaypicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/day.html"},require:["^uibDatepicker","uibDaypicker"],controller:"UibDaypickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibMonthpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/month.html"},require:["^uibDatepicker","uibMonthpicker"],controller:"UibMonthpickerController",link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibYearpicker",function(){return{replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepicker/year.html"},require:["^uibDatepicker","uibYearpicker"],controller:"UibYearpickerController",link:function(a,b,c,d){var e=d[0];angular.extend(e,d[1]),e.yearpickerInit(),e.refreshView()}}}),angular.module("ui.bootstrap.position",[]).factory("$uibPosition",["$document","$window",function(a,b){var c,d,e={normal:/(auto|scroll)/,hidden:/(auto|scroll|hidden)/},f={auto:/\s?auto?\s?/i,primary:/^(top|bottom|left|right)$/,secondary:/^(top|bottom|left|right|center)$/,vertical:/^(top|bottom)$/},g=/(HTML|BODY)/;return{getRawNode:function(a){return a.nodeName?a:a[0]||a},parseStyle:function(a){return a=parseFloat(a),isFinite(a)?a:0},offsetParent:function(c){function d(a){return"static"===(b.getComputedStyle(a).position||"static")}c=this.getRawNode(c);for(var e=c.offsetParent||a[0].documentElement;e&&e!==a[0].documentElement&&d(e);)e=e.offsetParent;return e||a[0].documentElement},scrollbarWidth:function(e){if(e){if(angular.isUndefined(d)){var f=a.find("body");f.addClass("uib-position-body-scrollbar-measure"),d=b.innerWidth-f[0].clientWidth,d=isFinite(d)?d:0,f.removeClass("uib-position-body-scrollbar-measure")}return d}if(angular.isUndefined(c)){var g=angular.element('<div class="uib-position-scrollbar-measure"></div>');a.find("body").append(g),c=g[0].offsetWidth-g[0].clientWidth,c=isFinite(c)?c:0,g.remove()}return c},scrollbarPadding:function(a){a=this.getRawNode(a);var c=b.getComputedStyle(a),d=this.parseStyle(c.paddingRight),e=this.parseStyle(c.paddingBottom),f=this.scrollParent(a,!1,!0),h=this.scrollbarWidth(f,g.test(f.tagName));return{scrollbarWidth:h,widthOverflow:f.scrollWidth>f.clientWidth,right:d+h,originalRight:d,heightOverflow:f.scrollHeight>f.clientHeight,bottom:e+h,originalBottom:e}},isScrollable:function(a,c){a=this.getRawNode(a);var d=c?e.hidden:e.normal,f=b.getComputedStyle(a);return d.test(f.overflow+f.overflowY+f.overflowX);
1766 },scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d<I.length;d++)if(c=l.parse(b,I[d],a.date),!isNaN(c))return c;return c}function r(a){if(angular.isNumber(a)&&(a=new Date(a)),!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=q(a);if(!isNaN(b))return l.toTimezone(b,J)}return F.$options&&F.$options.allowInvalid?a:void 0}function s(a,b){var d=a||b;return c.ngRequired||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?!0:angular.isString(d)?!isNaN(q(b)):!1:!0):!0}function t(c){if(a.isOpen||!a.disabled){var d=H[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.isOpen=!1})}}function u(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!1}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}function v(){if(a.isOpen){var d=angular.element(H[0].querySelector(".uib-datepicker-popup")),e=c.popupPlacement?c.popupPlacement:m.placement,f=j.positionElements(b,d,e,y);d.css({top:f.top+"px",left:f.left+"px"}),d.hasClass("uib-position-measure")&&d.removeClass("uib-position-measure")}}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K=!1,L=[];this.init=function(e){if(F=e,G=e.$options,x=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):m.closeOnDateSelection,y=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):m.appendToBody,z=angular.isDefined(c.onOpenFocus)?a.$parent.$eval(c.onOpenFocus):m.onOpenFocus,A=angular.isDefined(c.datepickerPopupTemplateUrl)?c.datepickerPopupTemplateUrl:m.datepickerPopupTemplateUrl,B=angular.isDefined(c.datepickerTemplateUrl)?c.datepickerTemplateUrl:m.datepickerTemplateUrl,I=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):m.altInputFormats,a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):m.showButtonBar,m.html5Types[c.type]?(w=m.html5Types[c.type],K=!0):(w=c.uibDatepickerPopup||m.datepickerPopup,c.$observe("uibDatepickerPopup",function(a,b){var c=a||m.datepickerPopup;if(c!==w&&(w=c,F.$modelValue=null,!w))throw new Error("uibDatepickerPopup must have a date format specified.")})),!w)throw new Error("uibDatepickerPopup must have a date format specified.");if(K&&c.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");C=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(a.date=l.fromTimezone(b,J),angular.isNumber(a.date)&&(a.date=new Date(a.date)),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium"))):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b,f){c||(a.on("click",d),f.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b,f){c===b&&(c=null,a.off("click",d),f.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(a.stopPropagation(),c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:m.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",e.right=window.innerWidth-(m.left+b.prop("offsetWidth"))+"px"):(e.left=m.left+"px",e.right="auto"),!t){var v=h.offset(u);e.top=m.top-v.top+"px",i?e.right=window.innerWidth-(m.left-v.left+b.prop("offsetWidth"))+"px":e.left=m.left-v.left+"px"}n.dropdownMenu.css(e)}var w=u?u:b,x=w.hasClass(u?p:q);if(x===!c&&g[c?"addClass":"removeClass"](w,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o,b);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var y=angular.element('<ul class="dropdown-menu"></ul>');n.dropdownMenu.replaceWith(y),n.dropdownMenu=y}f.close(o,b),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b===a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b===a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap","ui.bootstrap.position"]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).provider("$uibResolve",function(){var a=this;this.resolver=null,this.setResolver=function(a){this.resolver=a},this.$get=["$injector","$q",function(b,c){var d=a.resolver?b.get(a.resolver):null;return{resolve:function(a,e,f,g){if(d)return d.resolve(a,e,f,g);var h=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?h.push(c.resolve(b.invoke(a))):angular.isString(a)?h.push(c.resolve(b.get(a))):h.push(c.resolve(a))}),c.all(h).then(function(b){var c={},d=0;return angular.forEach(a,function(a,e){c[e]=b[d++]}),c})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(a,b,c){function d(b,d,e){e.modalInClass&&(a.addClass(d,e.modalInClass),b.$on(c.NOW_CLOSING_EVENT,function(c,f){var g=f();b.modalOptions.animation?a.removeClass(d,e.modalInClass).then(g):g()}))}return{replace:!0,templateUrl:"uib/template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(a,b,c,d){return{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/modal/window.html"},link:function(e,f,g){f.addClass(g.windowClass||""),f.addClass(g.windowTopClass||""),e.size=g.size,e.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},f.on("click",e.close),e.$isRendered=!0;var h=b.defer();g.$observe("modalRender",function(a){"true"===a&&h.resolve()}),h.promise.then(function(){var h=null;g.modalInClass&&(h=c(f,{addClass:g.modalInClass}).start(),e.$on(a.NOW_CLOSING_EVENT,function(a,b){var d=b();c(f,{removeClass:g.modalInClass}).start().then(d)})),b.when(h).then(function(){var b=a.getTop();if(b&&a.modalRendered(b.key),!d[0].activeElement||!f[0].contains(d[0].activeElement)){var c=f[0].querySelector("[autofocus]");c?c.focus():f[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(a,b,c,d,e,f,g,h,i){function j(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function k(){for(var a=-1,b=v.keys(),c=0;c<b.length;c++)v.get(b[c]).value.backdrop&&(a=c);return a>-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a),z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a);var e=w.hasKey(b);d.toggleClass(b,e),!e&&t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"})),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('<div uib-modal-window="modal-window"></div>');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a)}):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a}),i=f(e.controller,j,!0),e.controllerAs?(g=i.instance,e.bindToController&&(g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,c)),g=i(),d[e.controllerAs]=g):g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup uib-title="'+r+"title"+s+'" '+(n.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen" origin-scope="origScope" class="uib-position-measure"></div>';
1766 },scrollParent:function(c,d,f){c=this.getRawNode(c);var g=d?e.hidden:e.normal,h=a[0].documentElement,i=b.getComputedStyle(c);if(f&&g.test(i.overflow+i.overflowY+i.overflowX))return c;var j="absolute"===i.position,k=c.parentElement||h;if(k===h||"fixed"===i.position)return h;for(;k.parentElement&&k!==h;){var l=b.getComputedStyle(k);if(j&&"static"!==l.position&&(j=!1),!j&&g.test(l.overflow+l.overflowY+l.overflowX))break;k=k.parentElement}return k},position:function(c,d){c=this.getRawNode(c);var e=this.offset(c);if(d){var f=b.getComputedStyle(c);e.top-=this.parseStyle(f.marginTop),e.left-=this.parseStyle(f.marginLeft)}var g=this.offsetParent(c),h={top:0,left:0};return g!==a[0].documentElement&&(h=this.offset(g),h.top+=g.clientTop-g.scrollTop,h.left+=g.clientLeft-g.scrollLeft),{width:Math.round(angular.isNumber(e.width)?e.width:c.offsetWidth),height:Math.round(angular.isNumber(e.height)?e.height:c.offsetHeight),top:Math.round(e.top-h.top),left:Math.round(e.left-h.left)}},offset:function(c){c=this.getRawNode(c);var d=c.getBoundingClientRect();return{width:Math.round(angular.isNumber(d.width)?d.width:c.offsetWidth),height:Math.round(angular.isNumber(d.height)?d.height:c.offsetHeight),top:Math.round(d.top+(b.pageYOffset||a[0].documentElement.scrollTop)),left:Math.round(d.left+(b.pageXOffset||a[0].documentElement.scrollLeft))}},viewportOffset:function(c,d,e){c=this.getRawNode(c),e=e!==!1;var f=c.getBoundingClientRect(),g={top:0,left:0,bottom:0,right:0},h=d?a[0].documentElement:this.scrollParent(c),i=h.getBoundingClientRect();if(g.top=i.top+h.clientTop,g.left=i.left+h.clientLeft,h===a[0].documentElement&&(g.top+=b.pageYOffset,g.left+=b.pageXOffset),g.bottom=g.top+h.clientHeight,g.right=g.left+h.clientWidth,e){var j=b.getComputedStyle(h);g.top+=this.parseStyle(j.paddingTop),g.bottom-=this.parseStyle(j.paddingBottom),g.left+=this.parseStyle(j.paddingLeft),g.right-=this.parseStyle(j.paddingRight)}return{top:Math.round(f.top-g.top),bottom:Math.round(g.bottom-f.bottom),left:Math.round(f.left-g.left),right:Math.round(g.right-f.right)}},parsePlacement:function(a){var b=f.auto.test(a);return b&&(a=a.replace(f.auto,"")),a=a.split("-"),a[0]=a[0]||"top",f.primary.test(a[0])||(a[0]="top"),a[1]=a[1]||"center",f.secondary.test(a[1])||(a[1]="center"),b?a[2]=!0:a[2]=!1,a},positionElements:function(a,c,d,e){a=this.getRawNode(a),c=this.getRawNode(c);var g=angular.isDefined(c.offsetWidth)?c.offsetWidth:c.prop("offsetWidth"),h=angular.isDefined(c.offsetHeight)?c.offsetHeight:c.prop("offsetHeight");d=this.parsePlacement(d);var i=e?this.offset(a):this.position(a),j={top:0,left:0,placement:""};if(d[2]){var k=this.viewportOffset(a,e),l=b.getComputedStyle(c),m={width:g+Math.round(Math.abs(this.parseStyle(l.marginLeft)+this.parseStyle(l.marginRight))),height:h+Math.round(Math.abs(this.parseStyle(l.marginTop)+this.parseStyle(l.marginBottom)))};if(d[0]="top"===d[0]&&m.height>k.top&&m.height<=k.bottom?"bottom":"bottom"===d[0]&&m.height>k.bottom&&m.height<=k.top?"top":"left"===d[0]&&m.width>k.left&&m.width<=k.right?"right":"right"===d[0]&&m.width>k.right&&m.width<=k.left?"left":d[0],d[1]="top"===d[1]&&m.height-i.height>k.bottom&&m.height-i.height<=k.top?"bottom":"bottom"===d[1]&&m.height-i.height>k.top&&m.height-i.height<=k.bottom?"top":"left"===d[1]&&m.width-i.width>k.right&&m.width-i.width<=k.left?"right":"right"===d[1]&&m.width-i.width>k.left&&m.width-i.width<=k.right?"left":d[1],"center"===d[1])if(f.vertical.test(d[0])){var n=i.width/2-g/2;k.left+n<0&&m.width-i.width<=k.right?d[1]="left":k.right+n<0&&m.width-i.width<=k.left&&(d[1]="right")}else{var o=i.height/2-m.height/2;k.top+o<0&&m.height-i.height<=k.bottom?d[1]="top":k.bottom+o<0&&m.height-i.height<=k.top&&(d[1]="bottom")}}switch(d[0]){case"top":j.top=i.top-h;break;case"bottom":j.top=i.top+i.height;break;case"left":j.left=i.left-g;break;case"right":j.left=i.left+i.width}switch(d[1]){case"top":j.top=i.top;break;case"bottom":j.top=i.top+i.height-h;break;case"left":j.left=i.left;break;case"right":j.left=i.left+i.width-g;break;case"center":f.vertical.test(d[0])?j.left=i.left+i.width/2-g/2:j.top=i.top+i.height/2-h/2}return j.top=Math.round(j.top),j.left=Math.round(j.left),j.placement="center"===d[1]?d[0]:d[0]+"-"+d[1],j},positionArrow:function(a,c){a=this.getRawNode(a);var d=a.querySelector(".tooltip-inner, .popover-inner");if(d){var e=angular.element(d).hasClass("tooltip-inner"),g=e?a.querySelector(".tooltip-arrow"):a.querySelector(".arrow");if(g){var h={top:"",bottom:"",left:"",right:""};if(c=this.parsePlacement(c),"center"===c[1])return void angular.element(g).css(h);var i="border-"+c[0]+"-width",j=b.getComputedStyle(g)[i],k="border-";k+=f.vertical.test(c[0])?c[0]+"-"+c[1]:c[1]+"-"+c[0],k+="-radius";var l=b.getComputedStyle(e?d:a)[k];switch(c[0]){case"top":h.bottom=e?"0":"-"+j;break;case"bottom":h.top=e?"0":"-"+j;break;case"left":h.right=e?"0":"-"+j;break;case"right":h.left=e?"0":"-"+j}h[c[1]]=l,angular.element(g).css(h)}}}}}]),angular.module("ui.bootstrap.datepickerPopup",["ui.bootstrap.datepicker","ui.bootstrap.position"]).value("$datepickerPopupLiteralWarning",!0).constant("uibDatepickerPopupConfig",{altInputFormats:[],appendToBody:!1,clearText:"Clear",closeOnDateSelection:!0,closeText:"Done",currentText:"Today",datepickerPopup:"yyyy-MM-dd",datepickerPopupTemplateUrl:"uib/template/datepickerPopup/popup.html",datepickerTemplateUrl:"uib/template/datepicker/datepicker.html",html5Types:{date:"yyyy-MM-dd","datetime-local":"yyyy-MM-ddTHH:mm:ss.sss",month:"yyyy-MM"},onOpenFocus:!0,showButtonBar:!0,placement:"auto bottom-left"}).controller("UibDatepickerPopupController",["$scope","$element","$attrs","$compile","$log","$parse","$window","$document","$rootScope","$uibPosition","dateFilter","uibDateParser","uibDatepickerPopupConfig","$timeout","uibDatepickerConfig","$datepickerPopupLiteralWarning",function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p){function q(b){var c=l.parse(b,w,a.date);if(isNaN(c))for(var d=0;d<I.length;d++)if(c=l.parse(b,I[d],a.date),!isNaN(c))return c;return c}function r(a){if(angular.isNumber(a)&&(a=new Date(a)),!a)return null;if(angular.isDate(a)&&!isNaN(a))return a;if(angular.isString(a)){var b=q(a);if(!isNaN(b))return l.toTimezone(b,J)}return F.$options&&F.$options.allowInvalid?a:void 0}function s(a,b){var d=a||b;return c.ngRequired||d?(angular.isNumber(d)&&(d=new Date(d)),d?angular.isDate(d)&&!isNaN(d)?!0:angular.isString(d)?!isNaN(q(b)):!1:!0):!0}function t(c){if(a.isOpen||!a.disabled){var d=H[0],e=b[0].contains(c.target),f=void 0!==d.contains&&d.contains(c.target);!a.isOpen||e||f||a.$apply(function(){a.isOpen=!1})}}function u(c){27===c.which&&a.isOpen?(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!1}),b[0].focus()):40!==c.which||a.isOpen||(c.preventDefault(),c.stopPropagation(),a.$apply(function(){a.isOpen=!0}))}function v(){if(a.isOpen){var d=angular.element(H[0].querySelector(".uib-datepicker-popup")),e=c.popupPlacement?c.popupPlacement:m.placement,f=j.positionElements(b,d,e,y);d.css({top:f.top+"px",left:f.left+"px"}),d.hasClass("uib-position-measure")&&d.removeClass("uib-position-measure")}}var w,x,y,z,A,B,C,D,E,F,G,H,I,J,K=!1,L=[];this.init=function(e){if(F=e,G=e.$options,x=angular.isDefined(c.closeOnDateSelection)?a.$parent.$eval(c.closeOnDateSelection):m.closeOnDateSelection,y=angular.isDefined(c.datepickerAppendToBody)?a.$parent.$eval(c.datepickerAppendToBody):m.appendToBody,z=angular.isDefined(c.onOpenFocus)?a.$parent.$eval(c.onOpenFocus):m.onOpenFocus,A=angular.isDefined(c.datepickerPopupTemplateUrl)?c.datepickerPopupTemplateUrl:m.datepickerPopupTemplateUrl,B=angular.isDefined(c.datepickerTemplateUrl)?c.datepickerTemplateUrl:m.datepickerTemplateUrl,I=angular.isDefined(c.altInputFormats)?a.$parent.$eval(c.altInputFormats):m.altInputFormats,a.showButtonBar=angular.isDefined(c.showButtonBar)?a.$parent.$eval(c.showButtonBar):m.showButtonBar,m.html5Types[c.type]?(w=m.html5Types[c.type],K=!0):(w=c.uibDatepickerPopup||m.datepickerPopup,c.$observe("uibDatepickerPopup",function(a,b){var c=a||m.datepickerPopup;if(c!==w&&(w=c,F.$modelValue=null,!w))throw new Error("uibDatepickerPopup must have a date format specified.")})),!w)throw new Error("uibDatepickerPopup must have a date format specified.");if(K&&c.uibDatepickerPopup)throw new Error("HTML5 date input types do not support custom formats.");C=angular.element("<div uib-datepicker-popup-wrap><div uib-datepicker></div></div>"),G?(J=G.timezone,a.ngModelOptions=angular.copy(G),a.ngModelOptions.timezone=null,a.ngModelOptions.updateOnDefault===!0&&(a.ngModelOptions.updateOn=a.ngModelOptions.updateOn?a.ngModelOptions.updateOn+" default":"default"),C.attr("ng-model-options","ngModelOptions")):J=null,C.attr({"ng-model":"date","ng-change":"dateSelection(date)","template-url":A}),D=angular.element(C.children()[0]),D.attr("template-url",B),a.datepickerOptions||(a.datepickerOptions={}),K&&"month"===c.type&&(a.datepickerOptions.datepickerMode="month",a.datepickerOptions.minMode="month"),D.attr("datepicker-options","datepickerOptions"),K?F.$formatters.push(function(b){return a.date=l.fromTimezone(b,J),b}):(F.$$parserName="date",F.$validators.date=s,F.$parsers.unshift(r),F.$formatters.push(function(b){return F.$isEmpty(b)?(a.date=b,b):(a.date=l.fromTimezone(b,J),angular.isNumber(a.date)&&(a.date=new Date(a.date)),l.filter(a.date,w))})),F.$viewChangeListeners.push(function(){a.date=q(F.$viewValue)}),b.on("keydown",u),H=d(C)(a),C.remove(),y?h.find("body").append(H):b.after(H),a.$on("$destroy",function(){for(a.isOpen===!0&&(i.$$phase||a.$apply(function(){a.isOpen=!1})),H.remove(),b.off("keydown",u),h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v);L.length;)L.shift()()})},a.getText=function(b){return a[b+"Text"]||m[b+"Text"]},a.isDisabled=function(b){"today"===b&&(b=l.fromTimezone(new Date,J));var c={};return angular.forEach(["minDate","maxDate"],function(b){a.datepickerOptions[b]?angular.isDate(a.datepickerOptions[b])?c[b]=l.fromTimezone(new Date(a.datepickerOptions[b]),J):(p&&e.warn("Literal date support has been deprecated, please switch to date object usage"),c[b]=new Date(k(a.datepickerOptions[b],"medium"))):c[b]=null}),a.datepickerOptions&&c.minDate&&a.compare(b,c.minDate)<0||c.maxDate&&a.compare(b,c.maxDate)>0},a.compare=function(a,b){return new Date(a.getFullYear(),a.getMonth(),a.getDate())-new Date(b.getFullYear(),b.getMonth(),b.getDate())},a.dateSelection=function(c){angular.isDefined(c)&&(a.date=c);var d=a.date?l.filter(a.date,w):null;b.val(d),F.$setViewValue(d),x&&(a.isOpen=!1,b[0].focus())},a.keydown=function(c){27===c.which&&(c.stopPropagation(),a.isOpen=!1,b[0].focus())},a.select=function(b,c){if(c.stopPropagation(),"today"===b){var d=new Date;angular.isDate(a.date)?(b=new Date(a.date),b.setFullYear(d.getFullYear(),d.getMonth(),d.getDate())):b=new Date(d.setHours(0,0,0,0))}a.dateSelection(b)},a.close=function(c){c.stopPropagation(),a.isOpen=!1,b[0].focus()},a.disabled=angular.isDefined(c.disabled)||!1,c.ngDisabled&&L.push(a.$parent.$watch(f(c.ngDisabled),function(b){a.disabled=b})),a.$watch("isOpen",function(d){d?a.disabled?a.isOpen=!1:n(function(){v(),z&&a.$broadcast("uib:datepicker.focus"),h.on("click",t);var d=c.popupPlacement?c.popupPlacement:m.placement;y||j.parsePlacement(d)[2]?(E=E||angular.element(j.scrollParent(b)),E&&E.on("scroll",v)):E=null,angular.element(g).on("resize",v)},0,!1):(h.off("click",t),E&&E.off("scroll",v),angular.element(g).off("resize",v))}),a.$on("uib:datepicker.mode",function(){n(v,0,!1)})}]).directive("uibDatepickerPopup",function(){return{require:["ngModel","uibDatepickerPopup"],controller:"UibDatepickerPopupController",scope:{datepickerOptions:"=?",isOpen:"=?",currentText:"@",clearText:"@",closeText:"@"},link:function(a,b,c,d){var e=d[0],f=d[1];f.init(e)}}}).directive("uibDatepickerPopupWrap",function(){return{replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/datepickerPopup/popup.html"}}}),angular.module("ui.bootstrap.debounce",[]).factory("$$debounce",["$timeout",function(a){return function(b,c){var d;return function(){var e=this,f=Array.prototype.slice.call(arguments);d&&a.cancel(d),d=a(function(){b.apply(e,f)},c)}}}]),angular.module("ui.bootstrap.dropdown",["ui.bootstrap.position"]).constant("uibDropdownConfig",{appendToOpenClass:"uib-dropdown-open",openClass:"open"}).service("uibDropdownService",["$document","$rootScope",function(a,b){var c=null;this.open=function(b,f){c||(a.on("click",d),f.on("keydown",e)),c&&c!==b&&(c.isOpen=!1),c=b},this.close=function(b,f){c===b&&(c=null,a.off("click",d),f.off("keydown",e))};var d=function(a){if(c&&!(a&&"disabled"===c.getAutoClose()||a&&3===a.which)){var d=c.getToggleElement();if(!(a&&d&&d[0].contains(a.target))){var e=c.getDropdownElement();a&&"outsideClick"===c.getAutoClose()&&e&&e[0].contains(a.target)||(c.isOpen=!1,b.$$phase||c.$apply())}}},e=function(a){27===a.which?(a.stopPropagation(),c.focusToggleElement(),d()):c.isKeynavEnabled()&&-1!==[38,40].indexOf(a.which)&&c.isOpen&&(a.preventDefault(),a.stopPropagation(),c.focusDropdownEntry(a.which))}}]).controller("UibDropdownController",["$scope","$element","$attrs","$parse","uibDropdownConfig","uibDropdownService","$animate","$uibPosition","$document","$compile","$templateRequest",function(a,b,c,d,e,f,g,h,i,j,k){var l,m,n=this,o=a.$new(),p=e.appendToOpenClass,q=e.openClass,r=angular.noop,s=c.onToggle?d(c.onToggle):angular.noop,t=!1,u=null,v=!1,w=i.find("body");b.addClass("dropdown"),this.init=function(){if(c.isOpen&&(m=d(c.isOpen),r=m.assign,a.$watch(m,function(a){o.isOpen=!!a})),angular.isDefined(c.dropdownAppendTo)){var e=d(c.dropdownAppendTo)(o);e&&(u=angular.element(e))}t=angular.isDefined(c.dropdownAppendToBody),v=angular.isDefined(c.keyboardNav),t&&!u&&(u=w),u&&n.dropdownMenu&&(u.append(n.dropdownMenu),b.on("$destroy",function(){n.dropdownMenu.remove()}))},this.toggle=function(a){return o.isOpen=arguments.length?!!a:!o.isOpen,angular.isFunction(r)&&r(o,o.isOpen),o.isOpen},this.isOpen=function(){return o.isOpen},o.getToggleElement=function(){return n.toggleElement},o.getAutoClose=function(){return c.autoClose||"always"},o.getElement=function(){return b},o.isKeynavEnabled=function(){return v},o.focusDropdownEntry=function(a){var c=n.dropdownMenu?angular.element(n.dropdownMenu).find("a"):b.find("ul").eq(0).find("a");switch(a){case 40:angular.isNumber(n.selectedOption)?n.selectedOption=n.selectedOption===c.length-1?n.selectedOption:n.selectedOption+1:n.selectedOption=0;break;case 38:angular.isNumber(n.selectedOption)?n.selectedOption=0===n.selectedOption?0:n.selectedOption-1:n.selectedOption=c.length-1}c[n.selectedOption].focus()},o.getDropdownElement=function(){return n.dropdownMenu},o.focusToggleElement=function(){n.toggleElement&&n.toggleElement[0].focus()},o.$watch("isOpen",function(c,d){if(u&&n.dropdownMenu){var e,i,m=h.positionElements(b,n.dropdownMenu,"bottom-left",!0);if(e={top:m.top+"px",display:c?"block":"none"},i=n.dropdownMenu.hasClass("dropdown-menu-right"),i?(e.left="auto",e.right=window.innerWidth-(m.left+b.prop("offsetWidth"))+"px"):(e.left=m.left+"px",e.right="auto"),!t){var v=h.offset(u);e.top=m.top-v.top+"px",i?e.right=window.innerWidth-(m.left-v.left+b.prop("offsetWidth"))+"px":e.left=m.left-v.left+"px"}n.dropdownMenu.css(e)}var w=u?u:b,x=w.hasClass(u?p:q);if(x===!c&&g[c?"addClass":"removeClass"](w,u?p:q).then(function(){angular.isDefined(c)&&c!==d&&s(a,{open:!!c})}),c)n.dropdownMenuTemplateUrl&&k(n.dropdownMenuTemplateUrl).then(function(a){l=o.$new(),j(a.trim())(l,function(a){var b=a;n.dropdownMenu.replaceWith(b),n.dropdownMenu=b})}),o.focusToggleElement(),f.open(o,b);else{if(n.dropdownMenuTemplateUrl){l&&l.$destroy();var y=angular.element('<ul class="dropdown-menu"></ul>');n.dropdownMenu.replaceWith(y),n.dropdownMenu=y}f.close(o,b),n.selectedOption=null}angular.isFunction(r)&&r(a,c)})}]).directive("uibDropdown",function(){return{controller:"UibDropdownController",link:function(a,b,c,d){d.init()}}}).directive("uibDropdownMenu",function(){return{restrict:"A",require:"?^uibDropdown",link:function(a,b,c,d){if(d&&!angular.isDefined(c.dropdownNested)){b.addClass("dropdown-menu");var e=c.templateUrl;e&&(d.dropdownMenuTemplateUrl=e),d.dropdownMenu||(d.dropdownMenu=b)}}}}).directive("uibDropdownToggle",function(){return{require:"?^uibDropdown",link:function(a,b,c,d){if(d){b.addClass("dropdown-toggle"),d.toggleElement=b;var e=function(e){e.preventDefault(),b.hasClass("disabled")||c.disabled||a.$apply(function(){d.toggle()})};b.bind("click",e),b.attr({"aria-haspopup":!0,"aria-expanded":!1}),a.$watch(d.isOpen,function(a){b.attr("aria-expanded",!!a)}),a.$on("$destroy",function(){b.unbind("click",e)})}}}}),angular.module("ui.bootstrap.stackedMap",[]).factory("$$stackedMap",function(){return{createNew:function(){var a=[];return{add:function(b,c){a.push({key:b,value:c})},get:function(b){for(var c=0;c<a.length;c++)if(b===a[c].key)return a[c]},keys:function(){for(var b=[],c=0;c<a.length;c++)b.push(a[c].key);return b},top:function(){return a[a.length-1]},remove:function(b){for(var c=-1,d=0;d<a.length;d++)if(b===a[d].key){c=d;break}return a.splice(c,1)[0]},removeTop:function(){return a.splice(a.length-1,1)[0]},length:function(){return a.length}}}}}),angular.module("ui.bootstrap.modal",["ui.bootstrap.stackedMap","ui.bootstrap.position"]).factory("$$multiMap",function(){return{createNew:function(){var a={};return{entries:function(){return Object.keys(a).map(function(b){return{key:b,value:a[b]}})},get:function(b){return a[b]},hasKey:function(b){return!!a[b]},keys:function(){return Object.keys(a)},put:function(b,c){a[b]||(a[b]=[]),a[b].push(c)},remove:function(b,c){var d=a[b];if(d){var e=d.indexOf(c);-1!==e&&d.splice(e,1),d.length||delete a[b]}}}}}}).provider("$uibResolve",function(){var a=this;this.resolver=null,this.setResolver=function(a){this.resolver=a},this.$get=["$injector","$q",function(b,c){var d=a.resolver?b.get(a.resolver):null;return{resolve:function(a,e,f,g){if(d)return d.resolve(a,e,f,g);var h=[];return angular.forEach(a,function(a){angular.isFunction(a)||angular.isArray(a)?h.push(c.resolve(b.invoke(a))):angular.isString(a)?h.push(c.resolve(b.get(a))):h.push(c.resolve(a))}),c.all(h).then(function(b){var c={},d=0;return angular.forEach(a,function(a,e){c[e]=b[d++]}),c})}}}]}).directive("uibModalBackdrop",["$animate","$injector","$uibModalStack",function(a,b,c){function d(b,d,e){e.modalInClass&&(a.addClass(d,e.modalInClass),b.$on(c.NOW_CLOSING_EVENT,function(c,f){var g=f();b.modalOptions.animation?a.removeClass(d,e.modalInClass).then(g):g()}))}return{replace:!0,templateUrl:"uib/template/modal/backdrop.html",compile:function(a,b){return a.addClass(b.backdropClass),d}}}]).directive("uibModalWindow",["$uibModalStack","$q","$animateCss","$document",function(a,b,c,d){return{scope:{index:"@"},replace:!0,transclude:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/modal/window.html"},link:function(e,f,g){f.addClass(g.windowClass||""),f.addClass(g.windowTopClass||""),e.size=g.size,e.close=function(b){var c=a.getTop();c&&c.value.backdrop&&"static"!==c.value.backdrop&&b.target===b.currentTarget&&(b.preventDefault(),b.stopPropagation(),a.dismiss(c.key,"backdrop click"))},f.on("click",e.close),e.$isRendered=!0;var h=b.defer();g.$observe("modalRender",function(a){"true"===a&&h.resolve()}),h.promise.then(function(){var h=null;g.modalInClass&&(h=c(f,{addClass:g.modalInClass}).start(),e.$on(a.NOW_CLOSING_EVENT,function(a,b){var d=b();c(f,{removeClass:g.modalInClass}).start().then(d)})),b.when(h).then(function(){var b=a.getTop();if(b&&a.modalRendered(b.key),!d[0].activeElement||!f[0].contains(d[0].activeElement)){var c=f[0].querySelector("[autofocus]");c?c.focus():f[0].focus()}})})}}}]).directive("uibModalAnimationClass",function(){return{compile:function(a,b){b.modalAnimation&&a.addClass(b.uibModalAnimationClass)}}}).directive("uibModalTransclude",function(){return{link:function(a,b,c,d,e){e(a.$parent,function(a){b.empty(),b.append(a)})}}}).factory("$uibModalStack",["$animate","$animateCss","$document","$compile","$rootScope","$q","$$multiMap","$$stackedMap","$uibPosition",function(a,b,c,d,e,f,g,h,i){function j(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)}function k(){for(var a=-1,b=v.keys(),c=0;c<b.length;c++)v.get(b[c]).value.backdrop&&(a=c);return a>-1&&y>a&&(a=y),a}function l(a,b){var c=v.get(a).value,d=c.appendTo;v.remove(a),z=v.top(),z&&(y=parseInt(z.value.modalDomEl.attr("index"),10)),o(c.modalDomEl,c.modalScope,function(){var b=c.openedClass||u;w.remove(b,a);var e=w.hasKey(b);d.toggleClass(b,e),!e&&t&&t.heightOverflow&&t.scrollbarWidth&&(t.originalRight?d.css({paddingRight:t.originalRight+"px"}):d.css({paddingRight:""}),t=null),m(!0)},c.closedDeferred),n(),b&&b.focus?b.focus():d.focus&&d.focus()}function m(a){var b;v.length()>0&&(b=v.top().value,b.modalDomEl.toggleClass(b.windowTopClass||"",a))}function n(){if(r&&-1===k()){var a=s;o(r,s,function(){a=null}),r=void 0,s=void 0}}function o(b,c,d,e){function g(){g.done||(g.done=!0,a.leave(b).then(function(){b.remove(),e&&e.resolve()}),c.$destroy(),d&&d())}var h,i=null,j=function(){return h||(h=f.defer(),i=h.promise),function(){h.resolve()}};return c.$broadcast(x.NOW_CLOSING_EVENT,j),f.when(i).then(g)}function p(a){if(a.isDefaultPrevented())return a;var b=v.top();if(b)switch(a.which){case 27:b.value.keyboard&&(a.preventDefault(),e.$apply(function(){x.dismiss(b.key,"escape key press")}));break;case 9:var c=x.loadFocusElementList(b),d=!1;a.shiftKey?(x.isFocusInFirstItem(a,c)||x.isModalFocused(a,b))&&(d=x.focusLastFocusableElement(c)):x.isFocusInLastItem(a,c)&&(d=x.focusFirstFocusableElement(c)),d&&(a.preventDefault(),a.stopPropagation())}}function q(a,b,c){return!a.value.modalScope.$broadcast("modal.closing",b,c).defaultPrevented}var r,s,t,u="modal-open",v=h.createNew(),w=g.createNew(),x={NOW_CLOSING_EVENT:"modal.stack.now-closing"},y=0,z=null,A="a[href], area[href], input:not([disabled]), button:not([disabled]),select:not([disabled]), textarea:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable=true]";return e.$watch(k,function(a){s&&(s.index=a)}),c.on("keydown",p),e.$on("$destroy",function(){c.off("keydown",p)}),x.open=function(b,f){var g=c[0].activeElement,h=f.openedClass||u;m(!1),z=v.top(),v.add(b,{deferred:f.deferred,renderDeferred:f.renderDeferred,closedDeferred:f.closedDeferred,modalScope:f.scope,backdrop:f.backdrop,keyboard:f.keyboard,openedClass:f.openedClass,windowTopClass:f.windowTopClass,animation:f.animation,appendTo:f.appendTo}),w.put(h,b);var j=f.appendTo,l=k();if(!j.length)throw new Error("appendTo element not found. Make sure that the element passed is in DOM.");l>=0&&!r&&(s=e.$new(!0),s.modalOptions=f,s.index=l,r=angular.element('<div uib-modal-backdrop="modal-backdrop"></div>'),r.attr("backdrop-class",f.backdropClass),f.animation&&r.attr("modal-animation","true"),d(r)(s),a.enter(r,j),t=i.scrollbarPadding(j),t.heightOverflow&&t.scrollbarWidth&&j.css({paddingRight:t.right+"px"})),y=z?parseInt(z.value.modalDomEl.attr("index"),10)+1:0;var n=angular.element('<div uib-modal-window="modal-window"></div>');n.attr({"template-url":f.windowTemplateUrl,"window-class":f.windowClass,"window-top-class":f.windowTopClass,size:f.size,index:y,animate:"animate"}).html(f.content),f.animation&&n.attr("modal-animation","true"),j.addClass(h),a.enter(d(n)(f.scope),j),v.top().value.modalDomEl=n,v.top().value.modalOpener=g},x.close=function(a,b){var c=v.get(a);return c&&q(c,b,!0)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.resolve(b),l(a,c.value.modalOpener),!0):!c},x.dismiss=function(a,b){var c=v.get(a);return c&&q(c,b,!1)?(c.value.modalScope.$$uibDestructionScheduled=!0,c.value.deferred.reject(b),l(a,c.value.modalOpener),!0):!c},x.dismissAll=function(a){for(var b=this.getTop();b&&this.dismiss(b.key,a);)b=this.getTop()},x.getTop=function(){return v.top()},x.modalRendered=function(a){var b=v.get(a);b&&b.value.renderDeferred.resolve()},x.focusFirstFocusableElement=function(a){return a.length>0?(a[0].focus(),!0):!1},x.focusLastFocusableElement=function(a){return a.length>0?(a[a.length-1].focus(),!0):!1},x.isModalFocused=function(a,b){if(a&&b){var c=b.value.modalDomEl;if(c&&c.length)return(a.target||a.srcElement)===c[0]}return!1},x.isFocusInFirstItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[0]:!1},x.isFocusInLastItem=function(a,b){return b.length>0?(a.target||a.srcElement)===b[b.length-1]:!1},x.loadFocusElementList=function(a){if(a){var b=a.value.modalDomEl;if(b&&b.length){var c=b[0].querySelectorAll(A);return c?Array.prototype.filter.call(c,function(a){return j(a)}):c}}},x}]).provider("$uibModal",function(){var a={options:{animation:!0,backdrop:!0,keyboard:!0},$get:["$rootScope","$q","$document","$templateRequest","$controller","$uibResolve","$uibModalStack",function(b,c,d,e,f,g,h){function i(a){return a.template?c.when(a.template):e(angular.isFunction(a.templateUrl)?a.templateUrl():a.templateUrl)}var j={},k=null;return j.getPromiseChain=function(){return k},j.open=function(e){function j(){return r}var l=c.defer(),m=c.defer(),n=c.defer(),o=c.defer(),p={result:l.promise,opened:m.promise,closed:n.promise,rendered:o.promise,close:function(a){return h.close(p,a)},dismiss:function(a){return h.dismiss(p,a)}};if(e=angular.extend({},a.options,e),e.resolve=e.resolve||{},e.appendTo=e.appendTo||d.find("body").eq(0),!e.template&&!e.templateUrl)throw new Error("One of template or templateUrl options is required.");var q,r=c.all([i(e),g.resolve(e.resolve,{},null,null)]);return q=k=c.all([k]).then(j,j).then(function(a){var c=e.scope||b,d=c.$new();d.$close=p.close,d.$dismiss=p.dismiss,d.$on("$destroy",function(){d.$$uibDestructionScheduled||d.$dismiss("$uibUnscheduledDestruction")});var g,i,j={};e.controller&&(j.$scope=d,j.$uibModalInstance=p,angular.forEach(a[1],function(a,b){j[b]=a}),i=f(e.controller,j,!0),e.controllerAs?(g=i.instance,e.bindToController&&(g.$close=d.$close,g.$dismiss=d.$dismiss,angular.extend(g,c)),g=i(),d[e.controllerAs]=g):g=i(),angular.isFunction(g.$onInit)&&g.$onInit()),h.open(p,{scope:d,deferred:l,renderDeferred:o,closedDeferred:n,content:a[0],animation:e.animation,backdrop:e.backdrop,keyboard:e.keyboard,backdropClass:e.backdropClass,windowTopClass:e.windowTopClass,windowClass:e.windowClass,windowTemplateUrl:e.windowTemplateUrl,size:e.size,openedClass:e.openedClass,appendTo:e.appendTo}),m.resolve(!0)},function(a){m.reject(a),l.reject(a)})["finally"](function(){k===q&&(k=null)}),p},j}]};return a}),angular.module("ui.bootstrap.paging",[]).factory("uibPaging",["$parse",function(a){return{create:function(b,c,d){b.setNumPages=d.numPages?a(d.numPages).assign:angular.noop,b.ngModelCtrl={$setViewValue:angular.noop},b._watchers=[],b.init=function(a,e){b.ngModelCtrl=a,b.config=e,a.$render=function(){b.render()},d.itemsPerPage?b._watchers.push(c.$parent.$watch(d.itemsPerPage,function(a){b.itemsPerPage=parseInt(a,10),c.totalPages=b.calculateTotalPages(),b.updatePage()})):b.itemsPerPage=e.itemsPerPage,c.$watch("totalItems",function(a,d){(angular.isDefined(a)||a!==d)&&(c.totalPages=b.calculateTotalPages(),b.updatePage())})},b.calculateTotalPages=function(){var a=b.itemsPerPage<1?1:Math.ceil(c.totalItems/b.itemsPerPage);return Math.max(a||0,1)},b.render=function(){c.page=parseInt(b.ngModelCtrl.$viewValue,10)||1},c.selectPage=function(a,d){d&&d.preventDefault();var e=!c.ngDisabled||!d;e&&c.page!==a&&a>0&&a<=c.totalPages&&(d&&d.target&&d.target.blur(),b.ngModelCtrl.$setViewValue(a),b.ngModelCtrl.$render())},c.getText=function(a){return c[a+"Text"]||b.config[a+"Text"]},c.noPrevious=function(){return 1===c.page},c.noNext=function(){return c.page===c.totalPages},b.updatePage=function(){b.setNumPages(c.$parent,c.totalPages),c.page>c.totalPages?c.selectPage(c.totalPages):b.ngModelCtrl.$render()},c.$on("$destroy",function(){for(;b._watchers.length;)b._watchers.shift()()})}}}]),angular.module("ui.bootstrap.pager",["ui.bootstrap.paging"]).controller("UibPagerController",["$scope","$attrs","uibPaging","uibPagerConfig",function(a,b,c,d){a.align=angular.isDefined(b.align)?a.$parent.$eval(b.align):d.align,c.create(this,a,b)}]).constant("uibPagerConfig",{itemsPerPage:10,previousText:"« Previous",nextText:"Next »",align:!0}).directive("uibPager",["uibPagerConfig",function(a){return{scope:{totalItems:"=",previousText:"@",nextText:"@",ngDisabled:"="},require:["uibPager","?ngModel"],controller:"UibPagerController",controllerAs:"pager",templateUrl:function(a,b){return b.templateUrl||"uib/template/pager/pager.html"},replace:!0,link:function(b,c,d,e){var f=e[0],g=e[1];g&&f.init(g,a)}}}]),angular.module("ui.bootstrap.pagination",["ui.bootstrap.paging"]).controller("UibPaginationController",["$scope","$attrs","$parse","uibPaging","uibPaginationConfig",function(a,b,c,d,e){function f(a,b,c){return{number:a,text:b,active:c}}function g(a,b){var c=[],d=1,e=b,g=angular.isDefined(i)&&b>i;g&&(j?(d=Math.max(a-Math.floor(i/2),1),e=d+i-1,e>b&&(e=b,d=e-i+1)):(d=(Math.ceil(a/i)-1)*i+1,e=Math.min(d+i-1,b)));for(var h=d;e>=h;h++){var n=f(h,m(h),h===a);c.push(n)}if(g&&i>0&&(!j||k||l)){if(d>1){if(!l||d>3){var o=f(d-1,"...",!1);c.unshift(o)}if(l){if(3===d){var p=f(2,"2",!1);c.unshift(p)}var q=f(1,"1",!1);c.unshift(q)}}if(b>e){if(!l||b-2>e){var r=f(e+1,"...",!1);c.push(r)}if(l){if(e===b-2){var s=f(b-1,b-1,!1);c.push(s)}var t=f(b,b,!1);c.push(t)}}}return c}var h=this,i=angular.isDefined(b.maxSize)?a.$parent.$eval(b.maxSize):e.maxSize,j=angular.isDefined(b.rotate)?a.$parent.$eval(b.rotate):e.rotate,k=angular.isDefined(b.forceEllipses)?a.$parent.$eval(b.forceEllipses):e.forceEllipses,l=angular.isDefined(b.boundaryLinkNumbers)?a.$parent.$eval(b.boundaryLinkNumbers):e.boundaryLinkNumbers,m=angular.isDefined(b.pageLabel)?function(c){return a.$parent.$eval(b.pageLabel,{$page:c})}:angular.identity;a.boundaryLinks=angular.isDefined(b.boundaryLinks)?a.$parent.$eval(b.boundaryLinks):e.boundaryLinks,a.directionLinks=angular.isDefined(b.directionLinks)?a.$parent.$eval(b.directionLinks):e.directionLinks,d.create(this,a,b),b.maxSize&&h._watchers.push(a.$parent.$watch(c(b.maxSize),function(a){i=parseInt(a,10),h.render()}));var n=this.render;this.render=function(){n(),a.page>0&&a.page<=a.totalPages&&(a.pages=g(a.page,a.totalPages))}}]).constant("uibPaginationConfig",{itemsPerPage:10,boundaryLinks:!1,boundaryLinkNumbers:!1,directionLinks:!0,firstText:"First",previousText:"Previous",nextText:"Next",lastText:"Last",rotate:!0,forceEllipses:!1}).directive("uibPagination",["$parse","uibPaginationConfig",function(a,b){return{scope:{totalItems:"=",firstText:"@",previousText:"@",nextText:"@",lastText:"@",ngDisabled:"="},require:["uibPagination","?ngModel"],controller:"UibPaginationController",controllerAs:"pagination",templateUrl:function(a,b){return b.templateUrl||"uib/template/pagination/pagination.html"},replace:!0,link:function(a,c,d,e){var f=e[0],g=e[1];g&&f.init(g,b)}}}]),angular.module("ui.bootstrap.tooltip",["ui.bootstrap.position","ui.bootstrap.stackedMap"]).provider("$uibTooltip",function(){function a(a){var b=/[A-Z]/g,c="-";return a.replace(b,function(a,b){return(b?c:"")+a.toLowerCase()})}var b={placement:"top",placementClassPrefix:"",animation:!0,popupDelay:0,popupCloseDelay:0,useContentExp:!1},c={mouseenter:"mouseleave",click:"click",outsideClick:"outsideClick",focus:"blur",none:""},d={};this.options=function(a){angular.extend(d,a)},this.setTriggers=function(a){angular.extend(c,a)},this.$get=["$window","$compile","$timeout","$document","$uibPosition","$interpolate","$rootScope","$parse","$$stackedMap",function(e,f,g,h,i,j,k,l,m){function n(a){if(27===a.which){var b=o.top();b&&(b.value.close(),o.removeTop(),b=null)}}var o=m.createNew();return h.on("keypress",n),k.$on("$destroy",function(){h.off("keypress",n)}),function(e,k,m,n){function p(a){var b=(a||n.trigger||m).split(" "),d=b.map(function(a){return c[a]||a});return{show:b,hide:d}}n=angular.extend({},b,d,n);var q=a(e),r=j.startSymbol(),s=j.endSymbol(),t="<div "+q+'-popup uib-title="'+r+"title"+s+'" '+(n.useContentExp?'content-exp="contentExp()" ':'content="'+r+"content"+s+'" ')+'placement="'+r+"placement"+s+'" popup-class="'+r+"popupClass"+s+'" animation="animation" is-open="isOpen" origin-scope="origScope" class="uib-position-measure"></div>';
1767 return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement,N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;b<d.tabs.length;b++)if(d.tabs[b].index===a)return b}var c,d=this;d.tabs=[],d.select=function(a,f){if(!e){var g=b(c),h=d.tabs[g];if(h){if(h.tab.onDeselect({$event:f}),f&&f.isDefaultPrevented())return;h.tab.active=!1}var i=d.tabs[a];i?(i.tab.onSelect({$event:f}),i.tab.active=!0,d.active=i.index,c=i.index):!i&&angular.isNumber(c)&&(d.active=null,c=null)}},d.addTab=function(a){if(d.tabs.push({tab:a,index:a.index}),d.tabs.sort(function(a,b){return a.index>b.index?1:a.index<b.index?-1:0}),a.index===d.active||!angular.isNumber(d.active)&&1===d.tabs.length){var c=b(a.index);d.select(c)}},d.removeTab=function(a){for(var b,c=0;c<d.tabs.length;c++)if(d.tabs[c].tab===a){b=c;break}if(d.tabs[b].index===d.active){var e=b===d.tabs.length-1?b-1:b+1%d.tabs.length;d.select(e)}d.tabs.splice(b,1)},a.$watch("tabset.active",function(a){angular.isNumber(a)&&a!==c&&d.select(b(a))});var e;a.$on("$destroy",function(){e=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tabset.html"},link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1,angular.isUndefined(c.active)&&(a.active=0)}}}).directive("uibTab",["$parse",function(a){return{require:"^uibTabset",replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(b,c,d,e,f){b.disabled=!1,d.disable&&b.$parent.$watch(a(d.disable),function(a){b.disabled=!!a}),angular.isUndefined(d.index)&&(e.tabs&&e.tabs.length?b.index=Math.max.apply(null,e.tabs.map(function(a){return a.index}))+1:b.index=0),angular.isUndefined(d.classes)&&(b.classes=""),b.select=function(a){if(!b.disabled){for(var c,d=0;d<e.tabs.length;d++)if(e.tabs[d].tab===b){c=d;break}e.select(c,a)}},e.addTab(b),b.$on("$destroy",function(){e.removeTab(b)}),b.$transcludeFn=f}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("uibTabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("uib-tab-heading")||a.hasAttribute("data-uib-tab-heading")||a.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===a.tagName.toLowerCase()||"data-uib-tab-heading"===a.tagName.toLowerCase()||"x-uib-tab-heading"===a.tagName.toLowerCase()||"uib:tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(b,c,d){var e=b.$eval(d.uibTabContentTransclude).tab;e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(a,b,c,d,e,f,g){function h(){var b=+a.hours,c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)<z};var C=g.secondStep;c.secondStep&&t.push(a.$parent.$watch(d(c.secondStep),function(a){C=+a})),a.showSeconds=g.showSeconds,c.showSeconds&&t.push(a.$parent.$watch(d(c.showSeconds),function(b){a.showSeconds=!!b})),a.showMeridian=g.showMeridian,c.showMeridian&&t.push(a.$parent.$watch(d(c.showMeridian),function(b){if(a.showMeridian=!!b,u.$error.time){var c=h(),d=i();angular.isDefined(c)&&angular.isDefined(d)&&(s.setHours(c),l())}else n()})),this.setupMousewheelEvents=function(b,c,d){var e=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){N.moveInProgress||(N.moveInProgress=!0,N.$digest()),Y()}function o(){N.position=D?l.offset(b):l.position(b),N.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=e(c.typeaheadOnSelect),A=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,B=e(c.typeaheadNoResults).assign||angular.noop,C=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,D=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,E=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,F=a.$eval(c.typeaheadFocusFirst)!==!1,G=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,H=e(c.typeaheadIsOpen).assign||angular.noop,I=a.$eval(c.typeaheadShowHint)||!1,J=e(c.ngModel),K=e(c.ngModel+"($$$p)"),L=function(b,c){return angular.isFunction(J(a))&&q&&q.$options&&q.$options.getterSetter?K(b,{$$$p:c}):J.assign(b,c)},M=m.parse(c.uibTypeahead),N=a.$new(),O=a.$on("$destroy",function(){N.$destroy()});N.$on("$destroy",O);var P="typeahead-"+N.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":P});var Q,R;I&&(Q=angular.element("<div></div>"),Q.css("position","relative"),b.after(Q),R=b.clone(),R.attr("placeholder",""),R.attr("tabindex","-1"),R.val(""),R.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),Q.append(R),R.after(b));var S=angular.element("<div uib-typeahead-popup></div>");S.attr({id:P,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&S.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&S.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var T=function(){I&&R.val("")},U=function(){N.matches=[],N.activeIdx=-1,b.attr("aria-expanded",!1),T()},V=function(a){return P+"-option-"+a};N.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",V(a))});var W=function(a,b){return N.matches.length>b&&a?a.toUpperCase()===N.matches[b].label.toUpperCase():!1},X=function(c,d){var e={$viewValue:c};y(a,!0),B(a,!1),f.when(M.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){N.activeIdx=F?0:-1,B(a,!1),N.matches.length=0;for(var h=0;h<f.length;h++)e[M.itemName]=f[h],N.matches.push({id:V(h),label:M.viewMapper(N,e),model:f[h]});if(N.query=c,o(),b.attr("aria-expanded",!0),G&&1===N.matches.length&&W(c,0)&&(angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(0,d)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(0,d)),I){var i=N.matches[0].label;angular.isString(c)&&c.length>0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?R.val(c+i.slice(c.length)):R.val("")}}else U(),B(a,!0);g&&y(a,!1)},function(){U(),y(a,!1),B(a,!0)})};D&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Y=k(function(){N.matches.length&&o(),N.moveInProgress=!1},s);N.moveInProgress=!1,N.query=void 0;var Z,$=function(a){Z=g(function(){X(a)},u)},_=function(){Z&&g.cancel(Z)};U(),N.assignIsOpen=function(b){H(a,b)},N.select=function(d,e){var f,h,i={};x=!0,i[M.itemName]=h=N.matches[d].model,f=M.modelMapper(a,i),L(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),z(a,{$item:h,$model:f,$label:M.viewMapper(a,i),$event:e}),U(),N.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==N.matches.length&&-1!==r.indexOf(b.which)){if(-1===N.activeIdx&&(9===b.which||13===b.which)||9===b.which&&b.shiftKey)return U(),void N.$digest();b.preventDefault();var c;switch(b.which){case 9:case 13:N.$apply(function(){angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(N.activeIdx,b)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(N.activeIdx,b)});break;case 27:b.stopPropagation(),U(),a.$digest();break;case 38:N.activeIdx=(N.activeIdx>0?N.activeIdx:N.matches.length)-1,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop;break;case 40:N.activeIdx=(N.activeIdx+1)%N.matches.length,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){X(p.$viewValue,a)},0)}),b.bind("blur",function(a){A&&N.matches.length&&-1!==N.activeIdx&&!x&&(x=!0,N.$apply(function(){angular.isObject(N.debounceUpdate)&&angular.isNumber(N.debounceUpdate.blur)?k(function(){N.select(N.activeIdx,a)},N.debounceUpdate.blur):N.select(N.activeIdx,a)})),!v&&p.$error.editable&&(p.$setViewValue(),p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var aa=function(c){b[0]!==c.target&&3!==c.which&&0!==N.matches.length&&(U(),j.$$phase||a.$digest())};h.on("click",aa),a.$on("$destroy",function(){h.off("click",aa),(D||E)&&ba.remove(),D&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),S.remove(),I&&Q.remove()});var ba=d(S)(N);D?h.find("body").append(ba):E?angular.element(E).eq(0).append(ba):b.after(ba),this.init=function(b,c){p=b,q=c,N.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(_(),$(b)):X(b):(y(a,!1),_(),U()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),C?(e.$model=b,C(a,e)):(e[M.itemName]=b,c=M.viewMapper(a,e),e[M.itemName]=void 0,d=M.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion-group.html",'<div class="panel" ng-class="panelClass || \'panel-default\'">\n <div role="tab" id="{{::headingId}}" aria-selected="{{isOpen}}" class="panel-heading" ng-keypress="toggleOpen($event)">\n <h4 class="panel-title">\n <a role="button" data-toggle="collapse" href aria-expanded="{{isOpen}}" aria-controls="{{::panelId}}" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span uib-accordion-header ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div id="{{::panelId}}" aria-labelledby="{{::headingId}}" aria-hidden="{{!isOpen}}" role="tabpanel" class="panel-collapse collapse" uib-collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion.html",'<div role="tablist" class="panel-group" ng-transclude></div>')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("uib/template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissible\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close({$event: $event})">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <div class="carousel-inner" ng-transclude></div>\n <a role="button" href class="left carousel-control" ng-click="prev()" ng-class="{ disabled: isPrevDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span>\n <span class="sr-only">previous</span>\n </a>\n <a role="button" href class="right carousel-control" ng-click="next()" ng-class="{ disabled: isNextDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span>\n <span class="sr-only">next</span>\n </a>\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:indexOfSlide track by $index" ng-class="{ active: isActive(slide) }" ng-click="select(slide)">\n <span class="sr-only">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if="isActive(slide)">, currently active</span></span>\n </li>\n </ol>\n</div>\n');
1767 return{compile:function(a,b){var c=f(t);return function(a,b,d,f){function j(){N.isOpen?q():m()}function m(){M&&!a.$eval(d[k+"Enable"])||(u(),x(),N.popupDelay?G||(G=g(r,N.popupDelay,!1)):r())}function q(){s(),N.popupCloseDelay?H||(H=g(t,N.popupCloseDelay,!1)):t()}function r(){return s(),u(),N.content?(v(),void N.$evalAsync(function(){N.isOpen=!0,y(!0),S()})):angular.noop}function s(){G&&(g.cancel(G),G=null),I&&(g.cancel(I),I=null)}function t(){N&&N.$evalAsync(function(){N&&(N.isOpen=!1,y(!1),N.animation?F||(F=g(w,150,!1)):w())})}function u(){H&&(g.cancel(H),H=null),F&&(g.cancel(F),F=null)}function v(){D||(E=N.$new(),D=c(E,function(a){K?h.find("body").append(a):b.after(a)}),z())}function w(){s(),u(),A(),D&&(D.remove(),D=null),E&&(E.$destroy(),E=null)}function x(){N.title=d[k+"Title"],Q?N.content=Q(a):N.content=d[e],N.popupClass=d[k+"Class"],N.placement=angular.isDefined(d[k+"Placement"])?d[k+"Placement"]:n.placement;var b=i.parsePlacement(N.placement);J=b[1]?b[0]+"-"+b[1]:b[0];var c=parseInt(d[k+"PopupDelay"],10),f=parseInt(d[k+"PopupCloseDelay"],10);N.popupDelay=isNaN(c)?n.popupDelay:c,N.popupCloseDelay=isNaN(f)?n.popupCloseDelay:f}function y(b){P&&angular.isFunction(P.assign)&&P.assign(a,b)}function z(){R.length=0,Q?(R.push(a.$watch(Q,function(a){N.content=a,!a&&N.isOpen&&t()})),R.push(E.$watch(function(){O||(O=!0,E.$$postDigest(function(){O=!1,N&&N.isOpen&&S()}))}))):R.push(d.$observe(e,function(a){N.content=a,!a&&N.isOpen?t():S()})),R.push(d.$observe(k+"Title",function(a){N.title=a,N.isOpen&&S()})),R.push(d.$observe(k+"Placement",function(a){N.placement=a?a:n.placement,N.isOpen&&S()}))}function A(){R.length&&(angular.forEach(R,function(a){a()}),R.length=0)}function B(a){N&&N.isOpen&&D&&(b[0].contains(a.target)||D[0].contains(a.target)||q())}function C(){var a=d[k+"Trigger"];T(),L=p(a),"none"!==L.show&&L.show.forEach(function(a,c){"outsideClick"===a?(b.on("click",j),h.on("click",B)):a===L.hide[c]?b.on(a,j):a&&(b.on(a,m),b.on(L.hide[c],q)),b.on("keypress",function(a){27===a.which&&q()})})}var D,E,F,G,H,I,J,K=angular.isDefined(n.appendToBody)?n.appendToBody:!1,L=p(void 0),M=angular.isDefined(d[k+"Enable"]),N=a.$new(!0),O=!1,P=angular.isDefined(d[k+"IsOpen"])?l(d[k+"IsOpen"]):!1,Q=n.useContentExp?l(d[e]):!1,R=[],S=function(){D&&D.html()&&(I||(I=g(function(){var a=i.positionElements(b,D,N.placement,K);D.css({top:a.top+"px",left:a.left+"px"}),D.hasClass(a.placement.split("-")[0])||(D.removeClass(J.split("-")[0]),D.addClass(a.placement.split("-")[0])),D.hasClass(n.placementClassPrefix+a.placement)||(D.removeClass(n.placementClassPrefix+J),D.addClass(n.placementClassPrefix+a.placement)),D.hasClass("uib-position-measure")?(i.positionArrow(D,a.placement),D.removeClass("uib-position-measure")):J!==a.placement&&i.positionArrow(D,a.placement),J=a.placement,I=null},0,!1)))};N.origScope=a,N.isOpen=!1,o.add(N,{close:t}),N.contentExp=function(){return N.content},d.$observe("disabled",function(a){a&&s(),a&&N.isOpen&&t()}),P&&a.$watch(P,function(a){N&&!a===N.isOpen&&j()});var T=function(){L.show.forEach(function(a){"outsideClick"===a?b.off("click",j):(b.off(a,m),b.off(a,j))}),L.hide.forEach(function(a){"outsideClick"===a?h.off("click",B):b.off(a,q)})};C();var U=a.$eval(d[k+"Animation"]);N.animation=angular.isDefined(U)?!!U:n.animation;var V,W=k+"AppendToBody";V=W in d&&void 0===d[W]?!0:a.$eval(d[W]),K=angular.isDefined(V)?V:K,a.$on("$destroy",function(){T(),w(),o.remove(N),N=null})}}}}}]}).directive("uibTooltipTemplateTransclude",["$animate","$sce","$compile","$templateRequest",function(a,b,c,d){return{link:function(e,f,g){var h,i,j,k=e.$eval(g.tooltipTemplateTranscludeScope),l=0,m=function(){i&&(i.remove(),i=null),h&&(h.$destroy(),h=null),j&&(a.leave(j).then(function(){i=null}),i=j,j=null)};e.$watch(b.parseAsResourceUrl(g.uibTooltipTemplateTransclude),function(b){var g=++l;b?(d(b,!0).then(function(d){if(g===l){var e=k.$new(),i=d,n=c(i)(e,function(b){m(),a.enter(b,f)});h=e,j=n,h.$emit("$includeContentLoaded",b)}},function(){g===l&&(m(),e.$emit("$includeContentError",b))}),e.$emit("$includeContentRequested",b)):m()}),e.$on("$destroy",m)}}}]).directive("uibTooltipClasses",["$uibPosition",function(a){return{restrict:"A",link:function(b,c,d){if(b.placement){var e=a.parsePlacement(b.placement);c.addClass(e[0])}b.popupClass&&c.addClass(b.popupClass),b.animation()&&c.addClass(d.tooltipAnimationClass)}}}]).directive("uibTooltipPopup",function(){return{replace:!0,scope:{content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-popup.html"}}).directive("uibTooltip",["$uibTooltip",function(a){return a("uibTooltip","tooltip","mouseenter")}]).directive("uibTooltipTemplatePopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/tooltip/tooltip-template-popup.html"}}).directive("uibTooltipTemplate",["$uibTooltip",function(a){return a("uibTooltipTemplate","tooltip","mouseenter",{useContentExp:!0})}]).directive("uibTooltipHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/tooltip/tooltip-html-popup.html"}}).directive("uibTooltipHtml",["$uibTooltip",function(a){return a("uibTooltipHtml","tooltip","mouseenter",{useContentExp:!0})}]),angular.module("ui.bootstrap.popover",["ui.bootstrap.tooltip"]).directive("uibPopoverTemplatePopup",function(){return{replace:!0,scope:{uibTitle:"@",contentExp:"&",placement:"@",popupClass:"@",animation:"&",isOpen:"&",originScope:"&"},templateUrl:"uib/template/popover/popover-template.html"}}).directive("uibPopoverTemplate",["$uibTooltip",function(a){return a("uibPopoverTemplate","popover","click",{useContentExp:!0})}]).directive("uibPopoverHtmlPopup",function(){return{replace:!0,scope:{contentExp:"&",uibTitle:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover-html.html"}}).directive("uibPopoverHtml",["$uibTooltip",function(a){return a("uibPopoverHtml","popover","click",{useContentExp:!0})}]).directive("uibPopoverPopup",function(){return{replace:!0,scope:{uibTitle:"@",content:"@",placement:"@",popupClass:"@",animation:"&",isOpen:"&"},templateUrl:"uib/template/popover/popover.html"}}).directive("uibPopover",["$uibTooltip",function(a){return a("uibPopover","popover","click")}]),angular.module("ui.bootstrap.progressbar",[]).constant("uibProgressConfig",{animate:!0,max:100}).controller("UibProgressController",["$scope","$attrs","uibProgressConfig",function(a,b,c){function d(){return angular.isDefined(a.maxParam)?a.maxParam:c.max}var e=this,f=angular.isDefined(b.animate)?a.$parent.$eval(b.animate):c.animate;this.bars=[],a.max=d(),this.addBar=function(a,b,c){f||b.css({transition:"none"}),this.bars.push(a),a.max=d(),a.title=c&&angular.isDefined(c.title)?c.title:"progressbar",a.$watch("value",function(b){a.recalculatePercentage()}),a.recalculatePercentage=function(){var b=e.bars.reduce(function(a,b){return b.percent=+(100*b.value/b.max).toFixed(2),a+b.percent},0);b>100&&(a.percent-=b-100)},a.$on("$destroy",function(){b=null,e.removeBar(a)})},this.removeBar=function(a){this.bars.splice(this.bars.indexOf(a),1),this.bars.forEach(function(a){a.recalculatePercentage()})},a.$watch("maxParam",function(a){e.bars.forEach(function(a){a.max=d(),a.recalculatePercentage()})})}]).directive("uibProgress",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",require:"uibProgress",scope:{maxParam:"=?max"},templateUrl:"uib/template/progressbar/progress.html"}}).directive("uibBar",function(){return{replace:!0,transclude:!0,require:"^uibProgress",scope:{value:"=",type:"@"},templateUrl:"uib/template/progressbar/bar.html",link:function(a,b,c,d){d.addBar(a,b,c)}}}).directive("uibProgressbar",function(){return{replace:!0,transclude:!0,controller:"UibProgressController",scope:{value:"=",maxParam:"=?max",type:"@"},templateUrl:"uib/template/progressbar/progressbar.html",link:function(a,b,c,d){d.addBar(a,angular.element(b.children()[0]),{title:c.title})}}}),angular.module("ui.bootstrap.rating",[]).constant("uibRatingConfig",{max:5,stateOn:null,stateOff:null,enableReset:!0,titles:["one","two","three","four","five"]}).controller("UibRatingController",["$scope","$attrs","uibRatingConfig",function(a,b,c){var d={$setViewValue:angular.noop},e=this;this.init=function(e){d=e,d.$render=this.render,d.$formatters.push(function(a){return angular.isNumber(a)&&a<<0!==a&&(a=Math.round(a)),a}),this.stateOn=angular.isDefined(b.stateOn)?a.$parent.$eval(b.stateOn):c.stateOn,this.stateOff=angular.isDefined(b.stateOff)?a.$parent.$eval(b.stateOff):c.stateOff,this.enableReset=angular.isDefined(b.enableReset)?a.$parent.$eval(b.enableReset):c.enableReset;var f=angular.isDefined(b.titles)?a.$parent.$eval(b.titles):c.titles;this.titles=angular.isArray(f)&&f.length>0?f:c.titles;var g=angular.isDefined(b.ratingStates)?a.$parent.$eval(b.ratingStates):new Array(angular.isDefined(b.max)?a.$parent.$eval(b.max):c.max);a.range=this.buildTemplateObjects(g)},this.buildTemplateObjects=function(a){for(var b=0,c=a.length;c>b;b++)a[b]=angular.extend({index:b},{stateOn:this.stateOn,stateOff:this.stateOff,title:this.getTitle(b)},a[b]);return a},this.getTitle=function(a){return a>=this.titles.length?a+1:this.titles[a]},a.rate=function(b){if(!a.readonly&&b>=0&&b<=a.range.length){var c=e.enableReset&&d.$viewValue===b?0:b;d.$setViewValue(c),d.$render()}},a.enter=function(b){a.readonly||(a.value=b),a.onHover({value:b})},a.reset=function(){a.value=d.$viewValue,a.onLeave()},a.onKeydown=function(b){/(37|38|39|40)/.test(b.which)&&(b.preventDefault(),b.stopPropagation(),a.rate(a.value+(38===b.which||39===b.which?1:-1)))},this.render=function(){a.value=d.$viewValue,a.title=e.getTitle(a.value-1)}}]).directive("uibRating",function(){return{require:["uibRating","ngModel"],scope:{readonly:"=?readOnly",onHover:"&",onLeave:"&"},controller:"UibRatingController",templateUrl:"uib/template/rating/rating.html",replace:!0,link:function(a,b,c,d){var e=d[0],f=d[1];e.init(f)}}}),angular.module("ui.bootstrap.tabs",[]).controller("UibTabsetController",["$scope",function(a){function b(a){for(var b=0;b<d.tabs.length;b++)if(d.tabs[b].index===a)return b}var c,d=this;d.tabs=[],d.select=function(a,f){if(!e){var g=b(c),h=d.tabs[g];if(h){if(h.tab.onDeselect({$event:f}),f&&f.isDefaultPrevented())return;h.tab.active=!1}var i=d.tabs[a];i?(i.tab.onSelect({$event:f}),i.tab.active=!0,d.active=i.index,c=i.index):!i&&angular.isNumber(c)&&(d.active=null,c=null)}},d.addTab=function(a){if(d.tabs.push({tab:a,index:a.index}),d.tabs.sort(function(a,b){return a.index>b.index?1:a.index<b.index?-1:0}),a.index===d.active||!angular.isNumber(d.active)&&1===d.tabs.length){var c=b(a.index);d.select(c)}},d.removeTab=function(a){for(var b,c=0;c<d.tabs.length;c++)if(d.tabs[c].tab===a){b=c;break}if(d.tabs[b].index===d.active){var e=b===d.tabs.length-1?b-1:b+1%d.tabs.length;d.select(e)}d.tabs.splice(b,1)},a.$watch("tabset.active",function(a){angular.isNumber(a)&&a!==c&&d.select(b(a))});var e;a.$on("$destroy",function(){e=!0})}]).directive("uibTabset",function(){return{transclude:!0,replace:!0,scope:{},bindToController:{active:"=?",type:"@"},controller:"UibTabsetController",controllerAs:"tabset",templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tabset.html"},link:function(a,b,c){a.vertical=angular.isDefined(c.vertical)?a.$parent.$eval(c.vertical):!1,a.justified=angular.isDefined(c.justified)?a.$parent.$eval(c.justified):!1,angular.isUndefined(c.active)&&(a.active=0)}}}).directive("uibTab",["$parse",function(a){return{require:"^uibTabset",replace:!0,templateUrl:function(a,b){return b.templateUrl||"uib/template/tabs/tab.html"},transclude:!0,scope:{heading:"@",index:"=?",classes:"@?",onSelect:"&select",onDeselect:"&deselect"},controller:function(){},controllerAs:"tab",link:function(b,c,d,e,f){b.disabled=!1,d.disable&&b.$parent.$watch(a(d.disable),function(a){b.disabled=!!a}),angular.isUndefined(d.index)&&(e.tabs&&e.tabs.length?b.index=Math.max.apply(null,e.tabs.map(function(a){return a.index}))+1:b.index=0),angular.isUndefined(d.classes)&&(b.classes=""),b.select=function(a){if(!b.disabled){for(var c,d=0;d<e.tabs.length;d++)if(e.tabs[d].tab===b){c=d;break}e.select(c,a)}},e.addTab(b),b.$on("$destroy",function(){e.removeTab(b)}),b.$transcludeFn=f}}}]).directive("uibTabHeadingTransclude",function(){return{restrict:"A",require:"^uibTab",link:function(a,b){a.$watch("headingElement",function(a){a&&(b.html(""),b.append(a))})}}}).directive("uibTabContentTransclude",function(){function a(a){return a.tagName&&(a.hasAttribute("uib-tab-heading")||a.hasAttribute("data-uib-tab-heading")||a.hasAttribute("x-uib-tab-heading")||"uib-tab-heading"===a.tagName.toLowerCase()||"data-uib-tab-heading"===a.tagName.toLowerCase()||"x-uib-tab-heading"===a.tagName.toLowerCase()||"uib:tab-heading"===a.tagName.toLowerCase())}return{restrict:"A",require:"^uibTabset",link:function(b,c,d){var e=b.$eval(d.uibTabContentTransclude).tab;e.$transcludeFn(e.$parent,function(b){angular.forEach(b,function(b){a(b)?e.headingElement=b:c.append(b)})})}}}),angular.module("ui.bootstrap.timepicker",[]).constant("uibTimepickerConfig",{hourStep:1,minuteStep:1,secondStep:1,showMeridian:!0,showSeconds:!1,meridians:null,readonlyInput:!1,mousewheel:!0,arrowkeys:!0,showSpinners:!0,templateUrl:"uib/template/timepicker/timepicker.html"}).controller("UibTimepickerController",["$scope","$element","$attrs","$parse","$log","$locale","uibTimepickerConfig",function(a,b,c,d,e,f,g){function h(){var b=+a.hours,c=a.showMeridian?b>0&&13>b:b>=0&&24>b;return c&&""!==a.hours?(a.showMeridian&&(12===b&&(b=0),a.meridian===v[1]&&(b+=12)),b):void 0}function i(){var b=+a.minutes,c=b>=0&&60>b;return c&&""!==a.minutes?b:void 0}function j(){var b=+a.seconds;return b>=0&&60>b?b:void 0}function k(a,b){return null===a?"":angular.isDefined(a)&&a.toString().length<2&&!b?"0"+a:a.toString()}function l(a){m(),u.$setViewValue(new Date(s)),n(a)}function m(){u.$setValidity("time",!0),a.invalidHours=!1,a.invalidMinutes=!1,a.invalidSeconds=!1}function n(b){if(u.$modelValue){var c=s.getHours(),d=s.getMinutes(),e=s.getSeconds();a.showMeridian&&(c=0===c||12===c?12:c%12),a.hours="h"===b?c:k(c,!w),"m"!==b&&(a.minutes=k(d)),a.meridian=s.getHours()<12?v[0]:v[1],"s"!==b&&(a.seconds=k(e)),a.meridian=s.getHours()<12?v[0]:v[1]}else a.hours=null,a.minutes=null,a.seconds=null,a.meridian=v[0]}function o(a){s=q(s,a),l()}function p(a,b){return q(a,60*b)}function q(a,b){var c=new Date(a.getTime()+1e3*b),d=new Date(a);return d.setHours(c.getHours(),c.getMinutes(),c.getSeconds()),d}function r(){return(null===a.hours||""===a.hours)&&(null===a.minutes||""===a.minutes)&&(!a.showSeconds||a.showSeconds&&(null===a.seconds||""===a.seconds))}var s=new Date,t=[],u={$setViewValue:angular.noop},v=angular.isDefined(c.meridians)?a.$parent.$eval(c.meridians):g.meridians||f.DATETIME_FORMATS.AMPMS,w=angular.isDefined(c.padHours)?a.$parent.$eval(c.padHours):!0;a.tabindex=angular.isDefined(c.tabindex)?c.tabindex:0,b.removeAttr("tabindex"),this.init=function(b,d){u=b,u.$render=this.render,u.$formatters.unshift(function(a){return a?new Date(a):null});var e=d.eq(0),f=d.eq(1),h=d.eq(2),i=angular.isDefined(c.mousewheel)?a.$parent.$eval(c.mousewheel):g.mousewheel;i&&this.setupMousewheelEvents(e,f,h);var j=angular.isDefined(c.arrowkeys)?a.$parent.$eval(c.arrowkeys):g.arrowkeys;j&&this.setupArrowkeyEvents(e,f,h),a.readonlyInput=angular.isDefined(c.readonlyInput)?a.$parent.$eval(c.readonlyInput):g.readonlyInput,this.setupInputEvents(e,f,h)};var x=g.hourStep;c.hourStep&&t.push(a.$parent.$watch(d(c.hourStep),function(a){x=+a}));var y=g.minuteStep;c.minuteStep&&t.push(a.$parent.$watch(d(c.minuteStep),function(a){y=+a}));var z;t.push(a.$parent.$watch(d(c.min),function(a){var b=new Date(a);z=isNaN(b)?void 0:b}));var A;t.push(a.$parent.$watch(d(c.max),function(a){var b=new Date(a);A=isNaN(b)?void 0:b}));var B=!1;c.ngDisabled&&t.push(a.$parent.$watch(d(c.ngDisabled),function(a){B=a})),a.noIncrementHours=function(){var a=p(s,60*x);return B||a>A||s>a&&z>a},a.noDecrementHours=function(){var a=p(s,60*-x);return B||z>a||a>s&&a>A},a.noIncrementMinutes=function(){var a=p(s,y);return B||a>A||s>a&&z>a},a.noDecrementMinutes=function(){var a=p(s,-y);return B||z>a||a>s&&a>A},a.noIncrementSeconds=function(){var a=q(s,C);return B||a>A||s>a&&z>a},a.noDecrementSeconds=function(){var a=q(s,-C);return B||z>a||a>s&&a>A},a.noToggleMeridian=function(){return s.getHours()<12?B||p(s,720)>A:B||p(s,-720)<z};var C=g.secondStep;c.secondStep&&t.push(a.$parent.$watch(d(c.secondStep),function(a){C=+a})),a.showSeconds=g.showSeconds,c.showSeconds&&t.push(a.$parent.$watch(d(c.showSeconds),function(b){a.showSeconds=!!b})),a.showMeridian=g.showMeridian,c.showMeridian&&t.push(a.$parent.$watch(d(c.showMeridian),function(b){if(a.showMeridian=!!b,u.$error.time){var c=h(),d=i();angular.isDefined(c)&&angular.isDefined(d)&&(s.setHours(c),l())}else n()})),this.setupMousewheelEvents=function(b,c,d){var e=function(a){a.originalEvent&&(a=a.originalEvent);var b=a.wheelDelta?a.wheelDelta:-a.deltaY;return a.detail||b>0};b.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementHours():a.decrementHours()),b.preventDefault()}),c.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementMinutes():a.decrementMinutes()),b.preventDefault()}),d.bind("mousewheel wheel",function(b){B||a.$apply(e(b)?a.incrementSeconds():a.decrementSeconds()),b.preventDefault()})},this.setupArrowkeyEvents=function(b,c,d){b.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementHours(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementHours(),a.$apply()))}),c.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementMinutes(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementMinutes(),a.$apply()))}),d.bind("keydown",function(b){B||(38===b.which?(b.preventDefault(),a.incrementSeconds(),a.$apply()):40===b.which&&(b.preventDefault(),a.decrementSeconds(),a.$apply()))})},this.setupInputEvents=function(b,c,d){if(a.readonlyInput)return a.updateHours=angular.noop,a.updateMinutes=angular.noop,void(a.updateSeconds=angular.noop);var e=function(b,c,d){u.$setViewValue(null),u.$setValidity("time",!1),angular.isDefined(b)&&(a.invalidHours=b),angular.isDefined(c)&&(a.invalidMinutes=c),angular.isDefined(d)&&(a.invalidSeconds=d)};a.updateHours=function(){var a=h(),b=i();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(a),s.setMinutes(b),z>s||s>A?e(!0):l("h")):e(!0)},b.bind("blur",function(b){u.$setTouched(),r()?m():null===a.hours||""===a.hours?e(!0):!a.invalidHours&&a.hours<10&&a.$apply(function(){a.hours=k(a.hours,!w)})}),a.updateMinutes=function(){var a=i(),b=h();u.$setDirty(),angular.isDefined(a)&&angular.isDefined(b)?(s.setHours(b),s.setMinutes(a),z>s||s>A?e(void 0,!0):l("m")):e(void 0,!0)},c.bind("blur",function(b){u.$setTouched(),r()?m():null===a.minutes?e(void 0,!0):!a.invalidMinutes&&a.minutes<10&&a.$apply(function(){a.minutes=k(a.minutes)})}),a.updateSeconds=function(){var a=j();u.$setDirty(),angular.isDefined(a)?(s.setSeconds(a),l("s")):e(void 0,void 0,!0)},d.bind("blur",function(b){r()?m():!a.invalidSeconds&&a.seconds<10&&a.$apply(function(){a.seconds=k(a.seconds)})})},this.render=function(){var b=u.$viewValue;isNaN(b)?(u.$setValidity("time",!1),e.error('Timepicker directive: "ng-model" value must be a Date object, a number of milliseconds since 01.01.1970 or a string representing an RFC2822 or ISO 8601 date.')):(b&&(s=b),z>s||s>A?(u.$setValidity("time",!1),a.invalidHours=!0,a.invalidMinutes=!0):m(),n())},a.showSpinners=angular.isDefined(c.showSpinners)?a.$parent.$eval(c.showSpinners):g.showSpinners,a.incrementHours=function(){a.noIncrementHours()||o(60*x*60)},a.decrementHours=function(){a.noDecrementHours()||o(60*-x*60)},a.incrementMinutes=function(){a.noIncrementMinutes()||o(60*y)},a.decrementMinutes=function(){a.noDecrementMinutes()||o(60*-y)},a.incrementSeconds=function(){a.noIncrementSeconds()||o(C)},a.decrementSeconds=function(){a.noDecrementSeconds()||o(-C)},a.toggleMeridian=function(){var b=i(),c=h();a.noToggleMeridian()||(angular.isDefined(b)&&angular.isDefined(c)?o(720*(s.getHours()<12?60:-60)):a.meridian=a.meridian===v[0]?v[1]:v[0])},a.blur=function(){u.$setTouched()},a.$on("$destroy",function(){for(;t.length;)t.shift()()})}]).directive("uibTimepicker",["uibTimepickerConfig",function(a){return{require:["uibTimepicker","?^ngModel"],controller:"UibTimepickerController",controllerAs:"timepicker",replace:!0,scope:{},templateUrl:function(b,c){return c.templateUrl||a.templateUrl},link:function(a,b,c,d){var e=d[0],f=d[1];f&&e.init(f,b.find("input"))}}}]),angular.module("ui.bootstrap.typeahead",["ui.bootstrap.debounce","ui.bootstrap.position"]).factory("uibTypeaheadParser",["$parse",function(a){var b=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w\d]*))\s+in\s+([\s\S]+?)$/;return{parse:function(c){var d=c.match(b);if(!d)throw new Error('Expected typeahead specification in form of "_modelValue_ (as _label_)? for _item_ in _collection_" but got "'+c+'".');return{itemName:d[3],source:a(d[4]),viewMapper:a(d[2]||d[1]),modelMapper:a(d[1])}}}}]).controller("UibTypeaheadController",["$scope","$element","$attrs","$compile","$parse","$q","$timeout","$document","$window","$rootScope","$$debounce","$uibPosition","uibTypeaheadParser",function(a,b,c,d,e,f,g,h,i,j,k,l,m){function n(){N.moveInProgress||(N.moveInProgress=!0,N.$digest()),Y()}function o(){N.position=D?l.offset(b):l.position(b),N.position.top+=b.prop("offsetHeight")}var p,q,r=[9,13,27,38,40],s=200,t=a.$eval(c.typeaheadMinLength);t||0===t||(t=1),a.$watch(c.typeaheadMinLength,function(a){t=a||0===a?a:1});var u=a.$eval(c.typeaheadWaitMs)||0,v=a.$eval(c.typeaheadEditable)!==!1;a.$watch(c.typeaheadEditable,function(a){v=a!==!1});var w,x,y=e(c.typeaheadLoading).assign||angular.noop,z=e(c.typeaheadOnSelect),A=angular.isDefined(c.typeaheadSelectOnBlur)?a.$eval(c.typeaheadSelectOnBlur):!1,B=e(c.typeaheadNoResults).assign||angular.noop,C=c.typeaheadInputFormatter?e(c.typeaheadInputFormatter):void 0,D=c.typeaheadAppendToBody?a.$eval(c.typeaheadAppendToBody):!1,E=c.typeaheadAppendTo?a.$eval(c.typeaheadAppendTo):null,F=a.$eval(c.typeaheadFocusFirst)!==!1,G=c.typeaheadSelectOnExact?a.$eval(c.typeaheadSelectOnExact):!1,H=e(c.typeaheadIsOpen).assign||angular.noop,I=a.$eval(c.typeaheadShowHint)||!1,J=e(c.ngModel),K=e(c.ngModel+"($$$p)"),L=function(b,c){return angular.isFunction(J(a))&&q&&q.$options&&q.$options.getterSetter?K(b,{$$$p:c}):J.assign(b,c)},M=m.parse(c.uibTypeahead),N=a.$new(),O=a.$on("$destroy",function(){N.$destroy()});N.$on("$destroy",O);var P="typeahead-"+N.$id+"-"+Math.floor(1e4*Math.random());b.attr({"aria-autocomplete":"list","aria-expanded":!1,"aria-owns":P});var Q,R;I&&(Q=angular.element("<div></div>"),Q.css("position","relative"),b.after(Q),R=b.clone(),R.attr("placeholder",""),R.attr("tabindex","-1"),R.val(""),R.css({position:"absolute",top:"0px",left:"0px","border-color":"transparent","box-shadow":"none",opacity:1,background:"none 0% 0% / auto repeat scroll padding-box border-box rgb(255, 255, 255)",color:"#999"}),b.css({position:"relative","vertical-align":"top","background-color":"transparent"}),Q.append(R),R.after(b));var S=angular.element("<div uib-typeahead-popup></div>");S.attr({id:P,matches:"matches",active:"activeIdx",select:"select(activeIdx, evt)","move-in-progress":"moveInProgress",query:"query",position:"position","assign-is-open":"assignIsOpen(isOpen)",debounce:"debounceUpdate"}),angular.isDefined(c.typeaheadTemplateUrl)&&S.attr("template-url",c.typeaheadTemplateUrl),angular.isDefined(c.typeaheadPopupTemplateUrl)&&S.attr("popup-template-url",c.typeaheadPopupTemplateUrl);var T=function(){I&&R.val("")},U=function(){N.matches=[],N.activeIdx=-1,b.attr("aria-expanded",!1),T()},V=function(a){return P+"-option-"+a};N.$watch("activeIdx",function(a){0>a?b.removeAttr("aria-activedescendant"):b.attr("aria-activedescendant",V(a))});var W=function(a,b){return N.matches.length>b&&a?a.toUpperCase()===N.matches[b].label.toUpperCase():!1},X=function(c,d){var e={$viewValue:c};y(a,!0),B(a,!1),f.when(M.source(a,e)).then(function(f){var g=c===p.$viewValue;if(g&&w)if(f&&f.length>0){N.activeIdx=F?0:-1,B(a,!1),N.matches.length=0;for(var h=0;h<f.length;h++)e[M.itemName]=f[h],N.matches.push({id:V(h),label:M.viewMapper(N,e),model:f[h]});if(N.query=c,o(),b.attr("aria-expanded",!0),G&&1===N.matches.length&&W(c,0)&&(angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(0,d)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(0,d)),I){var i=N.matches[0].label;angular.isString(c)&&c.length>0&&i.slice(0,c.length).toUpperCase()===c.toUpperCase()?R.val(c+i.slice(c.length)):R.val("")}}else U(),B(a,!0);g&&y(a,!1)},function(){U(),y(a,!1),B(a,!0)})};D&&(angular.element(i).on("resize",n),h.find("body").on("scroll",n));var Y=k(function(){N.matches.length&&o(),N.moveInProgress=!1},s);N.moveInProgress=!1,N.query=void 0;var Z,$=function(a){Z=g(function(){X(a)},u)},_=function(){Z&&g.cancel(Z)};U(),N.assignIsOpen=function(b){H(a,b)},N.select=function(d,e){var f,h,i={};x=!0,i[M.itemName]=h=N.matches[d].model,f=M.modelMapper(a,i),L(a,f),p.$setValidity("editable",!0),p.$setValidity("parse",!0),z(a,{$item:h,$model:f,$label:M.viewMapper(a,i),$event:e}),U(),N.$eval(c.typeaheadFocusOnSelect)!==!1&&g(function(){b[0].focus()},0,!1)},b.on("keydown",function(b){if(0!==N.matches.length&&-1!==r.indexOf(b.which)){if(-1===N.activeIdx&&(9===b.which||13===b.which)||9===b.which&&b.shiftKey)return U(),void N.$digest();b.preventDefault();var c;switch(b.which){case 9:case 13:N.$apply(function(){angular.isNumber(N.debounceUpdate)||angular.isObject(N.debounceUpdate)?k(function(){N.select(N.activeIdx,b)},angular.isNumber(N.debounceUpdate)?N.debounceUpdate:N.debounceUpdate["default"]):N.select(N.activeIdx,b)});break;case 27:b.stopPropagation(),U(),a.$digest();break;case 38:N.activeIdx=(N.activeIdx>0?N.activeIdx:N.matches.length)-1,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop;break;case 40:N.activeIdx=(N.activeIdx+1)%N.matches.length,N.$digest(),c=S.find("li")[N.activeIdx],c.parentNode.scrollTop=c.offsetTop}}}),b.bind("focus",function(a){w=!0,0!==t||p.$viewValue||g(function(){X(p.$viewValue,a)},0)}),b.bind("blur",function(a){A&&N.matches.length&&-1!==N.activeIdx&&!x&&(x=!0,N.$apply(function(){angular.isObject(N.debounceUpdate)&&angular.isNumber(N.debounceUpdate.blur)?k(function(){N.select(N.activeIdx,a)},N.debounceUpdate.blur):N.select(N.activeIdx,a)})),!v&&p.$error.editable&&(p.$setViewValue(),p.$setValidity("editable",!0),p.$setValidity("parse",!0),b.val("")),w=!1,x=!1});var aa=function(c){b[0]!==c.target&&3!==c.which&&0!==N.matches.length&&(U(),j.$$phase||a.$digest())};h.on("click",aa),a.$on("$destroy",function(){h.off("click",aa),(D||E)&&ba.remove(),D&&(angular.element(i).off("resize",n),h.find("body").off("scroll",n)),S.remove(),I&&Q.remove()});var ba=d(S)(N);D?h.find("body").append(ba):E?angular.element(E).eq(0).append(ba):b.after(ba),this.init=function(b,c){p=b,q=c,N.debounceUpdate=p.$options&&e(p.$options.debounce)(a),p.$parsers.unshift(function(b){return w=!0,0===t||b&&b.length>=t?u>0?(_(),$(b)):X(b):(y(a,!1),_(),U()),v?b:b?void p.$setValidity("editable",!1):(p.$setValidity("editable",!0),null)}),p.$formatters.push(function(b){var c,d,e={};return v||p.$setValidity("editable",!0),C?(e.$model=b,C(a,e)):(e[M.itemName]=b,c=M.viewMapper(a,e),e[M.itemName]=void 0,d=M.viewMapper(a,e),c!==d?c:b)})}}]).directive("uibTypeahead",function(){return{controller:"UibTypeaheadController",require:["ngModel","^?ngModelOptions","uibTypeahead"],link:function(a,b,c,d){d[2].init(d[0],d[1])}}}).directive("uibTypeaheadPopup",["$$debounce",function(a){return{scope:{matches:"=",query:"=",active:"=",position:"&",moveInProgress:"=",select:"&",assignIsOpen:"&",debounce:"&"},replace:!0,templateUrl:function(a,b){return b.popupTemplateUrl||"uib/template/typeahead/typeahead-popup.html"},link:function(b,c,d){b.templateUrl=d.templateUrl,b.isOpen=function(){var a=b.matches.length>0;return b.assignIsOpen({isOpen:a}),a},b.isActive=function(a){return b.active===a},b.selectActive=function(a){b.active=a},b.selectMatch=function(c,d){var e=b.debounce();angular.isNumber(e)||angular.isObject(e)?a(function(){b.select({activeIdx:c,evt:d})},angular.isNumber(e)?e:e["default"]):b.select({activeIdx:c,evt:d})}}}}]).directive("uibTypeaheadMatch",["$templateRequest","$compile","$parse",function(a,b,c){return{scope:{index:"=",match:"=",query:"="},link:function(d,e,f){var g=c(f.templateUrl)(d.$parent)||"uib/template/typeahead/typeahead-match.html";a(g).then(function(a){var c=angular.element(a.trim());e.replaceWith(c),b(c)(d)})}}}]).filter("uibTypeaheadHighlight",["$sce","$injector","$log",function(a,b,c){function d(a){return a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}function e(a){return/<.*>/g.test(a)}var f;return f=b.has("$sanitize"),function(b,g){return!f&&e(b)&&c.warn("Unsafe use of typeahead please use ngSanitize"),b=g?(""+b).replace(new RegExp(d(g),"gi"),"<strong>$&</strong>"):b,f||(b=a.trustAsHtml(b)),b}}]),angular.module("uib/template/accordion/accordion-group.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion-group.html",'<div class="panel" ng-class="panelClass || \'panel-default\'">\n <div role="tab" id="{{::headingId}}" aria-selected="{{isOpen}}" class="panel-heading" ng-keypress="toggleOpen($event)">\n <h4 class="panel-title">\n <a role="button" data-toggle="collapse" href aria-expanded="{{isOpen}}" aria-controls="{{::panelId}}" tabindex="0" class="accordion-toggle" ng-click="toggleOpen()" uib-accordion-transclude="heading"><span uib-accordion-header ng-class="{\'text-muted\': isDisabled}">{{heading}}</span></a>\n </h4>\n </div>\n <div id="{{::panelId}}" aria-labelledby="{{::headingId}}" aria-hidden="{{!isOpen}}" role="tabpanel" class="panel-collapse collapse" uib-collapse="!isOpen">\n <div class="panel-body" ng-transclude></div>\n </div>\n</div>\n')}]),angular.module("uib/template/accordion/accordion.html",[]).run(["$templateCache",function(a){a.put("uib/template/accordion/accordion.html",'<div role="tablist" class="panel-group" ng-transclude></div>')}]),angular.module("uib/template/alert/alert.html",[]).run(["$templateCache",function(a){a.put("uib/template/alert/alert.html",'<div class="alert" ng-class="[\'alert-\' + (type || \'warning\'), closeable ? \'alert-dismissible\' : null]" role="alert">\n <button ng-show="closeable" type="button" class="close" ng-click="close({$event: $event})">\n <span aria-hidden="true">&times;</span>\n <span class="sr-only">Close</span>\n </button>\n <div ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/carousel/carousel.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/carousel.html",'<div ng-mouseenter="pause()" ng-mouseleave="play()" class="carousel" ng-swipe-right="prev()" ng-swipe-left="next()">\n <div class="carousel-inner" ng-transclude></div>\n <a role="button" href class="left carousel-control" ng-click="prev()" ng-class="{ disabled: isPrevDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-left"></span>\n <span class="sr-only">previous</span>\n </a>\n <a role="button" href class="right carousel-control" ng-click="next()" ng-class="{ disabled: isNextDisabled() }" ng-show="slides.length > 1">\n <span aria-hidden="true" class="glyphicon glyphicon-chevron-right"></span>\n <span class="sr-only">next</span>\n </a>\n <ol class="carousel-indicators" ng-show="slides.length > 1">\n <li ng-repeat="slide in slides | orderBy:indexOfSlide track by $index" ng-class="{ active: isActive(slide) }" ng-click="select(slide)">\n <span class="sr-only">slide {{ $index + 1 }} of {{ slides.length }}<span ng-if="isActive(slide)">, currently active</span></span>\n </li>\n </ol>\n</div>\n');
1768 }]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/slide.html",'<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/datepicker.html",'<div class="uib-datepicker" ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <uib-daypicker ng-switch-when="day" tabindex="0"></uib-daypicker>\n <uib-monthpicker ng-switch-when="month" tabindex="0"></uib-monthpicker>\n <uib-yearpicker ng-switch-when="year" tabindex="0"></uib-yearpicker>\n</div>\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/day.html",'<table class="uib-daypicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-if="showWeeks" class="text-center"></th>\n <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-weeks" ng-repeat="row in rows track by $index">\n <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row" class="uib-day text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default btn-sm"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/month.html",'<table class="uib-monthpicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-months" ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row" class="uib-month text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/year.html",'<table class="uib-yearpicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{::columns - 2}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-years" ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row" class="uib-year text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepickerPopup/popup.html",'<div>\n <ul class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n </ul>\n</div>\n')}]),angular.module("uib/template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/backdrop.html",'<div class="modal-backdrop"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/window.html",'<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}">\n <div class="modal-dialog {{size ? \'modal-\' + size : \'\'}}"><div class="modal-content" uib-modal-transclude></div></div>\n</div>\n')}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(a){a.put("uib/template/pager/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious()||ngDisabled, previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext()||ngDisabled, next: align}"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n</ul>\n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("uib/template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="::boundaryLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-first"><a href ng-click="selectPage(1, $event)">{{::getText(\'first\')}}</a></li>\n <li ng-if="::directionLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-prev"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active,disabled: ngDisabled&&!page.active}" class="pagination-page"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="::directionLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-next"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n <li ng-if="::boundaryLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-last"><a href ng-click="selectPage(totalPages, $event)">{{::getText(\'last\')}}</a></li>\n</ul>\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-html-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-template-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-html.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind-html="contentExp()"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-template.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progress.html",'<div class="progress" ng-transclude aria-labelledby="{{::title}}"></div>')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("uib/template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}" aria-valuetext="{{title}}">\n <span ng-repeat-start="r in range track by $index" class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n <i ng-repeat-end ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')" ng-attr-title="{{r.title}}"></i>\n</span>\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tab.html",'<li ng-class="[{active: active, disabled: disabled}, classes]" class="uib-tab nav-item">\n <a href ng-click="select($event)" class="nav-link" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{tabset.type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane"\n ng-repeat="tab in tabset.tabs"\n ng-class="{active: tabset.active === tab.index}"\n uib-tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/timepicker/timepicker.html",'<table class="uib-timepicker">\n <tbody>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-increment seconds"><a ng-click="incrementSeconds()" ng-class="{disabled: noIncrementSeconds()}" class="btn btn-link" ng-disabled="noIncrementSeconds()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group uib-time hours" ng-class="{\'has-error\': invalidHours}">\n <input type="text" placeholder="HH" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementHours()" ng-blur="blur()">\n </td>\n <td class="uib-separator">:</td>\n <td class="form-group uib-time minutes" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" placeholder="MM" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementMinutes()" ng-blur="blur()">\n </td>\n <td ng-show="showSeconds" class="uib-separator">:</td>\n <td class="form-group uib-time seconds" ng-class="{\'has-error\': invalidSeconds}" ng-show="showSeconds">\n <input type="text" placeholder="SS" ng-model="seconds" ng-change="updateSeconds()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementSeconds()" ng-blur="blur()">\n </td>\n <td ng-show="showMeridian" class="uib-time am-pm"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>\n </tr>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-decrement hours"><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-decrement minutes"><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-decrement seconds"><a ng-click="decrementSeconds()" ng-class="{disabled: noDecrementSeconds()}" class="btn btn-link" ng-disabled="noDecrementSeconds()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-match.html",'<a href\n tabindex="-1"\n ng-bind-html="match.label | uibTypeaheadHighlight:query"\n ng-attr-title="{{match.label}}"></a>\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+\'px\', left: position().left+\'px\'}" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index, $event)" role="option" id="{{::match.id}}">\n <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0});
1768 }]),angular.module("uib/template/carousel/slide.html",[]).run(["$templateCache",function(a){a.put("uib/template/carousel/slide.html",'<div ng-class="{\n \'active\': active\n }" class="item text-center" ng-transclude></div>\n')}]),angular.module("uib/template/datepicker/datepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/datepicker.html",'<div class="uib-datepicker" ng-switch="datepickerMode" role="application" ng-keydown="keydown($event)">\n <uib-daypicker ng-switch-when="day" tabindex="0"></uib-daypicker>\n <uib-monthpicker ng-switch-when="month" tabindex="0"></uib-monthpicker>\n <uib-yearpicker ng-switch-when="year" tabindex="0"></uib-yearpicker>\n</div>\n')}]),angular.module("uib/template/datepicker/day.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/day.html",'<table class="uib-daypicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{::5 + showWeeks}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n <tr>\n <th ng-if="showWeeks" class="text-center"></th>\n <th ng-repeat="label in ::labels track by $index" class="text-center"><small aria-label="{{::label.full}}">{{::label.abbr}}</small></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-weeks" ng-repeat="row in rows track by $index">\n <td ng-if="showWeeks" class="text-center h6"><em>{{ weekNumbers[$index] }}</em></td>\n <td ng-repeat="dt in row" class="uib-day text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default btn-sm"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-muted\': dt.secondary, \'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/month.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/month.html",'<table class="uib-monthpicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-months" ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row" class="uib-month text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepicker/year.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepicker/year.html",'<table class="uib-yearpicker" role="grid" aria-labelledby="{{::uniqueId}}-title" aria-activedescendant="{{activeDateId}}">\n <thead>\n <tr>\n <th><button type="button" class="btn btn-default btn-sm pull-left uib-left" ng-click="move(-1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-left"></i></button></th>\n <th colspan="{{::columns - 2}}"><button id="{{::uniqueId}}-title" role="heading" aria-live="assertive" aria-atomic="true" type="button" class="btn btn-default btn-sm uib-title" ng-click="toggleMode()" ng-disabled="datepickerMode === maxMode" tabindex="-1"><strong>{{title}}</strong></button></th>\n <th><button type="button" class="btn btn-default btn-sm pull-right uib-right" ng-click="move(1)" tabindex="-1"><i class="glyphicon glyphicon-chevron-right"></i></button></th>\n </tr>\n </thead>\n <tbody>\n <tr class="uib-years" ng-repeat="row in rows track by $index">\n <td ng-repeat="dt in row" class="uib-year text-center" role="gridcell"\n id="{{::dt.uid}}"\n ng-class="::dt.customClass">\n <button type="button" class="btn btn-default"\n uib-is-class="\n \'btn-info\' for selectedDt,\n \'active\' for activeDt\n on dt"\n ng-click="select(dt.date)"\n ng-disabled="::dt.disabled"\n tabindex="-1"><span ng-class="::{\'text-info\': dt.current}">{{::dt.label}}</span></button>\n </td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/datepickerPopup/popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/datepickerPopup/popup.html",'<div>\n <ul class="uib-datepicker-popup dropdown-menu uib-position-measure" dropdown-nested ng-if="isOpen" ng-keydown="keydown($event)" ng-click="$event.stopPropagation()">\n <li ng-transclude></li>\n <li ng-if="showButtonBar" class="uib-button-bar">\n <span class="btn-group pull-left">\n <button type="button" class="btn btn-sm btn-info uib-datepicker-current" ng-click="select(\'today\', $event)" ng-disabled="isDisabled(\'today\')">{{ getText(\'current\') }}</button>\n <button type="button" class="btn btn-sm btn-danger uib-clear" ng-click="select(null, $event)">{{ getText(\'clear\') }}</button>\n </span>\n <button type="button" class="btn btn-sm btn-success pull-right uib-close" ng-click="close($event)">{{ getText(\'close\') }}</button>\n </li>\n </ul>\n</div>\n')}]),angular.module("uib/template/modal/backdrop.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/backdrop.html",'<div class="modal-backdrop"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1040 + (index && 1 || 0) + index*10}"\n></div>\n')}]),angular.module("uib/template/modal/window.html",[]).run(["$templateCache",function(a){a.put("uib/template/modal/window.html",'<div modal-render="{{$isRendered}}" tabindex="-1" role="dialog" class="modal"\n uib-modal-animation-class="fade"\n modal-in-class="in"\n ng-style="{\'z-index\': 1050 + index*10, display: \'block\'}">\n <div class="modal-dialog {{size ? \'modal-\' + size : \'\'}}"><div class="modal-content" uib-modal-transclude></div></div>\n</div>\n')}]),angular.module("uib/template/pager/pager.html",[]).run(["$templateCache",function(a){a.put("uib/template/pager/pager.html",'<ul class="pager">\n <li ng-class="{disabled: noPrevious()||ngDisabled, previous: align}"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n <li ng-class="{disabled: noNext()||ngDisabled, next: align}"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n</ul>\n')}]),angular.module("uib/template/pagination/pagination.html",[]).run(["$templateCache",function(a){a.put("uib/template/pagination/pagination.html",'<ul class="pagination">\n <li ng-if="::boundaryLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-first"><a href ng-click="selectPage(1, $event)">{{::getText(\'first\')}}</a></li>\n <li ng-if="::directionLinks" ng-class="{disabled: noPrevious()||ngDisabled}" class="pagination-prev"><a href ng-click="selectPage(page - 1, $event)">{{::getText(\'previous\')}}</a></li>\n <li ng-repeat="page in pages track by $index" ng-class="{active: page.active,disabled: ngDisabled&&!page.active}" class="pagination-page"><a href ng-click="selectPage(page.number, $event)">{{page.text}}</a></li>\n <li ng-if="::directionLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-next"><a href ng-click="selectPage(page + 1, $event)">{{::getText(\'next\')}}</a></li>\n <li ng-if="::boundaryLinks" ng-class="{disabled: noNext()||ngDisabled}" class="pagination-last"><a href ng-click="selectPage(totalPages, $event)">{{::getText(\'last\')}}</a></li>\n</ul>\n')}]),angular.module("uib/template/tooltip/tooltip-html-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-html-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind-html="contentExp()"></div>\n</div>\n')}]),angular.module("uib/template/tooltip/tooltip-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner" ng-bind="content"></div>\n</div>\n')}]),angular.module("uib/template/tooltip/tooltip-template-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/tooltip/tooltip-template-popup.html",'<div class="tooltip"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="tooltip-arrow"></div>\n <div class="tooltip-inner"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n</div>\n')}]),angular.module("uib/template/popover/popover-html.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-html.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind-html="contentExp()"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/popover/popover-template.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover-template.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content"\n uib-tooltip-template-transclude="contentExp()"\n tooltip-template-transclude-scope="originScope()"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/popover/popover.html",[]).run(["$templateCache",function(a){a.put("uib/template/popover/popover.html",'<div class="popover"\n tooltip-animation-class="fade"\n uib-tooltip-classes\n ng-class="{ in: isOpen() }">\n <div class="arrow"></div>\n\n <div class="popover-inner">\n <h3 class="popover-title" ng-bind="uibTitle" ng-if="uibTitle"></h3>\n <div class="popover-content" ng-bind="content"></div>\n </div>\n</div>\n')}]),angular.module("uib/template/progressbar/bar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/bar.html",'<div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n')}]),angular.module("uib/template/progressbar/progress.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progress.html",'<div class="progress" ng-transclude aria-labelledby="{{::title}}"></div>')}]),angular.module("uib/template/progressbar/progressbar.html",[]).run(["$templateCache",function(a){a.put("uib/template/progressbar/progressbar.html",'<div class="progress">\n <div class="progress-bar" ng-class="type && \'progress-bar-\' + type" role="progressbar" aria-valuenow="{{value}}" aria-valuemin="0" aria-valuemax="{{max}}" ng-style="{width: (percent < 100 ? percent : 100) + \'%\'}" aria-valuetext="{{percent | number:0}}%" aria-labelledby="{{::title}}" ng-transclude></div>\n</div>\n')}]),angular.module("uib/template/rating/rating.html",[]).run(["$templateCache",function(a){a.put("uib/template/rating/rating.html",'<span ng-mouseleave="reset()" ng-keydown="onKeydown($event)" tabindex="0" role="slider" aria-valuemin="0" aria-valuemax="{{range.length}}" aria-valuenow="{{value}}" aria-valuetext="{{title}}">\n <span ng-repeat-start="r in range track by $index" class="sr-only">({{ $index < value ? \'*\' : \' \' }})</span>\n <i ng-repeat-end ng-mouseenter="enter($index + 1)" ng-click="rate($index + 1)" class="glyphicon" ng-class="$index < value && (r.stateOn || \'glyphicon-star\') || (r.stateOff || \'glyphicon-star-empty\')" ng-attr-title="{{r.title}}"></i>\n</span>\n')}]),angular.module("uib/template/tabs/tab.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tab.html",'<li ng-class="[{active: active, disabled: disabled}, classes]" class="uib-tab nav-item">\n <a href ng-click="select($event)" class="nav-link" uib-tab-heading-transclude>{{heading}}</a>\n</li>\n')}]),angular.module("uib/template/tabs/tabset.html",[]).run(["$templateCache",function(a){a.put("uib/template/tabs/tabset.html",'<div>\n <ul class="nav nav-{{tabset.type || \'tabs\'}}" ng-class="{\'nav-stacked\': vertical, \'nav-justified\': justified}" ng-transclude></ul>\n <div class="tab-content">\n <div class="tab-pane"\n ng-repeat="tab in tabset.tabs"\n ng-class="{active: tabset.active === tab.index}"\n uib-tab-content-transclude="tab">\n </div>\n </div>\n</div>\n')}]),angular.module("uib/template/timepicker/timepicker.html",[]).run(["$templateCache",function(a){a.put("uib/template/timepicker/timepicker.html",'<table class="uib-timepicker">\n <tbody>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-increment hours"><a ng-click="incrementHours()" ng-class="{disabled: noIncrementHours()}" class="btn btn-link" ng-disabled="noIncrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-increment minutes"><a ng-click="incrementMinutes()" ng-class="{disabled: noIncrementMinutes()}" class="btn btn-link" ng-disabled="noIncrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-increment seconds"><a ng-click="incrementSeconds()" ng-class="{disabled: noIncrementSeconds()}" class="btn btn-link" ng-disabled="noIncrementSeconds()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-up"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n <tr>\n <td class="form-group uib-time hours" ng-class="{\'has-error\': invalidHours}">\n <input type="text" placeholder="HH" ng-model="hours" ng-change="updateHours()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementHours()" ng-blur="blur()">\n </td>\n <td class="uib-separator">:</td>\n <td class="form-group uib-time minutes" ng-class="{\'has-error\': invalidMinutes}">\n <input type="text" placeholder="MM" ng-model="minutes" ng-change="updateMinutes()" class="form-control text-center" ng-readonly="::readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementMinutes()" ng-blur="blur()">\n </td>\n <td ng-show="showSeconds" class="uib-separator">:</td>\n <td class="form-group uib-time seconds" ng-class="{\'has-error\': invalidSeconds}" ng-show="showSeconds">\n <input type="text" placeholder="SS" ng-model="seconds" ng-change="updateSeconds()" class="form-control text-center" ng-readonly="readonlyInput" maxlength="2" tabindex="{{::tabindex}}" ng-disabled="noIncrementSeconds()" ng-blur="blur()">\n </td>\n <td ng-show="showMeridian" class="uib-time am-pm"><button type="button" ng-class="{disabled: noToggleMeridian()}" class="btn btn-default text-center" ng-click="toggleMeridian()" ng-disabled="noToggleMeridian()" tabindex="{{::tabindex}}">{{meridian}}</button></td>\n </tr>\n <tr class="text-center" ng-show="::showSpinners">\n <td class="uib-decrement hours"><a ng-click="decrementHours()" ng-class="{disabled: noDecrementHours()}" class="btn btn-link" ng-disabled="noDecrementHours()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td>&nbsp;</td>\n <td class="uib-decrement minutes"><a ng-click="decrementMinutes()" ng-class="{disabled: noDecrementMinutes()}" class="btn btn-link" ng-disabled="noDecrementMinutes()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showSeconds">&nbsp;</td>\n <td ng-show="showSeconds" class="uib-decrement seconds"><a ng-click="decrementSeconds()" ng-class="{disabled: noDecrementSeconds()}" class="btn btn-link" ng-disabled="noDecrementSeconds()" tabindex="{{::tabindex}}"><span class="glyphicon glyphicon-chevron-down"></span></a></td>\n <td ng-show="showMeridian"></td>\n </tr>\n </tbody>\n</table>\n')}]),angular.module("uib/template/typeahead/typeahead-match.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-match.html",'<a href\n tabindex="-1"\n ng-bind-html="match.label | uibTypeaheadHighlight:query"\n ng-attr-title="{{match.label}}"></a>\n')}]),angular.module("uib/template/typeahead/typeahead-popup.html",[]).run(["$templateCache",function(a){a.put("uib/template/typeahead/typeahead-popup.html",'<ul class="dropdown-menu" ng-show="isOpen() && !moveInProgress" ng-style="{top: position().top+\'px\', left: position().left+\'px\'}" role="listbox" aria-hidden="{{!isOpen()}}">\n <li ng-repeat="match in matches track by $index" ng-class="{active: isActive($index) }" ng-mouseenter="selectActive($index)" ng-click="selectMatch($index, $event)" role="option" id="{{::match.id}}">\n <div uib-typeahead-match index="$index" match="match" query="query" template-url="templateUrl"></div>\n </li>\n</ul>\n')}]),angular.module("ui.bootstrap.carousel").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibCarouselCss&&angular.element(document).find("head").prepend('<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>'),angular.$$uibCarouselCss=!0}),angular.module("ui.bootstrap.datepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-left,.uib-right{width:100%}</style>'),angular.$$uibDatepickerCss=!0}),angular.module("ui.bootstrap.position").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibPositionCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute !important;top:-9999px !important;width:50px !important;height:50px !important;overflow:scroll !important;}.uib-position-body-scrollbar-measure{overflow:scroll !important;}</style>'),angular.$$uibPositionCss=!0}),angular.module("ui.bootstrap.datepickerPopup").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibDatepickerpopupCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}</style>'),angular.$$uibDatepickerpopupCss=!0}),angular.module("ui.bootstrap.tooltip").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTooltipCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>'),angular.$$uibTooltipCss=!0}),angular.module("ui.bootstrap.timepicker").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTimepickerCss&&angular.element(document).find("head").prepend('<style type="text/css">.uib-time input{width:50px;}</style>'),angular.$$uibTimepickerCss=!0}),angular.module("ui.bootstrap.typeahead").run(function(){!angular.$$csp().noInlineStyle&&!angular.$$uibTypeaheadCss&&angular.element(document).find("head").prepend('<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>'),angular.$$uibTypeaheadCss=!0});
1769 ;/*!
1769 ;/*!
1770 * State-based routing for AngularJS
1770 * State-based routing for AngularJS
1771 * @version v1.0.0-alpha.5
1771 * @version v1.0.0-alpha.5
1772 * @link http://angular-ui.github.com/ui-router
1772 * @link http://angular-ui.github.com/ui-router
1773 * @license MIT License, http://www.opensource.org/licenses/MIT
1773 * @license MIT License, http://www.opensource.org/licenses/MIT
1774 */
1774 */
1775 !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("angular-ui-router",[],e):"object"==typeof exports?exports["angular-ui-router"]=e():t["angular-ui-router"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(1)),r(n(53)),r(n(54)),r(n(56)),n(57),n(58),n(59),n(60),Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="ui.router"},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(2)),r(n(20)),r(n(44)),r(n(40)),r(n(17)),r(n(13)),r(n(45)),r(n(49)),r(n(51));var i=n(52);e.UIRouter=i.UIRouter},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(3)),r(n(6)),r(n(7)),r(n(5)),r(n(4)),r(n(8)),r(n(9)),r(n(12))},function(t,e,n){"use strict";function r(t,e,n,r){return void 0===r&&(r=Object.keys(t)),r.filter(function(e){return"function"==typeof t[e]}).forEach(function(r){return e[r]=t[r].bind(n)})}function i(t){void 0===t&&(t={});for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=o.apply(null,[{}].concat(n));return e.extend({},i,c(t||{},Object.keys(i)))}function o(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.forEach(n,function(n){e.forEach(n,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function a(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function s(t,e,n){void 0===n&&(n=Object.keys(t));for(var r=0;r<n.length;r++){var i=n[r];if(t[i]!=e[i])return!1}return!0}function u(t,e){var n={},r=_(arguments,2);for(var i in e)t(r,i)&&(n[i]=e[i]);return n}function c(t){return u.apply(null,[T].concat(_(arguments)))}function l(t){return u.apply(null,[k.not(T)].concat(_(arguments)))}function f(t,e){return v(t,k.prop(e))}function p(t,n){var r=P.isArray(t),i=r?[]:{},o=r?function(t){return i.push(t)}:function(t,e){return i[e]=t};return e.forEach(t,function(t,e){n(t,e)&&o(t,e)}),i}function h(t,n){var r;return e.forEach(t,function(t,e){r||n(t,e)&&(r=t)}),r}function v(t,n){var r=P.isArray(t)?[]:{};return e.forEach(t,function(t,e){return r[e]=n(t,e)}),r}function d(t,e){return t.push(e),t}function m(t,e){return void 0===e&&(e="assert failure"),function(n){if(!t(n))throw new Error(P.isFunction(e)?e(n):e);return!0}}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];if(0===t.length)return[];var n=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991);return Array.apply(null,Array(n)).map(function(e,n){return t.map(function(t){return t[n]})})}function y(t,e){var n,r;if(P.isArray(e)&&(n=e[0],r=e[1]),!P.isString(n))throw new Error("invalid parameters to applyPairs");return t[n]=r,t}function w(t){return t.length&&t[t.length-1]||void 0}function $(t,n){return n&&Object.keys(n).forEach(function(t){return delete n[t]}),n||(n={}),e.extend(n,t)}function b(t,e,n){return P.isArray(t)?t.forEach(e,n):void Object.keys(t).forEach(function(n){return e(t[n],n)})}function R(t,e){return Object.keys(e).forEach(function(n){return t[n]=e[n]}),t}function S(t,n){return _(arguments,1).filter(e.identity).reduce(R,t)}function x(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var n=typeof t,r=typeof e;if(n!==r||"object"!==n)return!1;var i=[t,e];if(k.all(P.isArray)(i))return E(t,e);if(k.all(P.isDate)(i))return t.getTime()===e.getTime();if(k.all(P.isRegExp)(i))return t.toString()===e.toString();if(k.all(P.isFunction)(i))return!0;var o=[P.isFunction,P.isArray,P.isDate,P.isRegExp];if(o.map(k.any).reduce(function(t,e){return t||!!e(i)},!1))return!1;var a,s={};for(a in t){if(!x(t[a],e[a]))return!1;s[a]=!0}for(a in e)if(!s[a])return!1;return!0}function E(t,e){return t.length!==e.length?!1:g(t,e).reduce(function(t,e){return t&&x(e[0],e[1])},!0)}var P=n(4),k=n(5),O="undefined"==typeof window?{}:window,C=O.angular||{};e.fromJson=C.fromJson||JSON.parse.bind(JSON),e.toJson=C.toJson||JSON.stringify.bind(JSON),e.copy=C.copy||$,e.forEach=C.forEach||b,e.extend=C.extend||S,e.equals=C.equals||x,e.identity=function(t){return t},e.noop=function(){},e.abstractKey="abstract",e.bindFunctions=r,e.inherit=function(t,n){return e.extend(new(e.extend(function(){},{prototype:t})),n)};var _=function(t,e){return void 0===e&&(e=0),Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(t,e))},T=function(t,e){return-1!==t.indexOf(e)};e.removeFrom=k.curry(function(t,e){var n=t.indexOf(e);return n>=0&&t.splice(n,1),t}),e.defaults=i,e.merge=o,e.mergeR=function(t,n){return e.extend(t,n)},e.ancestors=a,e.equalForKeys=s,e.pick=c,e.omit=l,e.pluck=f,e.filter=p,e.find=h,e.mapObj=v,e.map=v,e.values=function(t){return Object.keys(t).map(function(e){return t[e]})},e.allTrueR=function(t,e){return t&&e},e.anyTrueR=function(t,e){return t||e},e.unnestR=function(t,e){return t.concat(e)},e.flattenR=function(t,n){return P.isArray(n)?t.concat(n.reduce(e.flattenR,[])):d(t,n)},e.unnest=function(t){return t.reduce(e.unnestR,[])},e.flatten=function(t){return t.reduce(e.flattenR,[])},e.assertPredicate=m,e.pairs=function(t){return Object.keys(t).map(function(e){return[e,t[e]]})},e.arrayTuples=g,e.applyPairs=y,e.tail=w},function(t,e,n){"use strict";function r(t){if(e.isArray(t)&&t.length){var n=t.slice(0,-1),r=t.slice(-1);return!(n.filter(i.not(e.isString)).length||r.filter(i.not(e.isFunction)).length)}return e.isFunction(t)}var i=n(5),o=Object.prototype.toString,a=function(t){return function(e){return typeof e===t}};e.isUndefined=a("undefined"),e.isDefined=i.not(e.isUndefined),e.isNull=function(t){return null===t},e.isFunction=a("function"),e.isNumber=a("number"),e.isString=a("string"),e.isObject=function(t){return null!==t&&"object"==typeof t},e.isArray=Array.isArray,e.isDate=function(t){return"[object Date]"===o.call(t)},e.isRegExp=function(t){return"[object RegExp]"===o.call(t)},e.isInjectable=r,e.isPromise=i.and(e.isObject,i.pipe(i.prop("then"),e.isFunction))},function(t,e){"use strict";function n(t){function e(n){return n.length>=r?t.apply(null,n):function(){return e(n.concat([].slice.apply(arguments)))}}var n=[].slice.apply(arguments,[1]),r=t.length;return e(n)}function r(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return r.apply(null,[].slice.call(arguments).reverse())}function o(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)&&e.apply(null,n)}}function a(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)||e.apply(null,n)}}function s(t,e){return function(n){return n[t].apply(n,e)}}function u(t){return function(e){for(var n=0;n<t.length;n++)if(t[n][0](e))return t[n][1](e)}}e.curry=n,e.compose=r,e.pipe=i,e.prop=function(t){return function(e){return e&&e[t]}},e.propEq=n(function(t,e,n){return n&&n[t]===e}),e.parse=function(t){return i.apply(null,t.split(".").map(e.prop))},e.not=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];return!t.apply(null,e)}},e.and=o,e.or=a,e.all=function(t){return function(e){return e.reduce(function(e,n){return e&&!!t(n)},!0)}},e.any=function(t){return function(e){return e.reduce(function(e,n){return e||!!t(n)},!1)}},e.none=e.not(e.any),e.is=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},e.eq=function(t){return function(e){return t===e}},e.val=function(t){return function(){return t}},e.invoke=s,e.pattern=u},function(t,e){"use strict";var n=function(t){return function(){throw new Error(t+"(): No coreservices implementation for UI-Router is loaded. You should include one of: ['angular1.js']")}},r={$q:void 0,$injector:void 0,location:{},locationConfig:{},template:{}};e.services=r,["replace","url","path","search","hash","onChange"].forEach(function(t){return r.location[t]=n(t)}),["port","protocol","host","baseHref","html5Mode","hashPrefix"].forEach(function(t){return r.locationConfig[t]=n(t)})},function(t,e){"use strict";var n=function(){function t(t){this.text=t,this.glob=t.split(".")}return t.prototype.matches=function(t){for(var e=t.split("."),n=0,r=this.glob.length;r>n;n++)"*"===this.glob[n]&&(e[n]="*");return"**"===this.glob[0]&&(e=e.slice(e.indexOf(this.glob[1])),e.unshift("**")),"**"===this.glob[this.glob.length-1]&&(e.splice(e.indexOf(this.glob[this.glob.length-2])+1,Number.MAX_VALUE),e.push("**")),this.glob.length!=e.length?!1:e.join("")===this.glob.join("")},t.is=function(t){return t.indexOf("*")>-1},t.fromString=function(e){return this.is(e)?new t(e):null},t}();e.Glob=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this._items=t,this._limit=e}return t.prototype.enqueue=function(t){var e=this._items;return e.push(t),this._limit&&e.length>this._limit&&e.shift(),t},t.prototype.dequeue=function(){return this.size()?this._items.splice(0,1)[0]:void 0},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(t){var e=this._items.indexOf(t);return e>-1&&this._items.splice(e,1)[0]},t.prototype.peekTail=function(){return this._items[this._items.length-1]},t.prototype.peekHead=function(){return this.size()?this._items[0]:void 0},t}();e.Queue=n},function(t,e,n){"use strict";function r(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function i(t,e){for(;e.length<t;)e+=" ";return e}function o(t){return t.replace(/^([A-Z])/,function(t){return t.toLowerCase()}).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function a(t){return"Promise("+JSON.stringify(t)+")"}function s(t){var e=u(t),n=e.match(/^(function [^ ]+\([^)]*\))/);return n?n[1]:e}function u(t){var e=l.isArray(t)?t.slice(-1)[0]:t;return e&&e.toString()||"undefined"}function c(t){function e(t){if(l.isObject(t)){if(-1!==n.indexOf(t))return"[circular ref]";n.push(t)}return g(t)}var n=[];return JSON.stringify(t,function(t,n){return e(n)}).replace(/\\"/g,'"')}var l=n(4),f=n(10),p=n(3),h=n(5),v=n(11),d=n(32);e.maxLength=r,e.padString=i,e.kebobString=o,e.functionToString=s,e.fnToString=u;var m=f.Rejection.isTransitionRejectionPromise,g=h.pattern([[h.not(l.isDefined),h.val("undefined")],[l.isNull,h.val("null")],[l.isPromise,a],[m,function(t){return t._transitionRejection.toString()}],[h.is(f.Rejection),h.invoke("toString")],[h.is(v.Transition),h.invoke("toString")],[h.is(d.Resolvable),h.invoke("toString")],[l.isInjectable,s],[h.val(!0),p.identity]]);e.stringify=c,e.beforeAfterSubstr=function(t){return function(e){if(!e)return["",""];var n=e.indexOf(t);return-1===n?[e,""]:[e.substr(0,n),e.substr(n+1)]}}},function(t,e,n){"use strict";var r=n(3),i=n(6),o=n(9);!function(t){t[t.SUPERSEDED=2]="SUPERSEDED",t[t.ABORTED=3]="ABORTED",t[t.INVALID=4]="INVALID",t[t.IGNORED=5]="IGNORED"}(e.RejectType||(e.RejectType={}));var a=e.RejectType,s=function(){function t(t,e,n){this.type=t,this.message=e,this.detail=n}return t.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():o.stringify(t)},e=this.type,n=this.message,r=t(this.detail);return"TransitionRejection(type: "+e+", message: "+n+", detail: "+r+")"},t.prototype.toPromise=function(){return r.extend(i.services.$q.reject(this),{_transitionRejection:this})},t.isTransitionRejectionPromise=function(e){return e&&"function"==typeof e.then&&e._transitionRejection instanceof t},t.superseded=function(e,n){var r="The transition has been superseded by a different transition (see detail).",i=new t(a.SUPERSEDED,r,e);return n&&n.redirected&&(i.redirected=!0),i},t.redirected=function(e){return t.superseded(e,{redirected:!0})},t.invalid=function(e){var n="This transition is invalid (see detail)";return new t(a.INVALID,n,e)},t.ignored=function(e){var n="The transition was ignored.";return new t(a.IGNORED,n,e)},t.aborted=function(e){var n="The transition has been aborted.";return new t(a.ABORTED,n,e)},t}();e.Rejection=s},function(t,e,n){"use strict";var r=n(12),i=n(6),o=n(3),a=n(4),s=n(5),u=n(13),c=n(39),l=n(38),f=n(17),p=n(20),h=n(40),v=n(10),d=0,m=s.prop("self"),g=function(){function t(t,e,n){var r=this;if(this._transitionService=n,this._deferred=i.services.$q.defer(),this.promise=this._deferred.promise,this.treeChanges=function(){return r._treeChanges},this.isActive=function(){return r===r._options.current()},!e.valid())throw new Error(e.error());u.HookRegistry.mixin(new u.HookRegistry,this),this._options=o.extend({current:s.val(this)},e.options()),this.$id=d++;var a=l.PathFactory.buildToPath(t,e);a=l.PathFactory.applyViewConfigs(n.$view,a),this._treeChanges=l.PathFactory.treeChanges(t,a,this._options.reloadState),l.PathFactory.bindTransitionResolve(this._treeChanges,this)}return t.prototype.$from=function(){return o.tail(this._treeChanges.from).state},t.prototype.$to=function(){return o.tail(this._treeChanges.to).state},t.prototype.from=function(){return this.$from().self},t.prototype.to=function(){return this.$to().self},t.prototype.is=function(e){return e instanceof t?this.is({to:e.$to().name,from:e.$from().name}):!(e.to&&!u.matchState(this.$to(),e.to)||e.from&&!u.matchState(this.$from(),e.from))},t.prototype.params=function(t){return void 0===t&&(t="to"),this._treeChanges[t].map(s.prop("paramValues")).reduce(o.mergeR,{})},t.prototype.resolves=function(){return o.map(o.tail(this._treeChanges.to).resolveContext.getResolvables(),function(t){return t.data})},t.prototype.addResolves=function(t,e){void 0===e&&(e="");var n="string"==typeof e?e:e.name,r=this._treeChanges.to,i=o.find(r,function(t){return t.state.name===n});o.tail(r).resolveContext.addResolvables(h.Resolvable.makeResolvables(t),i.state)},t.prototype.previous=function(){return this._options.previous||null},t.prototype.options=function(){return this._options},t.prototype.entering=function(){return o.map(this._treeChanges.entering,s.prop("state")).map(m)},t.prototype.exiting=function(){return o.map(this._treeChanges.exiting,s.prop("state")).map(m).reverse()},t.prototype.retained=function(){return o.map(this._treeChanges.retained,s.prop("state")).map(m)},t.prototype.views=function(t,e){void 0===t&&(t="entering");var n=this._treeChanges[t];return n=e?n.filter(s.propEq("state",e)):n,n.map(s.prop("views")).filter(o.identity).reduce(o.unnestR,[])},t.prototype.redirect=function(e){var n=o.extend({},this.options(),e.options(),{previous:this});e=new f.TargetState(e.identifier(),e.$state(),e.params(),n);var r=new t(this._treeChanges.from,e,this._transitionService),i=e.options().reloadState,a=this.treeChanges().to,s=c.Node.matching(r.treeChanges().to,a).filter(function(t){return!i||!i.includes[t.state.name]}),u=function(t,e){return-1===["$stateParams","$transition$"].indexOf(e)};return s.forEach(function(t,e){return o.extend(t.resolves,o.filter(a[e].resolves,u))}),r},t.prototype._changedParams=function(){var t=this._treeChanges,e=t.to,n=t.from;if(!this._options.reload&&o.tail(e).state===o.tail(n).state){var r=e.map(function(t){return t.paramSchema}),i=[e,n].map(function(t){return t.map(function(t){return t.paramValues})}),a=i[0],s=i[1],u=o.arrayTuples(r,a,s);return u.map(function(t){var e=t[0],n=t[1],r=t[2];return p.Param.changed(e,n,r)}).reduce(o.unnestR,[])}},t.prototype.dynamic=function(){var t=this._changedParams();return t?t.map(function(t){return t.dynamic}).reduce(o.anyTrueR,!1):!1},t.prototype.ignored=function(){var t=this._changedParams();return t?0===t.length:!1},t.prototype.hookBuilder=function(){return new u.HookBuilder(this._transitionService,this,{transition:this,current:this._options.current})},t.prototype.run=function(){var t=this,e=this.hookBuilder(),n=u.TransitionHook.runSynchronousHooks,o=function(){return n(e.getOnSuccessHooks(),{},!0)},a=function(t){return n(e.getOnErrorHooks(),{$error$:t},!0)};this.promise.then(o,a);var s=n(e.getOnBeforeHooks());if(v.Rejection.isTransitionRejectionPromise(s)){s["catch"](function(){return 0});var c=s._transitionRejection;return this._deferred.reject(c),this.promise}if(!this.valid()){var l=new Error(this.error());return this._deferred.reject(l),this.promise}if(this.ignored())return r.trace.traceTransitionIgnored(this),this._deferred.reject(v.Rejection.ignored()),this.promise;var f=function(){t.success=!0,t._deferred.resolve(t),r.trace.traceSuccess(t.$to(),t)},p=function(e){return t.success=!1,t._deferred.reject(e),r.trace.traceError(e,t),i.services.$q.reject(e)};r.trace.traceTransitionStart(this);var h=e.asyncHooks().reduce(function(t,e){return t.then(e.invokeHook.bind(e))},s);return h.then(f,p),this.promise},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.$to();return t.self[o.abstractKey]?"Cannot transition to abstract state '"+t.name+"'":p.Param.validates(t.parameters(),this.params())?void 0:"Param values not valid for state '"+t.name+"'"},t.prototype.toString=function(){var t=this.from(),e=this.to(),n=function(t){return null!==t["#"]&&void 0!==t["#"]?t:o.omit(t,"#")},r=this.$id,i=a.isObject(t)?t.name:t,u=o.toJson(n(this._treeChanges.from.map(s.prop("paramValues")).reduce(o.mergeR,{}))),c=this.valid()?"":"(X) ",l=a.isObject(e)?e.name:e,f=o.toJson(n(this.params()));return"Transition#"+r+"( '"+i+"'"+u+" -> "+c+"'"+l+"'"+f+" )"},t}();e.Transition=g},function(t,e,n){"use strict";function r(t){return t?"[ui-view#"+t.id+" tag in template from '"+(t.creationContext.name||"(root)")+"' state]: fqn: '"+t.fqn+"', name: '"+t.name+"@"+t.creationContext+"')":"ui-view (defunct)"}function i(t){return a.isNumber(t)?c[t]:c[c[t]]}var o=n(5),a=n(4),s=n(9),u=function(t){return"[ViewConfig from '"+(t.viewDecl.$context.name||"(root)")+"' state]: target ui-view: '"+t.viewDecl.$uiViewName+"@"+t.viewDecl.$uiViewContextAnchor+"'"};!function(t){t[t.RESOLVE=0]="RESOLVE",t[t.TRANSITION=1]="TRANSITION",t[t.HOOK=2]="HOOK",t[t.INVOKE=3]="INVOKE",t[t.UIVIEW=4]="UIVIEW",t[t.VIEWCONFIG=5]="VIEWCONFIG"}(e.Category||(e.Category={}));var c=e.Category,l=function(){function t(){this._enabled={},this.approximateDigests=0}return t.prototype._set=function(t,e){var n=this;e.length||(e=Object.keys(c).filter(function(t){return isNaN(parseInt(t,10))}).map(function(t){return c[t]})),e.map(i).forEach(function(e){return n._enabled[e]=t})},t.prototype.enable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!0,t)},t.prototype.disable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!1,t)},t.prototype.enabled=function(t){return!!this._enabled[i(t)]},t.prototype.traceTransitionStart=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Started -> "+r)}},t.prototype.traceTransitionIgnored=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Ignored <> "+r)}},t.prototype.traceHookInvocation=function(t,e){if(this.enabled(c.HOOK)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=o.parse("traceData.hookType")(e)||"internal",a=o.parse("traceData.context.state.name")(e)||o.parse("traceData.context")(e)||"unknown",u=s.functionToString(t.fn);console.log("Transition #"+n+" Digest #"+r+": Hook -> "+i+" context: "+a+", "+s.maxLength(200,u))}},t.prototype.traceHookResult=function(t,e,n){if(this.enabled(c.HOOK)){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=s.stringify(t),u=s.stringify(e);console.log("Transition #"+r+" Digest #"+i+": <- Hook returned: "+s.maxLength(200,a)+", transition result: "+s.maxLength(200,u))}},t.prototype.traceResolvePath=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=e&&e.resolvePolicy;console.log("Transition #"+n+" Digest #"+r+": Resolving "+i+" ("+a+")")}},t.prototype.traceResolvePathElement=function(t,e,n){if(this.enabled(c.RESOLVE)&&e.length){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=Object.keys(e).join(", "),s=t&&t.toString(),u=n&&n.resolvePolicy;console.log("Transition #"+r+" Digest #"+i+": Resolve "+s+" resolvables: ["+a+"] ("+u+")")}},t.prototype.traceResolveResolvable=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString();console.log("Transition #"+n+" Digest #"+r+": Resolving -> "+i)}},t.prototype.traceResolvableResolved=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=s.stringify(t.data);console.log("Transition #"+n+" Digest #"+r+": <- Resolved "+i+" to: "+s.maxLength(200,a))}},t.prototype.tracePathElementInvoke=function(t,e,n,r){if(this.enabled(c.INVOKE)){var i=o.parse("transition.$id")(r),a=this.approximateDigests,u=t&&t.state&&t.state.toString(),l=s.functionToString(e);console.log("Transition #"+i+" Digest #"+a+": Invoke "+r.when+": context: "+u+" "+s.maxLength(200,l))}},t.prototype.traceError=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Rejected "+i+", reason: "+t)}},t.prototype.traceSuccess=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=t.name,o=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Success "+o+", final state: "+i)}},t.prototype.traceUiViewEvent=function(t,e,n){void 0===n&&(n=""),this.enabled(c.UIVIEW)&&console.log("ui-view: "+s.padString(30,t)+" "+r(e)+n)},t.prototype.traceUiViewConfigUpdated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Updating",t," with ViewConfig from context='"+e+"'")},t.prototype.traceUiViewScopeCreated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Created scope for",t,", scope #"+e.$id)},t.prototype.traceUiViewFill=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Fill",t," with: "+s.maxLength(200,e))},t.prototype.traceViewServiceEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+u(e))},t.prototype.traceViewServiceUiViewEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+r(e))},t}();e.Trace=l;var f=new l;e.trace=f},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(14)),r(n(15)),r(n(10)),r(n(11)),r(n(16)),r(n(43))},function(t,e,n){"use strict";function r(t){return void 0===t&&(t=!1),function(e,n){var r=t?-1:1,i=(e.node.state.path.length-n.node.state.path.length)*r;return 0!==i?i:n.hook.priority-e.hook.priority}}var i=n(3),o=n(4),a=n(13),s=function(){function t(t,e,n){var o=this;this.$transitions=t,this.transition=e,this.baseHookOptions=n,this.getOnBeforeHooks=function(){return o._buildNodeHooks("onBefore","to",r(),void 0,{async:!1})},this.getOnStartHooks=function(){return o._buildNodeHooks("onStart","to",r())},this.getOnExitHooks=function(){return o._buildNodeHooks("onExit","exiting",r(!0),function(t){return{$state$:t.state}})},this.getOnRetainHooks=function(){return o._buildNodeHooks("onRetain","retained",r(),function(t){return{$state$:t.state}})},this.getOnEnterHooks=function(){return o._buildNodeHooks("onEnter","entering",r(),function(t){return{$state$:t.state}})},this.getOnFinishHooks=function(){return o._buildNodeHooks("onFinish","to",r(),function(t){return{$treeChanges$:o.treeChanges}})},this.getOnSuccessHooks=function(){return o._buildNodeHooks("onSuccess","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.getOnErrorHooks=function(){return o._buildNodeHooks("onError","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.treeChanges=e.treeChanges(),this.toState=i.tail(this.treeChanges.to).state,this.fromState=i.tail(this.treeChanges.from).state,this.transitionOptions=e.options()}return t.prototype.asyncHooks=function(){var t=this.getOnStartHooks(),e=this.getOnExitHooks(),n=this.getOnRetainHooks(),r=this.getOnEnterHooks(),o=this.getOnFinishHooks(),a=[t,e,n,r,o];return a.reduce(i.unnestR,[]).filter(i.identity)},t.prototype._buildNodeHooks=function(t,e,n,r,o){var s=this;void 0===r&&(r=function(t){return{}});var u=this._matchingHooks(t,this.treeChanges);if(!u)return[];var c=function(n){var u=n.matches(s.treeChanges),c=u[e];return c.map(function(e){var u=i.extend({bind:n.bind,traceData:{hookType:t,context:e}},s.baseHookOptions,o),c=new a.TransitionHook(n.callback,r(e),e.resolveContext,u);return{hook:n,node:e,transitionHook:c}})};return u.map(c).reduce(i.unnestR,[]).sort(n).map(function(t){return t.transitionHook})},t.prototype._matchingHooks=function(t,e){return[this.transition,this.$transitions].map(function(e){return e.getHooks(t)}).filter(i.assertPredicate(o.isArray,"broken event named: "+t)).reduce(i.unnestR,[]).filter(function(t){return t.matches(e)})},t}();e.HookBuilder=s},function(t,e,n){"use strict";function r(t,e){function n(t){for(var e=r,n=0;n<e.length;n++){var i=s.Glob.fromString(e[n]);if(i&&i.matches(t.name)||!i&&e[n]===t.name)return!0}return!1}var r=a.isString(e)?[e]:e,i=a.isFunction(r)?r:n;return!!i(t)}function i(t,e){return function(n,r,i){void 0===i&&(i={});var a=new u(n,r,i);return t[e].push(a),function(){o.removeFrom(t[e])(a)}}}var o=n(3),a=n(4),s=n(7);e.matchState=r;var u=function(){function t(t,e,n){void 0===n&&(n={}),this.callback=e,this.matchCriteria=o.extend({to:!0,from:!0,exiting:!0,retained:!0,entering:!0},t),this.priority=n.priority||0,this.bind=n.bind||null}return t._matchingNodes=function(t,e){if(e===!0)return t;var n=t.filter(function(t){return r(t.state,e)});return n.length?n:null},t.prototype.matches=function(e){var n=this.matchCriteria,r=t._matchingNodes,i={to:r([o.tail(e.to)],n.to),from:r([o.tail(e.from)],n.from),exiting:r(e.exiting,n.exiting),retained:r(e.retained,n.retained),entering:r(e.entering,n.entering)},a=["to","from","exiting","retained","entering"].map(function(t){return i[t]}).reduce(o.allTrueR,!0);return a?i:null},t}();e.EventHook=u;var c=function(){function t(){var t=this;this._transitionEvents={onBefore:[],onStart:[],onEnter:[],onRetain:[],onExit:[],onFinish:[],onSuccess:[],onError:[]},this.getHooks=function(e){return t._transitionEvents[e]},this.onBefore=i(this._transitionEvents,"onBefore"),this.onStart=i(this._transitionEvents,"onStart"),this.onEnter=i(this._transitionEvents,"onEnter"),this.onRetain=i(this._transitionEvents,"onRetain"),this.onExit=i(this._transitionEvents,"onExit"),this.onFinish=i(this._transitionEvents,"onFinish"),this.onSuccess=i(this._transitionEvents,"onSuccess"),this.onError=i(this._transitionEvents,"onError")}return t.mixin=function(t,e){Object.keys(t._transitionEvents).concat(["getHooks"]).forEach(function(n){return e[n]=t[n]})},t}();e.HookRegistry=c},function(t,e,n){"use strict";var r=n(3),i=n(9),o=n(4),a=n(5),s=n(12),u=n(6),c=n(10),l=n(17),f={async:!0,rejectIfSuperseded:!0,current:r.noop,transition:null,traceData:{},bind:null},p=function(){function t(t,e,n,i){var o=this;this.fn=t,this.locals=e,this.resolveContext=n,this.options=i,this.isSuperseded=function(){return o.options.current()!==o.options.transition},this.options=r.defaults(i,f)}return t.prototype.invokeHook=function(t){var e=this,n=this,i=n.options,o=n.fn,a=n.resolveContext,u=r.extend({},this.locals,t);if(s.trace.traceHookInvocation(this,i),i.rejectIfSuperseded&&this.isSuperseded())return c.Rejection.superseded(i.current()).toPromise();if(!i.async){var l=a.invokeNow(o,u,i);return this.handleHookResult(l)}return a.invokeLater(o,u,i).then(function(t){return e.handleHookResult(t)})},t.prototype.handleHookResult=function(t){var e=this;if(o.isDefined(t)){var n=a.pattern([[this.isSuperseded,function(){return c.Rejection.superseded(e.options.current()).toPromise()}],[a.eq(!1),function(){return c.Rejection.aborted("Hook aborted transition").toPromise()}],[a.is(l.TargetState),function(t){return c.Rejection.redirected(t).toPromise()}],[o.isPromise,function(t){return t.then(e.handleHookResult.bind(e))}]]),r=n(t);return r&&s.trace.traceHookResult(t,r,this.options),r}},t.prototype.toString=function(){var t=this,e=t.options,n=t.fn,r=a.parse("traceData.hookType")(e)||"internal",o=a.parse("traceData.context.state.name")(e)||a.parse("traceData.context")(e)||"unknown",s=i.fnToString(n);return r+" context: "+o+", "+i.maxLength(200,s)},t.runSynchronousHooks=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=!1);for(var r=[],i=0;i<t.length;i++)try{r.push(t[i].invokeHook(e))}catch(s){if(!n)return c.Rejection.aborted(s).toPromise();console.error("Swallowed exception during synchronous hook handler: "+s)}var l=r.filter(c.Rejection.isTransitionRejectionPromise);return l.length?l[0]:r.filter(o.isPromise).reduce(function(t,e){return t.then(a.val(e))},u.services.$q.when())},t}();e.TransitionHook=p},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(18)),r(n(19)),r(n(26)),r(n(33)),r(n(34)),r(n(35)),r(n(36)),r(n(37)),r(n(27))},function(t,e,n){"use strict";var r=n(4),i=n(3),o=function(){function t(e){this.stateRegistry=e,this.invalidCallbacks=[],i.bindFunctions(t.prototype,this,this)}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return r.isObject(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){this.invalidCallbacks.push(t)},t}();e.StateProvider=o},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(5),a=n(20),s=function(t){if(!i.isString(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},u=function(){function t(t,e){this.matcher=t;var n=this,i=function(t){return""===t.name},u=function(){return t.find("")};this.builders={self:[function(t){return t.self.$$state=function(){return t},t.self}],parent:[function(e){return i(e)?null:t.find(n.parentName(e))||u()}],data:[function(t){return t.parent&&t.parent.data&&(t.data=t.self.data=r.inherit(t.parent.data,t.data)),t.data}],url:[function(t){var n=t,i=s(n.url),o=t.parent,a=i?e.compile(i.val,{params:t.params||{},paramMap:function(t,e){return n.reloadOnSearch===!1&&e&&(t=r.extend(t||{},{dynamic:!0})),t}}):n.url;if(!a)return null;if(!e.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+t+"'");return i&&i.root?a:(o&&o.navigable||u()).url.append(a)}],navigable:[function(t){return!i(t)&&t.url?t:t.parent?t.parent.navigable:null}],params:[function(t){var e=function(t,e){return a.Param.fromConfig(e,null,t)},n=t.url&&t.url.parameters({inherit:!1})||[],i=r.values(r.map(r.omit(t.params||{},n.map(o.prop("id"))),e));return n.concat(i).map(function(t){return[t.id,t]}).reduce(r.applyPairs,{})}],views:[],path:[function(t){return t.parent?t.parent.path.concat(t):[t]}],includes:[function(t){var e=t.parent?r.extend({},t.parent.includes):{};return e[t.name]=!0,e}]}}return t.prototype.builder=function(t,e){var n=this.builders,r=n[t]||[];return i.isString(t)&&!i.isDefined(e)?r.length>1?r:r[0]:i.isString(t)&&i.isFunction(e)?(n[t]=r,n[t].push(e),function(){return n[t].splice(n[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,n=e.matcher,i=e.builders,o=this.parentName(t);if(o&&!n.find(o))return null;for(var a in i)if(i.hasOwnProperty(a)){var s=i[a].reduce(function(t,e){return function(n){return e(n,t)}},r.noop);t[a]=s(t)}return t},t.prototype.parentName=function(t){var e=t.name||"";return-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):t.parent?i.isString(t.parent)?t.parent:t.parent.name:""},t.prototype.name=function(t){var e=t.name;if(-1!==e.indexOf(".")||!t.parent)return e;var n=i.isString(t.parent)?t.parent:t.parent.name;return n?n+"."+e:e},t}();e.StateBuilder=u},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(21)),r(n(24)),r(n(25)),r(n(23))},function(t,e,n){
1775 !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("angular-ui-router",[],e):"object"==typeof exports?exports["angular-ui-router"]=e():t["angular-ui-router"]=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return t[r].call(i.exports,i,i.exports,e),i.loaded=!0,i.exports}var n={};return e.m=t,e.c=n,e.p="",e(0)}([function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(1)),r(n(53)),r(n(54)),r(n(56)),n(57),n(58),n(59),n(60),Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="ui.router"},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(2)),r(n(20)),r(n(44)),r(n(40)),r(n(17)),r(n(13)),r(n(45)),r(n(49)),r(n(51));var i=n(52);e.UIRouter=i.UIRouter},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(3)),r(n(6)),r(n(7)),r(n(5)),r(n(4)),r(n(8)),r(n(9)),r(n(12))},function(t,e,n){"use strict";function r(t,e,n,r){return void 0===r&&(r=Object.keys(t)),r.filter(function(e){return"function"==typeof t[e]}).forEach(function(r){return e[r]=t[r].bind(n)})}function i(t){void 0===t&&(t={});for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=o.apply(null,[{}].concat(n));return e.extend({},i,c(t||{},Object.keys(i)))}function o(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];return e.forEach(n,function(n){e.forEach(n,function(e,n){t.hasOwnProperty(n)||(t[n]=e)})}),t}function a(t,e){var n=[];for(var r in t.path){if(t.path[r]!==e.path[r])break;n.push(t.path[r])}return n}function s(t,e,n){void 0===n&&(n=Object.keys(t));for(var r=0;r<n.length;r++){var i=n[r];if(t[i]!=e[i])return!1}return!0}function u(t,e){var n={},r=_(arguments,2);for(var i in e)t(r,i)&&(n[i]=e[i]);return n}function c(t){return u.apply(null,[T].concat(_(arguments)))}function l(t){return u.apply(null,[k.not(T)].concat(_(arguments)))}function f(t,e){return v(t,k.prop(e))}function p(t,n){var r=P.isArray(t),i=r?[]:{},o=r?function(t){return i.push(t)}:function(t,e){return i[e]=t};return e.forEach(t,function(t,e){n(t,e)&&o(t,e)}),i}function h(t,n){var r;return e.forEach(t,function(t,e){r||n(t,e)&&(r=t)}),r}function v(t,n){var r=P.isArray(t)?[]:{};return e.forEach(t,function(t,e){return r[e]=n(t,e)}),r}function d(t,e){return t.push(e),t}function m(t,e){return void 0===e&&(e="assert failure"),function(n){if(!t(n))throw new Error(P.isFunction(e)?e(n):e);return!0}}function g(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];if(0===t.length)return[];var n=t.reduce(function(t,e){return Math.min(e.length,t)},9007199254740991);return Array.apply(null,Array(n)).map(function(e,n){return t.map(function(t){return t[n]})})}function y(t,e){var n,r;if(P.isArray(e)&&(n=e[0],r=e[1]),!P.isString(n))throw new Error("invalid parameters to applyPairs");return t[n]=r,t}function w(t){return t.length&&t[t.length-1]||void 0}function $(t,n){return n&&Object.keys(n).forEach(function(t){return delete n[t]}),n||(n={}),e.extend(n,t)}function b(t,e,n){return P.isArray(t)?t.forEach(e,n):void Object.keys(t).forEach(function(n){return e(t[n],n)})}function R(t,e){return Object.keys(e).forEach(function(n){return t[n]=e[n]}),t}function S(t,n){return _(arguments,1).filter(e.identity).reduce(R,t)}function x(t,e){if(t===e)return!0;if(null===t||null===e)return!1;if(t!==t&&e!==e)return!0;var n=typeof t,r=typeof e;if(n!==r||"object"!==n)return!1;var i=[t,e];if(k.all(P.isArray)(i))return E(t,e);if(k.all(P.isDate)(i))return t.getTime()===e.getTime();if(k.all(P.isRegExp)(i))return t.toString()===e.toString();if(k.all(P.isFunction)(i))return!0;var o=[P.isFunction,P.isArray,P.isDate,P.isRegExp];if(o.map(k.any).reduce(function(t,e){return t||!!e(i)},!1))return!1;var a,s={};for(a in t){if(!x(t[a],e[a]))return!1;s[a]=!0}for(a in e)if(!s[a])return!1;return!0}function E(t,e){return t.length!==e.length?!1:g(t,e).reduce(function(t,e){return t&&x(e[0],e[1])},!0)}var P=n(4),k=n(5),O="undefined"==typeof window?{}:window,C=O.angular||{};e.fromJson=C.fromJson||JSON.parse.bind(JSON),e.toJson=C.toJson||JSON.stringify.bind(JSON),e.copy=C.copy||$,e.forEach=C.forEach||b,e.extend=C.extend||S,e.equals=C.equals||x,e.identity=function(t){return t},e.noop=function(){},e.abstractKey="abstract",e.bindFunctions=r,e.inherit=function(t,n){return e.extend(new(e.extend(function(){},{prototype:t})),n)};var _=function(t,e){return void 0===e&&(e=0),Array.prototype.concat.apply(Array.prototype,Array.prototype.slice.call(t,e))},T=function(t,e){return-1!==t.indexOf(e)};e.removeFrom=k.curry(function(t,e){var n=t.indexOf(e);return n>=0&&t.splice(n,1),t}),e.defaults=i,e.merge=o,e.mergeR=function(t,n){return e.extend(t,n)},e.ancestors=a,e.equalForKeys=s,e.pick=c,e.omit=l,e.pluck=f,e.filter=p,e.find=h,e.mapObj=v,e.map=v,e.values=function(t){return Object.keys(t).map(function(e){return t[e]})},e.allTrueR=function(t,e){return t&&e},e.anyTrueR=function(t,e){return t||e},e.unnestR=function(t,e){return t.concat(e)},e.flattenR=function(t,n){return P.isArray(n)?t.concat(n.reduce(e.flattenR,[])):d(t,n)},e.unnest=function(t){return t.reduce(e.unnestR,[])},e.flatten=function(t){return t.reduce(e.flattenR,[])},e.assertPredicate=m,e.pairs=function(t){return Object.keys(t).map(function(e){return[e,t[e]]})},e.arrayTuples=g,e.applyPairs=y,e.tail=w},function(t,e,n){"use strict";function r(t){if(e.isArray(t)&&t.length){var n=t.slice(0,-1),r=t.slice(-1);return!(n.filter(i.not(e.isString)).length||r.filter(i.not(e.isFunction)).length)}return e.isFunction(t)}var i=n(5),o=Object.prototype.toString,a=function(t){return function(e){return typeof e===t}};e.isUndefined=a("undefined"),e.isDefined=i.not(e.isUndefined),e.isNull=function(t){return null===t},e.isFunction=a("function"),e.isNumber=a("number"),e.isString=a("string"),e.isObject=function(t){return null!==t&&"object"==typeof t},e.isArray=Array.isArray,e.isDate=function(t){return"[object Date]"===o.call(t)},e.isRegExp=function(t){return"[object RegExp]"===o.call(t)},e.isInjectable=r,e.isPromise=i.and(e.isObject,i.pipe(i.prop("then"),e.isFunction))},function(t,e){"use strict";function n(t){function e(n){return n.length>=r?t.apply(null,n):function(){return e(n.concat([].slice.apply(arguments)))}}var n=[].slice.apply(arguments,[1]),r=t.length;return e(n)}function r(){var t=arguments,e=t.length-1;return function(){for(var n=e,r=t[e].apply(this,arguments);n--;)r=t[n].call(this,r);return r}}function i(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return r.apply(null,[].slice.call(arguments).reverse())}function o(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)&&e.apply(null,n)}}function a(t,e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r-0]=arguments[r];return t.apply(null,n)||e.apply(null,n)}}function s(t,e){return function(n){return n[t].apply(n,e)}}function u(t){return function(e){for(var n=0;n<t.length;n++)if(t[n][0](e))return t[n][1](e)}}e.curry=n,e.compose=r,e.pipe=i,e.prop=function(t){return function(e){return e&&e[t]}},e.propEq=n(function(t,e,n){return n&&n[t]===e}),e.parse=function(t){return i.apply(null,t.split(".").map(e.prop))},e.not=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n-0]=arguments[n];return!t.apply(null,e)}},e.and=o,e.or=a,e.all=function(t){return function(e){return e.reduce(function(e,n){return e&&!!t(n)},!0)}},e.any=function(t){return function(e){return e.reduce(function(e,n){return e||!!t(n)},!1)}},e.none=e.not(e.any),e.is=function(t){return function(e){return null!=e&&e.constructor===t||e instanceof t}},e.eq=function(t){return function(e){return t===e}},e.val=function(t){return function(){return t}},e.invoke=s,e.pattern=u},function(t,e){"use strict";var n=function(t){return function(){throw new Error(t+"(): No coreservices implementation for UI-Router is loaded. You should include one of: ['angular1.js']")}},r={$q:void 0,$injector:void 0,location:{},locationConfig:{},template:{}};e.services=r,["replace","url","path","search","hash","onChange"].forEach(function(t){return r.location[t]=n(t)}),["port","protocol","host","baseHref","html5Mode","hashPrefix"].forEach(function(t){return r.locationConfig[t]=n(t)})},function(t,e){"use strict";var n=function(){function t(t){this.text=t,this.glob=t.split(".")}return t.prototype.matches=function(t){for(var e=t.split("."),n=0,r=this.glob.length;r>n;n++)"*"===this.glob[n]&&(e[n]="*");return"**"===this.glob[0]&&(e=e.slice(e.indexOf(this.glob[1])),e.unshift("**")),"**"===this.glob[this.glob.length-1]&&(e.splice(e.indexOf(this.glob[this.glob.length-2])+1,Number.MAX_VALUE),e.push("**")),this.glob.length!=e.length?!1:e.join("")===this.glob.join("")},t.is=function(t){return t.indexOf("*")>-1},t.fromString=function(e){return this.is(e)?new t(e):null},t}();e.Glob=n},function(t,e){"use strict";var n=function(){function t(t,e){void 0===t&&(t=[]),void 0===e&&(e=null),this._items=t,this._limit=e}return t.prototype.enqueue=function(t){var e=this._items;return e.push(t),this._limit&&e.length>this._limit&&e.shift(),t},t.prototype.dequeue=function(){return this.size()?this._items.splice(0,1)[0]:void 0},t.prototype.clear=function(){var t=this._items;return this._items=[],t},t.prototype.size=function(){return this._items.length},t.prototype.remove=function(t){var e=this._items.indexOf(t);return e>-1&&this._items.splice(e,1)[0]},t.prototype.peekTail=function(){return this._items[this._items.length-1]},t.prototype.peekHead=function(){return this.size()?this._items[0]:void 0},t}();e.Queue=n},function(t,e,n){"use strict";function r(t,e){return e.length<=t?e:e.substr(0,t-3)+"..."}function i(t,e){for(;e.length<t;)e+=" ";return e}function o(t){return t.replace(/^([A-Z])/,function(t){return t.toLowerCase()}).replace(/([A-Z])/g,function(t){return"-"+t.toLowerCase()})}function a(t){return"Promise("+JSON.stringify(t)+")"}function s(t){var e=u(t),n=e.match(/^(function [^ ]+\([^)]*\))/);return n?n[1]:e}function u(t){var e=l.isArray(t)?t.slice(-1)[0]:t;return e&&e.toString()||"undefined"}function c(t){function e(t){if(l.isObject(t)){if(-1!==n.indexOf(t))return"[circular ref]";n.push(t)}return g(t)}var n=[];return JSON.stringify(t,function(t,n){return e(n)}).replace(/\\"/g,'"')}var l=n(4),f=n(10),p=n(3),h=n(5),v=n(11),d=n(32);e.maxLength=r,e.padString=i,e.kebobString=o,e.functionToString=s,e.fnToString=u;var m=f.Rejection.isTransitionRejectionPromise,g=h.pattern([[h.not(l.isDefined),h.val("undefined")],[l.isNull,h.val("null")],[l.isPromise,a],[m,function(t){return t._transitionRejection.toString()}],[h.is(f.Rejection),h.invoke("toString")],[h.is(v.Transition),h.invoke("toString")],[h.is(d.Resolvable),h.invoke("toString")],[l.isInjectable,s],[h.val(!0),p.identity]]);e.stringify=c,e.beforeAfterSubstr=function(t){return function(e){if(!e)return["",""];var n=e.indexOf(t);return-1===n?[e,""]:[e.substr(0,n),e.substr(n+1)]}}},function(t,e,n){"use strict";var r=n(3),i=n(6),o=n(9);!function(t){t[t.SUPERSEDED=2]="SUPERSEDED",t[t.ABORTED=3]="ABORTED",t[t.INVALID=4]="INVALID",t[t.IGNORED=5]="IGNORED"}(e.RejectType||(e.RejectType={}));var a=e.RejectType,s=function(){function t(t,e,n){this.type=t,this.message=e,this.detail=n}return t.prototype.toString=function(){var t=function(t){return t&&t.toString!==Object.prototype.toString?t.toString():o.stringify(t)},e=this.type,n=this.message,r=t(this.detail);return"TransitionRejection(type: "+e+", message: "+n+", detail: "+r+")"},t.prototype.toPromise=function(){return r.extend(i.services.$q.reject(this),{_transitionRejection:this})},t.isTransitionRejectionPromise=function(e){return e&&"function"==typeof e.then&&e._transitionRejection instanceof t},t.superseded=function(e,n){var r="The transition has been superseded by a different transition (see detail).",i=new t(a.SUPERSEDED,r,e);return n&&n.redirected&&(i.redirected=!0),i},t.redirected=function(e){return t.superseded(e,{redirected:!0})},t.invalid=function(e){var n="This transition is invalid (see detail)";return new t(a.INVALID,n,e)},t.ignored=function(e){var n="The transition was ignored.";return new t(a.IGNORED,n,e)},t.aborted=function(e){var n="The transition has been aborted.";return new t(a.ABORTED,n,e)},t}();e.Rejection=s},function(t,e,n){"use strict";var r=n(12),i=n(6),o=n(3),a=n(4),s=n(5),u=n(13),c=n(39),l=n(38),f=n(17),p=n(20),h=n(40),v=n(10),d=0,m=s.prop("self"),g=function(){function t(t,e,n){var r=this;if(this._transitionService=n,this._deferred=i.services.$q.defer(),this.promise=this._deferred.promise,this.treeChanges=function(){return r._treeChanges},this.isActive=function(){return r===r._options.current()},!e.valid())throw new Error(e.error());u.HookRegistry.mixin(new u.HookRegistry,this),this._options=o.extend({current:s.val(this)},e.options()),this.$id=d++;var a=l.PathFactory.buildToPath(t,e);a=l.PathFactory.applyViewConfigs(n.$view,a),this._treeChanges=l.PathFactory.treeChanges(t,a,this._options.reloadState),l.PathFactory.bindTransitionResolve(this._treeChanges,this)}return t.prototype.$from=function(){return o.tail(this._treeChanges.from).state},t.prototype.$to=function(){return o.tail(this._treeChanges.to).state},t.prototype.from=function(){return this.$from().self},t.prototype.to=function(){return this.$to().self},t.prototype.is=function(e){return e instanceof t?this.is({to:e.$to().name,from:e.$from().name}):!(e.to&&!u.matchState(this.$to(),e.to)||e.from&&!u.matchState(this.$from(),e.from))},t.prototype.params=function(t){return void 0===t&&(t="to"),this._treeChanges[t].map(s.prop("paramValues")).reduce(o.mergeR,{})},t.prototype.resolves=function(){return o.map(o.tail(this._treeChanges.to).resolveContext.getResolvables(),function(t){return t.data})},t.prototype.addResolves=function(t,e){void 0===e&&(e="");var n="string"==typeof e?e:e.name,r=this._treeChanges.to,i=o.find(r,function(t){return t.state.name===n});o.tail(r).resolveContext.addResolvables(h.Resolvable.makeResolvables(t),i.state)},t.prototype.previous=function(){return this._options.previous||null},t.prototype.options=function(){return this._options},t.prototype.entering=function(){return o.map(this._treeChanges.entering,s.prop("state")).map(m)},t.prototype.exiting=function(){return o.map(this._treeChanges.exiting,s.prop("state")).map(m).reverse()},t.prototype.retained=function(){return o.map(this._treeChanges.retained,s.prop("state")).map(m)},t.prototype.views=function(t,e){void 0===t&&(t="entering");var n=this._treeChanges[t];return n=e?n.filter(s.propEq("state",e)):n,n.map(s.prop("views")).filter(o.identity).reduce(o.unnestR,[])},t.prototype.redirect=function(e){var n=o.extend({},this.options(),e.options(),{previous:this});e=new f.TargetState(e.identifier(),e.$state(),e.params(),n);var r=new t(this._treeChanges.from,e,this._transitionService),i=e.options().reloadState,a=this.treeChanges().to,s=c.Node.matching(r.treeChanges().to,a).filter(function(t){return!i||!i.includes[t.state.name]}),u=function(t,e){return-1===["$stateParams","$transition$"].indexOf(e)};return s.forEach(function(t,e){return o.extend(t.resolves,o.filter(a[e].resolves,u))}),r},t.prototype._changedParams=function(){var t=this._treeChanges,e=t.to,n=t.from;if(!this._options.reload&&o.tail(e).state===o.tail(n).state){var r=e.map(function(t){return t.paramSchema}),i=[e,n].map(function(t){return t.map(function(t){return t.paramValues})}),a=i[0],s=i[1],u=o.arrayTuples(r,a,s);return u.map(function(t){var e=t[0],n=t[1],r=t[2];return p.Param.changed(e,n,r)}).reduce(o.unnestR,[])}},t.prototype.dynamic=function(){var t=this._changedParams();return t?t.map(function(t){return t.dynamic}).reduce(o.anyTrueR,!1):!1},t.prototype.ignored=function(){var t=this._changedParams();return t?0===t.length:!1},t.prototype.hookBuilder=function(){return new u.HookBuilder(this._transitionService,this,{transition:this,current:this._options.current})},t.prototype.run=function(){var t=this,e=this.hookBuilder(),n=u.TransitionHook.runSynchronousHooks,o=function(){return n(e.getOnSuccessHooks(),{},!0)},a=function(t){return n(e.getOnErrorHooks(),{$error$:t},!0)};this.promise.then(o,a);var s=n(e.getOnBeforeHooks());if(v.Rejection.isTransitionRejectionPromise(s)){s["catch"](function(){return 0});var c=s._transitionRejection;return this._deferred.reject(c),this.promise}if(!this.valid()){var l=new Error(this.error());return this._deferred.reject(l),this.promise}if(this.ignored())return r.trace.traceTransitionIgnored(this),this._deferred.reject(v.Rejection.ignored()),this.promise;var f=function(){t.success=!0,t._deferred.resolve(t),r.trace.traceSuccess(t.$to(),t)},p=function(e){return t.success=!1,t._deferred.reject(e),r.trace.traceError(e,t),i.services.$q.reject(e)};r.trace.traceTransitionStart(this);var h=e.asyncHooks().reduce(function(t,e){return t.then(e.invokeHook.bind(e))},s);return h.then(f,p),this.promise},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.$to();return t.self[o.abstractKey]?"Cannot transition to abstract state '"+t.name+"'":p.Param.validates(t.parameters(),this.params())?void 0:"Param values not valid for state '"+t.name+"'"},t.prototype.toString=function(){var t=this.from(),e=this.to(),n=function(t){return null!==t["#"]&&void 0!==t["#"]?t:o.omit(t,"#")},r=this.$id,i=a.isObject(t)?t.name:t,u=o.toJson(n(this._treeChanges.from.map(s.prop("paramValues")).reduce(o.mergeR,{}))),c=this.valid()?"":"(X) ",l=a.isObject(e)?e.name:e,f=o.toJson(n(this.params()));return"Transition#"+r+"( '"+i+"'"+u+" -> "+c+"'"+l+"'"+f+" )"},t}();e.Transition=g},function(t,e,n){"use strict";function r(t){return t?"[ui-view#"+t.id+" tag in template from '"+(t.creationContext.name||"(root)")+"' state]: fqn: '"+t.fqn+"', name: '"+t.name+"@"+t.creationContext+"')":"ui-view (defunct)"}function i(t){return a.isNumber(t)?c[t]:c[c[t]]}var o=n(5),a=n(4),s=n(9),u=function(t){return"[ViewConfig from '"+(t.viewDecl.$context.name||"(root)")+"' state]: target ui-view: '"+t.viewDecl.$uiViewName+"@"+t.viewDecl.$uiViewContextAnchor+"'"};!function(t){t[t.RESOLVE=0]="RESOLVE",t[t.TRANSITION=1]="TRANSITION",t[t.HOOK=2]="HOOK",t[t.INVOKE=3]="INVOKE",t[t.UIVIEW=4]="UIVIEW",t[t.VIEWCONFIG=5]="VIEWCONFIG"}(e.Category||(e.Category={}));var c=e.Category,l=function(){function t(){this._enabled={},this.approximateDigests=0}return t.prototype._set=function(t,e){var n=this;e.length||(e=Object.keys(c).filter(function(t){return isNaN(parseInt(t,10))}).map(function(t){return c[t]})),e.map(i).forEach(function(e){return n._enabled[e]=t})},t.prototype.enable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!0,t)},t.prototype.disable=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];this._set(!1,t)},t.prototype.enabled=function(t){return!!this._enabled[i(t)]},t.prototype.traceTransitionStart=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Started -> "+r)}},t.prototype.traceTransitionIgnored=function(t){if(this.enabled(c.TRANSITION)){var e=t.$id,n=this.approximateDigests,r=s.stringify(t);console.log("Transition #"+e+" Digest #"+n+": Ignored <> "+r)}},t.prototype.traceHookInvocation=function(t,e){if(this.enabled(c.HOOK)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=o.parse("traceData.hookType")(e)||"internal",a=o.parse("traceData.context.state.name")(e)||o.parse("traceData.context")(e)||"unknown",u=s.functionToString(t.fn);console.log("Transition #"+n+" Digest #"+r+": Hook -> "+i+" context: "+a+", "+s.maxLength(200,u))}},t.prototype.traceHookResult=function(t,e,n){if(this.enabled(c.HOOK)){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=s.stringify(t),u=s.stringify(e);console.log("Transition #"+r+" Digest #"+i+": <- Hook returned: "+s.maxLength(200,a)+", transition result: "+s.maxLength(200,u))}},t.prototype.traceResolvePath=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=e&&e.resolvePolicy;console.log("Transition #"+n+" Digest #"+r+": Resolving "+i+" ("+a+")")}},t.prototype.traceResolvePathElement=function(t,e,n){if(this.enabled(c.RESOLVE)&&e.length){var r=o.parse("transition.$id")(n),i=this.approximateDigests,a=Object.keys(e).join(", "),s=t&&t.toString(),u=n&&n.resolvePolicy;console.log("Transition #"+r+" Digest #"+i+": Resolve "+s+" resolvables: ["+a+"] ("+u+")")}},t.prototype.traceResolveResolvable=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString();console.log("Transition #"+n+" Digest #"+r+": Resolving -> "+i)}},t.prototype.traceResolvableResolved=function(t,e){if(this.enabled(c.RESOLVE)){var n=o.parse("transition.$id")(e),r=this.approximateDigests,i=t&&t.toString(),a=s.stringify(t.data);console.log("Transition #"+n+" Digest #"+r+": <- Resolved "+i+" to: "+s.maxLength(200,a))}},t.prototype.tracePathElementInvoke=function(t,e,n,r){if(this.enabled(c.INVOKE)){var i=o.parse("transition.$id")(r),a=this.approximateDigests,u=t&&t.state&&t.state.toString(),l=s.functionToString(e);console.log("Transition #"+i+" Digest #"+a+": Invoke "+r.when+": context: "+u+" "+s.maxLength(200,l))}},t.prototype.traceError=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Rejected "+i+", reason: "+t)}},t.prototype.traceSuccess=function(t,e){if(this.enabled(c.TRANSITION)){var n=e.$id,r=this.approximateDigests,i=t.name,o=s.stringify(e);console.log("Transition #"+n+" Digest #"+r+": <- Success "+o+", final state: "+i)}},t.prototype.traceUiViewEvent=function(t,e,n){void 0===n&&(n=""),this.enabled(c.UIVIEW)&&console.log("ui-view: "+s.padString(30,t)+" "+r(e)+n)},t.prototype.traceUiViewConfigUpdated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Updating",t," with ViewConfig from context='"+e+"'")},t.prototype.traceUiViewScopeCreated=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Created scope for",t,", scope #"+e.$id)},t.prototype.traceUiViewFill=function(t,e){this.enabled(c.UIVIEW)&&this.traceUiViewEvent("Fill",t," with: "+s.maxLength(200,e))},t.prototype.traceViewServiceEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+u(e))},t.prototype.traceViewServiceUiViewEvent=function(t,e){this.enabled(c.VIEWCONFIG)&&console.log("VIEWCONFIG: "+t+" "+r(e))},t}();e.Trace=l;var f=new l;e.trace=f},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(14)),r(n(15)),r(n(10)),r(n(11)),r(n(16)),r(n(43))},function(t,e,n){"use strict";function r(t){return void 0===t&&(t=!1),function(e,n){var r=t?-1:1,i=(e.node.state.path.length-n.node.state.path.length)*r;return 0!==i?i:n.hook.priority-e.hook.priority}}var i=n(3),o=n(4),a=n(13),s=function(){function t(t,e,n){var o=this;this.$transitions=t,this.transition=e,this.baseHookOptions=n,this.getOnBeforeHooks=function(){return o._buildNodeHooks("onBefore","to",r(),void 0,{async:!1})},this.getOnStartHooks=function(){return o._buildNodeHooks("onStart","to",r())},this.getOnExitHooks=function(){return o._buildNodeHooks("onExit","exiting",r(!0),function(t){return{$state$:t.state}})},this.getOnRetainHooks=function(){return o._buildNodeHooks("onRetain","retained",r(),function(t){return{$state$:t.state}})},this.getOnEnterHooks=function(){return o._buildNodeHooks("onEnter","entering",r(),function(t){return{$state$:t.state}})},this.getOnFinishHooks=function(){return o._buildNodeHooks("onFinish","to",r(),function(t){return{$treeChanges$:o.treeChanges}})},this.getOnSuccessHooks=function(){return o._buildNodeHooks("onSuccess","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.getOnErrorHooks=function(){return o._buildNodeHooks("onError","to",r(),void 0,{async:!1,rejectIfSuperseded:!1})},this.treeChanges=e.treeChanges(),this.toState=i.tail(this.treeChanges.to).state,this.fromState=i.tail(this.treeChanges.from).state,this.transitionOptions=e.options()}return t.prototype.asyncHooks=function(){var t=this.getOnStartHooks(),e=this.getOnExitHooks(),n=this.getOnRetainHooks(),r=this.getOnEnterHooks(),o=this.getOnFinishHooks(),a=[t,e,n,r,o];return a.reduce(i.unnestR,[]).filter(i.identity)},t.prototype._buildNodeHooks=function(t,e,n,r,o){var s=this;void 0===r&&(r=function(t){return{}});var u=this._matchingHooks(t,this.treeChanges);if(!u)return[];var c=function(n){var u=n.matches(s.treeChanges),c=u[e];return c.map(function(e){var u=i.extend({bind:n.bind,traceData:{hookType:t,context:e}},s.baseHookOptions,o),c=new a.TransitionHook(n.callback,r(e),e.resolveContext,u);return{hook:n,node:e,transitionHook:c}})};return u.map(c).reduce(i.unnestR,[]).sort(n).map(function(t){return t.transitionHook})},t.prototype._matchingHooks=function(t,e){return[this.transition,this.$transitions].map(function(e){return e.getHooks(t)}).filter(i.assertPredicate(o.isArray,"broken event named: "+t)).reduce(i.unnestR,[]).filter(function(t){return t.matches(e)})},t}();e.HookBuilder=s},function(t,e,n){"use strict";function r(t,e){function n(t){for(var e=r,n=0;n<e.length;n++){var i=s.Glob.fromString(e[n]);if(i&&i.matches(t.name)||!i&&e[n]===t.name)return!0}return!1}var r=a.isString(e)?[e]:e,i=a.isFunction(r)?r:n;return!!i(t)}function i(t,e){return function(n,r,i){void 0===i&&(i={});var a=new u(n,r,i);return t[e].push(a),function(){o.removeFrom(t[e])(a)}}}var o=n(3),a=n(4),s=n(7);e.matchState=r;var u=function(){function t(t,e,n){void 0===n&&(n={}),this.callback=e,this.matchCriteria=o.extend({to:!0,from:!0,exiting:!0,retained:!0,entering:!0},t),this.priority=n.priority||0,this.bind=n.bind||null}return t._matchingNodes=function(t,e){if(e===!0)return t;var n=t.filter(function(t){return r(t.state,e)});return n.length?n:null},t.prototype.matches=function(e){var n=this.matchCriteria,r=t._matchingNodes,i={to:r([o.tail(e.to)],n.to),from:r([o.tail(e.from)],n.from),exiting:r(e.exiting,n.exiting),retained:r(e.retained,n.retained),entering:r(e.entering,n.entering)},a=["to","from","exiting","retained","entering"].map(function(t){return i[t]}).reduce(o.allTrueR,!0);return a?i:null},t}();e.EventHook=u;var c=function(){function t(){var t=this;this._transitionEvents={onBefore:[],onStart:[],onEnter:[],onRetain:[],onExit:[],onFinish:[],onSuccess:[],onError:[]},this.getHooks=function(e){return t._transitionEvents[e]},this.onBefore=i(this._transitionEvents,"onBefore"),this.onStart=i(this._transitionEvents,"onStart"),this.onEnter=i(this._transitionEvents,"onEnter"),this.onRetain=i(this._transitionEvents,"onRetain"),this.onExit=i(this._transitionEvents,"onExit"),this.onFinish=i(this._transitionEvents,"onFinish"),this.onSuccess=i(this._transitionEvents,"onSuccess"),this.onError=i(this._transitionEvents,"onError")}return t.mixin=function(t,e){Object.keys(t._transitionEvents).concat(["getHooks"]).forEach(function(n){return e[n]=t[n]})},t}();e.HookRegistry=c},function(t,e,n){"use strict";var r=n(3),i=n(9),o=n(4),a=n(5),s=n(12),u=n(6),c=n(10),l=n(17),f={async:!0,rejectIfSuperseded:!0,current:r.noop,transition:null,traceData:{},bind:null},p=function(){function t(t,e,n,i){var o=this;this.fn=t,this.locals=e,this.resolveContext=n,this.options=i,this.isSuperseded=function(){return o.options.current()!==o.options.transition},this.options=r.defaults(i,f)}return t.prototype.invokeHook=function(t){var e=this,n=this,i=n.options,o=n.fn,a=n.resolveContext,u=r.extend({},this.locals,t);if(s.trace.traceHookInvocation(this,i),i.rejectIfSuperseded&&this.isSuperseded())return c.Rejection.superseded(i.current()).toPromise();if(!i.async){var l=a.invokeNow(o,u,i);return this.handleHookResult(l)}return a.invokeLater(o,u,i).then(function(t){return e.handleHookResult(t)})},t.prototype.handleHookResult=function(t){var e=this;if(o.isDefined(t)){var n=a.pattern([[this.isSuperseded,function(){return c.Rejection.superseded(e.options.current()).toPromise()}],[a.eq(!1),function(){return c.Rejection.aborted("Hook aborted transition").toPromise()}],[a.is(l.TargetState),function(t){return c.Rejection.redirected(t).toPromise()}],[o.isPromise,function(t){return t.then(e.handleHookResult.bind(e))}]]),r=n(t);return r&&s.trace.traceHookResult(t,r,this.options),r}},t.prototype.toString=function(){var t=this,e=t.options,n=t.fn,r=a.parse("traceData.hookType")(e)||"internal",o=a.parse("traceData.context.state.name")(e)||a.parse("traceData.context")(e)||"unknown",s=i.fnToString(n);return r+" context: "+o+", "+i.maxLength(200,s)},t.runSynchronousHooks=function(t,e,n){void 0===e&&(e={}),void 0===n&&(n=!1);for(var r=[],i=0;i<t.length;i++)try{r.push(t[i].invokeHook(e))}catch(s){if(!n)return c.Rejection.aborted(s).toPromise();console.error("Swallowed exception during synchronous hook handler: "+s)}var l=r.filter(c.Rejection.isTransitionRejectionPromise);return l.length?l[0]:r.filter(o.isPromise).reduce(function(t,e){return t.then(a.val(e))},u.services.$q.when())},t}();e.TransitionHook=p},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(18)),r(n(19)),r(n(26)),r(n(33)),r(n(34)),r(n(35)),r(n(36)),r(n(37)),r(n(27))},function(t,e,n){"use strict";var r=n(4),i=n(3),o=function(){function t(e){this.stateRegistry=e,this.invalidCallbacks=[],i.bindFunctions(t.prototype,this,this)}return t.prototype.decorator=function(t,e){return this.stateRegistry.decorator(t,e)||this},t.prototype.state=function(t,e){return r.isObject(t)?e=t:e.name=t,this.stateRegistry.register(e),this},t.prototype.onInvalid=function(t){this.invalidCallbacks.push(t)},t}();e.StateProvider=o},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(5),a=n(20),s=function(t){if(!i.isString(t))return!1;var e="^"===t.charAt(0);return{val:e?t.substring(1):t,root:e}},u=function(){function t(t,e){this.matcher=t;var n=this,i=function(t){return""===t.name},u=function(){return t.find("")};this.builders={self:[function(t){return t.self.$$state=function(){return t},t.self}],parent:[function(e){return i(e)?null:t.find(n.parentName(e))||u()}],data:[function(t){return t.parent&&t.parent.data&&(t.data=t.self.data=r.inherit(t.parent.data,t.data)),t.data}],url:[function(t){var n=t,i=s(n.url),o=t.parent,a=i?e.compile(i.val,{params:t.params||{},paramMap:function(t,e){return n.reloadOnSearch===!1&&e&&(t=r.extend(t||{},{dynamic:!0})),t}}):n.url;if(!a)return null;if(!e.isMatcher(a))throw new Error("Invalid url '"+a+"' in state '"+t+"'");return i&&i.root?a:(o&&o.navigable||u()).url.append(a)}],navigable:[function(t){return!i(t)&&t.url?t:t.parent?t.parent.navigable:null}],params:[function(t){var e=function(t,e){return a.Param.fromConfig(e,null,t)},n=t.url&&t.url.parameters({inherit:!1})||[],i=r.values(r.map(r.omit(t.params||{},n.map(o.prop("id"))),e));return n.concat(i).map(function(t){return[t.id,t]}).reduce(r.applyPairs,{})}],views:[],path:[function(t){return t.parent?t.parent.path.concat(t):[t]}],includes:[function(t){var e=t.parent?r.extend({},t.parent.includes):{};return e[t.name]=!0,e}]}}return t.prototype.builder=function(t,e){var n=this.builders,r=n[t]||[];return i.isString(t)&&!i.isDefined(e)?r.length>1?r:r[0]:i.isString(t)&&i.isFunction(e)?(n[t]=r,n[t].push(e),function(){return n[t].splice(n[t].indexOf(e,1))&&null}):void 0},t.prototype.build=function(t){var e=this,n=e.matcher,i=e.builders,o=this.parentName(t);if(o&&!n.find(o))return null;for(var a in i)if(i.hasOwnProperty(a)){var s=i[a].reduce(function(t,e){return function(n){return e(n,t)}},r.noop);t[a]=s(t)}return t},t.prototype.parentName=function(t){var e=t.name||"";return-1!==e.indexOf(".")?e.substring(0,e.lastIndexOf(".")):t.parent?i.isString(t.parent)?t.parent:t.parent.name:""},t.prototype.name=function(t){var e=t.name;if(-1!==e.indexOf(".")||!t.parent)return e;var n=i.isString(t.parent)?t.parent:t.parent.name;return n?n+"."+e:e},t}();e.StateBuilder=u},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(21)),r(n(24)),r(n(25)),r(n(23))},function(t,e,n){
1776 "use strict";function r(t){return t=d(t)&&{value:t}||t,s.extend(t,{$$fn:c.isInjectable(t.value)?t.value:function(){return t.value}})}function i(t,e,n,r){if(t.type&&e&&"string"!==e.name)throw new Error("Param '"+r+"' has two type configurations.");return t.type&&e&&"string"===e.name&&h.paramTypes.type(t.type)?h.paramTypes.type(t.type):e?e:t.type?t.type instanceof p.Type?t.type:h.paramTypes.type(t.type):n===m.CONFIG?h.paramTypes.type("any"):h.paramTypes.type("string")}function o(t,e){var n=t.squash;if(!e||n===!1)return!1;if(!c.isDefined(n)||null==n)return f.matcherConfig.defaultSquashPolicy();if(n===!0||c.isString(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function a(t,e,n,r){var i,o,a=[{from:"",to:n||e?void 0:""},{from:null,to:n||e?void 0:""}];return i=c.isArray(t.replace)?t.replace:[],c.isString(r)&&i.push({from:r,to:void 0}),o=s.map(i,u.prop("from")),s.filter(a,function(t){return-1===o.indexOf(t.from)}).concat(i)}var s=n(3),u=n(5),c=n(4),l=n(6),f=n(22),p=n(23),h=n(24),v=Object.prototype.hasOwnProperty,d=function(t){return 0===["value","type","squash","array","dynamic"].filter(v.bind(t||{})).length};!function(t){t[t.PATH=0]="PATH",t[t.SEARCH=1]="SEARCH",t[t.CONFIG=2]="CONFIG"}(e.DefType||(e.DefType={}));var m=e.DefType,g=function(){function t(t,e,n,u){function c(){var e={array:u===m.SEARCH?"auto":!1},r=t.match(/\[\]$/)?{array:!0}:{};return s.extend(e,r,n).array}n=r(n),e=i(n,e,u,t);var l=c();e=l?e.$asArray(l,u===m.SEARCH):e;var f=void 0!==n.value,p=n.dynamic===!0,h=o(n,f),v=a(n,l,f,h);s.extend(this,{id:t,type:e,location:u,squash:h,replace:v,isOptional:f,dynamic:p,config:n,array:l})}return t.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},t.prototype.value=function(t){var e=this,n=function(){if(!l.services.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=l.services.$injector.invoke(e.config.$$fn);if(null!==t&&void 0!==t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of Type ("+e.type.name+")");return t},r=function(t){var n=s.map(s.filter(e.replace,u.propEq("from",t)),u.prop("to"));return n.length?n[0]:t};return t=r(t),c.isDefined(t)?this.type.$normalize(t):n()},t.prototype.isSearch=function(){return this.location===m.SEARCH},t.prototype.validates=function(t){if((!c.isDefined(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var n=this.type.encode(e);return!(c.isString(n)&&!this.type.pattern.exec(n))},t.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},t.fromConfig=function(e,n,r){return new t(e,n,r,m.CONFIG)},t.fromPath=function(e,n,r){return new t(e,n,r,m.PATH)},t.fromSearch=function(e,n,r){return new t(e,n,r,m.SEARCH)},t.values=function(t,e){return void 0===e&&(e={}),t.map(function(t){return[t.id,t.value(e[t.id])]}).reduce(s.applyPairs,{})},t.changed=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),t.filter(function(t){return!t.type.equals(e[t.id],n[t.id])})},t.equals=function(e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),0===t.changed(e,n,r).length},t.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(s.allTrueR,!0)},t}();e.Param=g},function(t,e,n){"use strict";var r=n(4),i=function(){function t(){this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1}return t.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=r.isDefined(t)?t:this._isCaseInsensitive},t.prototype.strictMode=function(t){return this._isStrictMode=r.isDefined(t)?t:this._isStrictMode},t.prototype.defaultSquashPolicy=function(t){if(r.isDefined(t)&&t!==!0&&t!==!1&&!r.isString(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=r.isDefined(t)?t:this._defaultSquashPolicy},t}();e.MatcherConfig=i,e.matcherConfig=new i},function(t,e,n){"use strict";function r(t,e){function n(t){return o.isArray(t)?t:o.isDefined(t)?[t]:[]}function r(t){switch(t.length){case 0:return;case 1:return"auto"===e?t[0]:t;default:return t}}function a(t,e){return function(a){if(o.isArray(a)&&0===a.length)return a;var s=n(a),u=i.map(s,t);return e===!0?0===i.filter(u,function(t){return!t}).length:r(u)}}function s(t){return function(e,r){var i=n(e),o=n(r);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(!t(i[a],o[a]))return!1;return!0}}var u=this;["encode","decode","equals","$normalize"].map(function(e){u[e]=("equals"===e?s:a)(t[e].bind(t))}),i.extend(this,{name:t.name,pattern:t.pattern,is:a(t.is.bind(t),!0),$arrayMode:e})}var i=n(3),o=n(4),a=function(){function t(t){this.pattern=/.*/,i.extend(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{Type:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new r(this,t)},t}();e.Type=a},function(t,e,n){"use strict";function r(t){return null!=t?t.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):t}function i(t){return null!=t?t.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):t}var o=n(3),a=n(4),s=n(5),u=n(6),c=n(23),l=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes={hash:{encode:r,decode:i,is:s.is(String),pattern:/.*/,equals:function(t,e){return t==e}},string:{encode:r,decode:i,is:s.is(String),pattern:/[^\/]*/},"int":{encode:r,decode:function(t){return parseInt(t,10)},is:function(t){return a.isDefined(t)&&this.decode(t.toString())===t},pattern:/-?\d+/},bool:{encode:function(t){return t&&1||0},decode:function(t){return 0!==parseInt(t,10)},is:s.is(Boolean),pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):void 0},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):void 0},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return["getFullYear","getMonth","getDate"].reduce(function(n,r){return n&&t[r]()===e[r]()},!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:o.toJson,decode:o.fromJson,is:s.is(Object),equals:o.equals,pattern:/[^\/]*/},any:{encode:o.identity,decode:o.identity,equals:o.equals,pattern:/.*/}};var t=function(t,e){return new c.Type(o.extend({name:e},t))};this.types=o.inherit(o.map(this.defaultTypes,t),{})}return t.prototype.type=function(t,e,n){if(!a.isDefined(e))return this.types[t];if(this.types.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return this.types[t]=new c.Type(o.extend({name:t},e)),n&&(this.typeQueue.push({name:t,def:n}),this.enqueue||this._flushTypeQueue()),this},t.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var t=this.typeQueue.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");o.extend(this.types[t.name],u.services.$injector.invoke(t.def))}},t}();e.ParamTypes=l,e.paramTypes=new l},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t){void 0===t&&(t={}),r.extend(this,t)}return t.prototype.$inherit=function(t,e,n){var i,o=r.ancestors(e,n),a={},s=[];for(var u in o)if(o[u]&&o[u].params&&(i=Object.keys(o[u].params),i.length))for(var c in i)s.indexOf(i[c])>=0||(s.push(i[c]),a[i[c]]=this[i[c]]);return r.extend({},a,t)},t}();e.StateParams=i},function(t,e,n){"use strict";var r=n(10),i=n(27),o=n(28),a=n(29),s=n(30),u=n(6),c=function(){function t(t,e,n,r,i,c){this.transition=t,this.$transitions=e,this.$urlRouter=n,this.$view=r,this.$state=i,this.globals=c,this.$q=u.services.$q,this.viewHooks=new o.ViewHooks(t,r),this.enterExitHooks=new a.EnterExitHooks(t),this.resolveHooks=new s.ResolveHooks(t),this.treeChanges=t.treeChanges(),this.registerUpdateGlobalState(),this.viewHooks.registerHooks(),this.enterExitHooks.registerHooks(),this.resolveHooks.registerHooks()}return t.prototype.runTransition=function(){var t=this;return this.globals.transitionHistory.enqueue(this.transition),this.transition.run().then(function(t){return t.to()})["catch"](function(e){return t.transRejected(e)})},t.prototype.registerUpdateGlobalState=function(){this.transition.onSuccess({},this.updateUrl.bind(this),{priority:9999})},t.prototype.transRejected=function(t){var e=this,n=e.transition,o=e.$state,a=e.$q;if(t instanceof r.Rejection){if(t.type===r.RejectType.IGNORED)return this.$urlRouter.update(),o.current;if(t.type===r.RejectType.SUPERSEDED&&t.redirected&&t.detail instanceof i.TargetState)return this._redirectMgr(n.redirect(t.detail)).runTransition();t.type===r.RejectType.ABORTED&&this.$urlRouter.update()}return this.$transitions.defaultErrorHandler()(t),a.reject(t)},t.prototype.updateUrl=function(){var t=this.transition,e=this,n=e.$urlRouter,r=e.$state,i=t.options();i.location&&r.$current.navigable&&n.push(r.$current.navigable.url,r.params,{replace:"replace"===i.location}),n.update(!0)},t.prototype._redirectMgr=function(e){var n=this,r=n.$transitions,i=n.$urlRouter,o=n.$view,a=n.$state,s=n.globals;return new t(e,r,i,o,a,s)},t}();e.TransitionManager=c},function(t,e){"use strict";var n=function(){function t(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),this._identifier=t,this._definition=e,this._options=r,this._params=n||{}}return t.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},t.prototype.identifier=function(){return this._identifier},t.prototype.params=function(){return this._params},t.prototype.$state=function(){return this._definition},t.prototype.state=function(){return this._definition&&this._definition.self},t.prototype.options=function(){return this._options},t.prototype.exists=function(){return!(!this._definition||!this._definition.self)},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.options().relative;if(!this._definition&&t){var e=t.name?t.name:t;return"Could not resolve '"+this.name()+"' from state '"+e+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},t}();e.TargetState=n},function(t,e,n){"use strict";var r=n(3),i=n(6),o=function(){function t(t,e){this.transition=t,this.$view=e,this.treeChanges=t.treeChanges(),this.enteringViews=t.views("entering"),this.exitingViews=t.views("exiting")}return t.prototype.loadAllEnteringViews=function(){return i.services.$q.all(this.enteringViews.map(function(t){return t.load()})).then(r.noop)},t.prototype.updateViews=function(){var t=this.$view;this.exitingViews.forEach(function(e){return t.deactivateViewConfig(e)}),this.enteringViews.forEach(function(e){return t.activateViewConfig(e)}),t.sync()},t.prototype.registerHooks=function(){this.enteringViews.length&&this.transition.onStart({},this.loadAllEnteringViews.bind(this)),(this.exitingViews.length||this.enteringViews.length)&&this.transition.onSuccess({},this.updateViews.bind(this))},t}();e.ViewHooks=o},function(t,e){"use strict";var n=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){this.registerOnEnterHooks(),this.registerOnRetainHooks(),this.registerOnExitHooks()},t.prototype.registerOnEnterHooks=function(){var t=this;this.transition.entering().filter(function(t){return!!t.onEnter}).forEach(function(e){return t.transition.onEnter({entering:e.name},e.onEnter)})},t.prototype.registerOnRetainHooks=function(){var t=this;this.transition.retained().filter(function(t){return!!t.onRetain}).forEach(function(e){return t.transition.onRetain({retained:e.name},e.onRetain)})},t.prototype.registerOnExitHooks=function(){var t=this;this.transition.exiting().filter(function(t){return!!t.onExit}).forEach(function(e){return t.transition.onExit({exiting:e.name},e.onExit)})},t}();e.EnterExitHooks=n},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(31),a=n(5),s=n(32),u=o.ResolvePolicy[o.ResolvePolicy.LAZY],c=o.ResolvePolicy[o.ResolvePolicy.EAGER],l=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){function t(t){return r.tail(n.to).resolveContext.resolvePath(r.extend({transition:t},{resolvePolicy:c}))}function e(t,e){var o=r.find(n.entering,i.propEq("state",t)),a=o.resolveContext,c=new s.Resolvable("$resolve$",function(){return r.map(a.getResolvables(),function(t){return t.data})}),l=r.extend({transition:e},{resolvePolicy:u});return a.resolvePathElement(o.state,l).then(function(){return c.resolveResolvable(a)}).then(function(){return a.addResolvables({$resolve$:c},o.state)})}var n=this.transition.treeChanges();t.$inject=["$transition$"],e.$inject=["$state$","$transition$"],this.transition.onStart({},t,{priority:1e3}),this.transition.onEnter({entering:a.val(!0)},e,{priority:1e3})},t}();e.ResolveHooks=l},function(t,e){"use strict";!function(t){t[t.JIT=0]="JIT",t[t.LAZY=1]="LAZY",t[t.EAGER=2]="EAGER"}(e.ResolvePolicy||(e.ResolvePolicy={}));e.ResolvePolicy},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(6),s=n(12),u=function(){function t(t,e,n){this.promise=void 0,r.extend(this,{name:t,resolveFn:e,deps:a.services.$injector.annotate(e,a.services.$injector.strictDi),data:n})}return t.prototype.resolveResolvable=function(t,e){var n=this;void 0===e&&(e={});var i=this,o=i.name,u=i.deps,c=i.resolveFn;s.trace.traceResolveResolvable(this,e);var l=a.services.$q.defer();this.promise=l.promise;var f=t.getResolvables(null,{omitOwnLocals:[o]}),p=r.pick(f,u),h=r.map(p,function(n){return n.get(t,e)});return a.services.$q.all(h).then(function(t){try{var e=a.services.$injector.invoke(c,null,t);l.resolve(e)}catch(r){l.reject(r)}return n.promise}).then(function(t){return n.data=t,s.trace.traceResolvableResolved(n,e),n.promise})},t.prototype.get=function(t,e){return this.promise||this.resolveResolvable(t,e)},t.prototype.toString=function(){return"Resolvable(name: "+this.name+", requires: ["+this.deps+"])"},t.makeResolvables=function(e){var n=r.filter(e,i.not(o.isInjectable)),a=Object.keys(n);if(a.length)throw new Error("Invalid resolve key/value: "+a[0]+"/"+n[a[0]]);return r.map(e,function(e,n){return new t(n,e)})},t}();e.Resolvable=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=function(){function t(t){r.extend(this,t)}return t.prototype.is=function(t){return this===t||this.self===t||this.fqn()===t},t.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var t=this.parent.fqn();return t?t+"."+this.name:this.name},t.prototype.root=function(){return this.parent&&this.parent.root()||this},t.prototype.parameters=function(t){t=r.defaults(t,{inherit:!0});var e=t.inherit&&this.parent&&this.parent.parameters()||[];return e.concat(r.values(this.params))},t.prototype.parameter=function(t,e){return void 0===e&&(e={}),this.url&&this.url.parameter(t,e)||r.find(r.values(this.params),i.propEq("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t}();e.State=o},function(t,e,n){"use strict";var r=n(4),i=function(){function t(t){this._states=t}return t.prototype.isRelative=function(t){return t=t||"",0===t.indexOf(".")||0===t.indexOf("^")},t.prototype.find=function(t,e){if(t||""===t){var n=r.isString(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];return!o||!n&&(n||o!==t&&o.self!==t)?void 0:o}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var n=this.find(e),r=t.split("."),i=0,o=r.length,a=n;o>i;i++)if(""!==r[i]||0!==i){if("^"!==r[i])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var s=r.slice(i).join(".");return a.name+(a.name&&s?".":"")+s},t}();e.StateMatcher=i},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(17),a=function(){function t(t,e,n){this.states=t,this.builder=e,this.$urlRouterProvider=n,this.queue=[]}return t.prototype.register=function(t){var e=this,n=e.states,a=e.queue,s=e.$state,u=r.inherit(new o.State,r.extend({},t,{self:t,resolve:t.resolve||{},toString:function(){return t.name}}));if(!i.isString(u.name))throw new Error("State must have a valid name");if(n.hasOwnProperty(u.name)||-1!==r.pluck(a,"name").indexOf(u.name))throw new Error("State '"+u.name+"' is already defined");return a.push(u),this.$state&&this.flush(s),u},t.prototype.flush=function(t){for(var e,n,r,i=this,o=i.queue,a=i.states,s=i.builder,u=[],c={};o.length>0;)if(n=o.shift(),e=s.build(n),r=u.indexOf(n),e){if(a.hasOwnProperty(n.name))throw new Error("State '"+name+"' is already defined");a[n.name]=n,this.attachRoute(t,n),r>=0&&u.splice(r,1)}else{var l=c[n.name];if(c[n.name]=o.length,r>=0&&l===o.length)return a;0>r&&u.push(n),o.push(n)}return a},t.prototype.autoFlush=function(t){this.$state=t,this.flush(t)},t.prototype.attachRoute=function(t,e){var n=this.$urlRouterProvider;!e[r.abstractKey]&&e.url&&n.when(e.url,["$match","$stateParams",function(n,i){t.$current.navigable===e&&r.equalForKeys(n,i)||t.transitionTo(e,n,{inherit:!0,location:!1})}])},t}();e.StateQueueManager=a},function(t,e,n){"use strict";var r=n(34),i=n(19),o=n(35),a=function(){function t(t,e){this.states={},this.matcher=new r.StateMatcher(this.states),this.builder=new i.StateBuilder(this.matcher,t),this.stateQueue=new o.StateQueueManager(this.states,this.builder,e);var n={name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},"abstract":!0},a=this._root=this.stateQueue.register(n);a.navigable=null}return t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype.get=function(t,e){var n=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return n.states[t].self});var r=this.matcher.find(t,e);return r&&r.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}();e.StateRegistry=a},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(8),a=n(6),s=n(38),u=n(39),c=n(43),l=n(10),f=n(27),p=n(26),h=n(21),v=n(7),d=n(3),m=n(3),g=function(){function t(e,n,r,i,o,a){this.$view=e,this.$urlRouter=n,this.$transitions=r,this.stateRegistry=i,this.stateProvider=o,this.globals=a;var s=["current","$current","params","transition"],u=Object.keys(t.prototype).filter(function(t){return-1===s.indexOf(t)});m.bindFunctions(t.prototype,this,this,u)}return Object.defineProperty(t.prototype,"transition",{get:function(){return this.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"current",{get:function(){return this.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"$current",{get:function(){return this.globals.$current},enumerable:!0,configurable:!0}),t.prototype._handleInvalidTargetState=function(t,e){function n(){var t=p.dequeue();return void 0===t?l.Rejection.invalid(e.error()).toPromise():d(t).then(m).then(function(t){return t||n()})}var r=this,i=function(){return r.globals.transitionHistory.peekTail()},u=i(),c=s.PathFactory.makeTargetState(t),p=new o.Queue([].concat(this.stateProvider.invalidCallbacks)),h=a.services.$q,v=a.services.$injector,d=function(t){return h.when(v.invoke(t,null,{$to$:e,$from$:c}))},m=function(t){if(t instanceof f.TargetState){var e=t;return e=r.target(e.identifier(),e.params(),e.options()),e.valid()?i()!==u?l.Rejection.superseded().toPromise():r.transitionTo(e.identifier(),e.params(),e.options()):l.Rejection.invalid(e.error()).toPromise()}};return n()},t.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:i.isDefined(t)?t:!0,inherit:!1,notify:!1})},t.prototype.go=function(t,e,n){var i={relative:this.$current,inherit:!0},o=r.defaults(n,i,c.defaultTransOpts);return this.transitionTo(t,e,o)},t.prototype.target=function(t,e,n){if(void 0===n&&(n={}),i.isObject(n.reload)&&!n.reload.name)throw new Error("Invalid reload state object");if(n.reloadState=n.reload===!0?this.stateRegistry.root():this.stateRegistry.matcher.find(n.reload,n.relative),n.reload&&!n.reloadState)throw new Error("No such reload state '"+(i.isString(n.reload)?n.reload:n.reload.name)+"'");var r=this.stateRegistry.matcher.find(t,n.relative);return new f.TargetState(t,r,e,n)},t.prototype.transitionTo=function(t,e,n){var i=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.globals.transitionHistory;n=r.defaults(n,c.defaultTransOpts),n=r.extend(n,{current:o.peekTail.bind(o)});var l=this.target(t,e,n),f=this.globals.successfulTransitions.peekTail(),h=function(){return s.PathFactory.bindTransNodesToPath([new u.Node(i.stateRegistry.root())])},v=f?f.treeChanges().to:h();if(!l.exists())return this._handleInvalidTargetState(v,l);if(!l.valid())return a.services.$q.reject(l.error());var d=this.$transitions.create(v,l),m=new p.TransitionManager(d,this.$transitions,this.$urlRouter,this.$view,this,this.globals),g=m.runTransition();return r.extend(g,{transition:d})},t.prototype.is=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=this.stateRegistry.matcher.find(t,n.relative);if(i.isDefined(o))return this.$current!==o?!1:i.isDefined(e)&&null!==e?h.Param.equals(o.parameters(),this.params,e):!0},t.prototype.includes=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=i.isString(t)&&v.Glob.fromString(t);if(o){if(!o.matches(this.$current.name))return!1;t=this.$current.name}var a=this.stateRegistry.matcher.find(t,n.relative),s=this.$current.includes;if(i.isDefined(a))return i.isDefined(s[a.name])?e?d.equalForKeys(h.Param.values(a.parameters(),e),this.params,Object.keys(e)):!0:!1},t.prototype.href=function(t,e,n){var o={lossy:!0,inherit:!0,absolute:!1,relative:this.$current};n=r.defaults(n,o);var a=this.stateRegistry.matcher.find(t,n.relative);if(!i.isDefined(a))return null;n.inherit&&(e=this.params.$inherit(e||{},this.$current,a));var s=a&&n.lossy?a.navigable:a;return s&&void 0!==s.url&&null!==s.url?this.$urlRouter.href(s.url,h.Param.values(a.parameters(),e),{absolute:n.absolute}):null},t.prototype.get=function(t,e){return 0===arguments.length?this.stateRegistry.get():this.stateRegistry.get(t,e||this.$current)},t}();e.StateService=g},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(17),a=n(39),s=n(40),u=function(){function t(){}return t.makeTargetState=function(t){var e=r.tail(t).state;return new o.TargetState(e,e,t.map(i.prop("paramValues")).reduce(r.mergeR,{}))},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new a.Node(t).applyRawParams(e)})},t.buildToPath=function(e,n){var r=t.buildPath(n);return n.options().inherit?t.inheritParams(e,r,Object.keys(n.params())):r},t.applyViewConfigs=function(t,e){return e.map(function(e){var n=r.values(e.state.views||{}),i=n.map(function(n){return t.createViewConfig(e,n)}).reduce(r.unnestR,[]);return r.extend(e,{views:i})})},t.inheritParams=function(t,e,n){function o(t,e){var n=r.find(t,i.propEq("state",e));return r.extend({},n&&n.paramValues)}void 0===n&&(n=[]);var s=i.curry(function(t,e,n){var i=r.extend({},n&&n.paramValues),s=r.pick(i,e);i=r.omit(i,e);var u=o(t,n.state)||{},c=r.extend(i,u,s);return new a.Node(n.state).applyRawParams(c)});return e.map(s(t,n))},t.bindTransNodesToPath=function(t){var e=new s.ResolveContext(t);return t.forEach(function(t){t.resolveContext=e.isolateRootTo(t.state),t.resolveInjector=new s.ResolveInjector(t.resolveContext,t.state),t.resolves.$stateParams=new s.Resolvable("$stateParams",function(){return t.paramValues},t.paramValues)}),t},t.treeChanges=function(e,n,r){function o(t,e){var r=a.Node.clone(t);return r.paramValues=n[e].paramValues,r}for(var s=0,u=Math.min(e.length,n.length),c=function(t){return t.parameters({inherit:!1}).filter(i.not(i.prop("dynamic"))).map(i.prop("id"))},l=function(t,e){return t.equals(e,c(t.state))};u>s&&e[s].state!==r&&l(e[s],n[s]);)s++;var f,p,h,v,d,m,g,y;return f=e,p=f.slice(0,s),h=f.slice(s),m=p.map(o),g=n.slice(s),y=m.concat(g),d=t.bindTransNodesToPath(y),v=d.slice(s),{from:f,to:d,retained:p,exiting:h,entering:v}},t.bindTransitionResolve=function(t,e){var n=t.to[0];n.resolves.$transition$=new s.Resolvable("$transition$",function(){return e},e)},t.subPath=function(t,e){var n=r.find(t,function(t){return t.state===e}),i=t.indexOf(n);if(-1===i)throw new Error("The path does not contain the state: "+e);return t.slice(0,i+1)},t.paramValues=function(t){return t.reduce(function(t,e){return r.extend(t,e.paramValues)},{})},t}();e.PathFactory=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(40),a=function(){function t(e){if(e instanceof t){var n=e;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=r.extend({},n.paramValues),this.resolves=r.extend({},n.resolves),this.views=n.views&&n.views.slice(),this.resolveContext=n.resolveContext,this.resolveInjector=n.resolveInjector}else this.state=e,this.paramSchema=e.parameters({inherit:!1}),this.paramValues={},this.resolves=r.mapObj(e.resolve,function(t,e){return new o.Resolvable(e,t)})}return t.prototype.applyRawParams=function(t){var e=function(e){return[e.id,e.value(t[e.id])]};return this.paramValues=this.paramSchema.reduce(function(t,n){return r.applyPairs(t,e(n))},{}),this},t.prototype.parameter=function(t){return r.find(this.paramSchema,i.propEq("id",t))},t.prototype.equals=function(t,e){var n=this;void 0===e&&(e=this.paramSchema.map(i.prop("id")));var o=function(e){return n.parameter(e).type.equals(n.paramValues[e],t.paramValues[e])};return this.state===t.state&&e.map(o).reduce(r.allTrueR,!0)},t.clone=function(e){return new t(e)},t.matching=function(t,e){var n=t.reduce(function(t,n,r){return t===r&&r<e.length&&n.state===e[r].state?r+1:t},0);return t.slice(0,n)},t}();e.Node=a},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(31)),r(n(32)),r(n(41)),r(n(42))},function(t,e,n){"use strict";function r(t,e){var n=a.isString(t)?t:null,r=a.isObject(t)?t:{},i=r[e.name]||n||p;return c.ResolvePolicy[i]}var i=n(3),o=n(5),a=n(4),s=n(12),u=n(6),c=n(31),l=n(3),f=n(38),p=c.ResolvePolicy[c.ResolvePolicy.LAZY],h=function(){function t(t){this._path=t,i.extend(this,{_nodeFor:function(t){return i.find(this._path,o.propEq("state",t))},_pathTo:function(t){return f.PathFactory.subPath(this._path,t)}})}return t.prototype.getResolvables=function(t,e){e=i.defaults(e,{omitOwnLocals:[]});var n=t?this._pathTo(t):this._path,r=i.tail(n);return n.reduce(function(t,n){var o=n===r?e.omitOwnLocals:[],a=i.omit(n.resolves,o);return i.extend(t,a)},{})},t.prototype.getResolvablesForFn=function(t){var e=u.services.$injector.annotate(t,u.services.$injector.strictDi);return i.pick(this.getResolvables(),e)},t.prototype.isolateRootTo=function(e){return new t(this._pathTo(e))},t.prototype.addResolvables=function(t,e){i.extend(this._nodeFor(e).resolves,t)},t.prototype.getOwnResolvables=function(t){return i.extend({},this._nodeFor(t).resolves)},t.prototype.resolvePath=function(t){var e=this;void 0===t&&(t={}),s.trace.traceResolvePath(this._path,t);var n=function(n){return e.resolvePathElement(n.state,t)};return u.services.$q.all(i.map(this._path,n)).then(function(t){return t.reduce(l.mergeR,{})})},t.prototype.resolvePathElement=function(t,e){var n=this;void 0===e&&(e={});var o=e&&e.resolvePolicy,a=c.ResolvePolicy[o||p],l=this.getOwnResolvables(t),f=function(e){return r(t.resolvePolicy,e)>=a},h=i.filter(l,f),v=function(r){return r.get(n.isolateRootTo(t),e)},d=i.map(h,v);return s.trace.traceResolvePathElement(this,h,e),u.services.$q.all(d)},t.prototype.invokeLater=function(t,e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(o),i.extend({when:"Later"},n));var a=function(t){return t.get(r,n)},c=i.map(o,a);return u.services.$q.all(c).then(function(){try{return r.invokeNow(t,e,n)}catch(i){return u.services.$q.reject(i)}})},t.prototype.invokeNow=function(t,e,n){void 0===n&&(n={});var r=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(r),i.extend({when:"Now "},n));var a=i.map(r,o.prop("data"));return u.services.$injector.invoke(t,n.bind||null,i.extend({},e,a))},t}();e.ResolveContext=h},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t,e){this._resolveContext=t,this._state=e}return t.prototype.invokeLater=function(t,e){return this._resolveContext.invokeLater(t,e)},t.prototype.invokeNow=function(t,e){return this._resolveContext.invokeNow(null,t,e)},t.prototype.getLocals=function(t){var e=this,n=function(t){return t.get(e._resolveContext)};return r.map(this._resolveContext.getResolvablesForFn(t),n)},t}();e.ResolveInjector=i},function(t,e,n){"use strict";var r=n(11),i=n(15);e.defaultTransOpts={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null}};var o=function(){function t(t){this.$view=t,this._defaultErrorHandler=function(t){t instanceof Error&&console.error(t)},i.HookRegistry.mixin(new i.HookRegistry,this)}return t.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},t.prototype.create=function(t,e){return new r.Transition(t,e,this)},t}();e.TransitionService=o},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(39)),r(n(38))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(46)),r(n(22)),r(n(47)),r(n(48))},function(t,e,n){"use strict";function r(t,e){var n=["",""],r=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return r;switch(e.squash){case!1:n=["(",")"+(e.isOptional?"?":"")];break;case!0:r=r.replace(/\/$/,""),n=["(?:/(",")|/)?"];break;default:n=["("+e.squash+"|",")?"]}return r+n[0]+e.type.pattern.source+n[1]}var i=n(3),o=n(5),a=n(4),s=n(20),u=n(4),c=n(21),l=n(3),f=n(3),p=function(t,e,n){return t[e]=t[e]||n()},h=function(){function t(e,n){var a=this;this.pattern=e,this.config=n,this._cache={path:[],pattern:null},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=i.defaults(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:i.identity});for(var u,c,l,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=0,v=[],d=function(n){if(!t.nameValidator.test(n))throw new Error("Invalid parameter name '"+n+"' in pattern '"+e+"'");if(i.find(a._params,o.propEq("id",n)))throw new Error("Duplicate parameter name '"+n+"' in pattern '"+e+"'")},m=function(t,n){var r=t[2]||t[3],o=n?t[4]:t[4]||("*"===t[1]?".*":null);return{id:r,regexp:o,cfg:a.config.params[r],segment:e.substring(h,t.index),type:o?s.paramTypes.type(o||"string")||i.inherit(s.paramTypes.type("string"),{pattern:new RegExp(o,a.config.caseInsensitive?"i":void 0)}):null}};(u=f.exec(e))&&(c=m(u,!1),!(c.segment.indexOf("?")>=0));)d(c.id),this._params.push(s.Param.fromPath(c.id,c.type,this.config.paramMap(c.cfg,!1))),this._segments.push(c.segment),v.push([c.segment,i.tail(this._params)]),h=f.lastIndex;l=e.substring(h);var g=l.indexOf("?");if(g>=0){var y=l.substring(g);if(l=l.substring(0,g),y.length>0)for(h=0;u=p.exec(y);)c=m(u,!0),d(c.id),this._params.push(s.Param.fromSearch(c.id,c.type,this.config.paramMap(c.cfg,!0))),h=f.lastIndex}this._segments.push(l),i.extend(this,{_compiled:v.map(function(t){return r.apply(null,t)}).concat(r(l)),prefix:this._segments[0]
1776 "use strict";function r(t){return t=d(t)&&{value:t}||t,s.extend(t,{$$fn:c.isInjectable(t.value)?t.value:function(){return t.value}})}function i(t,e,n,r){if(t.type&&e&&"string"!==e.name)throw new Error("Param '"+r+"' has two type configurations.");return t.type&&e&&"string"===e.name&&h.paramTypes.type(t.type)?h.paramTypes.type(t.type):e?e:t.type?t.type instanceof p.Type?t.type:h.paramTypes.type(t.type):n===m.CONFIG?h.paramTypes.type("any"):h.paramTypes.type("string")}function o(t,e){var n=t.squash;if(!e||n===!1)return!1;if(!c.isDefined(n)||null==n)return f.matcherConfig.defaultSquashPolicy();if(n===!0||c.isString(n))return n;throw new Error("Invalid squash policy: '"+n+"'. Valid policies: false, true, or arbitrary string")}function a(t,e,n,r){var i,o,a=[{from:"",to:n||e?void 0:""},{from:null,to:n||e?void 0:""}];return i=c.isArray(t.replace)?t.replace:[],c.isString(r)&&i.push({from:r,to:void 0}),o=s.map(i,u.prop("from")),s.filter(a,function(t){return-1===o.indexOf(t.from)}).concat(i)}var s=n(3),u=n(5),c=n(4),l=n(6),f=n(22),p=n(23),h=n(24),v=Object.prototype.hasOwnProperty,d=function(t){return 0===["value","type","squash","array","dynamic"].filter(v.bind(t||{})).length};!function(t){t[t.PATH=0]="PATH",t[t.SEARCH=1]="SEARCH",t[t.CONFIG=2]="CONFIG"}(e.DefType||(e.DefType={}));var m=e.DefType,g=function(){function t(t,e,n,u){function c(){var e={array:u===m.SEARCH?"auto":!1},r=t.match(/\[\]$/)?{array:!0}:{};return s.extend(e,r,n).array}n=r(n),e=i(n,e,u,t);var l=c();e=l?e.$asArray(l,u===m.SEARCH):e;var f=void 0!==n.value,p=n.dynamic===!0,h=o(n,f),v=a(n,l,f,h);s.extend(this,{id:t,type:e,location:u,squash:h,replace:v,isOptional:f,dynamic:p,config:n,array:l})}return t.prototype.isDefaultValue=function(t){return this.isOptional&&this.type.equals(this.value(),t)},t.prototype.value=function(t){var e=this,n=function(){if(!l.services.$injector)throw new Error("Injectable functions cannot be called at configuration time");var t=l.services.$injector.invoke(e.config.$$fn);if(null!==t&&void 0!==t&&!e.type.is(t))throw new Error("Default value ("+t+") for parameter '"+e.id+"' is not an instance of Type ("+e.type.name+")");return t},r=function(t){var n=s.map(s.filter(e.replace,u.propEq("from",t)),u.prop("to"));return n.length?n[0]:t};return t=r(t),c.isDefined(t)?this.type.$normalize(t):n()},t.prototype.isSearch=function(){return this.location===m.SEARCH},t.prototype.validates=function(t){if((!c.isDefined(t)||null===t)&&this.isOptional)return!0;var e=this.type.$normalize(t);if(!this.type.is(e))return!1;var n=this.type.encode(e);return!(c.isString(n)&&!this.type.pattern.exec(n))},t.prototype.toString=function(){return"{Param:"+this.id+" "+this.type+" squash: '"+this.squash+"' optional: "+this.isOptional+"}"},t.fromConfig=function(e,n,r){return new t(e,n,r,m.CONFIG)},t.fromPath=function(e,n,r){return new t(e,n,r,m.PATH)},t.fromSearch=function(e,n,r){return new t(e,n,r,m.SEARCH)},t.values=function(t,e){return void 0===e&&(e={}),t.map(function(t){return[t.id,t.value(e[t.id])]}).reduce(s.applyPairs,{})},t.changed=function(t,e,n){return void 0===e&&(e={}),void 0===n&&(n={}),t.filter(function(t){return!t.type.equals(e[t.id],n[t.id])})},t.equals=function(e,n,r){return void 0===n&&(n={}),void 0===r&&(r={}),0===t.changed(e,n,r).length},t.validates=function(t,e){return void 0===e&&(e={}),t.map(function(t){return t.validates(e[t.id])}).reduce(s.allTrueR,!0)},t}();e.Param=g},function(t,e,n){"use strict";var r=n(4),i=function(){function t(){this._isCaseInsensitive=!1,this._isStrictMode=!0,this._defaultSquashPolicy=!1}return t.prototype.caseInsensitive=function(t){return this._isCaseInsensitive=r.isDefined(t)?t:this._isCaseInsensitive},t.prototype.strictMode=function(t){return this._isStrictMode=r.isDefined(t)?t:this._isStrictMode},t.prototype.defaultSquashPolicy=function(t){if(r.isDefined(t)&&t!==!0&&t!==!1&&!r.isString(t))throw new Error("Invalid squash policy: "+t+". Valid policies: false, true, arbitrary-string");return this._defaultSquashPolicy=r.isDefined(t)?t:this._defaultSquashPolicy},t}();e.MatcherConfig=i,e.matcherConfig=new i},function(t,e,n){"use strict";function r(t,e){function n(t){return o.isArray(t)?t:o.isDefined(t)?[t]:[]}function r(t){switch(t.length){case 0:return;case 1:return"auto"===e?t[0]:t;default:return t}}function a(t,e){return function(a){if(o.isArray(a)&&0===a.length)return a;var s=n(a),u=i.map(s,t);return e===!0?0===i.filter(u,function(t){return!t}).length:r(u)}}function s(t){return function(e,r){var i=n(e),o=n(r);if(i.length!==o.length)return!1;for(var a=0;a<i.length;a++)if(!t(i[a],o[a]))return!1;return!0}}var u=this;["encode","decode","equals","$normalize"].map(function(e){u[e]=("equals"===e?s:a)(t[e].bind(t))}),i.extend(this,{name:t.name,pattern:t.pattern,is:a(t.is.bind(t),!0),$arrayMode:e})}var i=n(3),o=n(4),a=function(){function t(t){this.pattern=/.*/,i.extend(this,t)}return t.prototype.is=function(t,e){return!0},t.prototype.encode=function(t,e){return t},t.prototype.decode=function(t,e){return t},t.prototype.equals=function(t,e){return t==e},t.prototype.$subPattern=function(){var t=this.pattern.toString();return t.substr(1,t.length-2)},t.prototype.toString=function(){return"{Type:"+this.name+"}"},t.prototype.$normalize=function(t){return this.is(t)?t:this.decode(t)},t.prototype.$asArray=function(t,e){if(!t)return this;if("auto"===t&&!e)throw new Error("'auto' array mode is for query parameters only");return new r(this,t)},t}();e.Type=a},function(t,e,n){"use strict";function r(t){return null!=t?t.toString().replace(/~/g,"~~").replace(/\//g,"~2F"):t}function i(t){return null!=t?t.toString().replace(/~2F/g,"/").replace(/~~/g,"~"):t}var o=n(3),a=n(4),s=n(5),u=n(6),c=n(23),l=function(){function t(){this.enqueue=!0,this.typeQueue=[],this.defaultTypes={hash:{encode:r,decode:i,is:s.is(String),pattern:/.*/,equals:function(t,e){return t==e}},string:{encode:r,decode:i,is:s.is(String),pattern:/[^\/]*/},"int":{encode:r,decode:function(t){return parseInt(t,10)},is:function(t){return a.isDefined(t)&&this.decode(t.toString())===t},pattern:/-?\d+/},bool:{encode:function(t){return t&&1||0},decode:function(t){return 0!==parseInt(t,10)},is:s.is(Boolean),pattern:/0|1/},date:{encode:function(t){return this.is(t)?[t.getFullYear(),("0"+(t.getMonth()+1)).slice(-2),("0"+t.getDate()).slice(-2)].join("-"):void 0},decode:function(t){if(this.is(t))return t;var e=this.capture.exec(t);return e?new Date(e[1],e[2]-1,e[3]):void 0},is:function(t){return t instanceof Date&&!isNaN(t.valueOf())},equals:function(t,e){return["getFullYear","getMonth","getDate"].reduce(function(n,r){return n&&t[r]()===e[r]()},!0)},pattern:/[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[1-2][0-9]|3[0-1])/,capture:/([0-9]{4})-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])/},json:{encode:o.toJson,decode:o.fromJson,is:s.is(Object),equals:o.equals,pattern:/[^\/]*/},any:{encode:o.identity,decode:o.identity,equals:o.equals,pattern:/.*/}};var t=function(t,e){return new c.Type(o.extend({name:e},t))};this.types=o.inherit(o.map(this.defaultTypes,t),{})}return t.prototype.type=function(t,e,n){if(!a.isDefined(e))return this.types[t];if(this.types.hasOwnProperty(t))throw new Error("A type named '"+t+"' has already been defined.");return this.types[t]=new c.Type(o.extend({name:t},e)),n&&(this.typeQueue.push({name:t,def:n}),this.enqueue||this._flushTypeQueue()),this},t.prototype._flushTypeQueue=function(){for(;this.typeQueue.length;){var t=this.typeQueue.shift();if(t.pattern)throw new Error("You cannot override a type's .pattern at runtime.");o.extend(this.types[t.name],u.services.$injector.invoke(t.def))}},t}();e.ParamTypes=l,e.paramTypes=new l},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t){void 0===t&&(t={}),r.extend(this,t)}return t.prototype.$inherit=function(t,e,n){var i,o=r.ancestors(e,n),a={},s=[];for(var u in o)if(o[u]&&o[u].params&&(i=Object.keys(o[u].params),i.length))for(var c in i)s.indexOf(i[c])>=0||(s.push(i[c]),a[i[c]]=this[i[c]]);return r.extend({},a,t)},t}();e.StateParams=i},function(t,e,n){"use strict";var r=n(10),i=n(27),o=n(28),a=n(29),s=n(30),u=n(6),c=function(){function t(t,e,n,r,i,c){this.transition=t,this.$transitions=e,this.$urlRouter=n,this.$view=r,this.$state=i,this.globals=c,this.$q=u.services.$q,this.viewHooks=new o.ViewHooks(t,r),this.enterExitHooks=new a.EnterExitHooks(t),this.resolveHooks=new s.ResolveHooks(t),this.treeChanges=t.treeChanges(),this.registerUpdateGlobalState(),this.viewHooks.registerHooks(),this.enterExitHooks.registerHooks(),this.resolveHooks.registerHooks()}return t.prototype.runTransition=function(){var t=this;return this.globals.transitionHistory.enqueue(this.transition),this.transition.run().then(function(t){return t.to()})["catch"](function(e){return t.transRejected(e)})},t.prototype.registerUpdateGlobalState=function(){this.transition.onSuccess({},this.updateUrl.bind(this),{priority:9999})},t.prototype.transRejected=function(t){var e=this,n=e.transition,o=e.$state,a=e.$q;if(t instanceof r.Rejection){if(t.type===r.RejectType.IGNORED)return this.$urlRouter.update(),o.current;if(t.type===r.RejectType.SUPERSEDED&&t.redirected&&t.detail instanceof i.TargetState)return this._redirectMgr(n.redirect(t.detail)).runTransition();t.type===r.RejectType.ABORTED&&this.$urlRouter.update()}return this.$transitions.defaultErrorHandler()(t),a.reject(t)},t.prototype.updateUrl=function(){var t=this.transition,e=this,n=e.$urlRouter,r=e.$state,i=t.options();i.location&&r.$current.navigable&&n.push(r.$current.navigable.url,r.params,{replace:"replace"===i.location}),n.update(!0)},t.prototype._redirectMgr=function(e){var n=this,r=n.$transitions,i=n.$urlRouter,o=n.$view,a=n.$state,s=n.globals;return new t(e,r,i,o,a,s)},t}();e.TransitionManager=c},function(t,e){"use strict";var n=function(){function t(t,e,n,r){void 0===n&&(n={}),void 0===r&&(r={}),this._identifier=t,this._definition=e,this._options=r,this._params=n||{}}return t.prototype.name=function(){return this._definition&&this._definition.name||this._identifier},t.prototype.identifier=function(){return this._identifier},t.prototype.params=function(){return this._params},t.prototype.$state=function(){return this._definition},t.prototype.state=function(){return this._definition&&this._definition.self},t.prototype.options=function(){return this._options},t.prototype.exists=function(){return!(!this._definition||!this._definition.self)},t.prototype.valid=function(){return!this.error()},t.prototype.error=function(){var t=this.options().relative;if(!this._definition&&t){var e=t.name?t.name:t;return"Could not resolve '"+this.name()+"' from state '"+e+"'"}return this._definition?this._definition.self?void 0:"State '"+this.name()+"' has an invalid definition":"No such state '"+this.name()+"'"},t}();e.TargetState=n},function(t,e,n){"use strict";var r=n(3),i=n(6),o=function(){function t(t,e){this.transition=t,this.$view=e,this.treeChanges=t.treeChanges(),this.enteringViews=t.views("entering"),this.exitingViews=t.views("exiting")}return t.prototype.loadAllEnteringViews=function(){return i.services.$q.all(this.enteringViews.map(function(t){return t.load()})).then(r.noop)},t.prototype.updateViews=function(){var t=this.$view;this.exitingViews.forEach(function(e){return t.deactivateViewConfig(e)}),this.enteringViews.forEach(function(e){return t.activateViewConfig(e)}),t.sync()},t.prototype.registerHooks=function(){this.enteringViews.length&&this.transition.onStart({},this.loadAllEnteringViews.bind(this)),(this.exitingViews.length||this.enteringViews.length)&&this.transition.onSuccess({},this.updateViews.bind(this))},t}();e.ViewHooks=o},function(t,e){"use strict";var n=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){this.registerOnEnterHooks(),this.registerOnRetainHooks(),this.registerOnExitHooks()},t.prototype.registerOnEnterHooks=function(){var t=this;this.transition.entering().filter(function(t){return!!t.onEnter}).forEach(function(e){return t.transition.onEnter({entering:e.name},e.onEnter)})},t.prototype.registerOnRetainHooks=function(){var t=this;this.transition.retained().filter(function(t){return!!t.onRetain}).forEach(function(e){return t.transition.onRetain({retained:e.name},e.onRetain)})},t.prototype.registerOnExitHooks=function(){var t=this;this.transition.exiting().filter(function(t){return!!t.onExit}).forEach(function(e){return t.transition.onExit({exiting:e.name},e.onExit)})},t}();e.EnterExitHooks=n},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(31),a=n(5),s=n(32),u=o.ResolvePolicy[o.ResolvePolicy.LAZY],c=o.ResolvePolicy[o.ResolvePolicy.EAGER],l=function(){function t(t){this.transition=t}return t.prototype.registerHooks=function(){function t(t){return r.tail(n.to).resolveContext.resolvePath(r.extend({transition:t},{resolvePolicy:c}))}function e(t,e){var o=r.find(n.entering,i.propEq("state",t)),a=o.resolveContext,c=new s.Resolvable("$resolve$",function(){return r.map(a.getResolvables(),function(t){return t.data})}),l=r.extend({transition:e},{resolvePolicy:u});return a.resolvePathElement(o.state,l).then(function(){return c.resolveResolvable(a)}).then(function(){return a.addResolvables({$resolve$:c},o.state)})}var n=this.transition.treeChanges();t.$inject=["$transition$"],e.$inject=["$state$","$transition$"],this.transition.onStart({},t,{priority:1e3}),this.transition.onEnter({entering:a.val(!0)},e,{priority:1e3})},t}();e.ResolveHooks=l},function(t,e){"use strict";!function(t){t[t.JIT=0]="JIT",t[t.LAZY=1]="LAZY",t[t.EAGER=2]="EAGER"}(e.ResolvePolicy||(e.ResolvePolicy={}));e.ResolvePolicy},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(6),s=n(12),u=function(){function t(t,e,n){this.promise=void 0,r.extend(this,{name:t,resolveFn:e,deps:a.services.$injector.annotate(e,a.services.$injector.strictDi),data:n})}return t.prototype.resolveResolvable=function(t,e){var n=this;void 0===e&&(e={});var i=this,o=i.name,u=i.deps,c=i.resolveFn;s.trace.traceResolveResolvable(this,e);var l=a.services.$q.defer();this.promise=l.promise;var f=t.getResolvables(null,{omitOwnLocals:[o]}),p=r.pick(f,u),h=r.map(p,function(n){return n.get(t,e)});return a.services.$q.all(h).then(function(t){try{var e=a.services.$injector.invoke(c,null,t);l.resolve(e)}catch(r){l.reject(r)}return n.promise}).then(function(t){return n.data=t,s.trace.traceResolvableResolved(n,e),n.promise})},t.prototype.get=function(t,e){return this.promise||this.resolveResolvable(t,e)},t.prototype.toString=function(){return"Resolvable(name: "+this.name+", requires: ["+this.deps+"])"},t.makeResolvables=function(e){var n=r.filter(e,i.not(o.isInjectable)),a=Object.keys(n);if(a.length)throw new Error("Invalid resolve key/value: "+a[0]+"/"+n[a[0]]);return r.map(e,function(e,n){return new t(n,e)})},t}();e.Resolvable=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=function(){function t(t){r.extend(this,t)}return t.prototype.is=function(t){return this===t||this.self===t||this.fqn()===t},t.prototype.fqn=function(){if(!(this.parent&&this.parent instanceof this.constructor))return this.name;var t=this.parent.fqn();return t?t+"."+this.name:this.name},t.prototype.root=function(){return this.parent&&this.parent.root()||this},t.prototype.parameters=function(t){t=r.defaults(t,{inherit:!0});var e=t.inherit&&this.parent&&this.parent.parameters()||[];return e.concat(r.values(this.params))},t.prototype.parameter=function(t,e){return void 0===e&&(e={}),this.url&&this.url.parameter(t,e)||r.find(r.values(this.params),i.propEq("id",t))||e.inherit&&this.parent&&this.parent.parameter(t)},t.prototype.toString=function(){return this.fqn()},t}();e.State=o},function(t,e,n){"use strict";var r=n(4),i=function(){function t(t){this._states=t}return t.prototype.isRelative=function(t){return t=t||"",0===t.indexOf(".")||0===t.indexOf("^")},t.prototype.find=function(t,e){if(t||""===t){var n=r.isString(t),i=n?t:t.name;this.isRelative(i)&&(i=this.resolvePath(i,e));var o=this._states[i];return!o||!n&&(n||o!==t&&o.self!==t)?void 0:o}},t.prototype.resolvePath=function(t,e){if(!e)throw new Error("No reference point given for path '"+t+"'");for(var n=this.find(e),r=t.split("."),i=0,o=r.length,a=n;o>i;i++)if(""!==r[i]||0!==i){if("^"!==r[i])break;if(!a.parent)throw new Error("Path '"+t+"' not valid for state '"+n.name+"'");a=a.parent}else a=n;var s=r.slice(i).join(".");return a.name+(a.name&&s?".":"")+s},t}();e.StateMatcher=i},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(17),a=function(){function t(t,e,n){this.states=t,this.builder=e,this.$urlRouterProvider=n,this.queue=[]}return t.prototype.register=function(t){var e=this,n=e.states,a=e.queue,s=e.$state,u=r.inherit(new o.State,r.extend({},t,{self:t,resolve:t.resolve||{},toString:function(){return t.name}}));if(!i.isString(u.name))throw new Error("State must have a valid name");if(n.hasOwnProperty(u.name)||-1!==r.pluck(a,"name").indexOf(u.name))throw new Error("State '"+u.name+"' is already defined");return a.push(u),this.$state&&this.flush(s),u},t.prototype.flush=function(t){for(var e,n,r,i=this,o=i.queue,a=i.states,s=i.builder,u=[],c={};o.length>0;)if(n=o.shift(),e=s.build(n),r=u.indexOf(n),e){if(a.hasOwnProperty(n.name))throw new Error("State '"+name+"' is already defined");a[n.name]=n,this.attachRoute(t,n),r>=0&&u.splice(r,1)}else{var l=c[n.name];if(c[n.name]=o.length,r>=0&&l===o.length)return a;0>r&&u.push(n),o.push(n)}return a},t.prototype.autoFlush=function(t){this.$state=t,this.flush(t)},t.prototype.attachRoute=function(t,e){var n=this.$urlRouterProvider;!e[r.abstractKey]&&e.url&&n.when(e.url,["$match","$stateParams",function(n,i){t.$current.navigable===e&&r.equalForKeys(n,i)||t.transitionTo(e,n,{inherit:!0,location:!1})}])},t}();e.StateQueueManager=a},function(t,e,n){"use strict";var r=n(34),i=n(19),o=n(35),a=function(){function t(t,e){this.states={},this.matcher=new r.StateMatcher(this.states),this.builder=new i.StateBuilder(this.matcher,t),this.stateQueue=new o.StateQueueManager(this.states,this.builder,e);var n={name:"",url:"^",views:null,params:{"#":{value:null,type:"hash",dynamic:!0}},"abstract":!0},a=this._root=this.stateQueue.register(n);a.navigable=null}return t.prototype.root=function(){return this._root},t.prototype.register=function(t){return this.stateQueue.register(t)},t.prototype.get=function(t,e){var n=this;if(0===arguments.length)return Object.keys(this.states).map(function(t){return n.states[t].self});var r=this.matcher.find(t,e);return r&&r.self||null},t.prototype.decorator=function(t,e){return this.builder.builder(t,e)},t}();e.StateRegistry=a},function(t,e,n){"use strict";var r=n(3),i=n(4),o=n(8),a=n(6),s=n(38),u=n(39),c=n(43),l=n(10),f=n(27),p=n(26),h=n(21),v=n(7),d=n(3),m=n(3),g=function(){function t(e,n,r,i,o,a){this.$view=e,this.$urlRouter=n,this.$transitions=r,this.stateRegistry=i,this.stateProvider=o,this.globals=a;var s=["current","$current","params","transition"],u=Object.keys(t.prototype).filter(function(t){return-1===s.indexOf(t)});m.bindFunctions(t.prototype,this,this,u)}return Object.defineProperty(t.prototype,"transition",{get:function(){return this.globals.transition},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"params",{get:function(){return this.globals.params},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"current",{get:function(){return this.globals.current},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"$current",{get:function(){return this.globals.$current},enumerable:!0,configurable:!0}),t.prototype._handleInvalidTargetState=function(t,e){function n(){var t=p.dequeue();return void 0===t?l.Rejection.invalid(e.error()).toPromise():d(t).then(m).then(function(t){return t||n()})}var r=this,i=function(){return r.globals.transitionHistory.peekTail()},u=i(),c=s.PathFactory.makeTargetState(t),p=new o.Queue([].concat(this.stateProvider.invalidCallbacks)),h=a.services.$q,v=a.services.$injector,d=function(t){return h.when(v.invoke(t,null,{$to$:e,$from$:c}))},m=function(t){if(t instanceof f.TargetState){var e=t;return e=r.target(e.identifier(),e.params(),e.options()),e.valid()?i()!==u?l.Rejection.superseded().toPromise():r.transitionTo(e.identifier(),e.params(),e.options()):l.Rejection.invalid(e.error()).toPromise()}};return n()},t.prototype.reload=function(t){return this.transitionTo(this.current,this.params,{reload:i.isDefined(t)?t:!0,inherit:!1,notify:!1})},t.prototype.go=function(t,e,n){var i={relative:this.$current,inherit:!0},o=r.defaults(n,i,c.defaultTransOpts);return this.transitionTo(t,e,o)},t.prototype.target=function(t,e,n){if(void 0===n&&(n={}),i.isObject(n.reload)&&!n.reload.name)throw new Error("Invalid reload state object");if(n.reloadState=n.reload===!0?this.stateRegistry.root():this.stateRegistry.matcher.find(n.reload,n.relative),n.reload&&!n.reloadState)throw new Error("No such reload state '"+(i.isString(n.reload)?n.reload:n.reload.name)+"'");var r=this.stateRegistry.matcher.find(t,n.relative);return new f.TargetState(t,r,e,n)},t.prototype.transitionTo=function(t,e,n){var i=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.globals.transitionHistory;n=r.defaults(n,c.defaultTransOpts),n=r.extend(n,{current:o.peekTail.bind(o)});var l=this.target(t,e,n),f=this.globals.successfulTransitions.peekTail(),h=function(){return s.PathFactory.bindTransNodesToPath([new u.Node(i.stateRegistry.root())])},v=f?f.treeChanges().to:h();if(!l.exists())return this._handleInvalidTargetState(v,l);if(!l.valid())return a.services.$q.reject(l.error());var d=this.$transitions.create(v,l),m=new p.TransitionManager(d,this.$transitions,this.$urlRouter,this.$view,this,this.globals),g=m.runTransition();return r.extend(g,{transition:d})},t.prototype.is=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=this.stateRegistry.matcher.find(t,n.relative);if(i.isDefined(o))return this.$current!==o?!1:i.isDefined(e)&&null!==e?h.Param.equals(o.parameters(),this.params,e):!0},t.prototype.includes=function(t,e,n){n=r.defaults(n,{relative:this.$current});var o=i.isString(t)&&v.Glob.fromString(t);if(o){if(!o.matches(this.$current.name))return!1;t=this.$current.name}var a=this.stateRegistry.matcher.find(t,n.relative),s=this.$current.includes;if(i.isDefined(a))return i.isDefined(s[a.name])?e?d.equalForKeys(h.Param.values(a.parameters(),e),this.params,Object.keys(e)):!0:!1},t.prototype.href=function(t,e,n){var o={lossy:!0,inherit:!0,absolute:!1,relative:this.$current};n=r.defaults(n,o);var a=this.stateRegistry.matcher.find(t,n.relative);if(!i.isDefined(a))return null;n.inherit&&(e=this.params.$inherit(e||{},this.$current,a));var s=a&&n.lossy?a.navigable:a;return s&&void 0!==s.url&&null!==s.url?this.$urlRouter.href(s.url,h.Param.values(a.parameters(),e),{absolute:n.absolute}):null},t.prototype.get=function(t,e){return 0===arguments.length?this.stateRegistry.get():this.stateRegistry.get(t,e||this.$current)},t}();e.StateService=g},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(17),a=n(39),s=n(40),u=function(){function t(){}return t.makeTargetState=function(t){var e=r.tail(t).state;return new o.TargetState(e,e,t.map(i.prop("paramValues")).reduce(r.mergeR,{}))},t.buildPath=function(t){var e=t.params();return t.$state().path.map(function(t){return new a.Node(t).applyRawParams(e)})},t.buildToPath=function(e,n){var r=t.buildPath(n);return n.options().inherit?t.inheritParams(e,r,Object.keys(n.params())):r},t.applyViewConfigs=function(t,e){return e.map(function(e){var n=r.values(e.state.views||{}),i=n.map(function(n){return t.createViewConfig(e,n)}).reduce(r.unnestR,[]);return r.extend(e,{views:i})})},t.inheritParams=function(t,e,n){function o(t,e){var n=r.find(t,i.propEq("state",e));return r.extend({},n&&n.paramValues)}void 0===n&&(n=[]);var s=i.curry(function(t,e,n){var i=r.extend({},n&&n.paramValues),s=r.pick(i,e);i=r.omit(i,e);var u=o(t,n.state)||{},c=r.extend(i,u,s);return new a.Node(n.state).applyRawParams(c)});return e.map(s(t,n))},t.bindTransNodesToPath=function(t){var e=new s.ResolveContext(t);return t.forEach(function(t){t.resolveContext=e.isolateRootTo(t.state),t.resolveInjector=new s.ResolveInjector(t.resolveContext,t.state),t.resolves.$stateParams=new s.Resolvable("$stateParams",function(){return t.paramValues},t.paramValues)}),t},t.treeChanges=function(e,n,r){function o(t,e){var r=a.Node.clone(t);return r.paramValues=n[e].paramValues,r}for(var s=0,u=Math.min(e.length,n.length),c=function(t){return t.parameters({inherit:!1}).filter(i.not(i.prop("dynamic"))).map(i.prop("id"))},l=function(t,e){return t.equals(e,c(t.state))};u>s&&e[s].state!==r&&l(e[s],n[s]);)s++;var f,p,h,v,d,m,g,y;return f=e,p=f.slice(0,s),h=f.slice(s),m=p.map(o),g=n.slice(s),y=m.concat(g),d=t.bindTransNodesToPath(y),v=d.slice(s),{from:f,to:d,retained:p,exiting:h,entering:v}},t.bindTransitionResolve=function(t,e){var n=t.to[0];n.resolves.$transition$=new s.Resolvable("$transition$",function(){return e},e)},t.subPath=function(t,e){var n=r.find(t,function(t){return t.state===e}),i=t.indexOf(n);if(-1===i)throw new Error("The path does not contain the state: "+e);return t.slice(0,i+1)},t.paramValues=function(t){return t.reduce(function(t,e){return r.extend(t,e.paramValues)},{})},t}();e.PathFactory=u},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(40),a=function(){function t(e){if(e instanceof t){var n=e;this.state=n.state,this.paramSchema=n.paramSchema.slice(),this.paramValues=r.extend({},n.paramValues),this.resolves=r.extend({},n.resolves),this.views=n.views&&n.views.slice(),this.resolveContext=n.resolveContext,this.resolveInjector=n.resolveInjector}else this.state=e,this.paramSchema=e.parameters({inherit:!1}),this.paramValues={},this.resolves=r.mapObj(e.resolve,function(t,e){return new o.Resolvable(e,t)})}return t.prototype.applyRawParams=function(t){var e=function(e){return[e.id,e.value(t[e.id])]};return this.paramValues=this.paramSchema.reduce(function(t,n){return r.applyPairs(t,e(n))},{}),this},t.prototype.parameter=function(t){return r.find(this.paramSchema,i.propEq("id",t))},t.prototype.equals=function(t,e){var n=this;void 0===e&&(e=this.paramSchema.map(i.prop("id")));var o=function(e){return n.parameter(e).type.equals(n.paramValues[e],t.paramValues[e])};return this.state===t.state&&e.map(o).reduce(r.allTrueR,!0)},t.clone=function(e){return new t(e)},t.matching=function(t,e){var n=t.reduce(function(t,n,r){return t===r&&r<e.length&&n.state===e[r].state?r+1:t},0);return t.slice(0,n)},t}();e.Node=a},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(31)),r(n(32)),r(n(41)),r(n(42))},function(t,e,n){"use strict";function r(t,e){var n=a.isString(t)?t:null,r=a.isObject(t)?t:{},i=r[e.name]||n||p;return c.ResolvePolicy[i]}var i=n(3),o=n(5),a=n(4),s=n(12),u=n(6),c=n(31),l=n(3),f=n(38),p=c.ResolvePolicy[c.ResolvePolicy.LAZY],h=function(){function t(t){this._path=t,i.extend(this,{_nodeFor:function(t){return i.find(this._path,o.propEq("state",t))},_pathTo:function(t){return f.PathFactory.subPath(this._path,t)}})}return t.prototype.getResolvables=function(t,e){e=i.defaults(e,{omitOwnLocals:[]});var n=t?this._pathTo(t):this._path,r=i.tail(n);return n.reduce(function(t,n){var o=n===r?e.omitOwnLocals:[],a=i.omit(n.resolves,o);return i.extend(t,a)},{})},t.prototype.getResolvablesForFn=function(t){var e=u.services.$injector.annotate(t,u.services.$injector.strictDi);return i.pick(this.getResolvables(),e)},t.prototype.isolateRootTo=function(e){return new t(this._pathTo(e))},t.prototype.addResolvables=function(t,e){i.extend(this._nodeFor(e).resolves,t)},t.prototype.getOwnResolvables=function(t){return i.extend({},this._nodeFor(t).resolves)},t.prototype.resolvePath=function(t){var e=this;void 0===t&&(t={}),s.trace.traceResolvePath(this._path,t);var n=function(n){return e.resolvePathElement(n.state,t)};return u.services.$q.all(i.map(this._path,n)).then(function(t){return t.reduce(l.mergeR,{})})},t.prototype.resolvePathElement=function(t,e){var n=this;void 0===e&&(e={});var o=e&&e.resolvePolicy,a=c.ResolvePolicy[o||p],l=this.getOwnResolvables(t),f=function(e){return r(t.resolvePolicy,e)>=a},h=i.filter(l,f),v=function(r){return r.get(n.isolateRootTo(t),e)},d=i.map(h,v);return s.trace.traceResolvePathElement(this,h,e),u.services.$q.all(d)},t.prototype.invokeLater=function(t,e,n){var r=this;void 0===e&&(e={}),void 0===n&&(n={});var o=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(o),i.extend({when:"Later"},n));var a=function(t){return t.get(r,n)},c=i.map(o,a);return u.services.$q.all(c).then(function(){try{return r.invokeNow(t,e,n)}catch(i){return u.services.$q.reject(i)}})},t.prototype.invokeNow=function(t,e,n){void 0===n&&(n={});var r=this.getResolvablesForFn(t);s.trace.tracePathElementInvoke(i.tail(this._path),t,Object.keys(r),i.extend({when:"Now "},n));var a=i.map(r,o.prop("data"));return u.services.$injector.invoke(t,n.bind||null,i.extend({},e,a))},t}();e.ResolveContext=h},function(t,e,n){"use strict";var r=n(3),i=function(){function t(t,e){this._resolveContext=t,this._state=e}return t.prototype.invokeLater=function(t,e){return this._resolveContext.invokeLater(t,e)},t.prototype.invokeNow=function(t,e){return this._resolveContext.invokeNow(null,t,e)},t.prototype.getLocals=function(t){var e=this,n=function(t){return t.get(e._resolveContext)};return r.map(this._resolveContext.getResolvablesForFn(t),n)},t}();e.ResolveInjector=i},function(t,e,n){"use strict";var r=n(11),i=n(15);e.defaultTransOpts={location:!0,relative:null,inherit:!1,notify:!0,reload:!1,custom:{},current:function(){return null}};var o=function(){function t(t){this.$view=t,this._defaultErrorHandler=function(t){t instanceof Error&&console.error(t)},i.HookRegistry.mixin(new i.HookRegistry,this)}return t.prototype.defaultErrorHandler=function(t){return this._defaultErrorHandler=t||this._defaultErrorHandler},t.prototype.create=function(t,e){return new r.Transition(t,e,this)},t}();e.TransitionService=o},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(39)),r(n(38))},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(46)),r(n(22)),r(n(47)),r(n(48))},function(t,e,n){"use strict";function r(t,e){var n=["",""],r=t.replace(/[\\\[\]\^$*+?.()|{}]/g,"\\$&");if(!e)return r;switch(e.squash){case!1:n=["(",")"+(e.isOptional?"?":"")];break;case!0:r=r.replace(/\/$/,""),n=["(?:/(",")|/)?"];break;default:n=["("+e.squash+"|",")?"]}return r+n[0]+e.type.pattern.source+n[1]}var i=n(3),o=n(5),a=n(4),s=n(20),u=n(4),c=n(21),l=n(3),f=n(3),p=function(t,e,n){return t[e]=t[e]||n()},h=function(){function t(e,n){var a=this;this.pattern=e,this.config=n,this._cache={path:[],pattern:null},this._children=[],this._params=[],this._segments=[],this._compiled=[],this.config=i.defaults(this.config,{params:{},strict:!0,caseInsensitive:!1,paramMap:i.identity});for(var u,c,l,f=/([:*])([\w\[\]]+)|\{([\w\[\]]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,p=/([:]?)([\w\[\].-]+)|\{([\w\[\].-]+)(?:\:\s*((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g,h=0,v=[],d=function(n){if(!t.nameValidator.test(n))throw new Error("Invalid parameter name '"+n+"' in pattern '"+e+"'");if(i.find(a._params,o.propEq("id",n)))throw new Error("Duplicate parameter name '"+n+"' in pattern '"+e+"'")},m=function(t,n){var r=t[2]||t[3],o=n?t[4]:t[4]||("*"===t[1]?".*":null);return{id:r,regexp:o,cfg:a.config.params[r],segment:e.substring(h,t.index),type:o?s.paramTypes.type(o||"string")||i.inherit(s.paramTypes.type("string"),{pattern:new RegExp(o,a.config.caseInsensitive?"i":void 0)}):null}};(u=f.exec(e))&&(c=m(u,!1),!(c.segment.indexOf("?")>=0));)d(c.id),this._params.push(s.Param.fromPath(c.id,c.type,this.config.paramMap(c.cfg,!1))),this._segments.push(c.segment),v.push([c.segment,i.tail(this._params)]),h=f.lastIndex;l=e.substring(h);var g=l.indexOf("?");if(g>=0){var y=l.substring(g);if(l=l.substring(0,g),y.length>0)for(h=0;u=p.exec(y);)c=m(u,!0),d(c.id),this._params.push(s.Param.fromSearch(c.id,c.type,this.config.paramMap(c.cfg,!0))),h=f.lastIndex}this._segments.push(l),i.extend(this,{_compiled:v.map(function(t){return r.apply(null,t)}).concat(r(l)),prefix:this._segments[0]
1777 }),Object.freeze(this)}return t.prototype.append=function(t){return this._children.push(t),i.forEach(t._cache,function(e,n){return t._cache[n]=a.isArray(e)?[]:null}),t._cache.path=this._cache.path.concat(this),t},t.prototype.isRoot=function(){return 0===this._cache.path.length},t.prototype.toString=function(){return this.pattern},t.prototype.exec=function(t,e,n,r){function a(t){var e=function(t){return t.split("").reverse().join("")},n=function(t){return t.replace(/\\-/g,"-")},r=e(t).split(/-(?!\\)/),o=i.map(r,e);return i.map(o,n).reverse()}var s=this;void 0===e&&(e={}),void 0===r&&(r={});var c=p(this._cache,"pattern",function(){return new RegExp(["^",i.unnest(s._cache.path.concat(s).map(o.prop("_compiled"))).join(""),s.config.strict===!1?"/?":"","$"].join(""),s.config.caseInsensitive?"i":void 0)}).exec(t);if(!c)return null;var l=this.parameters(),f=l.filter(function(t){return!t.isSearch()}),h=l.filter(function(t){return t.isSearch()}),v=this._cache.path.concat(this).map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),d={};if(v!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var m=0;v>m;m++){for(var g=f[m],y=c[m+1],w=0;w<g.replace.length;w++)g.replace[w].from===y&&(y=g.replace[w].to);y&&g.array===!0&&(y=a(y)),u.isDefined(y)&&(y=g.type.decode(y)),d[g.id]=g.value(y)}return i.forEach(h,function(t){for(var n=e[t.id],r=0;r<t.replace.length;r++)t.replace[r].from===n&&(n=t.replace[r].to);u.isDefined(n)&&(n=t.type.decode(n)),d[t.id]=t.value(n)}),n&&(d["#"]=n),d},t.prototype.parameters=function(t){return void 0===t&&(t={}),t.inherit===!1?this._params:i.unnest(this._cache.path.concat(this).map(o.prop("_params")))},t.prototype.parameter=function(t,e){void 0===e&&(e={});var n=i.tail(this._cache.path);return i.find(this._params,o.propEq("id",t))||e.inherit!==!1&&n&&n.parameter(t)||null},t.prototype.validates=function(t){var e=this,n=function(t,e){return!t||t.validates(e)};return i.pairs(t||{}).map(function(t){var r=t[0],i=t[1];return n(e.parameter(r),i)}).reduce(i.allTrueR,!0)},t.prototype.format=function(e){function n(t){var n=t.value(e[t.id]),r=t.isDefaultValue(n),i=r?t.squash:!1,o=t.type.encode(n);return{param:t,value:n,isDefaultValue:r,squash:i,encoded:o}}if(void 0===e&&(e={}),!this.validates(e))return null;var r=this._cache.path.slice().concat(this),o=r.map(t.pathSegmentsAndParams).reduce(l.unnestR,[]),s=r.map(t.queryParams).reduce(l.unnestR,[]),u=o.reduce(function(e,r){if(a.isString(r))return e+r;var o=n(r),s=o.squash,u=o.encoded,c=o.param;return s===!0?e.match(/\/$/)?e.slice(0,-1):e:a.isString(s)?e+s:s!==!1?e:null==u?e:a.isArray(u)?e+i.map(u,t.encodeDashes).join("-"):c.type.raw?e+u:e+encodeURIComponent(u)},""),c=s.map(function(t){var e=n(t),r=e.squash,o=e.encoded,s=e.isDefaultValue;if(!(null==o||s&&r!==!1)&&(a.isArray(o)||(o=[o]),0!==o.length))return t.type.raw||(o=i.map(o,encodeURIComponent)),o.map(function(e){return t.id+"="+e})}).filter(i.identity).reduce(l.unnestR,[]).join("&");return u+(c?"?"+c:"")+(e["#"]?"#"+e["#"]:"")},t.encodeDashes=function(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})},t.pathSegmentsAndParams=function(t){var e=t._segments,n=t._params.filter(function(t){return t.location===c.DefType.PATH});return f.arrayTuples(e,n.concat(void 0)).reduce(l.unnestR,[]).filter(function(t){return""!==t&&u.isDefined(t)})},t.queryParams=function(t){return t._params.filter(function(t){return t.location===c.DefType.SEARCH})},t.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,t}();e.UrlMatcher=h},function(t,e,n){"use strict";function r(){return{strict:a.matcherConfig.strictMode(),caseInsensitive:a.matcherConfig.caseInsensitive()}}var i=n(3),o=n(4),a=n(45),s=n(20),u=function(){function t(){i.extend(this,{UrlMatcher:a.UrlMatcher,Param:s.Param})}return t.prototype.caseInsensitive=function(t){return a.matcherConfig.caseInsensitive(t)},t.prototype.strictMode=function(t){return a.matcherConfig.strictMode(t)},t.prototype.defaultSquashPolicy=function(t){return a.matcherConfig.defaultSquashPolicy(t)},t.prototype.compile=function(t,e){return new a.UrlMatcher(t,i.extend(r(),e))},t.prototype.isMatcher=function(t){if(!o.isObject(t))return!1;var e=!0;return i.forEach(a.UrlMatcher.prototype,function(n,r){o.isFunction(n)&&(e=e&&o.isDefined(t[r])&&o.isFunction(t[r]))}),e},t.prototype.type=function(t,e,n){var r=s.paramTypes.type(t,e,n);return o.isDefined(e)?this:r},t.prototype.$get=function(){return s.paramTypes.enqueue=!1,s.paramTypes._flushTypeQueue(),this},t}();e.UrlMatcherFactory=u},function(t,e,n){"use strict";function r(t){var e=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(t.source);return null!=e?e[1].replace(/\\(.)/g,"$1"):""}function i(t,e){return t.replace(/\$(\$|\d{1,2})/,function(t,n){return e["$"===n?0:Number(n)]})}function o(t,e,n,r){if(!r)return!1;var i=t.invoke(n,n,{$match:r,$stateParams:e});return c.isDefined(i)?i:!0}function a(t,e,n){var r=l.services.locationConfig.baseHref();return"/"===r?t:e?r.slice(0,-1)+t:n?r.slice(1)+t:t}function s(t,e,n){function r(t){var e=t(l.services.$injector,f);return e?(c.isString(e)&&(f.replace(),f.url(e)),!0):!1}if(!n||!n.defaultPrevented){var i,o=t.length;for(i=0;o>i;i++)if(r(t[i]))return;e&&r(e)}}var u=n(3),c=n(4),l=n(6),f=l.services.location,p=function(){function t(t,e){this.$urlMatcherFactory=t,this.$stateParams=e,this.rules=[],this.otherwiseFn=null,this.interceptDeferred=!1}return t.prototype.rule=function(t){if(!c.isFunction(t))throw new Error("'rule' must be a function");return this.rules.push(t),this},t.prototype.otherwise=function(t){if(!c.isFunction(t)&&!c.isString(t))throw new Error("'rule' must be a string or function");return this.otherwiseFn=c.isString(t)?function(){return t}:t,this},t.prototype.when=function(t,e){var n,a=this,s=a.$urlMatcherFactory,p=a.$stateParams,h=c.isString(e);if(c.isString(t)&&(t=s.compile(t)),!h&&!c.isFunction(e)&&!c.isArray(e))throw new Error("invalid 'handler' in when()");var v={matcher:function(t,e){return h&&(n=s.compile(e),e=["$match",n.format.bind(n)]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path(),f.search(),f.hash()))},{prefix:c.isString(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(n=e,e=["$match",function(t){return i(n,t)}]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path()))},{prefix:r(t)})}},d={matcher:s.isMatcher(t),regex:t instanceof RegExp};for(var m in d)if(d[m])return this.rule(v[m](t,e));throw new Error("invalid 'what' in when()")},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}();e.UrlRouterProvider=p;var h=function(){function t(e){this.urlRouterProvider=e,u.bindFunctions(t.prototype,this,this)}return t.prototype.sync=function(){s(this.urlRouterProvider.rules,this.urlRouterProvider.otherwiseFn)},t.prototype.listen=function(){var t=this;return this.listener=this.listener||f.onChange(function(e){return s(t.urlRouterProvider.rules,t.urlRouterProvider.otherwiseFn,e)})},t.prototype.update=function(t){return t?void(this.location=f.url()):void(f.url()!==this.location&&(f.url(this.location),f.replace()))},t.prototype.push=function(t,e,n){f.url(t.format(e||{})),n&&n.replace&&f.replace()},t.prototype.href=function(t,e,n){if(!t.validates(e))return null;var r=t.format(e);n=n||{};var i=l.services.locationConfig,o=i.html5Mode();if(o||null===r||(r="#"+i.hashPrefix()+r),r=a(r,o,n.absolute),!n.absolute||!r)return r;var s=!o&&r?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,s,r].join("")},t}();e.UrlRouter=h},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(50))},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(2),s=function(){function t(){var t=this;this.uiViews=[],this.viewConfigs=[],this._viewConfigFactories={},this.sync=function(){function e(t){return t.fqn.split(".").length}function n(t){for(var e=t.viewDecl.$context,n=0;++n&&e.parent;)e=e.parent;return n}var o=t.uiViews.map(function(t){return[t.fqn,t]}).reduce(r.applyPairs,{}),a=function(t){return function(e){if(t.$type!==e.viewDecl.$type)return!1;var n=e.viewDecl,i=n.$uiViewName.split("."),a=t.fqn.split(".");if(!r.equals(i,a.slice(0-i.length)))return!1;var s=1-i.length||void 0,u=a.slice(0,s).join("."),c=o[u].creationContext;return n.$uiViewContextAnchor===(c&&c.name)}},s=i.curry(function(t,e,n,r){return e*(t(n)-t(r))}),u=function(e){var r=t.viewConfigs.filter(a(e));return r.length>1&&r.sort(s(n,-1)),[e,r[0]]},c=function(e){var n=e[0],r=e[1];-1!==t.uiViews.indexOf(n)&&n.configUpdated(r)};t.uiViews.sort(s(e,1)).map(u).forEach(c)}}return t.prototype.rootContext=function(t){return this._rootContext=t||this._rootContext},t.prototype.viewConfigFactory=function(t,e){this._viewConfigFactories[t]=e},t.prototype.createViewConfig=function(t,e){var n=this._viewConfigFactories[e.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+e.$type);var r=n(t,e);return o.isArray(r)?r:[r]},t.prototype.deactivateViewConfig=function(t){a.trace.traceViewServiceEvent("<- Removing",t),r.removeFrom(this.viewConfigs,t)},t.prototype.activateViewConfig=function(t){a.trace.traceViewServiceEvent("-> Registering",t),this.viewConfigs.push(t)},t.prototype.registerUiView=function(t){a.trace.traceViewServiceUiViewEvent("-> Registering",t);var e=this.uiViews,n=function(e){return e.fqn===t.fqn};return e.filter(n).length&&a.trace.traceViewServiceUiViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){var n=e.indexOf(t);return 0>=n?void a.trace.traceViewServiceUiViewEvent("Tried removing non-registered uiView",t):(a.trace.traceViewServiceUiViewEvent("<- Deregistering",t),void r.removeFrom(e)(t))}},t.prototype.available=function(){return this.uiViews.map(i.prop("fqn"))},t.prototype.active=function(){return this.uiViews.filter(i.prop("$config")).map(i.prop("name"))},t.normalizeUiViewTarget=function(t,e){void 0===e&&(e="");var n=e.split("@"),r=n[0]||"$default",i=o.isString(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(r);a&&(i=a[1],r=a[2]),"!"===r.charAt(0)&&(r=r.substr(1),i="");var s=/^(\^(?:\.\^)*)$/;if(s.exec(i)){var u=i.split(".").reduce(function(t,e){return t.parent},t);i=u.name}return{uiViewName:r,uiViewContextAnchor:i}},t}();e.ViewService=s},function(t,e,n){"use strict";var r=n(25),i=n(8),o=n(3),a=function(){function t(t){var e=this;this.params=new r.StateParams,this.transitionHistory=new i.Queue([],1),this.successfulTransitions=new i.Queue([],1);var n=function(t){e.transition=t,e.transitionHistory.enqueue(t);var n=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,o.copy(t.params(),e.params)};t.onSuccess({},n,{priority:1e4});var r=function(){e.transition===t&&(e.transition=null)};t.promise.then(r,r)};t.onBefore({},["$transition$",n])}return t}();e.UIRouterGlobals=a},function(t,e,n){"use strict";var r=n(47),i=n(48),o=n(18),a=n(48),s=n(43),u=n(50),c=n(36),l=n(37),f=n(51),p=function(){function t(){this.viewService=new u.ViewService,this.transitionService=new s.TransitionService(this.viewService),this.globals=new f.UIRouterGlobals(this.transitionService),this.urlMatcherFactory=new r.UrlMatcherFactory,this.urlRouterProvider=new i.UrlRouterProvider(this.urlMatcherFactory,this.globals.params),this.urlRouter=new a.UrlRouter(this.urlRouterProvider),this.stateRegistry=new c.StateRegistry(this.urlMatcherFactory,this.urlRouterProvider),this.stateProvider=new o.StateProvider(this.stateRegistry),this.stateService=new l.StateService(this.viewService,this.urlRouter,this.transitionService,this.stateRegistry,this.stateProvider,this.globals),this.viewService.rootContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self}return t}();e.UIRouter=p},function(t,e,n){"use strict";function r(t){var e=f.services.$injector,n=e.get("$controller"),r=e.instantiate;try{var i;return e.instantiate=function(t){e.instantiate=r,i=e.annotate(t)},n(t,{$scope:{}}),i}finally{e.instantiate=r}}function i(t,e){f.services.$injector=t,f.services.$q=e}function o(t){function e(e,r,i,o,a,s){return o.$on("$locationChangeSuccess",function(t){return n.forEach(function(e){return e(t)})}),f.services.locationConfig.html5Mode=function(){var e=t.html5Mode();return e=v.isObject(e)?e.enabled:e,e&&i.history},f.services.template.get=function(t){return a.get(t,{cache:s,headers:{Accept:"text/html"}}).then(h.prop("data"))},p.bindFunctions(e,f.services.location,e,["replace","url","path","search","hash"]),p.bindFunctions(e,f.services.locationConfig,e,["port","protocol","host"]),p.bindFunctions(r,f.services.locationConfig,r,["baseHref"]),S}S=new l.UIRouter,S.stateRegistry.decorator("views",w.ng1ViewsBuilder),S.stateRegistry.decorator("resolve",b.ng1ResolveBuilder),S.viewService.viewConfigFactory("ng1",w.ng1ViewConfigFactory),p.bindFunctions(t,f.services.locationConfig,t,["hashPrefix"]);var n=[];f.services.location.onChange=function(t){return n.push(t),function(){return p.removeFrom(n)(t)}},this.$get=e,e.$inject=["$location","$browser","$sniffer","$rootScope","$http","$templateCache"]}function a(){return S.urlRouterProvider.$get=function(){return S.urlRouter.update(!0),this.interceptDeferred||S.urlRouter.listen(),S.urlRouter},S.urlRouterProvider}function s(){return S.stateProvider.$get=function(){return S.stateRegistry.stateQueue.autoFlush(S.stateService),S.stateService},S.stateProvider}function u(){function t(t){var e=function(e){function n(){}var i=p.find(t.treeChanges().to,h.propEq("state",e.viewDecl.$context));if(!i)return f.services.$q.when();var o=i.resolveContext,a=r(e.controller),s=o.getResolvables();return n.$inject=a.filter(function(t){return s.hasOwnProperty(t)}),o.invokeLater(n).then(function(){return e.locals=p.map(s,function(t){return t.data})})},n=t.views("entering").filter(function(t){return!!t.controller}).map(e);return f.services.$q.all(n).then(p.noop)}return t.$inject=["$transition$"],S.transitionService.onFinish({},t),S.transitionService.$get=function(){return S.transitionService},S.transitionService}function c(t){t.$watch(function(){y.trace.approximateDigests++})}var l=n(52),f=n(6),p=n(3),h=n(5),v=n(4),d=n(44),m=n(40),g=n(17),y=n(12),w=n(54),$=n(55),b=n(56),R=angular.module("ui.router.angular1",[]);angular.module("ui.router.util",["ng","ui.router.init"]),angular.module("ui.router.router",["ui.router.util"]),angular.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),angular.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),angular.module("ui.router.compat",["ui.router"]),e.annotateController=r,i.$inject=["$injector","$q"],R.run(i);var S=null;o.$inject=["$locationProvider"];var x=function(){return{resolve:function(t,e,n){void 0===e&&(e={});var r=new d.Node(new g.State({params:{}})),i=new d.Node(new g.State({params:{}})),o=new m.ResolveContext([r,i]);o.addResolvables(m.Resolvable.makeResolvables(t),i.state);var a=function(t){var n=function(t){return m.Resolvable.makeResolvables(p.map(t,function(t){return function(){return t}}))};return o.addResolvables(n(t),r.state),o.addResolvables(n(e),i.state),o.resolvePath()};return n?n.then(a):a({})}}};angular.module("ui.router.init",[]).provider("ng1UIRouter",o),angular.module("ui.router.init").run(["ng1UIRouter",function(t){}]),angular.module("ui.router.util").provider("$urlMatcherFactory",["ng1UIRouterProvider",function(){return S.urlMatcherFactory}]),angular.module("ui.router.util").run(["$urlMatcherFactory",function(t){}]),angular.module("ui.router.router").provider("$urlRouter",["ng1UIRouterProvider",a]),angular.module("ui.router.router").run(["$urlRouter",function(t){}]),angular.module("ui.router.state").provider("$state",["ng1UIRouterProvider",s]),angular.module("ui.router.state").run(["$state",function(t){}]),angular.module("ui.router.state").factory("$stateParams",["ng1UIRouter",function(t){return t.globals.params}]),angular.module("ui.router.state").provider("$transitions",["ng1UIRouterProvider",u]),angular.module("ui.router.util").factory("$templateFactory",["ng1UIRouter",function(){return new $.TemplateFactory}]),angular.module("ui.router").factory("$view",function(){return S.viewService}),angular.module("ui.router").factory("$resolve",x),angular.module("ui.router").service("$trace",function(){return y.trace}),c.$inject=["$rootScope"],e.watchDigests=c,angular.module("ui.router").run(c)},function(t,e,n){"use strict";function r(t){var e=["templateProvider","templateUrl","template","notify","async"],n=["controller","controllerProvider","controllerAs","resolveAs"],r=["component","bindings"],c=e.concat(n),l=r.concat(c),f={},p=t.views||{$default:o.pick(t,l)};return o.forEach(p,function(e,n){if(n=n||"$default",u.isString(e)&&(e={component:e}),Object.keys(e).length){if(e.component){if(c.map(function(t){return u.isDefined(e[t])}).reduce(o.anyTrueR,!1))throw new Error("Cannot combine: "+r.join("|")+" with: "+c.join("|")+" in stateview: 'name@"+t.name+"'");e.templateProvider=["$injector",function(t){var n=function(t){return e.bindings&&e.bindings[t]||t},r=angular.version.minor>=3?"::":"",o=function(t){var e=a.kebobString(t.name),i=n(t.name);return"@"===t.type?e+"='{{"+r+"$resolve."+i+"}}'":e+"='"+r+"$resolve."+i+"'"},s=i(t,e.component).map(o).join(" "),u=a.kebobString(e.component);return"<"+u+" "+s+"></"+u+">"}]}e.resolveAs=e.resolveAs||"$resolve",e.$type="ng1",e.$context=t,e.$name=n;var l=s.ViewService.normalizeUiViewTarget(e.$context,e.$name);e.$uiViewName=l.uiViewName,e.$uiViewContextAnchor=l.uiViewContextAnchor,f[n]=e}}),f}function i(t,e){var n=t.get(e+"Directive");if(!n||!n.length)throw new Error("Unable to find component named '"+e+"'");return n.map(h).reduce(o.unnestR,[])}var o=n(3),a=n(9),s=n(50),u=n(4),c=n(6),l=n(12),f=n(55);e.ng1ViewConfigFactory=function(t,e){return new v(t,e)},e.ng1ViewsBuilder=r;var p=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@])[?]?(.*)/.exec(t[e])]}).filter(function(t){return u.isDefined(t)&&u.isDefined(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},h=function(t){return p(u.isObject(t.bindToController)?t.bindToController:t.scope)},v=function(){function t(t,e){this.node=t,this.viewDecl=e,this.loaded=!1}return t.prototype.load=function(){var t=this,e=c.services.$q;if(!this.hasTemplate())throw new Error("No template configuration specified for '"+this.viewDecl.$uiViewName+"@"+this.viewDecl.$uiViewContextAnchor+"'");var n=this.node.resolveContext,r=this.node.paramValues,i={template:e.when(this.getTemplate(r,new f.TemplateFactory,n)),controller:e.when(this.getController(n))};return e.all(i).then(function(e){l.trace.traceViewServiceEvent("Loaded",t),t.controller=e.controller,t.template=e.template})},t.prototype.hasTemplate=function(){return!!(this.viewDecl.template||this.viewDecl.templateUrl||this.viewDecl.templateProvider)},t.prototype.getTemplate=function(t,e,n){return e.fromConfig(this.viewDecl,t,n.invokeLater.bind(n))},t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;return u.isInjectable(e)?t.invokeLater(e,{}):this.viewDecl.controller},t}();e.Ng1ViewConfig=v},function(t,e,n){"use strict";var r=n(4),i=n(6),o=function(){function t(){}return t.prototype.fromConfig=function(t,e,n){return r.isDefined(t.template)?this.fromString(t.template,e):r.isDefined(t.templateUrl)?this.fromUrl(t.templateUrl,e):r.isDefined(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},t.prototype.fromString=function(t,e){return r.isFunction(t)?t(e):t},t.prototype.fromUrl=function(t,e){return r.isFunction(t)&&(t=t(e)),null==t?null:i.services.template.get(t)},t.prototype.fromProvider=function(t,e,n){return n(t)},t}();e.TemplateFactory=o},function(t,e,n){"use strict";function r(t){var e={};return i.forEach(t.resolve||{},function(t,n){e[n]=o.isString(t)?[t,function(t){return t}]:t}),e}var i=n(3),o=n(4);e.ng1ResolveBuilder=r},function(t,e,n){"use strict";function r(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function i(t){var e=t.parent().inheritedData("$uiView"),n=l.parse("$cfg.node.state")(e);return n&&n.name?n:void 0}function o(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function a(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var c=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){c--<=0&&n.cancel(u)}}}}function s(t,e){return{relative:i(t)||e.$current,inherit:!0}}var u=n(3),c=n(4),l=n(5),f=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,c,l){var f=r(c.uiSref,t.current.name),p={state:f.state,href:null,params:null,options:null},h=o(i),v=l[1]||l[0],d=null;p.options=u.extend(s(i,t),c.uiSrefOpts?n.$eval(c.uiSrefOpts):{});var m=function(e){e&&(p.params=angular.copy(e)),p.href=t.href(f.state,p.params,p.options),d&&d(),v&&(d=v.$$addStateInfo(f.state,p.params)),null!==p.href&&c.$set(h.attr,p.href)};f.paramExpr&&(n.$watch(f.paramExpr,function(t){t!==p.params&&m(t)},!0),p.params=angular.copy(n.$eval(f.paramExpr))),m(),h.clickable&&i.bind("click",a(i,t,e,h,function(){return p}))}}}],p=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,s){function u(e){h.state=e[0],h.params=e[1],h.options=e[2],h.href=t.href(h.state,h.params,h.options),v&&v(),l&&(v=l.$$addStateInfo(h.state,h.params)),h.href&&i.$set(c.attr,h.href)}var c=o(r),l=s[1]||s[0],f=[i.uiState,i.uiStateParams||null,i.uiStateOpts||null],p="["+f.map(function(t){return t||"null"}).join(", ")+"]",h={state:null,params:null,options:null,href:null},v=null;n.$watch(p,u,!0),u(n.$eval(p)),c.clickable&&r.bind("click",a(r,t,e,c,function(){return h}))}}}],h=["$state","$stateParams","$interpolate","$transitions",function(t,e,n,o){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,a,s,l){function f(e,n,r){var o=t.get(e,i(a)),s=p(e,n),u={state:o||{name:e},params:n,hash:s};return $.push(u),b[s]=r,function(){var t=$.indexOf(u);-1!==t&&$.splice(t,1)}}function p(t,n){if(!c.isString(t))throw new Error("state should be a string");return c.isObject(n)?t+u.toJson(n):(n=e.$eval(n),c.isObject(n)?t+u.toJson(n):t)}function h(){for(var t=0;t<$.length;t++)m($[t].state,$[t].params)?v(a,b[$[t].hash]):d(a,b[$[t].hash]),g($[t].state,$[t].params)?v(a,y):d(a,y)}function v(t,e){l(function(){t.addClass(e)})}function d(t,e){t.removeClass(e)}function m(e,n){return t.includes(e.name,n)}function g(e,n){return t.is(e.name,n)}var y,w,$=[],b={};y=n(s.uiSrefActiveEq||"",!1)(e);try{w=e.$eval(s.uiSrefActive)}catch(R){}w=w||n(s.uiSrefActive||"",!1)(e),c.isObject(w)&&u.forEach(w,function(n,i){if(c.isString(n)){var o=r(n,t.current.name);f(o.state,e.$eval(o.paramExpr),i)}}),this.$$addStateInfo=function(t,e){if(!(c.isObject(w)&&$.length>0)){var n=f(t,e,w);return h(),n}},e.$on("$stateChangeSuccess",h);var S=["$transition$",function(t){t.promise.then(h)}],x=o.onStart({},S);e.$on("$destroy",x),h()}]}}];angular.module("ui.router.state").directive("uiSref",f).directive("uiSrefActive",h).directive("uiSrefActiveEq",h).directive("uiState",p)},function(t,e){"use strict";function n(t){var e=function(e,n,r){return t.is(e,n,r)};return e.$stateful=!0,e}function r(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}n.$inject=["$state"],e.$IsStateFilter=n,r.$inject=["$state"],e.$IncludedByStateFilter=r,angular.module("ui.router.state").filter("isState",n).filter("includedByState",r)},function(t,e,n){"use strict";function r(t,e,n,r,u){var c=l.parse("viewDecl.controllerAs"),p=l.parse("viewDecl.resolveAs"),h=l.parse("node.resolveContext");return{restrict:"ECA",priority:-400,compile:function(r){var u=r.html();return function(r,l){var v=l.data("$uiView");if(v){var d=v.$cfg||{viewDecl:{}};l.html(d.template||u),s.trace.traceUiViewFill(v.$uiView,l.html());var m=t(l.contents()),g=d.controller,y=c(d),w=p(d),$=h(d),b=$&&o.map($.getResolvables(),function(t){return t.data});if(r[w]=b,g){var R=e(g,o.extend({},b,{$scope:r,$element:l}));y&&(r[y]=R,r[y][w]=b),l.data("$ngControllerController",R),l.children().data("$ngControllerController",R),i(n,R,r,d)}if(a.isString(d.viewDecl.component))var S=d.viewDecl.component,x=f.kebobString(S),E=function(){var t=[].slice.call(l[0].children).filter(function(t){return t&&t.tagName&&t.tagName.toLowerCase()===x});return t&&angular.element(t).data("$"+S+"Controller")},P=r.$watch(E,function(t){t&&(i(n,t,r,d),P())});m(r)}}}}}function i(t,e,n,r){!a.isFunction(e.$onInit)||r.viewDecl.component&&h||e.$onInit();var i={bind:e};if(a.isFunction(e.uiOnParamsChanged)){var s=function(t){var n=r.node.resolveContext,i=n.getResolvables().$transition$.data;if(t!==i&&-1===t.exiting().indexOf(r.node.state.self)){var a=t.params("to"),s=t.params("from"),u=t.treeChanges().to.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),c=t.treeChanges().from.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),l=u.filter(function(t){var e=c.indexOf(t);return-1===e||!c[e].type.equals(a[t.id],s[t.id])});if(l.length){var f=l.map(function(t){return t.id});e.uiOnParamsChanged(o.filter(a,function(t,e){return-1!==f.indexOf(e)}),t)}}};n.$on("$destroy",t.onSuccess({},["$transition$",s]),i);var u=function(t,e){t.type===c.RejectType.IGNORED&&s(e)};n.$on("$destroy",t.onError({},["$error$","$transition$",u]),i)}if(a.isFunction(e.uiCanExit)){var l={exiting:r.node.state.name};n.$on("$destroy",t.onBefore(l,e.uiCanExit,i))}}var o=n(3),a=n(4),s=n(12),u=n(54),c=n(10),l=n(5),f=n(9),p=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,n,r,i){function o(t,n){return{enter:function(t,n,r){angular.version.minor>2?e.enter(t,null,n).then(r):e.enter(t,null,n,r)},leave:function(t,n){angular.version.minor>2?e.leave(t).then(n):e.leave(t,n)}}}function c(t,e){return t===e}var f={$cfg:{viewDecl:{$context:t.rootContext()}},$uiView:{}},p={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,h,v){return function(e,h,d){function m(t){(!t||t instanceof u.Ng1ViewConfig)&&(c(P,t)||(s.trace.traceUiViewConfigUpdated(C,t&&t.viewDecl&&t.viewDecl.$context),P=t,y(t)))}function g(){if(w&&(s.trace.traceUiViewEvent("Removing (previous) el",w.data("$uiView")),w.remove(),w=null),b&&(s.trace.traceUiViewEvent("Destroying scope",C),b.$destroy(),b=null),$){var t=$.data("$uiView");s.trace.traceUiViewEvent("Animate out",t),E.leave($,function(){t.$$animLeave.resolve(),w=null}),w=$,$=null}}function y(t){var r=e.$new();s.trace.traceUiViewScopeCreated(C,r);var o=i.defer(),u=i.defer(),c={$cfg:t,$uiView:C,$animEnter:o.promise,$animLeave:u.promise,$$animLeave:u},l=v(r,function(t){E.enter(t.data("$uiView",c),h,function(){o.resolve(),b&&b.$emit("$viewContentAnimationEnded"),(a.isDefined(x)&&!x||e.$eval(x))&&n(t)}),g()});$=l,b=r,b.$emit("$viewContentLoaded",t||P),b.$eval(S)}var w,$,b,R,S=d.onload||"",x=d.autoscroll,E=o(d,e),P=void 0,k=h.inheritedData("$uiView")||f,O=r(d.uiView||d.name||"")(e)||"$default",C={$type:"ng1",id:p.count++,name:O,fqn:k.$uiView.fqn?k.$uiView.fqn+"."+O:O,config:null,configUpdated:m,get creationContext(){return l.parse("$cfg.viewDecl.$context")(k)}};s.trace.traceUiViewEvent("Linking",C),h.data("$uiView",{$uiView:C}),y(),R=t.registerUiView(C),e.$on("$destroy",function(){s.trace.traceUiViewEvent("Destroying/Unregistering",C),R()})}}};return p}];r.$inject=["$compile","$controller","$transitions","$view","$timeout"];var h="function"==typeof angular.module("ui.router").component;angular.module("ui.router.state").directive("uiView",p),angular.module("ui.router.state").directive("uiView",r)},function(t,e){"use strict";function n(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,n){return t?e:function(t){return n(function(){t[0].scrollIntoView()},0,!1)}}]}angular.module("ui.router.state").provider("$uiViewScroll",n)}])});
1777 }),Object.freeze(this)}return t.prototype.append=function(t){return this._children.push(t),i.forEach(t._cache,function(e,n){return t._cache[n]=a.isArray(e)?[]:null}),t._cache.path=this._cache.path.concat(this),t},t.prototype.isRoot=function(){return 0===this._cache.path.length},t.prototype.toString=function(){return this.pattern},t.prototype.exec=function(t,e,n,r){function a(t){var e=function(t){return t.split("").reverse().join("")},n=function(t){return t.replace(/\\-/g,"-")},r=e(t).split(/-(?!\\)/),o=i.map(r,e);return i.map(o,n).reverse()}var s=this;void 0===e&&(e={}),void 0===r&&(r={});var c=p(this._cache,"pattern",function(){return new RegExp(["^",i.unnest(s._cache.path.concat(s).map(o.prop("_compiled"))).join(""),s.config.strict===!1?"/?":"","$"].join(""),s.config.caseInsensitive?"i":void 0)}).exec(t);if(!c)return null;var l=this.parameters(),f=l.filter(function(t){return!t.isSearch()}),h=l.filter(function(t){return t.isSearch()}),v=this._cache.path.concat(this).map(function(t){return t._segments.length-1}).reduce(function(t,e){return t+e}),d={};if(v!==c.length-1)throw new Error("Unbalanced capture group in route '"+this.pattern+"'");for(var m=0;v>m;m++){for(var g=f[m],y=c[m+1],w=0;w<g.replace.length;w++)g.replace[w].from===y&&(y=g.replace[w].to);y&&g.array===!0&&(y=a(y)),u.isDefined(y)&&(y=g.type.decode(y)),d[g.id]=g.value(y)}return i.forEach(h,function(t){for(var n=e[t.id],r=0;r<t.replace.length;r++)t.replace[r].from===n&&(n=t.replace[r].to);u.isDefined(n)&&(n=t.type.decode(n)),d[t.id]=t.value(n)}),n&&(d["#"]=n),d},t.prototype.parameters=function(t){return void 0===t&&(t={}),t.inherit===!1?this._params:i.unnest(this._cache.path.concat(this).map(o.prop("_params")))},t.prototype.parameter=function(t,e){void 0===e&&(e={});var n=i.tail(this._cache.path);return i.find(this._params,o.propEq("id",t))||e.inherit!==!1&&n&&n.parameter(t)||null},t.prototype.validates=function(t){var e=this,n=function(t,e){return!t||t.validates(e)};return i.pairs(t||{}).map(function(t){var r=t[0],i=t[1];return n(e.parameter(r),i)}).reduce(i.allTrueR,!0)},t.prototype.format=function(e){function n(t){var n=t.value(e[t.id]),r=t.isDefaultValue(n),i=r?t.squash:!1,o=t.type.encode(n);return{param:t,value:n,isDefaultValue:r,squash:i,encoded:o}}if(void 0===e&&(e={}),!this.validates(e))return null;var r=this._cache.path.slice().concat(this),o=r.map(t.pathSegmentsAndParams).reduce(l.unnestR,[]),s=r.map(t.queryParams).reduce(l.unnestR,[]),u=o.reduce(function(e,r){if(a.isString(r))return e+r;var o=n(r),s=o.squash,u=o.encoded,c=o.param;return s===!0?e.match(/\/$/)?e.slice(0,-1):e:a.isString(s)?e+s:s!==!1?e:null==u?e:a.isArray(u)?e+i.map(u,t.encodeDashes).join("-"):c.type.raw?e+u:e+encodeURIComponent(u)},""),c=s.map(function(t){var e=n(t),r=e.squash,o=e.encoded,s=e.isDefaultValue;if(!(null==o||s&&r!==!1)&&(a.isArray(o)||(o=[o]),0!==o.length))return t.type.raw||(o=i.map(o,encodeURIComponent)),o.map(function(e){return t.id+"="+e})}).filter(i.identity).reduce(l.unnestR,[]).join("&");return u+(c?"?"+c:"")+(e["#"]?"#"+e["#"]:"")},t.encodeDashes=function(t){return encodeURIComponent(t).replace(/-/g,function(t){return"%5C%"+t.charCodeAt(0).toString(16).toUpperCase()})},t.pathSegmentsAndParams=function(t){var e=t._segments,n=t._params.filter(function(t){return t.location===c.DefType.PATH});return f.arrayTuples(e,n.concat(void 0)).reduce(l.unnestR,[]).filter(function(t){return""!==t&&u.isDefined(t)})},t.queryParams=function(t){return t._params.filter(function(t){return t.location===c.DefType.SEARCH})},t.nameValidator=/^\w+([-.]+\w+)*(?:\[\])?$/,t}();e.UrlMatcher=h},function(t,e,n){"use strict";function r(){return{strict:a.matcherConfig.strictMode(),caseInsensitive:a.matcherConfig.caseInsensitive()}}var i=n(3),o=n(4),a=n(45),s=n(20),u=function(){function t(){i.extend(this,{UrlMatcher:a.UrlMatcher,Param:s.Param})}return t.prototype.caseInsensitive=function(t){return a.matcherConfig.caseInsensitive(t)},t.prototype.strictMode=function(t){return a.matcherConfig.strictMode(t)},t.prototype.defaultSquashPolicy=function(t){return a.matcherConfig.defaultSquashPolicy(t)},t.prototype.compile=function(t,e){return new a.UrlMatcher(t,i.extend(r(),e))},t.prototype.isMatcher=function(t){if(!o.isObject(t))return!1;var e=!0;return i.forEach(a.UrlMatcher.prototype,function(n,r){o.isFunction(n)&&(e=e&&o.isDefined(t[r])&&o.isFunction(t[r]))}),e},t.prototype.type=function(t,e,n){var r=s.paramTypes.type(t,e,n);return o.isDefined(e)?this:r},t.prototype.$get=function(){return s.paramTypes.enqueue=!1,s.paramTypes._flushTypeQueue(),this},t}();e.UrlMatcherFactory=u},function(t,e,n){"use strict";function r(t){var e=/^\^((?:\\[^a-zA-Z0-9]|[^\\\[\]\^$*+?.()|{}]+)*)/.exec(t.source);return null!=e?e[1].replace(/\\(.)/g,"$1"):""}function i(t,e){return t.replace(/\$(\$|\d{1,2})/,function(t,n){return e["$"===n?0:Number(n)]})}function o(t,e,n,r){if(!r)return!1;var i=t.invoke(n,n,{$match:r,$stateParams:e});return c.isDefined(i)?i:!0}function a(t,e,n){var r=l.services.locationConfig.baseHref();return"/"===r?t:e?r.slice(0,-1)+t:n?r.slice(1)+t:t}function s(t,e,n){function r(t){var e=t(l.services.$injector,f);return e?(c.isString(e)&&(f.replace(),f.url(e)),!0):!1}if(!n||!n.defaultPrevented){var i,o=t.length;for(i=0;o>i;i++)if(r(t[i]))return;e&&r(e)}}var u=n(3),c=n(4),l=n(6),f=l.services.location,p=function(){function t(t,e){this.$urlMatcherFactory=t,this.$stateParams=e,this.rules=[],this.otherwiseFn=null,this.interceptDeferred=!1}return t.prototype.rule=function(t){if(!c.isFunction(t))throw new Error("'rule' must be a function");return this.rules.push(t),this},t.prototype.otherwise=function(t){if(!c.isFunction(t)&&!c.isString(t))throw new Error("'rule' must be a string or function");return this.otherwiseFn=c.isString(t)?function(){return t}:t,this},t.prototype.when=function(t,e){var n,a=this,s=a.$urlMatcherFactory,p=a.$stateParams,h=c.isString(e);if(c.isString(t)&&(t=s.compile(t)),!h&&!c.isFunction(e)&&!c.isArray(e))throw new Error("invalid 'handler' in when()");var v={matcher:function(t,e){return h&&(n=s.compile(e),e=["$match",n.format.bind(n)]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path(),f.search(),f.hash()))},{prefix:c.isString(t.prefix)?t.prefix:""})},regex:function(t,e){if(t.global||t.sticky)throw new Error("when() RegExp must not be global or sticky");return h&&(n=e,e=["$match",function(t){return i(n,t)}]),u.extend(function(){return o(l.services.$injector,p,e,t.exec(f.path()))},{prefix:r(t)})}},d={matcher:s.isMatcher(t),regex:t instanceof RegExp};for(var m in d)if(d[m])return this.rule(v[m](t,e));throw new Error("invalid 'what' in when()")},t.prototype.deferIntercept=function(t){void 0===t&&(t=!0),this.interceptDeferred=t},t}();e.UrlRouterProvider=p;var h=function(){function t(e){this.urlRouterProvider=e,u.bindFunctions(t.prototype,this,this)}return t.prototype.sync=function(){s(this.urlRouterProvider.rules,this.urlRouterProvider.otherwiseFn)},t.prototype.listen=function(){var t=this;return this.listener=this.listener||f.onChange(function(e){return s(t.urlRouterProvider.rules,t.urlRouterProvider.otherwiseFn,e)})},t.prototype.update=function(t){return t?void(this.location=f.url()):void(f.url()!==this.location&&(f.url(this.location),f.replace()))},t.prototype.push=function(t,e,n){f.url(t.format(e||{})),n&&n.replace&&f.replace()},t.prototype.href=function(t,e,n){if(!t.validates(e))return null;var r=t.format(e);n=n||{};var i=l.services.locationConfig,o=i.html5Mode();if(o||null===r||(r="#"+i.hashPrefix()+r),r=a(r,o,n.absolute),!n.absolute||!r)return r;var s=!o&&r?"/":"",u=i.port();return u=80===u||443===u?"":":"+u,[i.protocol(),"://",i.host(),u,s,r].join("")},t}();e.UrlRouter=h},function(t,e,n){"use strict";function r(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}r(n(50))},function(t,e,n){"use strict";var r=n(3),i=n(5),o=n(4),a=n(2),s=function(){function t(){var t=this;this.uiViews=[],this.viewConfigs=[],this._viewConfigFactories={},this.sync=function(){function e(t){return t.fqn.split(".").length}function n(t){for(var e=t.viewDecl.$context,n=0;++n&&e.parent;)e=e.parent;return n}var o=t.uiViews.map(function(t){return[t.fqn,t]}).reduce(r.applyPairs,{}),a=function(t){return function(e){if(t.$type!==e.viewDecl.$type)return!1;var n=e.viewDecl,i=n.$uiViewName.split("."),a=t.fqn.split(".");if(!r.equals(i,a.slice(0-i.length)))return!1;var s=1-i.length||void 0,u=a.slice(0,s).join("."),c=o[u].creationContext;return n.$uiViewContextAnchor===(c&&c.name)}},s=i.curry(function(t,e,n,r){return e*(t(n)-t(r))}),u=function(e){var r=t.viewConfigs.filter(a(e));return r.length>1&&r.sort(s(n,-1)),[e,r[0]]},c=function(e){var n=e[0],r=e[1];-1!==t.uiViews.indexOf(n)&&n.configUpdated(r)};t.uiViews.sort(s(e,1)).map(u).forEach(c)}}return t.prototype.rootContext=function(t){return this._rootContext=t||this._rootContext},t.prototype.viewConfigFactory=function(t,e){this._viewConfigFactories[t]=e},t.prototype.createViewConfig=function(t,e){var n=this._viewConfigFactories[e.$type];if(!n)throw new Error("ViewService: No view config factory registered for type "+e.$type);var r=n(t,e);return o.isArray(r)?r:[r]},t.prototype.deactivateViewConfig=function(t){a.trace.traceViewServiceEvent("<- Removing",t),r.removeFrom(this.viewConfigs,t)},t.prototype.activateViewConfig=function(t){a.trace.traceViewServiceEvent("-> Registering",t),this.viewConfigs.push(t)},t.prototype.registerUiView=function(t){a.trace.traceViewServiceUiViewEvent("-> Registering",t);var e=this.uiViews,n=function(e){return e.fqn===t.fqn};return e.filter(n).length&&a.trace.traceViewServiceUiViewEvent("!!!! duplicate uiView named:",t),e.push(t),this.sync(),function(){var n=e.indexOf(t);return 0>=n?void a.trace.traceViewServiceUiViewEvent("Tried removing non-registered uiView",t):(a.trace.traceViewServiceUiViewEvent("<- Deregistering",t),void r.removeFrom(e)(t))}},t.prototype.available=function(){return this.uiViews.map(i.prop("fqn"))},t.prototype.active=function(){return this.uiViews.filter(i.prop("$config")).map(i.prop("name"))},t.normalizeUiViewTarget=function(t,e){void 0===e&&(e="");var n=e.split("@"),r=n[0]||"$default",i=o.isString(n[1])?n[1]:"^",a=/^(\^(?:\.\^)*)\.(.*$)/.exec(r);a&&(i=a[1],r=a[2]),"!"===r.charAt(0)&&(r=r.substr(1),i="");var s=/^(\^(?:\.\^)*)$/;if(s.exec(i)){var u=i.split(".").reduce(function(t,e){return t.parent},t);i=u.name}return{uiViewName:r,uiViewContextAnchor:i}},t}();e.ViewService=s},function(t,e,n){"use strict";var r=n(25),i=n(8),o=n(3),a=function(){function t(t){var e=this;this.params=new r.StateParams,this.transitionHistory=new i.Queue([],1),this.successfulTransitions=new i.Queue([],1);var n=function(t){e.transition=t,e.transitionHistory.enqueue(t);var n=function(){e.successfulTransitions.enqueue(t),e.$current=t.$to(),e.current=e.$current.self,o.copy(t.params(),e.params)};t.onSuccess({},n,{priority:1e4});var r=function(){e.transition===t&&(e.transition=null)};t.promise.then(r,r)};t.onBefore({},["$transition$",n])}return t}();e.UIRouterGlobals=a},function(t,e,n){"use strict";var r=n(47),i=n(48),o=n(18),a=n(48),s=n(43),u=n(50),c=n(36),l=n(37),f=n(51),p=function(){function t(){this.viewService=new u.ViewService,this.transitionService=new s.TransitionService(this.viewService),this.globals=new f.UIRouterGlobals(this.transitionService),this.urlMatcherFactory=new r.UrlMatcherFactory,this.urlRouterProvider=new i.UrlRouterProvider(this.urlMatcherFactory,this.globals.params),this.urlRouter=new a.UrlRouter(this.urlRouterProvider),this.stateRegistry=new c.StateRegistry(this.urlMatcherFactory,this.urlRouterProvider),this.stateProvider=new o.StateProvider(this.stateRegistry),this.stateService=new l.StateService(this.viewService,this.urlRouter,this.transitionService,this.stateRegistry,this.stateProvider,this.globals),this.viewService.rootContext(this.stateRegistry.root()),this.globals.$current=this.stateRegistry.root(),this.globals.current=this.globals.$current.self}return t}();e.UIRouter=p},function(t,e,n){"use strict";function r(t){var e=f.services.$injector,n=e.get("$controller"),r=e.instantiate;try{var i;return e.instantiate=function(t){e.instantiate=r,i=e.annotate(t)},n(t,{$scope:{}}),i}finally{e.instantiate=r}}function i(t,e){f.services.$injector=t,f.services.$q=e}function o(t){function e(e,r,i,o,a,s){return o.$on("$locationChangeSuccess",function(t){return n.forEach(function(e){return e(t)})}),f.services.locationConfig.html5Mode=function(){var e=t.html5Mode();return e=v.isObject(e)?e.enabled:e,e&&i.history},f.services.template.get=function(t){return a.get(t,{cache:s,headers:{Accept:"text/html"}}).then(h.prop("data"))},p.bindFunctions(e,f.services.location,e,["replace","url","path","search","hash"]),p.bindFunctions(e,f.services.locationConfig,e,["port","protocol","host"]),p.bindFunctions(r,f.services.locationConfig,r,["baseHref"]),S}S=new l.UIRouter,S.stateRegistry.decorator("views",w.ng1ViewsBuilder),S.stateRegistry.decorator("resolve",b.ng1ResolveBuilder),S.viewService.viewConfigFactory("ng1",w.ng1ViewConfigFactory),p.bindFunctions(t,f.services.locationConfig,t,["hashPrefix"]);var n=[];f.services.location.onChange=function(t){return n.push(t),function(){return p.removeFrom(n)(t)}},this.$get=e,e.$inject=["$location","$browser","$sniffer","$rootScope","$http","$templateCache"]}function a(){return S.urlRouterProvider.$get=function(){return S.urlRouter.update(!0),this.interceptDeferred||S.urlRouter.listen(),S.urlRouter},S.urlRouterProvider}function s(){return S.stateProvider.$get=function(){return S.stateRegistry.stateQueue.autoFlush(S.stateService),S.stateService},S.stateProvider}function u(){function t(t){var e=function(e){function n(){}var i=p.find(t.treeChanges().to,h.propEq("state",e.viewDecl.$context));if(!i)return f.services.$q.when();var o=i.resolveContext,a=r(e.controller),s=o.getResolvables();return n.$inject=a.filter(function(t){return s.hasOwnProperty(t)}),o.invokeLater(n).then(function(){return e.locals=p.map(s,function(t){return t.data})})},n=t.views("entering").filter(function(t){return!!t.controller}).map(e);return f.services.$q.all(n).then(p.noop)}return t.$inject=["$transition$"],S.transitionService.onFinish({},t),S.transitionService.$get=function(){return S.transitionService},S.transitionService}function c(t){t.$watch(function(){y.trace.approximateDigests++})}var l=n(52),f=n(6),p=n(3),h=n(5),v=n(4),d=n(44),m=n(40),g=n(17),y=n(12),w=n(54),$=n(55),b=n(56),R=angular.module("ui.router.angular1",[]);angular.module("ui.router.util",["ng","ui.router.init"]),angular.module("ui.router.router",["ui.router.util"]),angular.module("ui.router.state",["ui.router.router","ui.router.util","ui.router.angular1"]),angular.module("ui.router",["ui.router.init","ui.router.state","ui.router.angular1"]),angular.module("ui.router.compat",["ui.router"]),e.annotateController=r,i.$inject=["$injector","$q"],R.run(i);var S=null;o.$inject=["$locationProvider"];var x=function(){return{resolve:function(t,e,n){void 0===e&&(e={});var r=new d.Node(new g.State({params:{}})),i=new d.Node(new g.State({params:{}})),o=new m.ResolveContext([r,i]);o.addResolvables(m.Resolvable.makeResolvables(t),i.state);var a=function(t){var n=function(t){return m.Resolvable.makeResolvables(p.map(t,function(t){return function(){return t}}))};return o.addResolvables(n(t),r.state),o.addResolvables(n(e),i.state),o.resolvePath()};return n?n.then(a):a({})}}};angular.module("ui.router.init",[]).provider("ng1UIRouter",o),angular.module("ui.router.init").run(["ng1UIRouter",function(t){}]),angular.module("ui.router.util").provider("$urlMatcherFactory",["ng1UIRouterProvider",function(){return S.urlMatcherFactory}]),angular.module("ui.router.util").run(["$urlMatcherFactory",function(t){}]),angular.module("ui.router.router").provider("$urlRouter",["ng1UIRouterProvider",a]),angular.module("ui.router.router").run(["$urlRouter",function(t){}]),angular.module("ui.router.state").provider("$state",["ng1UIRouterProvider",s]),angular.module("ui.router.state").run(["$state",function(t){}]),angular.module("ui.router.state").factory("$stateParams",["ng1UIRouter",function(t){return t.globals.params}]),angular.module("ui.router.state").provider("$transitions",["ng1UIRouterProvider",u]),angular.module("ui.router.util").factory("$templateFactory",["ng1UIRouter",function(){return new $.TemplateFactory}]),angular.module("ui.router").factory("$view",function(){return S.viewService}),angular.module("ui.router").factory("$resolve",x),angular.module("ui.router").service("$trace",function(){return y.trace}),c.$inject=["$rootScope"],e.watchDigests=c,angular.module("ui.router").run(c)},function(t,e,n){"use strict";function r(t){var e=["templateProvider","templateUrl","template","notify","async"],n=["controller","controllerProvider","controllerAs","resolveAs"],r=["component","bindings"],c=e.concat(n),l=r.concat(c),f={},p=t.views||{$default:o.pick(t,l)};return o.forEach(p,function(e,n){if(n=n||"$default",u.isString(e)&&(e={component:e}),Object.keys(e).length){if(e.component){if(c.map(function(t){return u.isDefined(e[t])}).reduce(o.anyTrueR,!1))throw new Error("Cannot combine: "+r.join("|")+" with: "+c.join("|")+" in stateview: 'name@"+t.name+"'");e.templateProvider=["$injector",function(t){var n=function(t){return e.bindings&&e.bindings[t]||t},r=angular.version.minor>=3?"::":"",o=function(t){var e=a.kebobString(t.name),i=n(t.name);return"@"===t.type?e+"='{{"+r+"$resolve."+i+"}}'":e+"='"+r+"$resolve."+i+"'"},s=i(t,e.component).map(o).join(" "),u=a.kebobString(e.component);return"<"+u+" "+s+"></"+u+">"}]}e.resolveAs=e.resolveAs||"$resolve",e.$type="ng1",e.$context=t,e.$name=n;var l=s.ViewService.normalizeUiViewTarget(e.$context,e.$name);e.$uiViewName=l.uiViewName,e.$uiViewContextAnchor=l.uiViewContextAnchor,f[n]=e}}),f}function i(t,e){var n=t.get(e+"Directive");if(!n||!n.length)throw new Error("Unable to find component named '"+e+"'");return n.map(h).reduce(o.unnestR,[])}var o=n(3),a=n(9),s=n(50),u=n(4),c=n(6),l=n(12),f=n(55);e.ng1ViewConfigFactory=function(t,e){return new v(t,e)},e.ng1ViewsBuilder=r;var p=function(t){return Object.keys(t||{}).map(function(e){return[e,/^([=<@])[?]?(.*)/.exec(t[e])]}).filter(function(t){return u.isDefined(t)&&u.isDefined(t[1])}).map(function(t){return{name:t[1][2]||t[0],type:t[1][1]}})},h=function(t){return p(u.isObject(t.bindToController)?t.bindToController:t.scope)},v=function(){function t(t,e){this.node=t,this.viewDecl=e,this.loaded=!1}return t.prototype.load=function(){var t=this,e=c.services.$q;if(!this.hasTemplate())throw new Error("No template configuration specified for '"+this.viewDecl.$uiViewName+"@"+this.viewDecl.$uiViewContextAnchor+"'");var n=this.node.resolveContext,r=this.node.paramValues,i={template:e.when(this.getTemplate(r,new f.TemplateFactory,n)),controller:e.when(this.getController(n))};return e.all(i).then(function(e){l.trace.traceViewServiceEvent("Loaded",t),t.controller=e.controller,t.template=e.template})},t.prototype.hasTemplate=function(){return!!(this.viewDecl.template||this.viewDecl.templateUrl||this.viewDecl.templateProvider)},t.prototype.getTemplate=function(t,e,n){return e.fromConfig(this.viewDecl,t,n.invokeLater.bind(n))},t.prototype.getController=function(t){var e=this.viewDecl.controllerProvider;return u.isInjectable(e)?t.invokeLater(e,{}):this.viewDecl.controller},t}();e.Ng1ViewConfig=v},function(t,e,n){"use strict";var r=n(4),i=n(6),o=function(){function t(){}return t.prototype.fromConfig=function(t,e,n){return r.isDefined(t.template)?this.fromString(t.template,e):r.isDefined(t.templateUrl)?this.fromUrl(t.templateUrl,e):r.isDefined(t.templateProvider)?this.fromProvider(t.templateProvider,e,n):null},t.prototype.fromString=function(t,e){return r.isFunction(t)?t(e):t},t.prototype.fromUrl=function(t,e){return r.isFunction(t)&&(t=t(e)),null==t?null:i.services.template.get(t)},t.prototype.fromProvider=function(t,e,n){return n(t)},t}();e.TemplateFactory=o},function(t,e,n){"use strict";function r(t){var e={};return i.forEach(t.resolve||{},function(t,n){e[n]=o.isString(t)?[t,function(t){return t}]:t}),e}var i=n(3),o=n(4);e.ng1ResolveBuilder=r},function(t,e,n){"use strict";function r(t,e){var n,r=t.match(/^\s*({[^}]*})\s*$/);if(r&&(t=e+"("+r[1]+")"),n=t.replace(/\n/g," ").match(/^([^(]+?)\s*(\((.*)\))?$/),!n||4!==n.length)throw new Error("Invalid state ref '"+t+"'");return{state:n[1],paramExpr:n[3]||null}}function i(t){var e=t.parent().inheritedData("$uiView"),n=l.parse("$cfg.node.state")(e);return n&&n.name?n:void 0}function o(t){var e="[object SVGAnimatedString]"===Object.prototype.toString.call(t.prop("href")),n="FORM"===t[0].nodeName;return{attr:n?"action":e?"xlink:href":"href",isAnchor:"A"===t.prop("tagName").toUpperCase(),clickable:!n}}function a(t,e,n,r,i){return function(o){var a=o.which||o.button,s=i();if(!(a>1||o.ctrlKey||o.metaKey||o.shiftKey||t.attr("target"))){var u=n(function(){e.go(s.state,s.params,s.options)});o.preventDefault();var c=r.isAnchor&&!s.href?1:0;o.preventDefault=function(){c--<=0&&n.cancel(u)}}}}function s(t,e){return{relative:i(t)||e.$current,inherit:!0}}var u=n(3),c=n(4),l=n(5),f=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,i,c,l){var f=r(c.uiSref,t.current.name),p={state:f.state,href:null,params:null,options:null},h=o(i),v=l[1]||l[0],d=null;p.options=u.extend(s(i,t),c.uiSrefOpts?n.$eval(c.uiSrefOpts):{});var m=function(e){e&&(p.params=angular.copy(e)),p.href=t.href(f.state,p.params,p.options),d&&d(),v&&(d=v.$$addStateInfo(f.state,p.params)),null!==p.href&&c.$set(h.attr,p.href)};f.paramExpr&&(n.$watch(f.paramExpr,function(t){t!==p.params&&m(t)},!0),p.params=angular.copy(n.$eval(f.paramExpr))),m(),h.clickable&&i.bind("click",a(i,t,e,h,function(){return p}))}}}],p=["$state","$timeout",function(t,e){return{restrict:"A",require:["?^uiSrefActive","?^uiSrefActiveEq"],link:function(n,r,i,s){function u(e){h.state=e[0],h.params=e[1],h.options=e[2],h.href=t.href(h.state,h.params,h.options),v&&v(),l&&(v=l.$$addStateInfo(h.state,h.params)),h.href&&i.$set(c.attr,h.href)}var c=o(r),l=s[1]||s[0],f=[i.uiState,i.uiStateParams||null,i.uiStateOpts||null],p="["+f.map(function(t){return t||"null"}).join(", ")+"]",h={state:null,params:null,options:null,href:null},v=null;n.$watch(p,u,!0),u(n.$eval(p)),c.clickable&&r.bind("click",a(r,t,e,c,function(){return h}))}}}],h=["$state","$stateParams","$interpolate","$transitions",function(t,e,n,o){return{restrict:"A",controller:["$scope","$element","$attrs","$timeout",function(e,a,s,l){function f(e,n,r){var o=t.get(e,i(a)),s=p(e,n),u={state:o||{name:e},params:n,hash:s};return $.push(u),b[s]=r,function(){var t=$.indexOf(u);-1!==t&&$.splice(t,1)}}function p(t,n){if(!c.isString(t))throw new Error("state should be a string");return c.isObject(n)?t+u.toJson(n):(n=e.$eval(n),c.isObject(n)?t+u.toJson(n):t)}function h(){for(var t=0;t<$.length;t++)m($[t].state,$[t].params)?v(a,b[$[t].hash]):d(a,b[$[t].hash]),g($[t].state,$[t].params)?v(a,y):d(a,y)}function v(t,e){l(function(){t.addClass(e)})}function d(t,e){t.removeClass(e)}function m(e,n){return t.includes(e.name,n)}function g(e,n){return t.is(e.name,n)}var y,w,$=[],b={};y=n(s.uiSrefActiveEq||"",!1)(e);try{w=e.$eval(s.uiSrefActive)}catch(R){}w=w||n(s.uiSrefActive||"",!1)(e),c.isObject(w)&&u.forEach(w,function(n,i){if(c.isString(n)){var o=r(n,t.current.name);f(o.state,e.$eval(o.paramExpr),i)}}),this.$$addStateInfo=function(t,e){if(!(c.isObject(w)&&$.length>0)){var n=f(t,e,w);return h(),n}},e.$on("$stateChangeSuccess",h);var S=["$transition$",function(t){t.promise.then(h)}],x=o.onStart({},S);e.$on("$destroy",x),h()}]}}];angular.module("ui.router.state").directive("uiSref",f).directive("uiSrefActive",h).directive("uiSrefActiveEq",h).directive("uiState",p)},function(t,e){"use strict";function n(t){var e=function(e,n,r){return t.is(e,n,r)};return e.$stateful=!0,e}function r(t){var e=function(e,n,r){return t.includes(e,n,r)};return e.$stateful=!0,e}n.$inject=["$state"],e.$IsStateFilter=n,r.$inject=["$state"],e.$IncludedByStateFilter=r,angular.module("ui.router.state").filter("isState",n).filter("includedByState",r)},function(t,e,n){"use strict";function r(t,e,n,r,u){var c=l.parse("viewDecl.controllerAs"),p=l.parse("viewDecl.resolveAs"),h=l.parse("node.resolveContext");return{restrict:"ECA",priority:-400,compile:function(r){var u=r.html();return function(r,l){var v=l.data("$uiView");if(v){var d=v.$cfg||{viewDecl:{}};l.html(d.template||u),s.trace.traceUiViewFill(v.$uiView,l.html());var m=t(l.contents()),g=d.controller,y=c(d),w=p(d),$=h(d),b=$&&o.map($.getResolvables(),function(t){return t.data});if(r[w]=b,g){var R=e(g,o.extend({},b,{$scope:r,$element:l}));y&&(r[y]=R,r[y][w]=b),l.data("$ngControllerController",R),l.children().data("$ngControllerController",R),i(n,R,r,d)}if(a.isString(d.viewDecl.component))var S=d.viewDecl.component,x=f.kebobString(S),E=function(){var t=[].slice.call(l[0].children).filter(function(t){return t&&t.tagName&&t.tagName.toLowerCase()===x});return t&&angular.element(t).data("$"+S+"Controller")},P=r.$watch(E,function(t){t&&(i(n,t,r,d),P())});m(r)}}}}}function i(t,e,n,r){!a.isFunction(e.$onInit)||r.viewDecl.component&&h||e.$onInit();var i={bind:e};if(a.isFunction(e.uiOnParamsChanged)){var s=function(t){var n=r.node.resolveContext,i=n.getResolvables().$transition$.data;if(t!==i&&-1===t.exiting().indexOf(r.node.state.self)){var a=t.params("to"),s=t.params("from"),u=t.treeChanges().to.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),c=t.treeChanges().from.map(function(t){return t.paramSchema}).reduce(o.unnestR,[]),l=u.filter(function(t){var e=c.indexOf(t);return-1===e||!c[e].type.equals(a[t.id],s[t.id])});if(l.length){var f=l.map(function(t){return t.id});e.uiOnParamsChanged(o.filter(a,function(t,e){return-1!==f.indexOf(e)}),t)}}};n.$on("$destroy",t.onSuccess({},["$transition$",s]),i);var u=function(t,e){t.type===c.RejectType.IGNORED&&s(e)};n.$on("$destroy",t.onError({},["$error$","$transition$",u]),i)}if(a.isFunction(e.uiCanExit)){var l={exiting:r.node.state.name};n.$on("$destroy",t.onBefore(l,e.uiCanExit,i))}}var o=n(3),a=n(4),s=n(12),u=n(54),c=n(10),l=n(5),f=n(9),p=["$view","$animate","$uiViewScroll","$interpolate","$q",function(t,e,n,r,i){function o(t,n){return{enter:function(t,n,r){angular.version.minor>2?e.enter(t,null,n).then(r):e.enter(t,null,n,r)},leave:function(t,n){angular.version.minor>2?e.leave(t).then(n):e.leave(t,n)}}}function c(t,e){return t===e}var f={$cfg:{viewDecl:{$context:t.rootContext()}},$uiView:{}},p={count:0,restrict:"ECA",terminal:!0,priority:400,transclude:"element",compile:function(e,h,v){return function(e,h,d){function m(t){(!t||t instanceof u.Ng1ViewConfig)&&(c(P,t)||(s.trace.traceUiViewConfigUpdated(C,t&&t.viewDecl&&t.viewDecl.$context),P=t,y(t)))}function g(){if(w&&(s.trace.traceUiViewEvent("Removing (previous) el",w.data("$uiView")),w.remove(),w=null),b&&(s.trace.traceUiViewEvent("Destroying scope",C),b.$destroy(),b=null),$){var t=$.data("$uiView");s.trace.traceUiViewEvent("Animate out",t),E.leave($,function(){t.$$animLeave.resolve(),w=null}),w=$,$=null}}function y(t){var r=e.$new();s.trace.traceUiViewScopeCreated(C,r);var o=i.defer(),u=i.defer(),c={$cfg:t,$uiView:C,$animEnter:o.promise,$animLeave:u.promise,$$animLeave:u},l=v(r,function(t){E.enter(t.data("$uiView",c),h,function(){o.resolve(),b&&b.$emit("$viewContentAnimationEnded"),(a.isDefined(x)&&!x||e.$eval(x))&&n(t)}),g()});$=l,b=r,b.$emit("$viewContentLoaded",t||P),b.$eval(S)}var w,$,b,R,S=d.onload||"",x=d.autoscroll,E=o(d,e),P=void 0,k=h.inheritedData("$uiView")||f,O=r(d.uiView||d.name||"")(e)||"$default",C={$type:"ng1",id:p.count++,name:O,fqn:k.$uiView.fqn?k.$uiView.fqn+"."+O:O,config:null,configUpdated:m,get creationContext(){return l.parse("$cfg.viewDecl.$context")(k)}};s.trace.traceUiViewEvent("Linking",C),h.data("$uiView",{$uiView:C}),y(),R=t.registerUiView(C),e.$on("$destroy",function(){s.trace.traceUiViewEvent("Destroying/Unregistering",C),R()})}}};return p}];r.$inject=["$compile","$controller","$transitions","$view","$timeout"];var h="function"==typeof angular.module("ui.router").component;angular.module("ui.router.state").directive("uiView",p),angular.module("ui.router.state").directive("uiView",r)},function(t,e){"use strict";function n(){var t=!1;this.useAnchorScroll=function(){t=!0},this.$get=["$anchorScroll","$timeout",function(e,n){return t?e:function(t){return n(function(){t[0].scrollIntoView()},0,!1)}}]}angular.module("ui.router.state").provider("$uiViewScroll",n)}])});
1778 //# sourceMappingURL=angular-ui-router.min.js.map
1778 //# sourceMappingURL=angular-ui-router.min.js.map
1779 ;angular.module('angular-toArrayFilter', [])
1779 ;angular.module('angular-toArrayFilter', [])
1780
1780
1781 .filter('toArray', function () {
1781 .filter('toArray', function () {
1782 return function (obj, addKey) {
1782 return function (obj, addKey) {
1783 if (!angular.isObject(obj)) return obj;
1783 if (!angular.isObject(obj)) return obj;
1784 if ( addKey === false ) {
1784 if ( addKey === false ) {
1785 return Object.keys(obj).map(function(key) {
1785 return Object.keys(obj).map(function(key) {
1786 return obj[key];
1786 return obj[key];
1787 });
1787 });
1788 } else {
1788 } else {
1789 return Object.keys(obj).map(function (key) {
1789 return Object.keys(obj).map(function (key) {
1790 var value = obj[key];
1790 var value = obj[key];
1791 return angular.isObject(value) ?
1791 return angular.isObject(value) ?
1792 Object.defineProperty(value, '$key', { enumerable: false, value: key}) :
1792 Object.defineProperty(value, '$key', { enumerable: false, value: key}) :
1793 { $key: key, $value: value };
1793 { $key: key, $value: value };
1794 });
1794 });
1795 }
1795 }
1796 };
1796 };
1797 });
1797 });
1798 ;//Copyright (C) 2012 Kory Nunn
1798 ;//Copyright (C) 2012 Kory Nunn
1799
1799
1800 //Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1800 //Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
1801
1801
1802 //The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1802 //The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
1803
1803
1804 //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1804 //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1805
1805
1806 /*
1806 /*
1807
1807
1808 This code is not formatted for readability, but rather run-speed and to assist compilers.
1808 This code is not formatted for readability, but rather run-speed and to assist compilers.
1809
1809
1810 However, the code's intention should be transparent.
1810 However, the code's intention should be transparent.
1811
1811
1812 *** IE SUPPORT ***
1812 *** IE SUPPORT ***
1813
1813
1814 If you require this library to work in IE7, add the following after declaring crel.
1814 If you require this library to work in IE7, add the following after declaring crel.
1815
1815
1816 var testDiv = document.createElement('div'),
1816 var testDiv = document.createElement('div'),
1817 testLabel = document.createElement('label');
1817 testLabel = document.createElement('label');
1818
1818
1819 testDiv.setAttribute('class', 'a');
1819 testDiv.setAttribute('class', 'a');
1820 testDiv['className'] !== 'a' ? crel.attrMap['class'] = 'className':undefined;
1820 testDiv['className'] !== 'a' ? crel.attrMap['class'] = 'className':undefined;
1821 testDiv.setAttribute('name','a');
1821 testDiv.setAttribute('name','a');
1822 testDiv['name'] !== 'a' ? crel.attrMap['name'] = function(element, value){
1822 testDiv['name'] !== 'a' ? crel.attrMap['name'] = function(element, value){
1823 element.id = value;
1823 element.id = value;
1824 }:undefined;
1824 }:undefined;
1825
1825
1826
1826
1827 testLabel.setAttribute('for', 'a');
1827 testLabel.setAttribute('for', 'a');
1828 testLabel['htmlFor'] !== 'a' ? crel.attrMap['for'] = 'htmlFor':undefined;
1828 testLabel['htmlFor'] !== 'a' ? crel.attrMap['for'] = 'htmlFor':undefined;
1829
1829
1830
1830
1831
1831
1832 */
1832 */
1833
1833
1834 (function (root, factory) {
1834 (function (root, factory) {
1835 if (typeof exports === 'object') {
1835 if (typeof exports === 'object') {
1836 if (!root.window) {
1836 if (!root.window) {
1837 var jsdom = require('jsdom').jsdom;
1837 var jsdom = require('jsdom').jsdom;
1838 root.window = jsdom().parentWindow;
1838 root.window = jsdom().parentWindow;
1839 }
1839 }
1840 module.exports = factory(root.window);
1840 module.exports = factory(root.window);
1841 } else if (typeof define === 'function' && define.amd) {
1841 } else if (typeof define === 'function' && define.amd) {
1842 define(factory.bind(null, window));
1842 define(factory.bind(null, window));
1843 } else {
1843 } else {
1844 root.crel = factory(root.window);
1844 root.crel = factory(root.window);
1845 }
1845 }
1846 }(this, function (window) {
1846 }(this, function (window) {
1847 // based on http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
1847 // based on http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
1848 var isNode = typeof Node === 'object'
1848 var isNode = typeof Node === 'object'
1849 ? function (object) { return object instanceof Node }
1849 ? function (object) { return object instanceof Node }
1850 : function (object) {
1850 : function (object) {
1851 return object
1851 return object
1852 && typeof object === 'object'
1852 && typeof object === 'object'
1853 && typeof object.nodeType === 'number'
1853 && typeof object.nodeType === 'number'
1854 && typeof object.nodeName === 'string';
1854 && typeof object.nodeName === 'string';
1855 };
1855 };
1856
1856
1857 function crel(){
1857 function crel(){
1858 var document = window.document,
1858 var document = window.document,
1859 args = arguments, //Note: assigned to a variable to assist compilers. Saves about 40 bytes in closure compiler. Has negligable effect on performance.
1859 args = arguments, //Note: assigned to a variable to assist compilers. Saves about 40 bytes in closure compiler. Has negligable effect on performance.
1860 element = document.createElement(args[0]),
1860 element = document.createElement(args[0]),
1861 child,
1861 child,
1862 settings = args[1],
1862 settings = args[1],
1863 childIndex = 2,
1863 childIndex = 2,
1864 argumentsLength = args.length,
1864 argumentsLength = args.length,
1865 attributeMap = crel.attrMap;
1865 attributeMap = crel.attrMap;
1866
1866
1867 // shortcut
1867 // shortcut
1868 if(argumentsLength === 1){
1868 if(argumentsLength === 1){
1869 return element;
1869 return element;
1870 }
1870 }
1871
1871
1872 if(typeof settings !== 'object' || isNode(settings)) {
1872 if(typeof settings !== 'object' || isNode(settings)) {
1873 --childIndex;
1873 --childIndex;
1874 settings = null;
1874 settings = null;
1875 }
1875 }
1876
1876
1877 // shortcut if there is only one child that is a string
1877 // shortcut if there is only one child that is a string
1878 if((argumentsLength - childIndex) === 1 && typeof args[childIndex] === 'string' && element.textContent !== undefined){
1878 if((argumentsLength - childIndex) === 1 && typeof args[childIndex] === 'string' && element.textContent !== undefined){
1879 element.textContent = args[childIndex];
1879 element.textContent = args[childIndex];
1880 }else{
1880 }else{
1881 for(; childIndex < argumentsLength; ++childIndex){
1881 for(; childIndex < argumentsLength; ++childIndex){
1882 child = args[childIndex];
1882 child = args[childIndex];
1883
1883
1884 if(child == null){
1884 if(child == null){
1885 continue;
1885 continue;
1886 }
1886 }
1887
1887
1888 if(!isNode(child)){
1888 if(!isNode(child)){
1889 child = document.createTextNode(child);
1889 child = document.createTextNode(child);
1890 }
1890 }
1891
1891
1892 element.appendChild(child);
1892 element.appendChild(child);
1893 }
1893 }
1894 }
1894 }
1895
1895
1896 for(var key in settings){
1896 for(var key in settings){
1897 if(!attributeMap[key]){
1897 if(!attributeMap[key]){
1898 element.setAttribute(key, settings[key]);
1898 element.setAttribute(key, settings[key]);
1899 }else{
1899 }else{
1900 var attr = crel.attrMap[key];
1900 var attr = crel.attrMap[key];
1901 if(typeof attr === 'function'){
1901 if(typeof attr === 'function'){
1902 attr(element, settings[key]);
1902 attr(element, settings[key]);
1903 }else{
1903 }else{
1904 element.setAttribute(attr, settings[key]);
1904 element.setAttribute(attr, settings[key]);
1905 }
1905 }
1906 }
1906 }
1907 }
1907 }
1908
1908
1909 return element;
1909 return element;
1910 }
1910 }
1911
1911
1912 // Used for mapping one kind of attribute to the supported version of that in bad browsers.
1912 // Used for mapping one kind of attribute to the supported version of that in bad browsers.
1913 // String referenced so that compilers maintain the property name.
1913 // String referenced so that compilers maintain the property name.
1914 crel['attrMap'] = {};
1914 crel['attrMap'] = {};
1915
1915
1916 // String referenced so that compilers maintain the property name.
1916 // String referenced so that compilers maintain the property name.
1917 crel["isNode"] = isNode;
1917 crel["isNode"] = isNode;
1918
1918
1919 return crel;
1919 return crel;
1920 }));
1920 }));
1921
1921
1922 ;/*globals define, module, require, document*/
1922 ;/*globals define, module, require, document*/
1923 (function (root, factory) {
1923 (function (root, factory) {
1924 "use strict";
1924 "use strict";
1925 if (typeof define === 'function' && define.amd) {
1925 if (typeof define === 'function' && define.amd) {
1926 define([], factory);
1926 define([], factory);
1927 } else if (typeof module !== 'undefined' && module.exports) {
1927 } else if (typeof module !== 'undefined' && module.exports) {
1928 module.exports = factory();
1928 module.exports = factory();
1929 } else {
1929 } else {
1930 root.JsonHuman = factory();
1930 root.JsonHuman = factory();
1931 }
1931 }
1932 }(this, function () {
1932 }(this, function () {
1933 "use strict";
1933 "use strict";
1934
1934
1935 var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
1935 var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
1936
1936
1937 function makePrefixer(prefix) {
1937 function makePrefixer(prefix) {
1938 return function (name) {
1938 return function (name) {
1939 return prefix + "-" + name;
1939 return prefix + "-" + name;
1940 };
1940 };
1941 }
1941 }
1942
1942
1943 function isArray(obj) {
1943 function isArray(obj) {
1944 return toString.call(obj) === '[object Array]';
1944 return toString.call(obj) === '[object Array]';
1945 }
1945 }
1946
1946
1947 function sn(tagName, className, data) {
1947 function sn(tagName, className, data) {
1948 var result = document.createElement(tagName);
1948 var result = document.createElement(tagName);
1949
1949
1950 result.className = className;
1950 result.className = className;
1951 result.appendChild(document.createTextNode("" + data));
1951 result.appendChild(document.createTextNode("" + data));
1952
1952
1953 return result;
1953 return result;
1954 }
1954 }
1955
1955
1956 function scn(tagName, className, child) {
1956 function scn(tagName, className, child) {
1957 var result = document.createElement(tagName),
1957 var result = document.createElement(tagName),
1958 i, len;
1958 i, len;
1959
1959
1960 result.className = className;
1960 result.className = className;
1961
1961
1962 if (isArray(child)) {
1962 if (isArray(child)) {
1963 for (i = 0, len = child.length; i < len; i += 1) {
1963 for (i = 0, len = child.length; i < len; i += 1) {
1964 result.appendChild(child[i]);
1964 result.appendChild(child[i]);
1965 }
1965 }
1966 } else {
1966 } else {
1967 result.appendChild(child);
1967 result.appendChild(child);
1968 }
1968 }
1969
1969
1970 return result;
1970 return result;
1971 }
1971 }
1972
1972
1973 function linkNode(child, href, target){
1973 function linkNode(child, href, target){
1974 var a = scn("a", HYPERLINK_CLASS_NAME, child);
1974 var a = scn("a", HYPERLINK_CLASS_NAME, child);
1975 a.setAttribute('href', href);
1975 a.setAttribute('href', href);
1976 a.setAttribute('target', target);
1976 a.setAttribute('target', target);
1977 return a;
1977 return a;
1978 }
1978 }
1979
1979
1980 var toString = Object.prototype.toString,
1980 var toString = Object.prototype.toString,
1981 prefixer = makePrefixer("jh"),
1981 prefixer = makePrefixer("jh"),
1982 p = prefixer,
1982 p = prefixer,
1983 ARRAY = 2,
1983 ARRAY = 2,
1984 BOOL = 4,
1984 BOOL = 4,
1985 INT = 8,
1985 INT = 8,
1986 FLOAT = 16,
1986 FLOAT = 16,
1987 STRING = 32,
1987 STRING = 32,
1988 OBJECT = 64,
1988 OBJECT = 64,
1989 SPECIAL_OBJECT = 128,
1989 SPECIAL_OBJECT = 128,
1990 FUNCTION = 256,
1990 FUNCTION = 256,
1991 UNK = 1,
1991 UNK = 1,
1992
1992
1993 STRING_CLASS_NAME = p("type-string"),
1993 STRING_CLASS_NAME = p("type-string"),
1994 STRING_EMPTY_CLASS_NAME = p("type-string") + " " + p("empty"),
1994 STRING_EMPTY_CLASS_NAME = p("type-string") + " " + p("empty"),
1995
1995
1996 BOOL_TRUE_CLASS_NAME = p("type-bool-true"),
1996 BOOL_TRUE_CLASS_NAME = p("type-bool-true"),
1997 BOOL_FALSE_CLASS_NAME = p("type-bool-false"),
1997 BOOL_FALSE_CLASS_NAME = p("type-bool-false"),
1998 BOOL_IMAGE = p("type-bool-image"),
1998 BOOL_IMAGE = p("type-bool-image"),
1999 INT_CLASS_NAME = p("type-int") + " " + p("type-number"),
1999 INT_CLASS_NAME = p("type-int") + " " + p("type-number"),
2000 FLOAT_CLASS_NAME = p("type-float") + " " + p("type-number"),
2000 FLOAT_CLASS_NAME = p("type-float") + " " + p("type-number"),
2001
2001
2002 OBJECT_CLASS_NAME = p("type-object"),
2002 OBJECT_CLASS_NAME = p("type-object"),
2003 OBJ_KEY_CLASS_NAME = p("key") + " " + p("object-key"),
2003 OBJ_KEY_CLASS_NAME = p("key") + " " + p("object-key"),
2004 OBJ_VAL_CLASS_NAME = p("value") + " " + p("object-value"),
2004 OBJ_VAL_CLASS_NAME = p("value") + " " + p("object-value"),
2005 OBJ_EMPTY_CLASS_NAME = p("type-object") + " " + p("empty"),
2005 OBJ_EMPTY_CLASS_NAME = p("type-object") + " " + p("empty"),
2006
2006
2007 FUNCTION_CLASS_NAME = p("type-function"),
2007 FUNCTION_CLASS_NAME = p("type-function"),
2008
2008
2009 ARRAY_KEY_CLASS_NAME = p("key") + " " + p("array-key"),
2009 ARRAY_KEY_CLASS_NAME = p("key") + " " + p("array-key"),
2010 ARRAY_VAL_CLASS_NAME = p("value") + " " + p("array-value"),
2010 ARRAY_VAL_CLASS_NAME = p("value") + " " + p("array-value"),
2011 ARRAY_CLASS_NAME = p("type-array"),
2011 ARRAY_CLASS_NAME = p("type-array"),
2012 ARRAY_EMPTY_CLASS_NAME = p("type-array") + " " + p("empty"),
2012 ARRAY_EMPTY_CLASS_NAME = p("type-array") + " " + p("empty"),
2013
2013
2014 HYPERLINK_CLASS_NAME = p('a'),
2014 HYPERLINK_CLASS_NAME = p('a'),
2015
2015
2016 UNKNOWN_CLASS_NAME = p("type-unk");
2016 UNKNOWN_CLASS_NAME = p("type-unk");
2017
2017
2018 function getType(obj) {
2018 function getType(obj) {
2019 var type = typeof obj;
2019 var type = typeof obj;
2020
2020
2021 switch (type) {
2021 switch (type) {
2022 case "boolean":
2022 case "boolean":
2023 return BOOL;
2023 return BOOL;
2024 case "string":
2024 case "string":
2025 return STRING;
2025 return STRING;
2026 case "number":
2026 case "number":
2027 return (obj % 1 === 0) ? INT : FLOAT;
2027 return (obj % 1 === 0) ? INT : FLOAT;
2028 case "function":
2028 case "function":
2029 return FUNCTION;
2029 return FUNCTION;
2030 default:
2030 default:
2031 if (isArray(obj)) {
2031 if (isArray(obj)) {
2032 return ARRAY;
2032 return ARRAY;
2033 } else if (obj === Object(obj)) {
2033 } else if (obj === Object(obj)) {
2034 if (obj.constructor === Object) {
2034 if (obj.constructor === Object) {
2035 return OBJECT;
2035 return OBJECT;
2036 }
2036 }
2037 return OBJECT | SPECIAL_OBJECT
2037 return OBJECT | SPECIAL_OBJECT
2038 } else {
2038 } else {
2039 return UNK;
2039 return UNK;
2040 }
2040 }
2041 }
2041 }
2042 }
2042 }
2043
2043
2044 function _format(data, options, parentKey) {
2044 function _format(data, options, parentKey) {
2045
2045
2046 var result, container, key, keyNode, valNode, len, childs, tr, value,
2046 var result, container, key, keyNode, valNode, len, childs, tr, value,
2047 isEmpty = true,
2047 isEmpty = true,
2048 isSpecial = false,
2048 isSpecial = false,
2049 accum = [],
2049 accum = [],
2050 type = getType(data);
2050 type = getType(data);
2051
2051
2052 // Initialized & used only in case of objects & arrays
2052 // Initialized & used only in case of objects & arrays
2053 var hyperlinksEnabled, aTarget, hyperlinkKeys ;
2053 var hyperlinksEnabled, aTarget, hyperlinkKeys ;
2054
2054
2055 if (type === BOOL) {
2055 if (type === BOOL) {
2056 var boolOpt = options.bool;
2056 var boolOpt = options.bool;
2057 container = document.createElement('div');
2057 container = document.createElement('div');
2058
2058
2059 if (boolOpt.showImage) {
2059 if (boolOpt.showImage) {
2060 var img = document.createElement('img');
2060 var img = document.createElement('img');
2061 img.setAttribute('class', BOOL_IMAGE);
2061 img.setAttribute('class', BOOL_IMAGE);
2062
2062
2063 img.setAttribute('src',
2063 img.setAttribute('src',
2064 '' + (data ? boolOpt.img.true : boolOpt.img.false));
2064 '' + (data ? boolOpt.img.true : boolOpt.img.false));
2065
2065
2066 container.appendChild(img);
2066 container.appendChild(img);
2067 }
2067 }
2068
2068
2069 if (boolOpt.showText) {
2069 if (boolOpt.showText) {
2070 container.appendChild(data ?
2070 container.appendChild(data ?
2071 sn("span", BOOL_TRUE_CLASS_NAME, boolOpt.text.true) :
2071 sn("span", BOOL_TRUE_CLASS_NAME, boolOpt.text.true) :
2072 sn("span", BOOL_FALSE_CLASS_NAME, boolOpt.text.false));
2072 sn("span", BOOL_FALSE_CLASS_NAME, boolOpt.text.false));
2073 }
2073 }
2074
2074
2075 result = container;
2075 result = container;
2076
2076
2077 } else if (type === STRING) {
2077 } else if (type === STRING) {
2078 if (data === "") {
2078 if (data === "") {
2079 result = sn("span", STRING_EMPTY_CLASS_NAME, "(Empty Text)");
2079 result = sn("span", STRING_EMPTY_CLASS_NAME, "(Empty Text)");
2080 } else {
2080 } else {
2081 result = sn("span", STRING_CLASS_NAME, data);
2081 result = sn("span", STRING_CLASS_NAME, data);
2082 }
2082 }
2083 } else if (type === INT) {
2083 } else if (type === INT) {
2084 result = sn("span", INT_CLASS_NAME, data);
2084 result = sn("span", INT_CLASS_NAME, data);
2085 } else if (type === FLOAT) {
2085 } else if (type === FLOAT) {
2086 result = sn("span", FLOAT_CLASS_NAME, data);
2086 result = sn("span", FLOAT_CLASS_NAME, data);
2087 } else if (type & OBJECT) {
2087 } else if (type & OBJECT) {
2088 if (type & SPECIAL_OBJECT) {
2088 if (type & SPECIAL_OBJECT) {
2089 isSpecial = true;
2089 isSpecial = true;
2090 }
2090 }
2091 childs = [];
2091 childs = [];
2092
2092
2093 aTarget = options.hyperlinks.target;
2093 aTarget = options.hyperlinks.target;
2094 hyperlinkKeys = options.hyperlinks.keys;
2094 hyperlinkKeys = options.hyperlinks.keys;
2095
2095
2096 // Is Hyperlink Key
2096 // Is Hyperlink Key
2097 hyperlinksEnabled =
2097 hyperlinksEnabled =
2098 options.hyperlinks.enable &&
2098 options.hyperlinks.enable &&
2099 hyperlinkKeys &&
2099 hyperlinkKeys &&
2100 hyperlinkKeys.length > 0;
2100 hyperlinkKeys.length > 0;
2101
2101
2102 for (key in data) {
2102 for (key in data) {
2103 isEmpty = false;
2103 isEmpty = false;
2104
2104
2105 value = data[key];
2105 value = data[key];
2106
2106
2107 valNode = _format(value, options, key);
2107 valNode = _format(value, options, key);
2108 keyNode = sn("th", OBJ_KEY_CLASS_NAME, key);
2108 keyNode = sn("th", OBJ_KEY_CLASS_NAME, key);
2109
2109
2110 if( hyperlinksEnabled &&
2110 if( hyperlinksEnabled &&
2111 typeof(value) === 'string' &&
2111 typeof(value) === 'string' &&
2112 indexOf.call(hyperlinkKeys, key) >= 0){
2112 indexOf.call(hyperlinkKeys, key) >= 0){
2113
2113
2114 valNode = scn("td", OBJ_VAL_CLASS_NAME, linkNode(valNode, value, aTarget));
2114 valNode = scn("td", OBJ_VAL_CLASS_NAME, linkNode(valNode, value, aTarget));
2115 } else {
2115 } else {
2116 valNode = scn("td", OBJ_VAL_CLASS_NAME, valNode);
2116 valNode = scn("td", OBJ_VAL_CLASS_NAME, valNode);
2117 }
2117 }
2118
2118
2119 tr = document.createElement("tr");
2119 tr = document.createElement("tr");
2120 tr.appendChild(keyNode);
2120 tr.appendChild(keyNode);
2121 tr.appendChild(valNode);
2121 tr.appendChild(valNode);
2122
2122
2123 childs.push(tr);
2123 childs.push(tr);
2124 }
2124 }
2125
2125
2126 if (isSpecial) {
2126 if (isSpecial) {
2127 result = sn('span', STRING_CLASS_NAME, data.toString())
2127 result = sn('span', STRING_CLASS_NAME, data.toString())
2128 } else if (isEmpty) {
2128 } else if (isEmpty) {
2129 result = sn("span", OBJ_EMPTY_CLASS_NAME, "(Empty Object)");
2129 result = sn("span", OBJ_EMPTY_CLASS_NAME, "(Empty Object)");
2130 } else {
2130 } else {
2131 result = scn("table", OBJECT_CLASS_NAME, scn("tbody", '', childs));
2131 result = scn("table", OBJECT_CLASS_NAME, scn("tbody", '', childs));
2132 }
2132 }
2133 } else if (type === FUNCTION) {
2133 } else if (type === FUNCTION) {
2134 result = sn("span", FUNCTION_CLASS_NAME, data);
2134 result = sn("span", FUNCTION_CLASS_NAME, data);
2135 } else if (type === ARRAY) {
2135 } else if (type === ARRAY) {
2136 if (data.length > 0) {
2136 if (data.length > 0) {
2137 childs = [];
2137 childs = [];
2138 var showArrayIndices = options.showArrayIndex;
2138 var showArrayIndices = options.showArrayIndex;
2139
2139
2140 aTarget = options.hyperlinks.target;
2140 aTarget = options.hyperlinks.target;
2141 hyperlinkKeys = options.hyperlinks.keys;
2141 hyperlinkKeys = options.hyperlinks.keys;
2142
2142
2143 // Hyperlink of arrays?
2143 // Hyperlink of arrays?
2144 hyperlinksEnabled = parentKey && options.hyperlinks.enable &&
2144 hyperlinksEnabled = parentKey && options.hyperlinks.enable &&
2145 hyperlinkKeys &&
2145 hyperlinkKeys &&
2146 hyperlinkKeys.length > 0 &&
2146 hyperlinkKeys.length > 0 &&
2147 indexOf.call(hyperlinkKeys, parentKey) >= 0;
2147 indexOf.call(hyperlinkKeys, parentKey) >= 0;
2148
2148
2149 for (key = 0, len = data.length; key < len; key += 1) {
2149 for (key = 0, len = data.length; key < len; key += 1) {
2150
2150
2151 keyNode = sn("th", ARRAY_KEY_CLASS_NAME, key);
2151 keyNode = sn("th", ARRAY_KEY_CLASS_NAME, key);
2152 value = data[key];
2152 value = data[key];
2153
2153
2154 if (hyperlinksEnabled && typeof(value) === "string") {
2154 if (hyperlinksEnabled && typeof(value) === "string") {
2155 valNode = _format(value, options, key);
2155 valNode = _format(value, options, key);
2156 valNode = scn("td", ARRAY_VAL_CLASS_NAME,
2156 valNode = scn("td", ARRAY_VAL_CLASS_NAME,
2157 linkNode(valNode, value, aTarget));
2157 linkNode(valNode, value, aTarget));
2158 } else {
2158 } else {
2159 valNode = scn("td", ARRAY_VAL_CLASS_NAME,
2159 valNode = scn("td", ARRAY_VAL_CLASS_NAME,
2160 _format(value, options, key));
2160 _format(value, options, key));
2161 }
2161 }
2162
2162
2163 tr = document.createElement("tr");
2163 tr = document.createElement("tr");
2164
2164
2165 if (showArrayIndices) {
2165 if (showArrayIndices) {
2166 tr.appendChild(keyNode);
2166 tr.appendChild(keyNode);
2167 }
2167 }
2168 tr.appendChild(valNode);
2168 tr.appendChild(valNode);
2169
2169
2170 childs.push(tr);
2170 childs.push(tr);
2171 }
2171 }
2172
2172
2173 result = scn("table", ARRAY_CLASS_NAME, scn("tbody", '', childs));
2173 result = scn("table", ARRAY_CLASS_NAME, scn("tbody", '', childs));
2174 } else {
2174 } else {
2175 result = sn("span", ARRAY_EMPTY_CLASS_NAME, "(Empty List)");
2175 result = sn("span", ARRAY_EMPTY_CLASS_NAME, "(Empty List)");
2176 }
2176 }
2177 } else {
2177 } else {
2178 result = sn("span", UNKNOWN_CLASS_NAME, data);
2178 result = sn("span", UNKNOWN_CLASS_NAME, data);
2179 }
2179 }
2180
2180
2181 return result;
2181 return result;
2182 }
2182 }
2183
2183
2184 function format(data, options) {
2184 function format(data, options) {
2185 options = validateOptions(options || {});
2185 options = validateOptions(options || {});
2186
2186
2187 var result;
2187 var result;
2188
2188
2189 result = _format(data, options);
2189 result = _format(data, options);
2190 result.className = result.className + " " + prefixer("root");
2190 result.className = result.className + " " + prefixer("root");
2191
2191
2192 return result;
2192 return result;
2193 }
2193 }
2194
2194
2195 function validateOptions(options){
2195 function validateOptions(options){
2196 options = validateArrayIndexOption(options);
2196 options = validateArrayIndexOption(options);
2197 options = validateHyperlinkOptions(options);
2197 options = validateHyperlinkOptions(options);
2198 options = validateBoolOptions(options);
2198 options = validateBoolOptions(options);
2199
2199
2200 // Add any more option validators here
2200 // Add any more option validators here
2201
2201
2202 return options;
2202 return options;
2203 }
2203 }
2204
2204
2205
2205
2206 function validateArrayIndexOption(options) {
2206 function validateArrayIndexOption(options) {
2207 if(options.showArrayIndex === undefined){
2207 if(options.showArrayIndex === undefined){
2208 options.showArrayIndex = true;
2208 options.showArrayIndex = true;
2209 } else {
2209 } else {
2210 // Force to boolean just in case
2210 // Force to boolean just in case
2211 options.showArrayIndex = options.showArrayIndex ? true: false;
2211 options.showArrayIndex = options.showArrayIndex ? true: false;
2212 }
2212 }
2213
2213
2214 return options;
2214 return options;
2215 }
2215 }
2216
2216
2217 function validateHyperlinkOptions(options){
2217 function validateHyperlinkOptions(options){
2218 var hyperlinks = {
2218 var hyperlinks = {
2219 enable : false,
2219 enable : false,
2220 keys : null,
2220 keys : null,
2221 target : ''
2221 target : ''
2222 };
2222 };
2223
2223
2224 if(options.hyperlinks && options.hyperlinks.enable) {
2224 if(options.hyperlinks && options.hyperlinks.enable) {
2225 hyperlinks.enable = true;
2225 hyperlinks.enable = true;
2226
2226
2227 hyperlinks.keys = isArray(options.hyperlinks.keys) ? options.hyperlinks.keys : [];
2227 hyperlinks.keys = isArray(options.hyperlinks.keys) ? options.hyperlinks.keys : [];
2228
2228
2229 if(options.hyperlinks.target) {
2229 if(options.hyperlinks.target) {
2230 hyperlinks.target = '' + options.hyperlinks.target;
2230 hyperlinks.target = '' + options.hyperlinks.target;
2231 } else {
2231 } else {
2232 hyperlinks.target = '_blank';
2232 hyperlinks.target = '_blank';
2233 }
2233 }
2234 }
2234 }
2235
2235
2236 options.hyperlinks = hyperlinks;
2236 options.hyperlinks = hyperlinks;
2237
2237
2238 return options;
2238 return options;
2239 }
2239 }
2240
2240
2241 function validateBoolOptions(options){
2241 function validateBoolOptions(options){
2242 if(!options.bool){
2242 if(!options.bool){
2243 options.bool = {
2243 options.bool = {
2244 text: {
2244 text: {
2245 true : "true",
2245 true : "true",
2246 false : "false"
2246 false : "false"
2247 },
2247 },
2248 img : {
2248 img : {
2249 true: "",
2249 true: "",
2250 false: ""
2250 false: ""
2251 },
2251 },
2252 showImage : false,
2252 showImage : false,
2253 showText : true
2253 showText : true
2254 };
2254 };
2255 } else {
2255 } else {
2256 var boolOptions = options.bool;
2256 var boolOptions = options.bool;
2257
2257
2258 // Show text if no option
2258 // Show text if no option
2259 if(!boolOptions.showText && !boolOptions.showImage){
2259 if(!boolOptions.showText && !boolOptions.showImage){
2260 boolOptions.showImage = false;
2260 boolOptions.showImage = false;
2261 boolOptions.showText = true;
2261 boolOptions.showText = true;
2262 }
2262 }
2263
2263
2264 if(boolOptions.showText){
2264 if(boolOptions.showText){
2265 if(!boolOptions.text){
2265 if(!boolOptions.text){
2266 boolOptions.text = {
2266 boolOptions.text = {
2267 true : "true",
2267 true : "true",
2268 false : "false"
2268 false : "false"
2269 };
2269 };
2270 } else {
2270 } else {
2271 var t = boolOptions.text.true, f = boolOptions.text.false;
2271 var t = boolOptions.text.true, f = boolOptions.text.false;
2272
2272
2273 if(getType(t) != STRING || t === ''){
2273 if(getType(t) != STRING || t === ''){
2274 boolOptions.text.true = 'true';
2274 boolOptions.text.true = 'true';
2275 }
2275 }
2276
2276
2277 if(getType(f) != STRING || f === ''){
2277 if(getType(f) != STRING || f === ''){
2278 boolOptions.text.false = 'false';
2278 boolOptions.text.false = 'false';
2279 }
2279 }
2280 }
2280 }
2281 }
2281 }
2282
2282
2283 if(boolOptions.showImage){
2283 if(boolOptions.showImage){
2284 if(!boolOptions.img.true && !boolOptions.img.false){
2284 if(!boolOptions.img.true && !boolOptions.img.false){
2285 boolOptions.showImage = false;
2285 boolOptions.showImage = false;
2286 }
2286 }
2287 }
2287 }
2288 }
2288 }
2289
2289
2290 return options;
2290 return options;
2291 }
2291 }
2292
2292
2293 return {
2293 return {
2294 format: format
2294 format: format
2295 };
2295 };
2296 }));
2296 }));
2297
2297
2298 ;//! moment.js
2298 ;//! moment.js
2299 //! version : 2.8.4
2299 //! version : 2.8.4
2300 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2300 //! authors : Tim Wood, Iskren Chernev, Moment.js contributors
2301 //! license : MIT
2301 //! license : MIT
2302 //! momentjs.com
2302 //! momentjs.com
2303 (function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return zb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function e(a){tb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return m(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){qc[a]||(e(b),qc[a]=!0)}function h(a,b){return function(c){return p(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function j(){}function k(a,b){b!==!1&&F(a),n(this,a),this._d=new Date(+a._d)}function l(a){var b=y(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=tb.localeData(),this._bubble()}function m(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function n(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Ib.length>0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function q(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function r(a,b){var c;return b=K(b,a),a.isBefore(b)?c=q(a,b):(c=q(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function s(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(g(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=tb.duration(c,d),t(this,e,a),this}}function t(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&nb(a,"Date",mb(a,"Date")+f*c),g&&lb(a,mb(a,"Month")+g*c),d&&tb.updateOffset(a,f||g)}function u(a){return"[object Array]"===Object.prototype.toString.call(a)}function v(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function w(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=jc[a]||kc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>24||24===a._a[Db]&&(0!==a._a[Eb]||0!==a._a[Fb]||0!==a._a[Gb])?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}function G(b){return null==b._isValid&&(b._isValid=!isNaN(b._d.getTime())&&b._pf.overflow<0&&!b._pf.empty&&!b._pf.invalidMonth&&!b._pf.nullInput&&!b._pf.invalidFormat&&!b._pf.userInvalidated,b._strict&&(b._isValid=b._isValid&&0===b._pf.charsLeftOver&&0===b._pf.unusedTokens.length&&b._pf.bigHour===a)),b._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f<a.length;){for(e=H(a[f]).split("-"),b=e.length,c=H(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){var c,d;return b._isUTC?(c=b.clone(),d=(tb.isMoment(a)||v(a)?+a:+tb(a))-+c,c._d.setTime(+c._d+d),tb.updateOffset(c,!1),c):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=pc[d[b]]?pc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),lc[b]||(lc[b]=M(b)),lc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Zb;case"DDDD":return _b;case"YYYY":case"GGGG":case"gggg":return d?ac:Rb;case"Y":case"G":case"g":return cc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?bc:Sb;case"S":if(d)return Zb;case"SS":if(d)return $b;case"SSS":if(d)return _b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"x":return Xb;case"X":return Yb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?$b:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return d?b._locale._ordinalParse:b._locale._ordinalParseLenient;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(hc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b,a,c._strict),null!=d?e[Bb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"h":case"hh":c._pf.bigHour=!0;case"H":case"HH":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"x":c._d=new Date(A(b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];24===a._a[Db]&&0===a._a[Eb]&&0===a._a[Fb]&&0===a._a[Gb]&&(a._nextDay=!0,a._a[Db]=0),a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm),a._nextDay&&(a._a[Db]=24)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function W(b){if(b._f===tb.ISO_8601)return void $(b);b._a=[],b._pf.empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=O(b._f,b._locale).match(Nb)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(P(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&b._pf.unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),pc[f]?(d?b._pf.empty=!1:b._pf.unusedTokens.push(f),R(f,d,b)):b._strict&&!d&&b._pf.unusedTokens.push(f);b._pf.charsLeftOver=i-j,h.length>0&&b._pf.unusedInput.push(h),b._pf.bigHour===!0&&b._a[Db]<=12&&(b._pf.bigHour=a),b._isPm&&b._a[Db]<12&&(b._a[Db]+=12),b._isPm===!1&&12===b._a[Db]&&(b._a[Db]=0),T(b),F(b)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=d(),b._f=a._f[f],W(b),G(b)&&(g+=b._pf.charsLeftOver,g+=10*b._pf.unusedTokens.length,b._pf.score=g,(null==e||e>g)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=dc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f=fc[b][0]+(e[6]||" ");break}for(b=0,c=gc.length;c>b;b++)if(gc[b][1].exec(d)){a._f+=gc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function bb(b){var c,d=b._i;d===a?b._d=new Date:v(d)?b._d=new Date(+d):null!==(c=Kb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?_(b):u(d)?(b._a=ab(d.slice(0),function(a){return parseInt(a,10)}),T(b)):"object"==typeof d?U(b):"number"==typeof d?b._d=new Date(d):tb.createFromInputFallback(b)}function cb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e<mc.s&&["s",e]||1===f&&["m"]||f<mc.m&&["mm",f]||1===g&&["h"]||g<mc.h&&["hh",g]||1===h&&["d"]||h<mc.d&&["dd",h]||1===i&&["M"]||i<mc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c,d=b._i,e=b._f;return b._locale=b._locale||tb.localeData(b._l),null===d||e===a&&""===d?tb.invalid({nullInput:!0}):("string"==typeof d&&(b._i=d=b._locale.preparse(d)),tb.isMoment(d)?new k(d,!0):(e?u(e)?Z(b):W(b):bb(b),c=new k(b),c._nextDay&&(c.add(1,"d"),c._nextDay=a),c))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function lb(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),B(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function mb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function nb(a,b,c){return"Month"===b?lb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function ob(a,b){return function(c){return null!=c?(nb(this,a,c),tb.updateOffset(this,b),this):mb(this,a)}}function pb(a){return 400*a/146097}function qb(a){return 146097*a/400}function rb(a){tb.duration.fn[a]=function(){return this._data[a]}}function sb(a){"undefined"==typeof ender&&(ub=xb.moment,xb.moment=a?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",tb):tb)}for(var tb,ub,vb,wb="2.8.4",xb="undefined"!=typeof global?global:this,yb=Math.round,zb=Object.prototype.hasOwnProperty,Ab=0,Bb=1,Cb=2,Db=3,Eb=4,Fb=5,Gb=6,Hb={},Ib=[],Jb="undefined"!=typeof module&&module&&module.exports,Kb=/^\/?Date\((\-?\d+)/i,Lb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Mb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Nb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Ob=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pb=/\d\d?/,Qb=/\d{1,3}/,Rb=/\d{1,4}/,Sb=/[+\-]?\d{1,6}/,Tb=/\d+/,Ub=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Vb=/Z|[\+\-]\d\d:?\d\d/gi,Wb=/T/i,Xb=/[\+\-]?\d+/,Yb=/[\+\-]?\d+(\.\d{1,3})?/,Zb=/\d/,$b=/\d\d/,_b=/\d{3}/,ac=/\d{4}/,bc=/[+-]?\d{6}/,cc=/[+-]?\d+/,dc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ec="YYYY-MM-DDTHH:mm:ssZ",fc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],gc=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],hc=/([\+\-]|\d\d)/gi,ic=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),jc={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},kc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},lc={},mc={s:45,m:45,h:22,d:26,M:11},nc="DDD w W M D d".split(" "),oc="M D H h m s w W".split(" "),pc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return p(this.year()%100,2)},YYYY:function(){return p(this.year(),4)},YYYYY:function(){return p(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){return p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},qc={},rc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];nc.length;)vb=nc.pop(),pc[vb+"o"]=i(pc[vb],vb);for(;oc.length;)vb=oc.pop(),pc[vb+vb]=h(pc[vb],2);pc.DDDD=h(pc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=tb.utc([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.apply(b,[c]):d},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=ec,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return mc[b]===a?!1:c===a?mc[b]:(mc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._locale=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=rc.length-1;vb>=0;--vb)z(rc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():N(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):N(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return G(this)},isDSTShifted:function(){return this._a?this.isValid()&&w(this._a,(this._isUTC?tb.utc(this._a):tb(this._a)).toArray())>0:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this,tb(b)))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=eb(a,this.localeData()),this.add(a-b,"d")):b},month:ob("Month",!0),startOf:function(a){switch(a=x(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(b){return b=x(b),b===a||"millisecond"===b?this:this.startOf(b).add(1,"isoWeek"===b?"week":b).subtract(1,"ms")},isAfter:function(a,b){var c;return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this>+a):(c=tb.isMoment(a)?+a:+tb(a),c<+this.clone().startOf(b))},isBefore:function(a,b){var c;return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):(c=tb.isMoment(a)?+a:+tb(a),+this.clone().endOf(b)<c)},isSame:function(a,b){var c;return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):(c=+tb(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+Math.round(qb(this._months/12)),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;
2303 (function(a){function b(a,b,c){switch(arguments.length){case 2:return null!=a?a:b;case 3:return null!=a?a:null!=b?b:c;default:throw new Error("Implement me")}}function c(a,b){return zb.call(a,b)}function d(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function e(a){tb.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+a)}function f(a,b){var c=!0;return m(function(){return c&&(e(a),c=!1),b.apply(this,arguments)},b)}function g(a,b){qc[a]||(e(b),qc[a]=!0)}function h(a,b){return function(c){return p(a.call(this,c),b)}}function i(a,b){return function(c){return this.localeData().ordinal(a.call(this,c),b)}}function j(){}function k(a,b){b!==!1&&F(a),n(this,a),this._d=new Date(+a._d)}function l(a){var b=y(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=tb.localeData(),this._bubble()}function m(a,b){for(var d in b)c(b,d)&&(a[d]=b[d]);return c(b,"toString")&&(a.toString=b.toString),c(b,"valueOf")&&(a.valueOf=b.valueOf),a}function n(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=b._pf),"undefined"!=typeof b._locale&&(a._locale=b._locale),Ib.length>0)for(c in Ib)d=Ib[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function o(a){return 0>a?Math.ceil(a):Math.floor(a)}function p(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function q(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function r(a,b){var c;return b=K(b,a),a.isBefore(b)?c=q(a,b):(c=q(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function s(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(g(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=tb.duration(c,d),t(this,e,a),this}}function t(a,b,c,d){var e=b._milliseconds,f=b._days,g=b._months;d=null==d?!0:d,e&&a._d.setTime(+a._d+e*c),f&&nb(a,"Date",mb(a,"Date")+f*c),g&&lb(a,mb(a,"Month")+g*c),d&&tb.updateOffset(a,f||g)}function u(a){return"[object Array]"===Object.prototype.toString.call(a)}function v(a){return"[object Date]"===Object.prototype.toString.call(a)||a instanceof Date}function w(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&A(a[d])!==A(b[d]))&&g++;return g+f}function x(a){if(a){var b=a.toLowerCase().replace(/(.)s$/,"$1");a=jc[a]||kc[b]||b}return a}function y(a){var b,d,e={};for(d in a)c(a,d)&&(b=x(d),b&&(e[b]=a[d]));return e}function z(b){var c,d;if(0===b.indexOf("week"))c=7,d="day";else{if(0!==b.indexOf("month"))return;c=12,d="month"}tb[b]=function(e,f){var g,h,i=tb._locale[b],j=[];if("number"==typeof e&&(f=e,e=a),h=function(a){var b=tb().utc().set(d,a);return i.call(tb._locale,b,e||"")},null!=f)return h(f);for(g=0;c>g;g++)j.push(h(g));return j}}function A(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function B(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function C(a,b,c){return hb(tb([a,11,31+b-c]),b,c).week}function D(a){return E(a)?366:365}function E(a){return a%4===0&&a%100!==0||a%400===0}function F(a){var b;a._a&&-2===a._pf.overflow&&(b=a._a[Bb]<0||a._a[Bb]>11?Bb:a._a[Cb]<1||a._a[Cb]>B(a._a[Ab],a._a[Bb])?Cb:a._a[Db]<0||a._a[Db]>24||24===a._a[Db]&&(0!==a._a[Eb]||0!==a._a[Fb]||0!==a._a[Gb])?Db:a._a[Eb]<0||a._a[Eb]>59?Eb:a._a[Fb]<0||a._a[Fb]>59?Fb:a._a[Gb]<0||a._a[Gb]>999?Gb:-1,a._pf._overflowDayOfYear&&(Ab>b||b>Cb)&&(b=Cb),a._pf.overflow=b)}function G(b){return null==b._isValid&&(b._isValid=!isNaN(b._d.getTime())&&b._pf.overflow<0&&!b._pf.empty&&!b._pf.invalidMonth&&!b._pf.nullInput&&!b._pf.invalidFormat&&!b._pf.userInvalidated,b._strict&&(b._isValid=b._isValid&&0===b._pf.charsLeftOver&&0===b._pf.unusedTokens.length&&b._pf.bigHour===a)),b._isValid}function H(a){return a?a.toLowerCase().replace("_","-"):a}function I(a){for(var b,c,d,e,f=0;f<a.length;){for(e=H(a[f]).split("-"),b=e.length,c=H(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=J(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&w(e,c,!0)>=b-1)break;b--}f++}return null}function J(a){var b=null;if(!Hb[a]&&Jb)try{b=tb.locale(),require("./locale/"+a),tb.locale(b)}catch(c){}return Hb[a]}function K(a,b){var c,d;return b._isUTC?(c=b.clone(),d=(tb.isMoment(a)||v(a)?+a:+tb(a))-+c,c._d.setTime(+c._d+d),tb.updateOffset(c,!1),c):tb(a).local()}function L(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function M(a){var b,c,d=a.match(Nb);for(b=0,c=d.length;c>b;b++)d[b]=pc[d[b]]?pc[d[b]]:L(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function N(a,b){return a.isValid()?(b=O(b,a.localeData()),lc[b]||(lc[b]=M(b)),lc[b](a)):a.localeData().invalidDate()}function O(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Ob.lastIndex=0;d>=0&&Ob.test(a);)a=a.replace(Ob,c),Ob.lastIndex=0,d-=1;return a}function P(a,b){var c,d=b._strict;switch(a){case"Q":return Zb;case"DDDD":return _b;case"YYYY":case"GGGG":case"gggg":return d?ac:Rb;case"Y":case"G":case"g":return cc;case"YYYYYY":case"YYYYY":case"GGGGG":case"ggggg":return d?bc:Sb;case"S":if(d)return Zb;case"SS":if(d)return $b;case"SSS":if(d)return _b;case"DDD":return Qb;case"MMM":case"MMMM":case"dd":case"ddd":case"dddd":return Ub;case"a":case"A":return b._locale._meridiemParse;case"x":return Xb;case"X":return Yb;case"Z":case"ZZ":return Vb;case"T":return Wb;case"SSSS":return Tb;case"MM":case"DD":case"YY":case"GG":case"gg":case"HH":case"hh":case"mm":case"ss":case"ww":case"WW":return d?$b:Pb;case"M":case"D":case"d":case"H":case"h":case"m":case"s":case"w":case"W":case"e":case"E":return Pb;case"Do":return d?b._locale._ordinalParse:b._locale._ordinalParseLenient;default:return c=new RegExp(Y(X(a.replace("\\","")),"i"))}}function Q(a){a=a||"";var b=a.match(Vb)||[],c=b[b.length-1]||[],d=(c+"").match(hc)||["-",0,0],e=+(60*d[1])+A(d[2]);return"+"===d[0]?-e:e}function R(a,b,c){var d,e=c._a;switch(a){case"Q":null!=b&&(e[Bb]=3*(A(b)-1));break;case"M":case"MM":null!=b&&(e[Bb]=A(b)-1);break;case"MMM":case"MMMM":d=c._locale.monthsParse(b,a,c._strict),null!=d?e[Bb]=d:c._pf.invalidMonth=b;break;case"D":case"DD":null!=b&&(e[Cb]=A(b));break;case"Do":null!=b&&(e[Cb]=A(parseInt(b.match(/\d{1,2}/)[0],10)));break;case"DDD":case"DDDD":null!=b&&(c._dayOfYear=A(b));break;case"YY":e[Ab]=tb.parseTwoDigitYear(b);break;case"YYYY":case"YYYYY":case"YYYYYY":e[Ab]=A(b);break;case"a":case"A":c._isPm=c._locale.isPM(b);break;case"h":case"hh":c._pf.bigHour=!0;case"H":case"HH":e[Db]=A(b);break;case"m":case"mm":e[Eb]=A(b);break;case"s":case"ss":e[Fb]=A(b);break;case"S":case"SS":case"SSS":case"SSSS":e[Gb]=A(1e3*("0."+b));break;case"x":c._d=new Date(A(b));break;case"X":c._d=new Date(1e3*parseFloat(b));break;case"Z":case"ZZ":c._useUTC=!0,c._tzm=Q(b);break;case"dd":case"ddd":case"dddd":d=c._locale.weekdaysParse(b),null!=d?(c._w=c._w||{},c._w.d=d):c._pf.invalidWeekday=b;break;case"w":case"ww":case"W":case"WW":case"d":case"e":case"E":a=a.substr(0,1);case"gggg":case"GGGG":case"GGGGG":a=a.substr(0,2),b&&(c._w=c._w||{},c._w[a]=A(b));break;case"gg":case"GG":c._w=c._w||{},c._w[a]=tb.parseTwoDigitYear(b)}}function S(a){var c,d,e,f,g,h,i;c=a._w,null!=c.GG||null!=c.W||null!=c.E?(g=1,h=4,d=b(c.GG,a._a[Ab],hb(tb(),1,4).year),e=b(c.W,1),f=b(c.E,1)):(g=a._locale._week.dow,h=a._locale._week.doy,d=b(c.gg,a._a[Ab],hb(tb(),g,h).year),e=b(c.w,1),null!=c.d?(f=c.d,g>f&&++e):f=null!=c.e?c.e+g:g),i=ib(d,e,f,h,g),a._a[Ab]=i.year,a._dayOfYear=i.dayOfYear}function T(a){var c,d,e,f,g=[];if(!a._d){for(e=V(a),a._w&&null==a._a[Cb]&&null==a._a[Bb]&&S(a),a._dayOfYear&&(f=b(a._a[Ab],e[Ab]),a._dayOfYear>D(f)&&(a._pf._overflowDayOfYear=!0),d=db(f,0,a._dayOfYear),a._a[Bb]=d.getUTCMonth(),a._a[Cb]=d.getUTCDate()),c=0;3>c&&null==a._a[c];++c)a._a[c]=g[c]=e[c];for(;7>c;c++)a._a[c]=g[c]=null==a._a[c]?2===c?1:0:a._a[c];24===a._a[Db]&&0===a._a[Eb]&&0===a._a[Fb]&&0===a._a[Gb]&&(a._nextDay=!0,a._a[Db]=0),a._d=(a._useUTC?db:cb).apply(null,g),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()+a._tzm),a._nextDay&&(a._a[Db]=24)}}function U(a){var b;a._d||(b=y(a._i),a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],T(a))}function V(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function W(b){if(b._f===tb.ISO_8601)return void $(b);b._a=[],b._pf.empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,j=0;for(e=O(b._f,b._locale).match(Nb)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(P(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&b._pf.unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),pc[f]?(d?b._pf.empty=!1:b._pf.unusedTokens.push(f),R(f,d,b)):b._strict&&!d&&b._pf.unusedTokens.push(f);b._pf.charsLeftOver=i-j,h.length>0&&b._pf.unusedInput.push(h),b._pf.bigHour===!0&&b._a[Db]<=12&&(b._pf.bigHour=a),b._isPm&&b._a[Db]<12&&(b._a[Db]+=12),b._isPm===!1&&12===b._a[Db]&&(b._a[Db]=0),T(b),F(b)}function X(a){return a.replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e})}function Y(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Z(a){var b,c,e,f,g;if(0===a._f.length)return a._pf.invalidFormat=!0,void(a._d=new Date(0/0));for(f=0;f<a._f.length;f++)g=0,b=n({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._pf=d(),b._f=a._f[f],W(b),G(b)&&(g+=b._pf.charsLeftOver,g+=10*b._pf.unusedTokens.length,b._pf.score=g,(null==e||e>g)&&(e=g,c=b));m(a,c||b)}function $(a){var b,c,d=a._i,e=dc.exec(d);if(e){for(a._pf.iso=!0,b=0,c=fc.length;c>b;b++)if(fc[b][1].exec(d)){a._f=fc[b][0]+(e[6]||" ");break}for(b=0,c=gc.length;c>b;b++)if(gc[b][1].exec(d)){a._f+=gc[b][0];break}d.match(Vb)&&(a._f+="Z"),W(a)}else a._isValid=!1}function _(a){$(a),a._isValid===!1&&(delete a._isValid,tb.createFromInputFallback(a))}function ab(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function bb(b){var c,d=b._i;d===a?b._d=new Date:v(d)?b._d=new Date(+d):null!==(c=Kb.exec(d))?b._d=new Date(+c[1]):"string"==typeof d?_(b):u(d)?(b._a=ab(d.slice(0),function(a){return parseInt(a,10)}),T(b)):"object"==typeof d?U(b):"number"==typeof d?b._d=new Date(d):tb.createFromInputFallback(b)}function cb(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function db(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function eb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function fb(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function gb(a,b,c){var d=tb.duration(a).abs(),e=yb(d.as("s")),f=yb(d.as("m")),g=yb(d.as("h")),h=yb(d.as("d")),i=yb(d.as("M")),j=yb(d.as("y")),k=e<mc.s&&["s",e]||1===f&&["m"]||f<mc.m&&["mm",f]||1===g&&["h"]||g<mc.h&&["hh",g]||1===h&&["d"]||h<mc.d&&["dd",h]||1===i&&["M"]||i<mc.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,fb.apply({},k)}function hb(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=tb(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ib(a,b,c,d,e){var f,g,h=db(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:D(a-1)+g}}function jb(b){var c,d=b._i,e=b._f;return b._locale=b._locale||tb.localeData(b._l),null===d||e===a&&""===d?tb.invalid({nullInput:!0}):("string"==typeof d&&(b._i=d=b._locale.preparse(d)),tb.isMoment(d)?new k(d,!0):(e?u(e)?Z(b):W(b):bb(b),c=new k(b),c._nextDay&&(c.add(1,"d"),c._nextDay=a),c))}function kb(a,b){var c,d;if(1===b.length&&u(b[0])&&(b=b[0]),!b.length)return tb();for(c=b[0],d=1;d<b.length;++d)b[d][a](c)&&(c=b[d]);return c}function lb(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),B(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function mb(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function nb(a,b,c){return"Month"===b?lb(a,c):a._d["set"+(a._isUTC?"UTC":"")+b](c)}function ob(a,b){return function(c){return null!=c?(nb(this,a,c),tb.updateOffset(this,b),this):mb(this,a)}}function pb(a){return 400*a/146097}function qb(a){return 146097*a/400}function rb(a){tb.duration.fn[a]=function(){return this._data[a]}}function sb(a){"undefined"==typeof ender&&(ub=xb.moment,xb.moment=a?f("Accessing Moment through the global scope is deprecated, and will be removed in an upcoming release.",tb):tb)}for(var tb,ub,vb,wb="2.8.4",xb="undefined"!=typeof global?global:this,yb=Math.round,zb=Object.prototype.hasOwnProperty,Ab=0,Bb=1,Cb=2,Db=3,Eb=4,Fb=5,Gb=6,Hb={},Ib=[],Jb="undefined"!=typeof module&&module&&module.exports,Kb=/^\/?Date\((\-?\d+)/i,Lb=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,Mb=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/,Nb=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Ob=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Pb=/\d\d?/,Qb=/\d{1,3}/,Rb=/\d{1,4}/,Sb=/[+\-]?\d{1,6}/,Tb=/\d+/,Ub=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Vb=/Z|[\+\-]\d\d:?\d\d/gi,Wb=/T/i,Xb=/[\+\-]?\d+/,Yb=/[\+\-]?\d+(\.\d{1,3})?/,Zb=/\d/,$b=/\d\d/,_b=/\d{3}/,ac=/\d{4}/,bc=/[+-]?\d{6}/,cc=/[+-]?\d+/,dc=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ec="YYYY-MM-DDTHH:mm:ssZ",fc=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],gc=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],hc=/([\+\-]|\d\d)/gi,ic=("Date|Hours|Minutes|Seconds|Milliseconds".split("|"),{Milliseconds:1,Seconds:1e3,Minutes:6e4,Hours:36e5,Days:864e5,Months:2592e6,Years:31536e6}),jc={ms:"millisecond",s:"second",m:"minute",h:"hour",d:"day",D:"date",w:"week",W:"isoWeek",M:"month",Q:"quarter",y:"year",DDD:"dayOfYear",e:"weekday",E:"isoWeekday",gg:"weekYear",GG:"isoWeekYear"},kc={dayofyear:"dayOfYear",isoweekday:"isoWeekday",isoweek:"isoWeek",weekyear:"weekYear",isoweekyear:"isoWeekYear"},lc={},mc={s:45,m:45,h:22,d:26,M:11},nc="DDD w W M D d".split(" "),oc="M D H h m s w W".split(" "),pc={M:function(){return this.month()+1},MMM:function(a){return this.localeData().monthsShort(this,a)},MMMM:function(a){return this.localeData().months(this,a)},D:function(){return this.date()},DDD:function(){return this.dayOfYear()},d:function(){return this.day()},dd:function(a){return this.localeData().weekdaysMin(this,a)},ddd:function(a){return this.localeData().weekdaysShort(this,a)},dddd:function(a){return this.localeData().weekdays(this,a)},w:function(){return this.week()},W:function(){return this.isoWeek()},YY:function(){return p(this.year()%100,2)},YYYY:function(){return p(this.year(),4)},YYYYY:function(){return p(this.year(),5)},YYYYYY:function(){var a=this.year(),b=a>=0?"+":"-";return b+p(Math.abs(a),6)},gg:function(){return p(this.weekYear()%100,2)},gggg:function(){return p(this.weekYear(),4)},ggggg:function(){return p(this.weekYear(),5)},GG:function(){return p(this.isoWeekYear()%100,2)},GGGG:function(){return p(this.isoWeekYear(),4)},GGGGG:function(){return p(this.isoWeekYear(),5)},e:function(){return this.weekday()},E:function(){return this.isoWeekday()},a:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!0)},A:function(){return this.localeData().meridiem(this.hours(),this.minutes(),!1)},H:function(){return this.hours()},h:function(){return this.hours()%12||12},m:function(){return this.minutes()},s:function(){return this.seconds()},S:function(){return A(this.milliseconds()/100)},SS:function(){return p(A(this.milliseconds()/10),2)},SSS:function(){return p(this.milliseconds(),3)},SSSS:function(){return p(this.milliseconds(),3)},Z:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+":"+p(A(a)%60,2)},ZZ:function(){var a=-this.zone(),b="+";return 0>a&&(a=-a,b="-"),b+p(A(a/60),2)+p(A(a)%60,2)},z:function(){return this.zoneAbbr()},zz:function(){return this.zoneName()},x:function(){return this.valueOf()},X:function(){return this.unix()},Q:function(){return this.quarter()}},qc={},rc=["months","monthsShort","weekdays","weekdaysShort","weekdaysMin"];nc.length;)vb=nc.pop(),pc[vb+"o"]=i(pc[vb],vb);for(;oc.length;)vb=oc.pop(),pc[vb+vb]=h(pc[vb],2);pc.DDDD=h(pc.DDD,3),m(j.prototype,{set:function(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)},_months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),months:function(a){return this._months[a.month()]},_monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),monthsShort:function(a){return this._monthsShort[a.month()]},monthsParse:function(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=tb.utc([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}},_weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdays:function(a){return this._weekdays[a.day()]},_weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysShort:function(a){return this._weekdaysShort[a.day()]},_weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),weekdaysMin:function(a){return this._weekdaysMin[a.day()]},weekdaysParse:function(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=tb([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b},_longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},longDateFormat:function(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b},isPM:function(a){return"p"===(a+"").toLowerCase().charAt(0)},_meridiemParse:/[ap]\.?m?\.?/i,meridiem:function(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"},_calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},calendar:function(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.apply(b,[c]):d},_relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},relativeTime:function(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)},pastFuture:function(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)},ordinal:function(a){return this._ordinal.replace("%d",a)},_ordinal:"%d",_ordinalParse:/\d{1,2}/,preparse:function(a){return a},postformat:function(a){return a},week:function(a){return hb(a,this._week.dow,this._week.doy).week},_week:{dow:0,doy:6},_invalidDate:"Invalid date",invalidDate:function(){return this._invalidDate}}),tb=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._i=b,g._f=c,g._l=e,g._strict=f,g._isUTC=!1,g._pf=d(),jb(g)},tb.suppressDeprecationWarnings=!1,tb.createFromInputFallback=f("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),tb.min=function(){var a=[].slice.call(arguments,0);return kb("isBefore",a)},tb.max=function(){var a=[].slice.call(arguments,0);return kb("isAfter",a)},tb.utc=function(b,c,e,f){var g;return"boolean"==typeof e&&(f=e,e=a),g={},g._isAMomentObject=!0,g._useUTC=!0,g._isUTC=!0,g._l=e,g._i=b,g._f=c,g._strict=f,g._pf=d(),jb(g).utc()},tb.unix=function(a){return tb(1e3*a)},tb.duration=function(a,b){var d,e,f,g,h=a,i=null;return tb.isDuration(a)?h={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(h={},b?h[b]=a:h.milliseconds=a):(i=Lb.exec(a))?(d="-"===i[1]?-1:1,h={y:0,d:A(i[Cb])*d,h:A(i[Db])*d,m:A(i[Eb])*d,s:A(i[Fb])*d,ms:A(i[Gb])*d}):(i=Mb.exec(a))?(d="-"===i[1]?-1:1,f=function(a){var b=a&&parseFloat(a.replace(",","."));return(isNaN(b)?0:b)*d},h={y:f(i[2]),M:f(i[3]),d:f(i[4]),h:f(i[5]),m:f(i[6]),s:f(i[7]),w:f(i[8])}):"object"==typeof h&&("from"in h||"to"in h)&&(g=r(tb(h.from),tb(h.to)),h={},h.ms=g.milliseconds,h.M=g.months),e=new l(h),tb.isDuration(a)&&c(a,"_locale")&&(e._locale=a._locale),e},tb.version=wb,tb.defaultFormat=ec,tb.ISO_8601=function(){},tb.momentProperties=Ib,tb.updateOffset=function(){},tb.relativeTimeThreshold=function(b,c){return mc[b]===a?!1:c===a?mc[b]:(mc[b]=c,!0)},tb.lang=f("moment.lang is deprecated. Use moment.locale instead.",function(a,b){return tb.locale(a,b)}),tb.locale=function(a,b){var c;return a&&(c="undefined"!=typeof b?tb.defineLocale(a,b):tb.localeData(a),c&&(tb.duration._locale=tb._locale=c)),tb._locale._abbr},tb.defineLocale=function(a,b){return null!==b?(b.abbr=a,Hb[a]||(Hb[a]=new j),Hb[a].set(b),tb.locale(a),Hb[a]):(delete Hb[a],null)},tb.langData=f("moment.langData is deprecated. Use moment.localeData instead.",function(a){return tb.localeData(a)}),tb.localeData=function(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return tb._locale;if(!u(a)){if(b=J(a))return b;a=[a]}return I(a)},tb.isMoment=function(a){return a instanceof k||null!=a&&c(a,"_isAMomentObject")},tb.isDuration=function(a){return a instanceof l};for(vb=rc.length-1;vb>=0;--vb)z(rc[vb]);tb.normalizeUnits=function(a){return x(a)},tb.invalid=function(a){var b=tb.utc(0/0);return null!=a?m(b._pf,a):b._pf.userInvalidated=!0,b},tb.parseZone=function(){return tb.apply(null,arguments).parseZone()},tb.parseTwoDigitYear=function(a){return A(a)+(A(a)>68?1900:2e3)},m(tb.fn=k.prototype,{clone:function(){return tb(this)},valueOf:function(){return+this._d+6e4*(this._offset||0)},unix:function(){return Math.floor(+this/1e3)},toString:function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},toDate:function(){return this._offset?new Date(+this):this._d},toISOString:function(){var a=tb(this).utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():N(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):N(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")},toArray:function(){var a=this;return[a.year(),a.month(),a.date(),a.hours(),a.minutes(),a.seconds(),a.milliseconds()]},isValid:function(){return G(this)},isDSTShifted:function(){return this._a?this.isValid()&&w(this._a,(this._isUTC?tb.utc(this._a):tb(this._a)).toArray())>0:!1},parsingFlags:function(){return m({},this._pf)},invalidAt:function(){return this._pf.overflow},utc:function(a){return this.zone(0,a)},local:function(a){return this._isUTC&&(this.zone(0,a),this._isUTC=!1,a&&this.add(this._dateTzOffset(),"m")),this},format:function(a){var b=N(this,a||tb.defaultFormat);return this.localeData().postformat(b)},add:s(1,"add"),subtract:s(-1,"subtract"),diff:function(a,b,c){var d,e,f,g=K(a,this),h=6e4*(this.zone()-g.zone());return b=x(b),"year"===b||"month"===b?(d=432e5*(this.daysInMonth()+g.daysInMonth()),e=12*(this.year()-g.year())+(this.month()-g.month()),f=this-tb(this).startOf("month")-(g-tb(g).startOf("month")),f-=6e4*(this.zone()-tb(this).startOf("month").zone()-(g.zone()-tb(g).startOf("month").zone())),e+=f/d,"year"===b&&(e/=12)):(d=this-g,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-h)/864e5:"week"===b?(d-h)/6048e5:d),c?e:o(e)},from:function(a,b){return tb.duration({to:this,from:a}).locale(this.locale()).humanize(!b)},fromNow:function(a){return this.from(tb(),a)},calendar:function(a){var b=a||tb(),c=K(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this,tb(b)))},isLeapYear:function(){return E(this.year())},isDST:function(){return this.zone()<this.clone().month(0).zone()||this.zone()<this.clone().month(5).zone()},day:function(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=eb(a,this.localeData()),this.add(a-b,"d")):b},month:ob("Month",!0),startOf:function(a){switch(a=x(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a?this.weekday(0):"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this},endOf:function(b){return b=x(b),b===a||"millisecond"===b?this:this.startOf(b).add(1,"isoWeek"===b?"week":b).subtract(1,"ms")},isAfter:function(a,b){var c;return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this>+a):(c=tb.isMoment(a)?+a:+tb(a),c<+this.clone().startOf(b))},isBefore:function(a,b){var c;return b=x("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+a>+this):(c=tb.isMoment(a)?+a:+tb(a),+this.clone().endOf(b)<c)},isSame:function(a,b){var c;return b=x(b||"millisecond"),"millisecond"===b?(a=tb.isMoment(a)?a:tb(a),+this===+a):(c=+tb(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))},min:f("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),this>a?this:a}),max:f("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(a){return a=tb.apply(null,arguments),a>this?this:a}),zone:function(a,b){var c,d=this._offset||0;return null==a?this._isUTC?d:this._dateTzOffset():("string"==typeof a&&(a=Q(a)),Math.abs(a)<16&&(a=60*a),!this._isUTC&&b&&(c=this._dateTzOffset()),this._offset=a,this._isUTC=!0,null!=c&&this.subtract(c,"m"),d!==a&&(!b||this._changeInProgress?t(this,tb.duration(d-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,tb.updateOffset(this,!0),this._changeInProgress=null)),this)},zoneAbbr:function(){return this._isUTC?"UTC":""},zoneName:function(){return this._isUTC?"Coordinated Universal Time":""},parseZone:function(){return this._tzm?this.zone(this._tzm):"string"==typeof this._i&&this.zone(this._i),this},hasAlignedHourOffset:function(a){return a=a?tb(a).zone():0,(this.zone()-a)%60===0},daysInMonth:function(){return B(this.year(),this.month())},dayOfYear:function(a){var b=yb((tb(this).startOf("day")-tb(this).startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")},quarter:function(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)},weekYear:function(a){var b=hb(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")},isoWeekYear:function(a){var b=hb(this,1,4).year;return null==a?b:this.add(a-b,"y")},week:function(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")},isoWeek:function(a){var b=hb(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")},weekday:function(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")},isoWeekday:function(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)},isoWeeksInYear:function(){return C(this.year(),1,4)},weeksInYear:function(){var a=this.localeData()._week;return C(this.year(),a.dow,a.doy)},get:function(a){return a=x(a),this[a]()},set:function(a,b){return a=x(a),"function"==typeof this[a]&&this[a](b),this},locale:function(b){var c;return b===a?this._locale._abbr:(c=tb.localeData(b),null!=c&&(this._locale=c),this)},lang:f("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(b){return b===a?this.localeData():this.locale(b)}),localeData:function(){return this._locale},_dateTzOffset:function(){return 15*Math.round(this._d.getTimezoneOffset()/15)}}),tb.fn.millisecond=tb.fn.milliseconds=ob("Milliseconds",!1),tb.fn.second=tb.fn.seconds=ob("Seconds",!1),tb.fn.minute=tb.fn.minutes=ob("Minutes",!1),tb.fn.hour=tb.fn.hours=ob("Hours",!0),tb.fn.date=ob("Date",!0),tb.fn.dates=f("dates accessor is deprecated. Use date instead.",ob("Date",!0)),tb.fn.year=ob("FullYear",!0),tb.fn.years=f("years accessor is deprecated. Use year instead.",ob("FullYear",!0)),tb.fn.days=tb.fn.day,tb.fn.months=tb.fn.month,tb.fn.weeks=tb.fn.week,tb.fn.isoWeeks=tb.fn.isoWeek,tb.fn.quarters=tb.fn.quarter,tb.fn.toJSON=tb.fn.toISOString,m(tb.duration.fn=l.prototype,{_bubble:function(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;g.milliseconds=d%1e3,a=o(d/1e3),g.seconds=a%60,b=o(a/60),g.minutes=b%60,c=o(b/60),g.hours=c%24,e+=o(c/24),h=o(pb(e)),e-=o(qb(h)),f+=o(e/30),e%=30,h+=o(f/12),f%=12,g.days=e,g.months=f,g.years=h},abs:function(){return this._milliseconds=Math.abs(this._milliseconds),this._days=Math.abs(this._days),this._months=Math.abs(this._months),this._data.milliseconds=Math.abs(this._data.milliseconds),this._data.seconds=Math.abs(this._data.seconds),this._data.minutes=Math.abs(this._data.minutes),this._data.hours=Math.abs(this._data.hours),this._data.months=Math.abs(this._data.months),this._data.years=Math.abs(this._data.years),this},weeks:function(){return o(this.days()/7)},valueOf:function(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*A(this._months/12)},humanize:function(a){var b=gb(this,!a,this.localeData());return a&&(b=this.localeData().pastFuture(+this,b)),this.localeData().postformat(b)},add:function(a,b){var c=tb.duration(a,b);return this._milliseconds+=c._milliseconds,this._days+=c._days,this._months+=c._months,this._bubble(),this},subtract:function(a,b){var c=tb.duration(a,b);return this._milliseconds-=c._milliseconds,this._days-=c._days,this._months-=c._months,this._bubble(),this},get:function(a){return a=x(a),this[a.toLowerCase()+"s"]()},as:function(a){var b,c;if(a=x(a),"month"===a||"year"===a)return b=this._days+this._milliseconds/864e5,c=this._months+12*pb(b),"month"===a?c:c/12;switch(b=this._days+Math.round(qb(this._months/12)),a){case"week":return b/7+this._milliseconds/6048e5;case"day":return b+this._milliseconds/864e5;case"hour":return 24*b+this._milliseconds/36e5;case"minute":return 24*b*60+this._milliseconds/6e4;case"second":return 24*b*60*60+this._milliseconds/1e3;
2304 case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in ic)c(ic,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}).call(this);
2304 case"millisecond":return Math.floor(24*b*60*60*1e3)+this._milliseconds;default:throw new Error("Unknown unit "+a)}},lang:tb.fn.lang,locale:tb.fn.locale,toIsoString:f("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",function(){return this.toISOString()}),toISOString:function(){var a=Math.abs(this.years()),b=Math.abs(this.months()),c=Math.abs(this.days()),d=Math.abs(this.hours()),e=Math.abs(this.minutes()),f=Math.abs(this.seconds()+this.milliseconds()/1e3);return this.asSeconds()?(this.asSeconds()<0?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"},localeData:function(){return this._locale}}),tb.duration.fn.toString=tb.duration.fn.toISOString;for(vb in ic)c(ic,vb)&&rb(vb.toLowerCase());tb.duration.fn.asMilliseconds=function(){return this.as("ms")},tb.duration.fn.asSeconds=function(){return this.as("s")},tb.duration.fn.asMinutes=function(){return this.as("m")},tb.duration.fn.asHours=function(){return this.as("h")},tb.duration.fn.asDays=function(){return this.as("d")},tb.duration.fn.asWeeks=function(){return this.as("weeks")},tb.duration.fn.asMonths=function(){return this.as("M")},tb.duration.fn.asYears=function(){return this.as("y")},tb.locale("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===A(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),Jb?module.exports=tb:"function"==typeof define&&define.amd?(define("moment",function(a,b,c){return c.config&&c.config()&&c.config().noGlobal===!0&&(xb.moment=ub),tb}),sb(!0)):sb()}).call(this);
2305 ;!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null===n?0/0:+n}function e(n){return!isNaN(n)}function r(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function u(n){return n.length}function i(n){for(var t=1;n*t%1;)t*=10;return t}function o(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function a(){this._=Object.create(null)}function c(n){return(n+="")===da||n[0]===ma?ma+n:n}function l(n){return(n+="")[0]===ma?n.slice(1):n}function s(n){return c(n)in this._}function f(n){return(n=c(n))in this._&&delete this._[n]}function h(){var n=[];for(var t in this._)n.push(l(t));return n}function g(){var n=0;for(var t in this._)++n;return n}function p(){for(var n in this._)return!1;return!0}function v(){this._=Object.create(null)}function d(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function m(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=ya.length;r>e;++e){var u=ya[e]+t;if(u in n)return u}}function y(){}function M(){}function x(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new a;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function b(){ta.event.preventDefault()}function _(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function w(n){for(var t=new M,e=0,r=arguments.length;++e<r;)t[arguments[e]]=x(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function S(n){return xa(n,ka),n}function k(n){return"function"==typeof n?n:function(){return ba(n,this)}}function E(n){return"function"==typeof n?n:function(){return _a(n,this)}}function A(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function N(n){return n.trim().replace(/\s+/g," ")}function C(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function z(n){return(n+"").trim().split(/^|\s+/)}function q(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=z(n).map(L);var u=n.length;return"function"==typeof t?r:e}function L(n){var t=C(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",N(u+" "+n))):e.setAttribute("class",N(u.replace(t," ")))}}function T(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function R(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function D(n){return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function P(){var n=this.parentNode;n&&n.removeChild(this)}function U(n){return{__data__:n}}function j(n){return function(){return Sa(this,n)}}function F(t){return arguments.length||(t=n),function(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}}function H(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function O(n){return xa(n,Aa),n}function Y(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function I(n){var t=n.__transition__;t&&++t.active}function Z(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=V;a>0&&(n=n.slice(0,a));var l=Ca.get(n);return l&&(n=l,c=X),a?t?u:r:t?y:i}function V(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function X(n,t){var e=V(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function $(){var n=".dragsuppress-"+ ++qa,t="click"+n,e=ta.select(oa).on("touchmove"+n,b).on("dragstart"+n,b).on("selectstart"+n,b);if(za){var r=ia.style,u=r[za];r[za]="none"}return function(i){if(e.on(n,null),za&&(r[za]=u),i){var o=function(){e.on(t,null)};e.on(t,function(){b(),o()},!0),setTimeout(o,0)}}}function B(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>La&&(oa.scrollX||oa.scrollY)){e=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();La=!(u.f||u.e),e.remove()}return La?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function W(){return ta.event.changedTouches[0].identifier}function J(){return ta.event.target}function G(){return oa}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?Da:Math.acos(n)}function tt(n){return n>1?ja:-1>n?-ja:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Fa)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Ja,r=pt(r)*Ga,i=pt(i)*Ka,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Ha,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,255&n>>8,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=tc.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Ja),u=vt((.2126729*n+.7151522*t+.072175*e)/Ga),i=vt((.0193339*n+.119192*t+.9503041*e)/Ka);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return n}function Nt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Ct(t,e,n,r)}}function Ct(n,t,e,r){function u(){var n,t=c.status;if(!t&&qt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!oa.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(zt(r))}function zt(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function qt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function Lt(){var n=Tt(),t=Rt()-n;t>24?(isFinite(t)&&(clearTimeout(ic),ic=setTimeout(Lt,t)),uc=0):(uc=1,ac(Lt))}function Tt(){var n=Date.now();for(oc=ec;oc;)n>=oc.t&&(oc.f=oc.c(n-oc.t)),oc=oc.n;return n}function Rt(){for(var n,t=ec,e=1/0;t;)t.f?t=n?n.n=t.n:ec=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return rc=n,e}function Dt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Pt(n,t){var e=Math.pow(10,3*va(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Ut(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:At;return function(n){var e=lc.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=sc.get(g)||jt;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function jt(n){return n+""}function Ft(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new hc(e-1)),1),e}function i(n,e){return t(n=new hc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{hc=Ft;var r=new Ft;return r._=n,o(r,t,e)}finally{hc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ot(n);return c.floor=c,c.round=Ot(r),c.ceil=Ot(u),c.offset=Ot(i),c.range=a,n}function Ot(n){return function(t,e){try{hc=Ft;var r=new Ft;return r._=t,n(r,e)._}finally{hc=Date}}}function Yt(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=pc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&hc!==Ft,o=new(i?Ft:hc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(0|r.Z/100),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in pc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{hc=Ft;var t=new hc;return t._=n,r(t)}finally{hc=Date}}var r=t(n);return e.parse=function(n){try{hc=Ft;var t=r.parse(n);return t&&t._}finally{hc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ce;var M=ta.map(),x=Zt(v),b=Vt(v),_=Zt(d),w=Vt(d),S=Zt(m),k=Vt(m),E=Zt(y),A=Vt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+fc.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(fc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(fc.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:oe,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:ne,e:ne,H:ee,I:ee,j:te,L:ie,m:Qt,M:re,p:s,S:ue,U:$t,w:Xt,W:Bt,x:c,X:l,y:Jt,Y:Wt,Z:Gt,"%":ae};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Zt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Vt(n){for(var t=new a,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Xt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function $t(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Bt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Wt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Jt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.y=Kt(+r[0]),e+r[0].length):-1}function Gt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Kt(n){return n+(n>68?1900:2e3)}function Qt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function ne(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function te(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ee(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function re(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ue(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ie(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function oe(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=0|va(t)/60,u=va(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function ae(n,t,e){dc.lastIndex=0;var r=dc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ce(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function le(){}function se(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function fe(n,t){n&&xc.hasOwnProperty(n.type)&&xc[n.type](n,t)}function he(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function ge(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)he(n[e],t,1);t.polygonEnd()}function pe(){function n(n,t){n*=Fa,t=t*Fa/2+Da/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);_c.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;wc.point=function(o,a){wc.point=n,r=(t=o)*Fa,u=Math.cos(a=(e=a)*Fa/2+Da/4),i=Math.sin(a)},wc.lineEnd=function(){n(t,e)}}function ve(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function de(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function me(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ye(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Me(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function xe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function be(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function _e(n,t){return va(n[0]-t[0])<Ta&&va(n[1]-t[1])<Ta}function we(n,t){n*=Fa;var e=Math.cos(t*=Fa);Se(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function Se(n,t,e){++Sc,Ec+=(n-Ec)/Sc,Ac+=(t-Ac)/Sc,Nc+=(e-Nc)/Sc}function ke(){function n(n,u){n*=Fa;var i=Math.cos(u*=Fa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);kc+=l,Cc+=l*(t+(t=o)),zc+=l*(e+(e=a)),qc+=l*(r+(r=c)),Se(t,e,r)}var t,e,r;Dc.point=function(u,i){u*=Fa;var o=Math.cos(i*=Fa);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),Dc.point=n,Se(t,e,r)}}function Ee(){Dc.point=we}function Ae(){function n(n,t){n*=Fa;var e=Math.cos(t*=Fa),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Lc+=p*l,Tc+=p*s,Rc+=p*f,kc+=v,Cc+=v*(r+(r=o)),zc+=v*(u+(u=a)),qc+=v*(i+(i=c)),Se(r,u,i)}var t,e,r,u,i;Dc.point=function(o,a){t=o,e=a,Dc.point=n,o*=Fa;var c=Math.cos(a*=Fa);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),Se(r,u,i)},Dc.lineEnd=function(){n(t,e),Dc.lineEnd=Ee,Dc.point=we}}function Ne(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ce(){return!0}function ze(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(_e(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Le(e,n,null,!0),l=new Le(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new Le(r,n,null,!1),l=new Le(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),qe(i),qe(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qe(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Le(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Te(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Re))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=He(m,p);g.length?(b||(i.polygonStart(),b=!0),ze(g,Pe,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=De(),x=t(M),b=!1;return y}}function Re(n){return n.length>1}function De(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:y,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Pe(n,t){return((n=n.x)[0]<0?n[1]-ja-Ta:ja-n[1])-((t=t.x)[0]<0?t[1]-ja-Ta:ja-t[1])}function Ue(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?Da:-Da,c=va(i-e);va(c-Da)<Ta?(n.point(e,r=(r+o)/2>0?ja:-ja),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=Da&&(va(e-u)<Ta&&(e-=u*Ta),va(i-a)<Ta&&(i-=a*Ta),r=je(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function je(n,t,e,r){var u,i,o=Math.sin(n-e);return va(o)>Ta?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Fe(n,t,e,r){var u;if(null==n)u=e*ja,r.point(-Da,u),r.point(0,u),r.point(Da,u),r.point(Da,0),r.point(Da,-u),r.point(0,-u),r.point(-Da,-u),r.point(-Da,0),r.point(-Da,u);else if(va(n[0]-t[0])>Ta){var i=n[0]<t[0]?Da:-Da;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function He(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;_c.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+Da/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+Da/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>Da,k=p*M;if(_c.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*Pa:b,S^h>=e^m>=e){var E=me(ve(f),ve(n));xe(E);var A=me(u,E);xe(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ta>i||Ta>i&&0>_c)^1&o}function Oe(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?Da:-Da),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(_e(e,g)||_e(p,g))&&(p[0]+=Ta,p[1]+=Ta,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&_e(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=ve(n),u=ve(t),o=[1,0,0],a=me(r,u),c=de(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=me(o,a),p=Me(o,f),v=Me(a,h);ye(p,v);var d=g,m=de(p,d),y=de(d,d),M=m*m-y*(de(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=Me(d,(-m-x)/y);if(ye(b,p),b=be(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=va(A-Da)<Ta,C=N||Ta>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(va(b[0]-w)<Ta?k:E):k<=b[1]&&b[1]<=E:A>Da^(w<=b[0]&&b[0]<=S)){var z=Me(d,(-m+x)/y);return ye(z,p),[b,be(z)]}}}function u(t,e){var r=o?n:Da-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=va(i)>Ta,c=pr(n,6*Fa);return Te(t,e,c,o?[0,-n]:[-Da,n-Da])}function Ye(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return va(r[0]-n)<Ta?u>0?0:3:va(r[0]-e)<Ta?u>0?2:1:va(r[1]-t)<Ta?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Uc,Math.min(Uc,n)),t=Math.max(-Uc,Math.min(Uc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=De(),N=Ye(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&ze(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ze(n){var t=0,e=Da/3,r=or(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*Da/180,e=n[1]*Da/180):[180*(t/Da),180*(e/Da)]},u}function Ve(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Xe(){function n(n,t){Fc+=u*n-r*t,r=n,u=t}var t,e,r,u;Zc.point=function(i,o){Zc.point=n,t=r=i,e=u=o},Zc.lineEnd=function(){n(t,e)}}function $e(n,t){Hc>n&&(Hc=n),n>Yc&&(Yc=n),Oc>t&&(Oc=t),t>Ic&&(Ic=t)}function Be(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=We(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=We(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function We(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Je(n,t){Ec+=n,Ac+=t,++Nc}function Ge(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);Cc+=o*(t+n)/2,zc+=o*(e+r)/2,qc+=o,Je(t=n,e=r)}var t,e;Xc.point=function(r,u){Xc.point=n,Je(t=r,e=u)}}function Ke(){Xc.point=Je}function Qe(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);Cc+=o*(r+n)/2,zc+=o*(u+t)/2,qc+=o,o=u*n-r*t,Lc+=o*(r+n),Tc+=o*(u+t),Rc+=3*o,Je(r=n,u=t)}var t,e,r,u;Xc.point=function(i,o){Xc.point=n,Je(t=r=i,e=u=o)},Xc.lineEnd=function(){n(t,e)}}function nr(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Pa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:y};return a}function tr(n){function t(n){return(a?r:e)(n)}function e(t){return ur(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=ve([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=va(va(w)-1)<Ta||va(r-h)<Ta?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;
2305 ;!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null===n?0/0:+n}function e(n){return!isNaN(n)}function r(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function u(n){return n.length}function i(n){for(var t=1;n*t%1;)t*=10;return t}function o(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function a(){this._=Object.create(null)}function c(n){return(n+="")===da||n[0]===ma?ma+n:n}function l(n){return(n+="")[0]===ma?n.slice(1):n}function s(n){return c(n)in this._}function f(n){return(n=c(n))in this._&&delete this._[n]}function h(){var n=[];for(var t in this._)n.push(l(t));return n}function g(){var n=0;for(var t in this._)++n;return n}function p(){for(var n in this._)return!1;return!0}function v(){this._=Object.create(null)}function d(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function m(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=ya.length;r>e;++e){var u=ya[e]+t;if(u in n)return u}}function y(){}function M(){}function x(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new a;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function b(){ta.event.preventDefault()}function _(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function w(n){for(var t=new M,e=0,r=arguments.length;++e<r;)t[arguments[e]]=x(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function S(n){return xa(n,ka),n}function k(n){return"function"==typeof n?n:function(){return ba(n,this)}}function E(n){return"function"==typeof n?n:function(){return _a(n,this)}}function A(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function N(n){return n.trim().replace(/\s+/g," ")}function C(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function z(n){return(n+"").trim().split(/^|\s+/)}function q(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=z(n).map(L);var u=n.length;return"function"==typeof t?r:e}function L(n){var t=C(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",N(u+" "+n))):e.setAttribute("class",N(u.replace(t," ")))}}function T(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function R(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function D(n){return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?function(){return this.ownerDocument.createElementNS(n.space,n.local)}:function(){return this.ownerDocument.createElementNS(this.namespaceURI,n)}}function P(){var n=this.parentNode;n&&n.removeChild(this)}function U(n){return{__data__:n}}function j(n){return function(){return Sa(this,n)}}function F(t){return arguments.length||(t=n),function(n,e){return n&&e?t(n.__data__,e.__data__):!n-!e}}function H(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function O(n){return xa(n,Aa),n}function Y(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function I(n){var t=n.__transition__;t&&++t.active}function Z(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=V;a>0&&(n=n.slice(0,a));var l=Ca.get(n);return l&&(n=l,c=X),a?t?u:r:t?y:i}function V(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function X(n,t){var e=V(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function $(){var n=".dragsuppress-"+ ++qa,t="click"+n,e=ta.select(oa).on("touchmove"+n,b).on("dragstart"+n,b).on("selectstart"+n,b);if(za){var r=ia.style,u=r[za];r[za]="none"}return function(i){if(e.on(n,null),za&&(r[za]=u),i){var o=function(){e.on(t,null)};e.on(t,function(){b(),o()},!0),setTimeout(o,0)}}}function B(n,t){t.changedTouches&&(t=t.changedTouches[0]);var e=n.ownerSVGElement||n;if(e.createSVGPoint){var r=e.createSVGPoint();if(0>La&&(oa.scrollX||oa.scrollY)){e=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var u=e[0][0].getScreenCTM();La=!(u.f||u.e),e.remove()}return La?(r.x=t.pageX,r.y=t.pageY):(r.x=t.clientX,r.y=t.clientY),r=r.matrixTransform(n.getScreenCTM().inverse()),[r.x,r.y]}var i=n.getBoundingClientRect();return[t.clientX-i.left-n.clientLeft,t.clientY-i.top-n.clientTop]}function W(){return ta.event.changedTouches[0].identifier}function J(){return ta.event.target}function G(){return oa}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?Da:Math.acos(n)}function tt(n){return n>1?ja:-1>n?-ja:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Fa)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Ja,r=pt(r)*Ga,i=pt(i)*Ka,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Ha,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,255&n>>8,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=tc.get(n))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Ja),u=vt((.2126729*n+.7151522*t+.072175*e)/Ga),i=vt((.0193339*n+.119192*t+.9503041*e)/Ka);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return n}function Nt(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Ct(t,e,n,r)}}function Ct(n,t,e,r){function u(){var n,t=c.status;if(!t&&qt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return o.error.call(i,r),void 0}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!oa.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(zt(r))}function zt(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function qt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function Lt(){var n=Tt(),t=Rt()-n;t>24?(isFinite(t)&&(clearTimeout(ic),ic=setTimeout(Lt,t)),uc=0):(uc=1,ac(Lt))}function Tt(){var n=Date.now();for(oc=ec;oc;)n>=oc.t&&(oc.f=oc.c(n-oc.t)),oc=oc.n;return n}function Rt(){for(var n,t=ec,e=1/0;t;)t.f?t=n?n.n=t.n:ec=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return rc=n,e}function Dt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Pt(n,t){var e=Math.pow(10,3*va(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Ut(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:At;return function(n){var e=lc.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=sc.get(g)||jt;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function jt(n){return n+""}function Ft(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ht(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new hc(e-1)),1),e}function i(n,e){return t(n=new hc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{hc=Ft;var r=new Ft;return r._=n,o(r,t,e)}finally{hc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ot(n);return c.floor=c,c.round=Ot(r),c.ceil=Ot(u),c.offset=Ot(i),c.range=a,n}function Ot(n){return function(t,e){try{hc=Ft;var r=new Ft;return r._=t,n(r,e)._}finally{hc=Date}}}function Yt(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=pc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&hc!==Ft,o=new(i?Ft:hc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(0|r.Z/100),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in pc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{hc=Ft;var t=new hc;return t._=n,r(t)}finally{hc=Date}}var r=t(n);return e.parse=function(n){try{hc=Ft;var t=r.parse(n);return t&&t._}finally{hc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ce;var M=ta.map(),x=Zt(v),b=Vt(v),_=Zt(d),w=Vt(d),S=Zt(m),k=Vt(m),E=Zt(y),A=Vt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+fc.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(fc.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(fc.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:oe,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:ne,e:ne,H:ee,I:ee,j:te,L:ie,m:Qt,M:re,p:s,S:ue,U:$t,w:Xt,W:Bt,x:c,X:l,y:Jt,Y:Wt,Z:Gt,"%":ae};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Zt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Vt(n){for(var t=new a,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Xt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function $t(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function Bt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Wt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Jt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.y=Kt(+r[0]),e+r[0].length):-1}function Gt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Kt(n){return n+(n>68?1900:2e3)}function Qt(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function ne(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function te(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function ee(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function re(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function ue(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ie(n,t,e){vc.lastIndex=0;var r=vc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function oe(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=0|va(t)/60,u=va(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function ae(n,t,e){dc.lastIndex=0;var r=dc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ce(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function le(){}function se(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function fe(n,t){n&&xc.hasOwnProperty(n.type)&&xc[n.type](n,t)}function he(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function ge(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)he(n[e],t,1);t.polygonEnd()}function pe(){function n(n,t){n*=Fa,t=t*Fa/2+Da/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);_c.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;wc.point=function(o,a){wc.point=n,r=(t=o)*Fa,u=Math.cos(a=(e=a)*Fa/2+Da/4),i=Math.sin(a)},wc.lineEnd=function(){n(t,e)}}function ve(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function de(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function me(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function ye(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function Me(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function xe(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function be(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function _e(n,t){return va(n[0]-t[0])<Ta&&va(n[1]-t[1])<Ta}function we(n,t){n*=Fa;var e=Math.cos(t*=Fa);Se(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function Se(n,t,e){++Sc,Ec+=(n-Ec)/Sc,Ac+=(t-Ac)/Sc,Nc+=(e-Nc)/Sc}function ke(){function n(n,u){n*=Fa;var i=Math.cos(u*=Fa),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);kc+=l,Cc+=l*(t+(t=o)),zc+=l*(e+(e=a)),qc+=l*(r+(r=c)),Se(t,e,r)}var t,e,r;Dc.point=function(u,i){u*=Fa;var o=Math.cos(i*=Fa);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),Dc.point=n,Se(t,e,r)}}function Ee(){Dc.point=we}function Ae(){function n(n,t){n*=Fa;var e=Math.cos(t*=Fa),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Lc+=p*l,Tc+=p*s,Rc+=p*f,kc+=v,Cc+=v*(r+(r=o)),zc+=v*(u+(u=a)),qc+=v*(i+(i=c)),Se(r,u,i)}var t,e,r,u,i;Dc.point=function(o,a){t=o,e=a,Dc.point=n,o*=Fa;var c=Math.cos(a*=Fa);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),Se(r,u,i)},Dc.lineEnd=function(){n(t,e),Dc.lineEnd=Ee,Dc.point=we}}function Ne(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ce(){return!0}function ze(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(_e(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return u.lineEnd(),void 0}var c=new Le(e,n,null,!0),l=new Le(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new Le(r,n,null,!1),l=new Le(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),qe(i),qe(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function qe(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function Le(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Te(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Re))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=He(m,p);g.length?(b||(i.polygonStart(),b=!0),ze(g,Pe,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=De(),x=t(M),b=!1;return y}}function Re(n){return n.length>1}function De(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:y,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function Pe(n,t){return((n=n.x)[0]<0?n[1]-ja-Ta:ja-n[1])-((t=t.x)[0]<0?t[1]-ja-Ta:ja-t[1])}function Ue(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?Da:-Da,c=va(i-e);va(c-Da)<Ta?(n.point(e,r=(r+o)/2>0?ja:-ja),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=Da&&(va(e-u)<Ta&&(e-=u*Ta),va(i-a)<Ta&&(i-=a*Ta),r=je(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function je(n,t,e,r){var u,i,o=Math.sin(n-e);return va(o)>Ta?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function Fe(n,t,e,r){var u;if(null==n)u=e*ja,r.point(-Da,u),r.point(0,u),r.point(Da,u),r.point(Da,0),r.point(Da,-u),r.point(0,-u),r.point(-Da,-u),r.point(-Da,0),r.point(-Da,u);else if(va(n[0]-t[0])>Ta){var i=n[0]<t[0]?Da:-Da;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function He(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;_c.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+Da/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+Da/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>Da,k=p*M;if(_c.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*Pa:b,S^h>=e^m>=e){var E=me(ve(f),ve(n));xe(E);var A=me(u,E);xe(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ta>i||Ta>i&&0>_c)^1&o}function Oe(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?Da:-Da),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(_e(e,g)||_e(p,g))&&(p[0]+=Ta,p[1]+=Ta,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&_e(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=ve(n),u=ve(t),o=[1,0,0],a=me(r,u),c=de(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=me(o,a),p=Me(o,f),v=Me(a,h);ye(p,v);var d=g,m=de(p,d),y=de(d,d),M=m*m-y*(de(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=Me(d,(-m-x)/y);if(ye(b,p),b=be(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=va(A-Da)<Ta,C=N||Ta>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(va(b[0]-w)<Ta?k:E):k<=b[1]&&b[1]<=E:A>Da^(w<=b[0]&&b[0]<=S)){var z=Me(d,(-m+x)/y);return ye(z,p),[b,be(z)]}}}function u(t,e){var r=o?n:Da-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=va(i)>Ta,c=pr(n,6*Fa);return Te(t,e,c,o?[0,-n]:[-Da,n-Da])}function Ye(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return va(r[0]-n)<Ta?u>0?0:3:va(r[0]-e)<Ta?u>0?2:1:va(r[1]-t)<Ta?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Uc,Math.min(Uc,n)),t=Math.max(-Uc,Math.min(Uc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=De(),N=Ye(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&ze(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ze(n){var t=0,e=Da/3,r=or(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*Da/180,e=n[1]*Da/180):[180*(t/Da),180*(e/Da)]},u}function Ve(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Xe(){function n(n,t){Fc+=u*n-r*t,r=n,u=t}var t,e,r,u;Zc.point=function(i,o){Zc.point=n,t=r=i,e=u=o},Zc.lineEnd=function(){n(t,e)}}function $e(n,t){Hc>n&&(Hc=n),n>Yc&&(Yc=n),Oc>t&&(Oc=t),t>Ic&&(Ic=t)}function Be(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=We(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=We(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function We(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function Je(n,t){Ec+=n,Ac+=t,++Nc}function Ge(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);Cc+=o*(t+n)/2,zc+=o*(e+r)/2,qc+=o,Je(t=n,e=r)}var t,e;Xc.point=function(r,u){Xc.point=n,Je(t=r,e=u)}}function Ke(){Xc.point=Je}function Qe(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);Cc+=o*(r+n)/2,zc+=o*(u+t)/2,qc+=o,o=u*n-r*t,Lc+=o*(r+n),Tc+=o*(u+t),Rc+=3*o,Je(r=n,u=t)}var t,e,r,u;Xc.point=function(i,o){Xc.point=n,Je(t=r=i,e=u=o)},Xc.lineEnd=function(){n(t,e)}}function nr(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,Pa)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:y};return a}function tr(n){function t(n){return(a?r:e)(n)}function e(t){return ur(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=ve([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=va(va(w)-1)<Ta||va(r-h)<Ta?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;
2306 (L*L/x>i||va((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Fa),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function er(n){var t=tr(function(t,e){return n([t*Ha,e*Ha])});return function(n){return ar(t(n))}}function rr(n){this.stream=n}function ur(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ir(n){return or(function(){return n})()}function or(n){function t(n){return n=a(n[0]*Fa,n[1]*Fa),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Ha,n[1]*Ha]}function r(){a=Ne(o=sr(m,y,M),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=tr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,M=0,x=Pc,b=At,_=null,w=null;return t.stream=function(n){return s&&(s.valid=!1),s=ar(x(o,f(b(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(x=null==n?(_=n,Pc):Oe((_=+n)*Fa),u()):_},t.clipExtent=function(n){return arguments.length?(w=n,b=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):At,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Fa,d=n[1]%360*Fa,r()):[v*Ha,d*Ha]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Fa,y=n[1]%360*Fa,M=n.length>2?n[2]%360*Fa:0,r()):[m*Ha,y*Ha,M*Ha]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function ar(n){return ur(n,function(t,e){n.point(t*Fa,e*Fa)})}function cr(n,t){return[n,t]}function lr(n,t){return[n>Da?n-Pa:-Da>n?n+Pa:n,t]}function sr(n,t,e){return n?t||e?Ne(hr(n),gr(t,e)):hr(n):t||e?gr(t,e):lr}function fr(n){return function(t,e){return t+=n,[t>Da?t-Pa:-Da>t?t+Pa:t,e]}}function hr(n){var t=fr(n);return t.invert=fr(-n),t}function gr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function pr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=vr(e,u),i=vr(e,i),(o>0?i>u:u>i)&&(u+=o*Pa)):(u=n+o*Pa,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=be([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function vr(n,t){var e=ve(t);e[0]-=n,xe(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ta)%(2*Math.PI)}function dr(n,t,e){var r=ta.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function mr(n,t,e){var r=ta.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function yr(n){return n.source}function Mr(n){return n.target}function xr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ha,Math.atan2(o,Math.sqrt(r*r+u*u))*Ha]}:function(){return[n*Ha,t*Ha]};return p.distance=h,p}function br(){function n(n,u){var i=Math.sin(u*=Fa),o=Math.cos(u),a=va((n*=Fa)-t),c=Math.cos(a);$c+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Bc.point=function(u,i){t=u*Fa,e=Math.sin(i*=Fa),r=Math.cos(i),Bc.point=n},Bc.lineEnd=function(){Bc.point=Bc.lineEnd=y}}function _r(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function wr(n,t){function e(n,t){o>0?-ja+Ta>t&&(t=-ja+Ta):t>ja-Ta&&(t=ja-Ta);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(Da/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-ja]},e):kr}function Sr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return va(u)<Ta?cr:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function kr(n,t){return[n,Math.log(Math.tan(Da/4+t/2))]}function Er(n){var t,e=ir(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=Da*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ar(n,t){return[Math.log(Math.tan(Da/4+t/2)),-n]}function Nr(n){return n[0]}function Cr(n){return n[1]}function zr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qr(n,t){return n[0]-t[0]||n[1]-t[1]}function Lr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Tr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Rr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Dr(){eu(this),this.edge=this.site=this.circle=null}function Pr(n){var t=ol.pop()||new Dr;return t.site=n,t}function Ur(n){$r(n),rl.remove(n),ol.push(n),eu(n)}function jr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Ur(n);for(var c=i;c.circle&&va(e-c.circle.x)<Ta&&va(r-c.circle.cy)<Ta;)i=c.P,a.unshift(c),Ur(c),c=i;a.unshift(c),$r(c);for(var l=o;l.circle&&va(e-l.circle.x)<Ta&&va(r-l.circle.cy)<Ta;)o=l.N,a.push(l),Ur(l),l=o;a.push(l),$r(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Qr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Gr(c.site,l.site,null,u),Xr(c),Xr(l)}function Fr(n){for(var t,e,r,u,i=n.x,o=n.y,a=rl._;a;)if(r=Hr(a,o)-i,r>Ta)a=a.L;else{if(u=i-Or(a,o),!(u>Ta)){r>-Ta?(t=a.P,e=a):u>-Ta?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Pr(n);if(rl.insert(t,c),t||e){if(t===e)return $r(t),e=Pr(t.site),rl.insert(c,e),c.edge=e.edge=Gr(t.site,c.site),Xr(t),Xr(e),void 0;if(!e)return c.edge=Gr(t.site,c.site),void 0;$r(t),$r(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Qr(e.edge,l,p,x),c.edge=Gr(l,n,null,x),e.edge=Gr(n,p,null,x),Xr(t),Xr(e)}}function Hr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Or(n,t){var e=n.N;if(e)return Hr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Yr(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=el,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(va(r-t)>Ta||va(u-e)>Ta)&&(a.splice(o,0,new nu(Kr(i.site,s,va(r-f)<Ta&&p-u>Ta?{x:f,y:va(t-f)<Ta?e:p}:va(u-p)<Ta&&h-r>Ta?{x:va(e-p)<Ta?t:h,y:p}:va(r-h)<Ta&&u-g>Ta?{x:h,y:va(t-h)<Ta?e:g}:va(u-g)<Ta&&r-f>Ta?{x:va(e-g)<Ta?t:f,y:g}:null),i.site,null)),++c)}function Zr(n,t){return t.angle-n.angle}function Vr(){eu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Xr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-Ra)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=al.pop()||new Vr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=il._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}il.insert(y,m),y||(ul=m)}}}}function $r(n){var t=n.circle;t&&(t.P||(ul=t.N),il.remove(t),al.push(t),eu(t),n.circle=null)}function Br(n){for(var t,e=tl,r=Ye(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Wr(t,n)||!r(t)||va(t.a.x-t.b.x)<Ta&&va(t.a.y-t.b.y)<Ta)&&(t.a=t.b=null,e.splice(u,1))}function Wr(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Jr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Gr(n,t,e,r){var u=new Jr(n,t);return tl.push(u),e&&Qr(u,n,t,e),r&&Qr(u,t,n,r),el[n.i].edges.push(new nu(u,n,t)),el[t.i].edges.push(new nu(u,t,n)),u}function Kr(n,t,e){var r=new Jr(n,null);return r.a=t,r.b=e,tl.push(r),r}function Qr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function nu(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function tu(){this._=null}function eu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ru(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function uu(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function iu(n){for(;n.L;)n=n.L;return n}function ou(n,t){var e,r,u,i=n.sort(au).pop();for(tl=[],el=new Array(n.length),rl=new tu,il=new tu;;)if(u=ul,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(el[i.i]=new Yr(i),Fr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;jr(u.arc)}t&&(Br(t),Ir(t));var o={cells:el,edges:tl};return rl=il=tl=el=null,o}function au(n,t){return t.y-n.y||t.x-n.x}function cu(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function lu(n){return n.x}function su(n){return n.y}function fu(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function hu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&hu(n,c[0],e,r,o,a),c[1]&&hu(n,c[1],o,r,u,a),c[2]&&hu(n,c[2],e,a,o,i),c[3]&&hu(n,c[3],o,a,u,i)}}function gu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-p[0],d=e-p[1],m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function pu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function vu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=yu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function du(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mu(n,t){var e,r,u,i=ll.lastIndex=sl.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=ll.exec(n))&&(r=sl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:du(e,r)})),i=sl.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function yu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function Mu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(yu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function xu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function bu(n){return function(t){return 1-n(1-t)}}function _u(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function wu(n){return n*n}function Su(n){return n*n*n}function ku(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Eu(n){return function(t){return Math.pow(t,n)}}function Au(n){return 1-Math.cos(n*ja)}function Nu(n){return Math.pow(2,10*(n-1))}function Cu(n){return 1-Math.sqrt(1-n*n)}function zu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Pa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Pa/t)}}function qu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Lu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Tu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Pu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Uu(n){var t=[n.a,n.b],e=[n.c,n.d],r=Fu(t),u=ju(t,e),i=Fu(Hu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ha,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ha:0}function ju(n,t){return n[0]*t[0]+n[1]*t[1]}function Fu(n){var t=Math.sqrt(ju(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Hu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ou(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:du(a[0],c[0])},{i:3,x:du(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:du(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:du(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:du(g[0],p[0])},{i:e-2,x:du(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Yu(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Zu(n){for(var t=n.source,e=n.target,r=Xu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Vu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Xu(n,t){if(n===t)return n;for(var e=Vu(n),r=Vu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function $u(n){n.fixed|=2}function Bu(n){n.fixed&=-7}function Wu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Ju(n){n.fixed&=-5}function Gu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Gu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Ku(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ui,n}function Qu(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function ni(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ti(n){return n.children}function ei(n){return n.value}function ri(n,t){return t.value-n.value}function ui(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ii(n){return n.x}function oi(n){return n.y}function ai(n,t,e){n.y0=t,n.y=e}function ci(n){return ta.range(n.length)}function li(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function si(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function fi(n){return n.reduce(hi,0)}function hi(n,t){return n+t[1]}function gi(n,t){return pi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function pi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function vi(n){return[ta.min(n),ta.max(n)]}function di(n,t){return n.value-t.value}function mi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function yi(n,t){n._pack_next=t,t._pack_prev=n}function Mi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function xi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(bi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],Si(r,u,i),t(i),mi(r,i),r._pack_prev=i,mi(i,u),u=r._pack_next,o=3;l>o;o++){Si(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(Mi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!Mi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?yi(r,u=a):yi(r=c,u),o--):(mi(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(_i)}}function bi(n){n._pack_next=n._pack_prev=n}function _i(n){delete n._pack_next,delete n._pack_prev}function wi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)wi(u[i],t,e,r)}function Si(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function ki(n,t){return n.parent==t.parent?1:2}function Ei(n){var t=n.children;return t.length?t[0]:n.t}function Ai(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ni(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ci(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function zi(n,t,e){return n.a.parent===t.parent?n.a:e}function qi(n){return 1+ta.max(n,function(n){return n.y})}function Li(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ti(n){var t=n.children;return t&&t.length?Ti(t[0]):n}function Ri(n){var t,e=n.children;return e&&(t=e.length)?Ri(e[t-1]):n}function Di(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Pi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Ui(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function ji(n){return n.rangeExtent?n.rangeExtent():Ui(n.range())}function Fi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Hi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Oi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:bl}function Yi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Yi:Fi,c=r?Iu:Yu;return o=u(n,t,c,e),a=u(t,n,c,yu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Pu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return $i(n,t)},i.tickFormat=function(t,e){return Bi(n,t,e)},i.nice=function(t){return Vi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Zi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Vi(n,t){return Hi(n,Oi(Xi(n,t)[2]))}function Xi(n,t){null==t&&(t=10);var e=Ui(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function $i(n,t){return ta.range.apply(ta,Xi(n,t))}function Bi(n,t,e){var r=Xi(n,t);if(e){var u=lc.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(va(r[0]),va(r[1])));return u[7]||(u[7]="."+Wi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Ji(u[8],r)),e=u.join("")}else e=",."+Wi(r[2])+"f";return ta.format(e)}function Wi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Ji(n,t){var e=Wi(t[2]);return n in _l?Math.abs(e-Wi(Math.max(va(t[0]),va(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Gi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Hi(r.map(u),e?Math:Sl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Ui(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return wl;arguments.length<2?t=wl:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Gi(n.copy(),t,e,r)},Zi(o,n)}function Ki(n,t,e){function r(t){return n(u(t))}var u=Qi(t),i=Qi(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return $i(e,n)},r.tickFormat=function(n,t){return Bi(e,n,t)},r.nice=function(n){return r.domain(Vi(e,n))},r.exponent=function(o){return arguments.length?(u=Qi(t=o),i=Qi(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Ki(n.copy(),t,e)},Zi(r,n)}function Qi(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function no(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new a;for(var i,o=-1,c=r.length;++o<c;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):0|(l-c)/(n.length-1+a);return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Ui(t.a[0])},e.copy=function(){return no(n,t)},e.domain(n)}function to(r,u){function i(){var n=0,t=u.length;for(a=[];++n<t;)a[n-1]=ta.quantile(r,n/t);return o}function o(n){return isNaN(n=+n)?void 0:u[ta.bisect(a,n)]}var a;return o.domain=function(u){return arguments.length?(r=u.map(t).filter(e).sort(n),i()):r},o.range=function(n){return arguments.length?(u=n,i()):u},o.quantiles=function(){return a},o.invertExtent=function(n){return n=u.indexOf(n),0>n?[0/0,0/0]:[n>0?a[n-1]:r[0],n<a.length?a[n]:r[r.length-1]]},o.copy=function(){return to(r,u)},i()}function eo(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return eo(n,t,e)},u()}function ro(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ro(n,t)},e}function uo(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return $i(n,t)},t.tickFormat=function(t,e){return Bi(n,t,e)},t.copy=function(){return uo(n)},t}function io(){return 0}function oo(n){return n.innerRadius}function ao(n){return n.outerRadius}function co(n){return n.startAngle}function lo(n){return n.endAngle}function so(n){return n&&n.padAngle}function fo(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function ho(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function go(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Nr,r=Cr,u=Ce,i=po,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=zl.get(n)||po).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function po(n){return n.join("L")}function vo(n){return po(n)+"Z"}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function Mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function xo(n,t){return n.length<4?po(n):n[1]+wo(n.slice(1,-1),So(n,t))}function bo(n,t){return n.length<3?po(n):n[0]+wo((n.push(n[0]),n),So([n[n.length-2]].concat(n,[n[1]]),t))}function _o(n,t){return n.length<3?po(n):n[0]+wo(n,So(n,t))}function wo(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return po(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function So(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function ko(n){if(n.length<3)return po(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",Co(Tl,o),",",Co(Tl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),zo(c,o,a);return n.pop(),c.push("L",r),c.join("")}function Eo(n){if(n.length<4)return po(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(Co(Tl,i)+","+Co(Tl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),zo(e,i,o);return e.join("")}function Ao(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[Co(Tl,o),",",Co(Tl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),zo(t,o,a);return t.join("")}function No(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return ko(n)}function Co(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function zo(n,t,e){n.push("C",Co(ql,t),",",Co(ql,e),",",Co(Ll,t),",",Co(Ll,e),",",Co(Tl,t),",",Co(Tl,e))}function qo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Lo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=qo(u,i);++t<e;)r[t]=(o+(o=qo(u=i,i=n[t+1])))/2;return r[t]=o,r}function To(n){for(var t,e,r,u,i=[],o=Lo(n),a=-1,c=n.length-1;++a<c;)t=qo(n[a],n[a+1]),va(t)<Ta?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function Ro(n){return n.length<3?po(n):n[0]+wo(n,To(n))}function Do(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-ja,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Po(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Nr,r=Nr,u=0,i=Cr,o=Ce,a=po,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=zl.get(n)||po).key,l=a.reverse||a,s=a.closed?"M":"L",t):c
2306 (L*L/x>i||va((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Fa),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function er(n){var t=tr(function(t,e){return n([t*Ha,e*Ha])});return function(n){return ar(t(n))}}function rr(n){this.stream=n}function ur(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ir(n){return or(function(){return n})()}function or(n){function t(n){return n=a(n[0]*Fa,n[1]*Fa),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Ha,n[1]*Ha]}function r(){a=Ne(o=sr(m,y,M),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=tr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,y=0,M=0,x=Pc,b=At,_=null,w=null;return t.stream=function(n){return s&&(s.valid=!1),s=ar(x(o,f(b(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(x=null==n?(_=n,Pc):Oe((_=+n)*Fa),u()):_},t.clipExtent=function(n){return arguments.length?(w=n,b=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):At,u()):w},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Fa,d=n[1]%360*Fa,r()):[v*Ha,d*Ha]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Fa,y=n[1]%360*Fa,M=n.length>2?n[2]%360*Fa:0,r()):[m*Ha,y*Ha,M*Ha]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function ar(n){return ur(n,function(t,e){n.point(t*Fa,e*Fa)})}function cr(n,t){return[n,t]}function lr(n,t){return[n>Da?n-Pa:-Da>n?n+Pa:n,t]}function sr(n,t,e){return n?t||e?Ne(hr(n),gr(t,e)):hr(n):t||e?gr(t,e):lr}function fr(n){return function(t,e){return t+=n,[t>Da?t-Pa:-Da>t?t+Pa:t,e]}}function hr(n){var t=fr(n);return t.invert=fr(-n),t}function gr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function pr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=vr(e,u),i=vr(e,i),(o>0?i>u:u>i)&&(u+=o*Pa)):(u=n+o*Pa,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=be([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function vr(n,t){var e=ve(t);e[0]-=n,xe(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ta)%(2*Math.PI)}function dr(n,t,e){var r=ta.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function mr(n,t,e){var r=ta.range(n,t-Ta,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function yr(n){return n.source}function Mr(n){return n.target}function xr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Ha,Math.atan2(o,Math.sqrt(r*r+u*u))*Ha]}:function(){return[n*Ha,t*Ha]};return p.distance=h,p}function br(){function n(n,u){var i=Math.sin(u*=Fa),o=Math.cos(u),a=va((n*=Fa)-t),c=Math.cos(a);$c+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Bc.point=function(u,i){t=u*Fa,e=Math.sin(i*=Fa),r=Math.cos(i),Bc.point=n},Bc.lineEnd=function(){Bc.point=Bc.lineEnd=y}}function _r(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function wr(n,t){function e(n,t){o>0?-ja+Ta>t&&(t=-ja+Ta):t>ja-Ta&&(t=ja-Ta);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(Da/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-ja]},e):kr}function Sr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return va(u)<Ta?cr:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function kr(n,t){return[n,Math.log(Math.tan(Da/4+t/2))]}function Er(n){var t,e=ir(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=Da*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Ar(n,t){return[Math.log(Math.tan(Da/4+t/2)),-n]}function Nr(n){return n[0]}function Cr(n){return n[1]}function zr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function qr(n,t){return n[0]-t[0]||n[1]-t[1]}function Lr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Tr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Rr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Dr(){eu(this),this.edge=this.site=this.circle=null}function Pr(n){var t=ol.pop()||new Dr;return t.site=n,t}function Ur(n){$r(n),rl.remove(n),ol.push(n),eu(n)}function jr(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Ur(n);for(var c=i;c.circle&&va(e-c.circle.x)<Ta&&va(r-c.circle.cy)<Ta;)i=c.P,a.unshift(c),Ur(c),c=i;a.unshift(c),$r(c);for(var l=o;l.circle&&va(e-l.circle.x)<Ta&&va(r-l.circle.cy)<Ta;)o=l.N,a.push(l),Ur(l),l=o;a.push(l),$r(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Qr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Gr(c.site,l.site,null,u),Xr(c),Xr(l)}function Fr(n){for(var t,e,r,u,i=n.x,o=n.y,a=rl._;a;)if(r=Hr(a,o)-i,r>Ta)a=a.L;else{if(u=i-Or(a,o),!(u>Ta)){r>-Ta?(t=a.P,e=a):u>-Ta?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Pr(n);if(rl.insert(t,c),t||e){if(t===e)return $r(t),e=Pr(t.site),rl.insert(c,e),c.edge=e.edge=Gr(t.site,c.site),Xr(t),Xr(e),void 0;if(!e)return c.edge=Gr(t.site,c.site),void 0;$r(t),$r(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Qr(e.edge,l,p,x),c.edge=Gr(l,n,null,x),e.edge=Gr(n,p,null,x),Xr(t),Xr(e)}}function Hr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Or(n,t){var e=n.N;if(e)return Hr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Yr(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=el,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(va(r-t)>Ta||va(u-e)>Ta)&&(a.splice(o,0,new nu(Kr(i.site,s,va(r-f)<Ta&&p-u>Ta?{x:f,y:va(t-f)<Ta?e:p}:va(u-p)<Ta&&h-r>Ta?{x:va(e-p)<Ta?t:h,y:p}:va(r-h)<Ta&&u-g>Ta?{x:h,y:va(t-h)<Ta?e:g}:va(u-g)<Ta&&r-f>Ta?{x:va(e-g)<Ta?t:f,y:g}:null),i.site,null)),++c)}function Zr(n,t){return t.angle-n.angle}function Vr(){eu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Xr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-Ra)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=al.pop()||new Vr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=il._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}il.insert(y,m),y||(ul=m)}}}}function $r(n){var t=n.circle;t&&(t.P||(ul=t.N),il.remove(t),al.push(t),eu(t),n.circle=null)}function Br(n){for(var t,e=tl,r=Ye(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Wr(t,n)||!r(t)||va(t.a.x-t.b.x)<Ta&&va(t.a.y-t.b.y)<Ta)&&(t.a=t.b=null,e.splice(u,1))}function Wr(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Jr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Gr(n,t,e,r){var u=new Jr(n,t);return tl.push(u),e&&Qr(u,n,t,e),r&&Qr(u,t,n,r),el[n.i].edges.push(new nu(u,n,t)),el[t.i].edges.push(new nu(u,t,n)),u}function Kr(n,t,e){var r=new Jr(n,null);return r.a=t,r.b=e,tl.push(r),r}function Qr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function nu(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function tu(){this._=null}function eu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function ru(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function uu(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function iu(n){for(;n.L;)n=n.L;return n}function ou(n,t){var e,r,u,i=n.sort(au).pop();for(tl=[],el=new Array(n.length),rl=new tu,il=new tu;;)if(u=ul,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(el[i.i]=new Yr(i),Fr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;jr(u.arc)}t&&(Br(t),Ir(t));var o={cells:el,edges:tl};return rl=il=tl=el=null,o}function au(n,t){return t.y-n.y||t.x-n.x}function cu(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function lu(n){return n.x}function su(n){return n.y}function fu(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function hu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&hu(n,c[0],e,r,o,a),c[1]&&hu(n,c[1],o,r,u,a),c[2]&&hu(n,c[2],e,a,o,i),c[3]&&hu(n,c[3],o,a,u,i)}}function gu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-p[0],d=e-p[1],m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function pu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function vu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=yu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function du(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function mu(n,t){var e,r,u,i=ll.lastIndex=sl.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=ll.exec(n))&&(r=sl.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:du(e,r)})),i=sl.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function yu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function Mu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(yu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function xu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function bu(n){return function(t){return 1-n(1-t)}}function _u(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function wu(n){return n*n}function Su(n){return n*n*n}function ku(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function Eu(n){return function(t){return Math.pow(t,n)}}function Au(n){return 1-Math.cos(n*ja)}function Nu(n){return Math.pow(2,10*(n-1))}function Cu(n){return 1-Math.sqrt(1-n*n)}function zu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/Pa*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*Pa/t)}}function qu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function Lu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Tu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Pu(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Uu(n){var t=[n.a,n.b],e=[n.c,n.d],r=Fu(t),u=ju(t,e),i=Fu(Hu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Ha,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Ha:0}function ju(n,t){return n[0]*t[0]+n[1]*t[1]}function Fu(n){var t=Math.sqrt(ju(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Hu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Ou(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:du(a[0],c[0])},{i:3,x:du(a[1],c[1])})):c[0]||c[1]?r.push("translate("+c+")"):r.push(""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:du(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:du(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:du(g[0],p[0])},{i:e-2,x:du(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Yu(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Zu(n){for(var t=n.source,e=n.target,r=Xu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Vu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Xu(n,t){if(n===t)return n;for(var e=Vu(n),r=Vu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function $u(n){n.fixed|=2}function Bu(n){n.fixed&=-7}function Wu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Ju(n){n.fixed&=-5}function Gu(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Gu(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Ku(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ui,n}function Qu(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function ni(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ti(n){return n.children}function ei(n){return n.value}function ri(n,t){return t.value-n.value}function ui(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ii(n){return n.x}function oi(n){return n.y}function ai(n,t,e){n.y0=t,n.y=e}function ci(n){return ta.range(n.length)}function li(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function si(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function fi(n){return n.reduce(hi,0)}function hi(n,t){return n+t[1]}function gi(n,t){return pi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function pi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function vi(n){return[ta.min(n),ta.max(n)]}function di(n,t){return n.value-t.value}function mi(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function yi(n,t){n._pack_next=t,t._pack_prev=n}function Mi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function xi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(bi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],Si(r,u,i),t(i),mi(r,i),r._pack_prev=i,mi(i,u),u=r._pack_next,o=3;l>o;o++){Si(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(Mi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!Mi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?yi(r,u=a):yi(r=c,u),o--):(mi(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(_i)}}function bi(n){n._pack_next=n._pack_prev=n}function _i(n){delete n._pack_next,delete n._pack_prev}function wi(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)wi(u[i],t,e,r)}function Si(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function ki(n,t){return n.parent==t.parent?1:2}function Ei(n){var t=n.children;return t.length?t[0]:n.t}function Ai(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ni(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ci(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function zi(n,t,e){return n.a.parent===t.parent?n.a:e}function qi(n){return 1+ta.max(n,function(n){return n.y})}function Li(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Ti(n){var t=n.children;return t&&t.length?Ti(t[0]):n}function Ri(n){var t,e=n.children;return e&&(t=e.length)?Ri(e[t-1]):n}function Di(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Pi(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Ui(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function ji(n){return n.rangeExtent?n.rangeExtent():Ui(n.range())}function Fi(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Hi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Oi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:bl}function Yi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Yi:Fi,c=r?Iu:Yu;return o=u(n,t,c,e),a=u(t,n,c,yu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Pu)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return $i(n,t)},i.tickFormat=function(t,e){return Bi(n,t,e)},i.nice=function(t){return Vi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Zi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Vi(n,t){return Hi(n,Oi(Xi(n,t)[2]))}function Xi(n,t){null==t&&(t=10);var e=Ui(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function $i(n,t){return ta.range.apply(ta,Xi(n,t))}function Bi(n,t,e){var r=Xi(n,t);if(e){var u=lc.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(va(r[0]),va(r[1])));return u[7]||(u[7]="."+Wi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Ji(u[8],r)),e=u.join("")}else e=",."+Wi(r[2])+"f";return ta.format(e)}function Wi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Ji(n,t){var e=Wi(t[2]);return n in _l?Math.abs(e-Wi(Math.max(va(t[0]),va(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Gi(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Hi(r.map(u),e?Math:Sl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Ui(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return wl;arguments.length<2?t=wl:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Gi(n.copy(),t,e,r)},Zi(o,n)}function Ki(n,t,e){function r(t){return n(u(t))}var u=Qi(t),i=Qi(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return $i(e,n)},r.tickFormat=function(n,t){return Bi(e,n,t)},r.nice=function(n){return r.domain(Vi(e,n))},r.exponent=function(o){return arguments.length?(u=Qi(t=o),i=Qi(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Ki(n.copy(),t,e)},Zi(r,n)}function Qi(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function no(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new a;for(var i,o=-1,c=r.length;++o<c;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):0|(l-c)/(n.length-1+a);return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Ui(t.a[0])},e.copy=function(){return no(n,t)},e.domain(n)}function to(r,u){function i(){var n=0,t=u.length;for(a=[];++n<t;)a[n-1]=ta.quantile(r,n/t);return o}function o(n){return isNaN(n=+n)?void 0:u[ta.bisect(a,n)]}var a;return o.domain=function(u){return arguments.length?(r=u.map(t).filter(e).sort(n),i()):r},o.range=function(n){return arguments.length?(u=n,i()):u},o.quantiles=function(){return a},o.invertExtent=function(n){return n=u.indexOf(n),0>n?[0/0,0/0]:[n>0?a[n-1]:r[0],n<a.length?a[n]:r[r.length-1]]},o.copy=function(){return to(r,u)},i()}function eo(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return eo(n,t,e)},u()}function ro(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return ro(n,t)},e}function uo(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return $i(n,t)},t.tickFormat=function(t,e){return Bi(n,t,e)},t.copy=function(){return uo(n)},t}function io(){return 0}function oo(n){return n.innerRadius}function ao(n){return n.outerRadius}function co(n){return n.startAngle}function lo(n){return n.endAngle}function so(n){return n&&n.padAngle}function fo(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function ho(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function go(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Nr,r=Cr,u=Ce,i=po,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=zl.get(n)||po).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function po(n){return n.join("L")}function vo(n){return po(n)+"Z"}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function Mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function xo(n,t){return n.length<4?po(n):n[1]+wo(n.slice(1,-1),So(n,t))}function bo(n,t){return n.length<3?po(n):n[0]+wo((n.push(n[0]),n),So([n[n.length-2]].concat(n,[n[1]]),t))}function _o(n,t){return n.length<3?po(n):n[0]+wo(n,So(n,t))}function wo(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return po(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function So(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function ko(n){if(n.length<3)return po(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",Co(Tl,o),",",Co(Tl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),zo(c,o,a);return n.pop(),c.push("L",r),c.join("")}function Eo(n){if(n.length<4)return po(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(Co(Tl,i)+","+Co(Tl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),zo(e,i,o);return e.join("")}function Ao(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[Co(Tl,o),",",Co(Tl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),zo(t,o,a);return t.join("")}function No(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return ko(n)}function Co(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function zo(n,t,e){n.push("C",Co(ql,t),",",Co(ql,e),",",Co(Ll,t),",",Co(Ll,e),",",Co(Tl,t),",",Co(Tl,e))}function qo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function Lo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=qo(u,i);++t<e;)r[t]=(o+(o=qo(u=i,i=n[t+1])))/2;return r[t]=o,r}function To(n){for(var t,e,r,u,i=[],o=Lo(n),a=-1,c=n.length-1;++a<c;)t=qo(n[a],n[a+1]),va(t)<Ta?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function Ro(n){return n.length<3?po(n):n[0]+wo(n,To(n))}function Do(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-ja,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Po(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Nr,r=Nr,u=0,i=Cr,o=Ce,a=po,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=zl.get(n)||po).key,l=a.reverse||a,s=a.closed?"M":"L",t):c
2307 },t.tension=function(n){return arguments.length?(f=n,t):f},t}function Uo(n){return n.radius}function jo(n){return[n.x,n.y]}function Fo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-ja;return[e*Math.cos(r),e*Math.sin(r)]}}function Ho(){return 64}function Oo(){return"circle"}function Yo(n){var t=Math.sqrt(n/Da);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n,t,e){return xa(n,Fl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return H(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var c=u.time;o=i[r]={tween:new a,time:c,delay:u.delay,duration:u.duration,ease:u.ease},u=null,++i.count,ta.timer(function(u){function a(e){return i.active>r?s(!1):(i.active=r,o.event&&o.event.start.call(n,g,t),o.tween.forEach(function(e,r){(r=r.call(n,g,t))&&d.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return v.c=l(e||1)?Ce:l,1},0,c),void 0)}function l(t){if(i.active!==r)return s(!1);for(var e=t/f,u=h(e),o=d.length;o>0;)d[--o].call(n,u);return e>=1?s(!0):void 0}function s(u){return o.event&&o.event[u?"end":"interrupt"].call(n,g,t),--i.count?delete i[r]:delete n[e],1}var f,h,g=n.__data__,p=o.delay,v=oc,d=[];return v.t=p+c,u>=p?a(u-p):(v.c=a,void 0)},0,c)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Bl,u);return i==Bl.length?[t.year,Xi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Bl[i-1]<Bl[i]/u?i-1:i]:[Gl,Xi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Ui(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Hi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Ui(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Zi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.0"};Date.now||(Date.now=function(){return+new Date});var ea=[].slice,ra=function(n){return ea.call(n)},ua=document,ia=ua.documentElement,oa=window;try{ra(ia.childNodes)[0].nodeType}catch(aa){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{ua.createElement("div").style.setProperty("opacity",0,"")}catch(ca){var la=oa.Element.prototype,sa=la.setAttribute,fa=la.setAttributeNS,ha=oa.CSSStyleDeclaration.prototype,ga=ha.setProperty;la.setAttribute=function(n,t){sa.call(this,n,t+"")},la.setAttributeNS=function(n,t,e){fa.call(this,n,t,e+"")},ha.setProperty=function(n,t,e){ga.call(this,n,t+"",e)}}ta.ascending=n,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var r,u=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)e(r=+n[o])&&(u+=r);else for(;++o<i;)e(r=+t.call(n,n[o],o))&&(u+=r);return u},ta.mean=function(n,r){var u,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)e(u=t(n[a]))?i+=u:--c;else for(;++a<o;)e(u=t(r.call(n,n[a],a)))?i+=u:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(r,u){var i,o=[],a=r.length,c=-1;if(1===arguments.length)for(;++c<a;)e(i=t(r[c]))&&o.push(i);else for(;++c<a;)e(i=t(u.call(r,r[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(n),.5):void 0};var pa=r(n);ta.bisectLeft=pa.left,ta.bisect=ta.bisectRight=pa.right,ta.bisector=function(t){return r(1===t.length?function(e,r){return n(t(e),r)}:t)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=0|Math.random()*i--,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,u),e=new Array(t);++n<t;)for(var r,i=-1,o=e[n]=new Array(r);++i<r;)o[i]=arguments[i][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var va=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,u=[],o=i(va(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)u.push(r/o);else for(;(r=n+e*++a)<t;)u.push(r/o);return u},ta.map=function(n,t){var e=new a;if(n instanceof a)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var da="__proto__",ma="\x00";o(a,{has:s,get:function(n){return this._[c(n)]},set:function(n,t){return this._[c(n)]=t},remove:f,keys:h,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:l(t),value:this._[t]});return n},size:g,empty:p,forEach:function(n){for(var t in this._)n.call(this,l(t),this._[t])}}),ta.nest=function(){function n(t,o,c){if(c>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var l,s,f,h,g=-1,p=o.length,v=i[c++],d=new a;++g<p;)(h=d.get(l=v(s=o[g])))?h.push(s):d.set(l,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,c))}):(s={},f=function(e,r){s[e]=n(t,r,c)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new v;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},o(v,{has:s,add:function(n){return this._[c(n+="")]=!0,n},remove:f,values:h,size:g,empty:p,forEach:function(n){for(var t in this._)n.call(this,l(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=d(n,t,t[e]);return n};var ya=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new M,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=x(n);return n},M.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(Ma,"\\$&")};var Ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ba=function(n,t){return t.querySelector(n)},_a=function(n,t){return t.querySelectorAll(n)},wa=ia.matches||ia[m(ia,"matchesSelector")],Sa=function(n,t){return wa.call(n,t)};"function"==typeof Sizzle&&(ba=function(n,t){return Sizzle(n,t)[0]||null},_a=Sizzle,Sa=Sizzle.matchesSelector),ta.selection=function(){return Na};var ka=ta.selection.prototype=[];ka.select=function(n){var t,e,r,u,i=[];n=k(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return S(i)},ka.selectAll=function(n){var t,e,r=[];n=E(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return S(r)};var Ea={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ta.ns={prefix:Ea,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),Ea.hasOwnProperty(e)?{space:Ea[e],local:n}:n}},ka.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(A(t,n[t]));return this}return this.each(A(n,t))},ka.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=z(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!C(n[u]).test(t))return!1;return!0}for(t in n)this.each(q(t,n[t]));return this}return this.each(q(n,t))},ka.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(T(e,n[e],t));return this}if(2>r)return oa.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(T(n,t,e))},ka.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},ka.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},ka.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},ka.append=function(n){return n=D(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},ka.insert=function(n,t){return n=D(n),t=k(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},ka.remove=function(){return this.each(P)},ka.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new a,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=U(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=U(i);for(;f>r;++r)p[r]=U(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),l.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var c=O([]),l=S([]),s=S([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return l.enter=function(){return c},l.exit=function(){return s},l},ka.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},ka.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=j(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return S(u)},ka.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},ka.sort=function(n){n=F.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},ka.each=function(n){return H(this,function(t,e,r){n.call(t,t.__data__,e,r)})},ka.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},ka.empty=function(){return!this.node()},ka.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},ka.size=function(){var n=0;return H(this,function(){++n}),n};var Aa=[];ta.selection.enter=O,ta.selection.enter.prototype=Aa,Aa.append=ka.append,Aa.empty=ka.empty,Aa.node=ka.node,Aa.call=ka.call,Aa.size=ka.size,Aa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return S(o)},Aa.insert=function(n,t){return arguments.length<2&&(t=Y(this)),ka.insert.call(this,n,t)},ka.transition=function(n){for(var t,e,r=Dl||++Hl,u=Xo(n),i=[],o=Pl||{time:Date.now(),ease:ku,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Io(i,u,r)},ka.interrupt=function(n){var t=Xo(n);return this.each(function(){var n=this[t];n&&++n.active})},ta.select=function(n){var t=["string"==typeof n?ba(n,ua):n];return t.parentNode=ia,S([t])},ta.selectAll=function(n){var t=ra("string"==typeof n?_a(n,ua):n);return t.parentNode=ia,S([t])};var Na=ta.select(ia);ka.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(Z(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(Z(n,t,e))};var Ca=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});Ca.forEach(function(n){"on"+n in ua&&Ca.remove(n)});var za="onselectstart"in ua?null:m(ia.style,"userSelect"),qa=0;ta.mouse=function(n){return B(n,_())};var La=/WebKit/.test(oa.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=_().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return B(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=e.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(u()).on(i+d,a).on(o+d,c),y=$(),M=t(h,v);r?(l=r.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var e=w(n,"drag","dragstart","dragend"),r=null,u=t(y,ta.mouse,G,"mousemove","mouseup"),i=t(W,ta.touch,J,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},ta.rebind(n,e,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=_().touches),t?ra(t).map(function(t){var e=B(n,t);return e.identifier=t.identifier,e}):[]};var Ta=1e-6,Ra=Ta*Ta,Da=Math.PI,Pa=2*Da,Ua=Pa-Ta,ja=Da/2,Fa=Da/180,Ha=180/Da,Oa=Math.SQRT2,Ya=2,Ia=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(Ya*h)*(e*ut(Oa*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Oa*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Oa*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Ia*f)/(2*i*Ya*h),p=(c*c-i*i-Ia*f)/(2*c*Ya*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Oa;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(z,s).on(Xa+".zoom",h).on("dblclick.zoom",g).on(T,f)}function t(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function e(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function r(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=e(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function i(t,e,i,o){t.__chart__={x:k.x,y:k.y,k:k.k},r(Math.pow(2,o)),u(v=e,i),t=ta.select(t),N>0&&(t=t.transition().duration(N)),t.call(n.event)}function o(){x&&x.domain(M.range().map(function(n){return(n-k.x)/k.k}).map(M.invert)),S&&S.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function a(n){C++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function l(n){--C||n({type:"zoomend"}),v=null}function s(){function n(){s=1,u(ta.mouse(r),h),c(o)}function e(){f.on(q,null).on(L,null),g(s&&ta.event.target===i),l(o)}var r=this,i=ta.event.target,o=R.of(r,arguments),s=0,f=ta.select(oa).on(q,n).on(L,e),h=t(ta.mouse(r)),g=$();I(r),a(o)}function f(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=t(n))}),n}function e(){var t=ta.event.target;ta.select(t).on(x,o).on(_,h),w.push(t);for(var e=ta.event.changedTouches,r=0,u=e.length;u>r;++r)d[e[r].identifier]=null;var a=n(),c=Date.now();if(1===a.length){if(500>c-y){var l=a[0];i(p,l,d[l.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),b()}y=c}else if(a.length>1){var l=a[0],s=a[1],f=l[0]-s[0],g=l[1]-s[1];m=f*f+g*g}}function o(){var n,t,e,i,o=ta.touches(p);I(p);for(var a=0,l=o.length;l>a;++a,i=null)if(e=o[a],i=d[e.identifier]){if(t)break;n=e,t=i}if(i){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*g)}y=null,u(n,t),c(v)}function h(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(w).on(M,null),S.on(z,s).on(T,f),E(),l(v)}var g,p=this,v=R.of(p,arguments),d={},m=0,M=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+M,_="touchend"+M,w=[],S=ta.select(p),E=$();e(),a(v),S.on(z,null).on(T,e)}function h(){var n=R.of(this,arguments);m?clearTimeout(m):(p=t(v=d||ta.mouse(this)),I(this),a(n)),m=setTimeout(function(){m=null,l(n)},50),b(),r(Math.pow(2,.002*Za())*k.k),u(v,p),c(n)}function g(){var n=ta.mouse(this),e=Math.log(k.k)/Math.LN2;i(this,n,t(n),ta.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}var p,v,d,m,y,M,x,_,S,k={x:0,y:0,k:1},E=[960,500],A=Va,N=250,C=0,z="mousedown.zoom",q="mousemove.zoom",L="mouseup.zoom",T="touchstart.zoom",R=w(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=R.of(this,arguments),t=k;Dl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},a(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=v?v[0]:e/2,i=v?v[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){l(n)}).each("end.zoom",function(){l(n)}):(this.__chart__=k,a(n),c(n),l(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Va:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(d=t&&[+t[0],+t[1]],n):d},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(N=+t,n):N},n.x=function(t){return arguments.length?(x=t,M=t.copy(),k={x:0,y:0,k:1},n):x},n.y=function(t){return arguments.length?(S=t,_=t.copy(),k={x:0,y:0,k:1},n):S},ta.rebind(n,R,"on")};var Za,Va=[0,1/0],Xa="onwheel"in ua?(Za=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Za=function(){return ta.event.wheelDelta},"mousewheel"):(Za=function(){return-ta.event.detail},"MozMousePixelScroll");ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var $a=at.prototype=new ot;$a.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},$a.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},$a.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Ba=lt.prototype=new ot;Ba.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Wa*(arguments.length?n:1)))},Ba.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Wa*(arguments.length?n:1)))},Ba.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Wa=18,Ja=.95047,Ga=1,Ka=1.08883,Qa=ft.prototype=new ot;Qa.brighter=function(n){return new ft(Math.min(100,this.l+Wa*(arguments.length?n:1)),this.a,this.b)},Qa.darker=function(n){return new ft(Math.max(0,this.l-Wa*(arguments.length?n:1)),this.a,this.b)},Qa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var nc=mt.prototype=new ot;nc.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},nc.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},nc.hsl=function(){return _t(this.r,this.g,this.b)},nc.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var tc=ta.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});tc.forEach(function(n,t){tc.set(n,yt(t))}),ta.functor=Et,ta.xhr=Nt(At),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Ct(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new v,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var ec,rc,uc,ic,oc,ac=oa[m(oa,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};rc?rc.n=i:ec=i,rc=i,uc||(ic=clearTimeout(ic),uc=1,ac(Lt))},ta.timer.flush=function(){Tt(),Rt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var cc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Pt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Dt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),cc[8+e/3]};var lc=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,sc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Dt(n,t))).toFixed(Math.max(0,Math.min(20,Dt(n*(1+1e-15),t))))}}),fc=ta.time={},hc=Date;Ft.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gc.setUTCDate.apply(this._,arguments)},setDay:function(){gc.setUTCDay.apply(this._,arguments)},setFullYear:function(){gc.setUTCFullYear.apply(this._,arguments)},setHours:function(){gc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gc.setUTCSeconds.apply(this._,arguments)},setTime:function(){gc.setTime.apply(this._,arguments)}};var gc=Date.prototype;fc.year=Ht(function(n){return n=fc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),fc.years=fc.year.range,fc.years.utc=fc.year.utc.range,fc.day=Ht(function(n){var t=new hc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),fc.days=fc.day.range,fc.days.utc=fc.day.utc.range,fc.dayOfYear=function(n){var t=fc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=fc[n]=Ht(function(n){return(n=fc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=fc.year(n).getDay();return Math.floor((fc.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});fc[n+"s"]=e.range,fc[n+"s"].utc=e.utc.range,fc[n+"OfYear"]=function(n){var e=fc.year(n).getDay();return Math.floor((fc.dayOfYear(n)+(e+t)%7)/7)}}),fc.week=fc.sunday,fc.weeks=fc.sunday.range,fc.weeks.utc=fc.sunday.utc.range,fc.weekOfYear=fc.sundayOfYear;var pc={"-":"",_:" ",0:"0"},vc=/^\s*\d+/,dc=/^%/;ta.locale=function(n){return{numberFormat:Ut(n),timeFormat:Yt(n)}};var mc=ta.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ta.format=mc.numberFormat,ta.geo={},le.prototype={s:0,t:0,add:function(n){se(n,this.t,yc),se(yc.s,this.s,this),this.s?this.t+=yc.t:this.s=yc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var yc=new le;ta.geo.stream=function(n,t){n&&Mc.hasOwnProperty(n.type)?Mc[n.type](n,t):fe(n,t)};var Mc={Feature:function(n,t){fe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)fe(e[r].geometry,t)}},xc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){he(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t,0)},Polygon:function(n,t){ge(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ge(e[r],t)
2307 },t.tension=function(n){return arguments.length?(f=n,t):f},t}function Uo(n){return n.radius}function jo(n){return[n.x,n.y]}function Fo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-ja;return[e*Math.cos(r),e*Math.sin(r)]}}function Ho(){return 64}function Oo(){return"circle"}function Yo(n){var t=Math.sqrt(n/Da);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n,t,e){return xa(n,Fl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return H(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var c=u.time;o=i[r]={tween:new a,time:c,delay:u.delay,duration:u.duration,ease:u.ease},u=null,++i.count,ta.timer(function(u){function a(e){return i.active>r?s(!1):(i.active=r,o.event&&o.event.start.call(n,g,t),o.tween.forEach(function(e,r){(r=r.call(n,g,t))&&d.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return v.c=l(e||1)?Ce:l,1},0,c),void 0)}function l(t){if(i.active!==r)return s(!1);for(var e=t/f,u=h(e),o=d.length;o>0;)d[--o].call(n,u);return e>=1?s(!0):void 0}function s(u){return o.event&&o.event[u?"end":"interrupt"].call(n,g,t),--i.count?delete i[r]:delete n[e],1}var f,h,g=n.__data__,p=o.delay,v=oc,d=[];return v.t=p+c,u>=p?a(u-p):(v.c=a,void 0)},0,c)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Bl,u);return i==Bl.length?[t.year,Xi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Bl[i-1]<Bl[i]/u?i-1:i]:[Gl,Xi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Ui(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Hi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Ui(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Zi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.0"};Date.now||(Date.now=function(){return+new Date});var ea=[].slice,ra=function(n){return ea.call(n)},ua=document,ia=ua.documentElement,oa=window;try{ra(ia.childNodes)[0].nodeType}catch(aa){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}try{ua.createElement("div").style.setProperty("opacity",0,"")}catch(ca){var la=oa.Element.prototype,sa=la.setAttribute,fa=la.setAttributeNS,ha=oa.CSSStyleDeclaration.prototype,ga=ha.setProperty;la.setAttribute=function(n,t){sa.call(this,n,t+"")},la.setAttributeNS=function(n,t,e){fa.call(this,n,t,e+"")},ha.setProperty=function(n,t,e){ga.call(this,n,t+"",e)}}ta.ascending=n,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var r,u=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)e(r=+n[o])&&(u+=r);else for(;++o<i;)e(r=+t.call(n,n[o],o))&&(u+=r);return u},ta.mean=function(n,r){var u,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)e(u=t(n[a]))?i+=u:--c;else for(;++a<o;)e(u=t(r.call(n,n[a],a)))?i+=u:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(r,u){var i,o=[],a=r.length,c=-1;if(1===arguments.length)for(;++c<a;)e(i=t(r[c]))&&o.push(i);else for(;++c<a;)e(i=t(u.call(r,r[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(n),.5):void 0};var pa=r(n);ta.bisectLeft=pa.left,ta.bisect=ta.bisectRight=pa.right,ta.bisector=function(t){return r(1===t.length?function(e,r){return n(t(e),r)}:t)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=0|Math.random()*i--,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,u),e=new Array(t);++n<t;)for(var r,i=-1,o=e[n]=new Array(r);++i<r;)o[i]=arguments[i][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var va=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),1/0===(t-n)/e)throw new Error("infinite range");var r,u=[],o=i(va(e)),a=-1;if(n*=o,t*=o,e*=o,0>e)for(;(r=n+e*++a)>t;)u.push(r/o);else for(;(r=n+e*++a)<t;)u.push(r/o);return u},ta.map=function(n,t){var e=new a;if(n instanceof a)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var da="__proto__",ma="\x00";o(a,{has:s,get:function(n){return this._[c(n)]},set:function(n,t){return this._[c(n)]=t},remove:f,keys:h,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:l(t),value:this._[t]});return n},size:g,empty:p,forEach:function(n){for(var t in this._)n.call(this,l(t),this._[t])}}),ta.nest=function(){function n(t,o,c){if(c>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var l,s,f,h,g=-1,p=o.length,v=i[c++],d=new a;++g<p;)(h=d.get(l=v(s=o[g])))?h.push(s):d.set(l,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,c))}):(s={},f=function(e,r){s[e]=n(t,r,c)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new v;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},o(v,{has:s,add:function(n){return this._[c(n+="")]=!0,n},remove:f,values:h,size:g,empty:p,forEach:function(n){for(var t in this._)n.call(this,l(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=d(n,t,t[e]);return n};var ya=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new M,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=x(n);return n},M.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(Ma,"\\$&")};var Ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,xa={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},ba=function(n,t){return t.querySelector(n)},_a=function(n,t){return t.querySelectorAll(n)},wa=ia.matches||ia[m(ia,"matchesSelector")],Sa=function(n,t){return wa.call(n,t)};"function"==typeof Sizzle&&(ba=function(n,t){return Sizzle(n,t)[0]||null},_a=Sizzle,Sa=Sizzle.matchesSelector),ta.selection=function(){return Na};var ka=ta.selection.prototype=[];ka.select=function(n){var t,e,r,u,i=[];n=k(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return S(i)},ka.selectAll=function(n){var t,e,r=[];n=E(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return S(r)};var Ea={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ta.ns={prefix:Ea,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),Ea.hasOwnProperty(e)?{space:Ea[e],local:n}:n}},ka.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(A(t,n[t]));return this}return this.each(A(n,t))},ka.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=z(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!C(n[u]).test(t))return!1;return!0}for(t in n)this.each(q(t,n[t]));return this}return this.each(q(n,t))},ka.style=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t="");for(e in n)this.each(T(e,n[e],t));return this}if(2>r)return oa.getComputedStyle(this.node(),null).getPropertyValue(n);e=""}return this.each(T(n,t,e))},ka.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},ka.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},ka.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},ka.append=function(n){return n=D(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},ka.insert=function(n,t){return n=D(n),t=k(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},ka.remove=function(){return this.each(P)},ka.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new a,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=U(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=U(i);for(;f>r;++r)p[r]=U(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,c.push(p),l.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var c=O([]),l=S([]),s=S([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return l.enter=function(){return c},l.exit=function(){return s},l},ka.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},ka.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=j(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return S(u)},ka.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},ka.sort=function(n){n=F.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},ka.each=function(n){return H(this,function(t,e,r){n.call(t,t.__data__,e,r)})},ka.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},ka.empty=function(){return!this.node()},ka.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},ka.size=function(){var n=0;return H(this,function(){++n}),n};var Aa=[];ta.selection.enter=O,ta.selection.enter.prototype=Aa,Aa.append=ka.append,Aa.empty=ka.empty,Aa.node=ka.node,Aa.call=ka.call,Aa.size=ka.size,Aa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return S(o)},Aa.insert=function(n,t){return arguments.length<2&&(t=Y(this)),ka.insert.call(this,n,t)},ka.transition=function(n){for(var t,e,r=Dl||++Hl,u=Xo(n),i=[],o=Pl||{time:Date.now(),ease:ku,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Io(i,u,r)},ka.interrupt=function(n){var t=Xo(n);return this.each(function(){var n=this[t];n&&++n.active})},ta.select=function(n){var t=["string"==typeof n?ba(n,ua):n];return t.parentNode=ia,S([t])},ta.selectAll=function(n){var t=ra("string"==typeof n?_a(n,ua):n);return t.parentNode=ia,S([t])};var Na=ta.select(ia);ka.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(Z(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(Z(n,t,e))};var Ca=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});Ca.forEach(function(n){"on"+n in ua&&Ca.remove(n)});var za="onselectstart"in ua?null:m(ia.style,"userSelect"),qa=0;ta.mouse=function(n){return B(n,_())};var La=/WebKit/.test(oa.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=_().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return B(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",u).on("touchstart.drag",i)}function t(n,t,u,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=e.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(u()).on(i+d,a).on(o+d,c),y=$(),M=t(h,v);r?(l=r.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var e=w(n,"drag","dragstart","dragend"),r=null,u=t(y,ta.mouse,G,"mousemove","mouseup"),i=t(W,ta.touch,J,"touchmove","touchend");return n.origin=function(t){return arguments.length?(r=t,n):r},ta.rebind(n,e,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=_().touches),t?ra(t).map(function(t){var e=B(n,t);return e.identifier=t.identifier,e}):[]};var Ta=1e-6,Ra=Ta*Ta,Da=Math.PI,Pa=2*Da,Ua=Pa-Ta,ja=Da/2,Fa=Da/180,Ha=180/Da,Oa=Math.SQRT2,Ya=2,Ia=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(Ya*h)*(e*ut(Oa*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Oa*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Oa*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Ia*f)/(2*i*Ya*h),p=(c*c-i*i-Ia*f)/(2*c*Ya*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Oa;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(z,s).on(Xa+".zoom",h).on("dblclick.zoom",g).on(T,f)}function t(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function e(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function r(n){k.k=Math.max(A[0],Math.min(A[1],n))}function u(n,t){t=e(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function i(t,e,i,o){t.__chart__={x:k.x,y:k.y,k:k.k},r(Math.pow(2,o)),u(v=e,i),t=ta.select(t),N>0&&(t=t.transition().duration(N)),t.call(n.event)}function o(){x&&x.domain(M.range().map(function(n){return(n-k.x)/k.k}).map(M.invert)),S&&S.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function a(n){C++||n({type:"zoomstart"})}function c(n){o(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function l(n){--C||n({type:"zoomend"}),v=null}function s(){function n(){s=1,u(ta.mouse(r),h),c(o)}function e(){f.on(q,null).on(L,null),g(s&&ta.event.target===i),l(o)}var r=this,i=ta.event.target,o=R.of(r,arguments),s=0,f=ta.select(oa).on(q,n).on(L,e),h=t(ta.mouse(r)),g=$();I(r),a(o)}function f(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=t(n))}),n}function e(){var t=ta.event.target;ta.select(t).on(x,o).on(_,h),w.push(t);for(var e=ta.event.changedTouches,r=0,u=e.length;u>r;++r)d[e[r].identifier]=null;var a=n(),c=Date.now();if(1===a.length){if(500>c-y){var l=a[0];i(p,l,d[l.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),b()}y=c}else if(a.length>1){var l=a[0],s=a[1],f=l[0]-s[0],g=l[1]-s[1];m=f*f+g*g}}function o(){var n,t,e,i,o=ta.touches(p);I(p);for(var a=0,l=o.length;l>a;++a,i=null)if(e=o[a],i=d[e.identifier]){if(t)break;n=e,t=i}if(i){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+i[0])/2,(t[1]+i[1])/2],r(f*g)}y=null,u(n,t),c(v)}function h(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(w).on(M,null),S.on(z,s).on(T,f),E(),l(v)}var g,p=this,v=R.of(p,arguments),d={},m=0,M=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+M,_="touchend"+M,w=[],S=ta.select(p),E=$();e(),a(v),S.on(z,null).on(T,e)}function h(){var n=R.of(this,arguments);m?clearTimeout(m):(p=t(v=d||ta.mouse(this)),I(this),a(n)),m=setTimeout(function(){m=null,l(n)},50),b(),r(Math.pow(2,.002*Za())*k.k),u(v,p),c(n)}function g(){var n=ta.mouse(this),e=Math.log(k.k)/Math.LN2;i(this,n,t(n),ta.event.shiftKey?Math.ceil(e)-1:Math.floor(e)+1)}var p,v,d,m,y,M,x,_,S,k={x:0,y:0,k:1},E=[960,500],A=Va,N=250,C=0,z="mousedown.zoom",q="mousemove.zoom",L="mouseup.zoom",T="touchstart.zoom",R=w(n,"zoomstart","zoom","zoomend");return n.event=function(n){n.each(function(){var n=R.of(this,arguments),t=k;Dl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},a(n)}).tween("zoom:zoom",function(){var e=E[0],r=E[1],u=v?v[0]:e/2,i=v?v[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},c(n)}}).each("interrupt.zoom",function(){l(n)}).each("end.zoom",function(){l(n)}):(this.__chart__=k,a(n),c(n),l(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},o(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},o(),n):k.k},n.scaleExtent=function(t){return arguments.length?(A=null==t?Va:[+t[0],+t[1]],n):A},n.center=function(t){return arguments.length?(d=t&&[+t[0],+t[1]],n):d},n.size=function(t){return arguments.length?(E=t&&[+t[0],+t[1]],n):E},n.duration=function(t){return arguments.length?(N=+t,n):N},n.x=function(t){return arguments.length?(x=t,M=t.copy(),k={x:0,y:0,k:1},n):x},n.y=function(t){return arguments.length?(S=t,_=t.copy(),k={x:0,y:0,k:1},n):S},ta.rebind(n,R,"on")};var Za,Va=[0,1/0],Xa="onwheel"in ua?(Za=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Za=function(){return ta.event.wheelDelta},"mousewheel"):(Za=function(){return-ta.event.detail},"MozMousePixelScroll");ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var $a=at.prototype=new ot;$a.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},$a.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},$a.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Ba=lt.prototype=new ot;Ba.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Wa*(arguments.length?n:1)))},Ba.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Wa*(arguments.length?n:1)))},Ba.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Wa=18,Ja=.95047,Ga=1,Ka=1.08883,Qa=ft.prototype=new ot;Qa.brighter=function(n){return new ft(Math.min(100,this.l+Wa*(arguments.length?n:1)),this.a,this.b)},Qa.darker=function(n){return new ft(Math.max(0,this.l-Wa*(arguments.length?n:1)),this.a,this.b)},Qa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var nc=mt.prototype=new ot;nc.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},nc.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},nc.hsl=function(){return _t(this.r,this.g,this.b)},nc.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var tc=ta.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});tc.forEach(function(n,t){tc.set(n,yt(t))}),ta.functor=Et,ta.xhr=Nt(At),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Ct(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new v,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var ec,rc,uc,ic,oc,ac=oa[m(oa,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};rc?rc.n=i:ec=i,rc=i,uc||(ic=clearTimeout(ic),uc=1,ac(Lt))},ta.timer.flush=function(){Tt(),Rt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var cc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Pt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Dt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),cc[8+e/3]};var lc=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,sc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Dt(n,t))).toFixed(Math.max(0,Math.min(20,Dt(n*(1+1e-15),t))))}}),fc=ta.time={},hc=Date;Ft.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){gc.setUTCDate.apply(this._,arguments)},setDay:function(){gc.setUTCDay.apply(this._,arguments)},setFullYear:function(){gc.setUTCFullYear.apply(this._,arguments)},setHours:function(){gc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){gc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){gc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){gc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){gc.setUTCSeconds.apply(this._,arguments)},setTime:function(){gc.setTime.apply(this._,arguments)}};var gc=Date.prototype;fc.year=Ht(function(n){return n=fc.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),fc.years=fc.year.range,fc.years.utc=fc.year.utc.range,fc.day=Ht(function(n){var t=new hc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),fc.days=fc.day.range,fc.days.utc=fc.day.utc.range,fc.dayOfYear=function(n){var t=fc.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=fc[n]=Ht(function(n){return(n=fc.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=fc.year(n).getDay();return Math.floor((fc.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});fc[n+"s"]=e.range,fc[n+"s"].utc=e.utc.range,fc[n+"OfYear"]=function(n){var e=fc.year(n).getDay();return Math.floor((fc.dayOfYear(n)+(e+t)%7)/7)}}),fc.week=fc.sunday,fc.weeks=fc.sunday.range,fc.weeks.utc=fc.sunday.utc.range,fc.weekOfYear=fc.sundayOfYear;var pc={"-":"",_:" ",0:"0"},vc=/^\s*\d+/,dc=/^%/;ta.locale=function(n){return{numberFormat:Ut(n),timeFormat:Yt(n)}};var mc=ta.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ta.format=mc.numberFormat,ta.geo={},le.prototype={s:0,t:0,add:function(n){se(n,this.t,yc),se(yc.s,this.s,this),this.s?this.t+=yc.t:this.s=yc.t},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var yc=new le;ta.geo.stream=function(n,t){n&&Mc.hasOwnProperty(n.type)?Mc[n.type](n,t):fe(n,t)};var Mc={Feature:function(n,t){fe(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)fe(e[r].geometry,t)}},xc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){he(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t,0)},Polygon:function(n,t){ge(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)ge(e[r],t)
2308 },GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)fe(e[r],t)}};ta.geo.area=function(n){return bc=0,ta.geo.stream(n,wc),bc};var bc,_c=new le,wc={sphere:function(){bc+=4*Da},point:y,lineStart:y,lineEnd:y,polygonStart:function(){_c.reset(),wc.lineStart=pe},polygonEnd:function(){var n=2*_c;bc+=0>n?4*Da+n:n,wc.lineStart=wc.lineEnd=wc.point=y}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=ve([t*Fa,e*Fa]);if(m){var u=me(m,r),i=[u[1],-u[0],0],o=me(i,u);xe(o),o=be(o);var c=t-p,l=c>0?1:-1,v=o[0]*Ha*l,d=va(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Ha;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Ha;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=va(r)>180?r+(r>0?360:-360):r}else v=n,d=e;wc.point(n,e),t(n,e)}function i(){wc.lineStart()}function o(){u(v,d),wc.lineEnd(),va(y)>Ta&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,wc.polygonStart()},polygonEnd:function(){wc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>_c?(s=-(h=180),f=-(g=90)):y>Ta?g=90:-Ta>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){Sc=kc=Ec=Ac=Nc=Cc=zc=qc=Lc=Tc=Rc=0,ta.geo.stream(n,Dc);var t=Lc,e=Tc,r=Rc,u=t*t+e*e+r*r;return Ra>u&&(t=Cc,e=zc,r=qc,Ta>kc&&(t=Ec,e=Ac,r=Nc),u=t*t+e*e+r*r,Ra>u)?[0/0,0/0]:[Math.atan2(e,t)*Ha,tt(r/Math.sqrt(u))*Ha]};var Sc,kc,Ec,Ac,Nc,Cc,zc,qc,Lc,Tc,Rc,Dc={sphere:y,point:we,lineStart:ke,lineEnd:Ee,polygonStart:function(){Dc.lineStart=Ae},polygonEnd:function(){Dc.lineStart=ke}},Pc=Te(Ce,Ue,Fe,[-Da,-Da/2]),Uc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ze(Ve)}).raw=Ve,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ta,f+.12*l+Ta],[s-.214*l-Ta,f+.234*l-Ta]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ta,f+.166*l+Ta],[s-.115*l-Ta,f+.234*l-Ta]]).stream(c).point,n},n.scale(1070)};var jc,Fc,Hc,Oc,Yc,Ic,Zc={point:y,lineStart:y,lineEnd:y,polygonStart:function(){Fc=0,Zc.lineStart=Xe},polygonEnd:function(){Zc.lineStart=Zc.lineEnd=Zc.point=y,jc+=va(Fc/2)}},Vc={point:$e,lineStart:y,lineEnd:y,polygonStart:y,polygonEnd:y},Xc={point:Je,lineStart:Ge,lineEnd:Ke,polygonStart:function(){Xc.lineStart=Qe},polygonEnd:function(){Xc.point=Je,Xc.lineStart=Ge,Xc.lineEnd=Ke}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return jc=0,ta.geo.stream(n,u(Zc)),jc},n.centroid=function(n){return Ec=Ac=Nc=Cc=zc=qc=Lc=Tc=Rc=0,ta.geo.stream(n,u(Xc)),Rc?[Lc/Rc,Tc/Rc]:qc?[Cc/qc,zc/qc]:Nc?[Ec/Nc,Ac/Nc]:[0/0,0/0]},n.bounds=function(n){return Yc=Ic=-(Hc=Oc=1/0),ta.geo.stream(n,u(Vc)),[[Hc,Oc],[Yc,Ic]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||er(n):At,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Be:new nr(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new rr(t);for(var r in n)e[r]=n[r];return e}}},rr.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ta.geo.projection=ir,ta.geo.projectionMutator=or,(ta.geo.equirectangular=function(){return ir(cr)}).raw=cr.invert=cr,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Fa,t[1]*Fa),t[0]*=Ha,t[1]*=Ha,t}return n=sr(n[0]%360*Fa,n[1]*Fa,n.length>2?n[2]*Fa:0),t.invert=function(t){return t=n.invert(t[0]*Fa,t[1]*Fa),t[0]*=Ha,t[1]*=Ha,t},t},lr.invert=cr,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=sr(-n[0]*Fa,-n[1]*Fa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ha,n[1]*=Ha}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=pr((t=+r)*Fa,u*Fa),n):t},n.precision=function(r){return arguments.length?(e=pr(t*Fa,(u=+r)*Fa),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Fa,u=n[1]*Fa,i=t[1]*Fa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return va(n%d)>Ta}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return va(n%m)>Ta}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=dr(a,o,90),f=mr(r,e,y),h=dr(l,c,90),g=mr(i,u,y),n):y},n.majorExtent([[-180,-90+Ta],[180,90-Ta]]).minorExtent([[-180,-80-Ta],[180,80+Ta]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=yr,u=Mr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return xr(n[0]*Fa,n[1]*Fa,t[0]*Fa,t[1]*Fa)},ta.geo.length=function(n){return $c=0,ta.geo.stream(n,Bc),$c};var $c,Bc={sphere:y,point:y,lineStart:br,lineEnd:y,polygonStart:y,polygonEnd:y},Wc=_r(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ir(Wc)}).raw=Wc;var Jc=_r(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},At);(ta.geo.azimuthalEquidistant=function(){return ir(Jc)}).raw=Jc,(ta.geo.conicConformal=function(){return Ze(wr)}).raw=wr,(ta.geo.conicEquidistant=function(){return Ze(Sr)}).raw=Sr;var Gc=_r(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ir(Gc)}).raw=Gc,kr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-ja]},(ta.geo.mercator=function(){return Er(kr)}).raw=kr;var Kc=_r(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ir(Kc)}).raw=Kc;var Qc=_r(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ir(Qc)}).raw=Qc,Ar.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-ja]},(ta.geo.transverseMercator=function(){var n=Er(Ar),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ar,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(qr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=zr(a),s=zr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Nr,r=Cr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return xa(n,nl),n};var nl=ta.geom.polygon.prototype=[];nl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},nl.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},nl.clip=function(n){for(var t,e,r,u,i,o,a=Rr(n),c=-1,l=this.length-Rr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Lr(o,s,u)?(Lr(i,s,u)||n.push(Tr(i,o,s,u)),n.push(o)):Lr(i,s,u)&&n.push(Tr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var tl,el,rl,ul,il,ol=[],al=[];Yr.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Zr),t.length},nu.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},tu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=iu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,uu(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(uu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?iu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,uu(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,ru(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,uu(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ru(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,uu(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return ou(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ta)*Ta,y:Math.round(o(n,t)/Ta)*Ta,i:t}})}var r=Nr,u=Cr,i=r,o=u,a=cl;return n?t(n):(t.links=function(n){return ou(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ou(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Zr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&cu(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?cl:n,t):a===cl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===cl?null:a&&a[1]},t)};var cl=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(va(c-e)+va(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=fu()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=fu();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){hu(n,k,v,d,m,y)},k.find=function(n){return gu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Nr,c=Cr;return(o=arguments.length)?(a=lu,c=su,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=pu,ta.interpolateObject=vu,ta.interpolateNumber=du,ta.interpolateString=mu;var ll=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sl=new RegExp(ll.source,"g");ta.interpolate=yu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?tc.has(t)||/^(#|rgb\(|hsl\()/.test(t)?pu:mu:t instanceof ot?pu:Array.isArray(t)?Mu:"object"===e&&isNaN(t)?vu:du)(n,t)}],ta.interpolateArray=Mu;var fl=function(){return At},hl=ta.map({linear:fl,poly:Eu,quad:function(){return wu},cubic:function(){return Su},sin:function(){return Au},exp:function(){return Nu},circle:function(){return Cu},elastic:zu,back:qu,bounce:function(){return Lu}}),gl=ta.map({"in":At,out:bu,"in-out":_u,"out-in":function(n){return _u(bu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=hl.get(e)||fl,r=gl.get(r)||At,xu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Tu,ta.interpolateHsl=Ru,ta.interpolateLab=Du,ta.interpolateRound=Pu,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Uu(e?e.matrix:pl)})(n)},Uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Ou,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Zu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(Pa-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=vl,h=dl,g=-30,p=ml,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,M,x,b=m.length,_=y.length;for(e=0;_>e;++e)a=y[e],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(p=M*M+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,M*=p,x*=p,h.x-=M*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=M*(d=1-d),f.y+=x*d);if((d=r*v)&&(M=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(M-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Gu(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;l>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=y.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(At).on("dragstart.force",$u).on("drag.force",t).on("dragend.force",Bu)),arguments.length?(this.on("mouseover.force",Wu).on("mouseout.force",Ju).call(e),void 0):e},ta.rebind(a,c,"on")};var vl=20,dl=1,ml=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return ni(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ri,e=ti,r=ei;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qu(t,function(n){n.children&&(n.value=0)}),ni(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Ku(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===yl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=yl,r=0,u=Pa,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var yl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=At,e=ci,r=li,u=ai,i=ii,o=oi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:Ml.get(t)||ci,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:xl.get(t)||li,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var Ml=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(si),i=n.map(fi),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ci}),xl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:li});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=vi,u=gi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return pi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,ni(a,function(n){n.r=+s(n.value)}),ni(a,xi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;ni(a,function(n){n.r+=f}),ni(a,xi),ni(a,function(n){n.r-=f})}return wi(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(di),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Ku(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(ni(h,e),h.parent.m=-h.z,Qu(h,r),l)Qu(f,i);else{var g=f,p=f,v=f;Qu(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Qu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ci(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ai(o),u=Ei(u),o&&u;)c=Ei(c),i=Ai(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ni(zi(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ai(i)&&(i.t=o,i.m+=f-s),u&&!Ei(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=ki,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Ku(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;ni(c,function(n){var t=n.children;t&&t.length?(n.x=Li(t),n.y=qi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Ti(c),f=Ri(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return ni(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=ki,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Ku(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Di,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Di(t):Pi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Pi(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Di:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Ku(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;
2308 },GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)fe(e[r],t)}};ta.geo.area=function(n){return bc=0,ta.geo.stream(n,wc),bc};var bc,_c=new le,wc={sphere:function(){bc+=4*Da},point:y,lineStart:y,lineEnd:y,polygonStart:function(){_c.reset(),wc.lineStart=pe},polygonEnd:function(){var n=2*_c;bc+=0>n?4*Da+n:n,wc.lineStart=wc.lineEnd=wc.point=y}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=ve([t*Fa,e*Fa]);if(m){var u=me(m,r),i=[u[1],-u[0],0],o=me(i,u);xe(o),o=be(o);var c=t-p,l=c>0?1:-1,v=o[0]*Ha*l,d=va(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Ha;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Ha;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=va(r)>180?r+(r>0?360:-360):r}else v=n,d=e;wc.point(n,e),t(n,e)}function i(){wc.lineStart()}function o(){u(v,d),wc.lineEnd(),va(y)>Ta&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,wc.polygonStart()},polygonEnd:function(){wc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>_c?(s=-(h=180),f=-(g=90)):y>Ta?g=90:-Ta>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){Sc=kc=Ec=Ac=Nc=Cc=zc=qc=Lc=Tc=Rc=0,ta.geo.stream(n,Dc);var t=Lc,e=Tc,r=Rc,u=t*t+e*e+r*r;return Ra>u&&(t=Cc,e=zc,r=qc,Ta>kc&&(t=Ec,e=Ac,r=Nc),u=t*t+e*e+r*r,Ra>u)?[0/0,0/0]:[Math.atan2(e,t)*Ha,tt(r/Math.sqrt(u))*Ha]};var Sc,kc,Ec,Ac,Nc,Cc,zc,qc,Lc,Tc,Rc,Dc={sphere:y,point:we,lineStart:ke,lineEnd:Ee,polygonStart:function(){Dc.lineStart=Ae},polygonEnd:function(){Dc.lineStart=ke}},Pc=Te(Ce,Ue,Fe,[-Da,-Da/2]),Uc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ze(Ve)}).raw=Ve,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ta,f+.12*l+Ta],[s-.214*l-Ta,f+.234*l-Ta]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ta,f+.166*l+Ta],[s-.115*l-Ta,f+.234*l-Ta]]).stream(c).point,n},n.scale(1070)};var jc,Fc,Hc,Oc,Yc,Ic,Zc={point:y,lineStart:y,lineEnd:y,polygonStart:function(){Fc=0,Zc.lineStart=Xe},polygonEnd:function(){Zc.lineStart=Zc.lineEnd=Zc.point=y,jc+=va(Fc/2)}},Vc={point:$e,lineStart:y,lineEnd:y,polygonStart:y,polygonEnd:y},Xc={point:Je,lineStart:Ge,lineEnd:Ke,polygonStart:function(){Xc.lineStart=Qe},polygonEnd:function(){Xc.point=Je,Xc.lineStart=Ge,Xc.lineEnd=Ke}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return jc=0,ta.geo.stream(n,u(Zc)),jc},n.centroid=function(n){return Ec=Ac=Nc=Cc=zc=qc=Lc=Tc=Rc=0,ta.geo.stream(n,u(Xc)),Rc?[Lc/Rc,Tc/Rc]:qc?[Cc/qc,zc/qc]:Nc?[Ec/Nc,Ac/Nc]:[0/0,0/0]},n.bounds=function(n){return Yc=Ic=-(Hc=Oc=1/0),ta.geo.stream(n,u(Vc)),[[Hc,Oc],[Yc,Ic]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||er(n):At,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new Be:new nr(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new rr(t);for(var r in n)e[r]=n[r];return e}}},rr.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ta.geo.projection=ir,ta.geo.projectionMutator=or,(ta.geo.equirectangular=function(){return ir(cr)}).raw=cr.invert=cr,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Fa,t[1]*Fa),t[0]*=Ha,t[1]*=Ha,t}return n=sr(n[0]%360*Fa,n[1]*Fa,n.length>2?n[2]*Fa:0),t.invert=function(t){return t=n.invert(t[0]*Fa,t[1]*Fa),t[0]*=Ha,t[1]*=Ha,t},t},lr.invert=cr,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=sr(-n[0]*Fa,-n[1]*Fa,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Ha,n[1]*=Ha}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=pr((t=+r)*Fa,u*Fa),n):t},n.precision=function(r){return arguments.length?(e=pr(t*Fa,(u=+r)*Fa),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Fa,u=n[1]*Fa,i=t[1]*Fa,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return va(n%d)>Ta}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return va(n%m)>Ta}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=dr(a,o,90),f=mr(r,e,y),h=dr(l,c,90),g=mr(i,u,y),n):y},n.majorExtent([[-180,-90+Ta],[180,90-Ta]]).minorExtent([[-180,-80-Ta],[180,80+Ta]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=yr,u=Mr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return xr(n[0]*Fa,n[1]*Fa,t[0]*Fa,t[1]*Fa)},ta.geo.length=function(n){return $c=0,ta.geo.stream(n,Bc),$c};var $c,Bc={sphere:y,point:y,lineStart:br,lineEnd:y,polygonStart:y,polygonEnd:y},Wc=_r(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ir(Wc)}).raw=Wc;var Jc=_r(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},At);(ta.geo.azimuthalEquidistant=function(){return ir(Jc)}).raw=Jc,(ta.geo.conicConformal=function(){return Ze(wr)}).raw=wr,(ta.geo.conicEquidistant=function(){return Ze(Sr)}).raw=Sr;var Gc=_r(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ir(Gc)}).raw=Gc,kr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-ja]},(ta.geo.mercator=function(){return Er(kr)}).raw=kr;var Kc=_r(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ir(Kc)}).raw=Kc;var Qc=_r(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ir(Qc)}).raw=Qc,Ar.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-ja]},(ta.geo.transverseMercator=function(){var n=Er(Ar),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Ar,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(qr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=zr(a),s=zr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Nr,r=Cr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return xa(n,nl),n};var nl=ta.geom.polygon.prototype=[];nl.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},nl.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},nl.clip=function(n){for(var t,e,r,u,i,o,a=Rr(n),c=-1,l=this.length-Rr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],Lr(o,s,u)?(Lr(i,s,u)||n.push(Tr(i,o,s,u)),n.push(o)):Lr(i,s,u)&&n.push(Tr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var tl,el,rl,ul,il,ol=[],al=[];Yr.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Zr),t.length},nu.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},tu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=iu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,uu(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(uu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?iu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return n.C=!1,void 0;do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,uu(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,ru(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,uu(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,ru(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,uu(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return ou(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ta)*Ta,y:Math.round(o(n,t)/Ta)*Ta,i:t}})}var r=Nr,u=Cr,i=r,o=u,a=cl;return n?t(n):(t.links=function(n){return ou(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return ou(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Zr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&cu(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?cl:n,t):a===cl?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===cl?null:a&&a[1]},t)};var cl=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(va(c-e)+va(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=fu()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=fu();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){hu(n,k,v,d,m,y)},k.find=function(n){return gu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Nr,c=Cr;return(o=arguments.length)?(a=lu,c=su,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=pu,ta.interpolateObject=vu,ta.interpolateNumber=du,ta.interpolateString=mu;var ll=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sl=new RegExp(ll.source,"g");ta.interpolate=yu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?tc.has(t)||/^(#|rgb\(|hsl\()/.test(t)?pu:mu:t instanceof ot?pu:Array.isArray(t)?Mu:"object"===e&&isNaN(t)?vu:du)(n,t)}],ta.interpolateArray=Mu;var fl=function(){return At},hl=ta.map({linear:fl,poly:Eu,quad:function(){return wu},cubic:function(){return Su},sin:function(){return Au},exp:function(){return Nu},circle:function(){return Cu},elastic:zu,back:qu,bounce:function(){return Lu}}),gl=ta.map({"in":At,out:bu,"in-out":_u,"out-in":function(n){return _u(bu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=hl.get(e)||fl,r=gl.get(r)||At,xu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Tu,ta.interpolateHsl=Ru,ta.interpolateLab=Du,ta.interpolateRound=Pu,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Uu(e?e.matrix:pl)})(n)},Uu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var pl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Ou,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Zu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(Pa-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=vl,h=dl,g=-30,p=ml,v=.1,d=.64,m=[],y=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,M,x,b=m.length,_=y.length;for(e=0;_>e;++e)a=y[e],f=a.source,h=a.target,M=h.x-f.x,x=h.y-f.y,(p=M*M+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,M*=p,x*=p,h.x-=M*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=M*(d=1-d),f.y+=x*d);if((d=r*v)&&(M=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(M-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Gu(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(y=n,a):y},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;l>a;++a){var u=y[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=y.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=y[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,y[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,y[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(At).on("dragstart.force",$u).on("drag.force",t).on("dragend.force",Bu)),arguments.length?(this.on("mouseover.force",Wu).on("mouseout.force",Ju).call(e),void 0):e},ta.rebind(a,c,"on")};var vl=20,dl=1,ml=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return ni(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ri,e=ti,r=ei;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Qu(t,function(n){n.children&&(n.value=0)}),ni(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Ku(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===yl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=yl,r=0,u=Pa,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var yl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=At,e=ci,r=li,u=ai,i=ii,o=oi;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:Ml.get(t)||ci,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:xl.get(t)||li,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var Ml=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(si),i=n.map(fi),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ci}),xl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:li});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=vi,u=gi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return pi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,ni(a,function(n){n.r=+s(n.value)}),ni(a,xi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;ni(a,function(n){n.r+=f}),ni(a,xi),ni(a,function(n){n.r-=f})}return wi(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(di),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Ku(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(ni(h,e),h.parent.m=-h.z,Qu(h,r),l)Qu(f,i);else{var g=f,p=f,v=f;Qu(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Qu(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ci(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ai(o),u=Ei(u),o&&u;)c=Ei(c),i=Ai(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ni(zi(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ai(i)&&(i.t=o,i.m+=f-s),u&&!Ei(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=ki,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Ku(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;ni(c,function(n){var t=n.children;t&&t.length?(n.x=Li(t),n.y=qi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Ti(c),f=Ri(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return ni(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=ki,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Ku(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Di,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Di(t):Pi(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Pi(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Di:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Ku(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;
2309 do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var bl={floor:At,ceil:At};ta.scale.linear=function(){return Ii([0,1],[0,1],yu,!1)};var _l={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Gi(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=ta.format(".0e"),Sl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Ki(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return no([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(kl)},ta.scale.category20=function(){return ta.scale.ordinal().range(El)},ta.scale.category20b=function(){return ta.scale.ordinal().range(Al)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Nl)};var kl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),El=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),Al=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Nl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return to([],[])},ta.scale.quantize=function(){return eo(0,1,[0,1])},ta.scale.threshold=function(){return ro([.5],[0,1])},ta.scale.identity=function(){return uo([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-ja,f=a.apply(this,arguments)-ja,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ua)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===Cl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=Da?0:1;if(A&&fo(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=Da?0:1;if(E&&fo(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Tr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=ho(null==S?[_,w]:[S,k],[y,M],l,H,g),Y=ho([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^fo(O[1][0],O[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",H,",",H," 0 0,",v," ",Y[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",Y[0])}else N.push("M",y,",",M);if(null!=S){var I=Math.min(p,(n-F)/(j-1)),Z=ho([y,M],[S,k],n,-I,g),V=ho([_,w],null==x?[y,M]:[x,b],n,-I,g);p===I?N.push("L",V[0],"A",I,",",I," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^fo(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",I,",",I," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",I,",",I," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=oo,r=ao,u=io,i=Cl,o=co,a=lo,c=so;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==Cl?Cl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-ja;return[Math.cos(t)*n,Math.sin(t)*n]},n};var Cl="auto";ta.svg.line=function(){return go(At)};var zl=ta.map({linear:po,"linear-closed":vo,step:mo,"step-before":yo,"step-after":Mo,basis:ko,"basis-open":Eo,"basis-closed":Ao,bundle:No,cardinal:_o,"cardinal-open":xo,"cardinal-closed":bo,monotone:Ro});zl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var ql=[0,2/3,1/3,0],Ll=[0,1/3,2/3,0],Tl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=go(Do);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},yo.reverse=Mo,Mo.reverse=yo,ta.svg.area=function(){return Po(At)},ta.svg.area.radial=function(){var n=Po(Do);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-ja,s=l.call(n,u,r)-ja;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Da)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=yr,o=Mr,a=Uo,c=co,l=lo;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=yr,e=Mr,r=jo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=jo,e=n.projection;return n.projection=function(n){return arguments.length?e(Fo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(Rl.get(t.call(this,n,r))||Yo)(e.call(this,n,r))}var t=Oo,e=Ho;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var Rl=ta.map({circle:Yo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*jl)),e=t*jl;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=Rl.keys();var Dl,Pl,Ul=Math.sqrt(3),jl=Math.tan(30*Fa),Fl=[],Hl=0;Fl.call=ka.call,Fl.empty=ka.empty,Fl.node=ka.node,Fl.size=ka.size,ta.transition=function(n){return arguments.length?Dl?n.transition():n:Na.transition()},ta.transition.prototype=Fl,Fl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=k(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Io(o,i,u)},Fl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=E(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Io(c,a,o)},Fl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=j(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Io(u,this.namespace,this.id)},Fl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):H(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Fl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Ou:yu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Fl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Fl.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=oa.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=yu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Zo(this,"style."+n,t,u)},Fl.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,oa.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Fl.text=function(n){return Zo(this,"text",n,Vo)},Fl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Fl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),H(this,function(r){r[e][t].ease=n}))},Fl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:H(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Fl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:H(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Fl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Pl,i=Dl;Dl=e,H(this,function(t,u,i){Pl=t[r][e],n.call(t,t.__data__,u,i)}),Pl=u,Dl=i}else H(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Fl.transition=function(){for(var n,t,e,r,u=this.id,i=++Hl,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Io(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):At:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ta),d=ta.transition(p.exit()).style("opacity",Ta).remove(),m=ta.transition(p.order()).style("opacity",1),y=Math.max(u,0)+o,M=ji(f),x=l.selectAll(".domain").data([0]),b=(x.enter().append("path").attr("class","domain"),ta.transition(x));v.append("line"),v.append("text");var _,w,S,k,E=v.select("line"),A=m.select("line"),N=p.select("text").text(g),C=v.select("text"),z=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,_="x",S="y",w="x2",k="y2",N.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),b.attr("d","M"+M[0]+","+q*i+"V0H"+M[1]+"V"+q*i)):(n=Wo,_="y",S="x",w="y2",k="x2",N.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),b.attr("d","M"+q*i+","+M[0]+"H0V"+M[1]+"H"+q*i)),E.attr(k,q*u),C.attr(S,q*y),A.attr(w,0).attr(k,q*u),z.attr(_,0).attr(S,q*y),f.rangeBand){var L=f,T=L.rangeBand()/2;s=f=function(n){return L(n)+T}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=Ol,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Yl?t+"":Ol,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Ol="bottom",Yl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(i){i.each(function(){var i=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,At);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Il[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var s,f=ta.transition(i),h=ta.transition(o);c&&(s=ji(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),e(f)),l&&(s=ji(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==ta.event.keyCode&&(N||(y=null,z[0]-=s[1],z[1]-=f[1],N=2),b())}function p(){32==ta.event.keyCode&&2==N&&(z[0]+=s[1],z[1]+=f[1],N=0,b())}function v(){var n=ta.mouse(x),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),N||(ta.event.altKey?(y||(y=[(s[0]+s[1])/2,(f[0]+f[1])/2]),z[0]=s[+(n[0]<y[0])],z[1]=f[+(n[1]<y[1])]):y=null),E&&d(n,c,0)&&(e(S),u=!0),A&&d(n,l,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:N?"move":"resize"}))}function d(n,t,e){var r,u,a=ji(t),c=a[0],l=a[1],p=z[e],v=e?f:s,d=v[1]-v[0];return N&&(c-=p,l-=d+p),r=(e?g:h)?Math.max(c,Math.min(l,n[e])):n[e],N?u=(r+=p)+d:(y&&(p=Math.max(c,Math.min(l,2*y[e]-r))),r>p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),w({type:"brushend"})}var y,M,x=this,_=ta.select(ta.event.target),w=a.of(x,arguments),S=ta.select(x),k=_.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&l,N=_.classed("extent"),C=$(),z=ta.mouse(x),q=ta.select(oa).on("keydown.brush",u).on("keyup.brush",p);if(ta.event.changedTouches?q.on("touchmove.brush",v).on("touchend.brush",m):q.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),N)z[0]=s[0]-z[0],z[1]=f[0]-z[1];else if(k){var L=+/w$/.test(k),T=+/^n/.test(k);M=[s[1-L]-z[0],f[1-T]-z[1]],z[0]=s[L],z[1]=f[T]}else ta.event.altKey&&(y=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=w(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],f=[0,0],h=!0,g=!0,p=Zl[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Dl?ta.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,s=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=Mu(s,t.x),r=Mu(f,t.y);return i=o=null,function(u){s=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=Zl[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,p=Zl[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(h=!!t[0],g=!!t[1]):c?h=!!t:l&&(g=!!t),n):c&&l?[h,g]:c?h:l?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=s[0]||r!=s[1])&&(s=[e,r])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),l&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(h=u,u=a,a=h))),c&&l?[[e,u],[r,a]]:c?[e,r]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&f[0]==f[1]},ta.rebind(n,a,"on")};var Il={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Zl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=fc.format=mc.timeFormat,Xl=Vl.utc,$l=Xl("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:$l,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=$l.toString,fc.second=Ht(function(n){return new hc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),fc.seconds=fc.second.range,fc.seconds.utc=fc.second.utc.range,fc.minute=Ht(function(n){return new hc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),fc.minutes=fc.minute.range,fc.minutes.utc=fc.minute.utc.range,fc.hour=Ht(function(n){var t=n.getTimezoneOffset()/60;return new hc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),fc.hours=fc.hour.range,fc.hours.utc=fc.hour.utc.range,fc.month=Ht(function(n){return n=fc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),fc.months=fc.month.range,fc.months.utc=fc.month.utc.range;var Bl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Wl=[[fc.second,1],[fc.second,5],[fc.second,15],[fc.second,30],[fc.minute,1],[fc.minute,5],[fc.minute,15],[fc.minute,30],[fc.hour,1],[fc.hour,3],[fc.hour,6],[fc.hour,12],[fc.day,1],[fc.day,2],[fc.week,1],[fc.month,1],[fc.month,3],[fc.year,1]],Jl=Vl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ce]]),Gl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:At,ceil:At};Wl.year=fc.year,fc.scale=function(){return Go(ta.scale.linear(),Wl,Jl)};var Kl=Wl.map(function(n){return[n[0].utc,n[1]]}),Ql=Xl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ce]]);Kl.year=fc.year.utc,fc.scale.utc=function(){return Go(ta.scale.linear(),Kl,Ql)},ta.text=Nt(function(n){return n.responseText}),ta.json=function(n,t){return Ct(n,"application/json",Qo,t)},ta.html=function(n,t){return Ct(n,"text/html",na,t)},ta.xml=Nt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();
2309 do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var bl={floor:At,ceil:At};ta.scale.linear=function(){return Ii([0,1],[0,1],yu,!1)};var _l={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Gi(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var wl=ta.format(".0e"),Sl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Ki(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return no([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(kl)},ta.scale.category20=function(){return ta.scale.ordinal().range(El)},ta.scale.category20b=function(){return ta.scale.ordinal().range(Al)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Nl)};var kl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),El=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),Al=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Nl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return to([],[])},ta.scale.quantize=function(){return eo(0,1,[0,1])},ta.scale.threshold=function(){return ro([.5],[0,1])},ta.scale.identity=function(){return uo([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-ja,f=a.apply(this,arguments)-ja,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ua)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===Cl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=Da?0:1;if(A&&fo(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=Da?0:1;if(E&&fo(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Tr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=ho(null==S?[_,w]:[S,k],[y,M],l,H,g),Y=ho([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^fo(O[1][0],O[1][1],Y[1][0],Y[1][1]),",",g," ",Y[1],"A",H,",",H," 0 0,",v," ",Y[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",Y[0])}else N.push("M",y,",",M);if(null!=S){var I=Math.min(p,(n-F)/(j-1)),Z=ho([y,M],[S,k],n,-I,g),V=ho([_,w],null==x?[y,M]:[x,b],n,-I,g);p===I?N.push("L",V[0],"A",I,",",I," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^fo(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",I,",",I," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",I,",",I," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=oo,r=ao,u=io,i=Cl,o=co,a=lo,c=so;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==Cl?Cl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-ja;return[Math.cos(t)*n,Math.sin(t)*n]},n};var Cl="auto";ta.svg.line=function(){return go(At)};var zl=ta.map({linear:po,"linear-closed":vo,step:mo,"step-before":yo,"step-after":Mo,basis:ko,"basis-open":Eo,"basis-closed":Ao,bundle:No,cardinal:_o,"cardinal-open":xo,"cardinal-closed":bo,monotone:Ro});zl.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var ql=[0,2/3,1/3,0],Ll=[0,1/3,2/3,0],Tl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=go(Do);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},yo.reverse=Mo,Mo.reverse=yo,ta.svg.area=function(){return Po(At)},ta.svg.area.radial=function(){var n=Po(Do);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-ja,s=l.call(n,u,r)-ja;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>Da)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=yr,o=Mr,a=Uo,c=co,l=lo;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=yr,e=Mr,r=jo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=jo,e=n.projection;return n.projection=function(n){return arguments.length?e(Fo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(Rl.get(t.call(this,n,r))||Yo)(e.call(this,n,r))}var t=Oo,e=Ho;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var Rl=ta.map({circle:Yo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*jl)),e=t*jl;return"M0,"+-t+"L"+e+",0"+" 0,"+t+" "+-e+",0"+"Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/Ul),e=t*Ul/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=Rl.keys();var Dl,Pl,Ul=Math.sqrt(3),jl=Math.tan(30*Fa),Fl=[],Hl=0;Fl.call=ka.call,Fl.empty=ka.empty,Fl.node=ka.node,Fl.size=ka.size,ta.transition=function(n){return arguments.length?Dl?n.transition():n:Na.transition()},ta.transition.prototype=Fl,Fl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=k(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Io(o,i,u)},Fl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=E(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Io(c,a,o)},Fl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=j(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Io(u,this.namespace,this.id)},Fl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):H(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Fl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Ou:yu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Fl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Fl.style=function(n,t,e){function r(){this.style.removeProperty(n)}function u(t){return null==t?r:(t+="",function(){var r,u=oa.getComputedStyle(this,null).getPropertyValue(n);return u!==t&&(r=yu(u,t),function(t){this.style.setProperty(n,r(t),e)})})}var i=arguments.length;if(3>i){if("string"!=typeof n){2>i&&(t="");for(e in n)this.style(e,n[e],t);return this}e=""}return Zo(this,"style."+n,t,u)},Fl.styleTween=function(n,t,e){function r(r,u){var i=t.call(this,r,u,oa.getComputedStyle(this,null).getPropertyValue(n));return i&&function(t){this.style.setProperty(n,i(t),e)}}return arguments.length<3&&(e=""),this.tween("style."+n,r)},Fl.text=function(n){return Zo(this,"text",n,Vo)},Fl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Fl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),H(this,function(r){r[e][t].ease=n}))},Fl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:H(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Fl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:H(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Fl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Pl,i=Dl;Dl=e,H(this,function(t,u,i){Pl=t[r][e],n.call(t,t.__data__,u,i)}),Pl=u,Dl=i}else H(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Fl.transition=function(){for(var n,t,e,r,u=this.id,i=++Hl,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Io(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):At:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ta),d=ta.transition(p.exit()).style("opacity",Ta).remove(),m=ta.transition(p.order()).style("opacity",1),y=Math.max(u,0)+o,M=ji(f),x=l.selectAll(".domain").data([0]),b=(x.enter().append("path").attr("class","domain"),ta.transition(x));v.append("line"),v.append("text");var _,w,S,k,E=v.select("line"),A=m.select("line"),N=p.select("text").text(g),C=v.select("text"),z=m.select("text"),q="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,_="x",S="y",w="x2",k="y2",N.attr("dy",0>q?"0em":".71em").style("text-anchor","middle"),b.attr("d","M"+M[0]+","+q*i+"V0H"+M[1]+"V"+q*i)):(n=Wo,_="y",S="x",w="y2",k="x2",N.attr("dy",".32em").style("text-anchor",0>q?"end":"start"),b.attr("d","M"+q*i+","+M[0]+"H0V"+M[1]+"H"+q*i)),E.attr(k,q*u),C.attr(S,q*y),A.attr(w,0).attr(k,q*u),z.attr(_,0).attr(S,q*y),f.rangeBand){var L=f,T=L.rangeBand()/2;s=f=function(n){return L(n)+T}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=Ol,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Yl?t+"":Ol,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var Ol="bottom",Yl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(i){i.each(function(){var i=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",u).on("touchstart.brush",u),o=i.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),i.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=i.selectAll(".resize").data(p,At);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Il[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var s,f=ta.transition(i),h=ta.transition(o);c&&(s=ji(c),h.attr("x",s[0]).attr("width",s[1]-s[0]),e(f)),l&&(s=ji(l),h.attr("y",s[0]).attr("height",s[1]-s[0]),r(f)),t(f)})}function t(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+s[+/e$/.test(n)]+","+f[+/^s/.test(n)]+")"})}function e(n){n.select(".extent").attr("x",s[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",s[1]-s[0])}function r(n){n.select(".extent").attr("y",f[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",f[1]-f[0])}function u(){function u(){32==ta.event.keyCode&&(N||(y=null,z[0]-=s[1],z[1]-=f[1],N=2),b())}function p(){32==ta.event.keyCode&&2==N&&(z[0]+=s[1],z[1]+=f[1],N=0,b())}function v(){var n=ta.mouse(x),u=!1;M&&(n[0]+=M[0],n[1]+=M[1]),N||(ta.event.altKey?(y||(y=[(s[0]+s[1])/2,(f[0]+f[1])/2]),z[0]=s[+(n[0]<y[0])],z[1]=f[+(n[1]<y[1])]):y=null),E&&d(n,c,0)&&(e(S),u=!0),A&&d(n,l,1)&&(r(S),u=!0),u&&(t(S),w({type:"brush",mode:N?"move":"resize"}))}function d(n,t,e){var r,u,a=ji(t),c=a[0],l=a[1],p=z[e],v=e?f:s,d=v[1]-v[0];return N&&(c-=p,l-=d+p),r=(e?g:h)?Math.max(c,Math.min(l,n[e])):n[e],N?u=(r+=p)+d:(y&&(p=Math.max(c,Math.min(l,2*y[e]-r))),r>p?(u=r,r=p):u=p),v[0]!=r||v[1]!=u?(e?o=null:i=null,v[0]=r,v[1]=u,!0):void 0}function m(){v(),S.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),q.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),C(),w({type:"brushend"})}var y,M,x=this,_=ta.select(ta.event.target),w=a.of(x,arguments),S=ta.select(x),k=_.datum(),E=!/^(n|s)$/.test(k)&&c,A=!/^(e|w)$/.test(k)&&l,N=_.classed("extent"),C=$(),z=ta.mouse(x),q=ta.select(oa).on("keydown.brush",u).on("keyup.brush",p);if(ta.event.changedTouches?q.on("touchmove.brush",v).on("touchend.brush",m):q.on("mousemove.brush",v).on("mouseup.brush",m),S.interrupt().selectAll("*").interrupt(),N)z[0]=s[0]-z[0],z[1]=f[0]-z[1];else if(k){var L=+/w$/.test(k),T=+/^n/.test(k);M=[s[1-L]-z[0],f[1-T]-z[1]],z[0]=s[L],z[1]=f[T]}else ta.event.altKey&&(y=z.slice());S.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),v()}var i,o,a=w(n,"brushstart","brush","brushend"),c=null,l=null,s=[0,0],f=[0,0],h=!0,g=!0,p=Zl[0];return n.event=function(n){n.each(function(){var n=a.of(this,arguments),t={x:s,y:f,i:i,j:o},e=this.__chart__||t;this.__chart__=t,Dl?ta.select(this).transition().each("start.brush",function(){i=e.i,o=e.j,s=e.x,f=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=Mu(s,t.x),r=Mu(f,t.y);return i=o=null,function(u){s=t.x=e(u),f=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){i=t.i,o=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(c=t,p=Zl[!c<<1|!l],n):c},n.y=function(t){return arguments.length?(l=t,p=Zl[!c<<1|!l],n):l},n.clamp=function(t){return arguments.length?(c&&l?(h=!!t[0],g=!!t[1]):c?h=!!t:l&&(g=!!t),n):c&&l?[h,g]:c?h:l?g:null},n.extent=function(t){var e,r,u,a,h;return arguments.length?(c&&(e=t[0],r=t[1],l&&(e=e[0],r=r[0]),i=[e,r],c.invert&&(e=c(e),r=c(r)),e>r&&(h=e,e=r,r=h),(e!=s[0]||r!=s[1])&&(s=[e,r])),l&&(u=t[0],a=t[1],c&&(u=u[1],a=a[1]),o=[u,a],l.invert&&(u=l(u),a=l(a)),u>a&&(h=u,u=a,a=h),(u!=f[0]||a!=f[1])&&(f=[u,a])),n):(c&&(i?(e=i[0],r=i[1]):(e=s[0],r=s[1],c.invert&&(e=c.invert(e),r=c.invert(r)),e>r&&(h=e,e=r,r=h))),l&&(o?(u=o[0],a=o[1]):(u=f[0],a=f[1],l.invert&&(u=l.invert(u),a=l.invert(a)),u>a&&(h=u,u=a,a=h))),c&&l?[[e,u],[r,a]]:c?[e,r]:l&&[u,a])},n.clear=function(){return n.empty()||(s=[0,0],f=[0,0],i=o=null),n},n.empty=function(){return!!c&&s[0]==s[1]||!!l&&f[0]==f[1]},ta.rebind(n,a,"on")};var Il={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Zl=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Vl=fc.format=mc.timeFormat,Xl=Vl.utc,$l=Xl("%Y-%m-%dT%H:%M:%S.%LZ");Vl.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:$l,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=$l.toString,fc.second=Ht(function(n){return new hc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),fc.seconds=fc.second.range,fc.seconds.utc=fc.second.utc.range,fc.minute=Ht(function(n){return new hc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),fc.minutes=fc.minute.range,fc.minutes.utc=fc.minute.utc.range,fc.hour=Ht(function(n){var t=n.getTimezoneOffset()/60;return new hc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),fc.hours=fc.hour.range,fc.hours.utc=fc.hour.utc.range,fc.month=Ht(function(n){return n=fc.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),fc.months=fc.month.range,fc.months.utc=fc.month.utc.range;var Bl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Wl=[[fc.second,1],[fc.second,5],[fc.second,15],[fc.second,30],[fc.minute,1],[fc.minute,5],[fc.minute,15],[fc.minute,30],[fc.hour,1],[fc.hour,3],[fc.hour,6],[fc.hour,12],[fc.day,1],[fc.day,2],[fc.week,1],[fc.month,1],[fc.month,3],[fc.year,1]],Jl=Vl.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ce]]),Gl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:At,ceil:At};Wl.year=fc.year,fc.scale=function(){return Go(ta.scale.linear(),Wl,Jl)};var Kl=Wl.map(function(n){return[n[0].utc,n[1]]}),Ql=Xl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ce]]);Kl.year=fc.year.utc,fc.scale.utc=function(){return Go(ta.scale.linear(),Kl,Ql)},ta.text=Nt(function(n){return n.responseText}),ta.json=function(n,t){return Ct(n,"application/json",Qo,t)},ta.html=function(n,t){return Ct(n,"text/html",na,t)},ta.xml=Nt(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();
2310 ;!function(a){"use strict";function b(a){this.owner=a}function c(a,b){if(Object.create)b.prototype=Object.create(a.prototype);else{var c=function(){};c.prototype=a.prototype,b.prototype=new c}return b.prototype.constructor=b,b}function d(a){var b=this.internal=new e(this);b.loadConfig(a),b.beforeInit(a),b.init(),b.afterInit(a),function c(a,b,d){Object.keys(a).forEach(function(e){b[e]=a[e].bind(d),Object.keys(a[e]).length>0&&c(a[e],b[e],d)})}(h,this,this)}function e(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function f(a){b.call(this,a)}function g(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+u)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,n);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=p.copy();return b.isCategory&&(a=p.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var b=m?m(a):a;return"undefined"!=typeof b?b:""}function i(a){if(A)return A;var b={h:11.5,w:5.5};return a.select("text").text(h).each(function(a){var c=this.getBoundingClientRect(),d=h(a),e=c.height,f=d?c.width/d.length:void 0;e&&f&&(b.h=e,b.w=f)}).text(""),A=b,b}function j(c){return b.withoutTransition?c:a.transition(c)}function k(m){m.each(function(){function m(a,c){function d(a,b){f=void 0;for(var h=1;h<b.length;h++)if(" "===b.charAt(h)&&(f=h),e=b.substr(0,h+1),g=U.w*e.length,g>c)return d(a.concat(b.substr(0,f?f:h)),b.slice(f?f+1:h));return a.concat(b)}var e,f,g,i=h(a),j=[];return"[object Array]"===Object.prototype.toString.call(i)?i:((!c||0>=c)&&(c=X?95:b.isCategory?Math.ceil(F(G[1])-F(G[0]))-12:110),d(j,i+""))}function n(a,b){var c=U.h;return 0===b&&(c="left"===q||"right"===q?-((V[a.index]-1)*(U.h/2)-3):".71em"),c}function v(a){var b=p(a)+(o?0:u);return L[0]<b&&b<L[1]?r:0}function w(a){return a?a>0?"start":"end":"middle"}function x(a){return a?"rotate("+a+")":""}function y(a){return a?8*Math.sin(Math.PI*(a/180)):0}function z(a){return a?11.5-2.5*(a/15)*(a>0?1:-1):W}var A,B,C,D=k.g=a.select(this),E=this.__chart__||p,F=this.__chart__=g(),G=t?t:f(F),H=D.selectAll(".tick").data(G,F),I=H.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),J=H.exit().remove(),K=j(H).style("opacity",1),L=p.rangeExtent?p.rangeExtent():e(p.range()),M=D.selectAll(".domain").data([0]),N=(M.enter().append("path").attr("class","domain"),j(M));I.append("line"),I.append("text");var O=I.select("line"),P=K.select("line"),Q=I.select("text"),R=K.select("text");b.isCategory?(u=Math.ceil((F(1)-F(0))/2),B=o?0:u,C=o?u:0):u=B=0;var S,T,U=i(D.select(".tick")),V=[],W=Math.max(r,0)+s,X="left"===q||"right"===q;S=H.select("text"),T=S.selectAll("tspan").data(function(a,c){var d=b.tickMultiline?m(a,b.tickWidth):[].concat(h(a));return V[c]=d.length,d.map(function(a){return{index:c,splitted:a}})}),T.enter().append("tspan"),T.exit().remove(),T.text(function(a){return a.splitted});var Y=b.tickTextRotate;switch(q){case"bottom":A=c,O.attr("y2",r),Q.attr("y",W),P.attr("x1",B).attr("x2",B).attr("y2",v),R.attr("x",0).attr("y",z(Y)).style("text-anchor",w(Y)).attr("transform",x(Y)),T.attr("x",0).attr("dy",n).attr("dx",y(Y)),N.attr("d","M"+L[0]+","+l+"V0H"+L[1]+"V"+l);break;case"top":A=c,O.attr("y2",-r),Q.attr("y",-W),P.attr("x2",0).attr("y2",-r),R.attr("x",0).attr("y",-W),S.style("text-anchor","middle"),T.attr("x",0).attr("dy","0em"),N.attr("d","M"+L[0]+","+-l+"V0H"+L[1]+"V"+-l);break;case"left":A=d,O.attr("x2",-r),Q.attr("x",-W),P.attr("x2",-r).attr("y1",C).attr("y2",C),R.attr("x",-W).attr("y",u),S.style("text-anchor","end"),T.attr("x",-W).attr("dy",n),N.attr("d","M"+-l+","+L[0]+"H0V"+L[1]+"H"+-l);break;case"right":A=d,O.attr("x2",r),Q.attr("x",W),P.attr("x2",r).attr("y2",0),R.attr("x",W).attr("y",0),S.style("text-anchor","start"),T.attr("x",W).attr("dy",n),N.attr("d","M"+l+","+L[0]+"H0V"+L[1]+"H"+l)}if(F.rangeBand){var Z=F,$=Z.rangeBand()/2;E=F=function(a){return Z(a)+$}}else E.rangeBand?E=F:J.call(A,F);I.call(A,E),K.call(A,F)})}var l,m,n,o,p=a.scale.linear(),q="bottom",r=6,s=3,t=null,u=0,v=!0;return b=b||{},l=b.withOuterTick?6:0,k.scale=function(a){return arguments.length?(p=a,k):p},k.orient=function(a){return arguments.length?(q=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",k):q},k.tickFormat=function(a){return arguments.length?(m=a,k):m},k.tickCentered=function(a){return arguments.length?(o=a,k):o},k.tickOffset=function(){return u},k.tickInterval=function(){var a,c;return b.isCategory?a=2*u:(c=k.g.select("path.domain").node().getTotalLength()-2*l,a=c/k.g.selectAll("line").size()),a===1/0?0:a},k.ticks=function(){return arguments.length?(n=arguments,k):n},k.tickCulling=function(a){return arguments.length?(v=a,k):v},k.tickValues=function(a){if("function"==typeof a)t=function(){return a(p.domain())};else{if(!arguments.length)return t;t=a}return k},k}var h,i,j,k={version:"0.4.11"};k.generate=function(a){return new d(a)},k.chart={fn:d.prototype,internal:{fn:e.prototype,axis:{fn:f.prototype}}},h=k.chart.fn,i=k.chart.internal.fn,j=k.chart.internal.axis.fn,i.beforeInit=function(){},i.afterInit=function(){},i.init=function(){var a=this,b=a.config;if(a.initParams(),b.data_url)a.convertUrlToData(b.data_url,b.data_mimeType,b.data_headers,b.data_keys,a.initWithData);else if(b.data_json)a.initWithData(a.convertJsonToData(b.data_json,b.data_keys));else if(b.data_rows)a.initWithData(a.convertRowsToData(b.data_rows));else{if(!b.data_columns)throw Error("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b.data_columns))}},i.initParams=function(){var a=this,b=a.d3,c=a.config;a.clipId="c3-"+ +new Date+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxis=a.clipId+"-yaxis",a.clipIdForGrid=a.clipId+"-grid",a.clipIdForSubchart=a.clipId+"-subchart",a.clipPath=a.getClipPath(a.clipId),a.clipPathForXAxis=a.getClipPath(a.clipIdForXAxis),a.clipPathForYAxis=a.getClipPath(a.clipIdForYAxis),a.clipPathForGrid=a.getClipPath(a.clipIdForGrid),a.clipPathForSubchart=a.getClipPath(a.clipIdForSubchart),a.dragStart=null,a.dragging=!1,a.flowing=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.dataTimeFormat=c.data_xLocaltime?b.time.format:b.time.format.utc,a.axisTimeFormat=c.axis_x_localtime?b.time.format:b.time.format.utc,a.defaultAxisTimeFormat=a.axisTimeFormat.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.focusedTargetIds=[],a.defocusedTargetIds=[],a.xOrient=c.axis_rotated?"left":"bottom",a.yOrient=c.axis_rotated?c.axis_y_inner?"top":"bottom":c.axis_y_inner?"right":"left",a.y2Orient=c.axis_rotated?c.axis_y2_inner?"bottom":"top":c.axis_y2_inner?"left":"right",a.subXOrient=c.axis_rotated?"left":"bottom",a.isLegendRight="right"===c.legend_position,a.isLegendInset="inset"===c.legend_position,a.isLegendTop="top-left"===c.legend_inset_anchor||"top-right"===c.legend_inset_anchor,a.isLegendLeft="top-left"===c.legend_inset_anchor||"bottom-left"===c.legend_inset_anchor,a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.currentMaxTickWidths={x:0,y:0,y2:0},a.rotated_padding_left=30,a.rotated_padding_right=c.axis_rotated&&!c.axis_x_show?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.intervalForObserveInserted=void 0,a.axes.subx=b.selectAll([])},i.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},i.initWithData=function(a){var b,c,d=this,e=d.d3,g=d.config,h=!0;d.axis=new f(d),d.initPie&&d.initPie(),d.initBrush&&d.initBrush(),d.initZoom&&d.initZoom(),g.bindto?"function"==typeof g.bindto.node?d.selectChart=g.bindto:d.selectChart=e.select(g.bindto):d.selectChart=e.selectAll([]),d.selectChart.empty()&&(d.selectChart=e.select(document.createElement("div")).style("opacity",0),d.observeInserted(d.selectChart),h=!1),d.selectChart.html("").classed("c3",!0),d.data.xs={},d.data.targets=d.convertDataToTargets(a),g.data_filter&&(d.data.targets=d.data.targets.filter(g.data_filter)),g.data_hide&&d.addHiddenTargetIds(g.data_hide===!0?d.mapToIds(d.data.targets):g.data_hide),g.legend_hide&&d.addHiddenLegendIds(g.legend_hide===!0?d.mapToIds(d.data.targets):g.legend_hide),d.hasType("gauge")&&(g.legend_show=!1),d.updateSizes(),d.updateScales(),d.x.domain(e.extent(d.getXDomain(d.data.targets))),d.y.domain(d.getYDomain(d.data.targets,"y")),d.y2.domain(d.getYDomain(d.data.targets,"y2")),d.subX.domain(d.x.domain()),d.subY.domain(d.y.domain()),d.subY2.domain(d.y2.domain()),d.orgXDomain=d.x.domain(),d.brush&&d.brush.scale(d.subX),g.zoom_enabled&&d.zoom.scale(d.x),d.svg=d.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return g.onmouseover.call(d)}).on("mouseleave",function(){return g.onmouseout.call(d)}),d.config.svg_classname&&d.svg.attr("class",d.config.svg_classname),b=d.svg.append("defs"),d.clipChart=d.appendClip(b,d.clipId),d.clipXAxis=d.appendClip(b,d.clipIdForXAxis),d.clipYAxis=d.appendClip(b,d.clipIdForYAxis),d.clipGrid=d.appendClip(b,d.clipIdForGrid),d.clipSubchart=d.appendClip(b,d.clipIdForSubchart),d.updateSvgSize(),c=d.main=d.svg.append("g").attr("transform",d.getTranslate("main")),d.initSubchart&&d.initSubchart(),d.initTooltip&&d.initTooltip(),d.initLegend&&d.initLegend(),d.initTitle&&d.initTitle(),c.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),d.initRegion(),d.initGrid(),c.append("g").attr("clip-path",d.clipPath).attr("class",l.chart),g.grid_lines_front&&d.initGridLines(),d.initEventRect(),d.initChartElements(),c.insert("rect",g.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",d.width).attr("height",d.height).style("opacity",0).on("dblclick.zoom",null),g.axis_x_extent&&d.brush.extent(d.getDefaultExtent()),d.axis.init(),d.updateTargets(d.data.targets),h&&(d.updateDimension(),d.config.oninit.call(d),d.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),d.bindResize(),d.api.element=d.selectChart.node()},i.smoothLines=function(a,b){var c=this;"grid"===b&&a.each(function(){var a=c.d3.select(this),b=a.attr("x1"),d=a.attr("x2"),e=a.attr("y1"),f=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(d),y1:Math.ceil(e),y2:Math.ceil(f)})})},i.updateSizes=function(){var a=this,b=a.config,c=a.legend?a.getLegendHeight():0,d=a.legend?a.getLegendWidth():0,e=a.isLegendRight||a.isLegendInset?0:c,f=a.hasArcType(),g=b.axis_rotated||f?0:a.getHorizontalAxisHeight("x"),h=b.subchart_show&&!f?b.subchart_size_height+g:0;a.currentWidth=a.getCurrentWidth(),a.currentHeight=a.getCurrentHeight(),a.margin=b.axis_rotated?{top:a.getHorizontalAxisHeight("y2")+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:a.getHorizontalAxisHeight("y")+e+a.getCurrentPaddingBottom(),left:h+(f?0:a.getCurrentPaddingLeft())}:{top:4+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:g+h+e+a.getCurrentPaddingBottom(),left:f?0:a.getCurrentPaddingLeft()},a.margin2=b.axis_rotated?{top:a.margin.top,right:NaN,bottom:20+e,left:a.rotated_padding_left}:{top:a.currentHeight-h-e,right:NaN,bottom:g+e,left:a.margin.left},a.margin3={top:0,right:NaN,bottom:0,left:0},a.updateSizeForLegend&&a.updateSizeForLegend(c,d),a.width=a.currentWidth-a.margin.left-a.margin.right,a.height=a.currentHeight-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=b.axis_rotated?a.margin.left-a.rotated_padding_left-a.rotated_padding_right:a.width,a.height2=b.axis_rotated?a.height:a.currentHeight-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),a.arcWidth=a.width-(a.isLegendRight?d+10:0),a.arcHeight=a.height-(a.isLegendRight?0:10),a.hasType("gauge")&&!b.gauge_fullCircle&&(a.arcHeight+=a.height-a.getGaugeLabelHeight()),a.updateRadius&&a.updateRadius(),a.isLegendRight&&f&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)},i.updateTargets=function(a){var b=this;b.updateTargetsForText(a),b.updateTargetsForBar(a),b.updateTargetsForLine(a),b.hasArcType()&&b.updateTargetsForArc&&b.updateTargetsForArc(a),b.updateTargetsForSubchart&&b.updateTargetsForSubchart(a),b.showTargets()},i.showTargets=function(){var a=this;a.svg.selectAll("."+l.target).filter(function(b){return a.isTargetToShow(b.id)}).transition().duration(a.config.transition_duration).style("opacity",1)},i.redraw=function(a,b){var c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H=this,I=H.main,J=H.d3,K=H.config,L=H.getShapeIndices(H.isAreaType),M=H.getShapeIndices(H.isBarType),N=H.getShapeIndices(H.isLineType),O=H.hasArcType(),P=H.filterTargetsToShow(H.data.targets),Q=H.xv.bind(H);if(a=a||{},c=w(a,"withY",!0),d=w(a,"withSubchart",!0),e=w(a,"withTransition",!0),h=w(a,"withTransform",!1),i=w(a,"withUpdateXDomain",!1),j=w(a,"withUpdateOrgXDomain",!1),k=w(a,"withTrimXDomain",!0),p=w(a,"withUpdateXAxis",i),m=w(a,"withLegend",!1),n=w(a,"withEventRect",!0),o=w(a,"withDimension",!0),f=w(a,"withTransitionForExit",e),g=w(a,"withTransitionForAxis",e),v=e?K.transition_duration:0,x=f?v:0,y=g?v:0,b=b||H.axis.generateTransitions(y),m&&K.legend_show?H.updateLegend(H.mapToIds(H.data.targets),a,b):o&&H.updateDimension(!0),H.isCategorized()&&0===P.length&&H.x.domain([0,H.axes.x.selectAll(".tick").size()]),P.length?(H.updateXDomain(P,i,j,k),K.axis_x_tick_values||(B=H.axis.updateXAxisTickValues(P))):(H.xAxis.tickValues([]),H.subXAxis.tickValues([])),K.zoom_rescale&&!a.flow&&(E=H.x.orgDomain()),H.y.domain(H.getYDomain(P,"y",E)),H.y2.domain(H.getYDomain(P,"y2",E)),!K.axis_y_tick_values&&K.axis_y_tick_count&&H.yAxis.tickValues(H.axis.generateTickValues(H.y.domain(),K.axis_y_tick_count)),!K.axis_y2_tick_values&&K.axis_y2_tick_count&&H.y2Axis.tickValues(H.axis.generateTickValues(H.y2.domain(),K.axis_y2_tick_count)),H.axis.redraw(b,O),H.axis.updateLabels(e),(i||p)&&P.length)if(K.axis_x_tick_culling&&B){for(C=1;C<B.length;C++)if(B.length/C<K.axis_x_tick_culling_max){D=C;break}H.svg.selectAll("."+l.axisX+" .tick text").each(function(a){var b=B.indexOf(a);b>=0&&J.select(this).style("display",b%D?"none":"block")})}else H.svg.selectAll("."+l.axisX+" .tick text").style("display","block");q=H.generateDrawArea?H.generateDrawArea(L,!1):void 0,r=H.generateDrawBar?H.generateDrawBar(M):void 0,s=H.generateDrawLine?H.generateDrawLine(N,!1):void 0,t=H.generateXYForText(L,M,N,!0),u=H.generateXYForText(L,M,N,!1),c&&(H.subY.domain(H.getYDomain(P,"y")),H.subY2.domain(H.getYDomain(P,"y2"))),H.updateXgridFocus(),I.select("text."+l.text+"."+l.empty).attr("x",H.width/2).attr("y",H.height/2).text(K.data_empty_label_text).transition().style("opacity",P.length?0:1),H.updateGrid(v),H.updateRegion(v),H.updateBar(x),H.updateLine(x),H.updateArea(x),H.updateCircle(),H.hasDataLabel()&&H.updateText(x),H.redrawTitle&&H.redrawTitle(),H.redrawArc&&H.redrawArc(v,x,h),H.redrawSubchart&&H.redrawSubchart(d,b,v,x,L,M,N),I.selectAll("."+l.selectedCircles).filter(H.isBarType.bind(H)).selectAll("circle").remove(),K.interaction_enabled&&!a.flow&&n&&(H.redrawEventRect(),H.updateZoom&&H.updateZoom()),H.updateCircleY(),F=(H.config.axis_rotated?H.circleY:H.circleX).bind(H),G=(H.config.axis_rotated?H.circleX:H.circleY).bind(H),a.flow&&(A=H.generateFlow({targets:P,flow:a.flow,duration:a.flow.duration,drawBar:r,drawLine:s,drawArea:q,cx:F,cy:G,xv:Q,xForText:t,yForText:u})),(v||A)&&H.isTabVisible()?J.transition().duration(v).each(function(){var b=[];[H.redrawBar(r,!0),H.redrawLine(s,!0),H.redrawArea(q,!0),H.redrawCircle(F,G,!0),H.redrawText(t,u,a.flow,!0),H.redrawRegion(!0),H.redrawGrid(!0)].forEach(function(a){a.forEach(function(a){b.push(a)})}),z=H.generateWait(),b.forEach(function(a){z.add(a)})}).call(z,function(){A&&A(),K.onrendered&&K.onrendered.call(H)}):(H.redrawBar(r),H.redrawLine(s),H.redrawArea(q),H.redrawCircle(F,G),H.redrawText(t,u,a.flow),H.redrawRegion(),H.redrawGrid(),K.onrendered&&K.onrendered.call(H)),H.mapToIds(H.data.targets).forEach(function(a){H.withoutFadeIn[a]=!0})},i.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=w(a,"withTransition",!0),a.withTransform=w(a,"withTransform",!1),a.withLegend=w(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=w(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.axis.generateTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},i.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},i.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},i.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},i.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||v(b.data_xs))},i.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},i.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=s(d.margin.left),c=s(d.margin.top)):"context"===a?(b=s(d.margin2.left),c=s(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},i.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},i.initialOpacityForCircle=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?this.opacityForCircle(a):0},i.opacityForCircle=function(a){var b=this.config.point_show?1:0;return m(a.value)?this.isScatterType(a)?.5:b:0},i.opacityForText=function(){return this.hasDataLabel()?1:0},i.xx=function(a){return a?this.x(a.x):null},i.xv=function(a){var b=this,c=a.value;return b.isTimeSeries()?c=b.parseDate(a.value):b.isCategorized()&&"string"==typeof a.value&&(c=b.config.axis_x_categories.indexOf(a.value)),Math.ceil(b.x(c))},i.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},i.subxx=function(a){return a?this.subX(a.x):null},i.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+l.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+l.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+l.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+l.chartArcs).attr("transform",f.getTranslate("arc"))},i.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},i.updateSvgSize=function(){var a=this,b=a.svg.select(".c3-brush .background");a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.selectAll(["#"+a.clipId,"#"+a.clipIdForGrid]).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForSubchart).select("rect").attr("width",a.width).attr("height",b.size()?b.attr("height"):0),a.svg.select("."+l.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},i.updateDimension=function(a){var b=this;a||(b.config.axis_rotated?(b.axes.x.call(b.xAxis),b.axes.subx.call(b.subXAxis)):(b.axes.y.call(b.yAxis),b.axes.y2.call(b.y2Axis))),b.updateSizes(),b.updateScales(),b.updateSvgSize(),b.transformAll(!1)},i.observeInserted=function(b){var c,d=this;return"undefined"==typeof MutationObserver?void a.console.error("MutationObserver not defined."):(c=new MutationObserver(function(e){e.forEach(function(e){"childList"===e.type&&e.previousSibling&&(c.disconnect(),d.intervalForObserveInserted=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(d.intervalForObserveInserted),d.updateDimension(),d.brush&&d.brush.update(),d.config.oninit.call(d),d.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10))})}),void c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0}))},i.bindResize=function(){var b=this,c=b.config;if(b.resizeFunction=b.generateResize(),b.resizeFunction.add(function(){c.onresize.call(b)}),c.resize_auto&&b.resizeFunction.add(function(){void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),b.resizeTimeout=a.setTimeout(function(){delete b.resizeTimeout,b.api.flush()},100)}),b.resizeFunction.add(function(){c.onresized.call(b)}),a.attachEvent)a.attachEvent("onresize",b.resizeFunction);else if(a.addEventListener)a.addEventListener("resize",b.resizeFunction,!1);else{var d=a.onresize;d?d.add&&d.remove||(d=b.generateResize(),d.add(a.onresize)):d=b.generateResize(),d.add(b.resizeFunction),a.onresize=d}},i.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a.remove=function(a){for(var c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}},a},i.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},i.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},i.parseDate=function(b){var c,d=this;return b instanceof Date?c=b:"string"==typeof b?c=d.dataTimeFormat(d.config.data_xFormat).parse(b):"number"!=typeof b||isNaN(b)||(c=new Date(+b)),c&&!isNaN(+c)||a.console.error("Failed to parse x '"+b+"' to Date object"),c},i.isTabVisible=function(){var a;return"undefined"!=typeof document.hidden?a="hidden":"undefined"!=typeof document.mozHidden?a="mozHidden":"undefined"!=typeof document.msHidden?a="msHidden":"undefined"!=typeof document.webkitHidden&&(a="webkitHidden"),!document[a]},i.getDefaultConfig=function(){var a={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},i.additionalConfig={},i.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),q(e)&&(f[g]=e)})},i.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},i.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},i.getY=function(a,b,c){var d=this.getScale(a,b,this.isTimeSeriesY());return c&&d.domain(c),d},i.getYScale=function(a){return"y2"===this.axis.getId(a)?this.y2:this.y},i.getSubYScale=function(a){return"y2"===this.axis.getId(a)?this.subY2:this.subY},i.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?b.axis_y_default:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?b.axis_y2_default:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?b.axis_y_default:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?b.axis_y2_default:a.subY2.domain()),a.xAxisTickFormat=a.axis.getXAxisTickFormat(),a.xAxisTickValues=a.axis.getXAxisTickValues(),a.yAxisTickValues=a.axis.getYAxisTickValues(),a.y2AxisTickValues=a.axis.getY2AxisTickValues(),a.xAxis=a.axis.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.subXAxis=a.axis.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.yAxis=a.axis.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,a.yAxisTickValues,b.axis_y_tick_outer),a.y2Axis=a.axis.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,a.y2AxisTickValues,b.axis_y2_tick_outer),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},i.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&+a>0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},i.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&0>+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},i.getYDomain=function(a,b,c){var d,e,f,g,h,i,j,k,l,n,o,p=this,q=p.config,r=a.filter(function(a){return p.axis.getId(a.id)===b}),s=c?p.filterByXDomain(r,c):r,u="y2"===b?q.axis_y2_min:q.axis_y_min,w="y2"===b?q.axis_y2_max:q.axis_y_max,x=p.getYDomainMin(s),y=p.getYDomainMax(s),z="y2"===b?q.axis_y2_center:q.axis_y_center,A=p.hasType("bar",s)&&q.bar_zerobased||p.hasType("area",s)&&q.area_zerobased,B="y2"===b?q.axis_y2_inverted:q.axis_y_inverted,C=p.hasDataLabel()&&q.axis_rotated,D=p.hasDataLabel()&&!q.axis_rotated;return x=m(u)?u:m(w)?w>x?x:w-10:x,y=m(w)?w:m(u)?y>u?y:u+10:y,0===s.length?"y2"===b?p.y2.domain():p.y.domain():(isNaN(x)&&(x=0),isNaN(y)&&(y=x),x===y&&(0>x?y=0:x=0),n=x>=0&&y>=0,o=0>=x&&0>=y,(m(u)&&n||m(w)&&o)&&(A=!1),A&&(n&&(x=0),o&&(y=0)),e=Math.abs(y-x),f=g=h=.1*e,"undefined"!=typeof z&&(i=Math.max(Math.abs(x),Math.abs(y)),y=z+i,x=z-i),C?(j=p.getDataLabelLength(x,y,"width"),k=t(p.y.range()),l=[j[0]/k,j[1]/k],
2310 ;!function(a){"use strict";function b(a){this.owner=a}function c(a,b){if(Object.create)b.prototype=Object.create(a.prototype);else{var c=function(){};c.prototype=a.prototype,b.prototype=new c}return b.prototype.constructor=b,b}function d(a){var b=this.internal=new e(this);b.loadConfig(a),b.beforeInit(a),b.init(),b.afterInit(a),function c(a,b,d){Object.keys(a).forEach(function(e){b[e]=a[e].bind(d),Object.keys(a[e]).length>0&&c(a[e],b[e],d)})}(h,this,this)}function e(b){var c=this;c.d3=a.d3?a.d3:"undefined"!=typeof require?require("d3"):void 0,c.api=b,c.config=c.getDefaultConfig(),c.data={},c.cache={},c.axes={}}function f(a){b.call(this,a)}function g(a,b){function c(a,b){a.attr("transform",function(a){return"translate("+Math.ceil(b(a)+u)+", 0)"})}function d(a,b){a.attr("transform",function(a){return"translate(0,"+Math.ceil(b(a))+")"})}function e(a){var b=a[0],c=a[a.length-1];return c>b?[b,c]:[c,b]}function f(a){var b,c,d=[];if(a.ticks)return a.ticks.apply(a,n);for(c=a.domain(),b=Math.ceil(c[0]);b<c[1];b++)d.push(b);return d.length>0&&d[0]>0&&d.unshift(d[0]-(d[1]-d[0])),d}function g(){var a,c=p.copy();return b.isCategory&&(a=p.domain(),c.domain([a[0],a[1]-1])),c}function h(a){var b=m?m(a):a;return"undefined"!=typeof b?b:""}function i(a){if(A)return A;var b={h:11.5,w:5.5};return a.select("text").text(h).each(function(a){var c=this.getBoundingClientRect(),d=h(a),e=c.height,f=d?c.width/d.length:void 0;e&&f&&(b.h=e,b.w=f)}).text(""),A=b,b}function j(c){return b.withoutTransition?c:a.transition(c)}function k(m){m.each(function(){function m(a,c){function d(a,b){f=void 0;for(var h=1;h<b.length;h++)if(" "===b.charAt(h)&&(f=h),e=b.substr(0,h+1),g=U.w*e.length,g>c)return d(a.concat(b.substr(0,f?f:h)),b.slice(f?f+1:h));return a.concat(b)}var e,f,g,i=h(a),j=[];return"[object Array]"===Object.prototype.toString.call(i)?i:((!c||0>=c)&&(c=X?95:b.isCategory?Math.ceil(F(G[1])-F(G[0]))-12:110),d(j,i+""))}function n(a,b){var c=U.h;return 0===b&&(c="left"===q||"right"===q?-((V[a.index]-1)*(U.h/2)-3):".71em"),c}function v(a){var b=p(a)+(o?0:u);return L[0]<b&&b<L[1]?r:0}function w(a){return a?a>0?"start":"end":"middle"}function x(a){return a?"rotate("+a+")":""}function y(a){return a?8*Math.sin(Math.PI*(a/180)):0}function z(a){return a?11.5-2.5*(a/15)*(a>0?1:-1):W}var A,B,C,D=k.g=a.select(this),E=this.__chart__||p,F=this.__chart__=g(),G=t?t:f(F),H=D.selectAll(".tick").data(G,F),I=H.enter().insert("g",".domain").attr("class","tick").style("opacity",1e-6),J=H.exit().remove(),K=j(H).style("opacity",1),L=p.rangeExtent?p.rangeExtent():e(p.range()),M=D.selectAll(".domain").data([0]),N=(M.enter().append("path").attr("class","domain"),j(M));I.append("line"),I.append("text");var O=I.select("line"),P=K.select("line"),Q=I.select("text"),R=K.select("text");b.isCategory?(u=Math.ceil((F(1)-F(0))/2),B=o?0:u,C=o?u:0):u=B=0;var S,T,U=i(D.select(".tick")),V=[],W=Math.max(r,0)+s,X="left"===q||"right"===q;S=H.select("text"),T=S.selectAll("tspan").data(function(a,c){var d=b.tickMultiline?m(a,b.tickWidth):[].concat(h(a));return V[c]=d.length,d.map(function(a){return{index:c,splitted:a}})}),T.enter().append("tspan"),T.exit().remove(),T.text(function(a){return a.splitted});var Y=b.tickTextRotate;switch(q){case"bottom":A=c,O.attr("y2",r),Q.attr("y",W),P.attr("x1",B).attr("x2",B).attr("y2",v),R.attr("x",0).attr("y",z(Y)).style("text-anchor",w(Y)).attr("transform",x(Y)),T.attr("x",0).attr("dy",n).attr("dx",y(Y)),N.attr("d","M"+L[0]+","+l+"V0H"+L[1]+"V"+l);break;case"top":A=c,O.attr("y2",-r),Q.attr("y",-W),P.attr("x2",0).attr("y2",-r),R.attr("x",0).attr("y",-W),S.style("text-anchor","middle"),T.attr("x",0).attr("dy","0em"),N.attr("d","M"+L[0]+","+-l+"V0H"+L[1]+"V"+-l);break;case"left":A=d,O.attr("x2",-r),Q.attr("x",-W),P.attr("x2",-r).attr("y1",C).attr("y2",C),R.attr("x",-W).attr("y",u),S.style("text-anchor","end"),T.attr("x",-W).attr("dy",n),N.attr("d","M"+-l+","+L[0]+"H0V"+L[1]+"H"+-l);break;case"right":A=d,O.attr("x2",r),Q.attr("x",W),P.attr("x2",r).attr("y2",0),R.attr("x",W).attr("y",0),S.style("text-anchor","start"),T.attr("x",W).attr("dy",n),N.attr("d","M"+l+","+L[0]+"H0V"+L[1]+"H"+l)}if(F.rangeBand){var Z=F,$=Z.rangeBand()/2;E=F=function(a){return Z(a)+$}}else E.rangeBand?E=F:J.call(A,F);I.call(A,E),K.call(A,F)})}var l,m,n,o,p=a.scale.linear(),q="bottom",r=6,s=3,t=null,u=0,v=!0;return b=b||{},l=b.withOuterTick?6:0,k.scale=function(a){return arguments.length?(p=a,k):p},k.orient=function(a){return arguments.length?(q=a in{top:1,right:1,bottom:1,left:1}?a+"":"bottom",k):q},k.tickFormat=function(a){return arguments.length?(m=a,k):m},k.tickCentered=function(a){return arguments.length?(o=a,k):o},k.tickOffset=function(){return u},k.tickInterval=function(){var a,c;return b.isCategory?a=2*u:(c=k.g.select("path.domain").node().getTotalLength()-2*l,a=c/k.g.selectAll("line").size()),a===1/0?0:a},k.ticks=function(){return arguments.length?(n=arguments,k):n},k.tickCulling=function(a){return arguments.length?(v=a,k):v},k.tickValues=function(a){if("function"==typeof a)t=function(){return a(p.domain())};else{if(!arguments.length)return t;t=a}return k},k}var h,i,j,k={version:"0.4.11"};k.generate=function(a){return new d(a)},k.chart={fn:d.prototype,internal:{fn:e.prototype,axis:{fn:f.prototype}}},h=k.chart.fn,i=k.chart.internal.fn,j=k.chart.internal.axis.fn,i.beforeInit=function(){},i.afterInit=function(){},i.init=function(){var a=this,b=a.config;if(a.initParams(),b.data_url)a.convertUrlToData(b.data_url,b.data_mimeType,b.data_headers,b.data_keys,a.initWithData);else if(b.data_json)a.initWithData(a.convertJsonToData(b.data_json,b.data_keys));else if(b.data_rows)a.initWithData(a.convertRowsToData(b.data_rows));else{if(!b.data_columns)throw Error("url or json or rows or columns is required.");a.initWithData(a.convertColumnsToData(b.data_columns))}},i.initParams=function(){var a=this,b=a.d3,c=a.config;a.clipId="c3-"+ +new Date+"-clip",a.clipIdForXAxis=a.clipId+"-xaxis",a.clipIdForYAxis=a.clipId+"-yaxis",a.clipIdForGrid=a.clipId+"-grid",a.clipIdForSubchart=a.clipId+"-subchart",a.clipPath=a.getClipPath(a.clipId),a.clipPathForXAxis=a.getClipPath(a.clipIdForXAxis),a.clipPathForYAxis=a.getClipPath(a.clipIdForYAxis),a.clipPathForGrid=a.getClipPath(a.clipIdForGrid),a.clipPathForSubchart=a.getClipPath(a.clipIdForSubchart),a.dragStart=null,a.dragging=!1,a.flowing=!1,a.cancelClick=!1,a.mouseover=!1,a.transiting=!1,a.color=a.generateColor(),a.levelColor=a.generateLevelColor(),a.dataTimeFormat=c.data_xLocaltime?b.time.format:b.time.format.utc,a.axisTimeFormat=c.axis_x_localtime?b.time.format:b.time.format.utc,a.defaultAxisTimeFormat=a.axisTimeFormat.multi([[".%L",function(a){return a.getMilliseconds()}],[":%S",function(a){return a.getSeconds()}],["%I:%M",function(a){return a.getMinutes()}],["%I %p",function(a){return a.getHours()}],["%-m/%-d",function(a){return a.getDay()&&1!==a.getDate()}],["%-m/%-d",function(a){return 1!==a.getDate()}],["%-m/%-d",function(a){return a.getMonth()}],["%Y/%-m/%-d",function(){return!0}]]),a.hiddenTargetIds=[],a.hiddenLegendIds=[],a.focusedTargetIds=[],a.defocusedTargetIds=[],a.xOrient=c.axis_rotated?"left":"bottom",a.yOrient=c.axis_rotated?c.axis_y_inner?"top":"bottom":c.axis_y_inner?"right":"left",a.y2Orient=c.axis_rotated?c.axis_y2_inner?"bottom":"top":c.axis_y2_inner?"left":"right",a.subXOrient=c.axis_rotated?"left":"bottom",a.isLegendRight="right"===c.legend_position,a.isLegendInset="inset"===c.legend_position,a.isLegendTop="top-left"===c.legend_inset_anchor||"top-right"===c.legend_inset_anchor,a.isLegendLeft="top-left"===c.legend_inset_anchor||"bottom-left"===c.legend_inset_anchor,a.legendStep=0,a.legendItemWidth=0,a.legendItemHeight=0,a.currentMaxTickWidths={x:0,y:0,y2:0},a.rotated_padding_left=30,a.rotated_padding_right=c.axis_rotated&&!c.axis_x_show?0:30,a.rotated_padding_top=5,a.withoutFadeIn={},a.intervalForObserveInserted=void 0,a.axes.subx=b.selectAll([])},i.initChartElements=function(){this.initBar&&this.initBar(),this.initLine&&this.initLine(),this.initArc&&this.initArc(),this.initGauge&&this.initGauge(),this.initText&&this.initText()},i.initWithData=function(a){var b,c,d=this,e=d.d3,g=d.config,h=!0;d.axis=new f(d),d.initPie&&d.initPie(),d.initBrush&&d.initBrush(),d.initZoom&&d.initZoom(),g.bindto?"function"==typeof g.bindto.node?d.selectChart=g.bindto:d.selectChart=e.select(g.bindto):d.selectChart=e.selectAll([]),d.selectChart.empty()&&(d.selectChart=e.select(document.createElement("div")).style("opacity",0),d.observeInserted(d.selectChart),h=!1),d.selectChart.html("").classed("c3",!0),d.data.xs={},d.data.targets=d.convertDataToTargets(a),g.data_filter&&(d.data.targets=d.data.targets.filter(g.data_filter)),g.data_hide&&d.addHiddenTargetIds(g.data_hide===!0?d.mapToIds(d.data.targets):g.data_hide),g.legend_hide&&d.addHiddenLegendIds(g.legend_hide===!0?d.mapToIds(d.data.targets):g.legend_hide),d.hasType("gauge")&&(g.legend_show=!1),d.updateSizes(),d.updateScales(),d.x.domain(e.extent(d.getXDomain(d.data.targets))),d.y.domain(d.getYDomain(d.data.targets,"y")),d.y2.domain(d.getYDomain(d.data.targets,"y2")),d.subX.domain(d.x.domain()),d.subY.domain(d.y.domain()),d.subY2.domain(d.y2.domain()),d.orgXDomain=d.x.domain(),d.brush&&d.brush.scale(d.subX),g.zoom_enabled&&d.zoom.scale(d.x),d.svg=d.selectChart.append("svg").style("overflow","hidden").on("mouseenter",function(){return g.onmouseover.call(d)}).on("mouseleave",function(){return g.onmouseout.call(d)}),d.config.svg_classname&&d.svg.attr("class",d.config.svg_classname),b=d.svg.append("defs"),d.clipChart=d.appendClip(b,d.clipId),d.clipXAxis=d.appendClip(b,d.clipIdForXAxis),d.clipYAxis=d.appendClip(b,d.clipIdForYAxis),d.clipGrid=d.appendClip(b,d.clipIdForGrid),d.clipSubchart=d.appendClip(b,d.clipIdForSubchart),d.updateSvgSize(),c=d.main=d.svg.append("g").attr("transform",d.getTranslate("main")),d.initSubchart&&d.initSubchart(),d.initTooltip&&d.initTooltip(),d.initLegend&&d.initLegend(),d.initTitle&&d.initTitle(),c.append("text").attr("class",l.text+" "+l.empty).attr("text-anchor","middle").attr("dominant-baseline","middle"),d.initRegion(),d.initGrid(),c.append("g").attr("clip-path",d.clipPath).attr("class",l.chart),g.grid_lines_front&&d.initGridLines(),d.initEventRect(),d.initChartElements(),c.insert("rect",g.zoom_privileged?null:"g."+l.regions).attr("class",l.zoomRect).attr("width",d.width).attr("height",d.height).style("opacity",0).on("dblclick.zoom",null),g.axis_x_extent&&d.brush.extent(d.getDefaultExtent()),d.axis.init(),d.updateTargets(d.data.targets),h&&(d.updateDimension(),d.config.oninit.call(d),d.redraw({withTransition:!1,withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransitionForAxis:!1})),d.bindResize(),d.api.element=d.selectChart.node()},i.smoothLines=function(a,b){var c=this;"grid"===b&&a.each(function(){var a=c.d3.select(this),b=a.attr("x1"),d=a.attr("x2"),e=a.attr("y1"),f=a.attr("y2");a.attr({x1:Math.ceil(b),x2:Math.ceil(d),y1:Math.ceil(e),y2:Math.ceil(f)})})},i.updateSizes=function(){var a=this,b=a.config,c=a.legend?a.getLegendHeight():0,d=a.legend?a.getLegendWidth():0,e=a.isLegendRight||a.isLegendInset?0:c,f=a.hasArcType(),g=b.axis_rotated||f?0:a.getHorizontalAxisHeight("x"),h=b.subchart_show&&!f?b.subchart_size_height+g:0;a.currentWidth=a.getCurrentWidth(),a.currentHeight=a.getCurrentHeight(),a.margin=b.axis_rotated?{top:a.getHorizontalAxisHeight("y2")+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:a.getHorizontalAxisHeight("y")+e+a.getCurrentPaddingBottom(),left:h+(f?0:a.getCurrentPaddingLeft())}:{top:4+a.getCurrentPaddingTop(),right:f?0:a.getCurrentPaddingRight(),bottom:g+h+e+a.getCurrentPaddingBottom(),left:f?0:a.getCurrentPaddingLeft()},a.margin2=b.axis_rotated?{top:a.margin.top,right:NaN,bottom:20+e,left:a.rotated_padding_left}:{top:a.currentHeight-h-e,right:NaN,bottom:g+e,left:a.margin.left},a.margin3={top:0,right:NaN,bottom:0,left:0},a.updateSizeForLegend&&a.updateSizeForLegend(c,d),a.width=a.currentWidth-a.margin.left-a.margin.right,a.height=a.currentHeight-a.margin.top-a.margin.bottom,a.width<0&&(a.width=0),a.height<0&&(a.height=0),a.width2=b.axis_rotated?a.margin.left-a.rotated_padding_left-a.rotated_padding_right:a.width,a.height2=b.axis_rotated?a.height:a.currentHeight-a.margin2.top-a.margin2.bottom,a.width2<0&&(a.width2=0),a.height2<0&&(a.height2=0),a.arcWidth=a.width-(a.isLegendRight?d+10:0),a.arcHeight=a.height-(a.isLegendRight?0:10),a.hasType("gauge")&&!b.gauge_fullCircle&&(a.arcHeight+=a.height-a.getGaugeLabelHeight()),a.updateRadius&&a.updateRadius(),a.isLegendRight&&f&&(a.margin3.left=a.arcWidth/2+1.1*a.radiusExpanded)},i.updateTargets=function(a){var b=this;b.updateTargetsForText(a),b.updateTargetsForBar(a),b.updateTargetsForLine(a),b.hasArcType()&&b.updateTargetsForArc&&b.updateTargetsForArc(a),b.updateTargetsForSubchart&&b.updateTargetsForSubchart(a),b.showTargets()},i.showTargets=function(){var a=this;a.svg.selectAll("."+l.target).filter(function(b){return a.isTargetToShow(b.id)}).transition().duration(a.config.transition_duration).style("opacity",1)},i.redraw=function(a,b){var c,d,e,f,g,h,i,j,k,m,n,o,p,q,r,s,t,u,v,x,y,z,A,B,C,D,E,F,G,H=this,I=H.main,J=H.d3,K=H.config,L=H.getShapeIndices(H.isAreaType),M=H.getShapeIndices(H.isBarType),N=H.getShapeIndices(H.isLineType),O=H.hasArcType(),P=H.filterTargetsToShow(H.data.targets),Q=H.xv.bind(H);if(a=a||{},c=w(a,"withY",!0),d=w(a,"withSubchart",!0),e=w(a,"withTransition",!0),h=w(a,"withTransform",!1),i=w(a,"withUpdateXDomain",!1),j=w(a,"withUpdateOrgXDomain",!1),k=w(a,"withTrimXDomain",!0),p=w(a,"withUpdateXAxis",i),m=w(a,"withLegend",!1),n=w(a,"withEventRect",!0),o=w(a,"withDimension",!0),f=w(a,"withTransitionForExit",e),g=w(a,"withTransitionForAxis",e),v=e?K.transition_duration:0,x=f?v:0,y=g?v:0,b=b||H.axis.generateTransitions(y),m&&K.legend_show?H.updateLegend(H.mapToIds(H.data.targets),a,b):o&&H.updateDimension(!0),H.isCategorized()&&0===P.length&&H.x.domain([0,H.axes.x.selectAll(".tick").size()]),P.length?(H.updateXDomain(P,i,j,k),K.axis_x_tick_values||(B=H.axis.updateXAxisTickValues(P))):(H.xAxis.tickValues([]),H.subXAxis.tickValues([])),K.zoom_rescale&&!a.flow&&(E=H.x.orgDomain()),H.y.domain(H.getYDomain(P,"y",E)),H.y2.domain(H.getYDomain(P,"y2",E)),!K.axis_y_tick_values&&K.axis_y_tick_count&&H.yAxis.tickValues(H.axis.generateTickValues(H.y.domain(),K.axis_y_tick_count)),!K.axis_y2_tick_values&&K.axis_y2_tick_count&&H.y2Axis.tickValues(H.axis.generateTickValues(H.y2.domain(),K.axis_y2_tick_count)),H.axis.redraw(b,O),H.axis.updateLabels(e),(i||p)&&P.length)if(K.axis_x_tick_culling&&B){for(C=1;C<B.length;C++)if(B.length/C<K.axis_x_tick_culling_max){D=C;break}H.svg.selectAll("."+l.axisX+" .tick text").each(function(a){var b=B.indexOf(a);b>=0&&J.select(this).style("display",b%D?"none":"block")})}else H.svg.selectAll("."+l.axisX+" .tick text").style("display","block");q=H.generateDrawArea?H.generateDrawArea(L,!1):void 0,r=H.generateDrawBar?H.generateDrawBar(M):void 0,s=H.generateDrawLine?H.generateDrawLine(N,!1):void 0,t=H.generateXYForText(L,M,N,!0),u=H.generateXYForText(L,M,N,!1),c&&(H.subY.domain(H.getYDomain(P,"y")),H.subY2.domain(H.getYDomain(P,"y2"))),H.updateXgridFocus(),I.select("text."+l.text+"."+l.empty).attr("x",H.width/2).attr("y",H.height/2).text(K.data_empty_label_text).transition().style("opacity",P.length?0:1),H.updateGrid(v),H.updateRegion(v),H.updateBar(x),H.updateLine(x),H.updateArea(x),H.updateCircle(),H.hasDataLabel()&&H.updateText(x),H.redrawTitle&&H.redrawTitle(),H.redrawArc&&H.redrawArc(v,x,h),H.redrawSubchart&&H.redrawSubchart(d,b,v,x,L,M,N),I.selectAll("."+l.selectedCircles).filter(H.isBarType.bind(H)).selectAll("circle").remove(),K.interaction_enabled&&!a.flow&&n&&(H.redrawEventRect(),H.updateZoom&&H.updateZoom()),H.updateCircleY(),F=(H.config.axis_rotated?H.circleY:H.circleX).bind(H),G=(H.config.axis_rotated?H.circleX:H.circleY).bind(H),a.flow&&(A=H.generateFlow({targets:P,flow:a.flow,duration:a.flow.duration,drawBar:r,drawLine:s,drawArea:q,cx:F,cy:G,xv:Q,xForText:t,yForText:u})),(v||A)&&H.isTabVisible()?J.transition().duration(v).each(function(){var b=[];[H.redrawBar(r,!0),H.redrawLine(s,!0),H.redrawArea(q,!0),H.redrawCircle(F,G,!0),H.redrawText(t,u,a.flow,!0),H.redrawRegion(!0),H.redrawGrid(!0)].forEach(function(a){a.forEach(function(a){b.push(a)})}),z=H.generateWait(),b.forEach(function(a){z.add(a)})}).call(z,function(){A&&A(),K.onrendered&&K.onrendered.call(H)}):(H.redrawBar(r),H.redrawLine(s),H.redrawArea(q),H.redrawCircle(F,G),H.redrawText(t,u,a.flow),H.redrawRegion(),H.redrawGrid(),K.onrendered&&K.onrendered.call(H)),H.mapToIds(H.data.targets).forEach(function(a){H.withoutFadeIn[a]=!0})},i.updateAndRedraw=function(a){var b,c=this,d=c.config;a=a||{},a.withTransition=w(a,"withTransition",!0),a.withTransform=w(a,"withTransform",!1),a.withLegend=w(a,"withLegend",!1),a.withUpdateXDomain=!0,a.withUpdateOrgXDomain=!0,a.withTransitionForExit=!1,a.withTransitionForTransform=w(a,"withTransitionForTransform",a.withTransition),c.updateSizes(),a.withLegend&&d.legend_show||(b=c.axis.generateTransitions(a.withTransitionForAxis?d.transition_duration:0),c.updateScales(),c.updateSvgSize(),c.transformAll(a.withTransitionForTransform,b)),c.redraw(a,b)},i.redrawWithoutRescale=function(){this.redraw({withY:!1,withSubchart:!1,withEventRect:!1,withTransitionForAxis:!1})},i.isTimeSeries=function(){return"timeseries"===this.config.axis_x_type},i.isCategorized=function(){return this.config.axis_x_type.indexOf("categor")>=0},i.isCustomX=function(){var a=this,b=a.config;return!a.isTimeSeries()&&(b.data_x||v(b.data_xs))},i.isTimeSeriesY=function(){return"timeseries"===this.config.axis_y_type},i.getTranslate=function(a){var b,c,d=this,e=d.config;return"main"===a?(b=s(d.margin.left),c=s(d.margin.top)):"context"===a?(b=s(d.margin2.left),c=s(d.margin2.top)):"legend"===a?(b=d.margin3.left,c=d.margin3.top):"x"===a?(b=0,c=e.axis_rotated?0:d.height):"y"===a?(b=0,c=e.axis_rotated?d.height:0):"y2"===a?(b=e.axis_rotated?0:d.width,c=e.axis_rotated?1:0):"subx"===a?(b=0,c=e.axis_rotated?0:d.height2):"arc"===a&&(b=d.arcWidth/2,c=d.arcHeight/2),"translate("+b+","+c+")"},i.initialOpacity=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?1:0},i.initialOpacityForCircle=function(a){return null!==a.value&&this.withoutFadeIn[a.id]?this.opacityForCircle(a):0},i.opacityForCircle=function(a){var b=this.config.point_show?1:0;return m(a.value)?this.isScatterType(a)?.5:b:0},i.opacityForText=function(){return this.hasDataLabel()?1:0},i.xx=function(a){return a?this.x(a.x):null},i.xv=function(a){var b=this,c=a.value;return b.isTimeSeries()?c=b.parseDate(a.value):b.isCategorized()&&"string"==typeof a.value&&(c=b.config.axis_x_categories.indexOf(a.value)),Math.ceil(b.x(c))},i.yv=function(a){var b=this,c=a.axis&&"y2"===a.axis?b.y2:b.y;return Math.ceil(c(a.value))},i.subxx=function(a){return a?this.subX(a.x):null},i.transformMain=function(a,b){var c,d,e,f=this;b&&b.axisX?c=b.axisX:(c=f.main.select("."+l.axisX),a&&(c=c.transition())),b&&b.axisY?d=b.axisY:(d=f.main.select("."+l.axisY),a&&(d=d.transition())),b&&b.axisY2?e=b.axisY2:(e=f.main.select("."+l.axisY2),a&&(e=e.transition())),(a?f.main.transition():f.main).attr("transform",f.getTranslate("main")),c.attr("transform",f.getTranslate("x")),d.attr("transform",f.getTranslate("y")),e.attr("transform",f.getTranslate("y2")),f.main.select("."+l.chartArcs).attr("transform",f.getTranslate("arc"))},i.transformAll=function(a,b){var c=this;c.transformMain(a,b),c.config.subchart_show&&c.transformContext(a,b),c.legend&&c.transformLegend(a)},i.updateSvgSize=function(){var a=this,b=a.svg.select(".c3-brush .background");a.svg.attr("width",a.currentWidth).attr("height",a.currentHeight),a.svg.selectAll(["#"+a.clipId,"#"+a.clipIdForGrid]).select("rect").attr("width",a.width).attr("height",a.height),a.svg.select("#"+a.clipIdForXAxis).select("rect").attr("x",a.getXAxisClipX.bind(a)).attr("y",a.getXAxisClipY.bind(a)).attr("width",a.getXAxisClipWidth.bind(a)).attr("height",a.getXAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForYAxis).select("rect").attr("x",a.getYAxisClipX.bind(a)).attr("y",a.getYAxisClipY.bind(a)).attr("width",a.getYAxisClipWidth.bind(a)).attr("height",a.getYAxisClipHeight.bind(a)),a.svg.select("#"+a.clipIdForSubchart).select("rect").attr("width",a.width).attr("height",b.size()?b.attr("height"):0),a.svg.select("."+l.zoomRect).attr("width",a.width).attr("height",a.height),a.selectChart.style("max-height",a.currentHeight+"px")},i.updateDimension=function(a){var b=this;a||(b.config.axis_rotated?(b.axes.x.call(b.xAxis),b.axes.subx.call(b.subXAxis)):(b.axes.y.call(b.yAxis),b.axes.y2.call(b.y2Axis))),b.updateSizes(),b.updateScales(),b.updateSvgSize(),b.transformAll(!1)},i.observeInserted=function(b){var c,d=this;return"undefined"==typeof MutationObserver?void a.console.error("MutationObserver not defined."):(c=new MutationObserver(function(e){e.forEach(function(e){"childList"===e.type&&e.previousSibling&&(c.disconnect(),d.intervalForObserveInserted=a.setInterval(function(){b.node().parentNode&&(a.clearInterval(d.intervalForObserveInserted),d.updateDimension(),d.brush&&d.brush.update(),d.config.oninit.call(d),d.redraw({withTransform:!0,withUpdateXDomain:!0,withUpdateOrgXDomain:!0,withTransition:!1,withTransitionForTransform:!1,withLegend:!0}),b.transition().style("opacity",1))},10))})}),void c.observe(b.node(),{attributes:!0,childList:!0,characterData:!0}))},i.bindResize=function(){var b=this,c=b.config;if(b.resizeFunction=b.generateResize(),b.resizeFunction.add(function(){c.onresize.call(b)}),c.resize_auto&&b.resizeFunction.add(function(){void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),b.resizeTimeout=a.setTimeout(function(){delete b.resizeTimeout,b.api.flush()},100)}),b.resizeFunction.add(function(){c.onresized.call(b)}),a.attachEvent)a.attachEvent("onresize",b.resizeFunction);else if(a.addEventListener)a.addEventListener("resize",b.resizeFunction,!1);else{var d=a.onresize;d?d.add&&d.remove||(d=b.generateResize(),d.add(a.onresize)):d=b.generateResize(),d.add(b.resizeFunction),a.onresize=d}},i.generateResize=function(){function a(){b.forEach(function(a){a()})}var b=[];return a.add=function(a){b.push(a)},a.remove=function(a){for(var c=0;c<b.length;c++)if(b[c]===a){b.splice(c,1);break}},a},i.endall=function(a,b){var c=0;a.each(function(){++c}).each("end",function(){--c||b.apply(this,arguments)})},i.generateWait=function(){var a=[],b=function(b,c){var d=setInterval(function(){var b=0;a.forEach(function(a){if(a.empty())return void(b+=1);try{a.transition()}catch(c){b+=1}}),b===a.length&&(clearInterval(d),c&&c())},10)};return b.add=function(b){a.push(b)},b},i.parseDate=function(b){var c,d=this;return b instanceof Date?c=b:"string"==typeof b?c=d.dataTimeFormat(d.config.data_xFormat).parse(b):"number"!=typeof b||isNaN(b)||(c=new Date(+b)),c&&!isNaN(+c)||a.console.error("Failed to parse x '"+b+"' to Date object"),c},i.isTabVisible=function(){var a;return"undefined"!=typeof document.hidden?a="hidden":"undefined"!=typeof document.mozHidden?a="mozHidden":"undefined"!=typeof document.msHidden?a="msHidden":"undefined"!=typeof document.webkitHidden&&(a="webkitHidden"),!document[a]},i.getDefaultConfig=function(){var a={bindto:"#chart",svg_classname:void 0,size_width:void 0,size_height:void 0,padding_left:void 0,padding_right:void 0,padding_top:void 0,padding_bottom:void 0,resize_auto:!0,zoom_enabled:!1,zoom_extent:void 0,zoom_privileged:!1,zoom_rescale:!1,zoom_onzoom:function(){},zoom_onzoomstart:function(){},zoom_onzoomend:function(){},zoom_x_min:void 0,zoom_x_max:void 0,interaction_brighten:!0,interaction_enabled:!0,onmouseover:function(){},onmouseout:function(){},onresize:function(){},onresized:function(){},oninit:function(){},onrendered:function(){},transition_duration:350,data_x:void 0,data_xs:{},data_xFormat:"%Y-%m-%d",data_xLocaltime:!0,data_xSort:!0,data_idConverter:function(a){return a},data_names:{},data_classes:{},data_groups:[],data_axes:{},data_type:void 0,data_types:{},data_labels:{},data_order:"desc",data_regions:{},data_color:void 0,data_colors:{},data_hide:!1,data_filter:void 0,data_selection_enabled:!1,data_selection_grouped:!1,data_selection_isselectable:function(){return!0},data_selection_multiple:!0,data_selection_draggable:!1,data_onclick:function(){},data_onmouseover:function(){},data_onmouseout:function(){},data_onselected:function(){},data_onunselected:function(){},data_url:void 0,data_headers:void 0,data_json:void 0,data_rows:void 0,data_columns:void 0,data_mimeType:void 0,data_keys:void 0,data_empty_label_text:"",subchart_show:!1,subchart_size_height:60,subchart_axis_x_show:!0,subchart_onbrush:function(){},color_pattern:[],color_threshold:{},legend_show:!0,legend_hide:!1,legend_position:"bottom",legend_inset_anchor:"top-left",legend_inset_x:10,legend_inset_y:0,legend_inset_step:void 0,legend_item_onclick:void 0,legend_item_onmouseover:void 0,legend_item_onmouseout:void 0,legend_equally:!1,legend_padding:0,legend_item_tile_width:10,legend_item_tile_height:10,axis_rotated:!1,axis_x_show:!0,axis_x_type:"indexed",axis_x_localtime:!0,axis_x_categories:[],axis_x_tick_centered:!1,axis_x_tick_format:void 0,axis_x_tick_culling:{},axis_x_tick_culling_max:10,axis_x_tick_count:void 0,axis_x_tick_fit:!0,axis_x_tick_values:null,axis_x_tick_rotate:0,axis_x_tick_outer:!0,axis_x_tick_multiline:!0,axis_x_tick_width:null,axis_x_max:void 0,axis_x_min:void 0,axis_x_padding:{},axis_x_height:void 0,axis_x_extent:void 0,axis_x_label:{},axis_y_show:!0,axis_y_type:void 0,axis_y_max:void 0,axis_y_min:void 0,axis_y_inverted:!1,axis_y_center:void 0,axis_y_inner:void 0,axis_y_label:{},axis_y_tick_format:void 0,axis_y_tick_outer:!0,axis_y_tick_values:null,axis_y_tick_rotate:0,axis_y_tick_count:void 0,axis_y_tick_time_value:void 0,axis_y_tick_time_interval:void 0,axis_y_padding:{},axis_y_default:void 0,axis_y2_show:!1,axis_y2_max:void 0,axis_y2_min:void 0,axis_y2_inverted:!1,axis_y2_center:void 0,axis_y2_inner:void 0,axis_y2_label:{},axis_y2_tick_format:void 0,axis_y2_tick_outer:!0,axis_y2_tick_values:null,axis_y2_tick_count:void 0,axis_y2_padding:{},axis_y2_default:void 0,grid_x_show:!1,grid_x_type:"tick",grid_x_lines:[],grid_y_show:!1,grid_y_lines:[],grid_y_ticks:10,grid_focus_show:!0,grid_lines_front:!0,point_show:!0,point_r:2.5,point_sensitivity:10,point_focus_expand_enabled:!0,point_focus_expand_r:void 0,point_select_r:void 0,line_connectNull:!1,line_step_type:"step",bar_width:void 0,bar_width_ratio:.6,bar_width_max:void 0,bar_zerobased:!0,area_zerobased:!0,area_above:!1,pie_label_show:!0,pie_label_format:void 0,pie_label_threshold:.05,pie_label_ratio:void 0,pie_expand:{},pie_expand_duration:50,gauge_fullCircle:!1,gauge_label_show:!0,gauge_label_format:void 0,gauge_min:0,gauge_max:100,gauge_startingAngle:-1*Math.PI/2,gauge_units:void 0,gauge_width:void 0,gauge_expand:{},gauge_expand_duration:50,donut_label_show:!0,donut_label_format:void 0,donut_label_threshold:.05,donut_label_ratio:void 0,donut_width:void 0,donut_title:"",donut_expand:{},donut_expand_duration:50,spline_interpolation_type:"cardinal",regions:[],tooltip_show:!0,tooltip_grouped:!0,tooltip_format_title:void 0,tooltip_format_name:void 0,tooltip_format_value:void 0,tooltip_position:void 0,tooltip_contents:function(a,b,c,d){return this.getTooltipContent?this.getTooltipContent(a,b,c,d):""},tooltip_init_show:!1,tooltip_init_x:0,tooltip_init_position:{top:"0px",left:"50px"},tooltip_onshow:function(){},tooltip_onhide:function(){},title_text:void 0,title_padding:{top:0,right:0,bottom:0,left:0},title_position:"top-center"};return Object.keys(this.additionalConfig).forEach(function(b){a[b]=this.additionalConfig[b]},this),a},i.additionalConfig={},i.loadConfig=function(a){function b(){var a=d.shift();return a&&c&&"object"==typeof c&&a in c?(c=c[a],b()):a?void 0:c}var c,d,e,f=this.config;Object.keys(f).forEach(function(g){c=a,d=g.split("_"),e=b(),q(e)&&(f[g]=e)})},i.getScale=function(a,b,c){return(c?this.d3.time.scale():this.d3.scale.linear()).range([a,b])},i.getX=function(a,b,c,d){var e,f=this,g=f.getScale(a,b,f.isTimeSeries()),h=c?g.domain(c):g;f.isCategorized()?(d=d||function(){return 0},g=function(a,b){var c=h(a)+d(a);return b?c:Math.ceil(c)}):g=function(a,b){var c=h(a);return b?c:Math.ceil(c)};for(e in h)g[e]=h[e];return g.orgDomain=function(){return h.domain()},f.isCategorized()&&(g.domain=function(a){return arguments.length?(h.domain(a),g):(a=this.orgDomain(),[a[0],a[1]+1])}),g},i.getY=function(a,b,c){var d=this.getScale(a,b,this.isTimeSeriesY());return c&&d.domain(c),d},i.getYScale=function(a){return"y2"===this.axis.getId(a)?this.y2:this.y},i.getSubYScale=function(a){return"y2"===this.axis.getId(a)?this.subY2:this.subY},i.updateScales=function(){var a=this,b=a.config,c=!a.x;a.xMin=b.axis_rotated?1:0,a.xMax=b.axis_rotated?a.height:a.width,a.yMin=b.axis_rotated?0:a.height,a.yMax=b.axis_rotated?a.width:1,a.subXMin=a.xMin,a.subXMax=a.xMax,a.subYMin=b.axis_rotated?0:a.height2,a.subYMax=b.axis_rotated?a.width2:1,a.x=a.getX(a.xMin,a.xMax,c?void 0:a.x.orgDomain(),function(){return a.xAxis.tickOffset()}),a.y=a.getY(a.yMin,a.yMax,c?b.axis_y_default:a.y.domain()),a.y2=a.getY(a.yMin,a.yMax,c?b.axis_y2_default:a.y2.domain()),a.subX=a.getX(a.xMin,a.xMax,a.orgXDomain,function(b){return b%1?0:a.subXAxis.tickOffset()}),a.subY=a.getY(a.subYMin,a.subYMax,c?b.axis_y_default:a.subY.domain()),a.subY2=a.getY(a.subYMin,a.subYMax,c?b.axis_y2_default:a.subY2.domain()),a.xAxisTickFormat=a.axis.getXAxisTickFormat(),a.xAxisTickValues=a.axis.getXAxisTickValues(),a.yAxisTickValues=a.axis.getYAxisTickValues(),a.y2AxisTickValues=a.axis.getY2AxisTickValues(),a.xAxis=a.axis.getXAxis(a.x,a.xOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.subXAxis=a.axis.getXAxis(a.subX,a.subXOrient,a.xAxisTickFormat,a.xAxisTickValues,b.axis_x_tick_outer),a.yAxis=a.axis.getYAxis(a.y,a.yOrient,b.axis_y_tick_format,a.yAxisTickValues,b.axis_y_tick_outer),a.y2Axis=a.axis.getYAxis(a.y2,a.y2Orient,b.axis_y2_tick_format,a.y2AxisTickValues,b.axis_y2_tick_outer),c||(a.brush&&a.brush.scale(a.subX),b.zoom_enabled&&a.zoom.scale(a.x)),a.updateArc&&a.updateArc()},i.getYDomainMin=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasNegativeValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=0>a?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&+a>0||(k[d][b]+=+a)});return h.d3.min(Object.keys(k).map(function(a){return h.d3.min(k[a])}))},i.getYDomainMax=function(a){var b,c,d,e,f,g,h=this,i=h.config,j=h.mapToIds(a),k=h.getValuesAsIdKeyed(a);if(i.data_groups.length>0)for(g=h.hasPositiveValueInTargets(a),b=0;b<i.data_groups.length;b++)if(e=i.data_groups[b].filter(function(a){return j.indexOf(a)>=0}),0!==e.length)for(d=e[0],g&&k[d]&&k[d].forEach(function(a,b){k[d][b]=a>0?a:0}),c=1;c<e.length;c++)f=e[c],k[f]&&k[f].forEach(function(a,b){h.axis.getId(f)!==h.axis.getId(d)||!k[d]||g&&0>+a||(k[d][b]+=+a)});return h.d3.max(Object.keys(k).map(function(a){return h.d3.max(k[a])}))},i.getYDomain=function(a,b,c){var d,e,f,g,h,i,j,k,l,n,o,p=this,q=p.config,r=a.filter(function(a){return p.axis.getId(a.id)===b}),s=c?p.filterByXDomain(r,c):r,u="y2"===b?q.axis_y2_min:q.axis_y_min,w="y2"===b?q.axis_y2_max:q.axis_y_max,x=p.getYDomainMin(s),y=p.getYDomainMax(s),z="y2"===b?q.axis_y2_center:q.axis_y_center,A=p.hasType("bar",s)&&q.bar_zerobased||p.hasType("area",s)&&q.area_zerobased,B="y2"===b?q.axis_y2_inverted:q.axis_y_inverted,C=p.hasDataLabel()&&q.axis_rotated,D=p.hasDataLabel()&&!q.axis_rotated;return x=m(u)?u:m(w)?w>x?x:w-10:x,y=m(w)?w:m(u)?y>u?y:u+10:y,0===s.length?"y2"===b?p.y2.domain():p.y.domain():(isNaN(x)&&(x=0),isNaN(y)&&(y=x),x===y&&(0>x?y=0:x=0),n=x>=0&&y>=0,o=0>=x&&0>=y,(m(u)&&n||m(w)&&o)&&(A=!1),A&&(n&&(x=0),o&&(y=0)),e=Math.abs(y-x),f=g=h=.1*e,"undefined"!=typeof z&&(i=Math.max(Math.abs(x),Math.abs(y)),y=z+i,x=z-i),C?(j=p.getDataLabelLength(x,y,"width"),k=t(p.y.range()),l=[j[0]/k,j[1]/k],
2311 g+=e*(l[1]/(1-l[0]-l[1])),h+=e*(l[0]/(1-l[0]-l[1]))):D&&(j=p.getDataLabelLength(x,y,"height"),g+=p.axis.convertPixelsToAxisPadding(j[1],e),h+=p.axis.convertPixelsToAxisPadding(j[0],e)),"y"===b&&v(q.axis_y_padding)&&(g=p.axis.getPadding(q.axis_y_padding,"top",g,e),h=p.axis.getPadding(q.axis_y_padding,"bottom",h,e)),"y2"===b&&v(q.axis_y2_padding)&&(g=p.axis.getPadding(q.axis_y2_padding,"top",g,e),h=p.axis.getPadding(q.axis_y2_padding,"bottom",h,e)),A&&(n&&(h=x),o&&(g=-y)),d=[x-h,y+g],B?d.reverse():d)},i.getXDomainMin=function(a){var b=this,c=b.config;return q(c.axis_x_min)?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},i.getXDomainMax=function(a){var b=this,c=b.config;return q(c.axis_x_max)?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},i.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=a[1]-a[0];return f.isCategorized()?c=0:f.hasType("bar")?(b=f.getMaxDataCount(),c=b>1?h/(b-1)/2:.5):c=.01*h,"object"==typeof g.axis_x_padding&&v(g.axis_x_padding)?(d=m(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=m(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},i.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(c),g=0,h=0;return d-e!==0||b.isCategorized()||(b.isTimeSeries()?(d=new Date(.5*d.getTime()),e=new Date(1.5*e.getTime())):(d=0===d?1:.5*d,e=0===e?-1:1.5*e)),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},i.updateXDomain=function(a,b,c,d,e){var f=this,g=f.config;return c&&(f.x.domain(e?e:f.d3.extent(f.getXDomain(a))),f.orgXDomain=f.x.domain(),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent(),f.subX.domain(f.x.domain()),f.brush&&f.brush.scale(f.subX)),b&&(f.x.domain(e?e:!f.brush||f.brush.empty()?f.orgXDomain:f.brush.extent()),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent()),d&&f.x.domain(f.trimXDomain(f.x.orgDomain())),f.x.domain()},i.trimXDomain=function(a){var b=this.getZoomDomain(),c=b[0],d=b[1];return a[0]<=c&&(a[1]=+a[1]+(c-a[0]),a[0]=c),d<=a[1]&&(a[0]=+a[0]-(a[1]-d),a[1]=d),a},i.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||v(c.data_xs)&&x(c.data_xs,a)},i.isNotX=function(a){return!this.isX(a)},i.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:v(c.data_xs)?c.data_xs[a]:null},i.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&v(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},i.getIndexByX=function(a){var b=this,c=b.filterByX(b.data.targets,a);return c.length?c[0].index:null},i.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&m(c.data.xs[a][b])?c.data.xs[a][b]:b},i.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},i.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a<b.length?b[a]:null},i.addXs=function(a){var b=this;Object.keys(a).forEach(function(c){b.config.data_xs[c]=a[c]})},i.hasMultipleX=function(a){return this.d3.set(Object.keys(a).map(function(b){return a[b]})).size()>1},i.isMultipleX=function(){return v(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},i.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=void 0!==b?b:a.id),a},i.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},i.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},i.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},i.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?a?e.parseDate(a):e.parseDate(e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?m(a)?+a:e.getXValue(b,c):c},i.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},i.updateXs=function(){var a=this;a.data.targets.length&&(a.xs=[],a.data.targets[0].values.forEach(function(b){a.xs[b.index]=b.x}))},i.getPrevX=function(a){var b=this.xs[a-1];return"undefined"!=typeof b?b:null},i.getNextX=function(a){var b=this.xs[a+1];return"undefined"!=typeof b?b:null},i.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},i.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},i.getEdgeX=function(a){var b=this;return a.length?[b.d3.min(a,function(a){return a.values[0].x}),b.d3.max(a,function(a){return a.values[a.values.length-1].x})]:[0,0]},i.mapToIds=function(a){return a.map(function(a){return a.id})},i.mapToTargetIds=function(a){var b=this;return a?[].concat(a):b.mapToIds(b.data.targets)},i.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1},i.isTargetToShow=function(a){return this.hiddenTargetIds.indexOf(a)<0},i.isLegendToShow=function(a){return this.hiddenLegendIds.indexOf(a)<0},i.filterTargetsToShow=function(a){var b=this;return a.filter(function(a){return b.isTargetToShow(a.id)})},i.mapTargetsToUniqueXs=function(a){var b=this,c=b.d3.set(b.d3.merge(a.map(function(a){return a.values.map(function(a){return+a.x})}))).values();return c=b.isTimeSeries()?c.map(function(a){return new Date(+a)}):c.map(function(a){return+a}),c.sort(function(a,b){return b>a?-1:a>b?1:a>=b?0:NaN})},i.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},i.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){return a.indexOf(b)<0})},i.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},i.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){return a.indexOf(b)<0})},i.getValuesAsIdKeyed=function(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},i.checkValueInTargets=function(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},i.hasNegativeValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return 0>a})},i.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},i.isOrderDesc=function(){var a=this.config;return"string"==typeof a.data_order&&"desc"===a.data_order.toLowerCase()},i.isOrderAsc=function(){var a=this.config;return"string"==typeof a.data_order&&"asc"===a.data_order.toLowerCase()},i.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):n(c.data_order)&&a.sort(c.data_order),a},i.filterByX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},i.filterRemoveNull=function(a){return a.filter(function(a){return m(a.value)})},i.filterByXDomain=function(a,b){return a.map(function(a){return{id:a.id,id_org:a.id_org,values:a.values.filter(function(a){return b[0]<=a.x&&a.x<=b[1]})}})},i.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:!("object"!=typeof a.data_labels||!v(a.data_labels))},i.getDataLabelLength=function(a,b,c){var d=this,e=[0,0],f=1.3;return d.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return d.dataLabelFormat(a.id)(a)}).each(function(a,b){e[b]=this.getBoundingClientRect()[c]*f}).remove(),e},i.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},i.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},i.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e},i.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosest(a.values,b)}),d.findClosest(c,b)},i.findClosest=function(a,b){var c,d=this,e=d.config.point_sensitivity;return a.filter(function(a){return a&&d.isBarType(a.id)}).forEach(function(a){var b=d.main.select("."+l.bars+d.getTargetSelectorSuffix(a.id)+" ."+l.bar+"-"+a.index).node();!c&&d.isWithinBar(b)&&(c=a)}),a.filter(function(a){return a&&!d.isBarType(a.id)}).forEach(function(a){var f=d.dist(a,b);e>f&&(e=f,c=a)}),c},i.dist=function(a,b){var c=this,d=c.config,e=d.axis_rotated?1:0,f=d.axis_rotated?0:1,g=c.circleY(a,a.index),h=c.x(a.x);return Math.sqrt(Math.pow(h-b[e],2)+Math.pow(g-b[f],2))},i.convertValuesToStep=function(a){var b,c=[].concat(a);if(!this.isCategorized())return a;for(b=a.length+1;b>0;b--)c[b]=c[b-1];return c[0]={x:c[0].x-1,value:c[0].value,id:c[0].id},c[a.length+1]={x:c[a.length].x+1,value:c[a.length].value,id:c[a.length].id},c},i.updateDataAttributes=function(a,b){var c=this,d=c.config,e=d["data_"+a];return"undefined"==typeof b?e:(Object.keys(b).forEach(function(a){e[a]=b[a]}),c.redraw({withLegend:!0}),e)},i.convertUrlToData=function(a,b,c,d,e){var f=this,g=b?b:"csv",h=f.d3.xhr(a);c&&Object.keys(c).forEach(function(a){h.header(a,c[a])}),h.get(function(a,b){var c;if(!b)throw new Error(a.responseURL+" "+a.status+" ("+a.statusText+")");c="json"===g?f.convertJsonToData(JSON.parse(b.response),d):"tsv"===g?f.convertTsvToData(b.response):f.convertCsvToData(b.response),e.call(f,c)})},i.convertXsvToData=function(a,b){var c,d=b.parseRows(a);return 1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},i.convertCsvToData=function(a){return this.convertXsvToData(a,this.d3.csv)},i.convertTsvToData=function(a){return this.convertXsvToData(a,this.d3.tsv)},i.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(b.x?(c=b.value.concat(b.x),e.config.data_x=b.x):c=b.value,f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=e.findValueInJson(a,c);p(d)&&(d=null),b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},i.findValueInJson=function(a,b){b=b.replace(/\[(\w+)\]/g,".$1"),b=b.replace(/^\./,"");for(var c=b.split("."),d=0;d<c.length;++d){var e=c[d];if(!(e in a))return;a=a[e]}return a},i.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}return f},i.convertColumnsToData=function(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(p(e[c-1])&&(e[c-1]={}),p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[c-1][d]=a[b][c]}return e},i.convertDataToTargets=function(a,b){var c,d=this,e=d.config,f=d.d3.keys(a[0]).filter(d.isNotX,d),g=d.d3.keys(a[0]).filter(d.isX,d);return f.forEach(function(c){var f=d.getXKey(c);d.isCustomX()||d.isTimeSeries()?g.indexOf(f)>=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(m).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():v(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h,i=d.getXKey(b),j=a[i],k=null===a[b]||isNaN(a[b])?null:+a[b];return d.isCustomX()&&d.isCategorized()&&0===c&&!p(j)?(0===c&&0===g&&(e.axis_x_categories=[]),h=e.axis_x_categories.indexOf(j),-1===h&&(h=e.axis_x_categories.length,e.axis_x_categories.push(j))):h=d.generateTargetX(j,b,g),(p(a[b])||d.data.xs[b].length<=g)&&(h=void 0),{x:h,value:k,id:f}}).filter(function(a){return q(a.x)})}}),c.forEach(function(a){var b;e.data_xSort&&(a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d})),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),d.hasNegativeValue=d.hasNegativeValueInTargets(c),d.hasPositiveValue=d.hasPositiveValueInTargets(c),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},i.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){var d=b.types&&b.types[a.id]?b.types[a.id]:b.type;c.setTargetType(a.id,d)}),c.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),c.data.targets=c.data.targets.concat(a)),c.updateTargets(c.data.targets),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),b.done&&b.done()},i.loadFromArgs=function(a){var b=this;a.data?b.load(b.convertDataToTargets(a.data),a):a.url?b.convertUrlToData(a.url,a.mimeType,a.headers,a.keys,function(c){b.load(b.convertDataToTargets(c),a)}):a.json?b.load(b.convertDataToTargets(b.convertJsonToData(a.json,a.keys)),a):a.rows?b.load(b.convertDataToTargets(b.convertRowsToData(a.rows)),a):a.columns?b.load(b.convertDataToTargets(b.convertColumnsToData(a.columns)),a):b.load(null,a)},i.unload=function(a,b){var c=this;return b||(b=function(){}),a=a.filter(function(a){return c.hasTarget(c.data.targets,a)}),a&&0!==a.length?(c.svg.selectAll(a.map(function(a){return c.selectorTarget(a)})).transition().style("opacity",0).remove().call(c.endall,b),void a.forEach(function(a){c.withoutFadeIn[a]=!1,c.legend&&c.legend.selectAll("."+l.legendItem+c.getTargetSelectorSuffix(a)).remove(),c.data.targets=c.data.targets.filter(function(b){return b.id!==a})})):void b()},i.categoryName=function(a){var b=this.config;return a<b.axis_x_categories.length?b.axis_x_categories[a]:a},i.initEventRect=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},i.redrawEventRect=function(){var a,b,c=this,d=c.config,e=c.isMultipleX(),f=c.main.select("."+l.eventRects).style("cursor",d.zoom_enabled?d.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,e).classed(l.eventRectsSingle,!e);f.selectAll("."+l.eventRect).remove(),c.eventRect=f.selectAll("."+l.eventRect),e?(a=c.eventRect.data([0]),c.generateEventRectsForMultipleXs(a.enter()),c.updateEventRect(a)):(b=c.getMaxDataCountTarget(c.data.targets),f.datum(b?b.values:[]),c.eventRect=f.selectAll("."+l.eventRect),a=c.eventRect.data(function(a){return a}),c.generateEventRectsForSingleX(a.enter()),c.updateEventRect(a),a.exit().remove())},i.updateEventRect=function(a){var b,c,d,e,f,g,h=this,i=h.config;a=a||h.eventRect.data(function(a){return a}),h.isMultipleX()?(b=0,c=0,d=h.width,e=h.height):(!h.isCustomX()&&!h.isTimeSeries()||h.isCategorized()?(f=h.getEventRectWidth(),g=function(a){return h.x(a.x)-f/2}):(h.updateXs(),f=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index);return null===b&&null===c?i.axis_rotated?h.height:h.width:(null===b&&(b=h.x.domain()[0]),null===c&&(c=h.x.domain()[1]),Math.max(0,(h.x(c)-h.x(b))/2))},g=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index),d=h.data.xs[a.id][a.index];return null===b&&null===c?0:(null===b&&(b=h.x.domain()[0]),(h.x(d)+h.x(b))/2)}),b=i.axis_rotated?0:g,c=i.axis_rotated?g:0,d=i.axis_rotated?h.width:f,e=i.axis_rotated?f:h.height),a.attr("class",h.classEvent.bind(h)).attr("x",b).attr("y",c).attr("width",d).attr("height",e)},i.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",b.classEvent.bind(b)).style("cursor",d.data_selection_enabled&&d.data_selection_grouped?"pointer":null).on("mouseover",function(a){var c=a.index;b.dragging||b.flowing||b.hasArcType()||(d.point_focus_expand_enabled&&b.expandCircles(c,null,!0),b.expandBars(c,null,!0),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseover.call(b.api,a)}))}).on("mouseout",function(a){var c=a.index;b.config&&(b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles(),b.unexpandBars(),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseout.call(b.api,a)})))}).on("mousemove",function(a){var e,f=a.index,g=b.svg.select("."+l.eventRect+"-"+f);b.dragging||b.flowing||b.hasArcType()||(b.isStepType(a)&&"step-after"===b.config.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,f))&&(f-=1),e=b.filterTargetsToShow(b.data.targets).map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),d.tooltip_grouped&&(b.showTooltip(e,this),b.showXGridFocus(e)),(!d.tooltip_grouped||d.data_selection_enabled&&!d.data_selection_grouped)&&b.main.selectAll("."+l.shape+"-"+f).each(function(){c.select(this).classed(l.EXPANDED,!0),d.data_selection_enabled&&g.style("cursor",d.data_selection_grouped?"pointer":null),d.tooltip_grouped||(b.hideXGridFocus(),b.hideTooltip(),d.data_selection_grouped||(b.unexpandCircles(f),b.unexpandBars(f)))}).filter(function(a){return b.isWithinShape(this,a)}).each(function(a){d.data_selection_enabled&&(d.data_selection_grouped||d.data_selection_isselectable(a))&&g.style("cursor","pointer"),d.tooltip_grouped||(b.showTooltip([a],this),b.showXGridFocus([a]),d.point_focus_expand_enabled&&b.expandCircles(f,a.id,!0),b.expandBars(f,a.id,!0))}))}).on("click",function(a){var e=a.index;if(!b.hasArcType()&&b.toggleShape){if(b.cancelClick)return void(b.cancelClick=!1);b.isStepType(a)&&"step-after"===d.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,e))&&(e-=1),b.main.selectAll("."+l.shape+"-"+e).each(function(a){(d.data_selection_grouped||b.isWithinShape(this,a))&&(b.toggleShape(this,a,e),b.config.data_onclick.call(b.api,a,this))})}}).call(d.data_selection_draggable&&b.drag?c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()}):function(){})},i.generateEventRectsForMultipleXs=function(a){function b(){c.svg.select("."+l.eventRect).style("cursor",null),c.hideXGridFocus(),c.hideTooltip(),c.unexpandCircles(),c.unexpandBars()}var c=this,d=c.d3,e=c.config;a.append("rect").attr("x",0).attr("y",0).attr("width",c.width).attr("height",c.height).attr("class",l.eventRect).on("mouseout",function(){c.config&&(c.hasArcType()||b())}).on("mousemove",function(){var a,f,g,h,i=c.filterTargetsToShow(c.data.targets);if(!c.dragging&&!c.hasArcType(i)){if(a=d.mouse(this),f=c.findClosestFromTargets(i,a),!c.mouseover||f&&f.id===c.mouseover.id||(e.data_onmouseout.call(c.api,c.mouseover),c.mouseover=void 0),!f)return void b();g=c.isScatterType(f)||!e.tooltip_grouped?[f]:c.filterByX(i,f.x),h=g.map(function(a){return c.addName(a)}),c.showTooltip(h,this),e.point_focus_expand_enabled&&c.expandCircles(f.index,f.id,!0),c.expandBars(f.index,f.id,!0),c.showXGridFocus(h),(c.isBarType(f.id)||c.dist(f,a)<e.point_sensitivity)&&(c.svg.select("."+l.eventRect).style("cursor","pointer"),c.mouseover||(e.data_onmouseover.call(c.api,f),c.mouseover=f))}}).on("click",function(){var a,b,f=c.filterTargetsToShow(c.data.targets);c.hasArcType(f)||(a=d.mouse(this),b=c.findClosestFromTargets(f,a),b&&(c.isBarType(b.id)||c.dist(b,a)<e.point_sensitivity)&&c.main.selectAll("."+l.shapes+c.getTargetSelectorSuffix(b.id)).selectAll("."+l.shape+"-"+b.index).each(function(){(e.data_selection_grouped||c.isWithinShape(this,b))&&(c.toggleShape(this,b,b.index),c.config.data_onclick.call(c.api,b,this))}))}).call(e.data_selection_draggable&&c.drag?d.behavior.drag().origin(Object).on("drag",function(){c.drag(d.mouse(this))}).on("dragstart",function(){c.dragstart(d.mouse(this))}).on("dragend",function(){c.dragend()}):function(){})},i.dispatchEvent=function(b,c,d){var e=this,f="."+l.eventRect+(e.isMultipleX()?"":"-"+c),g=e.main.select(f).node(),h=g.getBoundingClientRect(),i=h.left+(d?d[0]:0),j=h.top+(d?d[1]:0),k=document.createEvent("MouseEvents");k.initMouseEvent(b,!0,!0,a,0,i,j,i,j,!1,!1,!1,!1,0,null),g.dispatchEvent(k)},i.getCurrentWidth=function(){var a=this,b=a.config;return b.size_width?b.size_width:a.getParentWidth()},i.getCurrentHeight=function(){var a=this,b=a.config,c=b.size_height?b.size_height:a.getParentHeight();return c>0?c:320/(a.hasType("gauge")&&!b.gauge_fullCircle?2:1)},i.getCurrentPaddingTop=function(){var a=this,b=a.config,c=m(b.padding_top)?b.padding_top:0;return a.title&&a.title.node()&&(c+=a.getTitlePadding()),c},i.getCurrentPaddingBottom=function(){var a=this.config;return m(a.padding_bottom)?a.padding_bottom:0},i.getCurrentPaddingLeft=function(a){var b=this,c=b.config;return m(c.padding_left)?c.padding_left:c.axis_rotated?c.axis_x_show?Math.max(r(b.getAxisWidthByAxisId("x",a)),40):1:!c.axis_y_show||c.axis_y_inner?b.axis.getYAxisLabelPosition().isOuter?30:1:r(b.getAxisWidthByAxisId("y",a))},i.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return m(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:!b.axis_y2_show||b.axis_y2_inner?2+d+(a.axis.getY2AxisLabelPosition().isOuter?20:0):r(a.getAxisWidthByAxisId("y2"))+d},i.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName;){try{b=c.getBoundingClientRect()[a]}catch(d){"width"===a&&(b=c.offsetWidth)}if(b)break;c=c.parentNode}return b},i.getParentWidth=function(){return this.getParentRectValue("width")},i.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},i.getSvgLeft=function(a){var b=this,c=b.config,d=c.axis_rotated||!c.axis_rotated&&!c.axis_y_inner,e=c.axis_rotated?l.axisX:l.axisY,f=b.main.select("."+e).node(),g=f&&d?f.getBoundingClientRect():{right:0},h=b.selectChart.node().getBoundingClientRect(),i=b.hasArcType(),j=g.right-h.left-(i?0:b.getCurrentPaddingLeft(a));return j>0?j:0},i.getAxisWidthByAxisId=function(a,b){var c=this,d=c.axis.getLabelPositionById(a);return c.axis.getMaxTickWidth(a,b)+(d.isInner?20:40)},i.getHorizontalAxisHeight=function(a){var b=this,c=b.config,d=30;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?("x"===a&&!c.axis_rotated&&c.axis_x_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_x_tick_rotate)/180)),"y"===a&&c.axis_rotated&&c.axis_y_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_y_tick_rotate)/180)),d+(b.axis.getLabelPositionById(a).isInner?0:10)+("y2"===a?-10:0)):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:8},i.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},i.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b<e.data_groups.length;b++)if(!(e.data_groups[b].indexOf(a.id)<0))for(c=0;c<e.data_groups[b].length;c++)if(e.data_groups[b][c]in f){f[a.id]=f[e.data_groups[b][c]];break}p(f[a.id])&&(f[a.id]=g++)}),f.__max__=g-1,f},i.getShapeX=function(a,b,c,d){var e=this,f=d?e.subX:e.x;return function(d){var e=d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-e):0}},i.getShapeY=function(a){var b=this;return function(c){var d=a?b.getSubYScale(c.id):b.getYScale(c.id);return d(c.value)}},i.getShapeOffset=function(a,b,c){var d=this,e=d.orderTargets(d.filterTargetsToShow(d.data.targets.filter(a,d))),f=e.map(function(a){return a.id});return function(a,g){var h=c?d.getSubYScale(a.id):d.getYScale(a.id),i=h(0),j=i;return e.forEach(function(c){var e=d.isStepType(a)?d.convertValuesToStep(c.values):c.values;c.id!==a.id&&b[c.id]===b[a.id]&&f.indexOf(c.id)<f.indexOf(a.id)&&("undefined"!=typeof e[g]&&+e[g].x===+a.x||(g=-1,e.forEach(function(b,c){b.x===a.x&&(g=c)})),g in e&&e[g].value*a.value>=0&&(j+=h(e[g].value)-i))}),j}},i.isWithinShape=function(a,b){var c,d=this,e=d.d3.select(a);return d.isTargetToShow(b.id)?"circle"===a.nodeName?c=d.isStepType(b)?d.isWithinStep(a,d.getYScale(b.id)(b.value)):d.isWithinCircle(a,1.5*d.pointSelectR(b)):"path"===a.nodeName&&(c=e.classed(l.bar)?d.isWithinBar(a):!0):c=!1,c},i.getInterpolate=function(a){var b=this,c=b.isInterpolationType(b.config.spline_interpolation_type)?b.config.spline_interpolation_type:"cardinal";return b.isSplineType(a)?c:b.isStepType(a)?b.config.line_step_type:"linear"},i.initLine=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartLines)},i.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),h=d.classAreas.bind(d),i=d.classCircles.bind(d),j=d.classFocus.bind(d);b=d.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",function(a){return f(a)+j(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",h),c.append("g").attr("class",function(a){return d.generateClass(l.selectedCircles,a.id)}),c.append("g").attr("class",i).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+l.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+l.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},i.updateLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).style("shape-rendering",function(a){return b.isStepType(a)?"crispEdges":""}).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLine=function(a,b){return[(b?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",a).style("stroke",this.color).style("opacity",1)]},i.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connectNull||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connectNull?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?d.data_regions[a.id]?f=c.lineWithRegions(h,i,j,d.data_regions[a.id]):(c.isStepType(a)&&(h=c.convertValuesToStep(h)),f=e.interpolate(c.getInterpolate(a))(h)):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},i.generateGetLinePoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)]]}},i.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}function f(a){return"M"+a[0][0]+" "+a[0][1]+" "+a[1][0]+" "+a[1][1]}var g,h,i,j,k,l,m,n,o,r,s,t,u=this,v=u.config,w=-1,x="M",y=u.isCategorized()?.5:0,z=[];if(q(d))for(g=0;g<d.length;g++)z[g]={},p(d[g].start)?z[g].start=a[0].x:z[g].start=u.isTimeSeries()?u.parseDate(d[g].start):d[g].start,p(d[g].end)?z[g].end=a[a.length-1].x:z[g].end=u.isTimeSeries()?u.parseDate(d[g].end):d[g].end;for(s=v.axis_rotated?function(a){return c(a.value)}:function(a){return b(a.x)},t=v.axis_rotated?function(a){return b(a.x)}:function(a){return c(a.value)},i=u.isTimeSeries()?function(a,d,e,g){var h,i=a.x.getTime(),j=d.x-a.x,l=new Date(i+j*e),m=new Date(i+j*(e+g));return h=v.axis_rotated?[[c(k(e)),b(l)],[c(k(e+g)),b(m)]]:[[b(l),c(k(e))],[b(m),c(k(e+g))]],f(h)}:function(a,d,e,g){var h;return h=v.axis_rotated?[[c(k(e),!0),b(j(e))],[c(k(e+g),!0),b(j(e+g))]]:[[b(j(e),!0),c(k(e))],[b(j(e+g),!0),c(k(e+g))]],f(h)},g=0;g<a.length;g++){if(p(z)||!e(a[g].x,z))x+=" "+s(a[g])+" "+t(a[g]);else for(j=u.getScale(a[g-1].x+y,a[g].x+y,u.isTimeSeries()),k=u.getScale(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=c(a[g].value)-c(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n,r=2*o,h=o;1>=h;h+=r)x+=i(a[g-1],a[g],h,o);w=a[g].x}return x},i.updateArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawArea=function(a,b){return[(b?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},i.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(c.getAreaBaseValue(a.id))},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(d.area_above?0:i).y1(j),d.line_connectNull||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connectNull?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?(c.isStepType(a)&&(f=c.convertValuesToStep(f)),b=e.interpolate(c.getInterpolate(a))(f)):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},i.getAreaBaseValue=function(){return 0},i.generateGetAreaPoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)],[k,l-(e-j)],[k,j]]}},i.updateCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+l.circles).selectAll("."+l.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacityForCircle.bind(a)),a.mainCircle.exit().remove()},i.redrawCircle=function(a,b,c){var d=this.main.selectAll("."+l.selectedCircle);return[(c?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",a).attr("cy",b),(c?d.transition(Math.random().toString()):d).attr("cx",a).attr("cy",b)]},i.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},i.updateCircleY=function(){var a,b,c=this;c.config.data_groups.length>0?(a=c.getShapeIndices(c.isLineType),b=c.generateGetLinePoints(a),c.circleY=function(a,c){return b(a,c)[0][1]}):c.circleY=function(a){return c.getYScale(a.id)(a.value)}},i.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+l.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.circle+(m(a)?"-"+a:""))},i.expandCircles=function(a,b,c){var d=this,e=d.pointExpandedR.bind(d);c&&d.unexpandCircles(),d.getCircles(a,b).classed(l.EXPANDED,!0).attr("r",e)},i.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",c)},i.pointR=function(a){var b=this,c=b.config;return b.isStepType(a)?0:n(c.point_r)?c.point_r(a):c.point_r;
2311 g+=e*(l[1]/(1-l[0]-l[1])),h+=e*(l[0]/(1-l[0]-l[1]))):D&&(j=p.getDataLabelLength(x,y,"height"),g+=p.axis.convertPixelsToAxisPadding(j[1],e),h+=p.axis.convertPixelsToAxisPadding(j[0],e)),"y"===b&&v(q.axis_y_padding)&&(g=p.axis.getPadding(q.axis_y_padding,"top",g,e),h=p.axis.getPadding(q.axis_y_padding,"bottom",h,e)),"y2"===b&&v(q.axis_y2_padding)&&(g=p.axis.getPadding(q.axis_y2_padding,"top",g,e),h=p.axis.getPadding(q.axis_y2_padding,"bottom",h,e)),A&&(n&&(h=x),o&&(g=-y)),d=[x-h,y+g],B?d.reverse():d)},i.getXDomainMin=function(a){var b=this,c=b.config;return q(c.axis_x_min)?b.isTimeSeries()?this.parseDate(c.axis_x_min):c.axis_x_min:b.d3.min(a,function(a){return b.d3.min(a.values,function(a){return a.x})})},i.getXDomainMax=function(a){var b=this,c=b.config;return q(c.axis_x_max)?b.isTimeSeries()?this.parseDate(c.axis_x_max):c.axis_x_max:b.d3.max(a,function(a){return b.d3.max(a.values,function(a){return a.x})})},i.getXDomainPadding=function(a){var b,c,d,e,f=this,g=f.config,h=a[1]-a[0];return f.isCategorized()?c=0:f.hasType("bar")?(b=f.getMaxDataCount(),c=b>1?h/(b-1)/2:.5):c=.01*h,"object"==typeof g.axis_x_padding&&v(g.axis_x_padding)?(d=m(g.axis_x_padding.left)?g.axis_x_padding.left:c,e=m(g.axis_x_padding.right)?g.axis_x_padding.right:c):d=e="number"==typeof g.axis_x_padding?g.axis_x_padding:c,{left:d,right:e}},i.getXDomain=function(a){var b=this,c=[b.getXDomainMin(a),b.getXDomainMax(a)],d=c[0],e=c[1],f=b.getXDomainPadding(c),g=0,h=0;return d-e!==0||b.isCategorized()||(b.isTimeSeries()?(d=new Date(.5*d.getTime()),e=new Date(1.5*e.getTime())):(d=0===d?1:.5*d,e=0===e?-1:1.5*e)),(d||0===d)&&(g=b.isTimeSeries()?new Date(d.getTime()-f.left):d-f.left),(e||0===e)&&(h=b.isTimeSeries()?new Date(e.getTime()+f.right):e+f.right),[g,h]},i.updateXDomain=function(a,b,c,d,e){var f=this,g=f.config;return c&&(f.x.domain(e?e:f.d3.extent(f.getXDomain(a))),f.orgXDomain=f.x.domain(),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent(),f.subX.domain(f.x.domain()),f.brush&&f.brush.scale(f.subX)),b&&(f.x.domain(e?e:!f.brush||f.brush.empty()?f.orgXDomain:f.brush.extent()),g.zoom_enabled&&f.zoom.scale(f.x).updateScaleExtent()),d&&f.x.domain(f.trimXDomain(f.x.orgDomain())),f.x.domain()},i.trimXDomain=function(a){var b=this.getZoomDomain(),c=b[0],d=b[1];return a[0]<=c&&(a[1]=+a[1]+(c-a[0]),a[0]=c),d<=a[1]&&(a[0]=+a[0]-(a[1]-d),a[1]=d),a},i.isX=function(a){var b=this,c=b.config;return c.data_x&&a===c.data_x||v(c.data_xs)&&x(c.data_xs,a)},i.isNotX=function(a){return!this.isX(a)},i.getXKey=function(a){var b=this,c=b.config;return c.data_x?c.data_x:v(c.data_xs)?c.data_xs[a]:null},i.getXValuesOfXKey=function(a,b){var c,d=this,e=b&&v(b)?d.mapToIds(b):[];return e.forEach(function(b){d.getXKey(b)===a&&(c=d.data.xs[b])}),c},i.getIndexByX=function(a){var b=this,c=b.filterByX(b.data.targets,a);return c.length?c[0].index:null},i.getXValue=function(a,b){var c=this;return a in c.data.xs&&c.data.xs[a]&&m(c.data.xs[a][b])?c.data.xs[a][b]:b},i.getOtherTargetXs=function(){var a=this,b=Object.keys(a.data.xs);return b.length?a.data.xs[b[0]]:null},i.getOtherTargetX=function(a){var b=this.getOtherTargetXs();return b&&a<b.length?b[a]:null},i.addXs=function(a){var b=this;Object.keys(a).forEach(function(c){b.config.data_xs[c]=a[c]})},i.hasMultipleX=function(a){return this.d3.set(Object.keys(a).map(function(b){return a[b]})).size()>1},i.isMultipleX=function(){return v(this.config.data_xs)||!this.config.data_xSort||this.hasType("scatter")},i.addName=function(a){var b,c=this;return a&&(b=c.config.data_names[a.id],a.name=void 0!==b?b:a.id),a},i.getValueOnIndex=function(a,b){var c=a.filter(function(a){return a.index===b});return c.length?c[0]:null},i.updateTargetX=function(a,b){var c=this;a.forEach(function(a){a.values.forEach(function(d,e){d.x=c.generateTargetX(b[e],a.id,e)}),c.data.xs[a.id]=b})},i.updateTargetXs=function(a,b){var c=this;a.forEach(function(a){b[a.id]&&c.updateTargetX([a],b[a.id])})},i.generateTargetX=function(a,b,c){var d,e=this;return d=e.isTimeSeries()?a?e.parseDate(a):e.parseDate(e.getXValue(b,c)):e.isCustomX()&&!e.isCategorized()?m(a)?+a:e.getXValue(b,c):c},i.cloneTarget=function(a){return{id:a.id,id_org:a.id_org,values:a.values.map(function(a){return{x:a.x,value:a.value,id:a.id}})}},i.updateXs=function(){var a=this;a.data.targets.length&&(a.xs=[],a.data.targets[0].values.forEach(function(b){a.xs[b.index]=b.x}))},i.getPrevX=function(a){var b=this.xs[a-1];return"undefined"!=typeof b?b:null},i.getNextX=function(a){var b=this.xs[a+1];return"undefined"!=typeof b?b:null},i.getMaxDataCount=function(){var a=this;return a.d3.max(a.data.targets,function(a){return a.values.length})},i.getMaxDataCountTarget=function(a){var b,c=a.length,d=0;return c>1?a.forEach(function(a){a.values.length>d&&(b=a,d=a.values.length)}):b=c?a[0]:null,b},i.getEdgeX=function(a){var b=this;return a.length?[b.d3.min(a,function(a){return a.values[0].x}),b.d3.max(a,function(a){return a.values[a.values.length-1].x})]:[0,0]},i.mapToIds=function(a){return a.map(function(a){return a.id})},i.mapToTargetIds=function(a){var b=this;return a?[].concat(a):b.mapToIds(b.data.targets)},i.hasTarget=function(a,b){var c,d=this.mapToIds(a);for(c=0;c<d.length;c++)if(d[c]===b)return!0;return!1},i.isTargetToShow=function(a){return this.hiddenTargetIds.indexOf(a)<0},i.isLegendToShow=function(a){return this.hiddenLegendIds.indexOf(a)<0},i.filterTargetsToShow=function(a){var b=this;return a.filter(function(a){return b.isTargetToShow(a.id)})},i.mapTargetsToUniqueXs=function(a){var b=this,c=b.d3.set(b.d3.merge(a.map(function(a){return a.values.map(function(a){return+a.x})}))).values();return c=b.isTimeSeries()?c.map(function(a){return new Date(+a)}):c.map(function(a){return+a}),c.sort(function(a,b){return b>a?-1:a>b?1:a>=b?0:NaN})},i.addHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.concat(a)},i.removeHiddenTargetIds=function(a){this.hiddenTargetIds=this.hiddenTargetIds.filter(function(b){return a.indexOf(b)<0})},i.addHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.concat(a)},i.removeHiddenLegendIds=function(a){this.hiddenLegendIds=this.hiddenLegendIds.filter(function(b){return a.indexOf(b)<0})},i.getValuesAsIdKeyed=function(a){var b={};return a.forEach(function(a){b[a.id]=[],a.values.forEach(function(c){b[a.id].push(c.value)})}),b},i.checkValueInTargets=function(a,b){var c,d,e,f=Object.keys(a);for(c=0;c<f.length;c++)for(e=a[f[c]].values,d=0;d<e.length;d++)if(b(e[d].value))return!0;return!1},i.hasNegativeValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return 0>a})},i.hasPositiveValueInTargets=function(a){return this.checkValueInTargets(a,function(a){return a>0})},i.isOrderDesc=function(){var a=this.config;return"string"==typeof a.data_order&&"desc"===a.data_order.toLowerCase()},i.isOrderAsc=function(){var a=this.config;return"string"==typeof a.data_order&&"asc"===a.data_order.toLowerCase()},i.orderTargets=function(a){var b=this,c=b.config,d=b.isOrderAsc(),e=b.isOrderDesc();return d||e?a.sort(function(a,b){var c=function(a,b){return a+Math.abs(b.value)},e=a.values.reduce(c,0),f=b.values.reduce(c,0);return d?f-e:e-f}):n(c.data_order)&&a.sort(c.data_order),a},i.filterByX=function(a,b){return this.d3.merge(a.map(function(a){return a.values})).filter(function(a){return a.x-b===0})},i.filterRemoveNull=function(a){return a.filter(function(a){return m(a.value)})},i.filterByXDomain=function(a,b){return a.map(function(a){return{id:a.id,id_org:a.id_org,values:a.values.filter(function(a){return b[0]<=a.x&&a.x<=b[1]})}})},i.hasDataLabel=function(){var a=this.config;return"boolean"==typeof a.data_labels&&a.data_labels?!0:!("object"!=typeof a.data_labels||!v(a.data_labels))},i.getDataLabelLength=function(a,b,c){var d=this,e=[0,0],f=1.3;return d.selectChart.select("svg").selectAll(".dummy").data([a,b]).enter().append("text").text(function(a){return d.dataLabelFormat(a.id)(a)}).each(function(a,b){e[b]=this.getBoundingClientRect()[c]*f}).remove(),e},i.isNoneArc=function(a){return this.hasTarget(this.data.targets,a.id)},i.isArc=function(a){return"data"in a&&this.hasTarget(this.data.targets,a.data.id)},i.findSameXOfValues=function(a,b){var c,d=a[b].x,e=[];for(c=b-1;c>=0&&d===a[c].x;c--)e.push(a[c]);for(c=b;c<a.length&&d===a[c].x;c++)e.push(a[c]);return e},i.findClosestFromTargets=function(a,b){var c,d=this;return c=a.map(function(a){return d.findClosest(a.values,b)}),d.findClosest(c,b)},i.findClosest=function(a,b){var c,d=this,e=d.config.point_sensitivity;return a.filter(function(a){return a&&d.isBarType(a.id)}).forEach(function(a){var b=d.main.select("."+l.bars+d.getTargetSelectorSuffix(a.id)+" ."+l.bar+"-"+a.index).node();!c&&d.isWithinBar(b)&&(c=a)}),a.filter(function(a){return a&&!d.isBarType(a.id)}).forEach(function(a){var f=d.dist(a,b);e>f&&(e=f,c=a)}),c},i.dist=function(a,b){var c=this,d=c.config,e=d.axis_rotated?1:0,f=d.axis_rotated?0:1,g=c.circleY(a,a.index),h=c.x(a.x);return Math.sqrt(Math.pow(h-b[e],2)+Math.pow(g-b[f],2))},i.convertValuesToStep=function(a){var b,c=[].concat(a);if(!this.isCategorized())return a;for(b=a.length+1;b>0;b--)c[b]=c[b-1];return c[0]={x:c[0].x-1,value:c[0].value,id:c[0].id},c[a.length+1]={x:c[a.length].x+1,value:c[a.length].value,id:c[a.length].id},c},i.updateDataAttributes=function(a,b){var c=this,d=c.config,e=d["data_"+a];return"undefined"==typeof b?e:(Object.keys(b).forEach(function(a){e[a]=b[a]}),c.redraw({withLegend:!0}),e)},i.convertUrlToData=function(a,b,c,d,e){var f=this,g=b?b:"csv",h=f.d3.xhr(a);c&&Object.keys(c).forEach(function(a){h.header(a,c[a])}),h.get(function(a,b){var c;if(!b)throw new Error(a.responseURL+" "+a.status+" ("+a.statusText+")");c="json"===g?f.convertJsonToData(JSON.parse(b.response),d):"tsv"===g?f.convertTsvToData(b.response):f.convertCsvToData(b.response),e.call(f,c)})},i.convertXsvToData=function(a,b){var c,d=b.parseRows(a);return 1===d.length?(c=[{}],d[0].forEach(function(a){c[0][a]=null})):c=b.parse(a),c},i.convertCsvToData=function(a){return this.convertXsvToData(a,this.d3.csv)},i.convertTsvToData=function(a){return this.convertXsvToData(a,this.d3.tsv)},i.convertJsonToData=function(a,b){var c,d,e=this,f=[];return b?(b.x?(c=b.value.concat(b.x),e.config.data_x=b.x):c=b.value,f.push(c),a.forEach(function(a){var b=[];c.forEach(function(c){var d=e.findValueInJson(a,c);p(d)&&(d=null),b.push(d)}),f.push(b)}),d=e.convertRowsToData(f)):(Object.keys(a).forEach(function(b){f.push([b].concat(a[b]))}),d=e.convertColumnsToData(f)),d},i.findValueInJson=function(a,b){b=b.replace(/\[(\w+)\]/g,".$1"),b=b.replace(/^\./,"");for(var c=b.split("."),d=0;d<c.length;++d){var e=c[d];if(!(e in a))return;a=a[e]}return a},i.convertRowsToData=function(a){var b,c,d=a[0],e={},f=[];for(b=1;b<a.length;b++){for(e={},c=0;c<a[b].length;c++){if(p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[d[c]]=a[b][c]}f.push(e)}return f},i.convertColumnsToData=function(a){var b,c,d,e=[];for(b=0;b<a.length;b++)for(d=a[b][0],c=1;c<a[b].length;c++){if(p(e[c-1])&&(e[c-1]={}),p(a[b][c]))throw new Error("Source data is missing a component at ("+b+","+c+")!");e[c-1][d]=a[b][c]}return e},i.convertDataToTargets=function(a,b){var c,d=this,e=d.config,f=d.d3.keys(a[0]).filter(d.isNotX,d),g=d.d3.keys(a[0]).filter(d.isX,d);return f.forEach(function(c){var f=d.getXKey(c);d.isCustomX()||d.isTimeSeries()?g.indexOf(f)>=0?d.data.xs[c]=(b&&d.data.xs[c]?d.data.xs[c]:[]).concat(a.map(function(a){return a[f]}).filter(m).map(function(a,b){return d.generateTargetX(a,c,b)})):e.data_x?d.data.xs[c]=d.getOtherTargetXs():v(e.data_xs)&&(d.data.xs[c]=d.getXValuesOfXKey(f,d.data.targets)):d.data.xs[c]=a.map(function(a,b){return b})}),f.forEach(function(a){if(!d.data.xs[a])throw new Error('x is not defined for id = "'+a+'".')}),c=f.map(function(b,c){var f=e.data_idConverter(b);return{id:f,id_org:b,values:a.map(function(a,g){var h,i=d.getXKey(b),j=a[i],k=null===a[b]||isNaN(a[b])?null:+a[b];return d.isCustomX()&&d.isCategorized()&&0===c&&!p(j)?(0===c&&0===g&&(e.axis_x_categories=[]),h=e.axis_x_categories.indexOf(j),-1===h&&(h=e.axis_x_categories.length,e.axis_x_categories.push(j))):h=d.generateTargetX(j,b,g),(p(a[b])||d.data.xs[b].length<=g)&&(h=void 0),{x:h,value:k,id:f}}).filter(function(a){return q(a.x)})}}),c.forEach(function(a){var b;e.data_xSort&&(a.values=a.values.sort(function(a,b){var c=a.x||0===a.x?a.x:1/0,d=b.x||0===b.x?b.x:1/0;return c-d})),b=0,a.values.forEach(function(a){a.index=b++}),d.data.xs[a.id].sort(function(a,b){return a-b})}),d.hasNegativeValue=d.hasNegativeValueInTargets(c),d.hasPositiveValue=d.hasPositiveValueInTargets(c),e.data_type&&d.setTargetType(d.mapToIds(c).filter(function(a){return!(a in e.data_types)}),e.data_type),c.forEach(function(a){d.addCache(a.id_org,a)}),c},i.load=function(a,b){var c=this;a&&(b.filter&&(a=a.filter(b.filter)),(b.type||b.types)&&a.forEach(function(a){var d=b.types&&b.types[a.id]?b.types[a.id]:b.type;c.setTargetType(a.id,d)}),c.data.targets.forEach(function(b){for(var c=0;c<a.length;c++)if(b.id===a[c].id){b.values=a[c].values,a.splice(c,1);break}}),c.data.targets=c.data.targets.concat(a)),c.updateTargets(c.data.targets),c.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),b.done&&b.done()},i.loadFromArgs=function(a){var b=this;a.data?b.load(b.convertDataToTargets(a.data),a):a.url?b.convertUrlToData(a.url,a.mimeType,a.headers,a.keys,function(c){b.load(b.convertDataToTargets(c),a)}):a.json?b.load(b.convertDataToTargets(b.convertJsonToData(a.json,a.keys)),a):a.rows?b.load(b.convertDataToTargets(b.convertRowsToData(a.rows)),a):a.columns?b.load(b.convertDataToTargets(b.convertColumnsToData(a.columns)),a):b.load(null,a)},i.unload=function(a,b){var c=this;return b||(b=function(){}),a=a.filter(function(a){return c.hasTarget(c.data.targets,a)}),a&&0!==a.length?(c.svg.selectAll(a.map(function(a){return c.selectorTarget(a)})).transition().style("opacity",0).remove().call(c.endall,b),void a.forEach(function(a){c.withoutFadeIn[a]=!1,c.legend&&c.legend.selectAll("."+l.legendItem+c.getTargetSelectorSuffix(a)).remove(),c.data.targets=c.data.targets.filter(function(b){return b.id!==a})})):void b()},i.categoryName=function(a){var b=this.config;return a<b.axis_x_categories.length?b.axis_x_categories[a]:a},i.initEventRect=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.eventRects).style("fill-opacity",0)},i.redrawEventRect=function(){var a,b,c=this,d=c.config,e=c.isMultipleX(),f=c.main.select("."+l.eventRects).style("cursor",d.zoom_enabled?d.axis_rotated?"ns-resize":"ew-resize":null).classed(l.eventRectsMultiple,e).classed(l.eventRectsSingle,!e);f.selectAll("."+l.eventRect).remove(),c.eventRect=f.selectAll("."+l.eventRect),e?(a=c.eventRect.data([0]),c.generateEventRectsForMultipleXs(a.enter()),c.updateEventRect(a)):(b=c.getMaxDataCountTarget(c.data.targets),f.datum(b?b.values:[]),c.eventRect=f.selectAll("."+l.eventRect),a=c.eventRect.data(function(a){return a}),c.generateEventRectsForSingleX(a.enter()),c.updateEventRect(a),a.exit().remove())},i.updateEventRect=function(a){var b,c,d,e,f,g,h=this,i=h.config;a=a||h.eventRect.data(function(a){return a}),h.isMultipleX()?(b=0,c=0,d=h.width,e=h.height):(!h.isCustomX()&&!h.isTimeSeries()||h.isCategorized()?(f=h.getEventRectWidth(),g=function(a){return h.x(a.x)-f/2}):(h.updateXs(),f=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index);return null===b&&null===c?i.axis_rotated?h.height:h.width:(null===b&&(b=h.x.domain()[0]),null===c&&(c=h.x.domain()[1]),Math.max(0,(h.x(c)-h.x(b))/2))},g=function(a){var b=h.getPrevX(a.index),c=h.getNextX(a.index),d=h.data.xs[a.id][a.index];return null===b&&null===c?0:(null===b&&(b=h.x.domain()[0]),(h.x(d)+h.x(b))/2)}),b=i.axis_rotated?0:g,c=i.axis_rotated?g:0,d=i.axis_rotated?h.width:f,e=i.axis_rotated?f:h.height),a.attr("class",h.classEvent.bind(h)).attr("x",b).attr("y",c).attr("width",d).attr("height",e)},i.generateEventRectsForSingleX=function(a){var b=this,c=b.d3,d=b.config;a.append("rect").attr("class",b.classEvent.bind(b)).style("cursor",d.data_selection_enabled&&d.data_selection_grouped?"pointer":null).on("mouseover",function(a){var c=a.index;b.dragging||b.flowing||b.hasArcType()||(d.point_focus_expand_enabled&&b.expandCircles(c,null,!0),b.expandBars(c,null,!0),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseover.call(b.api,a)}))}).on("mouseout",function(a){var c=a.index;b.config&&(b.hasArcType()||(b.hideXGridFocus(),b.hideTooltip(),b.unexpandCircles(),b.unexpandBars(),b.main.selectAll("."+l.shape+"-"+c).each(function(a){d.data_onmouseout.call(b.api,a)})))}).on("mousemove",function(a){var e,f=a.index,g=b.svg.select("."+l.eventRect+"-"+f);b.dragging||b.flowing||b.hasArcType()||(b.isStepType(a)&&"step-after"===b.config.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,f))&&(f-=1),e=b.filterTargetsToShow(b.data.targets).map(function(a){return b.addName(b.getValueOnIndex(a.values,f))}),d.tooltip_grouped&&(b.showTooltip(e,this),b.showXGridFocus(e)),(!d.tooltip_grouped||d.data_selection_enabled&&!d.data_selection_grouped)&&b.main.selectAll("."+l.shape+"-"+f).each(function(){c.select(this).classed(l.EXPANDED,!0),d.data_selection_enabled&&g.style("cursor",d.data_selection_grouped?"pointer":null),d.tooltip_grouped||(b.hideXGridFocus(),b.hideTooltip(),d.data_selection_grouped||(b.unexpandCircles(f),b.unexpandBars(f)))}).filter(function(a){return b.isWithinShape(this,a)}).each(function(a){d.data_selection_enabled&&(d.data_selection_grouped||d.data_selection_isselectable(a))&&g.style("cursor","pointer"),d.tooltip_grouped||(b.showTooltip([a],this),b.showXGridFocus([a]),d.point_focus_expand_enabled&&b.expandCircles(f,a.id,!0),b.expandBars(f,a.id,!0))}))}).on("click",function(a){var e=a.index;if(!b.hasArcType()&&b.toggleShape){if(b.cancelClick)return void(b.cancelClick=!1);b.isStepType(a)&&"step-after"===d.line_step_type&&c.mouse(this)[0]<b.x(b.getXValue(a.id,e))&&(e-=1),b.main.selectAll("."+l.shape+"-"+e).each(function(a){(d.data_selection_grouped||b.isWithinShape(this,a))&&(b.toggleShape(this,a,e),b.config.data_onclick.call(b.api,a,this))})}}).call(d.data_selection_draggable&&b.drag?c.behavior.drag().origin(Object).on("drag",function(){b.drag(c.mouse(this))}).on("dragstart",function(){b.dragstart(c.mouse(this))}).on("dragend",function(){b.dragend()}):function(){})},i.generateEventRectsForMultipleXs=function(a){function b(){c.svg.select("."+l.eventRect).style("cursor",null),c.hideXGridFocus(),c.hideTooltip(),c.unexpandCircles(),c.unexpandBars()}var c=this,d=c.d3,e=c.config;a.append("rect").attr("x",0).attr("y",0).attr("width",c.width).attr("height",c.height).attr("class",l.eventRect).on("mouseout",function(){c.config&&(c.hasArcType()||b())}).on("mousemove",function(){var a,f,g,h,i=c.filterTargetsToShow(c.data.targets);if(!c.dragging&&!c.hasArcType(i)){if(a=d.mouse(this),f=c.findClosestFromTargets(i,a),!c.mouseover||f&&f.id===c.mouseover.id||(e.data_onmouseout.call(c.api,c.mouseover),c.mouseover=void 0),!f)return void b();g=c.isScatterType(f)||!e.tooltip_grouped?[f]:c.filterByX(i,f.x),h=g.map(function(a){return c.addName(a)}),c.showTooltip(h,this),e.point_focus_expand_enabled&&c.expandCircles(f.index,f.id,!0),c.expandBars(f.index,f.id,!0),c.showXGridFocus(h),(c.isBarType(f.id)||c.dist(f,a)<e.point_sensitivity)&&(c.svg.select("."+l.eventRect).style("cursor","pointer"),c.mouseover||(e.data_onmouseover.call(c.api,f),c.mouseover=f))}}).on("click",function(){var a,b,f=c.filterTargetsToShow(c.data.targets);c.hasArcType(f)||(a=d.mouse(this),b=c.findClosestFromTargets(f,a),b&&(c.isBarType(b.id)||c.dist(b,a)<e.point_sensitivity)&&c.main.selectAll("."+l.shapes+c.getTargetSelectorSuffix(b.id)).selectAll("."+l.shape+"-"+b.index).each(function(){(e.data_selection_grouped||c.isWithinShape(this,b))&&(c.toggleShape(this,b,b.index),c.config.data_onclick.call(c.api,b,this))}))}).call(e.data_selection_draggable&&c.drag?d.behavior.drag().origin(Object).on("drag",function(){c.drag(d.mouse(this))}).on("dragstart",function(){c.dragstart(d.mouse(this))}).on("dragend",function(){c.dragend()}):function(){})},i.dispatchEvent=function(b,c,d){var e=this,f="."+l.eventRect+(e.isMultipleX()?"":"-"+c),g=e.main.select(f).node(),h=g.getBoundingClientRect(),i=h.left+(d?d[0]:0),j=h.top+(d?d[1]:0),k=document.createEvent("MouseEvents");k.initMouseEvent(b,!0,!0,a,0,i,j,i,j,!1,!1,!1,!1,0,null),g.dispatchEvent(k)},i.getCurrentWidth=function(){var a=this,b=a.config;return b.size_width?b.size_width:a.getParentWidth()},i.getCurrentHeight=function(){var a=this,b=a.config,c=b.size_height?b.size_height:a.getParentHeight();return c>0?c:320/(a.hasType("gauge")&&!b.gauge_fullCircle?2:1)},i.getCurrentPaddingTop=function(){var a=this,b=a.config,c=m(b.padding_top)?b.padding_top:0;return a.title&&a.title.node()&&(c+=a.getTitlePadding()),c},i.getCurrentPaddingBottom=function(){var a=this.config;return m(a.padding_bottom)?a.padding_bottom:0},i.getCurrentPaddingLeft=function(a){var b=this,c=b.config;return m(c.padding_left)?c.padding_left:c.axis_rotated?c.axis_x_show?Math.max(r(b.getAxisWidthByAxisId("x",a)),40):1:!c.axis_y_show||c.axis_y_inner?b.axis.getYAxisLabelPosition().isOuter?30:1:r(b.getAxisWidthByAxisId("y",a))},i.getCurrentPaddingRight=function(){var a=this,b=a.config,c=10,d=a.isLegendRight?a.getLegendWidth()+20:0;return m(b.padding_right)?b.padding_right+1:b.axis_rotated?c+d:!b.axis_y2_show||b.axis_y2_inner?2+d+(a.axis.getY2AxisLabelPosition().isOuter?20:0):r(a.getAxisWidthByAxisId("y2"))+d},i.getParentRectValue=function(a){for(var b,c=this.selectChart.node();c&&"BODY"!==c.tagName;){try{b=c.getBoundingClientRect()[a]}catch(d){"width"===a&&(b=c.offsetWidth)}if(b)break;c=c.parentNode}return b},i.getParentWidth=function(){return this.getParentRectValue("width")},i.getParentHeight=function(){var a=this.selectChart.style("height");return a.indexOf("px")>0?+a.replace("px",""):0},i.getSvgLeft=function(a){var b=this,c=b.config,d=c.axis_rotated||!c.axis_rotated&&!c.axis_y_inner,e=c.axis_rotated?l.axisX:l.axisY,f=b.main.select("."+e).node(),g=f&&d?f.getBoundingClientRect():{right:0},h=b.selectChart.node().getBoundingClientRect(),i=b.hasArcType(),j=g.right-h.left-(i?0:b.getCurrentPaddingLeft(a));return j>0?j:0},i.getAxisWidthByAxisId=function(a,b){var c=this,d=c.axis.getLabelPositionById(a);return c.axis.getMaxTickWidth(a,b)+(d.isInner?20:40)},i.getHorizontalAxisHeight=function(a){var b=this,c=b.config,d=30;return"x"!==a||c.axis_x_show?"x"===a&&c.axis_x_height?c.axis_x_height:"y"!==a||c.axis_y_show?"y2"!==a||c.axis_y2_show?("x"===a&&!c.axis_rotated&&c.axis_x_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_x_tick_rotate)/180)),"y"===a&&c.axis_rotated&&c.axis_y_tick_rotate&&(d=30+b.axis.getMaxTickWidth(a)*Math.cos(Math.PI*(90-c.axis_y_tick_rotate)/180)),d+(b.axis.getLabelPositionById(a).isInner?0:10)+("y2"===a?-10:0)):b.rotated_padding_top:!c.legend_show||b.isLegendRight||b.isLegendInset?1:10:8},i.getEventRectWidth=function(){return Math.max(0,this.xAxis.tickInterval())},i.getShapeIndices=function(a){var b,c,d=this,e=d.config,f={},g=0;return d.filterTargetsToShow(d.data.targets.filter(a,d)).forEach(function(a){for(b=0;b<e.data_groups.length;b++)if(!(e.data_groups[b].indexOf(a.id)<0))for(c=0;c<e.data_groups[b].length;c++)if(e.data_groups[b][c]in f){f[a.id]=f[e.data_groups[b][c]];break}p(f[a.id])&&(f[a.id]=g++)}),f.__max__=g-1,f},i.getShapeX=function(a,b,c,d){var e=this,f=d?e.subX:e.x;return function(d){var e=d.id in c?c[d.id]:0;return d.x||0===d.x?f(d.x)-a*(b/2-e):0}},i.getShapeY=function(a){var b=this;return function(c){var d=a?b.getSubYScale(c.id):b.getYScale(c.id);return d(c.value)}},i.getShapeOffset=function(a,b,c){var d=this,e=d.orderTargets(d.filterTargetsToShow(d.data.targets.filter(a,d))),f=e.map(function(a){return a.id});return function(a,g){var h=c?d.getSubYScale(a.id):d.getYScale(a.id),i=h(0),j=i;return e.forEach(function(c){var e=d.isStepType(a)?d.convertValuesToStep(c.values):c.values;c.id!==a.id&&b[c.id]===b[a.id]&&f.indexOf(c.id)<f.indexOf(a.id)&&("undefined"!=typeof e[g]&&+e[g].x===+a.x||(g=-1,e.forEach(function(b,c){b.x===a.x&&(g=c)})),g in e&&e[g].value*a.value>=0&&(j+=h(e[g].value)-i))}),j}},i.isWithinShape=function(a,b){var c,d=this,e=d.d3.select(a);return d.isTargetToShow(b.id)?"circle"===a.nodeName?c=d.isStepType(b)?d.isWithinStep(a,d.getYScale(b.id)(b.value)):d.isWithinCircle(a,1.5*d.pointSelectR(b)):"path"===a.nodeName&&(c=e.classed(l.bar)?d.isWithinBar(a):!0):c=!1,c},i.getInterpolate=function(a){var b=this,c=b.isInterpolationType(b.config.spline_interpolation_type)?b.config.spline_interpolation_type:"cardinal";return b.isSplineType(a)?c:b.isStepType(a)?b.config.line_step_type:"linear"},i.initLine=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartLines)},i.updateTargetsForLine=function(a){var b,c,d=this,e=d.config,f=d.classChartLine.bind(d),g=d.classLines.bind(d),h=d.classAreas.bind(d),i=d.classCircles.bind(d),j=d.classFocus.bind(d);b=d.main.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",function(a){return f(a)+j(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g),c.append("g").attr("class",h),c.append("g").attr("class",function(a){return d.generateClass(l.selectedCircles,a.id)}),c.append("g").attr("class",i).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null}),a.forEach(function(a){d.main.selectAll("."+l.selectedCircles+d.getTargetSelectorSuffix(a.id)).selectAll("."+l.selectedCircle).each(function(b){b.value=a.values[b.index].value})})},i.updateLine=function(a){var b=this;b.mainLine=b.main.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.mainLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.mainLine.style("opacity",b.initialOpacity.bind(b)).style("shape-rendering",function(a){return b.isStepType(a)?"crispEdges":""}).attr("transform",null),b.mainLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLine=function(a,b){return[(b?this.mainLine.transition(Math.random().toString()):this.mainLine).attr("d",a).style("stroke",this.color).style("opacity",1)]},i.generateDrawLine=function(a,b){var c=this,d=c.config,e=c.d3.svg.line(),f=c.generateGetLinePoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x(i).y(h):e.x(h).y(i),d.line_connectNull||(e=e.defined(function(a){return null!=a.value})),function(a){var f,h=d.line_connectNull?c.filterRemoveNull(a.values):a.values,i=b?c.x:c.subX,j=g.call(c,a.id),k=0,l=0;return c.isLineType(a)?d.data_regions[a.id]?f=c.lineWithRegions(h,i,j,d.data_regions[a.id]):(c.isStepType(a)&&(h=c.convertValuesToStep(h)),f=e.interpolate(c.getInterpolate(a))(h)):(h[0]&&(k=i(h[0].x),l=j(h[0].value)),f=d.axis_rotated?"M "+l+" "+k:"M "+k+" "+l),f?f:"M 0 0"}},i.generateGetLinePoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isLineType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)],[k,l-(e-j)]]}},i.lineWithRegions=function(a,b,c,d){function e(a,b){var c;for(c=0;c<b.length;c++)if(b[c].start<a&&a<=b[c].end)return!0;return!1}function f(a){return"M"+a[0][0]+" "+a[0][1]+" "+a[1][0]+" "+a[1][1]}var g,h,i,j,k,l,m,n,o,r,s,t,u=this,v=u.config,w=-1,x="M",y=u.isCategorized()?.5:0,z=[];if(q(d))for(g=0;g<d.length;g++)z[g]={},p(d[g].start)?z[g].start=a[0].x:z[g].start=u.isTimeSeries()?u.parseDate(d[g].start):d[g].start,p(d[g].end)?z[g].end=a[a.length-1].x:z[g].end=u.isTimeSeries()?u.parseDate(d[g].end):d[g].end;for(s=v.axis_rotated?function(a){return c(a.value)}:function(a){return b(a.x)},t=v.axis_rotated?function(a){return b(a.x)}:function(a){return c(a.value)},i=u.isTimeSeries()?function(a,d,e,g){var h,i=a.x.getTime(),j=d.x-a.x,l=new Date(i+j*e),m=new Date(i+j*(e+g));return h=v.axis_rotated?[[c(k(e)),b(l)],[c(k(e+g)),b(m)]]:[[b(l),c(k(e))],[b(m),c(k(e+g))]],f(h)}:function(a,d,e,g){var h;return h=v.axis_rotated?[[c(k(e),!0),b(j(e))],[c(k(e+g),!0),b(j(e+g))]]:[[b(j(e),!0),c(k(e))],[b(j(e+g),!0),c(k(e+g))]],f(h)},g=0;g<a.length;g++){if(p(z)||!e(a[g].x,z))x+=" "+s(a[g])+" "+t(a[g]);else for(j=u.getScale(a[g-1].x+y,a[g].x+y,u.isTimeSeries()),k=u.getScale(a[g-1].value,a[g].value),l=b(a[g].x)-b(a[g-1].x),m=c(a[g].value)-c(a[g-1].value),n=Math.sqrt(Math.pow(l,2)+Math.pow(m,2)),o=2/n,r=2*o,h=o;1>=h;h+=r)x+=i(a[g-1],a[g],h,o);w=a[g].x}return x},i.updateArea=function(a){var b=this,c=b.d3;b.mainArea=b.main.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.mainArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.mainArea.style("opacity",b.orgAreaOpacity),b.mainArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawArea=function(a,b){return[(b?this.mainArea.transition(Math.random().toString()):this.mainArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)]},i.generateDrawArea=function(a,b){var c=this,d=c.config,e=c.d3.svg.area(),f=c.generateGetAreaPoints(a,b),g=b?c.getSubYScale:c.getYScale,h=function(a){return(b?c.subxx:c.xx).call(c,a)},i=function(a,b){return d.data_groups.length>0?f(a,b)[0][1]:g.call(c,a.id)(c.getAreaBaseValue(a.id))},j=function(a,b){return d.data_groups.length>0?f(a,b)[1][1]:g.call(c,a.id)(a.value)};return e=d.axis_rotated?e.x0(i).x1(j).y(h):e.x(h).y0(d.area_above?0:i).y1(j),d.line_connectNull||(e=e.defined(function(a){return null!==a.value})),function(a){var b,f=d.line_connectNull?c.filterRemoveNull(a.values):a.values,g=0,h=0;return c.isAreaType(a)?(c.isStepType(a)&&(f=c.convertValuesToStep(f)),b=e.interpolate(c.getInterpolate(a))(f)):(f[0]&&(g=c.x(f[0].x),h=c.getYScale(a.id)(f[0].value)),b=d.axis_rotated?"M "+h+" "+g:"M "+g+" "+h),b?b:"M 0 0"}},i.getAreaBaseValue=function(){return 0},i.generateGetAreaPoints=function(a,b){var c=this,d=c.config,e=a.__max__+1,f=c.getShapeX(0,e,a,!!b),g=c.getShapeY(!!b),h=c.getShapeOffset(c.isAreaType,a,!!b),i=b?c.getSubYScale:c.getYScale;return function(a,b){var e=i.call(c,a.id)(0),j=h(a,b)||e,k=f(a),l=g(a);return d.axis_rotated&&(0<a.value&&e>l||a.value<0&&l>e)&&(l=e),[[k,j],[k,l-(e-j)],[k,l-(e-j)],[k,j]]}},i.updateCircle=function(){var a=this;a.mainCircle=a.main.selectAll("."+l.circles).selectAll("."+l.circle).data(a.lineOrScatterData.bind(a)),a.mainCircle.enter().append("circle").attr("class",a.classCircle.bind(a)).attr("r",a.pointR.bind(a)).style("fill",a.color),a.mainCircle.style("opacity",a.initialOpacityForCircle.bind(a)),a.mainCircle.exit().remove()},i.redrawCircle=function(a,b,c){var d=this.main.selectAll("."+l.selectedCircle);return[(c?this.mainCircle.transition(Math.random().toString()):this.mainCircle).style("opacity",this.opacityForCircle.bind(this)).style("fill",this.color).attr("cx",a).attr("cy",b),(c?d.transition(Math.random().toString()):d).attr("cx",a).attr("cy",b)]},i.circleX=function(a){return a.x||0===a.x?this.x(a.x):null},i.updateCircleY=function(){var a,b,c=this;c.config.data_groups.length>0?(a=c.getShapeIndices(c.isLineType),b=c.generateGetLinePoints(a),c.circleY=function(a,c){return b(a,c)[0][1]}):c.circleY=function(a){return c.getYScale(a.id)(a.value)}},i.getCircles=function(a,b){var c=this;return(b?c.main.selectAll("."+l.circles+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.circle+(m(a)?"-"+a:""))},i.expandCircles=function(a,b,c){var d=this,e=d.pointExpandedR.bind(d);c&&d.unexpandCircles(),d.getCircles(a,b).classed(l.EXPANDED,!0).attr("r",e)},i.unexpandCircles=function(a){var b=this,c=b.pointR.bind(b);b.getCircles(a).filter(function(){return b.d3.select(this).classed(l.EXPANDED)}).classed(l.EXPANDED,!1).attr("r",c)},i.pointR=function(a){var b=this,c=b.config;return b.isStepType(a)?0:n(c.point_r)?c.point_r(a):c.point_r;
2312 },i.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},i.pointSelectR=function(a){var b=this,c=b.config;return n(c.point_select_r)?c.point_select_r(a):c.point_select_r?c.point_select_r:4*b.pointR(a)},i.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=+e.attr("cx"),g=+e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))<b},i.isWithinStep=function(a,b){return Math.abs(b-this.d3.mouse(a)[1])<30},i.initBar=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartBars)},i.updateTargetsForBar=function(a){var b,c,d=this,e=d.config,f=d.classChartBar.bind(d),g=d.classBars.bind(d),h=d.classFocus.bind(d);b=d.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",function(a){return f(a)+h(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null})},i.updateBar=function(a){var b=this,c=b.barData.bind(b),d=b.classBar.bind(b),e=b.initialOpacity.bind(b),f=function(a){return b.color(a.id)};b.mainBar=b.main.selectAll("."+l.bars).selectAll("."+l.bar).data(c),b.mainBar.enter().append("path").attr("class",d).style("stroke",f).style("fill",f),b.mainBar.style("opacity",e),b.mainBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBar=function(a,b){return[(b?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",a).style("fill",this.color).style("opacity",1)]},i.getBarW=function(a,b){var c=this,d=c.config,e="number"==typeof d.bar_width?d.bar_width:b?a.tickInterval()*d.bar_width_ratio/b:0;return d.bar_width_max&&e>d.bar_width_max?d.bar_width_max:e},i.getBars=function(a,b){var c=this;return(b?c.main.selectAll("."+l.bars+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.bar+(m(a)?"-"+a:""))},i.expandBars=function(a,b,c){var d=this;c&&d.unexpandBars(),d.getBars(a,b).classed(l.EXPANDED,!0)},i.unexpandBars=function(a){var b=this;b.getBars(a).classed(l.EXPANDED,!1)},i.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},i.generateGetBarPoints=function(a,b){var c=this,d=b?c.subXAxis:c.xAxis,e=a.__max__+1,f=c.getBarW(d,e),g=c.getShapeX(f,e,a,!!b),h=c.getShapeY(!!b),i=c.getShapeOffset(c.isBarType,a,!!b),j=b?c.getSubYScale:c.getYScale;return function(a,b){var d=j.call(c,a.id)(0),e=i(a,b)||d,k=g(a),l=h(a);return c.config.axis_rotated&&(0<a.value&&d>l||a.value<0&&l>d)&&(l=d),[[k,e],[k,l-(d-e)],[k+f,l-(d-e)],[k+f,e]]}},i.isWithinBar=function(a){var b=this.d3.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=Math.min(d.x,e.x),g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return k<b[0]&&b[0]<l&&n<b[1]&&b[1]<m},i.initText=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartTexts),a.mainText=a.d3.selectAll([])},i.updateTargetsForText=function(a){var b,c,d=this,e=d.classChartText.bind(d),f=d.classTexts.bind(d),g=d.classFocus.bind(d);b=d.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(a).attr("class",function(a){return e(a)+g(a)}),c=b.enter().append("g").attr("class",e).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",f)},i.updateText=function(a){var b=this,c=b.config,d=b.barOrLineData.bind(b),e=b.classText.bind(b);b.mainText=b.main.selectAll("."+l.texts).selectAll("."+l.text).data(d),b.mainText.enter().append("text").attr("class",e).attr("text-anchor",function(a){return c.axis_rotated?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(a){return b.color(a)}).style("fill-opacity",0),b.mainText.text(function(a,c,d){return b.dataLabelFormat(a.id)(a.value,a.id,c,d)}),b.mainText.exit().transition().duration(a).style("fill-opacity",0).remove()},i.redrawText=function(a,b,c,d){return[(d?this.mainText.transition():this.mainText).attr("x",a).attr("y",b).style("fill",this.color).style("fill-opacity",c?0:this.opacityForText.bind(this))]},i.getTextRect=function(a,b,c){var d,e=this.d3.select("body").append("div").classed("c3",!0),f=e.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g=this.d3.select(c).style("font");return f.selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).style("font",g).text(a).each(function(){d=this.getBoundingClientRect()}),e.remove(),d},i.generateXYForText=function(a,b,c,d){var e=this,f=e.generateGetAreaPoints(a,!1),g=e.generateGetBarPoints(b,!1),h=e.generateGetLinePoints(c,!1),i=d?e.getXForText:e.getYForText;return function(a,b){var c=e.isAreaType(a)?f:e.isBarType(a)?g:h;return i.call(e,c(a,b),a,this)}},i.getXForText=function(a,b,c){var d,e,f=this,g=c.getBoundingClientRect();return f.config.axis_rotated?(e=f.isBarType(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=f.hasType("bar")?(a[2][0]+a[0][0])/2:a[0][0],null===b.value&&(d>f.width?d=f.width-g.width:0>d&&(d=4)),d},i.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return e.config.axis_rotated?d=(a[0][0]+a[2][0]+.6*f.height)/2:(d=a[2][1],b.value<0||0===b.value&&!e.hasPositiveValue?(d+=f.height,e.isBarType(b)&&e.isSafari()?d-=3:!e.isBarType(b)&&e.isChrome()&&(d+=3)):d+=e.isBarType(b)?-3:-6),null!==b.value||e.config.axis_rotated||(d<f.height?d=f.height:d>this.height&&(d=this.height-4)),d},i.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d.data_types[a],d.data_types[a]=b}),a||(d.data_type=b)},i.hasType=function(a,b){var c=this,d=c.config.data_types,e=!1;return b=b||c.data.targets,b&&b.length?b.forEach(function(b){var c=d[b.id];(c&&c.indexOf(a)>=0||!c&&"line"===a)&&(e=!0)}):Object.keys(d).length?Object.keys(d).forEach(function(b){d[b]===a&&(e=!0)}):e=c.config.data_type===a,e},i.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},i.isLineType=function(a){var b=this.config,c=o(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},i.isStepType=function(a){var b=o(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},i.isSplineType=function(a){var b=o(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},i.isAreaType=function(a){var b=o(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},i.isBarType=function(a){var b=o(a)?a:a.id;return"bar"===this.config.data_types[b]},i.isScatterType=function(a){var b=o(a)?a:a.id;return"scatter"===this.config.data_types[b]},i.isPieType=function(a){var b=o(a)?a:a.id;return"pie"===this.config.data_types[b]},i.isGaugeType=function(a){var b=o(a)?a:a.id;return"gauge"===this.config.data_types[b]},i.isDonutType=function(a){var b=o(a)?a:a.id;return"donut"===this.config.data_types[b]},i.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},i.lineData=function(a){return this.isLineType(a)?[a]:[]},i.arcData=function(a){return this.isArcType(a.data)?[a]:[]},i.barData=function(a){return this.isBarType(a)?a.values:[]},i.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},i.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},i.isInterpolationType=function(a){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(a)>=0},i.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid),b.grid_x_show&&a.grid.append("g").attr("class",l.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",l.ygrids),b.grid_focus_show&&a.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),a.xgrid=c.selectAll([]),b.grid_lines_front||a.initGridLines()},i.initGridLines=function(){var a=this,b=a.d3;a.gridLines=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),a.gridLines.append("g").attr("class",l.xgridLines),a.gridLines.append("g").attr("class",l.ygridLines),a.xgridLines=b.selectAll([])},i.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(e),b.xgrid.enter().append("line").attr("class",l.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},i.updateYGrid=function(){var a=this,b=a.config,c=a.yAxis.tickValues()||a.y.ticks(b.grid_y_ticks);a.ygrid=a.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(c),a.ygrid.enter().append("line").attr("class",l.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},i.gridTextAnchor=function(a){return a.position?a.position:"end"},i.gridTextDx=function(a){return"start"===a.position?4:"middle"===a.position?0:-4},i.xGridTextX=function(a){return"start"===a.position?-this.height:"middle"===a.position?-this.height/2:0},i.yGridTextX=function(a){return"start"===a.position?0:"middle"===a.position?this.width/2:this.width},i.updateGrid=function(a){var b,c,d,e=this,f=e.main,g=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),f.select("line."+l.xgridFocus).style("visibility","hidden"),g.grid_x_show&&e.updateXGrid(),e.xgridLines=f.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(g.grid_x_lines),b=e.xgridLines.enter().append("g").attr("class",function(a){return l.xgridLine+(a["class"]?" "+a["class"]:"")}),b.append("line").style("opacity",0),b.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"":"rotate(-90)").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),e.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),g.grid_y_show&&e.updateYGrid(),e.ygridLines=f.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(g.grid_y_lines),c=e.ygridLines.enter().append("g").attr("class",function(a){return l.ygridLine+(a["class"]?" "+a["class"]:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"rotate(-90)":"").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),d=e.yv.bind(e),e.ygridLines.select("line").transition().duration(a).attr("x1",g.axis_rotated?d:0).attr("x2",g.axis_rotated?d:e.width).attr("y1",g.axis_rotated?0:d).attr("y2",g.axis_rotated?e.height:d).style("opacity",1),e.ygridLines.select("text").transition().duration(a).attr("x",g.axis_rotated?e.xGridTextX.bind(e):e.yGridTextX.bind(e)).attr("y",d).text(function(a){return a.text}).style("opacity",1),e.ygridLines.exit().transition().duration(a).style("opacity",0).remove()},i.redrawGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b),e=b.xgridLines.select("line"),f=b.xgridLines.select("text");return[(a?e.transition():e).attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:0).attr("y2",c.axis_rotated?d:b.height).style("opacity",1),(a?f.transition():f).attr("x",c.axis_rotated?b.yGridTextX.bind(b):b.xGridTextX.bind(b)).attr("y",d).text(function(a){return a.text}).style("opacity",1)]},i.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&m(a.value)}),e=b.main.selectAll("line."+l.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},i.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},i.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+l.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},i.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],i=g.main.select("."+l.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},i.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(a){("value"in a&&b.value===a.value||"class"in a&&b["class"]===a["class"])&&(c=!0)}),c}:function(){return!0}},i.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?l.xgridLines:l.ygridLines,h=b?l.xgridLine:l.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},i.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&o(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a<b.data.targets[0].values.length&&b.data.targets[0].values[a].x-c.tooltip_init_x!==0;a++);c.tooltip_init_x=a}b.tooltip.html(c.tooltip_contents.call(b,b.data.targets.map(function(a){return b.addName(a.values[c.tooltip_init_x])}),b.axis.getXAxisTickFormat(),b.getYFormat(b.hasArcType()),b.color)),b.tooltip.style("top",c.tooltip_init_position.top).style("left",c.tooltip_init_position.left).style("display","block")}},i.getTooltipContent=function(a,b,c,d){var e,f,g,h,i,j,k=this,l=k.config,m=l.tooltip_format_title||b,n=l.tooltip_format_name||function(a){return a},o=l.tooltip_format_value||c,p=k.isOrderAsc();if(0===l.data_groups.length)a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return p?c-d:d-c});else{var q=k.orderTargets(k.data.targets).map(function(a){return a.id});a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return c>0&&d>0&&(c=a?q.indexOf(a.id):null,d=b?q.indexOf(b.id):null),p?c-d:d-c})}for(f=0;f<a.length;f++)if(a[f]&&(a[f].value||0===a[f].value)&&(e||(g=y(m?m(a[f].x):a[f].x),e="<table class='"+k.CLASS.tooltip+"'>"+(g||0===g?"<tr><th colspan='2'>"+g+"</th></tr>":"")),h=y(o(a[f].value,a[f].ratio,a[f].id,a[f].index,a)),void 0!==h)){if(null===a[f].name)continue;i=y(n(a[f].name,a[f].ratio,a[f].id,a[f].index)),j=k.levelColor?k.levelColor(a[f].value):d(a[f].id),e+="<tr class='"+k.CLASS.tooltipName+"-"+k.getTargetSelectorSuffix(a[f].id)+"'>",e+="<td class='name'><span style='background-color:"+j+"'></span>"+i+"</td>",e+="<td class='value'>"+h+"</td>",e+="</tr>"}return e+"</table>"},i.tooltipPosition=function(a,b,c,d){var e,f,g,h,i,j=this,k=j.config,l=j.d3,m=j.hasArcType(),n=l.mouse(d);return m?(f=(j.width-(j.isLegendRight?j.getLegendWidth():0))/2+n[0],h=j.height/2+n[1]+20):(e=j.getSvgLeft(!0),k.axis_rotated?(f=e+n[0]+100,g=f+b,i=j.currentWidth-j.getCurrentPaddingRight(),h=j.x(a[0].x)+20):(f=e+j.getCurrentPaddingLeft(!0)+j.x(a[0].x)+20,g=f+b,i=e+j.currentWidth-j.getCurrentPaddingRight(),h=n[1]+15),g>i&&(f-=g-i+20),h+c>j.currentHeight&&(h-=c+30)),0>h&&(h=0),{top:h,left:f}},i.showTooltip=function(a,b){var c,d,e,f=this,g=f.config,h=f.hasArcType(),j=a.filter(function(a){return a&&m(a.value)}),k=g.tooltip_position||i.tooltipPosition;0!==j.length&&g.tooltip_show&&(f.tooltip.html(g.tooltip_contents.call(f,a,f.axis.getXAxisTickFormat(),f.getYFormat(h),f.color)).style("display","block"),c=f.tooltip.property("offsetWidth"),d=f.tooltip.property("offsetHeight"),e=k.call(this,j,c,d,b),f.tooltip.style("top",e.top+"px").style("left",e.left+"px"))},i.hideTooltip=function(){this.tooltip.style("display","none")},i.initLegend=function(){var a=this;return a.legendItemTextBox={},a.legendHasRendered=!1,a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),a.config.legend_show?void a.updateLegendWithDefaults():(a.legend.style("visibility","hidden"),void(a.hiddenLegendIds=a.mapToIds(a.data.targets)))},i.updateLegendWithDefaults=function(){var a=this;a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},i.updateSizeForLegend=function(a,b){var c=this,d=c.config,e={top:c.isLegendTop?c.getCurrentPaddingTop()+d.legend_inset_y+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-d.legend_inset_y,left:c.isLegendLeft?c.getCurrentPaddingLeft()+d.legend_inset_x+.5:c.currentWidth-b-c.getCurrentPaddingRight()-d.legend_inset_x+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?e.top:c.currentHeight-a,right:NaN,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?e.left:0}},i.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},i.updateLegendStep=function(a){this.legendStep=a},i.updateLegendItemWidth=function(a){this.legendItemWidth=a},i.updateLegendItemHeight=function(a){this.legendItemHeight=a},i.getLegendWidth=function(){var a=this;return a.config.legend_show?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},i.getLegendHeight=function(){var a=this,b=0;return a.config.legend_show&&(b=a.isLegendRight?a.currentHeight:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),b},i.opacityForLegend=function(a){return a.classed(l.legendItemHidden)?null:1},i.opacityForUnfocusedLegend=function(a){return a.classed(l.legendItemHidden)?null:.3},i.toggleFocusLegend=function(a,b){var c=this;a=c.mapToTargetIds(a),c.legend.selectAll("."+l.legendItem).filter(function(b){return a.indexOf(b)>=0}).classed(l.legendItemFocused,b).transition().duration(100).style("opacity",function(){var a=b?c.opacityForLegend:c.opacityForUnfocusedLegend;return a.call(c,c.d3.select(this))})},i.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},i.showLegend=function(a){var b=this,c=b.config;c.legend_show||(c.legend_show=!0,b.legend.style("visibility","visible"),b.legendHasRendered||b.updateLegendWithDefaults()),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},i.hideLegend=function(a){var b=this,c=b.config;c.legend_show&&u(a)&&(c.legend_show=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")},i.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},i.updateLegend=function(a,b,c){function d(a,b){return y.legendItemTextBox[b]||(y.legendItemTextBox[b]=y.getTextRect(a.textContent,l.legendItem,a)),y.legendItemTextBox[b]}function e(b,c,e){function f(a,b){b||(g=(o-G-n)/2,E>g&&(g=(o-n)/2,G=0,M++)),L[a]=M,K[M]=y.isLegendInset?10:g,H[a]=G,G+=n}var g,h,i=0===e,j=e===a.length-1,k=d(b,c),l=k.width+F+(!j||y.isLegendRight||y.isLegendInset?B:0)+z.legend_padding,m=k.height+A,n=y.isLegendRight||y.isLegendInset?m:l,o=y.isLegendRight||y.isLegendInset?y.getLegendHeight():y.getLegendWidth();return i&&(G=0,M=0,C=0,D=0),z.legend_show&&!y.isLegendToShow(c)?void(I[c]=J[c]=L[c]=H[c]=0):(I[c]=l,J[c]=m,(!C||l>=C)&&(C=l),(!D||m>=D)&&(D=m),h=y.isLegendRight||y.isLegendInset?D:C,void(z.legend_equally?(Object.keys(I).forEach(function(a){I[a]=C}),Object.keys(J).forEach(function(a){J[a]=D}),g=(o-h*a.length)/2,E>g?(G=0,M=0,a.forEach(function(a){f(a)})):f(c,!0)):f(c)))}var f,g,h,i,j,k,m,n,o,p,r,s,t,u,v,x,y=this,z=y.config,A=4,B=10,C=0,D=0,E=10,F=z.legend_item_tile_width+5,G=0,H={},I={},J={},K=[0],L={},M=0;a=a.filter(function(a){return!q(z.data_names[a])||null!==z.data_names[a]}),b=b||{},r=w(b,"withTransition",!0),s=w(b,"withTransitionForTransform",!0),y.isLegendInset&&(M=z.legend_inset_step?z.legend_inset_step:a.length,y.updateLegendStep(M)),y.isLegendRight?(f=function(a){return C*L[a]},i=function(a){return K[L[a]]+H[a]}):y.isLegendInset?(f=function(a){return C*L[a]+10},i=function(a){return K[L[a]]+H[a]}):(f=function(a){return K[L[a]]+H[a]},i=function(a){return D*L[a]}),g=function(a,b){return f(a,b)+4+z.legend_item_tile_width},j=function(a,b){return i(a,b)+9},h=function(a,b){return f(a,b)},k=function(a,b){return i(a,b)-5},m=function(a,b){return f(a,b)-2},n=function(a,b){return f(a,b)-2+z.legend_item_tile_width},o=function(a,b){return i(a,b)+4},p=y.legend.selectAll("."+l.legendItem).data(a).enter().append("g").attr("class",function(a){return y.generateClass(l.legendItem,a)}).style("visibility",function(a){return y.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){z.legend_item_onclick?z.legend_item_onclick.call(y,a):y.d3.event.altKey?(y.api.hide(),y.api.show(a)):(y.api.toggle(a),y.isTargetToShow(a)?y.api.focus(a):y.api.revert())}).on("mouseover",function(a){z.legend_item_onmouseover?z.legend_item_onmouseover.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!0),!y.transiting&&y.isTargetToShow(a)&&y.api.focus(a))}).on("mouseout",function(a){z.legend_item_onmouseout?z.legend_item_onmouseout.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!1),y.api.revert())}),p.append("text").text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}).style("pointer-events","none").attr("x",y.isLegendRight||y.isLegendInset?g:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:j),p.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",y.isLegendRight||y.isLegendInset?h:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:k),p.append("line").attr("class",l.legendItemTile).style("stroke",y.color).style("pointer-events","none").attr("x1",y.isLegendRight||y.isLegendInset?m:-200).attr("y1",y.isLegendRight||y.isLegendInset?-200:o).attr("x2",y.isLegendRight||y.isLegendInset?n:-200).attr("y2",y.isLegendRight||y.isLegendInset?-200:o).attr("stroke-width",z.legend_item_tile_height),x=y.legend.select("."+l.legendBackground+" rect"),y.isLegendInset&&C>0&&0===x.size()&&(x=y.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),t=y.legend.selectAll("text").data(a).text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}),(r?t.transition():t).attr("x",g).attr("y",j),u=y.legend.selectAll("rect."+l.legendItemEvent).data(a),(r?u.transition():u).attr("width",function(a){return I[a]}).attr("height",function(a){return J[a]}).attr("x",h).attr("y",k),v=y.legend.selectAll("line."+l.legendItemTile).data(a),(r?v.transition():v).style("stroke",y.color).attr("x1",m).attr("y1",o).attr("x2",n).attr("y2",o),x&&(r?x.transition():x).attr("height",y.getLegendHeight()-12).attr("width",C*(M+1)+10),y.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(a){return!y.isTargetToShow(a)}),y.updateLegendItemWidth(C),y.updateLegendItemHeight(D),y.updateLegendStep(M),y.updateSizes(),y.updateScales(),y.updateSvgSize(),y.transformAll(s,c),y.legendHasRendered=!0},i.initTitle=function(){var a=this;a.title=a.svg.append("text").text(a.config.title_text).attr("class",a.CLASS.title)},i.redrawTitle=function(){var a=this;a.title.attr("x",a.xForTitle.bind(a)).attr("y",a.yForTitle.bind(a))},i.xForTitle=function(){var a,b=this,c=b.config,d=c.title_position||"left";return a=d.indexOf("right")>=0?b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width-c.title_padding.right:d.indexOf("center")>=0?(b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width)/2:c.title_padding.left},i.yForTitle=function(){var a=this;return a.config.title_padding.top+a.getTextRect(a.title.node().textContent,a.CLASS.title,a.title.node()).height},i.getTitlePadding=function(){var a=this;return a.yForTitle()+a.config.title_padding.bottom},c(b,f),f.prototype.init=function(){var a=this.owner,b=a.config,c=a.main;a.axes.x=c.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",a.clipPathForXAxis).attr("transform",a.getTranslate("x")).style("visibility",b.axis_x_show?"visible":"hidden"),a.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",b.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),a.axes.y=c.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",b.axis_y_inner?"":a.clipPathForYAxis).attr("transform",a.getTranslate("y")).style("visibility",b.axis_y_show?"visible":"hidden"),a.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),a.axes.y2=c.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",a.getTranslate("y2")).style("visibility",b.axis_y2_show?"visible":"hidden"),a.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={isCategory:i.isCategorized(),withOuterTick:e,tickMultiline:j.axis_x_tick_multiline,tickWidth:j.axis_x_tick_width,tickTextRotate:h?0:j.axis_x_tick_rotate,withoutTransition:f},l=g(i.d3,k).scale(a).orient(b);return i.isTimeSeries()&&d&&"function"!=typeof d&&(d=d.map(function(a){return i.parseDate(a)})),l.tickFormat(c).tickValues(d),i.isCategorized()&&(l.tickCentered(j.axis_x_tick_centered),u(j.axis_x_tick_culling)&&(j.axis_x_tick_culling=!1)),l},f.prototype.updateXAxisTickValues=function(a,b){var c,d=this.owner,e=d.config;return(e.axis_x_tick_fit||e.axis_x_tick_count)&&(c=this.generateTickValues(d.mapTargetsToUniqueXs(a),e.axis_x_tick_count,d.isTimeSeries())),b?b.tickValues(c):(d.xAxis.tickValues(c),d.subXAxis.tickValues(c)),c},f.prototype.getYAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={withOuterTick:e,withoutTransition:f,tickTextRotate:h?0:j.axis_y_tick_rotate},l=g(i.d3,k).scale(a).orient(b).tickFormat(c);return i.isTimeSeriesY()?l.ticks(i.d3.time[j.axis_y_tick_time_value],j.axis_y_tick_time_interval):l.tickValues(d),l},f.prototype.getId=function(a){var b=this.owner.config;return a in b.data_axes?b.data_axes[a]:"y"},f.prototype.getXAxisTickFormat=function(){var a=this.owner,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b.axis_x_tick_format&&(n(b.axis_x_tick_format)?c=b.axis_x_tick_format:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b.axis_x_tick_format)(c):""})),n(c)?function(b){return c.call(a,b)}:c},f.prototype.getTickValues=function(a,b){return a?a:b?b.tickValues():void 0},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(a){var b,c=this.owner,d=c.config;return"y"===a?b=d.axis_y_label:"y2"===a?b=d.axis_y2_label:"x"===a&&(b=d.axis_x_label),b},f.prototype.getLabelText=function(a){var b=this.getLabelOptionByAxisId(a);return o(b)?b:b?b.text:null},f.prototype.setLabelText=function(a,b){var c=this.owner,d=c.config,e=this.getLabelOptionByAxisId(a);o(e)?"y"===a?d.axis_y_label=b:"y2"===a?d.axis_y2_label=b:"x"===a&&(d.axis_x_label=b):e&&(e.text=b)},f.prototype.getLabelPosition=function(a,b){var c=this.getLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(a,b){var c=this.owner;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.prototype.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var a=this.owner,b=a.config,c=this.getXAxisLabelPosition();return b.axis_rotated?c.isInner?"1.2em":-25-this.getMaxTickWidth("x"):c.isInner?"-0.5em":b.axis_x_height?b.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var a=this.owner,b=this.getYAxisLabelPosition();return a.config.axis_rotated?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-10-(a.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var a=this.owner,b=this.getY2AxisLabelPosition();return a.config.axis_rotated?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":15+(a.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(!a.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(a,b){var c,d,e,f,g,h=this.owner,i=h.config,j=0;return b&&h.currentMaxTickWidths[a]?h.currentMaxTickWidths[a]:(h.svg&&(c=h.filterTargetsToShow(h.data.targets),"y"===a?(d=h.y.copy().domain(h.getYDomain(c,"y")),e=this.getYAxis(d,h.yOrient,i.axis_y_tick_format,h.yAxisTickValues,!1,!0,!0)):"y2"===a?(d=h.y2.copy().domain(h.getYDomain(c,"y2")),
2312 },i.pointExpandedR=function(a){var b=this,c=b.config;return c.point_focus_expand_enabled?c.point_focus_expand_r?c.point_focus_expand_r:1.75*b.pointR(a):b.pointR(a)},i.pointSelectR=function(a){var b=this,c=b.config;return n(c.point_select_r)?c.point_select_r(a):c.point_select_r?c.point_select_r:4*b.pointR(a)},i.isWithinCircle=function(a,b){var c=this.d3,d=c.mouse(a),e=c.select(a),f=+e.attr("cx"),g=+e.attr("cy");return Math.sqrt(Math.pow(f-d[0],2)+Math.pow(g-d[1],2))<b},i.isWithinStep=function(a,b){return Math.abs(b-this.d3.mouse(a)[1])<30},i.initBar=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartBars)},i.updateTargetsForBar=function(a){var b,c,d=this,e=d.config,f=d.classChartBar.bind(d),g=d.classBars.bind(d),h=d.classFocus.bind(d);b=d.main.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",function(a){return f(a)+h(a)}),c=b.enter().append("g").attr("class",f).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",g).style("cursor",function(a){return e.data_selection_isselectable(a)?"pointer":null})},i.updateBar=function(a){var b=this,c=b.barData.bind(b),d=b.classBar.bind(b),e=b.initialOpacity.bind(b),f=function(a){return b.color(a.id)};b.mainBar=b.main.selectAll("."+l.bars).selectAll("."+l.bar).data(c),b.mainBar.enter().append("path").attr("class",d).style("stroke",f).style("fill",f),b.mainBar.style("opacity",e),b.mainBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBar=function(a,b){return[(b?this.mainBar.transition(Math.random().toString()):this.mainBar).attr("d",a).style("fill",this.color).style("opacity",1)]},i.getBarW=function(a,b){var c=this,d=c.config,e="number"==typeof d.bar_width?d.bar_width:b?a.tickInterval()*d.bar_width_ratio/b:0;return d.bar_width_max&&e>d.bar_width_max?d.bar_width_max:e},i.getBars=function(a,b){var c=this;return(b?c.main.selectAll("."+l.bars+c.getTargetSelectorSuffix(b)):c.main).selectAll("."+l.bar+(m(a)?"-"+a:""))},i.expandBars=function(a,b,c){var d=this;c&&d.unexpandBars(),d.getBars(a,b).classed(l.EXPANDED,!0)},i.unexpandBars=function(a){var b=this;b.getBars(a).classed(l.EXPANDED,!1)},i.generateDrawBar=function(a,b){var c=this,d=c.config,e=c.generateGetBarPoints(a,b);return function(a,b){var c=e(a,b),f=d.axis_rotated?1:0,g=d.axis_rotated?0:1,h="M "+c[0][f]+","+c[0][g]+" L"+c[1][f]+","+c[1][g]+" L"+c[2][f]+","+c[2][g]+" L"+c[3][f]+","+c[3][g]+" z";return h}},i.generateGetBarPoints=function(a,b){var c=this,d=b?c.subXAxis:c.xAxis,e=a.__max__+1,f=c.getBarW(d,e),g=c.getShapeX(f,e,a,!!b),h=c.getShapeY(!!b),i=c.getShapeOffset(c.isBarType,a,!!b),j=b?c.getSubYScale:c.getYScale;return function(a,b){var d=j.call(c,a.id)(0),e=i(a,b)||d,k=g(a),l=h(a);return c.config.axis_rotated&&(0<a.value&&d>l||a.value<0&&l>d)&&(l=d),[[k,e],[k,l-(d-e)],[k+f,l-(d-e)],[k+f,e]]}},i.isWithinBar=function(a){var b=this.d3.mouse(a),c=a.getBoundingClientRect(),d=a.pathSegList.getItem(0),e=a.pathSegList.getItem(1),f=Math.min(d.x,e.x),g=Math.min(d.y,e.y),h=c.width,i=c.height,j=2,k=f-j,l=f+h+j,m=g+i+j,n=g-j;return k<b[0]&&b[0]<l&&n<b[1]&&b[1]<m},i.initText=function(){var a=this;a.main.select("."+l.chart).append("g").attr("class",l.chartTexts),a.mainText=a.d3.selectAll([])},i.updateTargetsForText=function(a){var b,c,d=this,e=d.classChartText.bind(d),f=d.classTexts.bind(d),g=d.classFocus.bind(d);b=d.main.select("."+l.chartTexts).selectAll("."+l.chartText).data(a).attr("class",function(a){return e(a)+g(a)}),c=b.enter().append("g").attr("class",e).style("opacity",0).style("pointer-events","none"),c.append("g").attr("class",f)},i.updateText=function(a){var b=this,c=b.config,d=b.barOrLineData.bind(b),e=b.classText.bind(b);b.mainText=b.main.selectAll("."+l.texts).selectAll("."+l.text).data(d),b.mainText.enter().append("text").attr("class",e).attr("text-anchor",function(a){return c.axis_rotated?a.value<0?"end":"start":"middle"}).style("stroke","none").style("fill",function(a){return b.color(a)}).style("fill-opacity",0),b.mainText.text(function(a,c,d){return b.dataLabelFormat(a.id)(a.value,a.id,c,d)}),b.mainText.exit().transition().duration(a).style("fill-opacity",0).remove()},i.redrawText=function(a,b,c,d){return[(d?this.mainText.transition():this.mainText).attr("x",a).attr("y",b).style("fill",this.color).style("fill-opacity",c?0:this.opacityForText.bind(this))]},i.getTextRect=function(a,b,c){var d,e=this.d3.select("body").append("div").classed("c3",!0),f=e.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g=this.d3.select(c).style("font");return f.selectAll(".dummy").data([a]).enter().append("text").classed(b?b:"",!0).style("font",g).text(a).each(function(){d=this.getBoundingClientRect()}),e.remove(),d},i.generateXYForText=function(a,b,c,d){var e=this,f=e.generateGetAreaPoints(a,!1),g=e.generateGetBarPoints(b,!1),h=e.generateGetLinePoints(c,!1),i=d?e.getXForText:e.getYForText;return function(a,b){var c=e.isAreaType(a)?f:e.isBarType(a)?g:h;return i.call(e,c(a,b),a,this)}},i.getXForText=function(a,b,c){var d,e,f=this,g=c.getBoundingClientRect();return f.config.axis_rotated?(e=f.isBarType(b)?4:6,d=a[2][1]+e*(b.value<0?-1:1)):d=f.hasType("bar")?(a[2][0]+a[0][0])/2:a[0][0],null===b.value&&(d>f.width?d=f.width-g.width:0>d&&(d=4)),d},i.getYForText=function(a,b,c){var d,e=this,f=c.getBoundingClientRect();return e.config.axis_rotated?d=(a[0][0]+a[2][0]+.6*f.height)/2:(d=a[2][1],b.value<0||0===b.value&&!e.hasPositiveValue?(d+=f.height,e.isBarType(b)&&e.isSafari()?d-=3:!e.isBarType(b)&&e.isChrome()&&(d+=3)):d+=e.isBarType(b)?-3:-6),null!==b.value||e.config.axis_rotated||(d<f.height?d=f.height:d>this.height&&(d=this.height-4)),d},i.setTargetType=function(a,b){var c=this,d=c.config;c.mapToTargetIds(a).forEach(function(a){c.withoutFadeIn[a]=b===d.data_types[a],d.data_types[a]=b}),a||(d.data_type=b)},i.hasType=function(a,b){var c=this,d=c.config.data_types,e=!1;return b=b||c.data.targets,b&&b.length?b.forEach(function(b){var c=d[b.id];(c&&c.indexOf(a)>=0||!c&&"line"===a)&&(e=!0)}):Object.keys(d).length?Object.keys(d).forEach(function(b){d[b]===a&&(e=!0)}):e=c.config.data_type===a,e},i.hasArcType=function(a){return this.hasType("pie",a)||this.hasType("donut",a)||this.hasType("gauge",a)},i.isLineType=function(a){var b=this.config,c=o(a)?a:a.id;return!b.data_types[c]||["line","spline","area","area-spline","step","area-step"].indexOf(b.data_types[c])>=0},i.isStepType=function(a){var b=o(a)?a:a.id;return["step","area-step"].indexOf(this.config.data_types[b])>=0},i.isSplineType=function(a){var b=o(a)?a:a.id;return["spline","area-spline"].indexOf(this.config.data_types[b])>=0},i.isAreaType=function(a){var b=o(a)?a:a.id;return["area","area-spline","area-step"].indexOf(this.config.data_types[b])>=0},i.isBarType=function(a){var b=o(a)?a:a.id;return"bar"===this.config.data_types[b]},i.isScatterType=function(a){var b=o(a)?a:a.id;return"scatter"===this.config.data_types[b]},i.isPieType=function(a){var b=o(a)?a:a.id;return"pie"===this.config.data_types[b]},i.isGaugeType=function(a){var b=o(a)?a:a.id;return"gauge"===this.config.data_types[b]},i.isDonutType=function(a){var b=o(a)?a:a.id;return"donut"===this.config.data_types[b]},i.isArcType=function(a){return this.isPieType(a)||this.isDonutType(a)||this.isGaugeType(a)},i.lineData=function(a){return this.isLineType(a)?[a]:[]},i.arcData=function(a){return this.isArcType(a.data)?[a]:[]},i.barData=function(a){return this.isBarType(a)?a.values:[]},i.lineOrScatterData=function(a){return this.isLineType(a)||this.isScatterType(a)?a.values:[]},i.barOrLineData=function(a){return this.isBarType(a)||this.isLineType(a)?a.values:[]},i.isInterpolationType=function(a){return["linear","linear-closed","basis","basis-open","basis-closed","bundle","cardinal","cardinal-open","cardinal-closed","monotone"].indexOf(a)>=0},i.initGrid=function(){var a=this,b=a.config,c=a.d3;a.grid=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid),b.grid_x_show&&a.grid.append("g").attr("class",l.xgrids),b.grid_y_show&&a.grid.append("g").attr("class",l.ygrids),b.grid_focus_show&&a.grid.append("g").attr("class",l.xgridFocus).append("line").attr("class",l.xgridFocus),a.xgrid=c.selectAll([]),b.grid_lines_front||a.initGridLines()},i.initGridLines=function(){var a=this,b=a.d3;a.gridLines=a.main.append("g").attr("clip-path",a.clipPathForGrid).attr("class",l.grid+" "+l.gridLines),a.gridLines.append("g").attr("class",l.xgridLines),a.gridLines.append("g").attr("class",l.ygridLines),a.xgridLines=b.selectAll([])},i.updateXGrid=function(a){var b=this,c=b.config,d=b.d3,e=b.generateGridData(c.grid_x_type,b.x),f=b.isCategorized()?b.xAxis.tickOffset():0;b.xgridAttr=c.axis_rotated?{x1:0,x2:b.width,y1:function(a){return b.x(a)-f},y2:function(a){return b.x(a)-f}}:{x1:function(a){return b.x(a)+f},x2:function(a){return b.x(a)+f},y1:0,y2:b.height},b.xgrid=b.main.select("."+l.xgrids).selectAll("."+l.xgrid).data(e),b.xgrid.enter().append("line").attr("class",l.xgrid),a||b.xgrid.attr(b.xgridAttr).style("opacity",function(){return+d.select(this).attr(c.axis_rotated?"y1":"x1")===(c.axis_rotated?b.height:0)?0:1}),b.xgrid.exit().remove()},i.updateYGrid=function(){var a=this,b=a.config,c=a.yAxis.tickValues()||a.y.ticks(b.grid_y_ticks);a.ygrid=a.main.select("."+l.ygrids).selectAll("."+l.ygrid).data(c),a.ygrid.enter().append("line").attr("class",l.ygrid),a.ygrid.attr("x1",b.axis_rotated?a.y:0).attr("x2",b.axis_rotated?a.y:a.width).attr("y1",b.axis_rotated?0:a.y).attr("y2",b.axis_rotated?a.height:a.y),a.ygrid.exit().remove(),a.smoothLines(a.ygrid,"grid")},i.gridTextAnchor=function(a){return a.position?a.position:"end"},i.gridTextDx=function(a){return"start"===a.position?4:"middle"===a.position?0:-4},i.xGridTextX=function(a){return"start"===a.position?-this.height:"middle"===a.position?-this.height/2:0},i.yGridTextX=function(a){return"start"===a.position?0:"middle"===a.position?this.width/2:this.width},i.updateGrid=function(a){var b,c,d,e=this,f=e.main,g=e.config;e.grid.style("visibility",e.hasArcType()?"hidden":"visible"),f.select("line."+l.xgridFocus).style("visibility","hidden"),g.grid_x_show&&e.updateXGrid(),e.xgridLines=f.select("."+l.xgridLines).selectAll("."+l.xgridLine).data(g.grid_x_lines),b=e.xgridLines.enter().append("g").attr("class",function(a){return l.xgridLine+(a["class"]?" "+a["class"]:"")}),b.append("line").style("opacity",0),b.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"":"rotate(-90)").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),e.xgridLines.exit().transition().duration(a).style("opacity",0).remove(),g.grid_y_show&&e.updateYGrid(),e.ygridLines=f.select("."+l.ygridLines).selectAll("."+l.ygridLine).data(g.grid_y_lines),c=e.ygridLines.enter().append("g").attr("class",function(a){return l.ygridLine+(a["class"]?" "+a["class"]:"")}),c.append("line").style("opacity",0),c.append("text").attr("text-anchor",e.gridTextAnchor).attr("transform",g.axis_rotated?"rotate(-90)":"").attr("dx",e.gridTextDx).attr("dy",-5).style("opacity",0),d=e.yv.bind(e),e.ygridLines.select("line").transition().duration(a).attr("x1",g.axis_rotated?d:0).attr("x2",g.axis_rotated?d:e.width).attr("y1",g.axis_rotated?0:d).attr("y2",g.axis_rotated?e.height:d).style("opacity",1),e.ygridLines.select("text").transition().duration(a).attr("x",g.axis_rotated?e.xGridTextX.bind(e):e.yGridTextX.bind(e)).attr("y",d).text(function(a){return a.text}).style("opacity",1),e.ygridLines.exit().transition().duration(a).style("opacity",0).remove()},i.redrawGrid=function(a){var b=this,c=b.config,d=b.xv.bind(b),e=b.xgridLines.select("line"),f=b.xgridLines.select("text");return[(a?e.transition():e).attr("x1",c.axis_rotated?0:d).attr("x2",c.axis_rotated?b.width:d).attr("y1",c.axis_rotated?d:0).attr("y2",c.axis_rotated?d:b.height).style("opacity",1),(a?f.transition():f).attr("x",c.axis_rotated?b.yGridTextX.bind(b):b.xGridTextX.bind(b)).attr("y",d).text(function(a){return a.text}).style("opacity",1)]},i.showXGridFocus=function(a){var b=this,c=b.config,d=a.filter(function(a){return a&&m(a.value)}),e=b.main.selectAll("line."+l.xgridFocus),f=b.xx.bind(b);c.tooltip_show&&(b.hasType("scatter")||b.hasArcType()||(e.style("visibility","visible").data([d[0]]).attr(c.axis_rotated?"y1":"x1",f).attr(c.axis_rotated?"y2":"x2",f),b.smoothLines(e,"grid")))},i.hideXGridFocus=function(){this.main.select("line."+l.xgridFocus).style("visibility","hidden")},i.updateXgridFocus=function(){var a=this,b=a.config;a.main.select("line."+l.xgridFocus).attr("x1",b.axis_rotated?0:-10).attr("x2",b.axis_rotated?a.width:-10).attr("y1",b.axis_rotated?-10:0).attr("y2",b.axis_rotated?-10:a.height)},i.generateGridData=function(a,b){var c,d,e,f,g=this,h=[],i=g.main.select("."+l.axisX).selectAll(".tick").size();if("year"===a)for(c=g.getXDomain(),d=c[0].getFullYear(),e=c[1].getFullYear(),f=d;e>=f;f++)h.push(new Date(f+"-01-01 00:00:00"));else h=b.ticks(10),h.length>i&&(h=h.filter(function(a){return(""+a).indexOf(".")<0}));return h},i.getGridFilterToRemove=function(a){return a?function(b){var c=!1;return[].concat(a).forEach(function(a){("value"in a&&b.value===a.value||"class"in a&&b["class"]===a["class"])&&(c=!0)}),c}:function(){return!0}},i.removeGridLines=function(a,b){var c=this,d=c.config,e=c.getGridFilterToRemove(a),f=function(a){return!e(a)},g=b?l.xgridLines:l.ygridLines,h=b?l.xgridLine:l.ygridLine;c.main.select("."+g).selectAll("."+h).filter(e).transition().duration(d.transition_duration).style("opacity",0).remove(),b?d.grid_x_lines=d.grid_x_lines.filter(f):d.grid_y_lines=d.grid_y_lines.filter(f)},i.initTooltip=function(){var a,b=this,c=b.config;if(b.tooltip=b.selectChart.style("position","relative").append("div").attr("class",l.tooltipContainer).style("position","absolute").style("pointer-events","none").style("display","none"),c.tooltip_init_show){if(b.isTimeSeries()&&o(c.tooltip_init_x)){for(c.tooltip_init_x=b.parseDate(c.tooltip_init_x),a=0;a<b.data.targets[0].values.length&&b.data.targets[0].values[a].x-c.tooltip_init_x!==0;a++);c.tooltip_init_x=a}b.tooltip.html(c.tooltip_contents.call(b,b.data.targets.map(function(a){return b.addName(a.values[c.tooltip_init_x])}),b.axis.getXAxisTickFormat(),b.getYFormat(b.hasArcType()),b.color)),b.tooltip.style("top",c.tooltip_init_position.top).style("left",c.tooltip_init_position.left).style("display","block")}},i.getTooltipContent=function(a,b,c,d){var e,f,g,h,i,j,k=this,l=k.config,m=l.tooltip_format_title||b,n=l.tooltip_format_name||function(a){return a},o=l.tooltip_format_value||c,p=k.isOrderAsc();if(0===l.data_groups.length)a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return p?c-d:d-c});else{var q=k.orderTargets(k.data.targets).map(function(a){return a.id});a.sort(function(a,b){var c=a?a.value:null,d=b?b.value:null;return c>0&&d>0&&(c=a?q.indexOf(a.id):null,d=b?q.indexOf(b.id):null),p?c-d:d-c})}for(f=0;f<a.length;f++)if(a[f]&&(a[f].value||0===a[f].value)&&(e||(g=y(m?m(a[f].x):a[f].x),e="<table class='"+k.CLASS.tooltip+"'>"+(g||0===g?"<tr><th colspan='2'>"+g+"</th></tr>":"")),h=y(o(a[f].value,a[f].ratio,a[f].id,a[f].index,a)),void 0!==h)){if(null===a[f].name)continue;i=y(n(a[f].name,a[f].ratio,a[f].id,a[f].index)),j=k.levelColor?k.levelColor(a[f].value):d(a[f].id),e+="<tr class='"+k.CLASS.tooltipName+"-"+k.getTargetSelectorSuffix(a[f].id)+"'>",e+="<td class='name'><span style='background-color:"+j+"'></span>"+i+"</td>",e+="<td class='value'>"+h+"</td>",e+="</tr>"}return e+"</table>"},i.tooltipPosition=function(a,b,c,d){var e,f,g,h,i,j=this,k=j.config,l=j.d3,m=j.hasArcType(),n=l.mouse(d);return m?(f=(j.width-(j.isLegendRight?j.getLegendWidth():0))/2+n[0],h=j.height/2+n[1]+20):(e=j.getSvgLeft(!0),k.axis_rotated?(f=e+n[0]+100,g=f+b,i=j.currentWidth-j.getCurrentPaddingRight(),h=j.x(a[0].x)+20):(f=e+j.getCurrentPaddingLeft(!0)+j.x(a[0].x)+20,g=f+b,i=e+j.currentWidth-j.getCurrentPaddingRight(),h=n[1]+15),g>i&&(f-=g-i+20),h+c>j.currentHeight&&(h-=c+30)),0>h&&(h=0),{top:h,left:f}},i.showTooltip=function(a,b){var c,d,e,f=this,g=f.config,h=f.hasArcType(),j=a.filter(function(a){return a&&m(a.value)}),k=g.tooltip_position||i.tooltipPosition;0!==j.length&&g.tooltip_show&&(f.tooltip.html(g.tooltip_contents.call(f,a,f.axis.getXAxisTickFormat(),f.getYFormat(h),f.color)).style("display","block"),c=f.tooltip.property("offsetWidth"),d=f.tooltip.property("offsetHeight"),e=k.call(this,j,c,d,b),f.tooltip.style("top",e.top+"px").style("left",e.left+"px"))},i.hideTooltip=function(){this.tooltip.style("display","none")},i.initLegend=function(){var a=this;return a.legendItemTextBox={},a.legendHasRendered=!1,a.legend=a.svg.append("g").attr("transform",a.getTranslate("legend")),a.config.legend_show?void a.updateLegendWithDefaults():(a.legend.style("visibility","hidden"),void(a.hiddenLegendIds=a.mapToIds(a.data.targets)))},i.updateLegendWithDefaults=function(){var a=this;a.updateLegend(a.mapToIds(a.data.targets),{withTransform:!1,withTransitionForTransform:!1,withTransition:!1})},i.updateSizeForLegend=function(a,b){var c=this,d=c.config,e={top:c.isLegendTop?c.getCurrentPaddingTop()+d.legend_inset_y+5.5:c.currentHeight-a-c.getCurrentPaddingBottom()-d.legend_inset_y,left:c.isLegendLeft?c.getCurrentPaddingLeft()+d.legend_inset_x+.5:c.currentWidth-b-c.getCurrentPaddingRight()-d.legend_inset_x+.5};c.margin3={top:c.isLegendRight?0:c.isLegendInset?e.top:c.currentHeight-a,right:NaN,bottom:0,left:c.isLegendRight?c.currentWidth-b:c.isLegendInset?e.left:0}},i.transformLegend=function(a){var b=this;(a?b.legend.transition():b.legend).attr("transform",b.getTranslate("legend"))},i.updateLegendStep=function(a){this.legendStep=a},i.updateLegendItemWidth=function(a){this.legendItemWidth=a},i.updateLegendItemHeight=function(a){this.legendItemHeight=a},i.getLegendWidth=function(){var a=this;return a.config.legend_show?a.isLegendRight||a.isLegendInset?a.legendItemWidth*(a.legendStep+1):a.currentWidth:0},i.getLegendHeight=function(){var a=this,b=0;return a.config.legend_show&&(b=a.isLegendRight?a.currentHeight:Math.max(20,a.legendItemHeight)*(a.legendStep+1)),b},i.opacityForLegend=function(a){return a.classed(l.legendItemHidden)?null:1},i.opacityForUnfocusedLegend=function(a){return a.classed(l.legendItemHidden)?null:.3},i.toggleFocusLegend=function(a,b){var c=this;a=c.mapToTargetIds(a),c.legend.selectAll("."+l.legendItem).filter(function(b){return a.indexOf(b)>=0}).classed(l.legendItemFocused,b).transition().duration(100).style("opacity",function(){var a=b?c.opacityForLegend:c.opacityForUnfocusedLegend;return a.call(c,c.d3.select(this))})},i.revertLegend=function(){var a=this,b=a.d3;a.legend.selectAll("."+l.legendItem).classed(l.legendItemFocused,!1).transition().duration(100).style("opacity",function(){return a.opacityForLegend(b.select(this))})},i.showLegend=function(a){var b=this,c=b.config;c.legend_show||(c.legend_show=!0,b.legend.style("visibility","visible"),b.legendHasRendered||b.updateLegendWithDefaults()),b.removeHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("visibility","visible").transition().style("opacity",function(){return b.opacityForLegend(b.d3.select(this))})},i.hideLegend=function(a){var b=this,c=b.config;c.legend_show&&u(a)&&(c.legend_show=!1,b.legend.style("visibility","hidden")),b.addHiddenLegendIds(a),b.legend.selectAll(b.selectorLegends(a)).style("opacity",0).style("visibility","hidden")},i.clearLegendItemTextBoxCache=function(){this.legendItemTextBox={}},i.updateLegend=function(a,b,c){function d(a,b){return y.legendItemTextBox[b]||(y.legendItemTextBox[b]=y.getTextRect(a.textContent,l.legendItem,a)),y.legendItemTextBox[b]}function e(b,c,e){function f(a,b){b||(g=(o-G-n)/2,E>g&&(g=(o-n)/2,G=0,M++)),L[a]=M,K[M]=y.isLegendInset?10:g,H[a]=G,G+=n}var g,h,i=0===e,j=e===a.length-1,k=d(b,c),l=k.width+F+(!j||y.isLegendRight||y.isLegendInset?B:0)+z.legend_padding,m=k.height+A,n=y.isLegendRight||y.isLegendInset?m:l,o=y.isLegendRight||y.isLegendInset?y.getLegendHeight():y.getLegendWidth();return i&&(G=0,M=0,C=0,D=0),z.legend_show&&!y.isLegendToShow(c)?void(I[c]=J[c]=L[c]=H[c]=0):(I[c]=l,J[c]=m,(!C||l>=C)&&(C=l),(!D||m>=D)&&(D=m),h=y.isLegendRight||y.isLegendInset?D:C,void(z.legend_equally?(Object.keys(I).forEach(function(a){I[a]=C}),Object.keys(J).forEach(function(a){J[a]=D}),g=(o-h*a.length)/2,E>g?(G=0,M=0,a.forEach(function(a){f(a)})):f(c,!0)):f(c)))}var f,g,h,i,j,k,m,n,o,p,r,s,t,u,v,x,y=this,z=y.config,A=4,B=10,C=0,D=0,E=10,F=z.legend_item_tile_width+5,G=0,H={},I={},J={},K=[0],L={},M=0;a=a.filter(function(a){return!q(z.data_names[a])||null!==z.data_names[a]}),b=b||{},r=w(b,"withTransition",!0),s=w(b,"withTransitionForTransform",!0),y.isLegendInset&&(M=z.legend_inset_step?z.legend_inset_step:a.length,y.updateLegendStep(M)),y.isLegendRight?(f=function(a){return C*L[a]},i=function(a){return K[L[a]]+H[a]}):y.isLegendInset?(f=function(a){return C*L[a]+10},i=function(a){return K[L[a]]+H[a]}):(f=function(a){return K[L[a]]+H[a]},i=function(a){return D*L[a]}),g=function(a,b){return f(a,b)+4+z.legend_item_tile_width},j=function(a,b){return i(a,b)+9},h=function(a,b){return f(a,b)},k=function(a,b){return i(a,b)-5},m=function(a,b){return f(a,b)-2},n=function(a,b){return f(a,b)-2+z.legend_item_tile_width},o=function(a,b){return i(a,b)+4},p=y.legend.selectAll("."+l.legendItem).data(a).enter().append("g").attr("class",function(a){return y.generateClass(l.legendItem,a)}).style("visibility",function(a){return y.isLegendToShow(a)?"visible":"hidden"}).style("cursor","pointer").on("click",function(a){z.legend_item_onclick?z.legend_item_onclick.call(y,a):y.d3.event.altKey?(y.api.hide(),y.api.show(a)):(y.api.toggle(a),y.isTargetToShow(a)?y.api.focus(a):y.api.revert())}).on("mouseover",function(a){z.legend_item_onmouseover?z.legend_item_onmouseover.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!0),!y.transiting&&y.isTargetToShow(a)&&y.api.focus(a))}).on("mouseout",function(a){z.legend_item_onmouseout?z.legend_item_onmouseout.call(y,a):(y.d3.select(this).classed(l.legendItemFocused,!1),y.api.revert())}),p.append("text").text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}).style("pointer-events","none").attr("x",y.isLegendRight||y.isLegendInset?g:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:j),p.append("rect").attr("class",l.legendItemEvent).style("fill-opacity",0).attr("x",y.isLegendRight||y.isLegendInset?h:-200).attr("y",y.isLegendRight||y.isLegendInset?-200:k),p.append("line").attr("class",l.legendItemTile).style("stroke",y.color).style("pointer-events","none").attr("x1",y.isLegendRight||y.isLegendInset?m:-200).attr("y1",y.isLegendRight||y.isLegendInset?-200:o).attr("x2",y.isLegendRight||y.isLegendInset?n:-200).attr("y2",y.isLegendRight||y.isLegendInset?-200:o).attr("stroke-width",z.legend_item_tile_height),x=y.legend.select("."+l.legendBackground+" rect"),y.isLegendInset&&C>0&&0===x.size()&&(x=y.legend.insert("g","."+l.legendItem).attr("class",l.legendBackground).append("rect")),t=y.legend.selectAll("text").data(a).text(function(a){return q(z.data_names[a])?z.data_names[a]:a}).each(function(a,b){e(this,a,b)}),(r?t.transition():t).attr("x",g).attr("y",j),u=y.legend.selectAll("rect."+l.legendItemEvent).data(a),(r?u.transition():u).attr("width",function(a){return I[a]}).attr("height",function(a){return J[a]}).attr("x",h).attr("y",k),v=y.legend.selectAll("line."+l.legendItemTile).data(a),(r?v.transition():v).style("stroke",y.color).attr("x1",m).attr("y1",o).attr("x2",n).attr("y2",o),x&&(r?x.transition():x).attr("height",y.getLegendHeight()-12).attr("width",C*(M+1)+10),y.legend.selectAll("."+l.legendItem).classed(l.legendItemHidden,function(a){return!y.isTargetToShow(a)}),y.updateLegendItemWidth(C),y.updateLegendItemHeight(D),y.updateLegendStep(M),y.updateSizes(),y.updateScales(),y.updateSvgSize(),y.transformAll(s,c),y.legendHasRendered=!0},i.initTitle=function(){var a=this;a.title=a.svg.append("text").text(a.config.title_text).attr("class",a.CLASS.title)},i.redrawTitle=function(){var a=this;a.title.attr("x",a.xForTitle.bind(a)).attr("y",a.yForTitle.bind(a))},i.xForTitle=function(){var a,b=this,c=b.config,d=c.title_position||"left";return a=d.indexOf("right")>=0?b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width-c.title_padding.right:d.indexOf("center")>=0?(b.currentWidth-b.getTextRect(b.title.node().textContent,b.CLASS.title,b.title.node()).width)/2:c.title_padding.left},i.yForTitle=function(){var a=this;return a.config.title_padding.top+a.getTextRect(a.title.node().textContent,a.CLASS.title,a.title.node()).height},i.getTitlePadding=function(){var a=this;return a.yForTitle()+a.config.title_padding.bottom},c(b,f),f.prototype.init=function(){var a=this.owner,b=a.config,c=a.main;a.axes.x=c.append("g").attr("class",l.axis+" "+l.axisX).attr("clip-path",a.clipPathForXAxis).attr("transform",a.getTranslate("x")).style("visibility",b.axis_x_show?"visible":"hidden"),a.axes.x.append("text").attr("class",l.axisXLabel).attr("transform",b.axis_rotated?"rotate(-90)":"").style("text-anchor",this.textAnchorForXAxisLabel.bind(this)),a.axes.y=c.append("g").attr("class",l.axis+" "+l.axisY).attr("clip-path",b.axis_y_inner?"":a.clipPathForYAxis).attr("transform",a.getTranslate("y")).style("visibility",b.axis_y_show?"visible":"hidden"),a.axes.y.append("text").attr("class",l.axisYLabel).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForYAxisLabel.bind(this)),a.axes.y2=c.append("g").attr("class",l.axis+" "+l.axisY2).attr("transform",a.getTranslate("y2")).style("visibility",b.axis_y2_show?"visible":"hidden"),a.axes.y2.append("text").attr("class",l.axisY2Label).attr("transform",b.axis_rotated?"":"rotate(-90)").style("text-anchor",this.textAnchorForY2AxisLabel.bind(this))},f.prototype.getXAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={isCategory:i.isCategorized(),withOuterTick:e,tickMultiline:j.axis_x_tick_multiline,tickWidth:j.axis_x_tick_width,tickTextRotate:h?0:j.axis_x_tick_rotate,withoutTransition:f},l=g(i.d3,k).scale(a).orient(b);return i.isTimeSeries()&&d&&"function"!=typeof d&&(d=d.map(function(a){return i.parseDate(a)})),l.tickFormat(c).tickValues(d),i.isCategorized()&&(l.tickCentered(j.axis_x_tick_centered),u(j.axis_x_tick_culling)&&(j.axis_x_tick_culling=!1)),l},f.prototype.updateXAxisTickValues=function(a,b){var c,d=this.owner,e=d.config;return(e.axis_x_tick_fit||e.axis_x_tick_count)&&(c=this.generateTickValues(d.mapTargetsToUniqueXs(a),e.axis_x_tick_count,d.isTimeSeries())),b?b.tickValues(c):(d.xAxis.tickValues(c),d.subXAxis.tickValues(c)),c},f.prototype.getYAxis=function(a,b,c,d,e,f,h){var i=this.owner,j=i.config,k={withOuterTick:e,withoutTransition:f,tickTextRotate:h?0:j.axis_y_tick_rotate},l=g(i.d3,k).scale(a).orient(b).tickFormat(c);return i.isTimeSeriesY()?l.ticks(i.d3.time[j.axis_y_tick_time_value],j.axis_y_tick_time_interval):l.tickValues(d),l},f.prototype.getId=function(a){var b=this.owner.config;return a in b.data_axes?b.data_axes[a]:"y"},f.prototype.getXAxisTickFormat=function(){var a=this.owner,b=a.config,c=a.isTimeSeries()?a.defaultAxisTimeFormat:a.isCategorized()?a.categoryName:function(a){return 0>a?a.toFixed(0):a};return b.axis_x_tick_format&&(n(b.axis_x_tick_format)?c=b.axis_x_tick_format:a.isTimeSeries()&&(c=function(c){return c?a.axisTimeFormat(b.axis_x_tick_format)(c):""})),n(c)?function(b){return c.call(a,b)}:c},f.prototype.getTickValues=function(a,b){return a?a:b?b.tickValues():void 0},f.prototype.getXAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_x_tick_values,this.owner.xAxis)},f.prototype.getYAxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y_tick_values,this.owner.yAxis)},f.prototype.getY2AxisTickValues=function(){return this.getTickValues(this.owner.config.axis_y2_tick_values,this.owner.y2Axis)},f.prototype.getLabelOptionByAxisId=function(a){var b,c=this.owner,d=c.config;return"y"===a?b=d.axis_y_label:"y2"===a?b=d.axis_y2_label:"x"===a&&(b=d.axis_x_label),b},f.prototype.getLabelText=function(a){var b=this.getLabelOptionByAxisId(a);return o(b)?b:b?b.text:null},f.prototype.setLabelText=function(a,b){var c=this.owner,d=c.config,e=this.getLabelOptionByAxisId(a);o(e)?"y"===a?d.axis_y_label=b:"y2"===a?d.axis_y2_label=b:"x"===a&&(d.axis_x_label=b):e&&(e.text=b)},f.prototype.getLabelPosition=function(a,b){var c=this.getLabelOptionByAxisId(a),d=c&&"object"==typeof c&&c.position?c.position:b;return{isInner:d.indexOf("inner")>=0,isOuter:d.indexOf("outer")>=0,isLeft:d.indexOf("left")>=0,isCenter:d.indexOf("center")>=0,isRight:d.indexOf("right")>=0,isTop:d.indexOf("top")>=0,isMiddle:d.indexOf("middle")>=0,isBottom:d.indexOf("bottom")>=0}},f.prototype.getXAxisLabelPosition=function(){return this.getLabelPosition("x",this.owner.config.axis_rotated?"inner-top":"inner-right")},f.prototype.getYAxisLabelPosition=function(){return this.getLabelPosition("y",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getY2AxisLabelPosition=function(){return this.getLabelPosition("y2",this.owner.config.axis_rotated?"inner-right":"inner-top")},f.prototype.getLabelPositionById=function(a){return"y2"===a?this.getY2AxisLabelPosition():"y"===a?this.getYAxisLabelPosition():this.getXAxisLabelPosition()},f.prototype.textForXAxisLabel=function(){return this.getLabelText("x")},f.prototype.textForYAxisLabel=function(){return this.getLabelText("y")},f.prototype.textForY2AxisLabel=function(){return this.getLabelText("y2")},f.prototype.xForAxisLabel=function(a,b){var c=this.owner;return a?b.isLeft?0:b.isCenter?c.width/2:c.width:b.isBottom?-c.height:b.isMiddle?-c.height/2:0},f.prototype.dxForAxisLabel=function(a,b){return a?b.isLeft?"0.5em":b.isRight?"-0.5em":"0":b.isTop?"-0.5em":b.isBottom?"0.5em":"0"},f.prototype.textAnchorForAxisLabel=function(a,b){return a?b.isLeft?"start":b.isCenter?"middle":"end":b.isBottom?"start":b.isMiddle?"middle":"end"},f.prototype.xForXAxisLabel=function(){return this.xForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.xForYAxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.xForY2AxisLabel=function(){return this.xForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dxForXAxisLabel=function(){return this.dxForAxisLabel(!this.owner.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.dxForYAxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.dxForY2AxisLabel=function(){return this.dxForAxisLabel(this.owner.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.dyForXAxisLabel=function(){var a=this.owner,b=a.config,c=this.getXAxisLabelPosition();return b.axis_rotated?c.isInner?"1.2em":-25-this.getMaxTickWidth("x"):c.isInner?"-0.5em":b.axis_x_height?b.axis_x_height-10:"3em"},f.prototype.dyForYAxisLabel=function(){var a=this.owner,b=this.getYAxisLabelPosition();return a.config.axis_rotated?b.isInner?"-0.5em":"3em":b.isInner?"1.2em":-10-(a.config.axis_y_inner?0:this.getMaxTickWidth("y")+10)},f.prototype.dyForY2AxisLabel=function(){var a=this.owner,b=this.getY2AxisLabelPosition();return a.config.axis_rotated?b.isInner?"1.2em":"-2.2em":b.isInner?"-0.5em":15+(a.config.axis_y2_inner?0:this.getMaxTickWidth("y2")+15)},f.prototype.textAnchorForXAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(!a.config.axis_rotated,this.getXAxisLabelPosition())},f.prototype.textAnchorForYAxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getYAxisLabelPosition())},f.prototype.textAnchorForY2AxisLabel=function(){var a=this.owner;return this.textAnchorForAxisLabel(a.config.axis_rotated,this.getY2AxisLabelPosition())},f.prototype.getMaxTickWidth=function(a,b){var c,d,e,f,g,h=this.owner,i=h.config,j=0;return b&&h.currentMaxTickWidths[a]?h.currentMaxTickWidths[a]:(h.svg&&(c=h.filterTargetsToShow(h.data.targets),"y"===a?(d=h.y.copy().domain(h.getYDomain(c,"y")),e=this.getYAxis(d,h.yOrient,i.axis_y_tick_format,h.yAxisTickValues,!1,!0,!0)):"y2"===a?(d=h.y2.copy().domain(h.getYDomain(c,"y2")),
2313 e=this.getYAxis(d,h.y2Orient,i.axis_y2_tick_format,h.y2AxisTickValues,!1,!0,!0)):(d=h.x.copy().domain(h.getXDomain(c)),e=this.getXAxis(d,h.xOrient,h.xAxisTickFormat,h.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(c,e)),f=h.d3.select("body").append("div").classed("c3",!0),g=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g.append("g").call(e).each(function(){h.d3.select(this).selectAll("text").each(function(){var a=this.getBoundingClientRect();j<a.width&&(j=a.width)}),f.remove()})),h.currentMaxTickWidths[a]=0>=j?h.currentMaxTickWidths[a]:j,h.currentMaxTickWidths[a])},f.prototype.updateLabels=function(a){var b=this.owner,c=b.main.select("."+l.axisX+" ."+l.axisXLabel),d=b.main.select("."+l.axisY+" ."+l.axisYLabel),e=b.main.select("."+l.axisY2+" ."+l.axisY2Label);(a?c.transition():c).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(a?d.transition():d).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(a?e.transition():e).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(a,b,c,d){var e="number"==typeof a?a:a[b];return m(e)?"ratio"===a.unit?a[b]*d:this.convertPixelsToAxisPadding(e,d):c},f.prototype.convertPixelsToAxisPadding=function(a,b){var c=this.owner,d=c.config.axis_rotated?c.width:c.height;return b*(a/d)},f.prototype.generateTickValues=function(a,b,c){var d,e,f,g,h,i,j,k=a;if(b)if(d=n(b)?b():b,1===d)k=[a[0]];else if(2===d)k=[a[0],a[a.length-1]];else if(d>2){for(g=d-2,e=a[0],f=a[a.length-1],h=(f-e)/(g+1),k=[e],i=0;g>i;i++)j=+e+h*(i+1),k.push(c?new Date(j):j);k.push(f)}return c||(k=k.sort(function(a,b){return a-b})),k},f.prototype.generateTransitions=function(a){var b=this.owner,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.prototype.redraw=function(a,b){var c=this.owner;c.axes.x.style("opacity",b?0:1),c.axes.y.style("opacity",b?0:1),c.axes.y2.style("opacity",b?0:1),c.axes.subx.style("opacity",b?0:1),a.axisX.call(c.xAxis),a.axisY.call(c.yAxis),a.axisY2.call(c.y2Axis),a.axisSubX.call(c.subXAxis)},i.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},i.appendClip=function(a,b){return a.append("clipPath").attr("id",b).append("rect")},i.getAxisClipX=function(a){var b=Math.max(30,this.margin.left);return a?-(1+b):-(b-1)},i.getAxisClipY=function(a){return a?-20:-this.margin.top},i.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config.axis_rotated)},i.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config.axis_rotated)},i.getYAxisClipX=function(){var a=this;return a.config.axis_y_inner?-1:a.getAxisClipX(a.config.axis_rotated)},i.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config.axis_rotated)},i.getAxisClipWidth=function(a){var b=this,c=Math.max(30,b.margin.left),d=Math.max(30,b.margin.right);return a?b.width+2+c+d:b.margin.left+20},i.getAxisClipHeight=function(a){return(a?this.margin.bottom:this.margin.top+this.height)+20},i.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config.axis_rotated)},i.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config.axis_rotated)},i.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config.axis_rotated)+(a.config.axis_y_inner?20:0)},i.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config.axis_rotated)},i.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c.data_order||a.pie.sort(null)},i.updateRadius=function(){var a=this,b=a.config,c=b.gauge_width||b.donut_width;a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},i.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},i.updateAngle=function(a){var b,c,d,e,f=this,g=f.config,h=!1,i=0;return g?(f.pie(f.filterTargetsToShow(f.data.targets)).forEach(function(b){h||b.data.id!==a.data.id||(h=!0,a=b,a.index=i),i++}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),f.isGaugeType(a.data)&&(b=g.gauge_min,c=g.gauge_max,d=Math.PI*(g.gauge_fullCircle?2:1)/(c-b),e=a.value<b?0:a.value<c?a.value-b:c-b,a.startAngle=g.gauge_startingAngle,a.endAngle=a.startAngle+d*e),h?a:null):null},i.getSvgArc=function(){var a=this,b=a.d3.svg.arc().outerRadius(a.radius).innerRadius(a.innerRadius),c=function(c,d){var e;return d?b(c):(e=a.updateAngle(c),e?b(e):"M 0 0")};return c.centroid=b.centroid,c},i.getSvgArcExpanded=function(a){var b=this,c=b.d3.svg.arc().outerRadius(b.radiusExpanded*(a?a:1)).innerRadius(b.innerRadius);return function(a){var d=b.updateAngle(a);return d?c(d):"M 0 0"}},i.getArc=function(a,b,c){return c||this.isArcType(a.data)?this.svgArc(a,b):"M 0 0"},i.transformForArcLabel=function(a){var b,c,d,e,f,g=this,h=g.config,i=g.updateAngle(a),j="";return i&&!g.hasType("gauge")&&(b=this.svgArc.centroid(i),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=g.hasType("donut")&&h.donut_label_ratio?n(h.donut_label_ratio)?h.donut_label_ratio(a,g.radius,e):h.donut_label_ratio:g.hasType("pie")&&h.pie_label_ratio?n(h.pie_label_ratio)?h.pie_label_ratio(a,g.radius,e):h.pie_label_ratio:g.radius&&e?(36/g.radius>.375?1.175-36/g.radius:.8)*g.radius/e:0,j="translate("+c*f+","+d*f+")"),j},i.getArcRatio=function(a){var b=this,c=b.config,d=Math.PI*(b.hasType("gauge")&&!c.gauge_fullCircle?1:2);return a?(a.endAngle-a.startAngle)/d:null},i.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},i.textForArcLabel=function(a){var b,c,d,e,f,g=this;return g.shouldShowArcLabel()?(b=g.updateAngle(a),c=b?b.value:null,d=g.getArcRatio(b),e=a.data.id,g.hasType("gauge")||g.meetsArcLabelThreshold(d)?(f=g.getArcLabelFormat(),f?f(c,d,e):g.defaultArcValueFormat(c,d)):""):""},i.expandArc=function(b){var c,d=this;return d.transiting?void(c=a.setInterval(function(){d.transiting||(a.clearInterval(c),d.legend.selectAll(".c3-legend-item-focused").size()>0&&d.expandArc(b))},10)):(b=d.mapToTargetIds(b),void d.svg.selectAll(d.selectorTargets(b,"."+l.chartArc)).each(function(a){d.shouldExpand(a.data.id)&&d.d3.select(this).selectAll("path").transition().duration(d.expandDuration(a.data.id)).attr("d",d.svgArcExpanded).transition().duration(2*d.expandDuration(a.data.id)).attr("d",d.svgArcExpandedSub).each(function(a){d.isDonutType(a.data)})}))},i.unexpandArc=function(a){var b=this;b.transiting||(a=b.mapToTargetIds(a),b.svg.selectAll(b.selectorTargets(a,"."+l.chartArc)).selectAll("path").transition().duration(function(a){return b.expandDuration(a.data.id)}).attr("d",b.svgArc),b.svg.selectAll("."+l.arc).style("opacity",1))},i.expandDuration=function(a){var b=this,c=b.config;return b.isDonutType(a)?c.donut_expand_duration:b.isGaugeType(a)?c.gauge_expand_duration:b.isPieType(a)?c.pie_expand_duration:50},i.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c.donut_expand||b.isGaugeType(a)&&c.gauge_expand||b.isPieType(a)&&c.pie_expand},i.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b.donut_label_show:a.hasType("pie")&&(c=b.pie_label_show),c},i.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c.donut_label_threshold:c.pie_label_threshold;return a>=d},i.getArcLabelFormat=function(){var a=this,b=a.config,c=b.pie_label_format;return a.hasType("gauge")?c=b.gauge_label_format:a.hasType("donut")&&(c=b.donut_label_format),c},i.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config.donut_title:""},i.updateTargetsForArc=function(a){var b,c,d=this,e=d.main,f=d.classChartArc.bind(d),g=d.classArcs.bind(d),h=d.classFocus.bind(d);b=e.select("."+l.chartArcs).selectAll("."+l.chartArc).data(d.pie(a)).attr("class",function(a){return f(a)+h(a.data)}),c=b.enter().append("g").attr("class",f),c.append("g").attr("class",g),c.append("text").attr("dy",d.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},i.initArc=function(){var a=this;a.arcs=a.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",a.getTranslate("arc")),a.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(a.getArcTitle())},i.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+l.arcs).selectAll("."+l.arc).data(e.arcData.bind(e)),d.enter().append("path").attr("class",e.classArc.bind(e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g.interaction_enabled&&g.data_selection_isselectable(a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=g.gauge_startingAngle),this._current=a}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).on("mouseover",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.expandArc(b.data.id),e.api.focus(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config.data_onmouseover(c,this)))}:null).on("mousemove",g.interaction_enabled?function(a){var b,c,d=e.updateAngle(a);d&&(b=e.convertToArcData(d),c=[b],e.showTooltip(c,this))}:null).on("mouseout",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.api.revert(),e.revertLegend(),e.hideTooltip(),e.config.data_onmouseout(c,this)))}:null).on("click",g.interaction_enabled?function(a,b){var c,d=e.updateAngle(a);d&&(c=e.convertToArcData(d),e.toggleShape&&e.toggleShape(this,c,b),e.config.data_onclick.call(e.api,c,this))}:null).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(c){var d=b(c);return d.data=a.data,e.getArc(d,!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?l.gaugeValue:""}).text(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(a){return e.isGaugeType(a.data)?Math.round(e.radius/5)+"px":""}).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+l.chartArcsTitle).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0),e.hasType("gauge")&&(e.arcs.select("."+l.chartArcsBackground).attr("d",function(){var a={data:[{value:g.gauge_max}],startAngle:g.gauge_startingAngle,endAngle:-1*g.gauge_startingAngle};return e.getArc(a,!0,!0)}),e.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(g.gauge_label_show?g.gauge_units:""),e.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_min:""),e.arcs.select("."+l.chartArcsGaugeMax).attr("dx",e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_max:""))},i.initGauge=function(){var a=this.arcs;this.hasType("gauge")&&(a.append("path").attr("class",l.chartArcsBackground),a.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},i.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},i.initRegion=function(){var a=this;a.region=a.main.append("g").attr("clip-path",a.clipPath).attr("class",l.regions)},i.updateRegion=function(a){var b=this,c=b.config;b.region.style("visibility",b.hasArcType()?"hidden":"visible"),b.mainRegion=b.main.select("."+l.regions).selectAll("."+l.region).data(c.regions),b.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),b.mainRegion.attr("class",b.classRegion.bind(b)),b.mainRegion.exit().transition().duration(a).style("opacity",0).remove()},i.redrawRegion=function(a){var b=this,c=b.mainRegion.selectAll("rect").each(function(){var a=b.d3.select(this.parentNode).datum();b.d3.select(this).datum(a)}),d=b.regionX.bind(b),e=b.regionY.bind(b),f=b.regionWidth.bind(b),g=b.regionHeight.bind(b);return[(a?c.transition():c).attr("x",d).attr("y",e).attr("width",f).attr("height",g).style("fill-opacity",function(a){return m(a.opacity)?a.opacity:.1})]},i.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"start"in a?e(a.start):0:d.axis_rotated?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?0:"end"in a?e(a.end):0:d.axis_rotated&&"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"end"in a?f(a.end):c.width:d.axis_rotated?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},i.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?c.height:"start"in a?f(a.start):c.height:d.axis_rotated&&"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height,e>b?0:b-e},i.isRegionOnX=function(a){return!a.axis||"x"===a.axis},i.drag=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.config,m=j.main,n=j.d3;j.hasArcType()||k.data_selection_enabled&&(k.zoom_enabled&&!j.zoom.altDomain||k.data_selection_multiple&&(b=j.dragStart[0],c=j.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=k.data_selection_grouped?j.margin.top:Math.min(c,e),i=k.data_selection_grouped?j.height:Math.max(c,e),m.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",g-f).attr("height",i-h),m.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(a){return k.data_selection_isselectable(a)}).each(function(a,b){var c,d,e,k,m,o,p=n.select(this),q=p.classed(l.SELECTED),r=p.classed(l.INCLUDED),s=!1;if(p.classed(l.circle))c=1*p.attr("cx"),d=1*p.attr("cy"),m=j.togglePoint,s=c>f&&g>c&&d>h&&i>d;else{if(!p.classed(l.bar))return;o=z(this),c=o.x,d=o.y,e=o.width,k=o.height,m=j.togglePath,s=!(c>g||f>c+e||d>i||h>d+k)}s^r&&(p.classed(l.INCLUDED,!r),p.classed(l.SELECTED,!q),m.call(j,!q,p,a,b))})))},i.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c.data_selection_enabled&&(b.dragStart=a,b.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),b.dragging=!0)},i.dragend=function(){var a=this,b=a.config;a.hasArcType()||b.data_selection_enabled&&(a.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),a.dragging=!1)},i.selectPoint=function(a,b,c){var d=this,e=d.config,f=(e.axis_rotated?d.circleY:d.circleX).bind(d),g=(e.axis_rotated?d.circleX:d.circleY).bind(d),h=d.pointSelectR.bind(d);e.data_onselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return d.generateClass(l.selectedCircle,c)}).attr("cx",f).attr("cy",g).attr("stroke",function(){return d.color(b)}).attr("r",function(a){return 1.4*d.pointSelectR(a)}).transition().duration(100).attr("r",h)},i.unselectPoint=function(a,b,c){var d=this;d.config.data_onunselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()},i.togglePoint=function(a,b,c,d){a?this.selectPoint(b,c,d):this.unselectPoint(b,c,d)},i.selectPath=function(a,b){var c=this;c.config.data_onselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.d3.rgb(c.color(b)).brighter(.75)})},i.unselectPath=function(a,b){var c=this;c.config.data_onunselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.color(b)})},i.togglePath=function(a,b,c,d){a?this.selectPath(b,c,d):this.unselectPath(b,c,d)},i.getToggle=function(a,b){var c,d=this;return"circle"===a.nodeName?c=d.isStepType(b)?function(){}:d.togglePoint:"path"===a.nodeName&&(c=d.togglePath),c},i.toggleShape=function(a,b,c){var d=this,e=d.d3,f=d.config,g=e.select(a),h=g.classed(l.SELECTED),i=d.getToggle(a,b).bind(d);f.data_selection_enabled&&f.data_selection_isselectable(b)&&(f.data_selection_multiple||d.main.selectAll("."+l.shapes+(f.data_selection_grouped?d.getTargetSelectorSuffix(b.id):"")).selectAll("."+l.shape).each(function(a,b){var c=e.select(this);c.classed(l.SELECTED)&&i(!1,c.classed(l.SELECTED,!1),a,b)}),g.classed(l.SELECTED,!h),i(!h,g,b,c))},i.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+l.brush).call(this),this},a.brush.scale=function(b){return a.config.axis_rotated?this.y(b):this.x(b)}},i.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context")),d=b.subchart_show?"visible":"hidden";c.style("visibility",d),c.append("g").attr("clip-path",a.clipPathForSubchart).attr("class",l.chart),c.select("."+l.chart).append("g").attr("class",l.chartBars),c.select("."+l.chart).append("g").attr("class",l.chartLines),c.append("g").attr("clip-path",a.clipPath).attr("class",l.brush).call(a.brush),a.axes.subx=c.append("g").attr("class",l.axisX).attr("transform",a.getTranslate("subx")).attr("clip-path",b.axis_rotated?"":a.clipPathForXAxis).style("visibility",b.subchart_axis_x_show?d:"hidden")},i.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config,i=f.classChartBar.bind(f),j=f.classBars.bind(f),k=f.classChartLine.bind(f),m=f.classLines.bind(f),n=f.classAreas.bind(f);h.subchart_show&&(e=g.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",i),d=e.enter().append("g").style("opacity",0).attr("class",i),d.append("g").attr("class",j),c=g.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",k),b=c.enter().append("g").style("opacity",0).attr("class",k),b.append("g").attr("class",m),b.append("g").attr("class",n),g.selectAll("."+l.brush+" rect").attr(h.axis_rotated?"width":"height",h.axis_rotated?f.width2:f.height2))},i.updateBarForSubchart=function(a){var b=this;b.contextBar=b.context.selectAll("."+l.bars).selectAll("."+l.bar).data(b.barData.bind(b)),b.contextBar.enter().append("path").attr("class",b.classBar.bind(b)).style("stroke","none").style("fill",b.color),b.contextBar.style("opacity",b.initialOpacity.bind(b)),b.contextBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBarForSubchart=function(a,b,c){(b?this.contextBar.transition(Math.random().toString()).duration(c):this.contextBar).attr("d",a).style("opacity",1)},i.updateLineForSubchart=function(a){var b=this;b.contextLine=b.context.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.contextLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.contextLine.style("opacity",b.initialOpacity.bind(b)),b.contextLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLineForSubchart=function(a,b,c){(b?this.contextLine.transition(Math.random().toString()).duration(c):this.contextLine).attr("d",a).style("opacity",1)},i.updateAreaForSubchart=function(a){var b=this,c=b.d3;b.contextArea=b.context.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.contextArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.contextArea.style("opacity",0),b.contextArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawAreaForSubchart=function(a,b,c){(b?this.contextArea.transition(Math.random().toString()).duration(c):this.contextArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)},i.redrawSubchart=function(a,b,c,d,e,f,g){var h,i,j,k=this,l=k.d3,m=k.config;k.context.style("visibility",m.subchart_show?"visible":"hidden"),m.subchart_show&&(l.event&&"zoom"===l.event.type&&k.brush.extent(k.x.orgDomain()).update(),a&&(k.brush.empty()||k.brush.extent(k.x.orgDomain()).update(),h=k.generateDrawArea(e,!0),i=k.generateDrawBar(f,!0),j=k.generateDrawLine(g,!0),k.updateBarForSubchart(c),k.updateLineForSubchart(c),k.updateAreaForSubchart(c),k.redrawBarForSubchart(i,c,c),k.redrawLineForSubchart(j,c,c),k.redrawAreaForSubchart(h,c,c)))},i.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:a.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),a.config.subchart_onbrush.call(a.api,b.orgDomain())},i.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+l.axisX),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},i.getDefaultExtent=function(){var a=this,b=a.config,c=n(b.axis_x_extent)?b.axis_x_extent(a.getXDomain(a.data.targets)):b.axis_x_extent;return a.isTimeSeries()&&(c=[a.parseDate(c[0]),a.parseDate(c[1])]),c},i.initZoom=function(){var a,b=this,c=b.d3,d=b.config;b.zoom=c.behavior.zoom().on("zoomstart",function(){a=c.event.sourceEvent,b.zoom.altDomain=c.event.sourceEvent.altKey?b.x.orgDomain():null,d.zoom_onzoomstart.call(b.api,c.event.sourceEvent)}).on("zoom",function(){b.redrawForZoom.call(b)}).on("zoomend",function(){var e=c.event.sourceEvent;e&&a.clientX===e.clientX&&a.clientY===e.clientY||(b.redrawEventRect(),b.updateZoom(),d.zoom_onzoomend.call(b.api,b.x.orgDomain()))}),b.zoom.scale=function(a){return d.axis_rotated?this.y(a):this.x(a)},b.zoom.orgScaleExtent=function(){var a=d.zoom_extent?d.zoom_extent:[1,10];return[a[0],Math.max(b.getMaxDataCount()/a[1],a[1])]},b.zoom.updateScaleExtent=function(){var a=t(b.x.orgDomain())/t(b.getZoomDomain()),c=this.orgScaleExtent();return this.scaleExtent([c[0]*a,c[1]*a]),this}},i.getZoomDomain=function(){var a=this,b=a.config,c=a.d3,d=c.min([a.orgXDomain[0],b.zoom_x_min]),e=c.max([a.orgXDomain[1],b.zoom_x_max]);return[d,e]},i.updateZoom=function(){var a=this,b=a.config.zoom_enabled?a.zoom:function(){};a.main.select("."+l.zoomRect).call(b).on("dblclick.zoom",null),a.main.selectAll("."+l.eventRect).call(b).on("dblclick.zoom",null)},i.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x;if(c.zoom_enabled&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===a.orgXDomain[0]&&e.domain([a.orgXDomain[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:c.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c.zoom_onzoom.call(a.api,e.orgDomain())}},i.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b.data_colors,e=v(b.color_pattern)?b.color_pattern:c.scale.category10().range(),f=b.data_color,g=[];return function(a){var b,c=a.id||a.data&&a.data.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},i.generateLevelColor=function(){var a=this,b=a.config,c=b.color_pattern,d=b.color_threshold,e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return v(b.color_threshold)?function(a){var b,d,h=c[c.length-1];for(b=0;b<f.length;b++)if(d=e?a:100*a/g,d<f[b]){h=c[b];break}return h}:null},i.getYFormat=function(a){var b=this,c=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.yFormat,d=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.y2Format;return function(a,e,f){var g="y2"===b.axis.getId(f)?d:c;return g.call(b,a,e)}},i.yFormat=function(a){var b=this,c=b.config,d=c.axis_y_tick_format?c.axis_y_tick_format:b.defaultValueFormat;return d(a)},i.y2Format=function(a){var b=this,c=b.config,d=c.axis_y2_tick_format?c.axis_y2_tick_format:b.defaultValueFormat;return d(a)},i.defaultValueFormat=function(a){return m(a)?+a:""},i.defaultArcValueFormat=function(a,b){return(100*b).toFixed(1)+"%"},i.dataLabelFormat=function(a){var b,c=this,d=c.config.data_labels,e=function(a){return m(a)?+a:""};return b="function"==typeof d.format?d.format:"object"==typeof d.format?d.format[a]?d.format[a]===!0?e:d.format[a]:function(){return""}:e},i.hasCaches=function(a){for(var b=0;b<a.length;b++)if(!(a[b]in this.cache))return!1;return!0},i.addCache=function(a,b){this.cache[a]=this.cloneTarget(b)},i.getCaches=function(a){var b,c=[];for(b=0;b<a.length;b++)a[b]in this.cache&&c.push(this.cloneTarget(this.cache[a[b]]));return c};var l=i.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};i.generateClass=function(a,b){return" "+a+" "+a+this.getTargetSelectorSuffix(b)},i.classText=function(a){return this.generateClass(l.text,a.index)},i.classTexts=function(a){return this.generateClass(l.texts,a.id)},i.classShape=function(a){return this.generateClass(l.shape,a.index)},i.classShapes=function(a){return this.generateClass(l.shapes,a.id)},i.classLine=function(a){return this.classShape(a)+this.generateClass(l.line,a.id)},i.classLines=function(a){return this.classShapes(a)+this.generateClass(l.lines,a.id)},i.classCircle=function(a){return this.classShape(a)+this.generateClass(l.circle,a.index)},i.classCircles=function(a){return this.classShapes(a)+this.generateClass(l.circles,a.id)},i.classBar=function(a){return this.classShape(a)+this.generateClass(l.bar,a.index)},i.classBars=function(a){return this.classShapes(a)+this.generateClass(l.bars,a.id)},i.classArc=function(a){return this.classShape(a.data)+this.generateClass(l.arc,a.data.id)},i.classArcs=function(a){return this.classShapes(a.data)+this.generateClass(l.arcs,a.data.id)},i.classArea=function(a){return this.classShape(a)+this.generateClass(l.area,a.id)},i.classAreas=function(a){return this.classShapes(a)+this.generateClass(l.areas,a.id)},i.classRegion=function(a,b){return this.generateClass(l.region,b)+" "+("class"in a?a["class"]:"")},i.classEvent=function(a){return this.generateClass(l.eventRect,a.index)},i.classTarget=function(a){var b=this,c=b.config.data_classes[a],d="";return c&&(d=" "+l.target+"-"+c),b.generateClass(l.target,a)+d},i.classFocus=function(a){return this.classFocused(a)+this.classDefocused(a)},i.classFocused=function(a){return" "+(this.focusedTargetIds.indexOf(a.id)>=0?l.focused:"")},i.classDefocused=function(a){return" "+(this.defocusedTargetIds.indexOf(a.id)>=0?l.defocused:"")},i.classChartText=function(a){return l.chartText+this.classTarget(a.id)},i.classChartLine=function(a){return l.chartLine+this.classTarget(a.id)},i.classChartBar=function(a){return l.chartBar+this.classTarget(a.id)},i.classChartArc=function(a){return l.chartArc+this.classTarget(a.data.id)},i.getTargetSelectorSuffix=function(a){return a||0===a?("-"+a).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},i.selectorTarget=function(a,b){return(b||"")+"."+l.target+this.getTargetSelectorSuffix(a)},i.selectorTargets=function(a,b){var c=this;return a=a||[],a.length?a.map(function(a){return c.selectorTarget(a,b)}):null},i.selectorLegend=function(a){return"."+l.legendItem+this.getTargetSelectorSuffix(a)},i.selectorLegends=function(a){var b=this;return a&&a.length?a.map(function(a){return b.selectorLegend(a)}):null};var m=i.isValue=function(a){return a||0===a},n=i.isFunction=function(a){return"function"==typeof a},o=i.isString=function(a){return"string"==typeof a},p=i.isUndefined=function(a){return"undefined"==typeof a},q=i.isDefined=function(a){return"undefined"!=typeof a},r=i.ceil10=function(a){return 10*Math.ceil(a/10)},s=i.asHalfPixel=function(a){return Math.ceil(a)+.5},t=i.diffDomain=function(a){return a[1]-a[0]},u=i.isEmpty=function(a){return"undefined"==typeof a||null===a||o(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},v=i.notEmpty=function(a){return!i.isEmpty(a)},w=i.getOption=function(a,b,c){return q(a[b])?a[b]:c},x=i.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},y=i.sanitise=function(a){return"string"==typeof a?a.replace(/</g,"&lt;").replace(/>/g,"&gt;"):a},z=i.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}};h.focus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),this.defocus(),b.classed(l.focused,!0).classed(l.defocused,!1),
2313 e=this.getYAxis(d,h.y2Orient,i.axis_y2_tick_format,h.y2AxisTickValues,!1,!0,!0)):(d=h.x.copy().domain(h.getXDomain(c)),e=this.getXAxis(d,h.xOrient,h.xAxisTickFormat,h.xAxisTickValues,!1,!0,!0),this.updateXAxisTickValues(c,e)),f=h.d3.select("body").append("div").classed("c3",!0),g=f.append("svg").style("visibility","hidden").style("position","fixed").style("top",0).style("left",0),g.append("g").call(e).each(function(){h.d3.select(this).selectAll("text").each(function(){var a=this.getBoundingClientRect();j<a.width&&(j=a.width)}),f.remove()})),h.currentMaxTickWidths[a]=0>=j?h.currentMaxTickWidths[a]:j,h.currentMaxTickWidths[a])},f.prototype.updateLabels=function(a){var b=this.owner,c=b.main.select("."+l.axisX+" ."+l.axisXLabel),d=b.main.select("."+l.axisY+" ."+l.axisYLabel),e=b.main.select("."+l.axisY2+" ."+l.axisY2Label);(a?c.transition():c).attr("x",this.xForXAxisLabel.bind(this)).attr("dx",this.dxForXAxisLabel.bind(this)).attr("dy",this.dyForXAxisLabel.bind(this)).text(this.textForXAxisLabel.bind(this)),(a?d.transition():d).attr("x",this.xForYAxisLabel.bind(this)).attr("dx",this.dxForYAxisLabel.bind(this)).attr("dy",this.dyForYAxisLabel.bind(this)).text(this.textForYAxisLabel.bind(this)),(a?e.transition():e).attr("x",this.xForY2AxisLabel.bind(this)).attr("dx",this.dxForY2AxisLabel.bind(this)).attr("dy",this.dyForY2AxisLabel.bind(this)).text(this.textForY2AxisLabel.bind(this))},f.prototype.getPadding=function(a,b,c,d){var e="number"==typeof a?a:a[b];return m(e)?"ratio"===a.unit?a[b]*d:this.convertPixelsToAxisPadding(e,d):c},f.prototype.convertPixelsToAxisPadding=function(a,b){var c=this.owner,d=c.config.axis_rotated?c.width:c.height;return b*(a/d)},f.prototype.generateTickValues=function(a,b,c){var d,e,f,g,h,i,j,k=a;if(b)if(d=n(b)?b():b,1===d)k=[a[0]];else if(2===d)k=[a[0],a[a.length-1]];else if(d>2){for(g=d-2,e=a[0],f=a[a.length-1],h=(f-e)/(g+1),k=[e],i=0;g>i;i++)j=+e+h*(i+1),k.push(c?new Date(j):j);k.push(f)}return c||(k=k.sort(function(a,b){return a-b})),k},f.prototype.generateTransitions=function(a){var b=this.owner,c=b.axes;return{axisX:a?c.x.transition().duration(a):c.x,axisY:a?c.y.transition().duration(a):c.y,axisY2:a?c.y2.transition().duration(a):c.y2,axisSubX:a?c.subx.transition().duration(a):c.subx}},f.prototype.redraw=function(a,b){var c=this.owner;c.axes.x.style("opacity",b?0:1),c.axes.y.style("opacity",b?0:1),c.axes.y2.style("opacity",b?0:1),c.axes.subx.style("opacity",b?0:1),a.axisX.call(c.xAxis),a.axisY.call(c.yAxis),a.axisY2.call(c.y2Axis),a.axisSubX.call(c.subXAxis)},i.getClipPath=function(b){var c=a.navigator.appVersion.toLowerCase().indexOf("msie 9.")>=0;return"url("+(c?"":document.URL.split("#")[0])+"#"+b+")"},i.appendClip=function(a,b){return a.append("clipPath").attr("id",b).append("rect")},i.getAxisClipX=function(a){var b=Math.max(30,this.margin.left);return a?-(1+b):-(b-1)},i.getAxisClipY=function(a){return a?-20:-this.margin.top},i.getXAxisClipX=function(){var a=this;return a.getAxisClipX(!a.config.axis_rotated)},i.getXAxisClipY=function(){var a=this;return a.getAxisClipY(!a.config.axis_rotated)},i.getYAxisClipX=function(){var a=this;return a.config.axis_y_inner?-1:a.getAxisClipX(a.config.axis_rotated)},i.getYAxisClipY=function(){var a=this;return a.getAxisClipY(a.config.axis_rotated)},i.getAxisClipWidth=function(a){var b=this,c=Math.max(30,b.margin.left),d=Math.max(30,b.margin.right);return a?b.width+2+c+d:b.margin.left+20},i.getAxisClipHeight=function(a){return(a?this.margin.bottom:this.margin.top+this.height)+20},i.getXAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(!a.config.axis_rotated)},i.getXAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(!a.config.axis_rotated)},i.getYAxisClipWidth=function(){var a=this;return a.getAxisClipWidth(a.config.axis_rotated)+(a.config.axis_y_inner?20:0)},i.getYAxisClipHeight=function(){var a=this;return a.getAxisClipHeight(a.config.axis_rotated)},i.initPie=function(){var a=this,b=a.d3,c=a.config;a.pie=b.layout.pie().value(function(a){return a.values.reduce(function(a,b){return a+b.value},0)}),c.data_order||a.pie.sort(null)},i.updateRadius=function(){var a=this,b=a.config,c=b.gauge_width||b.donut_width;a.radiusExpanded=Math.min(a.arcWidth,a.arcHeight)/2,a.radius=.95*a.radiusExpanded,a.innerRadiusRatio=c?(a.radius-c)/a.radius:.6,a.innerRadius=a.hasType("donut")||a.hasType("gauge")?a.radius*a.innerRadiusRatio:0},i.updateArc=function(){var a=this;a.svgArc=a.getSvgArc(),a.svgArcExpanded=a.getSvgArcExpanded(),a.svgArcExpandedSub=a.getSvgArcExpanded(.98)},i.updateAngle=function(a){var b,c,d,e,f=this,g=f.config,h=!1,i=0;return g?(f.pie(f.filterTargetsToShow(f.data.targets)).forEach(function(b){h||b.data.id!==a.data.id||(h=!0,a=b,a.index=i),i++}),isNaN(a.startAngle)&&(a.startAngle=0),isNaN(a.endAngle)&&(a.endAngle=a.startAngle),f.isGaugeType(a.data)&&(b=g.gauge_min,c=g.gauge_max,d=Math.PI*(g.gauge_fullCircle?2:1)/(c-b),e=a.value<b?0:a.value<c?a.value-b:c-b,a.startAngle=g.gauge_startingAngle,a.endAngle=a.startAngle+d*e),h?a:null):null},i.getSvgArc=function(){var a=this,b=a.d3.svg.arc().outerRadius(a.radius).innerRadius(a.innerRadius),c=function(c,d){var e;return d?b(c):(e=a.updateAngle(c),e?b(e):"M 0 0")};return c.centroid=b.centroid,c},i.getSvgArcExpanded=function(a){var b=this,c=b.d3.svg.arc().outerRadius(b.radiusExpanded*(a?a:1)).innerRadius(b.innerRadius);return function(a){var d=b.updateAngle(a);return d?c(d):"M 0 0"}},i.getArc=function(a,b,c){return c||this.isArcType(a.data)?this.svgArc(a,b):"M 0 0"},i.transformForArcLabel=function(a){var b,c,d,e,f,g=this,h=g.config,i=g.updateAngle(a),j="";return i&&!g.hasType("gauge")&&(b=this.svgArc.centroid(i),c=isNaN(b[0])?0:b[0],d=isNaN(b[1])?0:b[1],e=Math.sqrt(c*c+d*d),f=g.hasType("donut")&&h.donut_label_ratio?n(h.donut_label_ratio)?h.donut_label_ratio(a,g.radius,e):h.donut_label_ratio:g.hasType("pie")&&h.pie_label_ratio?n(h.pie_label_ratio)?h.pie_label_ratio(a,g.radius,e):h.pie_label_ratio:g.radius&&e?(36/g.radius>.375?1.175-36/g.radius:.8)*g.radius/e:0,j="translate("+c*f+","+d*f+")"),j},i.getArcRatio=function(a){var b=this,c=b.config,d=Math.PI*(b.hasType("gauge")&&!c.gauge_fullCircle?1:2);return a?(a.endAngle-a.startAngle)/d:null},i.convertToArcData=function(a){return this.addName({id:a.data.id,value:a.value,ratio:this.getArcRatio(a),index:a.index})},i.textForArcLabel=function(a){var b,c,d,e,f,g=this;return g.shouldShowArcLabel()?(b=g.updateAngle(a),c=b?b.value:null,d=g.getArcRatio(b),e=a.data.id,g.hasType("gauge")||g.meetsArcLabelThreshold(d)?(f=g.getArcLabelFormat(),f?f(c,d,e):g.defaultArcValueFormat(c,d)):""):""},i.expandArc=function(b){var c,d=this;return d.transiting?void(c=a.setInterval(function(){d.transiting||(a.clearInterval(c),d.legend.selectAll(".c3-legend-item-focused").size()>0&&d.expandArc(b))},10)):(b=d.mapToTargetIds(b),void d.svg.selectAll(d.selectorTargets(b,"."+l.chartArc)).each(function(a){d.shouldExpand(a.data.id)&&d.d3.select(this).selectAll("path").transition().duration(d.expandDuration(a.data.id)).attr("d",d.svgArcExpanded).transition().duration(2*d.expandDuration(a.data.id)).attr("d",d.svgArcExpandedSub).each(function(a){d.isDonutType(a.data)})}))},i.unexpandArc=function(a){var b=this;b.transiting||(a=b.mapToTargetIds(a),b.svg.selectAll(b.selectorTargets(a,"."+l.chartArc)).selectAll("path").transition().duration(function(a){return b.expandDuration(a.data.id)}).attr("d",b.svgArc),b.svg.selectAll("."+l.arc).style("opacity",1))},i.expandDuration=function(a){var b=this,c=b.config;return b.isDonutType(a)?c.donut_expand_duration:b.isGaugeType(a)?c.gauge_expand_duration:b.isPieType(a)?c.pie_expand_duration:50},i.shouldExpand=function(a){var b=this,c=b.config;return b.isDonutType(a)&&c.donut_expand||b.isGaugeType(a)&&c.gauge_expand||b.isPieType(a)&&c.pie_expand},i.shouldShowArcLabel=function(){var a=this,b=a.config,c=!0;return a.hasType("donut")?c=b.donut_label_show:a.hasType("pie")&&(c=b.pie_label_show),c},i.meetsArcLabelThreshold=function(a){var b=this,c=b.config,d=b.hasType("donut")?c.donut_label_threshold:c.pie_label_threshold;return a>=d},i.getArcLabelFormat=function(){var a=this,b=a.config,c=b.pie_label_format;return a.hasType("gauge")?c=b.gauge_label_format:a.hasType("donut")&&(c=b.donut_label_format),c},i.getArcTitle=function(){var a=this;return a.hasType("donut")?a.config.donut_title:""},i.updateTargetsForArc=function(a){var b,c,d=this,e=d.main,f=d.classChartArc.bind(d),g=d.classArcs.bind(d),h=d.classFocus.bind(d);b=e.select("."+l.chartArcs).selectAll("."+l.chartArc).data(d.pie(a)).attr("class",function(a){return f(a)+h(a.data)}),c=b.enter().append("g").attr("class",f),c.append("g").attr("class",g),c.append("text").attr("dy",d.hasType("gauge")?"-.1em":".35em").style("opacity",0).style("text-anchor","middle").style("pointer-events","none")},i.initArc=function(){var a=this;a.arcs=a.main.select("."+l.chart).append("g").attr("class",l.chartArcs).attr("transform",a.getTranslate("arc")),a.arcs.append("text").attr("class",l.chartArcsTitle).style("text-anchor","middle").text(a.getArcTitle())},i.redrawArc=function(a,b,c){var d,e=this,f=e.d3,g=e.config,h=e.main;d=h.selectAll("."+l.arcs).selectAll("."+l.arc).data(e.arcData.bind(e)),d.enter().append("path").attr("class",e.classArc.bind(e)).style("fill",function(a){return e.color(a.data)}).style("cursor",function(a){return g.interaction_enabled&&g.data_selection_isselectable(a)?"pointer":null}).style("opacity",0).each(function(a){e.isGaugeType(a.data)&&(a.startAngle=a.endAngle=g.gauge_startingAngle),this._current=a}),d.attr("transform",function(a){return!e.isGaugeType(a.data)&&c?"scale(0)":""}).style("opacity",function(a){return a===this._current?0:1}).on("mouseover",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.expandArc(b.data.id),e.api.focus(b.data.id),e.toggleFocusLegend(b.data.id,!0),e.config.data_onmouseover(c,this)))}:null).on("mousemove",g.interaction_enabled?function(a){var b,c,d=e.updateAngle(a);d&&(b=e.convertToArcData(d),c=[b],e.showTooltip(c,this))}:null).on("mouseout",g.interaction_enabled?function(a){var b,c;e.transiting||(b=e.updateAngle(a),b&&(c=e.convertToArcData(b),e.unexpandArc(b.data.id),e.api.revert(),e.revertLegend(),e.hideTooltip(),e.config.data_onmouseout(c,this)))}:null).on("click",g.interaction_enabled?function(a,b){var c,d=e.updateAngle(a);d&&(c=e.convertToArcData(d),e.toggleShape&&e.toggleShape(this,c,b),e.config.data_onclick.call(e.api,c,this))}:null).each(function(){e.transiting=!0}).transition().duration(a).attrTween("d",function(a){var b,c=e.updateAngle(a);return c?(isNaN(this._current.startAngle)&&(this._current.startAngle=0),isNaN(this._current.endAngle)&&(this._current.endAngle=this._current.startAngle),b=f.interpolate(this._current,c),this._current=b(0),function(c){var d=b(c);return d.data=a.data,e.getArc(d,!0)}):function(){return"M 0 0"}}).attr("transform",c?"scale(1)":"").style("fill",function(a){return e.levelColor?e.levelColor(a.data.values[0].value):e.color(a.data.id)}).style("opacity",1).call(e.endall,function(){e.transiting=!1}),d.exit().transition().duration(b).style("opacity",0).remove(),h.selectAll("."+l.chartArc).select("text").style("opacity",0).attr("class",function(a){return e.isGaugeType(a.data)?l.gaugeValue:""}).text(e.textForArcLabel.bind(e)).attr("transform",e.transformForArcLabel.bind(e)).style("font-size",function(a){return e.isGaugeType(a.data)?Math.round(e.radius/5)+"px":""}).transition().duration(a).style("opacity",function(a){return e.isTargetToShow(a.data.id)&&e.isArcType(a.data)?1:0}),h.select("."+l.chartArcsTitle).style("opacity",e.hasType("donut")||e.hasType("gauge")?1:0),e.hasType("gauge")&&(e.arcs.select("."+l.chartArcsBackground).attr("d",function(){var a={data:[{value:g.gauge_max}],startAngle:g.gauge_startingAngle,endAngle:-1*g.gauge_startingAngle};return e.getArc(a,!0,!0)}),e.arcs.select("."+l.chartArcsGaugeUnit).attr("dy",".75em").text(g.gauge_label_show?g.gauge_units:""),e.arcs.select("."+l.chartArcsGaugeMin).attr("dx",-1*(e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2))+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_min:""),e.arcs.select("."+l.chartArcsGaugeMax).attr("dx",e.innerRadius+(e.radius-e.innerRadius)/(g.gauge_fullCircle?1:2)+"px").attr("dy","1.2em").text(g.gauge_label_show?g.gauge_max:""))},i.initGauge=function(){var a=this.arcs;this.hasType("gauge")&&(a.append("path").attr("class",l.chartArcsBackground),a.append("text").attr("class",l.chartArcsGaugeUnit).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMin).style("text-anchor","middle").style("pointer-events","none"),a.append("text").attr("class",l.chartArcsGaugeMax).style("text-anchor","middle").style("pointer-events","none"))},i.getGaugeLabelHeight=function(){return this.config.gauge_label_show?20:0},i.initRegion=function(){var a=this;a.region=a.main.append("g").attr("clip-path",a.clipPath).attr("class",l.regions)},i.updateRegion=function(a){var b=this,c=b.config;b.region.style("visibility",b.hasArcType()?"hidden":"visible"),b.mainRegion=b.main.select("."+l.regions).selectAll("."+l.region).data(c.regions),b.mainRegion.enter().append("g").append("rect").style("fill-opacity",0),b.mainRegion.attr("class",b.classRegion.bind(b)),b.mainRegion.exit().transition().duration(a).style("opacity",0).remove()},i.redrawRegion=function(a){var b=this,c=b.mainRegion.selectAll("rect").each(function(){var a=b.d3.select(this.parentNode).datum();b.d3.select(this).datum(a)}),d=b.regionX.bind(b),e=b.regionY.bind(b),f=b.regionWidth.bind(b),g=b.regionHeight.bind(b);return[(a?c.transition():c).attr("x",d).attr("y",e).attr("width",f).attr("height",g).style("fill-opacity",function(a){return m(a.opacity)?a.opacity:.1})]},i.regionX=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"start"in a?e(a.start):0:d.axis_rotated?0:"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionY=function(a){var b,c=this,d=c.config,e="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?0:"end"in a?e(a.end):0:d.axis_rotated&&"start"in a?c.x(c.isTimeSeries()?c.parseDate(a.start):a.start):0},i.regionWidth=function(a){var b,c=this,d=c.config,e=c.regionX(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated&&"end"in a?f(a.end):c.width:d.axis_rotated?c.width:"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.width,e>b?0:b-e},i.regionHeight=function(a){var b,c=this,d=c.config,e=this.regionY(a),f="y"===a.axis?c.y:c.y2;return b="y"===a.axis||"y2"===a.axis?d.axis_rotated?c.height:"start"in a?f(a.start):c.height:d.axis_rotated&&"end"in a?c.x(c.isTimeSeries()?c.parseDate(a.end):a.end):c.height,e>b?0:b-e},i.isRegionOnX=function(a){return!a.axis||"x"===a.axis},i.drag=function(a){var b,c,d,e,f,g,h,i,j=this,k=j.config,m=j.main,n=j.d3;j.hasArcType()||k.data_selection_enabled&&(k.zoom_enabled&&!j.zoom.altDomain||k.data_selection_multiple&&(b=j.dragStart[0],c=j.dragStart[1],d=a[0],e=a[1],f=Math.min(b,d),g=Math.max(b,d),h=k.data_selection_grouped?j.margin.top:Math.min(c,e),i=k.data_selection_grouped?j.height:Math.max(c,e),m.select("."+l.dragarea).attr("x",f).attr("y",h).attr("width",g-f).attr("height",i-h),m.selectAll("."+l.shapes).selectAll("."+l.shape).filter(function(a){return k.data_selection_isselectable(a)}).each(function(a,b){var c,d,e,k,m,o,p=n.select(this),q=p.classed(l.SELECTED),r=p.classed(l.INCLUDED),s=!1;if(p.classed(l.circle))c=1*p.attr("cx"),d=1*p.attr("cy"),m=j.togglePoint,s=c>f&&g>c&&d>h&&i>d;else{if(!p.classed(l.bar))return;o=z(this),c=o.x,d=o.y,e=o.width,k=o.height,m=j.togglePath,s=!(c>g||f>c+e||d>i||h>d+k)}s^r&&(p.classed(l.INCLUDED,!r),p.classed(l.SELECTED,!q),m.call(j,!q,p,a,b))})))},i.dragstart=function(a){var b=this,c=b.config;b.hasArcType()||c.data_selection_enabled&&(b.dragStart=a,b.main.select("."+l.chart).append("rect").attr("class",l.dragarea).style("opacity",.1),b.dragging=!0)},i.dragend=function(){var a=this,b=a.config;a.hasArcType()||b.data_selection_enabled&&(a.main.select("."+l.dragarea).transition().duration(100).style("opacity",0).remove(),a.main.selectAll("."+l.shape).classed(l.INCLUDED,!1),a.dragging=!1)},i.selectPoint=function(a,b,c){var d=this,e=d.config,f=(e.axis_rotated?d.circleY:d.circleX).bind(d),g=(e.axis_rotated?d.circleX:d.circleY).bind(d),h=d.pointSelectR.bind(d);e.data_onselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).data([b]).enter().append("circle").attr("class",function(){return d.generateClass(l.selectedCircle,c)}).attr("cx",f).attr("cy",g).attr("stroke",function(){return d.color(b)}).attr("r",function(a){return 1.4*d.pointSelectR(a)}).transition().duration(100).attr("r",h)},i.unselectPoint=function(a,b,c){var d=this;d.config.data_onunselected.call(d.api,b,a.node()),d.main.select("."+l.selectedCircles+d.getTargetSelectorSuffix(b.id)).selectAll("."+l.selectedCircle+"-"+c).transition().duration(100).attr("r",0).remove()},i.togglePoint=function(a,b,c,d){a?this.selectPoint(b,c,d):this.unselectPoint(b,c,d)},i.selectPath=function(a,b){var c=this;c.config.data_onselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.d3.rgb(c.color(b)).brighter(.75)})},i.unselectPath=function(a,b){var c=this;c.config.data_onunselected.call(c,b,a.node()),c.config.interaction_brighten&&a.transition().duration(100).style("fill",function(){return c.color(b)})},i.togglePath=function(a,b,c,d){a?this.selectPath(b,c,d):this.unselectPath(b,c,d)},i.getToggle=function(a,b){var c,d=this;return"circle"===a.nodeName?c=d.isStepType(b)?function(){}:d.togglePoint:"path"===a.nodeName&&(c=d.togglePath),c},i.toggleShape=function(a,b,c){var d=this,e=d.d3,f=d.config,g=e.select(a),h=g.classed(l.SELECTED),i=d.getToggle(a,b).bind(d);f.data_selection_enabled&&f.data_selection_isselectable(b)&&(f.data_selection_multiple||d.main.selectAll("."+l.shapes+(f.data_selection_grouped?d.getTargetSelectorSuffix(b.id):"")).selectAll("."+l.shape).each(function(a,b){var c=e.select(this);c.classed(l.SELECTED)&&i(!1,c.classed(l.SELECTED,!1),a,b)}),g.classed(l.SELECTED,!h),i(!h,g,b,c))},i.initBrush=function(){var a=this,b=a.d3;a.brush=b.svg.brush().on("brush",function(){a.redrawForBrush()}),a.brush.update=function(){return a.context&&a.context.select("."+l.brush).call(this),this},a.brush.scale=function(b){return a.config.axis_rotated?this.y(b):this.x(b)}},i.initSubchart=function(){var a=this,b=a.config,c=a.context=a.svg.append("g").attr("transform",a.getTranslate("context")),d=b.subchart_show?"visible":"hidden";c.style("visibility",d),c.append("g").attr("clip-path",a.clipPathForSubchart).attr("class",l.chart),c.select("."+l.chart).append("g").attr("class",l.chartBars),c.select("."+l.chart).append("g").attr("class",l.chartLines),c.append("g").attr("clip-path",a.clipPath).attr("class",l.brush).call(a.brush),a.axes.subx=c.append("g").attr("class",l.axisX).attr("transform",a.getTranslate("subx")).attr("clip-path",b.axis_rotated?"":a.clipPathForXAxis).style("visibility",b.subchart_axis_x_show?d:"hidden")},i.updateTargetsForSubchart=function(a){var b,c,d,e,f=this,g=f.context,h=f.config,i=f.classChartBar.bind(f),j=f.classBars.bind(f),k=f.classChartLine.bind(f),m=f.classLines.bind(f),n=f.classAreas.bind(f);h.subchart_show&&(e=g.select("."+l.chartBars).selectAll("."+l.chartBar).data(a).attr("class",i),d=e.enter().append("g").style("opacity",0).attr("class",i),d.append("g").attr("class",j),c=g.select("."+l.chartLines).selectAll("."+l.chartLine).data(a).attr("class",k),b=c.enter().append("g").style("opacity",0).attr("class",k),b.append("g").attr("class",m),b.append("g").attr("class",n),g.selectAll("."+l.brush+" rect").attr(h.axis_rotated?"width":"height",h.axis_rotated?f.width2:f.height2))},i.updateBarForSubchart=function(a){var b=this;b.contextBar=b.context.selectAll("."+l.bars).selectAll("."+l.bar).data(b.barData.bind(b)),b.contextBar.enter().append("path").attr("class",b.classBar.bind(b)).style("stroke","none").style("fill",b.color),b.contextBar.style("opacity",b.initialOpacity.bind(b)),b.contextBar.exit().transition().duration(a).style("opacity",0).remove()},i.redrawBarForSubchart=function(a,b,c){(b?this.contextBar.transition(Math.random().toString()).duration(c):this.contextBar).attr("d",a).style("opacity",1)},i.updateLineForSubchart=function(a){var b=this;b.contextLine=b.context.selectAll("."+l.lines).selectAll("."+l.line).data(b.lineData.bind(b)),b.contextLine.enter().append("path").attr("class",b.classLine.bind(b)).style("stroke",b.color),b.contextLine.style("opacity",b.initialOpacity.bind(b)),b.contextLine.exit().transition().duration(a).style("opacity",0).remove()},i.redrawLineForSubchart=function(a,b,c){(b?this.contextLine.transition(Math.random().toString()).duration(c):this.contextLine).attr("d",a).style("opacity",1)},i.updateAreaForSubchart=function(a){var b=this,c=b.d3;b.contextArea=b.context.selectAll("."+l.areas).selectAll("."+l.area).data(b.lineData.bind(b)),b.contextArea.enter().append("path").attr("class",b.classArea.bind(b)).style("fill",b.color).style("opacity",function(){return b.orgAreaOpacity=+c.select(this).style("opacity"),0}),b.contextArea.style("opacity",0),b.contextArea.exit().transition().duration(a).style("opacity",0).remove()},i.redrawAreaForSubchart=function(a,b,c){(b?this.contextArea.transition(Math.random().toString()).duration(c):this.contextArea).attr("d",a).style("fill",this.color).style("opacity",this.orgAreaOpacity)},i.redrawSubchart=function(a,b,c,d,e,f,g){var h,i,j,k=this,l=k.d3,m=k.config;k.context.style("visibility",m.subchart_show?"visible":"hidden"),m.subchart_show&&(l.event&&"zoom"===l.event.type&&k.brush.extent(k.x.orgDomain()).update(),a&&(k.brush.empty()||k.brush.extent(k.x.orgDomain()).update(),h=k.generateDrawArea(e,!0),i=k.generateDrawBar(f,!0),j=k.generateDrawLine(g,!0),k.updateBarForSubchart(c),k.updateLineForSubchart(c),k.updateAreaForSubchart(c),k.redrawBarForSubchart(i,c,c),k.redrawLineForSubchart(j,c,c),k.redrawAreaForSubchart(h,c,c)))},i.redrawForBrush=function(){var a=this,b=a.x;a.redraw({withTransition:!1,withY:a.config.zoom_rescale,withSubchart:!1,withUpdateXDomain:!0,withDimension:!1}),a.config.subchart_onbrush.call(a.api,b.orgDomain())},i.transformContext=function(a,b){var c,d=this;b&&b.axisSubX?c=b.axisSubX:(c=d.context.select("."+l.axisX),a&&(c=c.transition())),d.context.attr("transform",d.getTranslate("context")),c.attr("transform",d.getTranslate("subx"))},i.getDefaultExtent=function(){var a=this,b=a.config,c=n(b.axis_x_extent)?b.axis_x_extent(a.getXDomain(a.data.targets)):b.axis_x_extent;return a.isTimeSeries()&&(c=[a.parseDate(c[0]),a.parseDate(c[1])]),c},i.initZoom=function(){var a,b=this,c=b.d3,d=b.config;b.zoom=c.behavior.zoom().on("zoomstart",function(){a=c.event.sourceEvent,b.zoom.altDomain=c.event.sourceEvent.altKey?b.x.orgDomain():null,d.zoom_onzoomstart.call(b.api,c.event.sourceEvent)}).on("zoom",function(){b.redrawForZoom.call(b)}).on("zoomend",function(){var e=c.event.sourceEvent;e&&a.clientX===e.clientX&&a.clientY===e.clientY||(b.redrawEventRect(),b.updateZoom(),d.zoom_onzoomend.call(b.api,b.x.orgDomain()))}),b.zoom.scale=function(a){return d.axis_rotated?this.y(a):this.x(a)},b.zoom.orgScaleExtent=function(){var a=d.zoom_extent?d.zoom_extent:[1,10];return[a[0],Math.max(b.getMaxDataCount()/a[1],a[1])]},b.zoom.updateScaleExtent=function(){var a=t(b.x.orgDomain())/t(b.getZoomDomain()),c=this.orgScaleExtent();return this.scaleExtent([c[0]*a,c[1]*a]),this}},i.getZoomDomain=function(){var a=this,b=a.config,c=a.d3,d=c.min([a.orgXDomain[0],b.zoom_x_min]),e=c.max([a.orgXDomain[1],b.zoom_x_max]);return[d,e]},i.updateZoom=function(){var a=this,b=a.config.zoom_enabled?a.zoom:function(){};a.main.select("."+l.zoomRect).call(b).on("dblclick.zoom",null),a.main.selectAll("."+l.eventRect).call(b).on("dblclick.zoom",null)},i.redrawForZoom=function(){var a=this,b=a.d3,c=a.config,d=a.zoom,e=a.x;if(c.zoom_enabled&&0!==a.filterTargetsToShow(a.data.targets).length){if("mousemove"===b.event.sourceEvent.type&&d.altDomain)return e.domain(d.altDomain),void d.scale(e).updateScaleExtent();a.isCategorized()&&e.orgDomain()[0]===a.orgXDomain[0]&&e.domain([a.orgXDomain[0]-1e-10,e.orgDomain()[1]]),a.redraw({withTransition:!1,withY:c.zoom_rescale,withSubchart:!1,withEventRect:!1,withDimension:!1}),"mousemove"===b.event.sourceEvent.type&&(a.cancelClick=!0),c.zoom_onzoom.call(a.api,e.orgDomain())}},i.generateColor=function(){var a=this,b=a.config,c=a.d3,d=b.data_colors,e=v(b.color_pattern)?b.color_pattern:c.scale.category10().range(),f=b.data_color,g=[];return function(a){var b,c=a.id||a.data&&a.data.id||a;return d[c]instanceof Function?b=d[c](a):d[c]?b=d[c]:(g.indexOf(c)<0&&g.push(c),b=e[g.indexOf(c)%e.length],d[c]=b),f instanceof Function?f(b,a):b}},i.generateLevelColor=function(){var a=this,b=a.config,c=b.color_pattern,d=b.color_threshold,e="value"===d.unit,f=d.values&&d.values.length?d.values:[],g=d.max||100;return v(b.color_threshold)?function(a){var b,d,h=c[c.length-1];for(b=0;b<f.length;b++)if(d=e?a:100*a/g,d<f[b]){h=c[b];break}return h}:null},i.getYFormat=function(a){var b=this,c=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.yFormat,d=a&&!b.hasType("gauge")?b.defaultArcValueFormat:b.y2Format;return function(a,e,f){var g="y2"===b.axis.getId(f)?d:c;return g.call(b,a,e)}},i.yFormat=function(a){var b=this,c=b.config,d=c.axis_y_tick_format?c.axis_y_tick_format:b.defaultValueFormat;return d(a)},i.y2Format=function(a){var b=this,c=b.config,d=c.axis_y2_tick_format?c.axis_y2_tick_format:b.defaultValueFormat;return d(a)},i.defaultValueFormat=function(a){return m(a)?+a:""},i.defaultArcValueFormat=function(a,b){return(100*b).toFixed(1)+"%"},i.dataLabelFormat=function(a){var b,c=this,d=c.config.data_labels,e=function(a){return m(a)?+a:""};return b="function"==typeof d.format?d.format:"object"==typeof d.format?d.format[a]?d.format[a]===!0?e:d.format[a]:function(){return""}:e},i.hasCaches=function(a){for(var b=0;b<a.length;b++)if(!(a[b]in this.cache))return!1;return!0},i.addCache=function(a,b){this.cache[a]=this.cloneTarget(b)},i.getCaches=function(a){var b,c=[];for(b=0;b<a.length;b++)a[b]in this.cache&&c.push(this.cloneTarget(this.cache[a[b]]));return c};var l=i.CLASS={target:"c3-target",chart:"c3-chart",chartLine:"c3-chart-line",chartLines:"c3-chart-lines",chartBar:"c3-chart-bar",chartBars:"c3-chart-bars",chartText:"c3-chart-text",chartTexts:"c3-chart-texts",chartArc:"c3-chart-arc",chartArcs:"c3-chart-arcs",chartArcsTitle:"c3-chart-arcs-title",chartArcsBackground:"c3-chart-arcs-background",chartArcsGaugeUnit:"c3-chart-arcs-gauge-unit",chartArcsGaugeMax:"c3-chart-arcs-gauge-max",chartArcsGaugeMin:"c3-chart-arcs-gauge-min",selectedCircle:"c3-selected-circle",selectedCircles:"c3-selected-circles",eventRect:"c3-event-rect",eventRects:"c3-event-rects",eventRectsSingle:"c3-event-rects-single",eventRectsMultiple:"c3-event-rects-multiple",zoomRect:"c3-zoom-rect",brush:"c3-brush",focused:"c3-focused",defocused:"c3-defocused",region:"c3-region",regions:"c3-regions",title:"c3-title",tooltipContainer:"c3-tooltip-container",tooltip:"c3-tooltip",tooltipName:"c3-tooltip-name",shape:"c3-shape",shapes:"c3-shapes",line:"c3-line",lines:"c3-lines",bar:"c3-bar",bars:"c3-bars",circle:"c3-circle",circles:"c3-circles",arc:"c3-arc",arcs:"c3-arcs",area:"c3-area",areas:"c3-areas",empty:"c3-empty",text:"c3-text",texts:"c3-texts",gaugeValue:"c3-gauge-value",grid:"c3-grid",gridLines:"c3-grid-lines",xgrid:"c3-xgrid",xgrids:"c3-xgrids",xgridLine:"c3-xgrid-line",xgridLines:"c3-xgrid-lines",xgridFocus:"c3-xgrid-focus",ygrid:"c3-ygrid",ygrids:"c3-ygrids",ygridLine:"c3-ygrid-line",ygridLines:"c3-ygrid-lines",axis:"c3-axis",axisX:"c3-axis-x",axisXLabel:"c3-axis-x-label",axisY:"c3-axis-y",axisYLabel:"c3-axis-y-label",axisY2:"c3-axis-y2",axisY2Label:"c3-axis-y2-label",legendBackground:"c3-legend-background",legendItem:"c3-legend-item",legendItemEvent:"c3-legend-item-event",legendItemTile:"c3-legend-item-tile",legendItemHidden:"c3-legend-item-hidden",legendItemFocused:"c3-legend-item-focused",dragarea:"c3-dragarea",EXPANDED:"_expanded_",SELECTED:"_selected_",INCLUDED:"_included_"};i.generateClass=function(a,b){return" "+a+" "+a+this.getTargetSelectorSuffix(b)},i.classText=function(a){return this.generateClass(l.text,a.index)},i.classTexts=function(a){return this.generateClass(l.texts,a.id)},i.classShape=function(a){return this.generateClass(l.shape,a.index)},i.classShapes=function(a){return this.generateClass(l.shapes,a.id)},i.classLine=function(a){return this.classShape(a)+this.generateClass(l.line,a.id)},i.classLines=function(a){return this.classShapes(a)+this.generateClass(l.lines,a.id)},i.classCircle=function(a){return this.classShape(a)+this.generateClass(l.circle,a.index)},i.classCircles=function(a){return this.classShapes(a)+this.generateClass(l.circles,a.id)},i.classBar=function(a){return this.classShape(a)+this.generateClass(l.bar,a.index)},i.classBars=function(a){return this.classShapes(a)+this.generateClass(l.bars,a.id)},i.classArc=function(a){return this.classShape(a.data)+this.generateClass(l.arc,a.data.id)},i.classArcs=function(a){return this.classShapes(a.data)+this.generateClass(l.arcs,a.data.id)},i.classArea=function(a){return this.classShape(a)+this.generateClass(l.area,a.id)},i.classAreas=function(a){return this.classShapes(a)+this.generateClass(l.areas,a.id)},i.classRegion=function(a,b){return this.generateClass(l.region,b)+" "+("class"in a?a["class"]:"")},i.classEvent=function(a){return this.generateClass(l.eventRect,a.index)},i.classTarget=function(a){var b=this,c=b.config.data_classes[a],d="";return c&&(d=" "+l.target+"-"+c),b.generateClass(l.target,a)+d},i.classFocus=function(a){return this.classFocused(a)+this.classDefocused(a)},i.classFocused=function(a){return" "+(this.focusedTargetIds.indexOf(a.id)>=0?l.focused:"")},i.classDefocused=function(a){return" "+(this.defocusedTargetIds.indexOf(a.id)>=0?l.defocused:"")},i.classChartText=function(a){return l.chartText+this.classTarget(a.id)},i.classChartLine=function(a){return l.chartLine+this.classTarget(a.id)},i.classChartBar=function(a){return l.chartBar+this.classTarget(a.id)},i.classChartArc=function(a){return l.chartArc+this.classTarget(a.data.id)},i.getTargetSelectorSuffix=function(a){return a||0===a?("-"+a).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g,"-"):""},i.selectorTarget=function(a,b){return(b||"")+"."+l.target+this.getTargetSelectorSuffix(a)},i.selectorTargets=function(a,b){var c=this;return a=a||[],a.length?a.map(function(a){return c.selectorTarget(a,b)}):null},i.selectorLegend=function(a){return"."+l.legendItem+this.getTargetSelectorSuffix(a)},i.selectorLegends=function(a){var b=this;return a&&a.length?a.map(function(a){return b.selectorLegend(a)}):null};var m=i.isValue=function(a){return a||0===a},n=i.isFunction=function(a){return"function"==typeof a},o=i.isString=function(a){return"string"==typeof a},p=i.isUndefined=function(a){return"undefined"==typeof a},q=i.isDefined=function(a){return"undefined"!=typeof a},r=i.ceil10=function(a){return 10*Math.ceil(a/10)},s=i.asHalfPixel=function(a){return Math.ceil(a)+.5},t=i.diffDomain=function(a){return a[1]-a[0]},u=i.isEmpty=function(a){return"undefined"==typeof a||null===a||o(a)&&0===a.length||"object"==typeof a&&0===Object.keys(a).length},v=i.notEmpty=function(a){return!i.isEmpty(a)},w=i.getOption=function(a,b,c){return q(a[b])?a[b]:c},x=i.hasValue=function(a,b){var c=!1;return Object.keys(a).forEach(function(d){a[d]===b&&(c=!0)}),c},y=i.sanitise=function(a){return"string"==typeof a?a.replace(/</g,"&lt;").replace(/>/g,"&gt;"):a},z=i.getPathBox=function(a){var b=a.getBoundingClientRect(),c=[a.pathSegList.getItem(0),a.pathSegList.getItem(1)],d=c[0].x,e=Math.min(c[0].y,c[1].y);return{x:d,y:e,width:b.width,height:b.height}};h.focus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),this.revert(),this.defocus(),b.classed(l.focused,!0).classed(l.defocused,!1),
2314 c.hasArcType()&&c.expandArc(a),c.toggleFocusLegend(a,!0),c.focusedTargetIds=a,c.defocusedTargetIds=c.defocusedTargetIds.filter(function(b){return a.indexOf(b)<0})},h.defocus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),b.classed(l.focused,!1).classed(l.defocused,!0),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1),c.focusedTargetIds=c.focusedTargetIds.filter(function(b){return a.indexOf(b)<0}),c.defocusedTargetIds=a},h.revert=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a)),b.classed(l.focused,!1).classed(l.defocused,!1),c.hasArcType()&&c.unexpandArc(a),c.config.legend_show&&(c.showLegend(a.filter(c.isLegendToShow.bind(c))),c.legend.selectAll(c.selectorLegends(a)).filter(function(){return c.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),c.focusedTargetIds=[],c.defocusedTargetIds=[]},h.show=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.removeHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",1,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",1)}),b.withLegend&&d.showLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.hide=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.addHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",0,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",0)}),b.withLegend&&d.hideLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.toggle=function(a,b){var c=this,d=this.internal;d.mapToTargetIds(a).forEach(function(a){d.isTargetToShow(a)?c.hide(a,b):c.show(a,b)})},h.zoom=function(a){var b=this.internal;return a&&(b.isTimeSeries()&&(a=a.map(function(a){return b.parseDate(a)})),b.brush.extent(a),b.redraw({withUpdateXDomain:!0,withY:b.config.zoom_rescale}),b.config.zoom_onzoom.call(this,b.x.orgDomain())),b.brush.extent()},h.zoom.enable=function(a){var b=this.internal;b.config.zoom_enabled=a,b.updateAndRedraw()},h.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},h.zoom.max=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_max=d.max([b.orgXDomain[1],a])):c.zoom_x_max},h.zoom.min=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_min=d.min([b.orgXDomain[0],a])):c.zoom_x_min},h.zoom.range=function(a){return arguments.length?(q(a.max)&&this.domain.max(a.max),void(q(a.min)&&this.domain.min(a.min))):{max:this.domain.max(),min:this.domain.min()}},h.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"names"in a&&h.data.names.bind(this)(a.names),"classes"in a&&Object.keys(a.classes).forEach(function(b){c.data_classes[b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c.axis_x_categories=a.categories),"axes"in a&&Object.keys(a.axes).forEach(function(b){c.data_axes[b]=a.axes[b]}),"colors"in a&&Object.keys(a.colors).forEach(function(b){c.data_colors[b]=a.colors[b]}),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},h.unload=function(a){var b=this.internal;a=a||{},a instanceof Array?a={ids:a}:"string"==typeof a&&(a={ids:[a]}),b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.done&&a.done()})},h.flow=function(a){var b,c,d,e,f,g,h,i,j=this.internal,k=[],l=j.getMaxDataCount(),n=0,o=0;if(a.json)c=j.convertJsonToData(a.json,a.keys);else if(a.rows)c=j.convertRowsToData(a.rows);else{if(!a.columns)return;c=j.convertColumnsToData(a.columns)}b=j.convertDataToTargets(c,!0),j.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;c<b.length;c++)if(a.id===b[c].id){for(e=!0,a.values[a.values.length-1]&&(o=a.values[a.values.length-1].index+1),n=b[c].values.length,d=0;n>d;d++)b[c].values[d].index=o+d,j.isTimeSeries()||(b[c].values[d].x=o+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||k.push(a.id)}),j.data.targets.forEach(function(a){var b,c;for(b=0;b<k.length;b++)if(a.id===k[b])for(o=a.values[a.values.length-1].index+1,c=0;n>c;c++)a.values.push({id:a.id,index:o+c,x:j.isTimeSeries()?j.getOtherTargetX(o+c):o+c,value:null})}),j.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=j.data.targets[0].values[0].index;o>b;b++)c.push({id:a.id,index:b,x:j.isTimeSeries()?j.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=o,j.isTimeSeries()||(a.x+=o)}),a.values=c.concat(a.values)}),j.data.targets=j.data.targets.concat(b),d=j.getMaxDataCount(),f=j.data.targets[0],g=f.values[0],q(a.to)?(n=0,i=j.isTimeSeries()?j.parseDate(a.to):a.to,f.values.forEach(function(a){a.x<i&&n++})):q(a.length)&&(n=a.length),l?1===l&&j.isTimeSeries()&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],j.updateXDomain(null,!0,!0,!1,e)):(h=j.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-j.getXDomain(j.data.targets)[0]:1,e=[g.x-h,g.x],j.updateXDomain(null,!0,!0,!1,e)),j.updateTargets(j.data.targets),j.redraw({flow:{index:g.index,length:n,duration:m(a.duration)?a.duration:j.config.transition_duration,done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})},i.generateFlow=function(a){var b=this,c=b.config,d=b.d3;return function(){var e,f,g,h=a.targets,i=a.flow,j=a.drawBar,k=a.drawLine,m=a.drawArea,n=a.cx,o=a.cy,p=a.xv,q=a.xForText,r=a.yForText,s=a.duration,u=1,v=i.index,w=i.length,x=b.getValueOnIndex(b.data.targets[0].values,v),y=b.getValueOnIndex(b.data.targets[0].values,v+w),z=b.x.domain(),A=i.duration||s,B=i.done||function(){},C=b.generateWait(),D=b.xgrid||d.selectAll([]),E=b.xgridLines||d.selectAll([]),F=b.mainRegion||d.selectAll([]),G=b.mainText||d.selectAll([]),H=b.mainBar||d.selectAll([]),I=b.mainLine||d.selectAll([]),J=b.mainArea||d.selectAll([]),K=b.mainCircle||d.selectAll([]);b.flowing=!0,b.data.targets.forEach(function(a){a.values.splice(0,w)}),g=b.updateXDomain(h,!0,!0),b.updateXGrid&&b.updateXGrid(!0),i.orgDataCount?e=1===i.orgDataCount||(x&&x.x)===(y&&y.x)?b.x(z[0])-b.x(g[0]):b.isTimeSeries()?b.x(z[0])-b.x(g[0]):b.x(x.x)-b.x(y.x):1!==b.data.targets[0].values.length?e=b.x(z[0])-b.x(g[0]):b.isTimeSeries()?(x=b.getValueOnIndex(b.data.targets[0].values,0),y=b.getValueOnIndex(b.data.targets[0].values,b.data.targets[0].values.length-1),e=b.x(x.x)-b.x(y.x)):e=t(g)/2,u=t(z)/t(g),f="translate("+e+",0) scale("+u+",1)",b.hideXGridFocus(),d.transition().ease("linear").duration(A).each(function(){C.add(b.axes.x.transition().call(b.xAxis)),C.add(H.transition().attr("transform",f)),C.add(I.transition().attr("transform",f)),C.add(J.transition().attr("transform",f)),C.add(K.transition().attr("transform",f)),C.add(G.transition().attr("transform",f)),C.add(F.filter(b.isRegionOnX).transition().attr("transform",f)),C.add(D.transition().attr("transform",f)),C.add(E.transition().attr("transform",f))}).call(C,function(){var a,d=[],e=[],f=[];if(w){for(a=0;w>a;a++)d.push("."+l.shape+"-"+(v+a)),e.push("."+l.text+"-"+(v+a)),f.push("."+l.eventRect+"-"+(v+a));b.svg.selectAll("."+l.shapes).selectAll(d).remove(),b.svg.selectAll("."+l.texts).selectAll(e).remove(),b.svg.selectAll("."+l.eventRects).selectAll(f).remove(),b.svg.select("."+l.xgrid).remove()}D.attr("transform",null).attr(b.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",c.axis_rotated?0:p).attr("x2",c.axis_rotated?b.width:p),E.select("text").attr("x",c.axis_rotated?b.width:0).attr("y",p),H.attr("transform",null).attr("d",j),I.attr("transform",null).attr("d",k),J.attr("transform",null).attr("d",m),K.attr("transform",null).attr("cx",n).attr("cy",o),G.attr("transform",null).attr("x",q).attr("y",r).style("fill-opacity",b.opacityForText.bind(b)),F.attr("transform",null),F.select("rect").filter(b.isRegionOnX).attr("x",b.regionX.bind(b)).attr("width",b.regionWidth.bind(b)),c.interaction_enabled&&b.redrawEventRect(),B(),b.flowing=!1})}},h.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+l.shapes+b.getTargetSelectorSuffix(a)).selectAll("."+l.shape).filter(function(){return c.select(this).classed(l.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},h.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f.data_selection_enabled&&d.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(g,h){var i=e.select(this),j=g.data?g.data.id:g.id,k=d.getToggle(this,g).bind(d),m=f.data_selection_grouped||!a||a.indexOf(j)>=0,n=!b||b.indexOf(h)>=0,o=i.classed(l.SELECTED);i.classed(l.line)||i.classed(l.area)||(m&&n?f.data_selection_isselectable(g)&&!o&&k(!0,i.classed(l.SELECTED,!0),g,h):q(c)&&c&&o&&k(!1,i.classed(l.SELECTED,!1),g,h))})},h.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e.data_selection_enabled&&c.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(f,g){var h=d.select(this),i=f.data?f.data.id:f.id,j=c.getToggle(this,f).bind(c),k=e.data_selection_grouped||!a||a.indexOf(i)>=0,m=!b||b.indexOf(g)>=0,n=h.classed(l.SELECTED);h.classed(l.line)||h.classed(l.area)||k&&m&&e.data_selection_isselectable(f)&&n&&j(!1,h.classed(l.SELECTED,!1),f,g)})},h.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},i.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateTargets(d.data.targets),d.updateAndRedraw(f)},h.groups=function(a){var b=this.internal,c=b.config;return p(a)?c.data_groups:(c.data_groups=a,b.redraw(),c.data_groups)},h.xgrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_x_lines=a,b.redrawWithoutRescale(),c.grid_x_lines):c.grid_x_lines},h.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config.grid_x_lines.concat(a?a:[]))},h.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},h.ygrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_y_lines=a,b.redrawWithoutRescale(),c.grid_y_lines):c.grid_y_lines},h.ygrids.add=function(a){var b=this.internal;return this.ygrids(b.config.grid_y_lines.concat(a?a:[]))},h.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},h.regions=function(a){var b=this.internal,c=b.config;return a?(c.regions=a,b.redrawWithoutRescale(),c.regions):c.regions},h.regions.add=function(a){var b=this.internal,c=b.config;return a?(c.regions=c.regions.concat(a),b.redrawWithoutRescale(),c.regions):c.regions},h.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f.transition_duration),c=e.getOption(a,"classes",[l.region]),d=e.main.select("."+l.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f.regions=f.regions.filter(function(a){var b=!1;return a["class"]?(a["class"].split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f.regions},h.data=function(a){var b=this.internal.data.targets;return"undefined"==typeof a?b:b.filter(function(b){return[].concat(a).indexOf(b.id)>=0})},h.data.shown=function(a){return this.internal.filterTargetsToShow(this.data(a))},h.data.values=function(a){var b,c=null;return a&&(b=this.data(a),c=b[0]?b[0].values.map(function(a){return a.value}):null),c},h.data.names=function(a){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",a)},h.data.colors=function(a){return this.internal.updateDataAttributes("colors",a)},h.data.axes=function(a){return this.internal.updateDataAttributes("axes",a)},h.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d.axis_x_categories[a]=b,c.redraw()),d.axis_x_categories[a]},h.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c.axis_x_categories=a,b.redraw(),c.axis_x_categories):c.axis_x_categories},h.color=function(a){var b=this.internal;return b.color(a)},h.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.axis=function(){},h.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.axis.setLabelText(c,a[c])}),b.axis.updateLabels())},h.axis.max=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_max=a.x),m(a.y)&&(c.axis_y_max=a.y),m(a.y2)&&(c.axis_y2_max=a.y2)):c.axis_y_max=c.axis_y2_max=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_max,y:c.axis_y_max,y2:c.axis_y2_max}},h.axis.min=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_min=a.x),m(a.y)&&(c.axis_y_min=a.y),m(a.y2)&&(c.axis_y2_min=a.y2)):c.axis_y_min=c.axis_y2_min=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_min,y:c.axis_y_min,y2:c.axis_y2_min}},h.axis.range=function(a){return arguments.length?(q(a.max)&&this.axis.max(a.max),void(q(a.min)&&this.axis.min(a.min))):{max:this.axis.max(),min:this.axis.min()}},h.legend=function(){},h.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.resize=function(a){var b=this.internal,c=b.config;c.size_width=a?a.width:null,c.size_height=a?a.height:null,this.flush()},h.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},h.destroy=function(){var b=this.internal;if(a.clearInterval(b.intervalForObserveInserted),void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),a.detachEvent)a.detachEvent("onresize",b.resizeFunction);else if(a.removeEventListener)a.removeEventListener("resize",b.resizeFunction);else{var c=a.onresize;c&&c.add&&c.remove&&c.remove(b.resizeFunction)}return b.selectChart.classed("c3",!1).html(""),Object.keys(b).forEach(function(a){b[a]=null}),null},h.tooltip=function(){},h.tooltip.show=function(a){var b,c,d=this.internal;a.mouse&&(c=a.mouse),a.data?d.isMultipleX()?(c=[d.x(a.data.x),d.getYScale(a.data.id)(a.data.value)],b=null):b=m(a.data.index)?a.data.index:d.getIndexByX(a.data.x):"undefined"!=typeof a.x?b=d.getIndexByX(a.x):"undefined"!=typeof a.index&&(b=a.index),d.dispatchEvent("mouseover",b,c),d.dispatchEvent("mousemove",b,c),d.config.tooltip_onshow.call(d,a.data)},h.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)};var A;i.isSafari=function(){var b=a.navigator.userAgent;return b.indexOf("Safari")>=0&&b.indexOf("Chrome")<0},i.isChrome=function(){var b=a.navigator.userAgent;return b.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),function(){"SVGPathSeg"in a||(a.SVGPathSeg=function(a,b,c){this.pathSegType=a,this.pathSegTypeAsLetter=b,this._owningPathSegList=c},SVGPathSeg.PATHSEG_UNKNOWN=0,SVGPathSeg.PATHSEG_CLOSEPATH=1,SVGPathSeg.PATHSEG_MOVETO_ABS=2,SVGPathSeg.PATHSEG_MOVETO_REL=3,SVGPathSeg.PATHSEG_LINETO_ABS=4,SVGPathSeg.PATHSEG_LINETO_REL=5,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,SVGPathSeg.PATHSEG_ARC_ABS=10,SVGPathSeg.PATHSEG_ARC_REL=11,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},a.SVGPathSegClosePath=function(a){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",a)},SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(void 0)},a.SVGPathSegMovetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS,"M",a),this._x=b,this._y=c},SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegMovetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",a),this._x=b,this._y=c},SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",a),this._x=b,this._y=c},SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",a),this._x=b,this._y=c},SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcAbs=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcRel=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",a),this._x=b},SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalRel=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",a),this._x=b},SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",a),this._y=b},SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalRel=function(a,b){
2314 c.hasArcType()&&c.expandArc(a),c.toggleFocusLegend(a,!0),c.focusedTargetIds=a,c.defocusedTargetIds=c.defocusedTargetIds.filter(function(b){return a.indexOf(b)<0})},h.defocus=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a.filter(c.isTargetToShow,c))),b.classed(l.focused,!1).classed(l.defocused,!0),c.hasArcType()&&c.unexpandArc(a),c.toggleFocusLegend(a,!1),c.focusedTargetIds=c.focusedTargetIds.filter(function(b){return a.indexOf(b)<0}),c.defocusedTargetIds=a},h.revert=function(a){var b,c=this.internal;a=c.mapToTargetIds(a),b=c.svg.selectAll(c.selectorTargets(a)),b.classed(l.focused,!1).classed(l.defocused,!1),c.hasArcType()&&c.unexpandArc(a),c.config.legend_show&&(c.showLegend(a.filter(c.isLegendToShow.bind(c))),c.legend.selectAll(c.selectorLegends(a)).filter(function(){return c.d3.select(this).classed(l.legendItemFocused)}).classed(l.legendItemFocused,!1)),c.focusedTargetIds=[],c.defocusedTargetIds=[]},h.show=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.removeHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",1,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",1)}),b.withLegend&&d.showLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.hide=function(a,b){var c,d=this.internal;a=d.mapToTargetIds(a),b=b||{},d.addHiddenTargetIds(a),c=d.svg.selectAll(d.selectorTargets(a)),c.transition().style("opacity",0,"important").call(d.endall,function(){c.style("opacity",null).style("opacity",0)}),b.withLegend&&d.hideLegend(a),d.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0})},h.toggle=function(a,b){var c=this,d=this.internal;d.mapToTargetIds(a).forEach(function(a){d.isTargetToShow(a)?c.hide(a,b):c.show(a,b)})},h.zoom=function(a){var b=this.internal;return a&&(b.isTimeSeries()&&(a=a.map(function(a){return b.parseDate(a)})),b.brush.extent(a),b.redraw({withUpdateXDomain:!0,withY:b.config.zoom_rescale}),b.config.zoom_onzoom.call(this,b.x.orgDomain())),b.brush.extent()},h.zoom.enable=function(a){var b=this.internal;b.config.zoom_enabled=a,b.updateAndRedraw()},h.unzoom=function(){var a=this.internal;a.brush.clear().update(),a.redraw({withUpdateXDomain:!0})},h.zoom.max=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_max=d.max([b.orgXDomain[1],a])):c.zoom_x_max},h.zoom.min=function(a){var b=this.internal,c=b.config,d=b.d3;return 0===a||a?void(c.zoom_x_min=d.min([b.orgXDomain[0],a])):c.zoom_x_min},h.zoom.range=function(a){return arguments.length?(q(a.max)&&this.domain.max(a.max),void(q(a.min)&&this.domain.min(a.min))):{max:this.domain.max(),min:this.domain.min()}},h.load=function(a){var b=this.internal,c=b.config;return a.xs&&b.addXs(a.xs),"names"in a&&h.data.names.bind(this)(a.names),"classes"in a&&Object.keys(a.classes).forEach(function(b){c.data_classes[b]=a.classes[b]}),"categories"in a&&b.isCategorized()&&(c.axis_x_categories=a.categories),"axes"in a&&Object.keys(a.axes).forEach(function(b){c.data_axes[b]=a.axes[b]}),"colors"in a&&Object.keys(a.colors).forEach(function(b){c.data_colors[b]=a.colors[b]}),"cacheIds"in a&&b.hasCaches(a.cacheIds)?void b.load(b.getCaches(a.cacheIds),a.done):void("unload"in a?b.unload(b.mapToTargetIds("boolean"==typeof a.unload&&a.unload?null:a.unload),function(){b.loadFromArgs(a)}):b.loadFromArgs(a))},h.unload=function(a){var b=this.internal;a=a||{},a instanceof Array?a={ids:a}:"string"==typeof a&&(a={ids:[a]}),b.unload(b.mapToTargetIds(a.ids),function(){b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0,withLegend:!0}),a.done&&a.done()})},h.flow=function(a){var b,c,d,e,f,g,h,i,j=this.internal,k=[],l=j.getMaxDataCount(),n=0,o=0;if(a.json)c=j.convertJsonToData(a.json,a.keys);else if(a.rows)c=j.convertRowsToData(a.rows);else{if(!a.columns)return;c=j.convertColumnsToData(a.columns)}b=j.convertDataToTargets(c,!0),j.data.targets.forEach(function(a){var c,d,e=!1;for(c=0;c<b.length;c++)if(a.id===b[c].id){for(e=!0,a.values[a.values.length-1]&&(o=a.values[a.values.length-1].index+1),n=b[c].values.length,d=0;n>d;d++)b[c].values[d].index=o+d,j.isTimeSeries()||(b[c].values[d].x=o+d);a.values=a.values.concat(b[c].values),b.splice(c,1);break}e||k.push(a.id)}),j.data.targets.forEach(function(a){var b,c;for(b=0;b<k.length;b++)if(a.id===k[b])for(o=a.values[a.values.length-1].index+1,c=0;n>c;c++)a.values.push({id:a.id,index:o+c,x:j.isTimeSeries()?j.getOtherTargetX(o+c):o+c,value:null})}),j.data.targets.length&&b.forEach(function(a){var b,c=[];for(b=j.data.targets[0].values[0].index;o>b;b++)c.push({id:a.id,index:b,x:j.isTimeSeries()?j.getOtherTargetX(b):b,value:null});a.values.forEach(function(a){a.index+=o,j.isTimeSeries()||(a.x+=o)}),a.values=c.concat(a.values)}),j.data.targets=j.data.targets.concat(b),d=j.getMaxDataCount(),f=j.data.targets[0],g=f.values[0],q(a.to)?(n=0,i=j.isTimeSeries()?j.parseDate(a.to):a.to,f.values.forEach(function(a){a.x<i&&n++})):q(a.length)&&(n=a.length),l?1===l&&j.isTimeSeries()&&(h=(f.values[f.values.length-1].x-g.x)/2,e=[new Date(+g.x-h),new Date(+g.x+h)],j.updateXDomain(null,!0,!0,!1,e)):(h=j.isTimeSeries()?f.values.length>1?f.values[f.values.length-1].x-g.x:g.x-j.getXDomain(j.data.targets)[0]:1,e=[g.x-h,g.x],j.updateXDomain(null,!0,!0,!1,e)),j.updateTargets(j.data.targets),j.redraw({flow:{index:g.index,length:n,duration:m(a.duration)?a.duration:j.config.transition_duration,done:a.done,orgDataCount:l},withLegend:!0,withTransition:l>1,withTrimXDomain:!1,withUpdateXAxis:!0})},i.generateFlow=function(a){var b=this,c=b.config,d=b.d3;return function(){var e,f,g,h=a.targets,i=a.flow,j=a.drawBar,k=a.drawLine,m=a.drawArea,n=a.cx,o=a.cy,p=a.xv,q=a.xForText,r=a.yForText,s=a.duration,u=1,v=i.index,w=i.length,x=b.getValueOnIndex(b.data.targets[0].values,v),y=b.getValueOnIndex(b.data.targets[0].values,v+w),z=b.x.domain(),A=i.duration||s,B=i.done||function(){},C=b.generateWait(),D=b.xgrid||d.selectAll([]),E=b.xgridLines||d.selectAll([]),F=b.mainRegion||d.selectAll([]),G=b.mainText||d.selectAll([]),H=b.mainBar||d.selectAll([]),I=b.mainLine||d.selectAll([]),J=b.mainArea||d.selectAll([]),K=b.mainCircle||d.selectAll([]);b.flowing=!0,b.data.targets.forEach(function(a){a.values.splice(0,w)}),g=b.updateXDomain(h,!0,!0),b.updateXGrid&&b.updateXGrid(!0),i.orgDataCount?e=1===i.orgDataCount||(x&&x.x)===(y&&y.x)?b.x(z[0])-b.x(g[0]):b.isTimeSeries()?b.x(z[0])-b.x(g[0]):b.x(x.x)-b.x(y.x):1!==b.data.targets[0].values.length?e=b.x(z[0])-b.x(g[0]):b.isTimeSeries()?(x=b.getValueOnIndex(b.data.targets[0].values,0),y=b.getValueOnIndex(b.data.targets[0].values,b.data.targets[0].values.length-1),e=b.x(x.x)-b.x(y.x)):e=t(g)/2,u=t(z)/t(g),f="translate("+e+",0) scale("+u+",1)",b.hideXGridFocus(),d.transition().ease("linear").duration(A).each(function(){C.add(b.axes.x.transition().call(b.xAxis)),C.add(H.transition().attr("transform",f)),C.add(I.transition().attr("transform",f)),C.add(J.transition().attr("transform",f)),C.add(K.transition().attr("transform",f)),C.add(G.transition().attr("transform",f)),C.add(F.filter(b.isRegionOnX).transition().attr("transform",f)),C.add(D.transition().attr("transform",f)),C.add(E.transition().attr("transform",f))}).call(C,function(){var a,d=[],e=[],f=[];if(w){for(a=0;w>a;a++)d.push("."+l.shape+"-"+(v+a)),e.push("."+l.text+"-"+(v+a)),f.push("."+l.eventRect+"-"+(v+a));b.svg.selectAll("."+l.shapes).selectAll(d).remove(),b.svg.selectAll("."+l.texts).selectAll(e).remove(),b.svg.selectAll("."+l.eventRects).selectAll(f).remove(),b.svg.select("."+l.xgrid).remove()}D.attr("transform",null).attr(b.xgridAttr),E.attr("transform",null),E.select("line").attr("x1",c.axis_rotated?0:p).attr("x2",c.axis_rotated?b.width:p),E.select("text").attr("x",c.axis_rotated?b.width:0).attr("y",p),H.attr("transform",null).attr("d",j),I.attr("transform",null).attr("d",k),J.attr("transform",null).attr("d",m),K.attr("transform",null).attr("cx",n).attr("cy",o),G.attr("transform",null).attr("x",q).attr("y",r).style("fill-opacity",b.opacityForText.bind(b)),F.attr("transform",null),F.select("rect").filter(b.isRegionOnX).attr("x",b.regionX.bind(b)).attr("width",b.regionWidth.bind(b)),c.interaction_enabled&&b.redrawEventRect(),B(),b.flowing=!1})}},h.selected=function(a){var b=this.internal,c=b.d3;return c.merge(b.main.selectAll("."+l.shapes+b.getTargetSelectorSuffix(a)).selectAll("."+l.shape).filter(function(){return c.select(this).classed(l.SELECTED)}).map(function(a){return a.map(function(a){var b=a.__data__;return b.data?b.data:b})}))},h.select=function(a,b,c){var d=this.internal,e=d.d3,f=d.config;f.data_selection_enabled&&d.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(g,h){var i=e.select(this),j=g.data?g.data.id:g.id,k=d.getToggle(this,g).bind(d),m=f.data_selection_grouped||!a||a.indexOf(j)>=0,n=!b||b.indexOf(h)>=0,o=i.classed(l.SELECTED);i.classed(l.line)||i.classed(l.area)||(m&&n?f.data_selection_isselectable(g)&&!o&&k(!0,i.classed(l.SELECTED,!0),g,h):q(c)&&c&&o&&k(!1,i.classed(l.SELECTED,!1),g,h))})},h.unselect=function(a,b){var c=this.internal,d=c.d3,e=c.config;e.data_selection_enabled&&c.main.selectAll("."+l.shapes).selectAll("."+l.shape).each(function(f,g){var h=d.select(this),i=f.data?f.data.id:f.id,j=c.getToggle(this,f).bind(c),k=e.data_selection_grouped||!a||a.indexOf(i)>=0,m=!b||b.indexOf(g)>=0,n=h.classed(l.SELECTED);h.classed(l.line)||h.classed(l.area)||k&&m&&e.data_selection_isselectable(f)&&n&&j(!1,h.classed(l.SELECTED,!1),f,g)})},h.transform=function(a,b){var c=this.internal,d=["pie","donut"].indexOf(a)>=0?{withTransform:!0}:null;c.transformTo(b,a,d)},i.transformTo=function(a,b,c){var d=this,e=!d.hasArcType(),f=c||{withTransitionForAxis:e};f.withTransitionForTransform=!1,d.transiting=!1,d.setTargetType(a,b),d.updateTargets(d.data.targets),d.updateAndRedraw(f)},h.groups=function(a){var b=this.internal,c=b.config;return p(a)?c.data_groups:(c.data_groups=a,b.redraw(),c.data_groups)},h.xgrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_x_lines=a,b.redrawWithoutRescale(),c.grid_x_lines):c.grid_x_lines},h.xgrids.add=function(a){var b=this.internal;return this.xgrids(b.config.grid_x_lines.concat(a?a:[]))},h.xgrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!0)},h.ygrids=function(a){var b=this.internal,c=b.config;return a?(c.grid_y_lines=a,b.redrawWithoutRescale(),c.grid_y_lines):c.grid_y_lines},h.ygrids.add=function(a){var b=this.internal;return this.ygrids(b.config.grid_y_lines.concat(a?a:[]))},h.ygrids.remove=function(a){var b=this.internal;b.removeGridLines(a,!1)},h.regions=function(a){var b=this.internal,c=b.config;return a?(c.regions=a,b.redrawWithoutRescale(),c.regions):c.regions},h.regions.add=function(a){var b=this.internal,c=b.config;return a?(c.regions=c.regions.concat(a),b.redrawWithoutRescale(),c.regions):c.regions},h.regions.remove=function(a){var b,c,d,e=this.internal,f=e.config;return a=a||{},b=e.getOption(a,"duration",f.transition_duration),c=e.getOption(a,"classes",[l.region]),d=e.main.select("."+l.regions).selectAll(c.map(function(a){return"."+a})),(b?d.transition().duration(b):d).style("opacity",0).remove(),f.regions=f.regions.filter(function(a){var b=!1;return a["class"]?(a["class"].split(" ").forEach(function(a){c.indexOf(a)>=0&&(b=!0)}),!b):!0}),f.regions},h.data=function(a){var b=this.internal.data.targets;return"undefined"==typeof a?b:b.filter(function(b){return[].concat(a).indexOf(b.id)>=0})},h.data.shown=function(a){return this.internal.filterTargetsToShow(this.data(a))},h.data.values=function(a){var b,c=null;return a&&(b=this.data(a),c=b[0]?b[0].values.map(function(a){return a.value}):null),c},h.data.names=function(a){return this.internal.clearLegendItemTextBoxCache(),this.internal.updateDataAttributes("names",a)},h.data.colors=function(a){return this.internal.updateDataAttributes("colors",a)},h.data.axes=function(a){return this.internal.updateDataAttributes("axes",a)},h.category=function(a,b){var c=this.internal,d=c.config;return arguments.length>1&&(d.axis_x_categories[a]=b,c.redraw()),d.axis_x_categories[a]},h.categories=function(a){var b=this.internal,c=b.config;return arguments.length?(c.axis_x_categories=a,b.redraw(),c.axis_x_categories):c.axis_x_categories},h.color=function(a){var b=this.internal;return b.color(a)},h.x=function(a){var b=this.internal;return arguments.length&&(b.updateTargetX(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.xs=function(a){var b=this.internal;return arguments.length&&(b.updateTargetXs(b.data.targets,a),b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})),b.data.xs},h.axis=function(){},h.axis.labels=function(a){var b=this.internal;arguments.length&&(Object.keys(a).forEach(function(c){b.axis.setLabelText(c,a[c])}),b.axis.updateLabels())},h.axis.max=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_max=a.x),m(a.y)&&(c.axis_y_max=a.y),m(a.y2)&&(c.axis_y2_max=a.y2)):c.axis_y_max=c.axis_y2_max=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_max,y:c.axis_y_max,y2:c.axis_y2_max}},h.axis.min=function(a){var b=this.internal,c=b.config;return arguments.length?("object"==typeof a?(m(a.x)&&(c.axis_x_min=a.x),m(a.y)&&(c.axis_y_min=a.y),m(a.y2)&&(c.axis_y2_min=a.y2)):c.axis_y_min=c.axis_y2_min=a,void b.redraw({withUpdateOrgXDomain:!0,withUpdateXDomain:!0})):{x:c.axis_x_min,y:c.axis_y_min,y2:c.axis_y2_min}},h.axis.range=function(a){return arguments.length?(q(a.max)&&this.axis.max(a.max),void(q(a.min)&&this.axis.min(a.min))):{max:this.axis.max(),min:this.axis.min()}},h.legend=function(){},h.legend.show=function(a){var b=this.internal;b.showLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.legend.hide=function(a){var b=this.internal;b.hideLegend(b.mapToTargetIds(a)),b.updateAndRedraw({withLegend:!0})},h.resize=function(a){var b=this.internal,c=b.config;c.size_width=a?a.width:null,c.size_height=a?a.height:null,this.flush()},h.flush=function(){var a=this.internal;a.updateAndRedraw({withLegend:!0,withTransition:!1,withTransitionForTransform:!1})},h.destroy=function(){var b=this.internal;if(a.clearInterval(b.intervalForObserveInserted),void 0!==b.resizeTimeout&&a.clearTimeout(b.resizeTimeout),a.detachEvent)a.detachEvent("onresize",b.resizeFunction);else if(a.removeEventListener)a.removeEventListener("resize",b.resizeFunction);else{var c=a.onresize;c&&c.add&&c.remove&&c.remove(b.resizeFunction)}return b.selectChart.classed("c3",!1).html(""),Object.keys(b).forEach(function(a){b[a]=null}),null},h.tooltip=function(){},h.tooltip.show=function(a){var b,c,d=this.internal;a.mouse&&(c=a.mouse),a.data?d.isMultipleX()?(c=[d.x(a.data.x),d.getYScale(a.data.id)(a.data.value)],b=null):b=m(a.data.index)?a.data.index:d.getIndexByX(a.data.x):"undefined"!=typeof a.x?b=d.getIndexByX(a.x):"undefined"!=typeof a.index&&(b=a.index),d.dispatchEvent("mouseover",b,c),d.dispatchEvent("mousemove",b,c),d.config.tooltip_onshow.call(d,a.data)},h.tooltip.hide=function(){this.internal.dispatchEvent("mouseout",0),this.internal.config.tooltip_onhide.call(this)};var A;i.isSafari=function(){var b=a.navigator.userAgent;return b.indexOf("Safari")>=0&&b.indexOf("Chrome")<0},i.isChrome=function(){var b=a.navigator.userAgent;return b.indexOf("Chrome")>=0},Function.prototype.bind||(Function.prototype.bind=function(a){if("function"!=typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var b=Array.prototype.slice.call(arguments,1),c=this,d=function(){},e=function(){return c.apply(this instanceof d?this:a,b.concat(Array.prototype.slice.call(arguments)))};return d.prototype=this.prototype,e.prototype=new d,e}),function(){"SVGPathSeg"in a||(a.SVGPathSeg=function(a,b,c){this.pathSegType=a,this.pathSegTypeAsLetter=b,this._owningPathSegList=c},SVGPathSeg.PATHSEG_UNKNOWN=0,SVGPathSeg.PATHSEG_CLOSEPATH=1,SVGPathSeg.PATHSEG_MOVETO_ABS=2,SVGPathSeg.PATHSEG_MOVETO_REL=3,SVGPathSeg.PATHSEG_LINETO_ABS=4,SVGPathSeg.PATHSEG_LINETO_REL=5,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS=6,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL=7,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS=8,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL=9,SVGPathSeg.PATHSEG_ARC_ABS=10,SVGPathSeg.PATHSEG_ARC_REL=11,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS=12,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL=13,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS=14,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL=15,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS=16,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL=17,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS=18,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL=19,SVGPathSeg.prototype._segmentChanged=function(){this._owningPathSegList&&this._owningPathSegList.segmentChanged(this)},a.SVGPathSegClosePath=function(a){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CLOSEPATH,"z",a)},SVGPathSegClosePath.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegClosePath.prototype.toString=function(){return"[object SVGPathSegClosePath]"},SVGPathSegClosePath.prototype._asPathString=function(){return this.pathSegTypeAsLetter},SVGPathSegClosePath.prototype.clone=function(){return new SVGPathSegClosePath(void 0)},a.SVGPathSegMovetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_ABS,"M",a),this._x=b,this._y=c},SVGPathSegMovetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoAbs.prototype.toString=function(){return"[object SVGPathSegMovetoAbs]"},SVGPathSegMovetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoAbs.prototype.clone=function(){return new SVGPathSegMovetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegMovetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_MOVETO_REL,"m",a),this._x=b,this._y=c},SVGPathSegMovetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegMovetoRel.prototype.toString=function(){return"[object SVGPathSegMovetoRel]"},SVGPathSegMovetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegMovetoRel.prototype.clone=function(){return new SVGPathSegMovetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegMovetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegMovetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_ABS,"L",a),this._x=b,this._y=c},SVGPathSegLinetoAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoAbs.prototype.toString=function(){return"[object SVGPathSegLinetoAbs]"},SVGPathSegLinetoAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoAbs.prototype.clone=function(){return new SVGPathSegLinetoAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_REL,"l",a),this._x=b,this._y=c},SVGPathSegLinetoRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoRel.prototype.toString=function(){return"[object SVGPathSegLinetoRel]"},SVGPathSegLinetoRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegLinetoRel.prototype.clone=function(){return new SVGPathSegLinetoRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegLinetoRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegLinetoRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS,"C",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicAbs]"},SVGPathSegCurvetoCubicAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicAbs(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f,g){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL,"c",a),this._x=b,this._y=c,this._x1=d,this._y1=e,this._x2=f,this._y2=g},SVGPathSegCurvetoCubicRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicRel]"},SVGPathSegCurvetoCubicRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicRel(void 0,this._x,this._y,this._x1,this._y1,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS,"Q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticAbs]"},SVGPathSegCurvetoQuadraticAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticAbs(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticAbs.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL,"q",a),this._x=b,this._y=c,this._x1=d,this._y1=e},SVGPathSegCurvetoQuadraticRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticRel]"},SVGPathSegCurvetoQuadraticRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x1+" "+this._y1+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticRel(void 0,this._x,this._y,this._x1,this._y1)},Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"x1",{get:function(){return this._x1},set:function(a){this._x1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticRel.prototype,"y1",{get:function(){return this._y1},set:function(a){this._y1=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcAbs=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_ABS,"A",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcAbs.prototype.toString=function(){return"[object SVGPathSegArcAbs]"},SVGPathSegArcAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcAbs.prototype.clone=function(){return new SVGPathSegArcAbs(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcAbs.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegArcRel=function(a,b,c,d,e,f,g,h){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_ARC_REL,"a",a),this._x=b,this._y=c,this._r1=d,this._r2=e,this._angle=f,this._largeArcFlag=g,this._sweepFlag=h},SVGPathSegArcRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegArcRel.prototype.toString=function(){return"[object SVGPathSegArcRel]"},SVGPathSegArcRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._r1+" "+this._r2+" "+this._angle+" "+(this._largeArcFlag?"1":"0")+" "+(this._sweepFlag?"1":"0")+" "+this._x+" "+this._y},SVGPathSegArcRel.prototype.clone=function(){return new SVGPathSegArcRel(void 0,this._x,this._y,this._r1,this._r2,this._angle,this._largeArcFlag,this._sweepFlag)},Object.defineProperty(SVGPathSegArcRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r1",{get:function(){return this._r1},set:function(a){this._r1=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"r2",{get:function(){return this._r2},set:function(a){this._r2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"angle",{get:function(){return this._angle},set:function(a){this._angle=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"largeArcFlag",{get:function(){return this._largeArcFlag},set:function(a){this._largeArcFlag=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegArcRel.prototype,"sweepFlag",{get:function(){return this._sweepFlag},set:function(a){this._sweepFlag=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS,"H",a),this._x=b},SVGPathSegLinetoHorizontalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalAbs]"},SVGPathSegLinetoHorizontalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalAbs.prototype.clone=function(){return new SVGPathSegLinetoHorizontalAbs(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoHorizontalRel=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL,"h",a),this._x=b},SVGPathSegLinetoHorizontalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoHorizontalRel.prototype.toString=function(){return"[object SVGPathSegLinetoHorizontalRel]"},SVGPathSegLinetoHorizontalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x},SVGPathSegLinetoHorizontalRel.prototype.clone=function(){return new SVGPathSegLinetoHorizontalRel(void 0,this._x)},Object.defineProperty(SVGPathSegLinetoHorizontalRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalAbs=function(a,b){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS,"V",a),this._y=b},SVGPathSegLinetoVerticalAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalAbs.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalAbs]"},SVGPathSegLinetoVerticalAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalAbs.prototype.clone=function(){return new SVGPathSegLinetoVerticalAbs(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegLinetoVerticalRel=function(a,b){
2315 SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",a),this._y=b},SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(a,b){return new SVGPathSegMovetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(a,b){return new SVGPathSegMovetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(a,b){return new SVGPathSegLinetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(a,b){return new SVGPathSegLinetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicAbs(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicRel(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(a,b,c,d,e,f,g){return new SVGPathSegArcAbs(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegArcRel=function(a,b,c,d,e,f,g){return new SVGPathSegArcRel(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(a){return new SVGPathSegLinetoHorizontalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(a){return new SVGPathSegLinetoHorizontalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(a){return new SVGPathSegLinetoVerticalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(a){return new SVGPathSegLinetoVerticalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,a,b)}),"SVGPathSegList"in a||(a.SVGPathSegList=function(a){this._pathElement=a,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},SVGPathSegList.prototype._updateListFromPathMutations=function(a){if(this._pathElement){var b=!1;a.forEach(function(a){"d"==a.attributeName&&(b=!0)}),b&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},SVGPathSegList.prototype.segmentChanged=function(a){this._writeListToPath()},SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(a){a._owningPathSegList=null}),this._list=[],this._writeListToPath()},SVGPathSegList.prototype.initialize=function(a){return this._checkPathSynchronizedToList(),this._list=[a],a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype._checkValidIndex=function(a){if(isNaN(a)||0>a||a>=this.numberOfItems)throw"INDEX_SIZE_ERR"},SVGPathSegList.prototype.getItem=function(a){return this._checkPathSynchronizedToList(),this._checkValidIndex(a),this._list[a]},SVGPathSegList.prototype.insertItemBefore=function(a,b){return this._checkPathSynchronizedToList(),b>this.numberOfItems&&(b=this.numberOfItems),a._owningPathSegList&&(a=a.clone()),this._list.splice(b,0,a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.replaceItem=function(a,b){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._checkValidIndex(b),this._list[b]=a,a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.removeItem=function(a){this._checkPathSynchronizedToList(),this._checkValidIndex(a);var b=this._list[a];return this._list.splice(a,1),this._writeListToPath(),b},SVGPathSegList.prototype.appendItem=function(a){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._list.push(a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList._pathSegArrayAsString=function(a){var b="",c=!0;return a.forEach(function(a){c?(c=!1,b+=a._asPathString()):b+=" "+a._asPathString()}),b},SVGPathSegList.prototype._parsePath=function(a){if(!a||0==a.length)return[];var b=this,c=function(){this.pathSegList=[]};c.prototype.appendSegment=function(a){this.pathSegList.push(a)};var d=function(a){this._string=a,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};d.prototype._isCurrentSpace=function(){var a=this._string[this._currentIndex];return" ">=a&&(" "==a||"\n"==a||" "==a||"\r"==a||"\f"==a)},d.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},d.prototype._skipOptionalSpacesOrDelimiter=function(){return this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex)?!1:(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},d.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},d.prototype.peekSegmentType=function(){var a=this._string[this._currentIndex];return this._pathSegTypeFromChar(a)},d.prototype._pathSegTypeFromChar=function(a){switch(a){case"Z":case"z":return SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return SVGPathSeg.PATHSEG_LINETO_REL;case"C":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return SVGPathSeg.PATHSEG_ARC_ABS;case"a":return SVGPathSeg.PATHSEG_ARC_REL;case"H":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return SVGPathSeg.PATHSEG_UNKNOWN}},d.prototype._nextCommandHelper=function(a,b){return("+"==a||"-"==a||"."==a||a>="0"&&"9">=a)&&b!=SVGPathSeg.PATHSEG_CLOSEPATH?b==SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:b==SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:b:SVGPathSeg.PATHSEG_UNKNOWN},d.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var a=this.peekSegmentType();return a==SVGPathSeg.PATHSEG_MOVETO_ABS||a==SVGPathSeg.PATHSEG_MOVETO_REL},d.prototype._parseNumber=function(){var a=0,b=0,c=1,d=0,e=1,f=1,g=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,e=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var h=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=h)for(var i=this._currentIndex-1,j=1;i>=h;)b+=j*(this._string.charAt(i--)-"0"),j*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)d+=(this._string.charAt(this._currentIndex++)-"0")*(c*=.1)}if(this._currentIndex!=g&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,f=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)a*=10,a+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var k=b+d;if(k*=e,a&&(k*=Math.pow(10,f*a)),g!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),k}},d.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var a=!1,b=this._string.charAt(this._currentIndex++);if("0"==b)a=!1;else{if("1"!=b)return;a=!0}return this._skipOptionalSpacesOrDelimiter(),a}},d.prototype.parseSegment=function(){var a=this._string[this._currentIndex],c=this._pathSegTypeFromChar(a);if(c==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;if(c=this._nextCommandHelper(a,this._previousCommand),c==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=c,c){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(b);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);default:throw"Unknown path seg type."}};var e=new c,f=new d(a);if(!f.initialCommandIsMoveTo())return[];for(;f.hasMoreData();){var g=f.parseSegment();if(!g)return[];e.appendSegment(g)}return e.pathSegList})}(),"function"==typeof define&&define.amd?define("c3",["d3"],function(){return k}):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=k:a.c3=k}(window);
2315 SVGPathSeg.call(this,SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL,"v",a),this._y=b},SVGPathSegLinetoVerticalRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegLinetoVerticalRel.prototype.toString=function(){return"[object SVGPathSegLinetoVerticalRel]"},SVGPathSegLinetoVerticalRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._y},SVGPathSegLinetoVerticalRel.prototype.clone=function(){return new SVGPathSegLinetoVerticalRel(void 0,this._y)},Object.defineProperty(SVGPathSegLinetoVerticalRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS,"S",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothAbs]"},SVGPathSegCurvetoCubicSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothAbs.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d,e){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL,"s",a),this._x=b,this._y=c,this._x2=d,this._y2=e},SVGPathSegCurvetoCubicSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoCubicSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoCubicSmoothRel]"},SVGPathSegCurvetoCubicSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x2+" "+this._y2+" "+this._x+" "+this._y},SVGPathSegCurvetoCubicSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoCubicSmoothRel(void 0,this._x,this._y,this._x2,this._y2)},Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"x2",{get:function(){return this._x2},set:function(a){this._x2=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoCubicSmoothRel.prototype,"y2",{get:function(){return this._y2},set:function(a){this._y2=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothAbs=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS,"T",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothAbs.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothAbs.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothAbs]"},SVGPathSegCurvetoQuadraticSmoothAbs.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothAbs.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothAbs.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),a.SVGPathSegCurvetoQuadraticSmoothRel=function(a,b,c){SVGPathSeg.call(this,SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL,"t",a),this._x=b,this._y=c},SVGPathSegCurvetoQuadraticSmoothRel.prototype=Object.create(SVGPathSeg.prototype),SVGPathSegCurvetoQuadraticSmoothRel.prototype.toString=function(){return"[object SVGPathSegCurvetoQuadraticSmoothRel]"},SVGPathSegCurvetoQuadraticSmoothRel.prototype._asPathString=function(){return this.pathSegTypeAsLetter+" "+this._x+" "+this._y},SVGPathSegCurvetoQuadraticSmoothRel.prototype.clone=function(){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,this._x,this._y)},Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"x",{get:function(){return this._x},set:function(a){this._x=a,this._segmentChanged()},enumerable:!0}),Object.defineProperty(SVGPathSegCurvetoQuadraticSmoothRel.prototype,"y",{get:function(){return this._y},set:function(a){this._y=a,this._segmentChanged()},enumerable:!0}),SVGPathElement.prototype.createSVGPathSegClosePath=function(){return new SVGPathSegClosePath(void 0)},SVGPathElement.prototype.createSVGPathSegMovetoAbs=function(a,b){return new SVGPathSegMovetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegMovetoRel=function(a,b){return new SVGPathSegMovetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoAbs=function(a,b){return new SVGPathSegLinetoAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegLinetoRel=function(a,b){return new SVGPathSegLinetoRel(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicAbs=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicAbs(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicRel=function(a,b,c,d,e,f){return new SVGPathSegCurvetoCubicRel(void 0,a,b,c,d,e,f)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticAbs=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticRel=function(a,b,c,d){return new SVGPathSegCurvetoQuadraticRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegArcAbs=function(a,b,c,d,e,f,g){return new SVGPathSegArcAbs(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegArcRel=function(a,b,c,d,e,f,g){return new SVGPathSegArcRel(void 0,a,b,c,d,e,f,g)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalAbs=function(a){return new SVGPathSegLinetoHorizontalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoHorizontalRel=function(a){return new SVGPathSegLinetoHorizontalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalAbs=function(a){return new SVGPathSegLinetoVerticalAbs(void 0,a)},SVGPathElement.prototype.createSVGPathSegLinetoVerticalRel=function(a){return new SVGPathSegLinetoVerticalRel(void 0,a)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothAbs=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothAbs(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoCubicSmoothRel=function(a,b,c,d){return new SVGPathSegCurvetoCubicSmoothRel(void 0,a,b,c,d)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothAbs=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothAbs(void 0,a,b)},SVGPathElement.prototype.createSVGPathSegCurvetoQuadraticSmoothRel=function(a,b){return new SVGPathSegCurvetoQuadraticSmoothRel(void 0,a,b)}),"SVGPathSegList"in a||(a.SVGPathSegList=function(a){this._pathElement=a,this._list=this._parsePath(this._pathElement.getAttribute("d")),this._mutationObserverConfig={attributes:!0,attributeFilter:["d"]},this._pathElementMutationObserver=new MutationObserver(this._updateListFromPathMutations.bind(this)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},Object.defineProperty(SVGPathSegList.prototype,"numberOfItems",{get:function(){return this._checkPathSynchronizedToList(),this._list.length},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"pathSegList",{get:function(){return this._pathSegList||(this._pathSegList=new SVGPathSegList(this)),this._pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"normalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),Object.defineProperty(SVGPathElement.prototype,"animatedNormalizedPathSegList",{get:function(){return this.pathSegList},enumerable:!0}),SVGPathSegList.prototype._checkPathSynchronizedToList=function(){this._updateListFromPathMutations(this._pathElementMutationObserver.takeRecords())},SVGPathSegList.prototype._updateListFromPathMutations=function(a){if(this._pathElement){var b=!1;a.forEach(function(a){"d"==a.attributeName&&(b=!0)}),b&&(this._list=this._parsePath(this._pathElement.getAttribute("d")))}},SVGPathSegList.prototype._writeListToPath=function(){this._pathElementMutationObserver.disconnect(),this._pathElement.setAttribute("d",SVGPathSegList._pathSegArrayAsString(this._list)),this._pathElementMutationObserver.observe(this._pathElement,this._mutationObserverConfig)},SVGPathSegList.prototype.segmentChanged=function(a){this._writeListToPath()},SVGPathSegList.prototype.clear=function(){this._checkPathSynchronizedToList(),this._list.forEach(function(a){a._owningPathSegList=null}),this._list=[],this._writeListToPath()},SVGPathSegList.prototype.initialize=function(a){return this._checkPathSynchronizedToList(),this._list=[a],a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype._checkValidIndex=function(a){if(isNaN(a)||0>a||a>=this.numberOfItems)throw"INDEX_SIZE_ERR"},SVGPathSegList.prototype.getItem=function(a){return this._checkPathSynchronizedToList(),this._checkValidIndex(a),this._list[a]},SVGPathSegList.prototype.insertItemBefore=function(a,b){return this._checkPathSynchronizedToList(),b>this.numberOfItems&&(b=this.numberOfItems),a._owningPathSegList&&(a=a.clone()),this._list.splice(b,0,a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.replaceItem=function(a,b){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._checkValidIndex(b),this._list[b]=a,a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList.prototype.removeItem=function(a){this._checkPathSynchronizedToList(),this._checkValidIndex(a);var b=this._list[a];return this._list.splice(a,1),this._writeListToPath(),b},SVGPathSegList.prototype.appendItem=function(a){return this._checkPathSynchronizedToList(),a._owningPathSegList&&(a=a.clone()),this._list.push(a),a._owningPathSegList=this,this._writeListToPath(),a},SVGPathSegList._pathSegArrayAsString=function(a){var b="",c=!0;return a.forEach(function(a){c?(c=!1,b+=a._asPathString()):b+=" "+a._asPathString()}),b},SVGPathSegList.prototype._parsePath=function(a){if(!a||0==a.length)return[];var b=this,c=function(){this.pathSegList=[]};c.prototype.appendSegment=function(a){this.pathSegList.push(a)};var d=function(a){this._string=a,this._currentIndex=0,this._endIndex=this._string.length,this._previousCommand=SVGPathSeg.PATHSEG_UNKNOWN,this._skipOptionalSpaces()};d.prototype._isCurrentSpace=function(){var a=this._string[this._currentIndex];return" ">=a&&(" "==a||"\n"==a||" "==a||"\r"==a||"\f"==a)},d.prototype._skipOptionalSpaces=function(){for(;this._currentIndex<this._endIndex&&this._isCurrentSpace();)this._currentIndex++;return this._currentIndex<this._endIndex},d.prototype._skipOptionalSpacesOrDelimiter=function(){return this._currentIndex<this._endIndex&&!this._isCurrentSpace()&&","!=this._string.charAt(this._currentIndex)?!1:(this._skipOptionalSpaces()&&this._currentIndex<this._endIndex&&","==this._string.charAt(this._currentIndex)&&(this._currentIndex++,this._skipOptionalSpaces()),this._currentIndex<this._endIndex)},d.prototype.hasMoreData=function(){return this._currentIndex<this._endIndex},d.prototype.peekSegmentType=function(){var a=this._string[this._currentIndex];return this._pathSegTypeFromChar(a)},d.prototype._pathSegTypeFromChar=function(a){switch(a){case"Z":case"z":return SVGPathSeg.PATHSEG_CLOSEPATH;case"M":return SVGPathSeg.PATHSEG_MOVETO_ABS;case"m":return SVGPathSeg.PATHSEG_MOVETO_REL;case"L":return SVGPathSeg.PATHSEG_LINETO_ABS;case"l":return SVGPathSeg.PATHSEG_LINETO_REL;case"C":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS;case"c":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL;case"Q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS;case"q":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL;case"A":return SVGPathSeg.PATHSEG_ARC_ABS;case"a":return SVGPathSeg.PATHSEG_ARC_REL;case"H":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS;case"h":return SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL;case"V":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS;case"v":return SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL;case"S":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS;case"s":return SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL;case"T":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS;case"t":return SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL;default:return SVGPathSeg.PATHSEG_UNKNOWN}},d.prototype._nextCommandHelper=function(a,b){return("+"==a||"-"==a||"."==a||a>="0"&&"9">=a)&&b!=SVGPathSeg.PATHSEG_CLOSEPATH?b==SVGPathSeg.PATHSEG_MOVETO_ABS?SVGPathSeg.PATHSEG_LINETO_ABS:b==SVGPathSeg.PATHSEG_MOVETO_REL?SVGPathSeg.PATHSEG_LINETO_REL:b:SVGPathSeg.PATHSEG_UNKNOWN},d.prototype.initialCommandIsMoveTo=function(){if(!this.hasMoreData())return!0;var a=this.peekSegmentType();return a==SVGPathSeg.PATHSEG_MOVETO_ABS||a==SVGPathSeg.PATHSEG_MOVETO_REL},d.prototype._parseNumber=function(){var a=0,b=0,c=1,d=0,e=1,f=1,g=this._currentIndex;if(this._skipOptionalSpaces(),this._currentIndex<this._endIndex&&"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:this._currentIndex<this._endIndex&&"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,e=-1),!(this._currentIndex==this._endIndex||(this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")&&"."!=this._string.charAt(this._currentIndex))){for(var h=this._currentIndex;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)this._currentIndex++;if(this._currentIndex!=h)for(var i=this._currentIndex-1,j=1;i>=h;)b+=j*(this._string.charAt(i--)-"0"),j*=10;if(this._currentIndex<this._endIndex&&"."==this._string.charAt(this._currentIndex)){if(this._currentIndex++,this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)d+=(this._string.charAt(this._currentIndex++)-"0")*(c*=.1)}if(this._currentIndex!=g&&this._currentIndex+1<this._endIndex&&("e"==this._string.charAt(this._currentIndex)||"E"==this._string.charAt(this._currentIndex))&&"x"!=this._string.charAt(this._currentIndex+1)&&"m"!=this._string.charAt(this._currentIndex+1)){if(this._currentIndex++,"+"==this._string.charAt(this._currentIndex)?this._currentIndex++:"-"==this._string.charAt(this._currentIndex)&&(this._currentIndex++,f=-1),this._currentIndex>=this._endIndex||this._string.charAt(this._currentIndex)<"0"||this._string.charAt(this._currentIndex)>"9")return;for(;this._currentIndex<this._endIndex&&this._string.charAt(this._currentIndex)>="0"&&this._string.charAt(this._currentIndex)<="9";)a*=10,a+=this._string.charAt(this._currentIndex)-"0",this._currentIndex++}var k=b+d;if(k*=e,a&&(k*=Math.pow(10,f*a)),g!=this._currentIndex)return this._skipOptionalSpacesOrDelimiter(),k}},d.prototype._parseArcFlag=function(){if(!(this._currentIndex>=this._endIndex)){var a=!1,b=this._string.charAt(this._currentIndex++);if("0"==b)a=!1;else{if("1"!=b)return;a=!0}return this._skipOptionalSpacesOrDelimiter(),a}},d.prototype.parseSegment=function(){var a=this._string[this._currentIndex],c=this._pathSegTypeFromChar(a);if(c==SVGPathSeg.PATHSEG_UNKNOWN){if(this._previousCommand==SVGPathSeg.PATHSEG_UNKNOWN)return null;if(c=this._nextCommandHelper(a,this._previousCommand),c==SVGPathSeg.PATHSEG_UNKNOWN)return null}else this._currentIndex++;switch(this._previousCommand=c,c){case SVGPathSeg.PATHSEG_MOVETO_REL:return new SVGPathSegMovetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_MOVETO_ABS:return new SVGPathSegMovetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_REL:return new SVGPathSegLinetoRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_ABS:return new SVGPathSegLinetoAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_REL:return new SVGPathSegLinetoHorizontalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_HORIZONTAL_ABS:return new SVGPathSegLinetoHorizontalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_REL:return new SVGPathSegLinetoVerticalRel(b,this._parseNumber());case SVGPathSeg.PATHSEG_LINETO_VERTICAL_ABS:return new SVGPathSegLinetoVerticalAbs(b,this._parseNumber());case SVGPathSeg.PATHSEG_CLOSEPATH:return this._skipOptionalSpaces(),new SVGPathSegClosePath(b);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicRel(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicAbs(b,d.x,d.y,d.x1,d.y1,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_REL:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothRel(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:var d={x2:this._parseNumber(),y2:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoCubicSmoothAbs(b,d.x,d.y,d.x2,d.y2);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticRel(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegCurvetoQuadraticAbs(b,d.x,d.y,d.x1,d.y1);case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL:return new SVGPathSegCurvetoQuadraticSmoothRel(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS:return new SVGPathSegCurvetoQuadraticSmoothAbs(b,this._parseNumber(),this._parseNumber());case SVGPathSeg.PATHSEG_ARC_REL:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcRel(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);case SVGPathSeg.PATHSEG_ARC_ABS:var d={x1:this._parseNumber(),y1:this._parseNumber(),arcAngle:this._parseNumber(),arcLarge:this._parseArcFlag(),arcSweep:this._parseArcFlag(),x:this._parseNumber(),y:this._parseNumber()};return new SVGPathSegArcAbs(b,d.x,d.y,d.x1,d.y1,d.arcAngle,d.arcLarge,d.arcSweep);default:throw"Unknown path seg type."}};var e=new c,f=new d(a);if(!f.initialCommandIsMoveTo())return[];for(;f.hasMoreData();){var g=f.parseSegment();if(!g)return[];e.appendSegment(g)}return e.pathSegList})}(),"function"==typeof define&&define.amd?define("c3",["d3"],function(){return k}):"undefined"!=typeof exports&&"undefined"!=typeof module?module.exports=k:a.c3=k}(window);
2316 ;/**
2316 ;/**
2317 * @version 2.1.8
2317 * @version 2.1.8
2318 * @license MIT
2318 * @license MIT
2319 */
2319 */
2320 !function(t,e){"use strict";t.module("smart-table",[]).run(["$templateCache",function(t){t.put("template/smart-table/pagination.html",'<nav ng-if="numPages && pages.length >= 2"><ul class="pagination"><li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a href="javascript: void(0);" ng-click="selectPage(page)">{{page}}</a></li></ul></nav>')}]),t.module("smart-table").constant("stConfig",{pagination:{template:"template/smart-table/pagination.html",itemsByPage:10,displayedPages:5},search:{delay:400,inputEvent:"input"},select:{mode:"single",selectedClass:"st-selected"},sort:{ascentClass:"st-sort-ascent",descentClass:"st-sort-descent",descendingFirst:!1,skipNatural:!1,delay:300},pipe:{delay:100}}),t.module("smart-table").controller("stTableController",["$scope","$parse","$filter","$attrs",function(a,n,s,i){function r(t){return t?[].concat(t):[]}function l(){b=r(o(a)),v===!0&&S.pipe()}function c(t,e){if(-1!=e.indexOf(".")){var a=e.split("."),s=a.pop(),i=a.join("."),r=n(i)(t);delete r[s],0==Object.keys(r).length&&c(t,i)}else delete t[e]}var o,u,p,g=i.stTable,d=n(g),f=d.assign,m=s("orderBy"),h=s("filter"),b=r(d(a)),P={sort:{},search:{},pagination:{start:0,totalItemCount:0}},v=!0,S=this;i.stSafeSrc&&(o=n(i.stSafeSrc),a.$watch(function(){var t=o(a);return t&&t.length?t[0]:e},function(t,e){t!==e&&l()}),a.$watch(function(){var t=o(a);return t?t.length:0},function(t){t!==b.length&&l()}),a.$watch(function(){return o(a)},function(t,e){t!==e&&(P.pagination.start=0,l())})),this.sortBy=function(e,a){return P.sort.predicate=e,P.sort.reverse=a===!0,t.isFunction(e)?P.sort.functionName=e.name:delete P.sort.functionName,P.pagination.start=0,this.pipe()},this.search=function(e,a){var s=P.search.predicateObject||{},i=a?a:"$";return e=t.isString(e)?e.trim():e,n(i).assign(s,e),e||c(s,i),P.search.predicateObject=s,P.pagination.start=0,this.pipe()},this.pipe=function(){var t,n=P.pagination;u=P.search.predicateObject?h(b,P.search.predicateObject):b,P.sort.predicate&&(u=m(u,P.sort.predicate,P.sort.reverse)),n.totalItemCount=u.length,n.number!==e&&(n.numberOfPages=u.length>0?Math.ceil(u.length/n.number):1,n.start=n.start>=u.length?(n.numberOfPages-1)*n.number:n.start,t=u.slice(n.start,n.start+parseInt(n.number))),f(a,t||u)},this.select=function(t,n){var s=r(d(a)),i=s.indexOf(t);-1!==i&&("single"===n?(t.isSelected=t.isSelected!==!0,p&&(p.isSelected=!1),p=t.isSelected===!0?t:e):s[i].isSelected=!s[i].isSelected)},this.slice=function(t,e){return P.pagination.start=t,P.pagination.number=e,this.pipe()},this.tableState=function(){return P},this.getFilteredCollection=function(){return u||b},this.setFilterFunction=function(t){h=s(t)},this.setSortFunction=function(t){m=s(t)},this.preventPipeOnWatch=function(){v=!1}}]).directive("stTable",function(){return{restrict:"A",controller:"stTableController",link:function(t,e,a,n){a.stSetFilter&&n.setFilterFunction(a.stSetFilter),a.stSetSort&&n.setSortFunction(a.stSetSort)}}}),t.module("smart-table").directive("stSearch",["stConfig","$timeout","$parse",function(t,e,a){return{require:"^stTable",link:function(n,s,i,r){var l=r,c=null,o=i.stDelay||t.search.delay,u=i.stInputEvent||t.search.inputEvent;i.$observe("stSearch",function(t,e){var a=s[0].value;t!==e&&a&&(r.tableState().search={},l.search(a,t))}),n.$watch(function(){return r.tableState().search},function(t){var e=i.stSearch||"$";t.predicateObject&&a(e)(t.predicateObject)!==s[0].value&&(s[0].value=a(e)(t.predicateObject)||"")},!0),s.bind(u,function(t){t=t.originalEvent||t,null!==c&&e.cancel(c),c=e(function(){l.search(t.target.value,i.stSearch||""),c=null},o)})}}}]),t.module("smart-table").directive("stSelectRow",["stConfig",function(t){return{restrict:"A",require:"^stTable",scope:{row:"=stSelectRow"},link:function(e,a,n,s){var i=n.stSelectMode||t.select.mode;a.bind("click",function(){e.$apply(function(){s.select(e.row,i)})}),e.$watch("row.isSelected",function(e){e===!0?a.addClass(t.select.selectedClass):a.removeClass(t.select.selectedClass)})}}}]),t.module("smart-table").directive("stSort",["stConfig","$parse","$timeout",function(a,n,s){return{restrict:"A",require:"^stTable",link:function(i,r,l,c){function o(){P?d=0===d?2:d-1:d++;var e;p=t.isFunction(g(i))||t.isArray(g(i))?g(i):l.stSort,d%3===0&&!!b!=!0?(d=0,c.tableState().sort={},c.tableState().pagination.start=0,e=c.pipe.bind(c)):e=c.sortBy.bind(c,p,d%2===0),null!==v&&s.cancel(v),0>S?e():v=s(e,S)}var u,p=l.stSort,g=n(p),d=0,f=l.stClassAscent||a.sort.ascentClass,m=l.stClassDescent||a.sort.descentClass,h=[f,m],b=l.stSkipNatural!==e?l.stSkipNatural:a.sort.skipNatural,P=l.stDescendingFirst!==e?l.stDescendingFirst:a.sort.descendingFirst,v=null,S=l.stDelay||a.sort.delay;l.stSortDefault&&(u=i.$eval(l.stSortDefault)!==e?i.$eval(l.stSortDefault):l.stSortDefault),r.bind("click",function(){p&&i.$apply(o)}),u&&(d="reverse"===u?1:0,o()),i.$watch(function(){return c.tableState().sort},function(t){t.predicate!==p?(d=0,r.removeClass(f).removeClass(m)):(d=t.reverse===!0?2:1,r.removeClass(h[d%2]).addClass(h[d-1]))},!0)}}}]),t.module("smart-table").directive("stPagination",["stConfig",function(t){return{restrict:"EA",require:"^stTable",scope:{stItemsByPage:"=?",stDisplayedPages:"=?",stPageChange:"&"},templateUrl:function(e,a){return a.stTemplate?a.stTemplate:t.pagination.template},link:function(e,a,n,s){function i(){var t,a,n=s.tableState().pagination,i=1,r=e.currentPage;for(e.totalItemCount=n.totalItemCount,e.currentPage=Math.floor(n.start/n.number)+1,i=Math.max(i,e.currentPage-Math.abs(Math.floor(e.stDisplayedPages/2))),t=i+e.stDisplayedPages,t>n.numberOfPages&&(t=n.numberOfPages+1,i=Math.max(1,t-e.stDisplayedPages)),e.pages=[],e.numPages=n.numberOfPages,a=i;t>a;a++)e.pages.push(a);r!==e.currentPage&&e.stPageChange({newPage:e.currentPage})}e.stItemsByPage=e.stItemsByPage?+e.stItemsByPage:t.pagination.itemsByPage,e.stDisplayedPages=e.stDisplayedPages?+e.stDisplayedPages:t.pagination.displayedPages,e.currentPage=1,e.pages=[],e.$watch(function(){return s.tableState().pagination},i,!0),e.$watch("stItemsByPage",function(t,a){t!==a&&e.selectPage(1)}),e.$watch("stDisplayedPages",i),e.selectPage=function(t){t>0&&t<=e.numPages&&s.slice((t-1)*e.stItemsByPage,e.stItemsByPage)},s.tableState().pagination.number||s.slice(0,e.stItemsByPage)}}}]),t.module("smart-table").directive("stPipe",["stConfig","$timeout",function(e,a){return{require:"stTable",scope:{stPipe:"="},link:{pre:function(n,s,i,r){var l=null;t.isFunction(n.stPipe)&&(r.preventPipeOnWatch(),r.pipe=function(){return null!==l&&a.cancel(l),l=a(function(){n.stPipe(r.tableState(),r)},e.pipe.delay)})},post:function(t,e,a,n){n.pipe()}}}}])}(angular);
2320 !function(t,e){"use strict";t.module("smart-table",[]).run(["$templateCache",function(t){t.put("template/smart-table/pagination.html",'<nav ng-if="numPages && pages.length >= 2"><ul class="pagination"><li ng-repeat="page in pages" ng-class="{active: page==currentPage}"><a href="javascript: void(0);" ng-click="selectPage(page)">{{page}}</a></li></ul></nav>')}]),t.module("smart-table").constant("stConfig",{pagination:{template:"template/smart-table/pagination.html",itemsByPage:10,displayedPages:5},search:{delay:400,inputEvent:"input"},select:{mode:"single",selectedClass:"st-selected"},sort:{ascentClass:"st-sort-ascent",descentClass:"st-sort-descent",descendingFirst:!1,skipNatural:!1,delay:300},pipe:{delay:100}}),t.module("smart-table").controller("stTableController",["$scope","$parse","$filter","$attrs",function(a,n,s,i){function r(t){return t?[].concat(t):[]}function l(){b=r(o(a)),v===!0&&S.pipe()}function c(t,e){if(-1!=e.indexOf(".")){var a=e.split("."),s=a.pop(),i=a.join("."),r=n(i)(t);delete r[s],0==Object.keys(r).length&&c(t,i)}else delete t[e]}var o,u,p,g=i.stTable,d=n(g),f=d.assign,m=s("orderBy"),h=s("filter"),b=r(d(a)),P={sort:{},search:{},pagination:{start:0,totalItemCount:0}},v=!0,S=this;i.stSafeSrc&&(o=n(i.stSafeSrc),a.$watch(function(){var t=o(a);return t&&t.length?t[0]:e},function(t,e){t!==e&&l()}),a.$watch(function(){var t=o(a);return t?t.length:0},function(t){t!==b.length&&l()}),a.$watch(function(){return o(a)},function(t,e){t!==e&&(P.pagination.start=0,l())})),this.sortBy=function(e,a){return P.sort.predicate=e,P.sort.reverse=a===!0,t.isFunction(e)?P.sort.functionName=e.name:delete P.sort.functionName,P.pagination.start=0,this.pipe()},this.search=function(e,a){var s=P.search.predicateObject||{},i=a?a:"$";return e=t.isString(e)?e.trim():e,n(i).assign(s,e),e||c(s,i),P.search.predicateObject=s,P.pagination.start=0,this.pipe()},this.pipe=function(){var t,n=P.pagination;u=P.search.predicateObject?h(b,P.search.predicateObject):b,P.sort.predicate&&(u=m(u,P.sort.predicate,P.sort.reverse)),n.totalItemCount=u.length,n.number!==e&&(n.numberOfPages=u.length>0?Math.ceil(u.length/n.number):1,n.start=n.start>=u.length?(n.numberOfPages-1)*n.number:n.start,t=u.slice(n.start,n.start+parseInt(n.number))),f(a,t||u)},this.select=function(t,n){var s=r(d(a)),i=s.indexOf(t);-1!==i&&("single"===n?(t.isSelected=t.isSelected!==!0,p&&(p.isSelected=!1),p=t.isSelected===!0?t:e):s[i].isSelected=!s[i].isSelected)},this.slice=function(t,e){return P.pagination.start=t,P.pagination.number=e,this.pipe()},this.tableState=function(){return P},this.getFilteredCollection=function(){return u||b},this.setFilterFunction=function(t){h=s(t)},this.setSortFunction=function(t){m=s(t)},this.preventPipeOnWatch=function(){v=!1}}]).directive("stTable",function(){return{restrict:"A",controller:"stTableController",link:function(t,e,a,n){a.stSetFilter&&n.setFilterFunction(a.stSetFilter),a.stSetSort&&n.setSortFunction(a.stSetSort)}}}),t.module("smart-table").directive("stSearch",["stConfig","$timeout","$parse",function(t,e,a){return{require:"^stTable",link:function(n,s,i,r){var l=r,c=null,o=i.stDelay||t.search.delay,u=i.stInputEvent||t.search.inputEvent;i.$observe("stSearch",function(t,e){var a=s[0].value;t!==e&&a&&(r.tableState().search={},l.search(a,t))}),n.$watch(function(){return r.tableState().search},function(t){var e=i.stSearch||"$";t.predicateObject&&a(e)(t.predicateObject)!==s[0].value&&(s[0].value=a(e)(t.predicateObject)||"")},!0),s.bind(u,function(t){t=t.originalEvent||t,null!==c&&e.cancel(c),c=e(function(){l.search(t.target.value,i.stSearch||""),c=null},o)})}}}]),t.module("smart-table").directive("stSelectRow",["stConfig",function(t){return{restrict:"A",require:"^stTable",scope:{row:"=stSelectRow"},link:function(e,a,n,s){var i=n.stSelectMode||t.select.mode;a.bind("click",function(){e.$apply(function(){s.select(e.row,i)})}),e.$watch("row.isSelected",function(e){e===!0?a.addClass(t.select.selectedClass):a.removeClass(t.select.selectedClass)})}}}]),t.module("smart-table").directive("stSort",["stConfig","$parse","$timeout",function(a,n,s){return{restrict:"A",require:"^stTable",link:function(i,r,l,c){function o(){P?d=0===d?2:d-1:d++;var e;p=t.isFunction(g(i))||t.isArray(g(i))?g(i):l.stSort,d%3===0&&!!b!=!0?(d=0,c.tableState().sort={},c.tableState().pagination.start=0,e=c.pipe.bind(c)):e=c.sortBy.bind(c,p,d%2===0),null!==v&&s.cancel(v),0>S?e():v=s(e,S)}var u,p=l.stSort,g=n(p),d=0,f=l.stClassAscent||a.sort.ascentClass,m=l.stClassDescent||a.sort.descentClass,h=[f,m],b=l.stSkipNatural!==e?l.stSkipNatural:a.sort.skipNatural,P=l.stDescendingFirst!==e?l.stDescendingFirst:a.sort.descendingFirst,v=null,S=l.stDelay||a.sort.delay;l.stSortDefault&&(u=i.$eval(l.stSortDefault)!==e?i.$eval(l.stSortDefault):l.stSortDefault),r.bind("click",function(){p&&i.$apply(o)}),u&&(d="reverse"===u?1:0,o()),i.$watch(function(){return c.tableState().sort},function(t){t.predicate!==p?(d=0,r.removeClass(f).removeClass(m)):(d=t.reverse===!0?2:1,r.removeClass(h[d%2]).addClass(h[d-1]))},!0)}}}]),t.module("smart-table").directive("stPagination",["stConfig",function(t){return{restrict:"EA",require:"^stTable",scope:{stItemsByPage:"=?",stDisplayedPages:"=?",stPageChange:"&"},templateUrl:function(e,a){return a.stTemplate?a.stTemplate:t.pagination.template},link:function(e,a,n,s){function i(){var t,a,n=s.tableState().pagination,i=1,r=e.currentPage;for(e.totalItemCount=n.totalItemCount,e.currentPage=Math.floor(n.start/n.number)+1,i=Math.max(i,e.currentPage-Math.abs(Math.floor(e.stDisplayedPages/2))),t=i+e.stDisplayedPages,t>n.numberOfPages&&(t=n.numberOfPages+1,i=Math.max(1,t-e.stDisplayedPages)),e.pages=[],e.numPages=n.numberOfPages,a=i;t>a;a++)e.pages.push(a);r!==e.currentPage&&e.stPageChange({newPage:e.currentPage})}e.stItemsByPage=e.stItemsByPage?+e.stItemsByPage:t.pagination.itemsByPage,e.stDisplayedPages=e.stDisplayedPages?+e.stDisplayedPages:t.pagination.displayedPages,e.currentPage=1,e.pages=[],e.$watch(function(){return s.tableState().pagination},i,!0),e.$watch("stItemsByPage",function(t,a){t!==a&&e.selectPage(1)}),e.$watch("stDisplayedPages",i),e.selectPage=function(t){t>0&&t<=e.numPages&&s.slice((t-1)*e.stItemsByPage,e.stItemsByPage)},s.tableState().pagination.number||s.slice(0,e.stItemsByPage)}}}]),t.module("smart-table").directive("stPipe",["stConfig","$timeout",function(e,a){return{require:"stTable",scope:{stPipe:"="},link:{pre:function(n,s,i,r){var l=null;t.isFunction(n.stPipe)&&(r.preventPipeOnWatch(),r.pipe=function(){return null!==l&&a.cancel(l),l=a(function(){n.stPipe(r.tableState(),r)},e.pipe.delay)})},post:function(t,e,a,n){n.pipe()}}}}])}(angular);
2321 //# sourceMappingURL=smart-table.min.js.map
2321 //# sourceMappingURL=smart-table.min.js.map
2322
2322
2323 ;"use strict";angular.module("mentio",[]).directive("mentio",["mentioUtil","$document","$compile","$log","$timeout",function(e,t,n,r,i){return{restrict:"A",scope:{macros:"=mentioMacros",search:"&mentioSearch",select:"&mentioSelect",items:"=mentioItems",typedTerm:"=mentioTypedTerm",altId:"=mentioId",iframeElement:"=mentioIframeElement",requireLeadingSpace:"=mentioRequireLeadingSpace",selectNotFound:"=mentioSelectNotFound",trimTerm:"=mentioTrimTerm",ngModel:"="},controller:["$scope","$timeout","$attrs",function(n,r,i){n.query=function(e,t){var r=n.triggerCharMap[e];(void 0===n.trimTerm||n.trimTerm)&&(t=t.trim()),r.showMenu(),r.search({term:t}),r.typedTerm=t},n.defaultSearch=function(e){var t=[];angular.forEach(n.items,function(n){n.label.toUpperCase().indexOf(e.term.toUpperCase())>=0&&t.push(n)}),n.localItems=t},n.bridgeSearch=function(e){var t=i.mentioSearch?n.search:n.defaultSearch;t({term:e})},n.defaultSelect=function(e){return n.defaultTriggerChar+e.item.label},n.bridgeSelect=function(e){var t=i.mentioSelect?n.select:n.defaultSelect;return t({item:e})},n.setTriggerText=function(e){n.syncTriggerText&&(n.typedTerm=void 0===n.trimTerm||n.trimTerm?e.trim():e)},n.context=function(){return n.iframeElement?{iframe:n.iframeElement}:void 0},n.replaceText=function(t,i){if(n.hideAll(),e.replaceTriggerText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.triggerCharSet,t,n.requireLeadingSpace,i),!i&&(n.setTriggerText(""),angular.element(n.targetElement).triggerHandler("change"),n.isContentEditable())){n.contentEditableMenuPasted=!0;var o=r(function(){n.contentEditableMenuPasted=!1},200);n.$on("$destroy",function(){r.cancel(o)})}},n.hideAll=function(){for(var e in n.triggerCharMap)n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].hideMenu()},n.getActiveMenuScope=function(){for(var e in n.triggerCharMap)if(n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible)return n.triggerCharMap[e];return null},n.selectActive=function(){for(var e in n.triggerCharMap)n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible&&n.triggerCharMap[e].selectActive()},n.isActive=function(){for(var e in n.triggerCharMap)if(n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible)return!0;return!1},n.isContentEditable=function(){return"INPUT"!==n.targetElement.nodeName&&"TEXTAREA"!==n.targetElement.nodeName},n.replaceMacro=function(t,i){i?e.replaceMacroText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.macros,n.macros[t]):(n.replacingMacro=!0,n.timer=r(function(){e.replaceMacroText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.macros,n.macros[t]),angular.element(n.targetElement).triggerHandler("change"),n.replacingMacro=!1},300),n.$on("$destroy",function(){r.cancel(n.timer)}))},n.addMenu=function(e){e.parentScope&&n.triggerCharMap.hasOwnProperty(e.triggerChar)||(n.triggerCharMap[e.triggerChar]=e,void 0===n.triggerCharSet&&(n.triggerCharSet=[]),n.triggerCharSet.push(e.triggerChar),e.setParent(n))},n.$on("menuCreated",function(e,t){(void 0!==i.id||void 0!==i.mentioId)&&(i.id===t.targetElement||void 0!==i.mentioId&&n.altId===t.targetElement)&&n.addMenu(t.scope)}),t.on("click",function(){n.isActive()&&n.$apply(function(){n.hideAll()})}),t.on("keydown keypress paste",function(e){var t=n.getActiveMenuScope();t&&((9===e.which||13===e.which)&&(e.preventDefault(),t.selectActive()),27===e.which&&(e.preventDefault(),t.$apply(function(){t.hideMenu()})),40===e.which&&(e.preventDefault(),t.$apply(function(){t.activateNextItem()}),t.adjustScroll(1)),38===e.which&&(e.preventDefault(),t.$apply(function(){t.activatePreviousItem()}),t.adjustScroll(-1)),(37===e.which||39===e.which)&&e.preventDefault())})}],link:function(t,o,a){function c(e){function n(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}var r=t.getActiveMenuScope();if(r){if(9===e.which||13===e.which)return n(e),r.selectActive(),!1;if(27===e.which)return n(e),r.$apply(function(){r.hideMenu()}),!1;if(40===e.which)return n(e),r.$apply(function(){r.activateNextItem()}),r.adjustScroll(1),!1;if(38===e.which)return n(e),r.$apply(function(){r.activatePreviousItem()}),r.adjustScroll(-1),!1;if(37===e.which||39===e.which)return n(e),!1}}if(t.triggerCharMap={},t.targetElement=o,a.$set("autocomplete","off"),a.mentioItems){t.localItems=[],t.parentScope=t;var l=a.mentioSearch?' mentio-items="items"':' mentio-items="localItems"';t.defaultTriggerChar=a.mentioTriggerChar?t.$eval(a.mentioTriggerChar):"@";var s='<mentio-menu mentio-search="bridgeSearch(term)" mentio-select="bridgeSelect(item)"'+l;a.mentioTemplateUrl&&(s=s+' mentio-template-url="'+a.mentioTemplateUrl+'"'),s=s+" mentio-trigger-char=\"'"+t.defaultTriggerChar+'\'" mentio-parent-scope="parentScope"/>';var m=n(s),u=m(t);o.parent().append(u),t.$on("$destroy",function(){u.remove()})}a.mentioTypedTerm&&(t.syncTriggerText=!0),t.$watch("iframeElement",function(e){if(e){var n=e.contentWindow.document;n.addEventListener("click",function(){t.isActive()&&t.$apply(function(){t.hideAll()})}),n.addEventListener("keydown",c,!0),t.$on("$destroy",function(){n.removeEventListener("keydown",c)})}}),t.$watch("ngModel",function(n){if(n&&""!==n||t.isActive()){if(void 0===t.triggerCharSet)return void r.error("Error, no mentio-items attribute was provided, and no separate mentio-menus were specified. Nothing to do.");if(t.contentEditableMenuPasted)return void(t.contentEditableMenuPasted=!1);t.replacingMacro&&(i.cancel(t.timer),t.replacingMacro=!1);var o=t.isActive(),a=t.isContentEditable(),c=e.getTriggerInfo(t.context(),t.triggerCharSet,t.requireLeadingSpace,o);if(void 0!==c&&(!o||o&&(a&&c.mentionTriggerChar===t.currentMentionTriggerChar||!a&&c.mentionPosition===t.currentMentionPosition)))c.mentionSelectedElement&&(t.targetElement=c.mentionSelectedElement,t.targetElementPath=c.mentionSelectedPath,t.targetElementSelectedOffset=c.mentionSelectedOffset),t.setTriggerText(c.mentionText),t.currentMentionPosition=c.mentionPosition,t.currentMentionTriggerChar=c.mentionTriggerChar,t.query(c.mentionTriggerChar,c.mentionText);else{var l=t.typedTerm;t.setTriggerText(""),t.hideAll();var s=e.getMacroMatch(t.context(),t.macros);if(void 0!==s)t.targetElement=s.macroSelectedElement,t.targetElementPath=s.macroSelectedPath,t.targetElementSelectedOffset=s.macroSelectedOffset,t.replaceMacro(s.macroText,s.macroHasTrailingSpace);else if(t.selectNotFound&&l&&""!==l){var m=t.triggerCharMap[t.currentMentionTriggerChar];if(m){var u=m.select({item:{label:l}});"function"==typeof u.then?u.then(t.replaceText):t.replaceText(u,!0)}}}}})}}}]).directive("mentioMenu",["mentioUtil","$rootScope","$log","$window","$document",function(e,t,n,r,i){return{restrict:"E",scope:{search:"&mentioSearch",select:"&mentioSelect",items:"=mentioItems",triggerChar:"=mentioTriggerChar",forElem:"=mentioFor",parentScope:"=mentioParentScope"},templateUrl:function(e,t){return void 0!==t.mentioTemplateUrl?t.mentioTemplateUrl:"mentio-menu.tpl.html"},controller:["$scope",function(e){e.visible=!1,this.activate=e.activate=function(t){e.activeItem=t},this.isActive=e.isActive=function(t){return e.activeItem===t},this.selectItem=e.selectItem=function(t){var n=e.select({item:t});"function"==typeof n.then?n.then(e.parentMentio.replaceText):e.parentMentio.replaceText(n)},e.activateNextItem=function(){var t=e.items.indexOf(e.activeItem);this.activate(e.items[(t+1)%e.items.length])},e.activatePreviousItem=function(){var t=e.items.indexOf(e.activeItem);this.activate(e.items[0===t?e.items.length-1:t-1])},e.isFirstItemActive=function(){var t=e.items.indexOf(e.activeItem);return 0===t},e.isLastItemActive=function(){var t=e.items.indexOf(e.activeItem);return t===e.items.length-1},e.selectActive=function(){e.selectItem(e.activeItem)},e.isVisible=function(){return e.visible},e.showMenu=function(){e.visible||(e.requestVisiblePendingSearch=!0)},e.setParent=function(t){e.parentMentio=t,e.targetElement=t.targetElement}}],link:function(o,a){if(a[0].parentNode.removeChild(a[0]),i[0].body.appendChild(a[0]),o.menuElement=a,o.parentScope)o.parentScope.addMenu(o);else{if(!o.forElem)return void n.error("mentio-menu requires a target element in tbe mentio-for attribute");if(!o.triggerChar)return void n.error("mentio-menu requires a trigger char");t.$broadcast("menuCreated",{targetElement:o.forElem,scope:o})}angular.element(r).bind("resize",function(){if(o.isVisible()){var t=[];t.push(o.triggerChar),e.popUnderMention(o.parentMentio.context(),t,a,o.requireLeadingSpace)}}),o.$watch("items",function(e){e&&e.length>0?(o.activate(e[0]),!o.visible&&o.requestVisiblePendingSearch&&(o.visible=!0,o.requestVisiblePendingSearch=!1)):o.hideMenu()}),o.$watch("isVisible()",function(t){if(t){var n=[];n.push(o.triggerChar),e.popUnderMention(o.parentMentio.context(),n,a,o.requireLeadingSpace)}}),o.parentMentio.$on("$destroy",function(){a.remove()}),o.hideMenu=function(){o.visible=!1,a.css("display","none")},o.adjustScroll=function(e){var t=a[0],n=t.querySelector("ul"),r=t.querySelector("[mentio-menu-item].active")||t.querySelector("[data-mentio-menu-item].active");return o.isFirstItemActive()?n.scrollTop=0:o.isLastItemActive()?n.scrollTop=n.scrollHeight:void(1===e?n.scrollTop+=r.offsetHeight:n.scrollTop-=r.offsetHeight)}}}}]).directive("mentioMenuItem",function(){return{restrict:"A",scope:{item:"=mentioMenuItem"},require:"^mentioMenu",link:function(e,t,n,r){e.$watch(function(){return r.isActive(e.item)},function(e){e?t.addClass("active"):t.removeClass("active")}),t.bind("mouseenter",function(){e.$apply(function(){r.activate(e.item)})}),t.bind("click",function(){return r.selectItem(e.item),!1})}}}).filter("unsafe",["$sce",function(e){return function(t){return e.trustAsHtml(t)}}]).filter("mentioHighlight",function(){function e(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(t,n,r){if(n){var i=r?'<span class="'+r+'">$&</span>':"<strong>$&</strong>";return(""+t).replace(new RegExp(e(n),"gi"),i)}return t}}),angular.module("mentio").factory("mentioUtil",["$window","$location","$anchorScroll","$timeout",function(e,t,n,r){function i(e,t,n,i){var c,l=h(e,t,i,!1);void 0!==l?(c=a(e)?b(e,v(e).activeElement,l.mentionPosition):S(e,l.mentionPosition),n.css({top:c.top+"px",left:c.left+"px",position:"absolute",zIndex:1e4,display:"block"}),r(function(){o(e,n)},0)):n.css({display:"none"})}function o(t,n){for(var r,i=20,o=100,a=n[0];void 0===r||0===r.height;)if(r=a.getBoundingClientRect(),0===r.height&&(a=a.childNodes[0],void 0===a||!a.getBoundingClientRect))return;var c=r.top,l=c+r.height;if(0>c)e.scrollTo(0,e.pageYOffset+r.top-i);else if(l>e.innerHeight){var s=e.pageYOffset+r.top-i;s-e.pageYOffset>o&&(s=e.pageYOffset+o);var m=e.pageYOffset-(e.innerHeight-l);m>s&&(m=s),e.scrollTo(0,m)}}function a(e){var t=v(e).activeElement;if(null!==t){var n=t.nodeName,r=t.getAttribute("type");return"INPUT"===n&&"text"===r||"TEXTAREA"===n}return!1}function c(e,t,n,r){var i,o=t;if(n)for(var a=0;a<n.length;a++){if(o=o.childNodes[n[a]],void 0===o)return;for(;o.length<r;)r-=o.length,o=o.nextSibling;0!==o.childNodes.length||o.length||(o=o.previousSibling)}var c=p(e);i=v(e).createRange(),i.setStart(o,r),i.setEnd(o,r),i.collapse(!0);try{c.removeAllRanges()}catch(l){}c.addRange(i),t.focus()}function l(e,t,n,r){var i,o;o=p(e),i=v(e).createRange(),i.setStart(o.anchorNode,n),i.setEnd(o.anchorNode,r),i.deleteContents();var a=v(e).createElement("div");a.innerHTML=t;for(var c,l,s=v(e).createDocumentFragment();c=a.firstChild;)l=s.appendChild(c);i.insertNode(s),l&&(i=i.cloneRange(),i.setStartAfter(l),i.collapse(!0),o.removeAllRanges(),o.addRange(i))}function s(e,t,n,r){var i=t.nodeName;"INPUT"===i||"TEXTAREA"===i?t!==v(e).activeElement&&t.focus():c(e,t,n,r)}function m(e,t,n,r,i,o){s(e,t,n,r);var c=d(e,i);if(c.macroHasTrailingSpace&&(c.macroText=c.macroText+" ",o+=" "),void 0!==c){var m=v(e).activeElement;if(a(e)){var u=c.macroPosition,g=c.macroPosition+c.macroText.length;m.value=m.value.substring(0,u)+o+m.value.substring(g,m.value.length),m.selectionStart=u+o.length,m.selectionEnd=u+o.length}else l(e,o,c.macroPosition,c.macroPosition+c.macroText.length)}}function u(e,t,n,r,i,o,c,m){s(e,t,n,r);var u=h(e,i,c,!0,m);if(void 0!==u)if(a()){var g=v(e).activeElement;o+=" ";var d=u.mentionPosition,f=u.mentionPosition+u.mentionText.length+1;g.value=g.value.substring(0,d)+o+g.value.substring(f,g.value.length),g.selectionStart=d+o.length,g.selectionEnd=d+o.length}else o+=" ",l(e,o,u.mentionPosition,u.mentionPosition+u.mentionText.length+1)}function g(e,t){if(null===t.parentNode)return 0;for(var n=0;n<t.parentNode.childNodes.length;n++){var r=t.parentNode.childNodes[n];if(r===t)return n}}function d(e,t){var n,r,i=[];if(a(e))n=v(e).activeElement;else{var o=f(e);o&&(n=o.selected,i=o.path,r=o.offset)}var c=T(e);if(void 0!==c&&null!==c){var l,s=!1;if(c.length>0&&(" "===c.charAt(c.length-1)||" "===c.charAt(c.length-1))&&(s=!0,c=c.substring(0,c.length-1)),angular.forEach(t,function(e,t){var o=c.toUpperCase().lastIndexOf(t.toUpperCase());if(o>=0&&t.length+o===c.length){var a=o-1;(0===o||" "===c.charAt(a)||" "===c.charAt(a))&&(l={macroPosition:o,macroText:t,macroSelectedElement:n,macroSelectedPath:i,macroSelectedOffset:r,macroHasTrailingSpace:s})}}),l)return l}}function f(e){var t,n=p(e),r=n.anchorNode,i=[];if(null!=r){for(var o,a=r.contentEditable;null!==r&&"true"!==a;)o=g(e,r),i.push(o),r=r.parentNode,null!==r&&(a=r.contentEditable);return i.reverse(),t=n.getRangeAt(0).startOffset,{selected:r,path:i,offset:t}}}function h(e,t,n,r,i){var o,c,l;if(a(e))o=v(e).activeElement;else{var s=f(e);s&&(o=s.selected,c=s.path,l=s.offset)}var m=T(e);if(void 0!==m&&null!==m){var u,g=-1;if(t.forEach(function(e){var t=m.lastIndexOf(e);t>g&&(g=t,u=e)}),g>=0&&(0===g||!n||/[\xA0\s]/g.test(m.substring(g-1,g)))){var d=m.substring(g+1,m.length);u=m.substring(g,g+1);var h=d.substring(0,1),p=d.length>0&&(" "===h||" "===h);if(i&&(d=d.trim()),!p&&(r||!/[\xA0\s]/g.test(d)))return{mentionPosition:g,mentionText:d,mentionSelectedElement:o,mentionSelectedPath:c,mentionSelectedOffset:l,mentionTriggerChar:u}}}}function p(e){return e?e.iframe.contentWindow.getSelection():window.getSelection()}function v(e){return e?e.iframe.contentWindow.document:document}function T(e){var t;if(a(e)){var n=v(e).activeElement,r=n.selectionStart;t=n.value.substring(0,r)}else{var i=p(e).anchorNode;if(null!=i){var o=i.textContent,c=p(e).getRangeAt(0).startOffset;c>=0&&(t=o.substring(0,c))}}return t}function S(e,t){var n,r,i="",o="sel_"+(new Date).getTime()+"_"+Math.random().toString().substr(2),a=p(e),c=a.getRangeAt(0);r=v(e).createRange(),r.setStart(a.anchorNode,t),r.setEnd(a.anchorNode,t),r.collapse(!1),n=v(e).createElement("span"),n.id=o,n.appendChild(v(e).createTextNode(i)),r.insertNode(n),a.removeAllRanges(),a.addRange(c);var l={left:0,top:n.offsetHeight};return E(e,n,l),n.parentNode.removeChild(n),l}function E(e,t,n){for(var r=t,i=e?e.iframe:null;r;)n.left+=r.offsetLeft+r.clientLeft,n.top+=r.offsetTop+r.clientTop,r=r.offsetParent,!r&&i&&(r=i,i=null);for(r=t,i=e?e.iframe:null;r!==v().body;)r.scrollTop&&r.scrollTop>0&&(n.top-=r.scrollTop),r.scrollLeft&&r.scrollLeft>0&&(n.left-=r.scrollLeft),r=r.parentNode,!r&&i&&(r=i,i=null)}function b(e,t,n){var r=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],i=null!==window.mozInnerScreenX,o=v(e).createElement("div");o.id="input-textarea-caret-position-mirror-div",v(e).body.appendChild(o);var a=o.style,c=window.getComputedStyle?getComputedStyle(t):t.currentStyle;a.whiteSpace="pre-wrap","INPUT"!==t.nodeName&&(a.wordWrap="break-word"),a.position="absolute",a.visibility="hidden",r.forEach(function(e){a[e]=c[e]}),i?(a.width=parseInt(c.width)-2+"px",t.scrollHeight>parseInt(c.height)&&(a.overflowY="scroll")):a.overflow="hidden",o.textContent=t.value.substring(0,n),"INPUT"===t.nodeName&&(o.textContent=o.textContent.replace(/\s/g," "));var l=v(e).createElement("span");l.textContent=t.value.substring(n)||".",o.appendChild(l);var s={top:l.offsetTop+parseInt(c.borderTopWidth)+parseInt(c.fontSize),left:l.offsetLeft+parseInt(c.borderLeftWidth)};return E(e,t,s),v(e).body.removeChild(o),s}return{popUnderMention:i,replaceMacroText:m,replaceTriggerText:u,getMacroMatch:d,getTriggerInfo:h,selectElement:c,getTextAreaOrInputUnderlinePosition:b,getTextPrecedingCurrentSelection:T,getContentEditableSelectedPath:f,getNodePositionInParent:g,getContentEditableCaretPosition:S,pasteHtml:l,resetSelection:s,scrollIntoView:o}}]),angular.module("mentio").run(["$templateCache",function(e){e.put("mentio-menu.tpl.html",'<style>\n.scrollable-menu {\n height: auto;\n max-height: 300px;\n overflow: auto;\n}\n\n.menu-highlighted {\n font-weight: bold;\n}\n</style>\n<ul class="dropdown-menu scrollable-menu" style="display:block">\n <li mentio-menu-item="item" ng-repeat="item in items track by $index">\n <a class="text-primary" ng-bind-html="item.label | mentioHighlight:typedTerm:\'menu-highlighted\' | unsafe"></a>\n </li>\n</ul>')}]);
2323 ;"use strict";angular.module("mentio",[]).directive("mentio",["mentioUtil","$document","$compile","$log","$timeout",function(e,t,n,r,i){return{restrict:"A",scope:{macros:"=mentioMacros",search:"&mentioSearch",select:"&mentioSelect",items:"=mentioItems",typedTerm:"=mentioTypedTerm",altId:"=mentioId",iframeElement:"=mentioIframeElement",requireLeadingSpace:"=mentioRequireLeadingSpace",selectNotFound:"=mentioSelectNotFound",trimTerm:"=mentioTrimTerm",ngModel:"="},controller:["$scope","$timeout","$attrs",function(n,r,i){n.query=function(e,t){var r=n.triggerCharMap[e];(void 0===n.trimTerm||n.trimTerm)&&(t=t.trim()),r.showMenu(),r.search({term:t}),r.typedTerm=t},n.defaultSearch=function(e){var t=[];angular.forEach(n.items,function(n){n.label.toUpperCase().indexOf(e.term.toUpperCase())>=0&&t.push(n)}),n.localItems=t},n.bridgeSearch=function(e){var t=i.mentioSearch?n.search:n.defaultSearch;t({term:e})},n.defaultSelect=function(e){return n.defaultTriggerChar+e.item.label},n.bridgeSelect=function(e){var t=i.mentioSelect?n.select:n.defaultSelect;return t({item:e})},n.setTriggerText=function(e){n.syncTriggerText&&(n.typedTerm=void 0===n.trimTerm||n.trimTerm?e.trim():e)},n.context=function(){return n.iframeElement?{iframe:n.iframeElement}:void 0},n.replaceText=function(t,i){if(n.hideAll(),e.replaceTriggerText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.triggerCharSet,t,n.requireLeadingSpace,i),!i&&(n.setTriggerText(""),angular.element(n.targetElement).triggerHandler("change"),n.isContentEditable())){n.contentEditableMenuPasted=!0;var o=r(function(){n.contentEditableMenuPasted=!1},200);n.$on("$destroy",function(){r.cancel(o)})}},n.hideAll=function(){for(var e in n.triggerCharMap)n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].hideMenu()},n.getActiveMenuScope=function(){for(var e in n.triggerCharMap)if(n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible)return n.triggerCharMap[e];return null},n.selectActive=function(){for(var e in n.triggerCharMap)n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible&&n.triggerCharMap[e].selectActive()},n.isActive=function(){for(var e in n.triggerCharMap)if(n.triggerCharMap.hasOwnProperty(e)&&n.triggerCharMap[e].visible)return!0;return!1},n.isContentEditable=function(){return"INPUT"!==n.targetElement.nodeName&&"TEXTAREA"!==n.targetElement.nodeName},n.replaceMacro=function(t,i){i?e.replaceMacroText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.macros,n.macros[t]):(n.replacingMacro=!0,n.timer=r(function(){e.replaceMacroText(n.context(),n.targetElement,n.targetElementPath,n.targetElementSelectedOffset,n.macros,n.macros[t]),angular.element(n.targetElement).triggerHandler("change"),n.replacingMacro=!1},300),n.$on("$destroy",function(){r.cancel(n.timer)}))},n.addMenu=function(e){e.parentScope&&n.triggerCharMap.hasOwnProperty(e.triggerChar)||(n.triggerCharMap[e.triggerChar]=e,void 0===n.triggerCharSet&&(n.triggerCharSet=[]),n.triggerCharSet.push(e.triggerChar),e.setParent(n))},n.$on("menuCreated",function(e,t){(void 0!==i.id||void 0!==i.mentioId)&&(i.id===t.targetElement||void 0!==i.mentioId&&n.altId===t.targetElement)&&n.addMenu(t.scope)}),t.on("click",function(){n.isActive()&&n.$apply(function(){n.hideAll()})}),t.on("keydown keypress paste",function(e){var t=n.getActiveMenuScope();t&&((9===e.which||13===e.which)&&(e.preventDefault(),t.selectActive()),27===e.which&&(e.preventDefault(),t.$apply(function(){t.hideMenu()})),40===e.which&&(e.preventDefault(),t.$apply(function(){t.activateNextItem()}),t.adjustScroll(1)),38===e.which&&(e.preventDefault(),t.$apply(function(){t.activatePreviousItem()}),t.adjustScroll(-1)),(37===e.which||39===e.which)&&e.preventDefault())})}],link:function(t,o,a){function c(e){function n(e){e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation()}var r=t.getActiveMenuScope();if(r){if(9===e.which||13===e.which)return n(e),r.selectActive(),!1;if(27===e.which)return n(e),r.$apply(function(){r.hideMenu()}),!1;if(40===e.which)return n(e),r.$apply(function(){r.activateNextItem()}),r.adjustScroll(1),!1;if(38===e.which)return n(e),r.$apply(function(){r.activatePreviousItem()}),r.adjustScroll(-1),!1;if(37===e.which||39===e.which)return n(e),!1}}if(t.triggerCharMap={},t.targetElement=o,a.$set("autocomplete","off"),a.mentioItems){t.localItems=[],t.parentScope=t;var l=a.mentioSearch?' mentio-items="items"':' mentio-items="localItems"';t.defaultTriggerChar=a.mentioTriggerChar?t.$eval(a.mentioTriggerChar):"@";var s='<mentio-menu mentio-search="bridgeSearch(term)" mentio-select="bridgeSelect(item)"'+l;a.mentioTemplateUrl&&(s=s+' mentio-template-url="'+a.mentioTemplateUrl+'"'),s=s+" mentio-trigger-char=\"'"+t.defaultTriggerChar+'\'" mentio-parent-scope="parentScope"/>';var m=n(s),u=m(t);o.parent().append(u),t.$on("$destroy",function(){u.remove()})}a.mentioTypedTerm&&(t.syncTriggerText=!0),t.$watch("iframeElement",function(e){if(e){var n=e.contentWindow.document;n.addEventListener("click",function(){t.isActive()&&t.$apply(function(){t.hideAll()})}),n.addEventListener("keydown",c,!0),t.$on("$destroy",function(){n.removeEventListener("keydown",c)})}}),t.$watch("ngModel",function(n){if(n&&""!==n||t.isActive()){if(void 0===t.triggerCharSet)return void r.error("Error, no mentio-items attribute was provided, and no separate mentio-menus were specified. Nothing to do.");if(t.contentEditableMenuPasted)return void(t.contentEditableMenuPasted=!1);t.replacingMacro&&(i.cancel(t.timer),t.replacingMacro=!1);var o=t.isActive(),a=t.isContentEditable(),c=e.getTriggerInfo(t.context(),t.triggerCharSet,t.requireLeadingSpace,o);if(void 0!==c&&(!o||o&&(a&&c.mentionTriggerChar===t.currentMentionTriggerChar||!a&&c.mentionPosition===t.currentMentionPosition)))c.mentionSelectedElement&&(t.targetElement=c.mentionSelectedElement,t.targetElementPath=c.mentionSelectedPath,t.targetElementSelectedOffset=c.mentionSelectedOffset),t.setTriggerText(c.mentionText),t.currentMentionPosition=c.mentionPosition,t.currentMentionTriggerChar=c.mentionTriggerChar,t.query(c.mentionTriggerChar,c.mentionText);else{var l=t.typedTerm;t.setTriggerText(""),t.hideAll();var s=e.getMacroMatch(t.context(),t.macros);if(void 0!==s)t.targetElement=s.macroSelectedElement,t.targetElementPath=s.macroSelectedPath,t.targetElementSelectedOffset=s.macroSelectedOffset,t.replaceMacro(s.macroText,s.macroHasTrailingSpace);else if(t.selectNotFound&&l&&""!==l){var m=t.triggerCharMap[t.currentMentionTriggerChar];if(m){var u=m.select({item:{label:l}});"function"==typeof u.then?u.then(t.replaceText):t.replaceText(u,!0)}}}}})}}}]).directive("mentioMenu",["mentioUtil","$rootScope","$log","$window","$document",function(e,t,n,r,i){return{restrict:"E",scope:{search:"&mentioSearch",select:"&mentioSelect",items:"=mentioItems",triggerChar:"=mentioTriggerChar",forElem:"=mentioFor",parentScope:"=mentioParentScope"},templateUrl:function(e,t){return void 0!==t.mentioTemplateUrl?t.mentioTemplateUrl:"mentio-menu.tpl.html"},controller:["$scope",function(e){e.visible=!1,this.activate=e.activate=function(t){e.activeItem=t},this.isActive=e.isActive=function(t){return e.activeItem===t},this.selectItem=e.selectItem=function(t){var n=e.select({item:t});"function"==typeof n.then?n.then(e.parentMentio.replaceText):e.parentMentio.replaceText(n)},e.activateNextItem=function(){var t=e.items.indexOf(e.activeItem);this.activate(e.items[(t+1)%e.items.length])},e.activatePreviousItem=function(){var t=e.items.indexOf(e.activeItem);this.activate(e.items[0===t?e.items.length-1:t-1])},e.isFirstItemActive=function(){var t=e.items.indexOf(e.activeItem);return 0===t},e.isLastItemActive=function(){var t=e.items.indexOf(e.activeItem);return t===e.items.length-1},e.selectActive=function(){e.selectItem(e.activeItem)},e.isVisible=function(){return e.visible},e.showMenu=function(){e.visible||(e.requestVisiblePendingSearch=!0)},e.setParent=function(t){e.parentMentio=t,e.targetElement=t.targetElement}}],link:function(o,a){if(a[0].parentNode.removeChild(a[0]),i[0].body.appendChild(a[0]),o.menuElement=a,o.parentScope)o.parentScope.addMenu(o);else{if(!o.forElem)return void n.error("mentio-menu requires a target element in tbe mentio-for attribute");if(!o.triggerChar)return void n.error("mentio-menu requires a trigger char");t.$broadcast("menuCreated",{targetElement:o.forElem,scope:o})}angular.element(r).bind("resize",function(){if(o.isVisible()){var t=[];t.push(o.triggerChar),e.popUnderMention(o.parentMentio.context(),t,a,o.requireLeadingSpace)}}),o.$watch("items",function(e){e&&e.length>0?(o.activate(e[0]),!o.visible&&o.requestVisiblePendingSearch&&(o.visible=!0,o.requestVisiblePendingSearch=!1)):o.hideMenu()}),o.$watch("isVisible()",function(t){if(t){var n=[];n.push(o.triggerChar),e.popUnderMention(o.parentMentio.context(),n,a,o.requireLeadingSpace)}}),o.parentMentio.$on("$destroy",function(){a.remove()}),o.hideMenu=function(){o.visible=!1,a.css("display","none")},o.adjustScroll=function(e){var t=a[0],n=t.querySelector("ul"),r=t.querySelector("[mentio-menu-item].active")||t.querySelector("[data-mentio-menu-item].active");return o.isFirstItemActive()?n.scrollTop=0:o.isLastItemActive()?n.scrollTop=n.scrollHeight:void(1===e?n.scrollTop+=r.offsetHeight:n.scrollTop-=r.offsetHeight)}}}}]).directive("mentioMenuItem",function(){return{restrict:"A",scope:{item:"=mentioMenuItem"},require:"^mentioMenu",link:function(e,t,n,r){e.$watch(function(){return r.isActive(e.item)},function(e){e?t.addClass("active"):t.removeClass("active")}),t.bind("mouseenter",function(){e.$apply(function(){r.activate(e.item)})}),t.bind("click",function(){return r.selectItem(e.item),!1})}}}).filter("unsafe",["$sce",function(e){return function(t){return e.trustAsHtml(t)}}]).filter("mentioHighlight",function(){function e(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}return function(t,n,r){if(n){var i=r?'<span class="'+r+'">$&</span>':"<strong>$&</strong>";return(""+t).replace(new RegExp(e(n),"gi"),i)}return t}}),angular.module("mentio").factory("mentioUtil",["$window","$location","$anchorScroll","$timeout",function(e,t,n,r){function i(e,t,n,i){var c,l=h(e,t,i,!1);void 0!==l?(c=a(e)?b(e,v(e).activeElement,l.mentionPosition):S(e,l.mentionPosition),n.css({top:c.top+"px",left:c.left+"px",position:"absolute",zIndex:1e4,display:"block"}),r(function(){o(e,n)},0)):n.css({display:"none"})}function o(t,n){for(var r,i=20,o=100,a=n[0];void 0===r||0===r.height;)if(r=a.getBoundingClientRect(),0===r.height&&(a=a.childNodes[0],void 0===a||!a.getBoundingClientRect))return;var c=r.top,l=c+r.height;if(0>c)e.scrollTo(0,e.pageYOffset+r.top-i);else if(l>e.innerHeight){var s=e.pageYOffset+r.top-i;s-e.pageYOffset>o&&(s=e.pageYOffset+o);var m=e.pageYOffset-(e.innerHeight-l);m>s&&(m=s),e.scrollTo(0,m)}}function a(e){var t=v(e).activeElement;if(null!==t){var n=t.nodeName,r=t.getAttribute("type");return"INPUT"===n&&"text"===r||"TEXTAREA"===n}return!1}function c(e,t,n,r){var i,o=t;if(n)for(var a=0;a<n.length;a++){if(o=o.childNodes[n[a]],void 0===o)return;for(;o.length<r;)r-=o.length,o=o.nextSibling;0!==o.childNodes.length||o.length||(o=o.previousSibling)}var c=p(e);i=v(e).createRange(),i.setStart(o,r),i.setEnd(o,r),i.collapse(!0);try{c.removeAllRanges()}catch(l){}c.addRange(i),t.focus()}function l(e,t,n,r){var i,o;o=p(e),i=v(e).createRange(),i.setStart(o.anchorNode,n),i.setEnd(o.anchorNode,r),i.deleteContents();var a=v(e).createElement("div");a.innerHTML=t;for(var c,l,s=v(e).createDocumentFragment();c=a.firstChild;)l=s.appendChild(c);i.insertNode(s),l&&(i=i.cloneRange(),i.setStartAfter(l),i.collapse(!0),o.removeAllRanges(),o.addRange(i))}function s(e,t,n,r){var i=t.nodeName;"INPUT"===i||"TEXTAREA"===i?t!==v(e).activeElement&&t.focus():c(e,t,n,r)}function m(e,t,n,r,i,o){s(e,t,n,r);var c=d(e,i);if(c.macroHasTrailingSpace&&(c.macroText=c.macroText+" ",o+=" "),void 0!==c){var m=v(e).activeElement;if(a(e)){var u=c.macroPosition,g=c.macroPosition+c.macroText.length;m.value=m.value.substring(0,u)+o+m.value.substring(g,m.value.length),m.selectionStart=u+o.length,m.selectionEnd=u+o.length}else l(e,o,c.macroPosition,c.macroPosition+c.macroText.length)}}function u(e,t,n,r,i,o,c,m){s(e,t,n,r);var u=h(e,i,c,!0,m);if(void 0!==u)if(a()){var g=v(e).activeElement;o+=" ";var d=u.mentionPosition,f=u.mentionPosition+u.mentionText.length+1;g.value=g.value.substring(0,d)+o+g.value.substring(f,g.value.length),g.selectionStart=d+o.length,g.selectionEnd=d+o.length}else o+=" ",l(e,o,u.mentionPosition,u.mentionPosition+u.mentionText.length+1)}function g(e,t){if(null===t.parentNode)return 0;for(var n=0;n<t.parentNode.childNodes.length;n++){var r=t.parentNode.childNodes[n];if(r===t)return n}}function d(e,t){var n,r,i=[];if(a(e))n=v(e).activeElement;else{var o=f(e);o&&(n=o.selected,i=o.path,r=o.offset)}var c=T(e);if(void 0!==c&&null!==c){var l,s=!1;if(c.length>0&&(" "===c.charAt(c.length-1)||" "===c.charAt(c.length-1))&&(s=!0,c=c.substring(0,c.length-1)),angular.forEach(t,function(e,t){var o=c.toUpperCase().lastIndexOf(t.toUpperCase());if(o>=0&&t.length+o===c.length){var a=o-1;(0===o||" "===c.charAt(a)||" "===c.charAt(a))&&(l={macroPosition:o,macroText:t,macroSelectedElement:n,macroSelectedPath:i,macroSelectedOffset:r,macroHasTrailingSpace:s})}}),l)return l}}function f(e){var t,n=p(e),r=n.anchorNode,i=[];if(null!=r){for(var o,a=r.contentEditable;null!==r&&"true"!==a;)o=g(e,r),i.push(o),r=r.parentNode,null!==r&&(a=r.contentEditable);return i.reverse(),t=n.getRangeAt(0).startOffset,{selected:r,path:i,offset:t}}}function h(e,t,n,r,i){var o,c,l;if(a(e))o=v(e).activeElement;else{var s=f(e);s&&(o=s.selected,c=s.path,l=s.offset)}var m=T(e);if(void 0!==m&&null!==m){var u,g=-1;if(t.forEach(function(e){var t=m.lastIndexOf(e);t>g&&(g=t,u=e)}),g>=0&&(0===g||!n||/[\xA0\s]/g.test(m.substring(g-1,g)))){var d=m.substring(g+1,m.length);u=m.substring(g,g+1);var h=d.substring(0,1),p=d.length>0&&(" "===h||" "===h);if(i&&(d=d.trim()),!p&&(r||!/[\xA0\s]/g.test(d)))return{mentionPosition:g,mentionText:d,mentionSelectedElement:o,mentionSelectedPath:c,mentionSelectedOffset:l,mentionTriggerChar:u}}}}function p(e){return e?e.iframe.contentWindow.getSelection():window.getSelection()}function v(e){return e?e.iframe.contentWindow.document:document}function T(e){var t;if(a(e)){var n=v(e).activeElement,r=n.selectionStart;t=n.value.substring(0,r)}else{var i=p(e).anchorNode;if(null!=i){var o=i.textContent,c=p(e).getRangeAt(0).startOffset;c>=0&&(t=o.substring(0,c))}}return t}function S(e,t){var n,r,i="",o="sel_"+(new Date).getTime()+"_"+Math.random().toString().substr(2),a=p(e),c=a.getRangeAt(0);r=v(e).createRange(),r.setStart(a.anchorNode,t),r.setEnd(a.anchorNode,t),r.collapse(!1),n=v(e).createElement("span"),n.id=o,n.appendChild(v(e).createTextNode(i)),r.insertNode(n),a.removeAllRanges(),a.addRange(c);var l={left:0,top:n.offsetHeight};return E(e,n,l),n.parentNode.removeChild(n),l}function E(e,t,n){for(var r=t,i=e?e.iframe:null;r;)n.left+=r.offsetLeft+r.clientLeft,n.top+=r.offsetTop+r.clientTop,r=r.offsetParent,!r&&i&&(r=i,i=null);for(r=t,i=e?e.iframe:null;r!==v().body;)r.scrollTop&&r.scrollTop>0&&(n.top-=r.scrollTop),r.scrollLeft&&r.scrollLeft>0&&(n.left-=r.scrollLeft),r=r.parentNode,!r&&i&&(r=i,i=null)}function b(e,t,n){var r=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing"],i=null!==window.mozInnerScreenX,o=v(e).createElement("div");o.id="input-textarea-caret-position-mirror-div",v(e).body.appendChild(o);var a=o.style,c=window.getComputedStyle?getComputedStyle(t):t.currentStyle;a.whiteSpace="pre-wrap","INPUT"!==t.nodeName&&(a.wordWrap="break-word"),a.position="absolute",a.visibility="hidden",r.forEach(function(e){a[e]=c[e]}),i?(a.width=parseInt(c.width)-2+"px",t.scrollHeight>parseInt(c.height)&&(a.overflowY="scroll")):a.overflow="hidden",o.textContent=t.value.substring(0,n),"INPUT"===t.nodeName&&(o.textContent=o.textContent.replace(/\s/g," "));var l=v(e).createElement("span");l.textContent=t.value.substring(n)||".",o.appendChild(l);var s={top:l.offsetTop+parseInt(c.borderTopWidth)+parseInt(c.fontSize),left:l.offsetLeft+parseInt(c.borderLeftWidth)};return E(e,t,s),v(e).body.removeChild(o),s}return{popUnderMention:i,replaceMacroText:m,replaceTriggerText:u,getMacroMatch:d,getTriggerInfo:h,selectElement:c,getTextAreaOrInputUnderlinePosition:b,getTextPrecedingCurrentSelection:T,getContentEditableSelectedPath:f,getNodePositionInParent:g,getContentEditableCaretPosition:S,pasteHtml:l,resetSelection:s,scrollIntoView:o}}]),angular.module("mentio").run(["$templateCache",function(e){e.put("mentio-menu.tpl.html",'<style>\n.scrollable-menu {\n height: auto;\n max-height: 300px;\n overflow: auto;\n}\n\n.menu-highlighted {\n font-weight: bold;\n}\n</style>\n<ul class="dropdown-menu scrollable-menu" style="display:block">\n <li mentio-menu-item="item" ng-repeat="item in items track by $index">\n <a class="text-primary" ng-bind-html="item.label | mentioHighlight:typedTerm:\'menu-highlighted\' | unsafe"></a>\n </li>\n</ul>')}]);
2324 ;moment.defaultFormat = 'YYYY-MM-DDTHH:mm';
2324 ;moment.defaultFormat = 'YYYY-MM-DDTHH:mm';
2325
2325
2326 ;// MIT License:
2326 ;// MIT License:
2327 //
2327 //
2328 // Copyright (c) 2010-2012, Joe Walnes
2328 // Copyright (c) 2010-2012, Joe Walnes
2329 //
2329 //
2330 // Permission is hereby granted, free of charge, to any person obtaining a copy
2330 // Permission is hereby granted, free of charge, to any person obtaining a copy
2331 // of this software and associated documentation files (the "Software"), to deal
2331 // of this software and associated documentation files (the "Software"), to deal
2332 // in the Software without restriction, including without limitation the rights
2332 // in the Software without restriction, including without limitation the rights
2333 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2333 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
2334 // copies of the Software, and to permit persons to whom the Software is
2334 // copies of the Software, and to permit persons to whom the Software is
2335 // furnished to do so, subject to the following conditions:
2335 // furnished to do so, subject to the following conditions:
2336 //
2336 //
2337 // The above copyright notice and this permission notice shall be included in
2337 // The above copyright notice and this permission notice shall be included in
2338 // all copies or substantial portions of the Software.
2338 // all copies or substantial portions of the Software.
2339 //
2339 //
2340 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2340 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2341 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2341 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2342 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2342 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2343 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2343 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2344 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2344 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2345 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2345 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
2346 // THE SOFTWARE.
2346 // THE SOFTWARE.
2347
2347
2348 /**
2348 /**
2349 * This behaves like a WebSocket in every way, except if it fails to connect,
2349 * This behaves like a WebSocket in every way, except if it fails to connect,
2350 * or it gets disconnected, it will repeatedly poll until it succesfully connects
2350 * or it gets disconnected, it will repeatedly poll until it succesfully connects
2351 * again.
2351 * again.
2352 *
2352 *
2353 * It is API compatible, so when you have:
2353 * It is API compatible, so when you have:
2354 * ws = new WebSocket('ws://....');
2354 * ws = new WebSocket('ws://....');
2355 * you can replace with:
2355 * you can replace with:
2356 * ws = new ReconnectingWebSocket('ws://....');
2356 * ws = new ReconnectingWebSocket('ws://....');
2357 *
2357 *
2358 * The event stream will typically look like:
2358 * The event stream will typically look like:
2359 * onconnecting
2359 * onconnecting
2360 * onopen
2360 * onopen
2361 * onmessage
2361 * onmessage
2362 * onmessage
2362 * onmessage
2363 * onclose // lost connection
2363 * onclose // lost connection
2364 * onconnecting
2364 * onconnecting
2365 * onopen // sometime later...
2365 * onopen // sometime later...
2366 * onmessage
2366 * onmessage
2367 * onmessage
2367 * onmessage
2368 * etc...
2368 * etc...
2369 *
2369 *
2370 * It is API compatible with the standard WebSocket API.
2370 * It is API compatible with the standard WebSocket API.
2371 *
2371 *
2372 * Latest version: https://github.com/joewalnes/reconnecting-websocket/
2372 * Latest version: https://github.com/joewalnes/reconnecting-websocket/
2373 * - Joe Walnes
2373 * - Joe Walnes
2374 */
2374 */
2375 function ReconnectingWebSocket(url, protocols) {
2375 function ReconnectingWebSocket(url, protocols) {
2376 protocols = protocols || [];
2376 protocols = protocols || [];
2377
2377
2378 // These can be altered by calling code.
2378 // These can be altered by calling code.
2379 this.debug = false;
2379 this.debug = false;
2380 this.reconnectInterval = 1000;
2380 this.reconnectInterval = 1000;
2381 this.timeoutInterval = 2000;
2381 this.timeoutInterval = 2000;
2382
2382
2383 var self = this;
2383 var self = this;
2384 var ws;
2384 var ws;
2385 var forcedClose = false;
2385 var forcedClose = false;
2386 var timedOut = false;
2386 var timedOut = false;
2387
2387
2388 this.url = url;
2388 this.url = url;
2389 this.protocols = protocols;
2389 this.protocols = protocols;
2390 this.readyState = WebSocket.CONNECTING;
2390 this.readyState = WebSocket.CONNECTING;
2391 this.URL = url; // Public API
2391 this.URL = url; // Public API
2392
2392
2393 this.onopen = function(event) {
2393 this.onopen = function(event) {
2394 };
2394 };
2395
2395
2396 this.onclose = function(event) {
2396 this.onclose = function(event) {
2397 };
2397 };
2398
2398
2399 this.onconnecting = function(event) {
2399 this.onconnecting = function(event) {
2400 };
2400 };
2401
2401
2402 this.onmessage = function(event) {
2402 this.onmessage = function(event) {
2403 };
2403 };
2404
2404
2405 this.onerror = function(event) {
2405 this.onerror = function(event) {
2406 };
2406 };
2407
2407
2408 function connect(reconnectAttempt) {
2408 function connect(reconnectAttempt) {
2409 ws = new WebSocket(url, protocols);
2409 ws = new WebSocket(url, protocols);
2410
2410
2411 self.onconnecting();
2411 self.onconnecting();
2412 if (self.debug || ReconnectingWebSocket.debugAll) {
2412 if (self.debug || ReconnectingWebSocket.debugAll) {
2413 console.debug('ReconnectingWebSocket', 'attempt-connect', url);
2413 console.debug('ReconnectingWebSocket', 'attempt-connect', url);
2414 }
2414 }
2415
2415
2416 var localWs = ws;
2416 var localWs = ws;
2417 var timeout = setTimeout(function() {
2417 var timeout = setTimeout(function() {
2418 if (self.debug || ReconnectingWebSocket.debugAll) {
2418 if (self.debug || ReconnectingWebSocket.debugAll) {
2419 console.debug('ReconnectingWebSocket', 'connection-timeout', url);
2419 console.debug('ReconnectingWebSocket', 'connection-timeout', url);
2420 }
2420 }
2421 timedOut = true;
2421 timedOut = true;
2422 localWs.close();
2422 localWs.close();
2423 timedOut = false;
2423 timedOut = false;
2424 }, self.timeoutInterval);
2424 }, self.timeoutInterval);
2425
2425
2426 ws.onopen = function(event) {
2426 ws.onopen = function(event) {
2427 clearTimeout(timeout);
2427 clearTimeout(timeout);
2428 if (self.debug || ReconnectingWebSocket.debugAll) {
2428 if (self.debug || ReconnectingWebSocket.debugAll) {
2429 console.debug('ReconnectingWebSocket', 'onopen', url);
2429 console.debug('ReconnectingWebSocket', 'onopen', url);
2430 }
2430 }
2431 self.readyState = WebSocket.OPEN;
2431 self.readyState = WebSocket.OPEN;
2432 reconnectAttempt = false;
2432 reconnectAttempt = false;
2433 self.onopen(event);
2433 self.onopen(event);
2434 };
2434 };
2435
2435
2436 ws.onclose = function(event) {
2436 ws.onclose = function(event) {
2437 clearTimeout(timeout);
2437 clearTimeout(timeout);
2438 ws = null;
2438 ws = null;
2439 if (forcedClose) {
2439 if (forcedClose) {
2440 self.readyState = WebSocket.CLOSED;
2440 self.readyState = WebSocket.CLOSED;
2441 self.onclose(event);
2441 self.onclose(event);
2442 } else {
2442 } else {
2443 self.readyState = WebSocket.CONNECTING;
2443 self.readyState = WebSocket.CONNECTING;
2444 self.onconnecting();
2444 self.onconnecting();
2445 if (!reconnectAttempt && !timedOut) {
2445 if (!reconnectAttempt && !timedOut) {
2446 if (self.debug || ReconnectingWebSocket.debugAll) {
2446 if (self.debug || ReconnectingWebSocket.debugAll) {
2447 console.debug('ReconnectingWebSocket', 'onclose', url);
2447 console.debug('ReconnectingWebSocket', 'onclose', url);
2448 }
2448 }
2449 self.onclose(event);
2449 self.onclose(event);
2450 }
2450 }
2451 setTimeout(function() {
2451 setTimeout(function() {
2452 connect(true);
2452 connect(true);
2453 }, self.reconnectInterval);
2453 }, self.reconnectInterval);
2454 }
2454 }
2455 };
2455 };
2456 ws.onmessage = function(event) {
2456 ws.onmessage = function(event) {
2457 if (self.debug || ReconnectingWebSocket.debugAll) {
2457 if (self.debug || ReconnectingWebSocket.debugAll) {
2458 console.debug('ReconnectingWebSocket', 'onmessage', url, event.data);
2458 console.debug('ReconnectingWebSocket', 'onmessage', url, event.data);
2459 }
2459 }
2460 self.onmessage(event);
2460 self.onmessage(event);
2461 };
2461 };
2462 ws.onerror = function(event) {
2462 ws.onerror = function(event) {
2463 if (self.debug || ReconnectingWebSocket.debugAll) {
2463 if (self.debug || ReconnectingWebSocket.debugAll) {
2464 console.debug('ReconnectingWebSocket', 'onerror', url, event);
2464 console.debug('ReconnectingWebSocket', 'onerror', url, event);
2465 }
2465 }
2466 self.onerror(event);
2466 self.onerror(event);
2467 };
2467 };
2468 }
2468 }
2469 connect(url);
2469 connect(url);
2470
2470
2471 this.send = function(data) {
2471 this.send = function(data) {
2472 if (ws) {
2472 if (ws) {
2473 if (self.debug || ReconnectingWebSocket.debugAll) {
2473 if (self.debug || ReconnectingWebSocket.debugAll) {
2474 console.debug('ReconnectingWebSocket', 'send', url, data);
2474 console.debug('ReconnectingWebSocket', 'send', url, data);
2475 }
2475 }
2476 return ws.send(data);
2476 return ws.send(data);
2477 } else {
2477 } else {
2478 throw 'INVALID_STATE_ERR : Pausing to reconnect websocket';
2478 throw 'INVALID_STATE_ERR : Pausing to reconnect websocket';
2479 }
2479 }
2480 };
2480 };
2481
2481
2482 this.close = function() {
2482 this.close = function() {
2483 if (ws) {
2483 if (ws) {
2484 forcedClose = true;
2484 forcedClose = true;
2485 ws.close();
2485 ws.close();
2486 }
2486 }
2487 };
2487 };
2488
2488
2489 /**
2489 /**
2490 * Additional public API method to refresh the connection if still open (close, re-open).
2490 * Additional public API method to refresh the connection if still open (close, re-open).
2491 * For example, if the app suspects bad data / missed heart beats, it can try to refresh.
2491 * For example, if the app suspects bad data / missed heart beats, it can try to refresh.
2492 */
2492 */
2493 this.refresh = function() {
2493 this.refresh = function() {
2494 if (ws) {
2494 if (ws) {
2495 ws.close();
2495 ws.close();
2496 }
2496 }
2497 };
2497 };
2498 }
2498 }
2499
2499
2500 /**
2500 /**
2501 * Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true.
2501 * Setting this to true is the equivalent of setting all instances of ReconnectingWebSocket.debug to true.
2502 */
2502 */
2503 ReconnectingWebSocket.debugAll = false;
2503 ReconnectingWebSocket.debugAll = false;
2504
2504
2505
2505
2506 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
2506 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
2507 // #
2507 // #
2508 // # This program is free software: you can redistribute it and/or modify
2508 // # This program is free software: you can redistribute it and/or modify
2509 // # it under the terms of the GNU Affero General Public License, version 3
2509 // # it under the terms of the GNU Affero General Public License, version 3
2510 // # (only), as published by the Free Software Foundation.
2510 // # (only), as published by the Free Software Foundation.
2511 // #
2511 // #
2512 // # This program is distributed in the hope that it will be useful,
2512 // # This program is distributed in the hope that it will be useful,
2513 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
2513 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
2514 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2514 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2515 // # GNU General Public License for more details.
2515 // # GNU General Public License for more details.
2516 // #
2516 // #
2517 // # You should have received a copy of the GNU Affero General Public License
2517 // # You should have received a copy of the GNU Affero General Public License
2518 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
2518 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
2519 // #
2519 // #
2520 // # This program is dual-licensed. If you wish to learn more about the
2520 // # This program is dual-licensed. If you wish to learn more about the
2521 // # AppEnlight Enterprise Edition, including its added features, Support
2521 // # AppEnlight Enterprise Edition, including its added features, Support
2522 // # services, and proprietary license terms, please see
2522 // # services, and proprietary license terms, please see
2523 // # https://rhodecode.com/licenses/
2523 // # https://rhodecode.com/licenses/
2524
2524
2525 if (!String.prototype.trim) {
2525 if (!String.prototype.trim) {
2526 String.prototype.trim = function () {
2526 String.prototype.trim = function () {
2527 return this.replace(/^\s+|\s+$/g, '');
2527 return this.replace(/^\s+|\s+$/g, '');
2528 };
2528 };
2529
2529
2530 String.prototype.ltrim = function () {
2530 String.prototype.ltrim = function () {
2531 return this.replace(/^\s+/, '');
2531 return this.replace(/^\s+/, '');
2532 };
2532 };
2533
2533
2534 String.prototype.rtrim = function () {
2534 String.prototype.rtrim = function () {
2535 return this.replace(/\s+$/, '');
2535 return this.replace(/\s+$/, '');
2536 };
2536 };
2537
2537
2538 String.prototype.fulltrim = function () {
2538 String.prototype.fulltrim = function () {
2539 return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ');
2539 return this.replace(/(?:(?:^|\n)\s+|\s+(?:$|\n))/g, '').replace(/\s+/g, ' ');
2540 };
2540 };
2541 }
2541 }
2542
2542
2543 function decodeEncodedJSON (input){
2543 function decodeEncodedJSON (input){
2544 try{
2544 try{
2545 var val = JSON.parse(input);
2545 var val = JSON.parse(input);
2546 delete doc;
2546 delete doc;
2547 return val;
2547 return val;
2548 }catch(exc){
2548 }catch(exc){
2549
2549
2550 delete doc;
2550 delete doc;
2551 }
2551 }
2552 }
2552 }
2553
2553
2554 function parseTagsToSearch(searchParams) {
2554 function parseTagsToSearch(searchParams) {
2555 var params = {};
2555 var params = {};
2556 _.each(searchParams.tags, function (t) {
2556 _.each(searchParams.tags, function (t) {
2557 if (!_.has(params, t.type)) {
2557 if (!_.has(params, t.type)) {
2558 params[t.type] = [];
2558 params[t.type] = [];
2559 }
2559 }
2560 params[t.type].push(t.value);
2560 params[t.type].push(t.value);
2561 });
2561 });
2562 if (searchParams.page > 1){
2562 if (searchParams.page > 1){
2563 params.page = searchParams.page;
2563 params.page = searchParams.page;
2564 }
2564 }
2565 return params;
2565 return params;
2566 }
2566 }
2567
2567
2568 function parseSearchToTags(search) {
2568 function parseSearchToTags(search) {
2569 var config = {page: 1, tags: [], type:''};
2569 var config = {page: 1, tags: [], type:''};
2570 _.each(_.pairs(search), function (obj) {
2570 _.each(_.pairs(search), function (obj) {
2571 if (_.isArray(obj[1])) {
2571 if (_.isArray(obj[1])) {
2572 _.each(obj[1], function (obj2) {
2572 _.each(obj[1], function (obj2) {
2573 config.tags.push({type: obj[0], value: obj2});
2573 config.tags.push({type: obj[0], value: obj2});
2574 })
2574 })
2575 } else {
2575 } else {
2576 if (obj[0] == 'page') {
2576 if (obj[0] == 'page') {
2577 config.page = obj[1];
2577 config.page = obj[1];
2578 }
2578 }
2579 else if (obj[0] == 'type') {
2579 else if (obj[0] == 'type') {
2580 config.type = obj[1];
2580 config.type = obj[1];
2581 }
2581 }
2582 else {
2582 else {
2583 config.tags.push({type: obj[0], value: obj[1]});
2583 config.tags.push({type: obj[0], value: obj[1]});
2584 }
2584 }
2585
2585
2586 }
2586 }
2587 });
2587 });
2588 return config;
2588 return config;
2589 }
2589 }
2590
2590
2591
2591
2592 /* returns ISO date string from UTC now - timespan */
2592 /* returns ISO date string from UTC now - timespan */
2593 function timeSpanToStartDate(timeSpan){
2593 function timeSpanToStartDate(timeSpan){
2594 var amount = Number(timeSpan.slice(0,-1));
2594 var amount = Number(timeSpan.slice(0,-1));
2595 var unit = timeSpan.slice(-1);
2595 var unit = timeSpan.slice(-1);
2596 return moment.utc().subtract(amount, unit).format();
2596 return moment.utc().subtract(amount, unit).format();
2597 }
2597 }
2598
2598
2599 /* Sets server validation messages on form using angular machinery +
2599 /* Sets server validation messages on form using angular machinery +
2600 * custom key holding actual error messages */
2600 * custom key holding actual error messages */
2601 function setServerValidation(form, errors){
2601 function setServerValidation(form, errors){
2602
2602
2603 if (typeof form.ae_validation === 'undefined'){
2603 if (typeof form.ae_validation === 'undefined'){
2604 form.ae_validation = {};
2604 form.ae_validation = {};
2605
2605
2606 }
2606 }
2607 for (var key in form.ae_validation){
2607 for (var key in form.ae_validation){
2608 form.ae_validation[key] = [];
2608 form.ae_validation[key] = [];
2609
2609
2610 }
2610 }
2611
2611
2612
2612
2613 for (var key in form){
2613 for (var key in form){
2614 if (key[0] !== '$' && key !== 'ae_validation'){
2614 if (key[0] !== '$' && key !== 'ae_validation'){
2615 form[key].$setValidity('ae_validation', true);
2615 form[key].$setValidity('ae_validation', true);
2616 }
2616 }
2617 }
2617 }
2618 if (typeof errors !== undefined){
2618 if (typeof errors !== undefined){
2619 for (var key in errors){
2619 for (var key in errors){
2620 if (typeof form[key] !== 'undefined'){
2620 if (typeof form[key] !== 'undefined'){
2621 form[key].$setValidity('ae_validation', false);
2621 form[key].$setValidity('ae_validation', false);
2622 }
2622 }
2623 // handle wtforms and colander errors based on
2623 // handle wtforms and colander errors based on
2624 // whether we have list of erors or a single error in a key
2624 // whether we have list of erors or a single error in a key
2625 if (angular.isArray(errors[key])){
2625 if (angular.isArray(errors[key])){
2626 form.ae_validation[key] = errors[key];
2626 form.ae_validation[key] = errors[key];
2627 }
2627 }
2628 else{
2628 else{
2629 form.ae_validation[key] = [errors[key]];
2629 form.ae_validation[key] = [errors[key]];
2630 }
2630 }
2631 }
2631 }
2632 }
2632 }
2633 return form;
2633 return form;
2634 }
2634 }
2635
2635
2636 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
2636 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
2637 // #
2637 // #
2638 // # This program is free software: you can redistribute it and/or modify
2638 // # This program is free software: you can redistribute it and/or modify
2639 // # it under the terms of the GNU Affero General Public License, version 3
2639 // # it under the terms of the GNU Affero General Public License, version 3
2640 // # (only), as published by the Free Software Foundation.
2640 // # (only), as published by the Free Software Foundation.
2641 // #
2641 // #
2642 // # This program is distributed in the hope that it will be useful,
2642 // # This program is distributed in the hope that it will be useful,
2643 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
2643 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
2644 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2644 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2645 // # GNU General Public License for more details.
2645 // # GNU General Public License for more details.
2646 // #
2646 // #
2647 // # You should have received a copy of the GNU Affero General Public License
2647 // # You should have received a copy of the GNU Affero General Public License
2648 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
2648 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
2649 // #
2649 // #
2650 // # This program is dual-licensed. If you wish to learn more about the
2650 // # This program is dual-licensed. If you wish to learn more about the
2651 // # AppEnlight Enterprise Edition, including its added features, Support
2651 // # AppEnlight Enterprise Edition, including its added features, Support
2652 // # services, and proprietary license terms, please see
2652 // # services, and proprietary license terms, please see
2653 // # https://rhodecode.com/licenses/
2653 // # https://rhodecode.com/licenses/
2654
2654
2655 'use strict';
2655 'use strict';
2656
2656
2657 // Declare app level module which depends on filters, and services
2657 // Declare app level module which depends on filters, and services
2658 angular.module('appenlight.base', [
2658 angular.module('appenlight.base', [
2659 'ngRoute',
2659 'ngRoute',
2660 'ui.router',
2660 'ui.router',
2661 'ui.router.router',
2661 'ui.router.router',
2662 'underscore',
2662 'underscore',
2663 'ui.bootstrap',
2663 'ui.bootstrap',
2664 'ngResource',
2664 'ngResource',
2665 'ngAnimate',
2665 'ngAnimate',
2666 'ngCookies',
2666 'ngCookies',
2667 'smart-table',
2667 'smart-table',
2668 'angular-toArrayFilter',
2668 'angular-toArrayFilter',
2669 'mentio'
2669 'mentio'
2670 ]);
2670 ]);
2671
2671
2672 angular.module('appenlight.filters', []);
2672 angular.module('appenlight.filters', []);
2673 angular.module('appenlight.templates', []);
2673 angular.module('appenlight.templates', []);
2674 angular.module('appenlight.controllers', [
2674 angular.module('appenlight.controllers', [
2675 'appenlight.base'
2675 'appenlight.base'
2676 ]);
2676 ]);
2677 angular.module('appenlight.components', [
2677 angular.module('appenlight.components', [
2678 'appenlight.components.channelstream'
2678 'appenlight.components.channelstream',
2679 'appenlight.components.appenlightApp',
2680 'appenlight.components.appenlightHeader'
2679 ]);
2681 ]);
2680 angular.module('appenlight.directives', [
2682 angular.module('appenlight.directives', [
2681 'appenlight.directives.appVersion',
2683 'appenlight.directives.appVersion',
2682 'appenlight.directives.c3chart',
2684 'appenlight.directives.c3chart',
2683 'appenlight.directives.confirmValidate',
2685 'appenlight.directives.confirmValidate',
2684 'appenlight.directives.focus',
2686 'appenlight.directives.focus',
2685 'appenlight.directives.formErrors',
2687 'appenlight.directives.formErrors',
2686 'appenlight.directives.humanFormat',
2688 'appenlight.directives.humanFormat',
2687 'appenlight.directives.isoToRelativeTime',
2689 'appenlight.directives.isoToRelativeTime',
2688 'appenlight.directives.permissionsForm',
2690 'appenlight.directives.permissionsForm',
2689 'appenlight.directives.smallReportGroupList',
2691 'appenlight.directives.smallReportGroupList',
2690 'appenlight.directives.smallReportList',
2692 'appenlight.directives.smallReportList',
2691 'appenlight.directives.pluginConfig',
2693 'appenlight.directives.pluginConfig',
2692 'appenlight.directives.recursive',
2694 'appenlight.directives.recursive',
2693 'appenlight.directives.reportAlertAction',
2695 'appenlight.directives.reportAlertAction',
2694 'appenlight.directives.postProcessAction',
2696 'appenlight.directives.postProcessAction',
2695 'appenlight.directives.rule',
2697 'appenlight.directives.rule',
2696 'appenlight.directives.ruleReadOnly'
2698 'appenlight.directives.ruleReadOnly'
2697 ]);
2699 ]);
2698 angular.module('appenlight.services', [
2700 angular.module('appenlight.services', [
2699 'appenlight.services.chartResultParser',
2701 'appenlight.services.chartResultParser',
2700 'appenlight.services.resources',
2702 'appenlight.services.resources',
2701 'appenlight.services.stateHolder',
2703 'appenlight.services.stateHolder',
2702 'appenlight.services.typeAheadTagHelper',
2704 'appenlight.services.typeAheadTagHelper',
2703 'appenlight.services.UUIDProvider'
2705 'appenlight.services.UUIDProvider'
2704 ]).value('version', '0.1');
2706 ]).value('version', '0.1');
2705
2707
2706
2708
2707 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
2709 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
2708 function(item){
2710 function(item){
2709 return item.config.angular_module
2711 return item.config.angular_module
2710 });
2712 });
2711
2713
2712 angular.module('appenlight.plugins', pluginsToLoad);
2714 angular.module('appenlight.plugins', pluginsToLoad);
2713
2715
2714 var app = angular.module('appenlight', [
2716 var app = angular.module('appenlight', [
2715 'appenlight.base',
2717 'appenlight.base',
2716 'appenlight.config',
2718 'appenlight.config',
2717 'appenlight.templates',
2719 'appenlight.templates',
2718 'appenlight.filters',
2720 'appenlight.filters',
2719 'appenlight.services',
2721 'appenlight.services',
2720 'appenlight.directives',
2722 'appenlight.directives',
2721 'appenlight.controllers',
2723 'appenlight.controllers',
2722 'appenlight.components',
2724 'appenlight.components',
2723 'appenlight.plugins'
2725 'appenlight.plugins'
2724 ]);
2726 ]);
2725
2727
2726 // needs manual execution because of plugin files
2728 // needs manual execution because of plugin files
2727 function kickstartAE(initialUserData) {
2729 function kickstartAE(initialUserData) {
2728 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
2730 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
2729 $locationProvider.html5Mode(true);
2731 $locationProvider.html5Mode(true);
2730 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
2732 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
2731 return {
2733 return {
2732 'response': function (response) {
2734 'response': function (response) {
2733 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
2735 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
2734 if (flashMessages && flashMessages.length > 0) {
2736 if (flashMessages && flashMessages.length > 0) {
2735 stateHolder.flashMessages.extend(flashMessages);
2737 stateHolder.flashMessages.extend(flashMessages);
2736 }
2738 }
2737 return response;
2739 return response;
2738 },
2740 },
2739 'responseError': function (rejection) {
2741 'responseError': function (rejection) {
2740 if (rejection.status > 299 && rejection.status !== 422) {
2742 if (rejection.status > 299 && rejection.status !== 422) {
2741 stateHolder.flashMessages.extend([{
2743 stateHolder.flashMessages.extend([{
2742 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
2744 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
2743 type: 'error'
2745 type: 'error'
2744 }]);
2746 }]);
2745 }
2747 }
2746 if (rejection.status == 0) {
2748 if (rejection.status == 0) {
2747 stateHolder.flashMessages.extend([{
2749 stateHolder.flashMessages.extend([{
2748 msg: 'Response timeout',
2750 msg: 'Response timeout',
2749 type: 'error'
2751 type: 'error'
2750 }]);
2752 }]);
2751 }
2753 }
2752 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
2754 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
2753 if (flashMessages && flashMessages.length > 0) {
2755 if (flashMessages && flashMessages.length > 0) {
2754 stateHolder.flashMessages.extend(flashMessages);
2756 stateHolder.flashMessages.extend(flashMessages);
2755 }
2757 }
2756
2758
2757 return $q.reject(rejection);
2759 return $q.reject(rejection);
2758 }
2760 }
2759 }
2761 }
2760 }]);
2762 }]);
2761
2763
2762 $uibTooltipProvider.options({appendToBody: true});
2764 $uibTooltipProvider.options({appendToBody: true});
2763
2765
2764 }]);
2766 }]);
2765
2767
2766
2768
2767 app.config(function ($provide) {
2769 app.config(function ($provide) {
2768 $provide.decorator("$exceptionHandler", function ($delegate) {
2770 $provide.decorator("$exceptionHandler", function ($delegate) {
2769 return function (exception, cause) {
2771 return function (exception, cause) {
2770 $delegate(exception, cause);
2772 $delegate(exception, cause);
2771 if (typeof AppEnlight !== 'undefined') {
2773 if (typeof AppEnlight !== 'undefined') {
2772 AppEnlight.grabError(exception);
2774 AppEnlight.grabError(exception);
2773 }
2775 }
2774 };
2776 };
2775 });
2777 });
2776 });
2778 });
2777
2779
2778 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
2780 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
2779 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
2781 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
2780 if (initialUserData){
2782 if (initialUserData){
2781 stateHolder.AeUser.update(initialUserData);
2783 stateHolder.AeUser.update(initialUserData);
2782 }
2784 }
2783 $rootScope.$state = $state;
2785 $rootScope.$state = $state;
2784 $rootScope.stateHolder = stateHolder;
2786 $rootScope.stateHolder = stateHolder;
2785 $rootScope.flash = stateHolder.flashMessages.list;
2787 $rootScope.flash = stateHolder.flashMessages.list;
2786 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
2788 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
2787 $rootScope.AeConfig = AeConfig;
2789 $rootScope.AeConfig = AeConfig;
2788
2790
2789 var transitionApp = function($transition$, $state) {
2791 var transitionApp = function($transition$, $state) {
2790 // redirect user to /register unless its one of open views
2792 // redirect user to /register unless its one of open views
2791 var isGuestState = [
2793 var isGuestState = [
2792 'report.view_detail',
2794 'report.view_detail',
2793 'report.view_group',
2795 'report.view_group',
2794 'dashboard.view'
2796 'dashboard.view'
2795 ].indexOf($transition$.to().name) !== -1;
2797 ].indexOf($transition$.to().name) !== -1;
2796
2798
2797 var path = $window.location.pathname;
2799 var path = $window.location.pathname;
2798 // strip trailing slash
2800 // strip trailing slash
2799 if (path.substr(path.length - 1) === '/') {
2801 if (path.substr(path.length - 1) === '/') {
2800 path = path.substr(0, path.length - 1);
2802 path = path.substr(0, path.length - 1);
2801 }
2803 }
2802 var isOpenView = false;
2804 var isOpenView = false;
2803 var openViews = [
2805 var openViews = [
2804 AeConfig.urls.otherRoutes.lostPassword,
2806 AeConfig.urls.otherRoutes.lostPassword,
2805 AeConfig.urls.otherRoutes.lostPasswordGenerate
2807 AeConfig.urls.otherRoutes.lostPasswordGenerate
2806 ];
2808 ];
2807
2809
2808 _.each(openViews, function (url) {
2810 _.each(openViews, function (url) {
2809 var url = '/' + url.split('/').slice(3).join('/');
2811 var url = '/' + url.split('/').slice(3).join('/');
2810 if (url === path) {
2812 if (url === path) {
2811 isOpenView = true;
2813 isOpenView = true;
2812 }
2814 }
2813 });
2815 });
2814 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
2816 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
2815 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
2817 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
2816
2818
2817 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
2819 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
2818 // fix infinite digest here
2820 // fix infinite digest here
2819 $rootScope.$on('$locationChangeStart',
2821 $rootScope.$on('$locationChangeStart',
2820 function(event, toState, toParams, fromState, fromParams, options){
2822 function(event, toState, toParams, fromState, fromParams, options){
2821 event.preventDefault();
2823 event.preventDefault();
2822 $window.location = newLocation;
2824 $window.location = newLocation;
2823 });
2825 });
2824 $window.location = newLocation;
2826 $window.location = newLocation;
2825 return false;
2827 return false;
2826 }
2828 }
2827 return false;
2829 return false;
2828 }
2830 }
2829 return true;
2831 return true;
2830 };
2832 };
2831 $transitions.onBefore({}, transitionApp);
2833 $transitions.onBefore({}, transitionApp);
2832
2834
2833 }]);
2835 }]);
2834 }
2836 }
2835
2837
2836 ;angular.module('appenlight.templates').run(['$templateCache', function($templateCache) {
2838 ;angular.module('appenlight.templates').run(['$templateCache', function($templateCache) {
2837 'use strict';
2839 'use strict';
2838
2840
2839 $templateCache.put('templates/admin/applications/applications_list.html',
2841 $templateCache.put('templates/admin/applications/applications_list.html',
2840 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
2842 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
2841 "\n" +
2843 "\n" +
2842 "<div class=\"panel panel-default\" ng-if=\"!applications.loading.applications\">\n" +
2844 "<div class=\"panel panel-default\" ng-if=\"!applications.loading.applications\">\n" +
2843 " <div class=\"panel-heading\">\n" +
2845 " <div class=\"panel-heading\">\n" +
2844 "\n" +
2846 "\n" +
2845 " Currently active applications: {{applications.applications.length}}\n" +
2847 " Currently active applications: {{applications.applications.length}}\n" +
2846 "\n" +
2848 "\n" +
2847 " </div>\n" +
2849 " </div>\n" +
2848 "\n" +
2850 "\n" +
2849 " <table st-table=\"displayedCollection\" st-safe-src=\"applications.applications\" class=\"table table-striped\">\n" +
2851 " <table st-table=\"displayedCollection\" st-safe-src=\"applications.applications\" class=\"table table-striped\">\n" +
2850 " <thead>\n" +
2852 " <thead>\n" +
2851 " <tr>\n" +
2853 " <tr>\n" +
2852 " <th st-sort=\"resource_name\"><a>Application name</a></th>\n" +
2854 " <th st-sort=\"resource_name\"><a>Application name</a></th>\n" +
2853 " <th st-sort=\"owner_user_name\"><a>Owner User</a></th>\n" +
2855 " <th st-sort=\"owner_user_name\"><a>Owner User</a></th>\n" +
2854 " <th st-sort=\"owner_group_name\"><a>Owner Group</a></th>\n" +
2856 " <th st-sort=\"owner_group_name\"><a>Owner Group</a></th>\n" +
2855 " <th class=\"options\"></th>\n" +
2857 " <th class=\"options\"></th>\n" +
2856 " </tr>\n" +
2858 " </tr>\n" +
2857 " <tr>\n" +
2859 " <tr>\n" +
2858 " <th><input st-search=\"resource_name\" placeholder=\"search for application\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2860 " <th><input st-search=\"resource_name\" placeholder=\"search for application\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2859 " <th><input st-search=\"owner_user_name\" placeholder=\"search for user\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2861 " <th><input st-search=\"owner_user_name\" placeholder=\"search for user\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2860 " <th><input st-search=\"owner_group_name\" placeholder=\"search for group\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2862 " <th><input st-search=\"owner_group_name\" placeholder=\"search for group\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
2861 " <th></th>\n" +
2863 " <th></th>\n" +
2862 " </tr>\n" +
2864 " </tr>\n" +
2863 " </thead>\n" +
2865 " </thead>\n" +
2864 " <tbody>\n" +
2866 " <tbody>\n" +
2865 "\n" +
2867 "\n" +
2866 " <tr ng-repeat=\"resource in displayedCollection track by resource.resource_id\">\n" +
2868 " <tr ng-repeat=\"resource in displayedCollection track by resource.resource_id\">\n" +
2867 " <td> {{resource.resource_name}}</td>\n" +
2869 " <td> {{resource.resource_name}}</td>\n" +
2868 " <td>{{resource.owner_user_name}}</td>\n" +
2870 " <td>{{resource.owner_user_name}}</td>\n" +
2869 " <td>{{resource.owner_group_name}}</td>\n" +
2871 " <td>{{resource.owner_group_name}}</td>\n" +
2870 " <td>\n" +
2872 " <td>\n" +
2871 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"applications.update({resourceId:resource.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span></a>\n" +
2873 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"applications.update({resourceId:resource.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span></a>\n" +
2872 " </td>\n" +
2874 " </td>\n" +
2873 " </tr>\n" +
2875 " </tr>\n" +
2874 " <tfoot>\n" +
2876 " <tfoot>\n" +
2875 " <tr>\n" +
2877 " <tr>\n" +
2876 " <td colspan=\"4\" class=\"text-center\">\n" +
2878 " <td colspan=\"4\" class=\"text-center\">\n" +
2877 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
2879 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
2878 " </td>\n" +
2880 " </td>\n" +
2879 " </tr>\n" +
2881 " </tr>\n" +
2880 " </tfoot>\n" +
2882 " </tfoot>\n" +
2881 " </tbody>\n" +
2883 " </tbody>\n" +
2882 " </table>\n" +
2884 " </table>\n" +
2883 "\n" +
2885 "\n" +
2884 "</div>\n"
2886 "</div>\n"
2885 );
2887 );
2886
2888
2887
2889
2888 $templateCache.put('templates/admin/configs/edit.html',
2890 $templateCache.put('templates/admin/configs/edit.html',
2889 "<ng-include src=\"'templates/loader.html'\" ng-if=\"configs.loading.config\"></ng-include>\n" +
2891 "<ng-include src=\"'templates/loader.html'\" ng-if=\"configs.loading.config\"></ng-include>\n" +
2890 "\n" +
2892 "\n" +
2891 "<div class=\"panel panel-default\" ng-show=\"!configs.loading.config\">\n" +
2893 "<div class=\"panel panel-default\" ng-show=\"!configs.loading.config\">\n" +
2892 " <div class=\"panel-heading\">\n" +
2894 " <div class=\"panel-heading\">\n" +
2893 " <h3 class=\"panel-title\">Basic Configuration</h3>\n" +
2895 " <h3 class=\"panel-title\">Basic Configuration</h3>\n" +
2894 " </div>\n" +
2896 " </div>\n" +
2895 " <div class=\"panel-body\">\n" +
2897 " <div class=\"panel-body\">\n" +
2896 " <h2>Visual</h2>\n" +
2898 " <h2>Visual</h2>\n" +
2897 " <form class=\"form-horizontal\">\n" +
2899 " <form class=\"form-horizontal\">\n" +
2898 " <div class=\"form-group\">\n" +
2900 " <div class=\"form-group\">\n" +
2899 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2901 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2900 " Footer HTML\n" +
2902 " Footer HTML\n" +
2901 " </label>\n" +
2903 " </label>\n" +
2902 " <div class=\"col-sm-8 col-lg-9\">\n" +
2904 " <div class=\"col-sm-8 col-lg-9\">\n" +
2903 " <textarea class=\"form-control\" type=\"text\" ng-model=\"configs.configs.global.template_footer_html.value\" style=\"min-height: 150px\"></textarea>\n" +
2905 " <textarea class=\"form-control\" type=\"text\" ng-model=\"configs.configs.global.template_footer_html.value\" style=\"min-height: 150px\"></textarea>\n" +
2904 " </div>\n" +
2906 " </div>\n" +
2905 " </div>\n" +
2907 " </div>\n" +
2906 " </form>\n" +
2908 " </form>\n" +
2907 "\n" +
2909 "\n" +
2908 " <h2>Functional</h2>\n" +
2910 " <h2>Functional</h2>\n" +
2909 "\n" +
2911 "\n" +
2910 " <form class=\"form-horizontal\">\n" +
2912 " <form class=\"form-horizontal\">\n" +
2911 " <div class=\"form-group\">\n" +
2913 " <div class=\"form-group\">\n" +
2912 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2914 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2913 " Show user groups to non-admin users\n" +
2915 " Show user groups to non-admin users\n" +
2914 " </label>\n" +
2916 " </label>\n" +
2915 " <div class=\"col-sm-8 col-lg-9\">\n" +
2917 " <div class=\"col-sm-8 col-lg-9\">\n" +
2916 " <button type=\"button\" class=\"btn btn-default\" ng-model=\"configs.configs.global.list_groups_to_non_admins.value\" uib-btn-checkbox>\n" +
2918 " <button type=\"button\" class=\"btn btn-default\" ng-model=\"configs.configs.global.list_groups_to_non_admins.value\" uib-btn-checkbox>\n" +
2917 " Enable\n" +
2919 " Enable\n" +
2918 " </button>\n" +
2920 " </button>\n" +
2919 " </div>\n" +
2921 " </div>\n" +
2920 " </div>\n" +
2922 " </div>\n" +
2921 " </form>\n" +
2923 " </form>\n" +
2922 "\n" +
2924 "\n" +
2923 " <h2>Global Rate Limiting</h2>\n" +
2925 " <h2>Global Rate Limiting</h2>\n" +
2924 "\n" +
2926 "\n" +
2925 " <form class=\"form-horizontal\">\n" +
2927 " <form class=\"form-horizontal\">\n" +
2926 " <div class=\"form-group\">\n" +
2928 " <div class=\"form-group\">\n" +
2927 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2929 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2928 " Ignore reports per minute/per application\n" +
2930 " Ignore reports per minute/per application\n" +
2929 " </label>\n" +
2931 " </label>\n" +
2930 " <div class=\"col-sm-8 col-lg-9\">\n" +
2932 " <div class=\"col-sm-8 col-lg-9\">\n" +
2931 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_reports_rate_limit.value\" />\n" +
2933 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_reports_rate_limit.value\" />\n" +
2932 " </div>\n" +
2934 " </div>\n" +
2933 " </div>\n" +
2935 " </div>\n" +
2934 "\n" +
2936 "\n" +
2935 " <div class=\"form-group\">\n" +
2937 " <div class=\"form-group\">\n" +
2936 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2938 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2937 " Ignore logs per minute/per application\n" +
2939 " Ignore logs per minute/per application\n" +
2938 " </label>\n" +
2940 " </label>\n" +
2939 " <div class=\"col-sm-8 col-lg-9\">\n" +
2941 " <div class=\"col-sm-8 col-lg-9\">\n" +
2940 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_logs_rate_limit.value\" />\n" +
2942 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_logs_rate_limit.value\" />\n" +
2941 " </div>\n" +
2943 " </div>\n" +
2942 " </div>\n" +
2944 " </div>\n" +
2943 "\n" +
2945 "\n" +
2944 " <div class=\"form-group\">\n" +
2946 " <div class=\"form-group\">\n" +
2945 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2947 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
2946 " Ignore metrics per minute/per application\n" +
2948 " Ignore metrics per minute/per application\n" +
2947 " </label>\n" +
2949 " </label>\n" +
2948 " <div class=\"col-sm-8 col-lg-9\">\n" +
2950 " <div class=\"col-sm-8 col-lg-9\">\n" +
2949 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_metrics_rate_limit.value\" />\n" +
2951 " <input class=\"form-control\" type=\"number\" ng-model=\"configs.configs.global.per_application_metrics_rate_limit.value\" />\n" +
2950 " </div>\n" +
2952 " </div>\n" +
2951 " </div>\n" +
2953 " </div>\n" +
2952 "\n" +
2954 "\n" +
2953 " </form>\n" +
2955 " </form>\n" +
2954 "\n" +
2956 "\n" +
2955 " <hr/>\n" +
2957 " <hr/>\n" +
2956 "\n" +
2958 "\n" +
2957 " <a class=\"btn btn-primary\" ng-click=\"configs.save()\">Save configuration</a>\n" +
2959 " <a class=\"btn btn-primary\" ng-click=\"configs.save()\">Save configuration</a>\n" +
2958 " </div>\n" +
2960 " </div>\n" +
2959 "\n" +
2961 "\n" +
2960 "</div>\n" +
2962 "</div>\n" +
2961 "\n" +
2963 "\n" +
2962 "\n" +
2964 "\n" +
2963 "<div class=\"panel panel-default\">\n" +
2965 "<div class=\"panel panel-default\">\n" +
2964 " <div class=\"panel-heading\">\n" +
2966 " <div class=\"panel-heading\">\n" +
2965 " <h3 class=\"panel-title\">Plugin Configuration</h3>\n" +
2967 " <h3 class=\"panel-title\">Plugin Configuration</h3>\n" +
2966 " </div>\n" +
2968 " </div>\n" +
2967 " <div class=\"panel-body\">\n" +
2969 " <div class=\"panel-body\">\n" +
2968 " <plugin-config section=\"'admin.config'\">\n" +
2970 " <plugin-config section=\"'admin.config'\">\n" +
2969 " </plugin-config>\n" +
2971 " </plugin-config>\n" +
2970 " </div>\n" +
2972 " </div>\n" +
2971 "</div>\n"
2973 "</div>\n"
2972 );
2974 );
2973
2975
2974
2976
2975 $templateCache.put('templates/admin/configs/parent_view.html',
2977 $templateCache.put('templates/admin/configs/parent_view.html',
2976 "<div ui-view></div>"
2978 "<div ui-view></div>"
2977 );
2979 );
2978
2980
2979
2981
2980 $templateCache.put('templates/admin/groups/groups_create.html',
2982 $templateCache.put('templates/admin/groups/groups_create.html',
2981 "<ng-include src=\"'templates/loader.html'\" ng-if=\"group.loading.group\"></ng-include>\n" +
2983 "<ng-include src=\"'templates/loader.html'\" ng-if=\"group.loading.group\"></ng-include>\n" +
2982 "\n" +
2984 "\n" +
2983 "<div ng-show=\"!group.loading.group\">\n" +
2985 "<div ng-show=\"!group.loading.group\">\n" +
2984 "\n" +
2986 "\n" +
2985 " <div class=\"panel panel-default\">\n" +
2987 " <div class=\"panel panel-default\">\n" +
2986 " <div class=\"panel-body\">\n" +
2988 " <div class=\"panel-body\">\n" +
2987 " <form name=\"group.groupForm\" class=\"form-horizontal\" ng-submit=\"group.createGroup()\">\n" +
2989 " <form name=\"group.groupForm\" class=\"form-horizontal\" ng-submit=\"group.createGroup()\">\n" +
2988 " <div class=\"form-group\" id=\"row-group_name\">\n" +
2990 " <div class=\"form-group\" id=\"row-group_name\">\n" +
2989 " <data-form-errors errors=\"group.groupForm.ae_validation.group_name\"></data-form-errors>\n" +
2991 " <data-form-errors errors=\"group.groupForm.ae_validation.group_name\"></data-form-errors>\n" +
2990 " <label for=\"group_name\" id=\"label-group_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
2992 " <label for=\"group_name\" id=\"label-group_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
2991 " Group name\n" +
2993 " Group name\n" +
2992 " <span class=\"required\">*</span>\n" +
2994 " <span class=\"required\">*</span>\n" +
2993 " </label>\n" +
2995 " </label>\n" +
2994 " <div class=\"col-sm-8 col-lg-9\">\n" +
2996 " <div class=\"col-sm-8 col-lg-9\">\n" +
2995 " <input class=\"form-control\" id=\"group_name\" name=\"group_name\" type=\"text\" ng-model=\"group.group.group_name\">\n" +
2997 " <input class=\"form-control\" id=\"group_name\" name=\"group_name\" type=\"text\" ng-model=\"group.group.group_name\">\n" +
2996 " </div>\n" +
2998 " </div>\n" +
2997 " </div>\n" +
2999 " </div>\n" +
2998 "\n" +
3000 "\n" +
2999 " <div class=\"form-group\" id=\"row-description\">\n" +
3001 " <div class=\"form-group\" id=\"row-description\">\n" +
3000 " <data-form-errors errors=\"group.groupForm.ae_validation.description\"></data-form-errors>\n" +
3002 " <data-form-errors errors=\"group.groupForm.ae_validation.description\"></data-form-errors>\n" +
3001 " <label for=\"description\" id=\"label-description\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3003 " <label for=\"description\" id=\"label-description\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3002 " Description\n" +
3004 " Description\n" +
3003 " <span class=\"required\">*</span>\n" +
3005 " <span class=\"required\">*</span>\n" +
3004 " </label>\n" +
3006 " </label>\n" +
3005 " <div class=\"col-sm-8 col-lg-9\">\n" +
3007 " <div class=\"col-sm-8 col-lg-9\">\n" +
3006 " <input class=\"form-control\" id=\"description\" name=\"description\" type=\"text\" ng-model=\"group.group.description\">\n" +
3008 " <input class=\"form-control\" id=\"description\" name=\"description\" type=\"text\" ng-model=\"group.group.description\">\n" +
3007 " </div>\n" +
3009 " </div>\n" +
3008 " </div>\n" +
3010 " </div>\n" +
3009 "\n" +
3011 "\n" +
3010 "\n" +
3012 "\n" +
3011 " <div class=\"form-group\" id=\"row-submit\">\n" +
3013 " <div class=\"form-group\" id=\"row-submit\">\n" +
3012 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3014 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3013 " </label>\n" +
3015 " </label>\n" +
3014 " <div class=\"col-sm-8 col-lg-9\">\n" +
3016 " <div class=\"col-sm-8 col-lg-9\">\n" +
3015 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.groupId ? 'Update' : 'Add'}} Group\">\n" +
3017 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.groupId ? 'Update' : 'Add'}} Group\">\n" +
3016 " </div>\n" +
3018 " </div>\n" +
3017 " </div>\n" +
3019 " </div>\n" +
3018 " </form>\n" +
3020 " </form>\n" +
3019 " </div>\n" +
3021 " </div>\n" +
3020 " </div>\n" +
3022 " </div>\n" +
3021 "\n" +
3023 "\n" +
3022 "\n" +
3024 "\n" +
3023 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3025 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3024 " <div class=\"panel-heading\">\n" +
3026 " <div class=\"panel-heading\">\n" +
3025 " <h3 class=\"panel-title\">Permissions summary</h3>\n" +
3027 " <h3 class=\"panel-title\">Permissions summary</h3>\n" +
3026 " </div>\n" +
3028 " </div>\n" +
3027 " <div class=\"panel-body\">\n" +
3029 " <div class=\"panel-body\">\n" +
3028 " <h3>Direct application permissions</h3>\n" +
3030 " <h3>Direct application permissions</h3>\n" +
3029 "\n" +
3031 "\n" +
3030 " <ul class=\"list-group\">\n" +
3032 " <ul class=\"list-group\">\n" +
3031 " <li ng-repeat=\"perm in group.resourcePermissions.group.application\" class=\"animate-repeat list-group-item\">\n" +
3033 " <li ng-repeat=\"perm in group.resourcePermissions.group.application\" class=\"animate-repeat list-group-item\">\n" +
3032 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3034 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3033 "\n" +
3035 "\n" +
3034 " <div class=\"pull-right\">\n" +
3036 " <div class=\"pull-right\">\n" +
3035 "\n" +
3037 "\n" +
3036 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3038 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3037 "\n" +
3039 "\n" +
3038 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3040 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3039 " <span class=\"fa fa-cog\"></span>\n" +
3041 " <span class=\"fa fa-cog\"></span>\n" +
3040 " </a>\n" +
3042 " </a>\n" +
3041 " </div>\n" +
3043 " </div>\n" +
3042 " </li>\n" +
3044 " </li>\n" +
3043 " </ul>\n" +
3045 " </ul>\n" +
3044 "\n" +
3046 "\n" +
3045 " <h3>Direct dashboard permissions</h3>\n" +
3047 " <h3>Direct dashboard permissions</h3>\n" +
3046 "\n" +
3048 "\n" +
3047 " <ul class=\"list-group\">\n" +
3049 " <ul class=\"list-group\">\n" +
3048 " <li ng-repeat=\"perm in group.resourcePermissions.group.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3050 " <li ng-repeat=\"perm in group.resourcePermissions.group.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3049 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3051 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3050 "\n" +
3052 "\n" +
3051 " <div class=\"pull-right\">\n" +
3053 " <div class=\"pull-right\">\n" +
3052 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3054 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3053 "\n" +
3055 "\n" +
3054 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3056 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3055 " <span class=\"fa fa-cog\"></span>\n" +
3057 " <span class=\"fa fa-cog\"></span>\n" +
3056 " </a>\n" +
3058 " </a>\n" +
3057 " </div>\n" +
3059 " </div>\n" +
3058 " </li>\n" +
3060 " </li>\n" +
3059 " </ul>\n" +
3061 " </ul>\n" +
3060 "\n" +
3062 "\n" +
3061 " </div>\n" +
3063 " </div>\n" +
3062 "\n" +
3064 "\n" +
3063 " </div>\n" +
3065 " </div>\n" +
3064 "\n" +
3066 "\n" +
3065 "\n" +
3067 "\n" +
3066 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3068 " <div class=\"panel panel-default\" ng-if=\"group.group.id\">\n" +
3067 " <div class=\"panel-heading\">\n" +
3069 " <div class=\"panel-heading\">\n" +
3068 " <h3 class=\"panel-title\">User list</h3>\n" +
3070 " <h3 class=\"panel-title\">User list</h3>\n" +
3069 " </div>\n" +
3071 " </div>\n" +
3070 " <div class=\"panel-body\">\n" +
3072 " <div class=\"panel-body\">\n" +
3071 "\n" +
3073 "\n" +
3072 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"group.addUser()\">\n" +
3074 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"group.addUser()\">\n" +
3073 " <div class=\"form-group\">\n" +
3075 " <div class=\"form-group\">\n" +
3074 " <input placeholder=\"Username or email\" type=\"text\" class=\"autocomplete form-control\" ng-model=\"group.form.autocompleteUser\" uib-typeahead=\"u for u in group.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"searchingUsers\" typeahead-wait-ms=\"250\"/>\n" +
3076 " <input placeholder=\"Username or email\" type=\"text\" class=\"autocomplete form-control\" ng-model=\"group.form.autocompleteUser\" uib-typeahead=\"u for u in group.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"searchingUsers\" typeahead-wait-ms=\"250\"/>\n" +
3075 " </div>\n" +
3077 " </div>\n" +
3076 " <div class=\"form-group\">\n" +
3078 " <div class=\"form-group\">\n" +
3077 " <button class=\"btn btn-info\" ng-disabled=\"!group.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Add user</button>\n" +
3079 " <button class=\"btn btn-info\" ng-disabled=\"!group.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Add user</button>\n" +
3078 " </div>\n" +
3080 " </div>\n" +
3079 " </form>\n" +
3081 " </form>\n" +
3080 "\n" +
3082 "\n" +
3081 " </div>\n" +
3083 " </div>\n" +
3082 "\n" +
3084 "\n" +
3083 " <table st-table=\"displayedCollection\" st-safe-src=\"group.users\" class=\"table table-striped\">\n" +
3085 " <table st-table=\"displayedCollection\" st-safe-src=\"group.users\" class=\"table table-striped\">\n" +
3084 " <thead>\n" +
3086 " <thead>\n" +
3085 " <tr>\n" +
3087 " <tr>\n" +
3086 " <th st-sort=\"user_name\"><a>Username</a></th>\n" +
3088 " <th st-sort=\"user_name\"><a>Username</a></th>\n" +
3087 " <th st-sort=\"email\"><a>Email</a></th>\n" +
3089 " <th st-sort=\"email\"><a>Email</a></th>\n" +
3088 " <th st-sort=\"status\"><a>Status</a></th>\n" +
3090 " <th st-sort=\"status\"><a>Status</a></th>\n" +
3089 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
3091 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
3090 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
3092 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
3091 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
3093 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
3092 " <th class=\"options\" style=\"width: 130px\"></th>\n" +
3094 " <th class=\"options\" style=\"width: 130px\"></th>\n" +
3093 " </tr>\n" +
3095 " </tr>\n" +
3094 " <tr>\n" +
3096 " <tr>\n" +
3095 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3097 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3096 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3098 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3097 " <th></th>\n" +
3099 " <th></th>\n" +
3098 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3100 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3099 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3101 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3100 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3102 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3101 " <th></th>\n" +
3103 " <th></th>\n" +
3102 " </tr>\n" +
3104 " </tr>\n" +
3103 " </thead>\n" +
3105 " </thead>\n" +
3104 " <tbody>\n" +
3106 " <tbody>\n" +
3105 "\n" +
3107 "\n" +
3106 " <tr ng-repeat=\"user in displayedCollection\">\n" +
3108 " <tr ng-repeat=\"user in displayedCollection\">\n" +
3107 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
3109 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
3108 " <td>{{user.email}}</td>\n" +
3110 " <td>{{user.email}}</td>\n" +
3109 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
3111 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
3110 " <td>{{user.first_name}}</td>\n" +
3112 " <td>{{user.first_name}}</td>\n" +
3111 " <td>{{user.last_name}}</td>\n" +
3113 " <td>{{user.last_name}}</td>\n" +
3112 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3114 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3113 " <td>\n" +
3115 " <td>\n" +
3114 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3116 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3115 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3117 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3116 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3118 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3117 " <ul class=\"dropdown-menu\">\n" +
3119 " <ul class=\"dropdown-menu\">\n" +
3118 " <li><a>No</a></li>\n" +
3120 " <li><a>No</a></li>\n" +
3119 " <li><a ng-click=\"group.removeUser(user)\">Yes</a></li>\n" +
3121 " <li><a ng-click=\"group.removeUser(user)\">Yes</a></li>\n" +
3120 " </ul>\n" +
3122 " </ul>\n" +
3121 " </span>\n" +
3123 " </span>\n" +
3122 " </tr>\n" +
3124 " </tr>\n" +
3123 " <tfoot>\n" +
3125 " <tfoot>\n" +
3124 " <tr>\n" +
3126 " <tr>\n" +
3125 " <td colspan=\"7\" class=\"text-center\">\n" +
3127 " <td colspan=\"7\" class=\"text-center\">\n" +
3126 " <div st-pagination=\"\" st-items-by-page=\"50\" st-displayed-pages=\"7\"></div>\n" +
3128 " <div st-pagination=\"\" st-items-by-page=\"50\" st-displayed-pages=\"7\"></div>\n" +
3127 " </td>\n" +
3129 " </td>\n" +
3128 " </tr>\n" +
3130 " </tr>\n" +
3129 " </tfoot>\n" +
3131 " </tfoot>\n" +
3130 " </tbody>\n" +
3132 " </tbody>\n" +
3131 " </table>\n" +
3133 " </table>\n" +
3132 "\n" +
3134 "\n" +
3133 " </div>\n" +
3135 " </div>\n" +
3134 "\n" +
3136 "\n" +
3135 "\n" +
3137 "\n" +
3136 "</div>\n"
3138 "</div>\n"
3137 );
3139 );
3138
3140
3139
3141
3140 $templateCache.put('templates/admin/groups/groups_list.html',
3142 $templateCache.put('templates/admin/groups/groups_list.html',
3141 "<ng-include src=\"'templates/loader.html'\" ng-if=\"groups.loading.groups\"></ng-include>\n" +
3143 "<ng-include src=\"'templates/loader.html'\" ng-if=\"groups.loading.groups\"></ng-include>\n" +
3142 "\n" +
3144 "\n" +
3143 "<div class=\"panel panel-default\" ng-show=\"!groups.loading.groups\">\n" +
3145 "<div class=\"panel panel-default\" ng-show=\"!groups.loading.groups\">\n" +
3144 "\n" +
3146 "\n" +
3145 " <table st-table=\"displayedCollection\" st-safe-src=\"groups.groups\" class=\"table table-striped\">\n" +
3147 " <table st-table=\"displayedCollection\" st-safe-src=\"groups.groups\" class=\"table table-striped\">\n" +
3146 " <thead>\n" +
3148 " <thead>\n" +
3147 " <tr>\n" +
3149 " <tr>\n" +
3148 " <th st-sort=\"group_name\"><a>Group name</a></th>\n" +
3150 " <th st-sort=\"group_name\"><a>Group name</a></th>\n" +
3149 " <th st-sort=\"description\"><a>Description</a></th>\n" +
3151 " <th st-sort=\"description\"><a>Description</a></th>\n" +
3150 " <th st-sort=\"members\"><a>Member count</a></th>\n" +
3152 " <th st-sort=\"members\"><a>Member count</a></th>\n" +
3151 " <th class=\"options\"></th>\n" +
3153 " <th class=\"options\"></th>\n" +
3152 " </tr>\n" +
3154 " </tr>\n" +
3153 " <tr>\n" +
3155 " <tr>\n" +
3154 " <th><input st-search=\"group_name\" placeholder=\"search for group name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3156 " <th><input st-search=\"group_name\" placeholder=\"search for group name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3155 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3157 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3156 " <th></th>\n" +
3158 " <th></th>\n" +
3157 " <th></th>\n" +
3159 " <th></th>\n" +
3158 " </tr>\n" +
3160 " </tr>\n" +
3159 " </thead>\n" +
3161 " </thead>\n" +
3160 " <tbody>\n" +
3162 " <tbody>\n" +
3161 "\n" +
3163 "\n" +
3162 " <tr ng-repeat=\"group in displayedCollection track by group.id\">\n" +
3164 " <tr ng-repeat=\"group in displayedCollection track by group.id\">\n" +
3163 " <td>{{group.group_name}}</td>\n" +
3165 " <td>{{group.group_name}}</td>\n" +
3164 " <td>{{group.description}}</td>\n" +
3166 " <td>{{group.description}}</td>\n" +
3165 " <td>{{group.member_count}}</td>\n" +
3167 " <td>{{group.member_count}}</td>\n" +
3166 " <td>\n" +
3168 " <td>\n" +
3167 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.group.update({groupId:group.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3169 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.group.update({groupId:group.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3168 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3170 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3169 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3171 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3170 " <ul class=\"dropdown-menu\">\n" +
3172 " <ul class=\"dropdown-menu\">\n" +
3171 " <li><a>No</a></li>\n" +
3173 " <li><a>No</a></li>\n" +
3172 " <li><a ng-click=\"groups.removeGroup(group)\">Yes</a></li>\n" +
3174 " <li><a ng-click=\"groups.removeGroup(group)\">Yes</a></li>\n" +
3173 " </ul>\n" +
3175 " </ul>\n" +
3174 " </span>\n" +
3176 " </span>\n" +
3175 " </tr>\n" +
3177 " </tr>\n" +
3176 " <tfoot>\n" +
3178 " <tfoot>\n" +
3177 " <tr>\n" +
3179 " <tr>\n" +
3178 " <td colspan=\"4\" class=\"text-center\">\n" +
3180 " <td colspan=\"4\" class=\"text-center\">\n" +
3179 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3181 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3180 " </td>\n" +
3182 " </td>\n" +
3181 " </tr>\n" +
3183 " </tr>\n" +
3182 " </tfoot>\n" +
3184 " </tfoot>\n" +
3183 " </tbody>\n" +
3185 " </tbody>\n" +
3184 " </table>\n" +
3186 " </table>\n" +
3185 "\n" +
3187 "\n" +
3186 "</div>\n" +
3188 "</div>\n" +
3187 "\n"
3189 "\n"
3188 );
3190 );
3189
3191
3190
3192
3191 $templateCache.put('templates/admin/groups/parent_view.html',
3193 $templateCache.put('templates/admin/groups/parent_view.html',
3192 "<div ui-view></div>"
3194 "<div ui-view></div>"
3193 );
3195 );
3194
3196
3195
3197
3196 $templateCache.put('templates/admin/parent_view.html',
3198 $templateCache.put('templates/admin/parent_view.html',
3197 "<div class=\"col-sm-3\" id=\"menu\">\n" +
3199 "<div class=\"col-sm-3\" id=\"menu\">\n" +
3198 " <div class=\"panel panel-default\">\n" +
3200 " <div class=\"panel panel-default\">\n" +
3199 " <div class=\"panel-heading\">Users and groups</div>\n" +
3201 " <div class=\"panel-heading\">Users and groups</div>\n" +
3200 " <ul class=\"list-group\">\n" +
3202 " <ul class=\"list-group\">\n" +
3201 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.list\"> Users</a></li>\n" +
3203 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.list\"> Users</a></li>\n" +
3202 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.create\"> Create user</a></li>\n" +
3204 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.user.create\"> Create user</a></li>\n" +
3203 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.list\"> Groups</a></li>\n" +
3205 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.list\"> Groups</a></li>\n" +
3204 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.create\"> Create group</a></li>\n" +
3206 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.group.create\"> Create group</a></li>\n" +
3205 " </ul>\n" +
3207 " </ul>\n" +
3206 " </div>\n" +
3208 " </div>\n" +
3207 " <div class=\"panel panel-default\">\n" +
3209 " <div class=\"panel panel-default\">\n" +
3208 " <div class=\"panel-heading\">Resources</div>\n" +
3210 " <div class=\"panel-heading\">Resources</div>\n" +
3209 " <ul class=\"list-group\">\n" +
3211 " <ul class=\"list-group\">\n" +
3210 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.application.list\"> List applications</a></li>\n" +
3212 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.application.list\"> List applications</a></li>\n" +
3211 " </ul>\n" +
3213 " </ul>\n" +
3212 " </div>\n" +
3214 " </div>\n" +
3213 "\n" +
3215 "\n" +
3214 " <div class=\"panel panel-default\">\n" +
3216 " <div class=\"panel panel-default\">\n" +
3215 " <div class=\"panel-heading\">System</div>\n" +
3217 " <div class=\"panel-heading\">System</div>\n" +
3216 " <ul class=\"list-group\">\n" +
3218 " <ul class=\"list-group\">\n" +
3217 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.configs.list\"> Config variables</a></li>\n" +
3219 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.configs.list\"> Config variables</a></li>\n" +
3218 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.system\"> System</a></li>\n" +
3220 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.system\"> System</a></li>\n" +
3219 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.partitions\"> Partition Management</a></li>\n" +
3221 " <li class=\"list-group-item\" ui-sref-active=\"active\"><a data-ui-sref=\"admin.partitions\"> Partition Management</a></li>\n" +
3220 " </ul>\n" +
3222 " </ul>\n" +
3221 " </div>\n" +
3223 " </div>\n" +
3222 "</div>\n" +
3224 "</div>\n" +
3223 "\n" +
3225 "\n" +
3224 "\n" +
3226 "\n" +
3225 "<div class=\"col-sm-9\" ui-view></div>\n"
3227 "<div class=\"col-sm-9\" ui-view></div>\n"
3226 );
3228 );
3227
3229
3228
3230
3229 $templateCache.put('templates/admin/partitions.html',
3231 $templateCache.put('templates/admin/partitions.html',
3230 "<ng-include src=\"'templates/loader.html'\" ng-if=\"partitions.loading.partitions\"></ng-include>\n" +
3232 "<ng-include src=\"'templates/loader.html'\" ng-if=\"partitions.loading.partitions\"></ng-include>\n" +
3231 "\n" +
3233 "\n" +
3232 "<div ng-show=\"!partitions.loading.partitions\">\n" +
3234 "<div ng-show=\"!partitions.loading.partitions\">\n" +
3233 "\n" +
3235 "\n" +
3234 " <div class=\"panel panel-default\">\n" +
3236 " <div class=\"panel panel-default\">\n" +
3235 " <div class=\"panel-heading\">\n" +
3237 " <div class=\"panel-heading\">\n" +
3236 " DELETE Daily Partitions\n" +
3238 " DELETE Daily Partitions\n" +
3237 " </div>\n" +
3239 " </div>\n" +
3238 "\n" +
3240 "\n" +
3239 " <form name=\"partitions.dailyPartitionsForm\"\n" +
3241 " <form name=\"partitions.dailyPartitionsForm\"\n" +
3240 " novalidate ng-submit=\"partitions.partitionsDelete('dailyPartitions')\"\n" +
3242 " novalidate ng-submit=\"partitions.partitionsDelete('dailyPartitions')\"\n" +
3241 " class=\"form-inline\"\n" +
3243 " class=\"form-inline\"\n" +
3242 " ng-class=\"{'has-error':partitions.dailyPartitionsForm.$invalid}\">\n" +
3244 " ng-class=\"{'has-error':partitions.dailyPartitionsForm.$invalid}\">\n" +
3243 "\n" +
3245 "\n" +
3244 " <div class=\"panel-body\">\n" +
3246 " <div class=\"panel-body\">\n" +
3245 "\n" +
3247 "\n" +
3246 " <input type=\"text\" name=\"confirm\"\n" +
3248 " <input type=\"text\" name=\"confirm\"\n" +
3247 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control input-autosize\" confirm-validate required ng-model=\"partitions.dailyConfirm\">\n" +
3249 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control input-autosize\" confirm-validate required ng-model=\"partitions.dailyConfirm\">\n" +
3248 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.dailyPartitionsForm.$invalid\">\n" +
3250 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.dailyPartitionsForm.$invalid\">\n" +
3249 " <input type=\"checkbox\" ng-model=\"partitions.dailyChecked\" ng-change=\"partitions.setCheckedList('dailyPartitions')\"> Check All\n" +
3251 " <input type=\"checkbox\" ng-model=\"partitions.dailyChecked\" ng-change=\"partitions.setCheckedList('dailyPartitions')\"> Check All\n" +
3250 "\n" +
3252 "\n" +
3251 " </div>\n" +
3253 " </div>\n" +
3252 "\n" +
3254 "\n" +
3253 " <table class=\"table table-striped\">\n" +
3255 " <table class=\"table table-striped\">\n" +
3254 " <tr>\n" +
3256 " <tr>\n" +
3255 " <th class=\"c1 date\">Date</th>\n" +
3257 " <th class=\"c1 date\">Date</th>\n" +
3256 " <th class=\"c2 indices\">Indices</th>\n" +
3258 " <th class=\"c2 indices\">Indices</th>\n" +
3257 " </tr>\n" +
3259 " </tr>\n" +
3258 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.dailyPartitions\">\n" +
3260 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.dailyPartitions\">\n" +
3259 " <td class=\"c1\">{{row[0]}}</td>\n" +
3261 " <td class=\"c1\">{{row[0]}}</td>\n" +
3260 " <td class=\"c2\">\n" +
3262 " <td class=\"c2\">\n" +
3261 " <ul class=\"list-group\">\n" +
3263 " <ul class=\"list-group\">\n" +
3262 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3264 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3263 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3265 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3264 " </li>\n" +
3266 " </li>\n" +
3265 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3267 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3266 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3268 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3267 " </li>\n" +
3269 " </li>\n" +
3268 " </ul>\n" +
3270 " </ul>\n" +
3269 " </td>\n" +
3271 " </td>\n" +
3270 " </tr>\n" +
3272 " </tr>\n" +
3271 " </table>\n" +
3273 " </table>\n" +
3272 " </form>\n" +
3274 " </form>\n" +
3273 "\n" +
3275 "\n" +
3274 " </div>\n" +
3276 " </div>\n" +
3275 "\n" +
3277 "\n" +
3276 " <div class=\"panel panel-default\">\n" +
3278 " <div class=\"panel panel-default\">\n" +
3277 " <div class=\"panel-heading\">\n" +
3279 " <div class=\"panel-heading\">\n" +
3278 " DELETE Permanent Partitions\n" +
3280 " DELETE Permanent Partitions\n" +
3279 " </div>\n" +
3281 " </div>\n" +
3280 "\n" +
3282 "\n" +
3281 " <form name=\"partitions.permanentPartitionsForm\" novalidate\n" +
3283 " <form name=\"partitions.permanentPartitionsForm\" novalidate\n" +
3282 " ng-submit=\"partitions.partitionsDelete('permanentPartitions')\"\n" +
3284 " ng-submit=\"partitions.partitionsDelete('permanentPartitions')\"\n" +
3283 " class=\"form-inline\"\n" +
3285 " class=\"form-inline\"\n" +
3284 " ng-class=\"{'has-error':partitions.permanentPartitionsForm.$invalid}\">\n" +
3286 " ng-class=\"{'has-error':partitions.permanentPartitionsForm.$invalid}\">\n" +
3285 "\n" +
3287 "\n" +
3286 "\n" +
3288 "\n" +
3287 " <div class=\"panel-body\">\n" +
3289 " <div class=\"panel-body\">\n" +
3288 "\n" +
3290 "\n" +
3289 " <div class=\"form-group\">\n" +
3291 " <div class=\"form-group\">\n" +
3290 " <input type=\"text\" name=\"confirm\"\n" +
3292 " <input type=\"text\" name=\"confirm\"\n" +
3291 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control\" confirm-validate required ng-model=\"partitions.permConfirm\">\n" +
3293 " placeholder=\"Enter CONFIRM to proceed\" class=\"form-control\" confirm-validate required ng-model=\"partitions.permConfirm\">\n" +
3292 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.permanentPartitionsForm.$invalid\">\n" +
3294 " <input type=\"submit\" class=\"btn btn-danger\" ng-disabled=\"partitions.permanentPartitionsForm.$invalid\">\n" +
3293 " <input type=\"checkbox\" ng-model=\"partitions.permChecked\" ng-change=\"partitions.setCheckedList('permanentPartitions')\"> Check All\n" +
3295 " <input type=\"checkbox\" ng-model=\"partitions.permChecked\" ng-change=\"partitions.setCheckedList('permanentPartitions')\"> Check All\n" +
3294 " </div>\n" +
3296 " </div>\n" +
3295 "\n" +
3297 "\n" +
3296 " </div>\n" +
3298 " </div>\n" +
3297 "\n" +
3299 "\n" +
3298 " <table class=\"table table-striped\">\n" +
3300 " <table class=\"table table-striped\">\n" +
3299 " <tr>\n" +
3301 " <tr>\n" +
3300 " <th class=\"c1 date\">Date</th>\n" +
3302 " <th class=\"c1 date\">Date</th>\n" +
3301 " <th class=\"c2 indices\">Indices</th>\n" +
3303 " <th class=\"c2 indices\">Indices</th>\n" +
3302 " </tr>\n" +
3304 " </tr>\n" +
3303 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.permanentPartitions\">\n" +
3305 " <tr class=\"r{{$index}}\" ng-repeat=\"row in partitions.permanentPartitions\">\n" +
3304 " <td class=\"c1\">{{row[0]}}</td>\n" +
3306 " <td class=\"c1\">{{row[0]}}</td>\n" +
3305 " <td class=\"c2\">\n" +
3307 " <td class=\"c2\">\n" +
3306 " <ul class=\"list-group\">\n" +
3308 " <ul class=\"list-group\">\n" +
3307 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3309 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].elasticsearch\">\n" +
3308 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3310 " <input name=\"es_index\" type=\"checkbox\" ng-model=\"partition.checked\"> ES: {{partition.name}}\n" +
3309 " </li>\n" +
3311 " </li>\n" +
3310 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3312 " <li class=\"list-group-item\" ng-repeat=\"partition in row[1].pg\">\n" +
3311 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3313 " <input name=\"pg_index\" type=\"checkbox\" ng-model=\"partition.checked\"> PG: {{partition.name}}\n" +
3312 " </li>\n" +
3314 " </li>\n" +
3313 " </ul>\n" +
3315 " </ul>\n" +
3314 " </td>\n" +
3316 " </td>\n" +
3315 " </tr>\n" +
3317 " </tr>\n" +
3316 " </table>\n" +
3318 " </table>\n" +
3317 " </form>\n" +
3319 " </form>\n" +
3318 "\n" +
3320 "\n" +
3319 " </div>\n" +
3321 " </div>\n" +
3320 "\n" +
3322 "\n" +
3321 "</div>\n"
3323 "</div>\n"
3322 );
3324 );
3323
3325
3324
3326
3325 $templateCache.put('templates/admin/system.html',
3327 $templateCache.put('templates/admin/system.html',
3326 "<ng-include src=\"'templates/loader.html'\" ng-if=\"system.loading.system\"></ng-include>\n" +
3328 "<ng-include src=\"'templates/loader.html'\" ng-if=\"system.loading.system\"></ng-include>\n" +
3327 "\n" +
3329 "\n" +
3328 "<div ng-if=\"system.loading.system == false\">\n" +
3330 "<div ng-if=\"system.loading.system == false\">\n" +
3329 " <div class=\"row\">\n" +
3331 " <div class=\"row\">\n" +
3330 " <div class=\"col-sm-12\">\n" +
3332 " <div class=\"col-sm-12\">\n" +
3331 " <div class=\"panel panel-default\">\n" +
3333 " <div class=\"panel panel-default\">\n" +
3332 " <div class=\"panel-heading\">\n" +
3334 " <div class=\"panel-heading\">\n" +
3333 " <h3 class=\"panel-title\">\n" +
3335 " <h3 class=\"panel-title\">\n" +
3334 " System Info\n" +
3336 " System Info\n" +
3335 " </h3>\n" +
3337 " </h3>\n" +
3336 " </div>\n" +
3338 " </div>\n" +
3337 " <div class=\"panel-body\">\n" +
3339 " <div class=\"panel-body\">\n" +
3338 "\n" +
3340 "\n" +
3339 " <p><strong>System Load:</strong>\n" +
3341 " <p><strong>System Load:</strong>\n" +
3340 " 1min: {{system.systemLoad[0]}}, 5min: {{system.systemLoad[1]}}, 15min: {{system.systemLoad[2]}}\n" +
3342 " 1min: {{system.systemLoad[0]}}, 5min: {{system.systemLoad[1]}}, 15min: {{system.systemLoad[2]}}\n" +
3341 " </p>\n" +
3343 " </p>\n" +
3342 " <p><strong>Awaiting tasks:</strong>\n" +
3344 " <p><strong>Awaiting tasks:</strong>\n" +
3343 " <ul>\n" +
3345 " <ul>\n" +
3344 " <li>reports: {{system.queueStats.waiting_reports}}</li>\n" +
3346 " <li>reports: {{system.queueStats.waiting_reports}}</li>\n" +
3345 " <li>logs: {{system.queueStats.waiting_logs}}</li>\n" +
3347 " <li>logs: {{system.queueStats.waiting_logs}}</li>\n" +
3346 " <li>metrics: {{system.queueStats.waiting_metrics}}</li>\n" +
3348 " <li>metrics: {{system.queueStats.waiting_metrics}}</li>\n" +
3347 " <li>other: {{system.queueStats.waiting_other}}</li>\n" +
3349 " <li>other: {{system.queueStats.waiting_other}}</li>\n" +
3348 " </ul>\n" +
3350 " </ul>\n" +
3349 " </p>\n" +
3351 " </p>\n" +
3350 " <p><strong>Queue stats from last minute:</strong>\n" +
3352 " <p><strong>Queue stats from last minute:</strong>\n" +
3351 " <ul>\n" +
3353 " <ul>\n" +
3352 " <li>Processed reports: {{system.queueStats.processed_reports}}</li>\n" +
3354 " <li>Processed reports: {{system.queueStats.processed_reports}}</li>\n" +
3353 " <li>Processed logs: {{system.queueStats.processed_logs}}</li>\n" +
3355 " <li>Processed logs: {{system.queueStats.processed_logs}}</li>\n" +
3354 " <li>Processed metrics: {{system.queueStats.processed_metrics}}</li>\n" +
3356 " <li>Processed metrics: {{system.queueStats.processed_metrics}}</li>\n" +
3355 " </ul>\n" +
3357 " </ul>\n" +
3356 " </p>\n" +
3358 " </p>\n" +
3357 "\n" +
3359 "\n" +
3358 " <p><strong>Disks:</strong>\n" +
3360 " <p><strong>Disks:</strong>\n" +
3359 " <ul>\n" +
3361 " <ul>\n" +
3360 " <li ng-repeat=\"disk in system.disks\">\n" +
3362 " <li ng-repeat=\"disk in system.disks\">\n" +
3361 " <strong>{{disk.device}}</strong> {{disk.free}}/{{disk.total}}, {{disk.percentage}}% used\n" +
3363 " <strong>{{disk.device}}</strong> {{disk.free}}/{{disk.total}}, {{disk.percentage}}% used\n" +
3362 " </li>\n" +
3364 " </li>\n" +
3363 " </ul>\n" +
3365 " </ul>\n" +
3364 " </p>\n" +
3366 " </p>\n" +
3365 "\n" +
3367 "\n" +
3366 " <p><strong>Process stats:</strong>\n" +
3368 " <p><strong>Process stats:</strong>\n" +
3367 " <ul>\n" +
3369 " <ul>\n" +
3368 " <li>FD soft limits: {{system.selfInfo.fds.soft}}</li>\n" +
3370 " <li>FD soft limits: {{system.selfInfo.fds.soft}}</li>\n" +
3369 " <li>FD hard limits: {{system.selfInfo.fds.hard}}</li>\n" +
3371 " <li>FD hard limits: {{system.selfInfo.fds.hard}}</li>\n" +
3370 " <li>Memlock soft limits: {{system.selfInfo.memlock.soft}}</li>\n" +
3372 " <li>Memlock soft limits: {{system.selfInfo.memlock.soft}}</li>\n" +
3371 " <li>Memlock hard limits: {{system.selfInfo.memlock.hard}}</li>\n" +
3373 " <li>Memlock hard limits: {{system.selfInfo.memlock.hard}}</li>\n" +
3372 " </ul>\n" +
3374 " </ul>\n" +
3373 " </p>\n" +
3375 " </p>\n" +
3374 "\n" +
3376 "\n" +
3375 " </div>\n" +
3377 " </div>\n" +
3376 " </div>\n" +
3378 " </div>\n" +
3377 " </div>\n" +
3379 " </div>\n" +
3378 " </div>\n" +
3380 " </div>\n" +
3379 " <div class=\"row\">\n" +
3381 " <div class=\"row\">\n" +
3380 " <div class=\"col-sm-12\">\n" +
3382 " <div class=\"col-sm-12\">\n" +
3381 "\n" +
3383 "\n" +
3382 " <div class=\"panel panel-default\">\n" +
3384 " <div class=\"panel panel-default\">\n" +
3383 " <div class=\"panel-body\">\n" +
3385 " <div class=\"panel-body\">\n" +
3384 "\n" +
3386 "\n" +
3385 " <uib-tabset>\n" +
3387 " <uib-tabset>\n" +
3386 " <uib-tab>\n" +
3388 " <uib-tab>\n" +
3387 " <uib-tab-heading>\n" +
3389 " <uib-tab-heading>\n" +
3388 " Postgresql Tables\n" +
3390 " Postgresql Tables\n" +
3389 " </uib-tab-heading>\n" +
3391 " </uib-tab-heading>\n" +
3390 "\n" +
3392 "\n" +
3391 " <table class=\"table table-striped\">\n" +
3393 " <table class=\"table table-striped\">\n" +
3392 " <thead>\n" +
3394 " <thead>\n" +
3393 " <tr>\n" +
3395 " <tr>\n" +
3394 " <th class=\"c1 tablename\">Table name</th>\n" +
3396 " <th class=\"c1 tablename\">Table name</th>\n" +
3395 " <th class=\"c2 size_human\">Size</th>\n" +
3397 " <th class=\"c2 size_human\">Size</th>\n" +
3396 " </tr>\n" +
3398 " </tr>\n" +
3397 " </thead>\n" +
3399 " </thead>\n" +
3398 " <tbody>\n" +
3400 " <tbody>\n" +
3399 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.DBtables\">\n" +
3401 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.DBtables\">\n" +
3400 " <td class=\"c1\">{{row.table_name}}</td>\n" +
3402 " <td class=\"c1\">{{row.table_name}}</td>\n" +
3401 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3403 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3402 " </tr>\n" +
3404 " </tr>\n" +
3403 " </tbody>\n" +
3405 " </tbody>\n" +
3404 " </table>\n" +
3406 " </table>\n" +
3405 "\n" +
3407 "\n" +
3406 " </uib-tab>\n" +
3408 " </uib-tab>\n" +
3407 "\n" +
3409 "\n" +
3408 " <uib-tab>\n" +
3410 " <uib-tab>\n" +
3409 " <uib-tab-heading>\n" +
3411 " <uib-tab-heading>\n" +
3410 " Elasticsearch Indices\n" +
3412 " Elasticsearch Indices\n" +
3411 " </uib-tab-heading>\n" +
3413 " </uib-tab-heading>\n" +
3412 "\n" +
3414 "\n" +
3413 " <table class=\"table table-striped\">\n" +
3415 " <table class=\"table table-striped\">\n" +
3414 " <thead>\n" +
3416 " <thead>\n" +
3415 " <tr>\n" +
3417 " <tr>\n" +
3416 " <th class=\"c1 tablename\">Index name</th>\n" +
3418 " <th class=\"c1 tablename\">Index name</th>\n" +
3417 " <th class=\"c2 size_human\">Size</th>\n" +
3419 " <th class=\"c2 size_human\">Size</th>\n" +
3418 " </tr>\n" +
3420 " </tr>\n" +
3419 " </thead>\n" +
3421 " </thead>\n" +
3420 " <tbody>\n" +
3422 " <tbody>\n" +
3421 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.ESIndices\">\n" +
3423 " <tr class=\"r{{$index}}\" ng-repeat=\"row in system.ESIndices\">\n" +
3422 " <td class=\"c1\">{{row.name}}</td>\n" +
3424 " <td class=\"c1\">{{row.name}}</td>\n" +
3423 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3425 " <td class=\"c2\">{{row.size_human}}</td>\n" +
3424 " </tr>\n" +
3426 " </tr>\n" +
3425 " </tbody>\n" +
3427 " </tbody>\n" +
3426 " </table>\n" +
3428 " </table>\n" +
3427 "\n" +
3429 "\n" +
3428 " </uib-tab>\n" +
3430 " </uib-tab>\n" +
3429 "\n" +
3431 "\n" +
3430 " <uib-tab>\n" +
3432 " <uib-tab>\n" +
3431 " <uib-tab-heading>\n" +
3433 " <uib-tab-heading>\n" +
3432 " Processes\n" +
3434 " Processes\n" +
3433 " </uib-tab-heading>\n" +
3435 " </uib-tab-heading>\n" +
3434 "\n" +
3436 "\n" +
3435 " <table class=\"table table-striped\">\n" +
3437 " <table class=\"table table-striped\">\n" +
3436 " <thead>\n" +
3438 " <thead>\n" +
3437 " <tr>\n" +
3439 " <tr>\n" +
3438 " <th class=\"c1 tablename\">Owner</th>\n" +
3440 " <th class=\"c1 tablename\">Owner</th>\n" +
3439 " <th class=\"c2 tablename\">PID</th>\n" +
3441 " <th class=\"c2 tablename\">PID</th>\n" +
3440 " <th class=\"c3 tablename\">CPU</th>\n" +
3442 " <th class=\"c3 tablename\">CPU</th>\n" +
3441 " <th class=\"c4 tablename\">MEM</th>\n" +
3443 " <th class=\"c4 tablename\">MEM</th>\n" +
3442 " <th class=\"c4 tablename\">Name</th>\n" +
3444 " <th class=\"c4 tablename\">Name</th>\n" +
3443 " </tr>\n" +
3445 " </tr>\n" +
3444 " </thead>\n" +
3446 " </thead>\n" +
3445 " <tbody>\n" +
3447 " <tbody>\n" +
3446 " <tr class=\"r{{$index}}\" ng-repeat-start=\"row in system.processInfo\">\n" +
3448 " <tr class=\"r{{$index}}\" ng-repeat-start=\"row in system.processInfo\">\n" +
3447 " <td class=\"c1\">{{row.owner}}</td>\n" +
3449 " <td class=\"c1\">{{row.owner}}</td>\n" +
3448 " <td class=\"c2\">{{row.pid}}</td>\n" +
3450 " <td class=\"c2\">{{row.pid}}</td>\n" +
3449 " <td class=\"c3\">{{row.cpu}}</td>\n" +
3451 " <td class=\"c3\">{{row.cpu}}</td>\n" +
3450 " <td class=\"c4\">{{row.mem_usage}} ({{row.mem_percentage}}%)</td>\n" +
3452 " <td class=\"c4\">{{row.mem_usage}} ({{row.mem_percentage}}%)</td>\n" +
3451 " <td class=\"c5\"><strong>{{row.name}}</strong></td>\n" +
3453 " <td class=\"c5\"><strong>{{row.name}}</strong></td>\n" +
3452 " </tr>\n" +
3454 " </tr>\n" +
3453 " <tr ng-repeat-end>\n" +
3455 " <tr ng-repeat-end>\n" +
3454 " <td colspan=\"5\" class=\"word-wrap\">{{row.command}}</td>\n" +
3456 " <td colspan=\"5\" class=\"word-wrap\">{{row.command}}</td>\n" +
3455 " </tr>\n" +
3457 " </tr>\n" +
3456 " </tbody>\n" +
3458 " </tbody>\n" +
3457 " </table>\n" +
3459 " </table>\n" +
3458 "\n" +
3460 "\n" +
3459 " </uib-tab>\n" +
3461 " </uib-tab>\n" +
3460 "\n" +
3462 "\n" +
3461 " <uib-tab>\n" +
3463 " <uib-tab>\n" +
3462 " <uib-tab-heading>\n" +
3464 " <uib-tab-heading>\n" +
3463 " Python packages\n" +
3465 " Python packages\n" +
3464 " </uib-tab-heading>\n" +
3466 " </uib-tab-heading>\n" +
3465 "\n" +
3467 "\n" +
3466 " <table class=\"table\">\n" +
3468 " <table class=\"table\">\n" +
3467 " <tr ng-repeat=\"package in system.packages\">\n" +
3469 " <tr ng-repeat=\"package in system.packages\">\n" +
3468 " <td>{{package.name}}</td>\n" +
3470 " <td>{{package.name}}</td>\n" +
3469 " <td>{{package.version}}</td>\n" +
3471 " <td>{{package.version}}</td>\n" +
3470 " </tr>\n" +
3472 " </tr>\n" +
3471 " </table>\n" +
3473 " </table>\n" +
3472 " </p>\n" +
3474 " </p>\n" +
3473 "\n" +
3475 "\n" +
3474 " </uib-tab>\n" +
3476 " </uib-tab>\n" +
3475 "\n" +
3477 "\n" +
3476 " </uib-tabset>\n" +
3478 " </uib-tabset>\n" +
3477 " </div>\n" +
3479 " </div>\n" +
3478 " </div>\n" +
3480 " </div>\n" +
3479 " </div>\n" +
3481 " </div>\n" +
3480 " </div>\n" +
3482 " </div>\n" +
3481 "</div>\n"
3483 "</div>\n"
3482 );
3484 );
3483
3485
3484
3486
3485 $templateCache.put('templates/admin/users/parent_view.html',
3487 $templateCache.put('templates/admin/users/parent_view.html',
3486 "<div ui-view></div>"
3488 "<div ui-view></div>"
3487 );
3489 );
3488
3490
3489
3491
3490 $templateCache.put('templates/admin/users/users_create.html',
3492 $templateCache.put('templates/admin/users/users_create.html',
3491 "<ng-include src=\"'templates/loader.html'\" ng-if=\"user.loading.user\"></ng-include>\n" +
3493 "<ng-include src=\"'templates/loader.html'\" ng-if=\"user.loading.user\"></ng-include>\n" +
3492 "\n" +
3494 "\n" +
3493 "<div ng-show=\"!user.loading.user\">\n" +
3495 "<div ng-show=\"!user.loading.user\">\n" +
3494 "\n" +
3496 "\n" +
3495 " <div class=\"panel panel-default\">\n" +
3497 " <div class=\"panel panel-default\">\n" +
3496 " <div class=\"panel-body\">\n" +
3498 " <div class=\"panel-body\">\n" +
3497 "\n" +
3499 "\n" +
3498 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"user.user.id\">\n" +
3500 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"user.user.id\">\n" +
3499 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-user-secret\"></span> Re-login to user</a>\n" +
3501 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-user-secret\"></span> Re-login to user</a>\n" +
3500 " <ul class=\"dropdown-menu\">\n" +
3502 " <ul class=\"dropdown-menu\">\n" +
3501 " <li><a>No</a></li>\n" +
3503 " <li><a>No</a></li>\n" +
3502 " <li><a ng-click=\"user.reloginUser(user)\">Yes</a></li>\n" +
3504 " <li><a ng-click=\"user.reloginUser(user)\">Yes</a></li>\n" +
3503 " </ul>\n" +
3505 " </ul>\n" +
3504 " </span>\n" +
3506 " </span>\n" +
3505 "\n" +
3507 "\n" +
3506 " <form name=\"user.profileForm\" class=\"form-horizontal\" ng-submit=\"user.createUser()\">\n" +
3508 " <form name=\"user.profileForm\" class=\"form-horizontal\" ng-submit=\"user.createUser()\">\n" +
3507 " <div class=\"form-group\" id=\"row-user_name\">\n" +
3509 " <div class=\"form-group\" id=\"row-user_name\">\n" +
3508 " <data-form-errors errors=\"user.profileForm.ae_validation.user_name\"></data-form-errors>\n" +
3510 " <data-form-errors errors=\"user.profileForm.ae_validation.user_name\"></data-form-errors>\n" +
3509 " <label for=\"user_name\" id=\"label-user_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3511 " <label for=\"user_name\" id=\"label-user_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3510 " User name\n" +
3512 " User name\n" +
3511 " <span class=\"required\">*</span>\n" +
3513 " <span class=\"required\">*</span>\n" +
3512 " </label>\n" +
3514 " </label>\n" +
3513 " <div class=\"col-sm-8 col-lg-9\">\n" +
3515 " <div class=\"col-sm-8 col-lg-9\">\n" +
3514 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"user.user.user_name\">\n" +
3516 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"user.user.user_name\">\n" +
3515 " </div>\n" +
3517 " </div>\n" +
3516 " </div>\n" +
3518 " </div>\n" +
3517 "\n" +
3519 "\n" +
3518 " <div class=\"form-group\" id=\"row-user_password\">\n" +
3520 " <div class=\"form-group\" id=\"row-user_password\">\n" +
3519 " <data-form-errors errors=\"user.profileForm.ae_validation.user_password\"></data-form-errors>\n" +
3521 " <data-form-errors errors=\"user.profileForm.ae_validation.user_password\"></data-form-errors>\n" +
3520 " <label for=\"user_password\" id=\"label-user_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3522 " <label for=\"user_password\" id=\"label-user_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3521 " Password\n" +
3523 " Password\n" +
3522 " <span class=\"required\">*</span>\n" +
3524 " <span class=\"required\">*</span>\n" +
3523 " </label>\n" +
3525 " </label>\n" +
3524 " <div class=\"col-sm-8 col-lg-9\">\n" +
3526 " <div class=\"col-sm-8 col-lg-9\">\n" +
3525 " <input class=\"form-control\" id=\"user_password\" name=\"user_password\" type=\"password\" ng-model=\"user.user.user_password\">\n" +
3527 " <input class=\"form-control\" id=\"user_password\" name=\"user_password\" type=\"password\" ng-model=\"user.user.user_password\">\n" +
3526 "\n" +
3528 "\n" +
3527 " <p class=\"m-t-1\"><a class=\"btn btn-info btn-sm\" ng-click=\"user.generatePassword()\"><span class=\"fa fa-lock\"></span> Generate password</a>\n" +
3529 " <p class=\"m-t-1\"><a class=\"btn btn-info btn-sm\" ng-click=\"user.generatePassword()\"><span class=\"fa fa-lock\"></span> Generate password</a>\n" +
3528 " <span ng-show=\"user.gen_pass.length > 0\">(generated password: {{user.gen_pass}})</span>\n" +
3530 " <span ng-show=\"user.gen_pass.length > 0\">(generated password: {{user.gen_pass}})</span>\n" +
3529 " </p>\n" +
3531 " </p>\n" +
3530 "\n" +
3532 "\n" +
3531 " </div>\n" +
3533 " </div>\n" +
3532 " </div>\n" +
3534 " </div>\n" +
3533 "\n" +
3535 "\n" +
3534 "\n" +
3536 "\n" +
3535 " <div class=\"form-group\" id=\"row-email\">\n" +
3537 " <div class=\"form-group\" id=\"row-email\">\n" +
3536 " <data-form-errors errors=\"user.profileForm.ae_validation.email\"></data-form-errors>\n" +
3538 " <data-form-errors errors=\"user.profileForm.ae_validation.email\"></data-form-errors>\n" +
3537 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3539 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3538 " Email Address\n" +
3540 " Email Address\n" +
3539 " <span class=\"required\">*</span>\n" +
3541 " <span class=\"required\">*</span>\n" +
3540 " </label>\n" +
3542 " </label>\n" +
3541 " <div class=\"col-sm-8 col-lg-9\">\n" +
3543 " <div class=\"col-sm-8 col-lg-9\">\n" +
3542 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"user.user.email\">\n" +
3544 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"user.user.email\">\n" +
3543 " </div>\n" +
3545 " </div>\n" +
3544 " </div>\n" +
3546 " </div>\n" +
3545 "\n" +
3547 "\n" +
3546 " <div class=\"form-group\" id=\"row-first_name\">\n" +
3548 " <div class=\"form-group\" id=\"row-first_name\">\n" +
3547 " <data-form-errors errors=\"user.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
3549 " <data-form-errors errors=\"user.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
3548 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3550 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3549 " First Name\n" +
3551 " First Name\n" +
3550 " </label>\n" +
3552 " </label>\n" +
3551 " <div class=\"col-sm-8 col-lg-9\">\n" +
3553 " <div class=\"col-sm-8 col-lg-9\">\n" +
3552 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"user.user.first_name\">\n" +
3554 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"user.user.first_name\">\n" +
3553 " </div>\n" +
3555 " </div>\n" +
3554 " </div>\n" +
3556 " </div>\n" +
3555 " <div class=\"form-group\" id=\"row-last_name\">\n" +
3557 " <div class=\"form-group\" id=\"row-last_name\">\n" +
3556 " <data-form-errors errors=\"user.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
3558 " <data-form-errors errors=\"user.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
3557 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3559 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3558 " Last Name\n" +
3560 " Last Name\n" +
3559 " </label>\n" +
3561 " </label>\n" +
3560 " <div class=\"col-sm-8 col-lg-9\">\n" +
3562 " <div class=\"col-sm-8 col-lg-9\">\n" +
3561 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"user.user.last_name\">\n" +
3563 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"user.user.last_name\">\n" +
3562 " </div>\n" +
3564 " </div>\n" +
3563 " </div>\n" +
3565 " </div>\n" +
3564 "\n" +
3566 "\n" +
3565 " <div class=\"form-group\" id=\"row-status\">\n" +
3567 " <div class=\"form-group\" id=\"row-status\">\n" +
3566 " <data-form-errors errors=\"user.profileForm.ae_validation.status\"></data-form-errors>\n" +
3568 " <data-form-errors errors=\"user.profileForm.ae_validation.status\"></data-form-errors>\n" +
3567 " <label for=\"status\" id=\"label-status\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3569 " <label for=\"status\" id=\"label-status\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3568 " Active\n" +
3570 " Active\n" +
3569 " </label>\n" +
3571 " </label>\n" +
3570 " <div class=\"col-sm-8 col-lg-9\">\n" +
3572 " <div class=\"col-sm-8 col-lg-9\">\n" +
3571 " <input checked class=\"form-control\" id=\"status\" name=\"status\" type=\"checkbox\" ng-model=\"user.user.status\">\n" +
3573 " <input checked class=\"form-control\" id=\"status\" name=\"status\" type=\"checkbox\" ng-model=\"user.user.status\">\n" +
3572 " </div>\n" +
3574 " </div>\n" +
3573 " </div>\n" +
3575 " </div>\n" +
3574 "\n" +
3576 "\n" +
3575 " <div class=\"form-group\" id=\"row-submit\">\n" +
3577 " <div class=\"form-group\" id=\"row-submit\">\n" +
3576 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3578 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
3577 " </label>\n" +
3579 " </label>\n" +
3578 " <div class=\"col-sm-8 col-lg-9\">\n" +
3580 " <div class=\"col-sm-8 col-lg-9\">\n" +
3579 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.userId ? 'Update' : 'Add'}} User\">\n" +
3581 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"{{$state.params.userId ? 'Update' : 'Add'}} User\">\n" +
3580 " </div>\n" +
3582 " </div>\n" +
3581 " </div>\n" +
3583 " </div>\n" +
3582 " </form>\n" +
3584 " </form>\n" +
3583 " </div>\n" +
3585 " </div>\n" +
3584 " </div>\n" +
3586 " </div>\n" +
3585 "\n" +
3587 "\n" +
3586 "\n" +
3588 "\n" +
3587 " <div class=\"panel panel-default\" ng-if=\"user.user.id\">\n" +
3589 " <div class=\"panel panel-default\" ng-if=\"user.user.id\">\n" +
3588 " <div class=\"panel-heading\">\n" +
3590 " <div class=\"panel-heading\">\n" +
3589 " <h3 class=\"panel-title\">Permission Summary</h3>\n" +
3591 " <h3 class=\"panel-title\">Permission Summary</h3>\n" +
3590 " </div>\n" +
3592 " </div>\n" +
3591 " <div class=\"panel-body\">\n" +
3593 " <div class=\"panel-body\">\n" +
3592 " <h3>Direct application permissions</h3>\n" +
3594 " <h3>Direct application permissions</h3>\n" +
3593 "\n" +
3595 "\n" +
3594 " <ul class=\"list-group\">\n" +
3596 " <ul class=\"list-group\">\n" +
3595 " <li ng-repeat=\"perm in user.resourcePermissions.user.application\" class=\"animate-repeat list-group-item\">\n" +
3597 " <li ng-repeat=\"perm in user.resourcePermissions.user.application\" class=\"animate-repeat list-group-item\">\n" +
3596 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3598 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3597 " <div class=\"pull-right\">\n" +
3599 " <div class=\"pull-right\">\n" +
3598 "\n" +
3600 "\n" +
3599 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3601 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3600 "\n" +
3602 "\n" +
3601 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3603 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Application\" data-ui-sref=\"applications.update({resourceId:perm.self.resource_id})\">\n" +
3602 " <span class=\"fa fa-cog\"></span>\n" +
3604 " <span class=\"fa fa-cog\"></span>\n" +
3603 " </a>\n" +
3605 " </a>\n" +
3604 " </div>\n" +
3606 " </div>\n" +
3605 " </li>\n" +
3607 " </li>\n" +
3606 " </ul>\n" +
3608 " </ul>\n" +
3607 "\n" +
3609 "\n" +
3608 " <h3>Direct dashboard permissions</h3>\n" +
3610 " <h3>Direct dashboard permissions</h3>\n" +
3609 "\n" +
3611 "\n" +
3610 " <ul class=\"list-group\">\n" +
3612 " <ul class=\"list-group\">\n" +
3611 " <li ng-repeat=\"perm in user.resourcePermissions.user.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3613 " <li ng-repeat=\"perm in user.resourcePermissions.user.dashboard\" class=\"animate-repeat list-group-item\">\n" +
3612 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3614 " <strong>{{ perm.self.resource_name }}</strong>\n" +
3613 " <div class=\"pull-right\">\n" +
3615 " <div class=\"pull-right\">\n" +
3614 "\n" +
3616 "\n" +
3615 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3617 " <span class=\"btn btn-primary btn-xs m-r-1\" disabled ng-repeat=\"perm_name in perm.permissions\">{{ perm.self.owner ? 'Resource owner' : perm_name }}</span>\n" +
3616 "\n" +
3618 "\n" +
3617 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3619 " <a class=\"btn btn-default btn-xs\" data-uib-tooltip=\"Visit Dashboard\" data-ui-sref=\"dashboard.update({resourceId:perm.self.resource_id})\">\n" +
3618 " <span class=\"fa fa-cog\"></span>\n" +
3620 " <span class=\"fa fa-cog\"></span>\n" +
3619 " </a>\n" +
3621 " </a>\n" +
3620 " </div>\n" +
3622 " </div>\n" +
3621 " </li>\n" +
3623 " </li>\n" +
3622 " </ul>\n" +
3624 " </ul>\n" +
3623 "\n" +
3625 "\n" +
3624 " </div>\n" +
3626 " </div>\n" +
3625 "\n" +
3627 "\n" +
3626 " </div>\n" +
3628 " </div>\n" +
3627 "\n" +
3629 "\n" +
3628 "\n" +
3630 "\n" +
3629 "</div>\n"
3631 "</div>\n"
3630 );
3632 );
3631
3633
3632
3634
3633 $templateCache.put('templates/admin/users/users_list.html',
3635 $templateCache.put('templates/admin/users/users_list.html',
3634 "<ng-include src=\"'templates/loader.html'\" ng-if=\"users.loading.users\"></ng-include>\n" +
3636 "<ng-include src=\"'templates/loader.html'\" ng-if=\"users.loading.users\"></ng-include>\n" +
3635 "\n" +
3637 "\n" +
3636 "<div ng-show=\"!users.loading.users\">\n" +
3638 "<div ng-show=\"!users.loading.users\">\n" +
3637 "\n" +
3639 "\n" +
3638 " <div class=\"panel panel-default\">\n" +
3640 " <div class=\"panel panel-default\">\n" +
3639 "\n" +
3641 "\n" +
3640 " <div class=\"panel-heading\">\n" +
3642 " <div class=\"panel-heading\">\n" +
3641 " {{users.activeUsers}} active out of {{users.users.length}} users\n" +
3643 " {{users.activeUsers}} active out of {{users.users.length}} users\n" +
3642 " </div>\n" +
3644 " </div>\n" +
3643 "\n" +
3645 "\n" +
3644 "\n" +
3646 "\n" +
3645 " <table st-table=\"displayedCollection\" st-safe-src=\"users.users\" class=\"table table-striped\">\n" +
3647 " <table st-table=\"displayedCollection\" st-safe-src=\"users.users\" class=\"table table-striped\">\n" +
3646 " <thead>\n" +
3648 " <thead>\n" +
3647 " <tr>\n" +
3649 " <tr>\n" +
3648 " <th class=\"user_name\" st-sort=\"user_name\"><a>Username</a></th>\n" +
3650 " <th class=\"user_name\" st-sort=\"user_name\"><a>Username</a></th>\n" +
3649 " <th class=\"email\" st-sort=\"email\"><a>Email</a></th>\n" +
3651 " <th class=\"email\" st-sort=\"email\"><a>Email</a></th>\n" +
3650 " <th class=\"status\" st-sort=\"status\"><a>Status</a></th>\n" +
3652 " <th class=\"status\" st-sort=\"status\"><a>Status</a></th>\n" +
3651 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
3653 " <th st-sort=\"first_name\"><a>First Name</a></th>\n" +
3652 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
3654 " <th st-sort=\"last_name\"><a>Last Name</a></th>\n" +
3653 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
3655 " <th st-sort=\"last_login_date\"><a>Last login</a></th>\n" +
3654 " <th class=\"options\"></th>\n" +
3656 " <th class=\"options\"></th>\n" +
3655 " </tr>\n" +
3657 " </tr>\n" +
3656 " <tr>\n" +
3658 " <tr>\n" +
3657 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3659 " <th><input st-search=\"user_name\" placeholder=\"search for user name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3658 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3660 " <th><input st-search=\"email\" placeholder=\"search for email\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3659 " <th></th>\n" +
3661 " <th></th>\n" +
3660 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3662 " <th><input st-search=\"first_name\" placeholder=\"search for first name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3661 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3663 " <th><input st-search=\"last_name\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3662 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3664 " <th><input st-search=\"last_login_date\" placeholder=\"search for last name\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
3663 " <th></th>\n" +
3665 " <th></th>\n" +
3664 " </tr>\n" +
3666 " </tr>\n" +
3665 " </thead>\n" +
3667 " </thead>\n" +
3666 " <tbody>\n" +
3668 " <tbody>\n" +
3667 "\n" +
3669 "\n" +
3668 " <tr ng-repeat=\"user in displayedCollection track by user.id\">\n" +
3670 " <tr ng-repeat=\"user in displayedCollection track by user.id\">\n" +
3669 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
3671 " <td><img src=\"{{user.gravatar_url}}\" class=\"avatar\"> {{user.user_name}}</td>\n" +
3670 " <td class=\"word-wrap small\">{{user.email}}</td>\n" +
3672 " <td class=\"word-wrap small\">{{user.email}}</td>\n" +
3671 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
3673 " <td class=\"text-center\"><span class=\"fa\" ng-class=\"{'fa-check-circle':user.status, 'fa-times':!user.status}\"></span></td>\n" +
3672 " <td class=\"word-wrap small\">{{user.first_name}}</td>\n" +
3674 " <td class=\"word-wrap small\">{{user.first_name}}</td>\n" +
3673 " <td class=\"word-wrap small\">{{user.last_name}}</td>\n" +
3675 " <td class=\"word-wrap small\">{{user.last_name}}</td>\n" +
3674 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\" class=\"small\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3676 " <td><span data-uib-tooltip=\"{{user.last_login_date}}\" class=\"small\">{{user.last_login_date | isoToRelativeTime}}</span></td>\n" +
3675 " <td>\n" +
3677 " <td>\n" +
3676 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3678 " <a class=\"btn btn-default btn-sm\" data-ui-sref=\"admin.user.update({userId:user.id})\"><span class=\"fa fa-cog\"></span></a>\n" +
3677 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3679 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
3678 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3680 " <a class=\"btn btn-danger btn-sm\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
3679 " <ul class=\"dropdown-menu\">\n" +
3681 " <ul class=\"dropdown-menu\">\n" +
3680 " <li><a>No</a></li>\n" +
3682 " <li><a>No</a></li>\n" +
3681 " <li><a ng-click=\"users.removeUser(user)\">Yes</a></li>\n" +
3683 " <li><a ng-click=\"users.removeUser(user)\">Yes</a></li>\n" +
3682 " </ul>\n" +
3684 " </ul>\n" +
3683 " </span>\n" +
3685 " </span>\n" +
3684 " </tr>\n" +
3686 " </tr>\n" +
3685 " <tfoot>\n" +
3687 " <tfoot>\n" +
3686 " <tr>\n" +
3688 " <tr>\n" +
3687 " <td colspan=\"6\" class=\"text-center\">\n" +
3689 " <td colspan=\"6\" class=\"text-center\">\n" +
3688 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3690 " <div st-pagination=\"\" st-items-by-page=\"100\" st-displayed-pages=\"7\"></div>\n" +
3689 " </td>\n" +
3691 " </td>\n" +
3690 " </tr>\n" +
3692 " </tr>\n" +
3691 " </tfoot>\n" +
3693 " </tfoot>\n" +
3692 " </tbody>\n" +
3694 " </tbody>\n" +
3693 " </table>\n" +
3695 " </table>\n" +
3694 "\n" +
3696 "\n" +
3695 "\n" +
3697 "\n" +
3696 " </div>\n" +
3698 " </div>\n" +
3697 "</div>\n"
3699 "</div>\n"
3698 );
3700 );
3699
3701
3700
3702
3701 $templateCache.put('templates/applications/applications_purge_logs.html',
3703 $templateCache.put('templates/applications/applications_purge_logs.html',
3702 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications_purge.loading.applications\"></ng-include>\n" +
3704 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications_purge.loading.applications\"></ng-include>\n" +
3703 "\n" +
3705 "\n" +
3704 "<div ng-show=\"!applications_purge.loading.applications\">\n" +
3706 "<div ng-show=\"!applications_purge.loading.applications\">\n" +
3705 " <div class=\"panel panel-default\">\n" +
3707 " <div class=\"panel panel-default\">\n" +
3706 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
3708 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
3707 " <div class=\"panel-body\">\n" +
3709 " <div class=\"panel-body\">\n" +
3708 "\n" +
3710 "\n" +
3709 " <form method=\"post\" class=\"form-horizontal\" name=\"applications_purge.form\" ng-submit=\"applications_purge.purgeLogs()\">\n" +
3711 " <form method=\"post\" class=\"form-horizontal\" name=\"applications_purge.form\" ng-submit=\"applications_purge.purgeLogs()\">\n" +
3710 " <div class=\"form-group\">\n" +
3712 " <div class=\"form-group\">\n" +
3711 " <label class=\"control-label col-sm-3 col-lg-2\">Application:</label>\n" +
3713 " <label class=\"control-label col-sm-3 col-lg-2\">Application:</label>\n" +
3712 "\n" +
3714 "\n" +
3713 " <div class=\"col-sm-9 col-lg-10 form-inline\">\n" +
3715 " <div class=\"col-sm-9 col-lg-10 form-inline\">\n" +
3714 " <select ng-model=\"applications_purge.selectedResource\" ng-change=\"applications_purge.getCommonKeys()\"\n" +
3716 " <select ng-model=\"applications_purge.selectedResource\" ng-change=\"applications_purge.getCommonKeys()\"\n" +
3715 " ng-options=\"r.resource_id as r.resource_name for r in applications_purge.applications\" class=\"form-control\"></select>\n" +
3717 " ng-options=\"r.resource_id as r.resource_name for r in applications_purge.applications\" class=\"form-control\"></select>\n" +
3716 " </div>\n" +
3718 " </div>\n" +
3717 " </div>\n" +
3719 " </div>\n" +
3718 "\n" +
3720 "\n" +
3719 " <div class=\"form-group\">\n" +
3721 " <div class=\"form-group\">\n" +
3720 " <label class=\"control-label col-sm-3 col-lg-2\">Namespace:</label>\n" +
3722 " <label class=\"control-label col-sm-3 col-lg-2\">Namespace:</label>\n" +
3721 "\n" +
3723 "\n" +
3722 " <div class=\"col-sm-9 col-lg-10\">\n" +
3724 " <div class=\"col-sm-9 col-lg-10\">\n" +
3723 " <input type=\"text\" name=\"namespace\" ng-model=\"applications_purge.namespace\"\n" +
3725 " <input type=\"text\" name=\"namespace\" ng-model=\"applications_purge.namespace\"\n" +
3724 " placeholder=\"Namespace to filter on\" uib-typeahead=\"ns for ns in applications_purge.commonNamespaces\"\n" +
3726 " placeholder=\"Namespace to filter on\" uib-typeahead=\"ns for ns in applications_purge.commonNamespaces\"\n" +
3725 " class=\"form-control\">\n" +
3727 " class=\"form-control\">\n" +
3726 " </div>\n" +
3728 " </div>\n" +
3727 " </div>\n" +
3729 " </div>\n" +
3728 "\n" +
3730 "\n" +
3729 " <div class=\"form-group\">\n" +
3731 " <div class=\"form-group\">\n" +
3730 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
3732 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
3731 "\n" +
3733 "\n" +
3732 " <div class=\"col-sm-8 col-lg-9 \">\n" +
3734 " <div class=\"col-sm-8 col-lg-9 \">\n" +
3733 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Purge logs meeting the criteria\">\n" +
3735 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Purge logs meeting the criteria\">\n" +
3734 " </div>\n" +
3736 " </div>\n" +
3735 " </div>\n" +
3737 " </div>\n" +
3736 "\n" +
3738 "\n" +
3737 " </form>\n" +
3739 " </form>\n" +
3738 " </div>\n" +
3740 " </div>\n" +
3739 " </div>\n" +
3741 " </div>\n" +
3740 "</div>\n"
3742 "</div>\n"
3741 );
3743 );
3742
3744
3743
3745
3744 $templateCache.put('templates/applications/applications_update.html',
3746 $templateCache.put('templates/applications/applications_update.html',
3745 "<ng-include src=\"'templates/loader.html'\" ng-if=\"application.loading.application\"></ng-include>\n" +
3747 "<ng-include src=\"'templates/loader.html'\" ng-if=\"application.loading.application\"></ng-include>\n" +
3746 "\n" +
3748 "\n" +
3747 "<div ng-show=\"!application.loading.application\">\n" +
3749 "<div ng-show=\"!application.loading.application\">\n" +
3748 "\n" +
3750 "\n" +
3749 " <div class=\"panel panel-default\">\n" +
3751 " <div class=\"panel panel-default\">\n" +
3750 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
3752 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
3751 " <div class=\"panel-body\">\n" +
3753 " <div class=\"panel-body\">\n" +
3752 "\n" +
3754 "\n" +
3753 " <div class=\"row\" ng-show=\"application.resource.resource_id\">\n" +
3755 " <div class=\"row\" ng-show=\"application.resource.resource_id\">\n" +
3754 " <div class=\"col-sm-6\">\n" +
3756 " <div class=\"col-sm-6\">\n" +
3755 "\n" +
3757 "\n" +
3756 " <uib-tabset>\n" +
3758 " <uib-tabset>\n" +
3757 " <uib-tab>\n" +
3759 " <uib-tab>\n" +
3758 " <uib-tab-heading>\n" +
3760 " <uib-tab-heading>\n" +
3759 " API keys\n" +
3761 " API keys\n" +
3760 " </uib-tab-heading>\n" +
3762 " </uib-tab-heading>\n" +
3761 "\n" +
3763 "\n" +
3762 " <p><strong>PRIVATE API KEY:</strong></p>\n" +
3764 " <p><strong>PRIVATE API KEY:</strong></p>\n" +
3763 " <p>\n" +
3765 " <p>\n" +
3764 " <div class=\"well well-sm\">{{ application.resource.api_key }}</div>\n" +
3766 " <div class=\"well well-sm\">{{ application.resource.api_key }}</div>\n" +
3765 " </p>\n" +
3767 " </p>\n" +
3766 " <p><strong>PUBLIC API KEY</strong> (for javascript clients):</p>\n" +
3768 " <p><strong>PUBLIC API KEY</strong> (for javascript clients):</p>\n" +
3767 " <p>\n" +
3769 " <p>\n" +
3768 " <div class=\"well well-sm\">{{ application.resource.public_key }}</div>\n" +
3770 " <div class=\"well well-sm\">{{ application.resource.public_key }}</div>\n" +
3769 " </p>\n" +
3771 " </p>\n" +
3770 " <p><small>Your key will be used to identify to which application your data\n" +
3772 " <p><small>Your key will be used to identify to which application your data\n" +
3771 " belongs to please keep them private at all times.</small></p>\n" +
3773 " belongs to please keep them private at all times.</small></p>\n" +
3772 "\n" +
3774 "\n" +
3773 " </uib-tab>\n" +
3775 " </uib-tab>\n" +
3774 "\n" +
3776 "\n" +
3775 " <uib-tab>\n" +
3777 " <uib-tab>\n" +
3776 " <uib-tab-heading>\n" +
3778 " <uib-tab-heading>\n" +
3777 " <span class=\"btn btn-danger btn-xs\"><span class=\"fa fa-exclamation-triangle\"></span></span> Regenerate API keys\n" +
3779 " <span class=\"btn btn-danger btn-xs\"><span class=\"fa fa-exclamation-triangle\"></span></span> Regenerate API keys\n" +
3778 " </uib-tab-heading>\n" +
3780 " </uib-tab-heading>\n" +
3779 " <p>Are you sure you want to regenerate API KEY for this application?</p>\n" +
3781 " <p>Are you sure you want to regenerate API KEY for this application?</p>\n" +
3780 " <p>All client application keys will need to be updated.</p>\n" +
3782 " <p>All client application keys will need to be updated.</p>\n" +
3781 " <form ng-submit=\"application.regenerateAPIKeys()\" name=\"application.regenerateAPIKeysForm\" class=\"form-inline\">\n" +
3783 " <form ng-submit=\"application.regenerateAPIKeys()\" name=\"application.regenerateAPIKeysForm\" class=\"form-inline\">\n" +
3782 " <data-form-errors errors=\"application.regenerateAPIKeysForm.ae_validation.password\"></data-form-errors>\n" +
3784 " <data-form-errors errors=\"application.regenerateAPIKeysForm.ae_validation.password\"></data-form-errors>\n" +
3783 " <div class=\"form-group\">\n" +
3785 " <div class=\"form-group\">\n" +
3784 " <input type=\"password\" name=\"confirm\"\n" +
3786 " <input type=\"password\" name=\"confirm\"\n" +
3785 " placeholder=\"Enter your password to proceed\" class=\"form-control\" ng-model=\"application.regenerateAPIKeysPassword\">\n" +
3787 " placeholder=\"Enter your password to proceed\" class=\"form-control\" ng-model=\"application.regenerateAPIKeysPassword\">\n" +
3786 " <input type=\"submit\" class=\"btn btn-danger\" value=\"Confirm\">\n" +
3788 " <input type=\"submit\" class=\"btn btn-danger\" value=\"Confirm\">\n" +
3787 " </div>\n" +
3789 " </div>\n" +
3788 " </form>\n" +
3790 " </form>\n" +
3789 " </uib-tab>\n" +
3791 " </uib-tab>\n" +
3790 " </uib-tabset>\n" +
3792 " </uib-tabset>\n" +
3791 " </div>\n" +
3793 " </div>\n" +
3792 " <div class=\"col-sm-6 text-center\">\n" +
3794 " <div class=\"col-sm-6 text-center\">\n" +
3793 " <h2 class=\"m-t-0\">How to connect your application?</h2>\n" +
3795 " <h2 class=\"m-t-0\">How to connect your application?</h2>\n" +
3794 " <p>Visit our <a href=\"{{AeConfig.urls.docs}}\"><strong>developer documentation</strong></a> for step-by-step integration instructions.</p>\n" +
3796 " <p>Visit our <a href=\"{{AeConfig.urls.docs}}\"><strong>developer documentation</strong></a> for step-by-step integration instructions.</p>\n" +
3795 " <div class=\"clearfix\"></div>\n" +
3797 " <div class=\"clearfix\"></div>\n" +
3796 " <p class=\"text-center\">\n" +
3798 " <p class=\"text-center\">\n" +
3797 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/django_small.png\" alt=\"Django Logo\">\n" +
3799 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/django_small.png\" alt=\"Django Logo\">\n" +
3798 " <img src=\"/static/appenlight/images/logos/pyramid_small.png\" alt=\"Pyramid Logo\">\n" +
3800 " <img src=\"/static/appenlight/images/logos/pyramid_small.png\" alt=\"Pyramid Logo\">\n" +
3799 " <img src=\"/static/appenlight/images/logos/flask_small.png\" alt=\"Flask Logo\"></a>\n" +
3801 " <img src=\"/static/appenlight/images/logos/flask_small.png\" alt=\"Flask Logo\"></a>\n" +
3800 "\n" +
3802 "\n" +
3801 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/js_small.png\" alt=\"Javascript Logo\">\n" +
3803 " <a href=\"{{AeConfig.urls.docs}}\"><img src=\"/static/appenlight/images/logos/js_small.png\" alt=\"Javascript Logo\">\n" +
3802 " <img src=\"/static/appenlight/images/logos/nodejs.png\" alt=\"Node.js\"></a>\n" +
3804 " <img src=\"/static/appenlight/images/logos/nodejs.png\" alt=\"Node.js\"></a>\n" +
3803 " <img src=\"/static/appenlight/images/logos/ruby_small.png\" alt=\"Ruby Logo\">\n" +
3805 " <img src=\"/static/appenlight/images/logos/ruby_small.png\" alt=\"Ruby Logo\">\n" +
3804 " <img src=\"/static/appenlight/images/logos/php_small.png\" alt=\"PHP Logo\">\n" +
3806 " <img src=\"/static/appenlight/images/logos/php_small.png\" alt=\"PHP Logo\">\n" +
3805 " </a>\n" +
3807 " </a>\n" +
3806 "\n" +
3808 "\n" +
3807 " </p>\n" +
3809 " </p>\n" +
3808 " </div>\n" +
3810 " </div>\n" +
3809 " </div>\n" +
3811 " </div>\n" +
3810 "\n" +
3812 "\n" +
3811 " <hr ng-show=\"application.resource.resource_id\">\n" +
3813 " <hr ng-show=\"application.resource.resource_id\">\n" +
3812 "\n" +
3814 "\n" +
3813 " <form method=\"post\" class=\"form-horizontal\" name=\"application.BasicForm\" ng-submit=\"application.updateBasicForm()\" novalidate>\n" +
3815 " <form method=\"post\" class=\"form-horizontal\" name=\"application.BasicForm\" ng-submit=\"application.updateBasicForm()\" novalidate>\n" +
3814 " <div class=\"form-group\">\n" +
3816 " <div class=\"form-group\">\n" +
3815 " <data-form-errors errors=\"application.BasicForm.ae_validation.resource_name\"></data-form-errors>\n" +
3817 " <data-form-errors errors=\"application.BasicForm.ae_validation.resource_name\"></data-form-errors>\n" +
3816 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3818 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3817 " Application name\n" +
3819 " Application name\n" +
3818 " <span class=\"required\">*</span>\n" +
3820 " <span class=\"required\">*</span>\n" +
3819 " </label>\n" +
3821 " </label>\n" +
3820 "\n" +
3822 "\n" +
3821 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3823 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3822 " <input class=\"form-control\" name=\"resource_name\" placeholder=\"Application Name\" type=\"text\" ng-model=\"application.resource.resource_name\">\n" +
3824 " <input class=\"form-control\" name=\"resource_name\" placeholder=\"Application Name\" type=\"text\" ng-model=\"application.resource.resource_name\">\n" +
3823 " </div>\n" +
3825 " </div>\n" +
3824 "\n" +
3826 "\n" +
3825 "\n" +
3827 "\n" +
3826 " </div>\n" +
3828 " </div>\n" +
3827 "\n" +
3829 "\n" +
3828 " <div class=\"form-group\">\n" +
3830 " <div class=\"form-group\">\n" +
3829 " <data-form-errors errors=\"application.BasicForm.ae_validation.domains\"></data-form-errors>\n" +
3831 " <data-form-errors errors=\"application.BasicForm.ae_validation.domains\"></data-form-errors>\n" +
3830 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3832 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3831 " Domain names for CORS headers\n" +
3833 " Domain names for CORS headers\n" +
3832 " </label>\n" +
3834 " </label>\n" +
3833 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3835 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3834 " <textarea class=\"form-control\" name=\"domains\" ng-model=\"application.resource.domains\"></textarea>\n" +
3836 " <textarea class=\"form-control\" name=\"domains\" ng-model=\"application.resource.domains\"></textarea>\n" +
3835 " <p class=\"description\">Required for Javascript error tracking (one line one domain, skip http:// part)</p>\n" +
3837 " <p class=\"description\">Required for Javascript error tracking (one line one domain, skip http:// part)</p>\n" +
3836 " </div>\n" +
3838 " </div>\n" +
3837 "\n" +
3839 "\n" +
3838 "\n" +
3840 "\n" +
3839 " </div>\n" +
3841 " </div>\n" +
3840 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3842 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3841 " <data-form-errors errors=\"application.BasicForm.ae_validation.default_grouping\"></data-form-errors>\n" +
3843 " <data-form-errors errors=\"application.BasicForm.ae_validation.default_grouping\"></data-form-errors>\n" +
3842 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3844 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3843 " Default grouping for errors\n" +
3845 " Default grouping for errors\n" +
3844 " </label>\n" +
3846 " </label>\n" +
3845 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3847 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3846 " <select class=\"form-control\" name=\"default_grouping\" ng-model=\"application.resource.default_grouping\" ng-options=\"i[0] as i[1] for i in application.groupingOptions\"></select>\n" +
3848 " <select class=\"form-control\" name=\"default_grouping\" ng-model=\"application.resource.default_grouping\" ng-options=\"i[0] as i[1] for i in application.groupingOptions\"></select>\n" +
3847 " </div>\n" +
3849 " </div>\n" +
3848 "\n" +
3850 "\n" +
3849 " </div>\n" +
3851 " </div>\n" +
3850 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3852 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3851 " <data-form-errors errors=\"application.BasicForm.ae_validation.error_report_threshold\"></data-form-errors>\n" +
3853 " <data-form-errors errors=\"application.BasicForm.ae_validation.error_report_threshold\"></data-form-errors>\n" +
3852 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3854 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3853 " Alert on error reports\n" +
3855 " Alert on error reports\n" +
3854 " <span class=\"required\">*</span>\n" +
3856 " <span class=\"required\">*</span>\n" +
3855 " </label>\n" +
3857 " </label>\n" +
3856 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3858 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3857 " <input class=\"form-control\" name=\"error_report_threshold\" type=\"text\" ng-model=\"application.resource.error_report_threshold\">\n" +
3859 " <input class=\"form-control\" name=\"error_report_threshold\" type=\"text\" ng-model=\"application.resource.error_report_threshold\">\n" +
3858 " <p class=\"description\">Application requires to send at least this amount of error reports per minute to open alert</p>\n" +
3860 " <p class=\"description\">Application requires to send at least this amount of error reports per minute to open alert</p>\n" +
3859 " </div>\n" +
3861 " </div>\n" +
3860 " </div>\n" +
3862 " </div>\n" +
3861 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3863 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3862 " <data-form-errors errors=\"application.BasicForm.ae_validation.slow_report_threshold\"></data-form-errors>\n" +
3864 " <data-form-errors errors=\"application.BasicForm.ae_validation.slow_report_threshold\"></data-form-errors>\n" +
3863 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3865 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3864 " Alert on slow reports\n" +
3866 " Alert on slow reports\n" +
3865 " <span class=\"required\">*</span>\n" +
3867 " <span class=\"required\">*</span>\n" +
3866 " </label>\n" +
3868 " </label>\n" +
3867 "\n" +
3869 "\n" +
3868 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3870 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3869 " <input class=\"form-control\" name=\"slow_report_threshold\" type=\"text\" ng-model=\"application.resource.slow_report_threshold\">\n" +
3871 " <input class=\"form-control\" name=\"slow_report_threshold\" type=\"text\" ng-model=\"application.resource.slow_report_threshold\">\n" +
3870 " <p class=\"description\">Application requires to send at least this amount of slow reports per minute to open alert</p>\n" +
3872 " <p class=\"description\">Application requires to send at least this amount of slow reports per minute to open alert</p>\n" +
3871 " </div>\n" +
3873 " </div>\n" +
3872 " </div>\n" +
3874 " </div>\n" +
3873 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3875 " <div class=\"form-group\" ng-show=\"application.resource.resource_id\">\n" +
3874 " <data-form-errors errors=\"application.BasicForm.ae_validation.allow_permanent_storage\"></data-form-errors>\n" +
3876 " <data-form-errors errors=\"application.BasicForm.ae_validation.allow_permanent_storage\"></data-form-errors>\n" +
3875 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3877 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3876 " Permanent logs\n" +
3878 " Permanent logs\n" +
3877 " </label>\n" +
3879 " </label>\n" +
3878 " <div class=\" col-sm-8 col-lg-9\">\n" +
3880 " <div class=\" col-sm-8 col-lg-9\">\n" +
3879 " <input class=\"form-control\" name=\"allow_permanent_storage\" type=\"checkbox\" ng-model=\"application.resource.allow_permanent_storage\">\n" +
3881 " <input class=\"form-control\" name=\"allow_permanent_storage\" type=\"checkbox\" ng-model=\"application.resource.allow_permanent_storage\">\n" +
3880 " <p class=\"description\">Allow permanent storage of logs in separate DB partitions (only administrator can enable this feature)</p>\n" +
3882 " <p class=\"description\">Allow permanent storage of logs in separate DB partitions (only administrator can enable this feature)</p>\n" +
3881 " </div>\n" +
3883 " </div>\n" +
3882 " </div>\n" +
3884 " </div>\n" +
3883 " <div class=\"form-group\">\n" +
3885 " <div class=\"form-group\">\n" +
3884 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3886 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
3885 "\n" +
3887 "\n" +
3886 " </label>\n" +
3888 " </label>\n" +
3887 "\n" +
3889 "\n" +
3888 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3890 " <div class=\" col-sm-8 col-lg-9 \">\n" +
3889 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"{{application.resource.resource_id? 'Update' : 'Create'}} Application\">\n" +
3891 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"{{application.resource.resource_id? 'Update' : 'Create'}} Application\">\n" +
3890 " </div>\n" +
3892 " </div>\n" +
3891 " </div>\n" +
3893 " </div>\n" +
3892 " </form>\n" +
3894 " </form>\n" +
3893 " </div>\n" +
3895 " </div>\n" +
3894 " </div>\n" +
3896 " </div>\n" +
3895 "\n" +
3897 "\n" +
3896 " <div class=\"panel panel-default\" ng-show=\"application.resource.resource_id\">\n" +
3898 " <div class=\"panel panel-default\" ng-show=\"application.resource.resource_id\">\n" +
3897 " <div class=\"panel-heading\">\n" +
3899 " <div class=\"panel-heading\">\n" +
3898 " <h3 class=\"panel-title\">Plugins</h3>\n" +
3900 " <h3 class=\"panel-title\">Plugins</h3>\n" +
3899 " </div>\n" +
3901 " </div>\n" +
3900 " <div class=\"panel-body\">\n" +
3902 " <div class=\"panel-body\">\n" +
3901 "\n" +
3903 "\n" +
3902 " <plugin-config resource=\"application.resource\"\n" +
3904 " <plugin-config resource=\"application.resource\"\n" +
3903 " section=\"'application.update'\"\n" +
3905 " section=\"'application.update'\"\n" +
3904 " ng-if=\"application.resource.resource_id\">\n" +
3906 " ng-if=\"application.resource.resource_id\">\n" +
3905 " </plugin-config>\n" +
3907 " </plugin-config>\n" +
3906 "\n" +
3908 "\n" +
3907 " </div>\n" +
3909 " </div>\n" +
3908 " </div>\n" +
3910 " </div>\n" +
3909 "\n" +
3911 "\n" +
3910 " <div class=\"panel panel-default m-t-1\" ng-show=\"application.resource.resource_id\">\n" +
3912 " <div class=\"panel panel-default m-t-1\" ng-show=\"application.resource.resource_id\">\n" +
3911 " <div class=\"panel-heading\">\n" +
3913 " <div class=\"panel-heading\">\n" +
3912 " <h3 class=\"panel-title\">API Testing</h3>\n" +
3914 " <h3 class=\"panel-title\">API Testing</h3>\n" +
3913 " </div>\n" +
3915 " </div>\n" +
3914 " <div class=\"panel-body\">\n" +
3916 " <div class=\"panel-body\">\n" +
3915 " <p>Please be sure to add at least one <a data-ui-sref=\"user.alert_channels.email\"><strong>email alert channel</strong></a> for your account.</p>\n" +
3917 " <p>Please be sure to add at least one <a data-ui-sref=\"user.alert_channels.email\"><strong>email alert channel</strong></a> for your account.</p>\n" +
3916 " <p>This will enable AppEnlight to send you notification emails about errors inside your application.</p>\n" +
3918 " <p>This will enable AppEnlight to send you notification emails about errors inside your application.</p>\n" +
3917 " <p><strong>After this is done you can use this CURL commands to test APIs:</strong></p>\n" +
3919 " <p><strong>After this is done you can use this CURL commands to test APIs:</strong></p>\n" +
3918 " <p>(Please note that the data like execution times is semi randomly generated)</p>\n" +
3920 " <p>(Please note that the data like execution times is semi randomly generated)</p>\n" +
3919 " <uib-tabset>\n" +
3921 " <uib-tabset>\n" +
3920 " <uib-tab>\n" +
3922 " <uib-tab>\n" +
3921 " <uib-tab-heading>\n" +
3923 " <uib-tab-heading>\n" +
3922 " Log API\n" +
3924 " Log API\n" +
3923 " </uib-tab-heading>\n" +
3925 " </uib-tab-heading>\n" +
3924 "\n" +
3926 "\n" +
3925 " <div class=\"codehilite\">\n" +
3927 " <div class=\"codehilite\">\n" +
3926 " <pre class=\"m-a-0\">\n" +
3928 " <pre class=\"m-a-0\">\n" +
3927 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/logs?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
3929 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/logs?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
3928 " [\n" +
3930 " [\n" +
3929 " {\n" +
3931 " {\n" +
3930 " \"log_level\": \"WARNING\",\n" +
3932 " \"log_level\": \"WARNING\",\n" +
3931 " \"message\": \"OMG ValueError happened\",\n" +
3933 " \"message\": \"OMG ValueError happened\",\n" +
3932 " \"namespace\": \"some.namespace.indicator\",\n" +
3934 " \"namespace\": \"some.namespace.indicator\",\n" +
3933 " \"request_id\": \"SOME_UUID\",\n" +
3935 " \"request_id\": \"SOME_UUID\",\n" +
3934 " \"permanent\": false,\n" +
3936 " \"permanent\": false,\n" +
3935 " \"primary_key\": \"random_key\",\n" +
3937 " \"primary_key\": \"random_key\",\n" +
3936 " \"server\": \"some.server.hostname\",\n" +
3938 " \"server\": \"some.server.hostname\",\n" +
3937 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3939 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3938 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]]\n" +
3940 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]]\n" +
3939 " },\n" +
3941 " },\n" +
3940 " {\n" +
3942 " {\n" +
3941 " \"log_level\": \"ERROR\",\n" +
3943 " \"log_level\": \"ERROR\",\n" +
3942 " \"message\": \"OMG ValueError happened2\",\n" +
3944 " \"message\": \"OMG ValueError happened2\",\n" +
3943 " \"namespace\": \"some.namespace.indicator\",\n" +
3945 " \"namespace\": \"some.namespace.indicator\",\n" +
3944 " \"request_id\": \"SOME_UUID\",\n" +
3946 " \"request_id\": \"SOME_UUID\",\n" +
3945 " \"permanent\": false,\n" +
3947 " \"permanent\": false,\n" +
3946 " \"server\": \"some.server.hostname\",\n" +
3948 " \"server\": \"some.server.hostname\",\n" +
3947 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\"\n" +
3949 " \"date\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\"\n" +
3948 " }\n" +
3950 " }\n" +
3949 " ]'\n" +
3951 " ]'\n" +
3950 " </pre>\n" +
3952 " </pre>\n" +
3951 " </div>\n" +
3953 " </div>\n" +
3952 "\n" +
3954 "\n" +
3953 " </uib-tab>\n" +
3955 " </uib-tab>\n" +
3954 "\n" +
3956 "\n" +
3955 " <uib-tab>\n" +
3957 " <uib-tab>\n" +
3956 " <uib-tab-heading>\n" +
3958 " <uib-tab-heading>\n" +
3957 " Report API\n" +
3959 " Report API\n" +
3958 " </uib-tab-heading>\n" +
3960 " </uib-tab-heading>\n" +
3959 "\n" +
3961 "\n" +
3960 " <div class=\"codehilite\">\n" +
3962 " <div class=\"codehilite\">\n" +
3961 " <pre class=\"m-a-0\">\n" +
3963 " <pre class=\"m-a-0\">\n" +
3962 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/reports?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
3964 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/reports?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
3963 " [{\n" +
3965 " [{\n" +
3964 " \"client\": \"your-client-name-python\",\n" +
3966 " \"client\": \"your-client-name-python\",\n" +
3965 " \"language\": \"python\",\n" +
3967 " \"language\": \"python\",\n" +
3966 " \"view_name\": \"views/foo:bar\",\n" +
3968 " \"view_name\": \"views/foo:bar\",\n" +
3967 " \"server\": \"SERVERNAME/INSTANCENAME\",\n" +
3969 " \"server\": \"SERVERNAME/INSTANCENAME\",\n" +
3968 " \"priority\": 5,\n" +
3970 " \"priority\": 5,\n" +
3969 " \"error\": \"OMG ValueError happened\",\n" +
3971 " \"error\": \"OMG ValueError happened\",\n" +
3970 " \"occurences\":1,\n" +
3972 " \"occurences\":1,\n" +
3971 " \"http_status\": 500,\n" +
3973 " \"http_status\": 500,\n" +
3972 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]],\n" +
3974 " \"tags\": [[\"tag1\",\"value\"], [\"tag2\", 5]],\n" +
3973 " \"username\": \"USER\",\n" +
3975 " \"username\": \"USER\",\n" +
3974 " \"url\": \"HTTP://SOMEURL\",\n" +
3976 " \"url\": \"HTTP://SOMEURL\",\n" +
3975 " \"ip\": \"127.0.0.1\",\n" +
3977 " \"ip\": \"127.0.0.1\",\n" +
3976 " \"start_time\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3978 " \"start_time\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3977 " \"end_time\": \"{{application.momentJs.utc().milliseconds(0).add(2, 'seconds').toISOString()}}\",\n" +
3979 " \"end_time\": \"{{application.momentJs.utc().milliseconds(0).add(2, 'seconds').toISOString()}}\",\n" +
3978 " \"user_agent\": \"BROWSER_AGENT\",\n" +
3980 " \"user_agent\": \"BROWSER_AGENT\",\n" +
3979 " \"extra\": [[\"message\",\"CUSTOM MESSAGE\"], [\"custom_value\", \"some payload\"]],\n" +
3981 " \"extra\": [[\"message\",\"CUSTOM MESSAGE\"], [\"custom_value\", \"some payload\"]],\n" +
3980 " \"request_id\": \"SOME_UUID\",\n" +
3982 " \"request_id\": \"SOME_UUID\",\n" +
3981 " \"request\": {\"REQUEST_METHOD\": \"GET\",\n" +
3983 " \"request\": {\"REQUEST_METHOD\": \"GET\",\n" +
3982 " \"PATH_INFO\": \"/FOO/BAR\",\n" +
3984 " \"PATH_INFO\": \"/FOO/BAR\",\n" +
3983 " \"POST\": {\"FOO\":\"BAZ\",\"XXX\":\"YYY\"}\n" +
3985 " \"POST\": {\"FOO\":\"BAZ\",\"XXX\":\"YYY\"}\n" +
3984 " },\n" +
3986 " },\n" +
3985 " \"slow_calls\":[{\n" +
3987 " \"slow_calls\":[{\n" +
3986 " \"start\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3988 " \"start\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
3987 " \"end\": \"{{application.momentJs.utc().milliseconds(0).add(1, 'seconds').toISOString()}}\",\n" +
3989 " \"end\": \"{{application.momentJs.utc().milliseconds(0).add(1, 'seconds').toISOString()}}\",\n" +
3988 " \"type\": \"sql\",\n" +
3990 " \"type\": \"sql\",\n" +
3989 " \"subtype\": \"postgresql\",\n" +
3991 " \"subtype\": \"postgresql\",\n" +
3990 " \"parameters\": [\"QPARAM1\",\"QPARAM2\",\"QPARAMX\"],\n" +
3992 " \"parameters\": [\"QPARAM1\",\"QPARAM2\",\"QPARAMX\"],\n" +
3991 " \"statement\": \"QUERY\"\n" +
3993 " \"statement\": \"QUERY\"\n" +
3992 " }],\n" +
3994 " }],\n" +
3993 " \"request_stats\": {\n" +
3995 " \"request_stats\": {\n" +
3994 " \"main\": 2.50779,\n" +
3996 " \"main\": 2.50779,\n" +
3995 " \"nosql\": 0.01008,\n" +
3997 " \"nosql\": 0.01008,\n" +
3996 " \"nosql_calls\": 17.0,\n" +
3998 " \"nosql_calls\": 17.0,\n" +
3997 " \"remote\": 0.0,\n" +
3999 " \"remote\": 0.0,\n" +
3998 " \"remote_calls\": 0.0,\n" +
4000 " \"remote_calls\": 0.0,\n" +
3999 " \"sql\": 1,\n" +
4001 " \"sql\": 1,\n" +
4000 " \"sql_calls\": 1.0,\n" +
4002 " \"sql_calls\": 1.0,\n" +
4001 " \"tmpl\": 0.0,\n" +
4003 " \"tmpl\": 0.0,\n" +
4002 " \"tmpl_calls\": 0.0,\n" +
4004 " \"tmpl_calls\": 0.0,\n" +
4003 " \"custom\": 0.0,\n" +
4005 " \"custom\": 0.0,\n" +
4004 " \"custom_calls\": 0.0\n" +
4006 " \"custom_calls\": 0.0\n" +
4005 " },\n" +
4007 " },\n" +
4006 " \"traceback\": [\n" +
4008 " \"traceback\": [\n" +
4007 " {\"cline\": \"return foo_bar_baz(1,2,3)\",\n" +
4009 " {\"cline\": \"return foo_bar_baz(1,2,3)\",\n" +
4008 " \"file\": \"somedir/somefile.py\",\n" +
4010 " \"file\": \"somedir/somefile.py\",\n" +
4009 " \"fn\": \"somefunction\",\n" +
4011 " \"fn\": \"somefunction\",\n" +
4010 " \"line\": 454,\n" +
4012 " \"line\": 454,\n" +
4011 " \"vars\": [[\"a_list\",\n" +
4013 " \"vars\": [[\"a_list\",\n" +
4012 " [\"1\",2,\"4\",\"5\",6]],\n" +
4014 " [\"1\",2,\"4\",\"5\",6]],\n" +
4013 " [\"b\", {\"1\": \"2\", \"ccc\": \"ddd\", \"1\": \"a\"}],\n" +
4015 " [\"b\", {\"1\": \"2\", \"ccc\": \"ddd\", \"1\": \"a\"}],\n" +
4014 " [\"obj\", \"object object at 0x7f0030853dc0\"]]\n" +
4016 " [\"obj\", \"object object at 0x7f0030853dc0\"]]\n" +
4015 " },\n" +
4017 " },\n" +
4016 " {\"cline\": \"OMG ValueError happened\",\n" +
4018 " {\"cline\": \"OMG ValueError happened\",\n" +
4017 " \"file\": \"\",\n" +
4019 " \"file\": \"\",\n" +
4018 " \"fn\": \"\",\n" +
4020 " \"fn\": \"\",\n" +
4019 " \"line\": \"\",\n" +
4021 " \"line\": \"\",\n" +
4020 " \"vars\": []}\n" +
4022 " \"vars\": []}\n" +
4021 " ]\n" +
4023 " ]\n" +
4022 " }]'\n" +
4024 " }]'\n" +
4023 " </pre>\n" +
4025 " </pre>\n" +
4024 " </div>\n" +
4026 " </div>\n" +
4025 "\n" +
4027 "\n" +
4026 " </uib-tab>\n" +
4028 " </uib-tab>\n" +
4027 "\n" +
4029 "\n" +
4028 " <uib-tab>\n" +
4030 " <uib-tab>\n" +
4029 "\n" +
4031 "\n" +
4030 " <uib-tab-heading>\n" +
4032 " <uib-tab-heading>\n" +
4031 " Metrics API\n" +
4033 " Metrics API\n" +
4032 " </uib-tab-heading>\n" +
4034 " </uib-tab-heading>\n" +
4033 "\n" +
4035 "\n" +
4034 " <div class=\"codehilite\">\n" +
4036 " <div class=\"codehilite\">\n" +
4035 " <pre class=\"m-a-0\">\n" +
4037 " <pre class=\"m-a-0\">\n" +
4036 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/general_metrics?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4038 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/general_metrics?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4037 " [{\n" +
4039 " [{\n" +
4038 " \"namespace\": \"some.monitor\",\n" +
4040 " \"namespace\": \"some.monitor\",\n" +
4039 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4041 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4040 " \"server_name\": \"server.name\",\n" +
4042 " \"server_name\": \"server.name\",\n" +
4041 " \"tags\": [[\"value1\", 15.7], [\"value2\", 26]]}]'\n" +
4043 " \"tags\": [[\"value1\", 15.7], [\"value2\", 26]]}]'\n" +
4042 " </pre>\n" +
4044 " </pre>\n" +
4043 " </div>\n" +
4045 " </div>\n" +
4044 "\n" +
4046 "\n" +
4045 " </uib-tab>\n" +
4047 " </uib-tab>\n" +
4046 "\n" +
4048 "\n" +
4047 " <uib-tab>\n" +
4049 " <uib-tab>\n" +
4048 "\n" +
4050 "\n" +
4049 " <uib-tab-heading>\n" +
4051 " <uib-tab-heading>\n" +
4050 " Request Stats API\n" +
4052 " Request Stats API\n" +
4051 " </uib-tab-heading>\n" +
4053 " </uib-tab-heading>\n" +
4052 "\n" +
4054 "\n" +
4053 " <div class=\"codehilite\">\n" +
4055 " <div class=\"codehilite\">\n" +
4054 " <pre class=\"m-a-0\">\n" +
4056 " <pre class=\"m-a-0\">\n" +
4055 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/request_stats?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4057 "curl -H \"Content-Type: application/json\" -k {{AeConfig.urls.baseUrl}}api/request_stats?protocol_version=0.5\\&ampapi_key={{application.resource.api_key}} -d '\n" +
4056 " [{\"server\": \"some.server.hostname\",\n" +
4058 " [{\"server\": \"some.server.hostname\",\n" +
4057 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4059 " \"timestamp\": \"{{application.momentJs.utc().milliseconds(0).toISOString()}}\",\n" +
4058 " \"metrics\": [[\"dir/module:func\",\n" +
4060 " \"metrics\": [[\"dir/module:func\",\n" +
4059 " {\"custom\": 0.0,\n" +
4061 " {\"custom\": 0.0,\n" +
4060 " \"custom_calls\": 0,\n" +
4062 " \"custom_calls\": 0,\n" +
4061 " \"main\": 0.01664,\n" +
4063 " \"main\": 0.01664,\n" +
4062 " \"nosql\": 0.00061,\n" +
4064 " \"nosql\": 0.00061,\n" +
4063 " \"nosql_calls\": 23,\n" +
4065 " \"nosql_calls\": 23,\n" +
4064 " \"remote\": 0.0,\n" +
4066 " \"remote\": 0.0,\n" +
4065 " \"remote_calls\": 0,\n" +
4067 " \"remote_calls\": 0,\n" +
4066 " \"requests\": 1,\n" +
4068 " \"requests\": 1,\n" +
4067 " \"sql\": 0.00105,\n" +
4069 " \"sql\": 0.00105,\n" +
4068 " \"sql_calls\": 2,\n" +
4070 " \"sql_calls\": 2,\n" +
4069 " \"tmpl\": 0.0,\n" +
4071 " \"tmpl\": 0.0,\n" +
4070 " \"tmpl_calls\": 0}],\n" +
4072 " \"tmpl_calls\": 0}],\n" +
4071 " [\"SomeView.function\",\n" +
4073 " [\"SomeView.function\",\n" +
4072 " {\"custom\": 0.0,\n" +
4074 " {\"custom\": 0.0,\n" +
4073 " \"custom_calls\": 0,\n" +
4075 " \"custom_calls\": 0,\n" +
4074 " \"main\": 0.647261,\n" +
4076 " \"main\": 0.647261,\n" +
4075 " \"nosql\": 0.306554,\n" +
4077 " \"nosql\": 0.306554,\n" +
4076 " \"nosql_calls\": 140,\n" +
4078 " \"nosql_calls\": 140,\n" +
4077 " \"remote\": 0.0,\n" +
4079 " \"remote\": 0.0,\n" +
4078 " \"remote_calls\": 0,\n" +
4080 " \"remote_calls\": 0,\n" +
4079 " \"requests\": 28,\n" +
4081 " \"requests\": 28,\n" +
4080 " \"sql\": 0.0,\n" +
4082 " \"sql\": 0.0,\n" +
4081 " \"sql_calls\": 0,\n" +
4083 " \"sql_calls\": 0,\n" +
4082 " \"tmpl\": 0.0,\n" +
4084 " \"tmpl\": 0.0,\n" +
4083 " \"tmpl_calls\": 0}]]\n" +
4085 " \"tmpl_calls\": 0}]]\n" +
4084 " }]'\n" +
4086 " }]'\n" +
4085 " </pre>\n" +
4087 " </pre>\n" +
4086 " </div>\n" +
4088 " </div>\n" +
4087 "\n" +
4089 "\n" +
4088 " </uib-tab>\n" +
4090 " </uib-tab>\n" +
4089 "\n" +
4091 "\n" +
4090 " </uib-tabset>\n" +
4092 " </uib-tabset>\n" +
4091 "\n" +
4093 "\n" +
4092 " </div>\n" +
4094 " </div>\n" +
4093 " </div>\n" +
4095 " </div>\n" +
4094 "\n" +
4096 "\n" +
4095 " <permissions-form resource=\"application.resource\" current-permissions=\"application.resource.current_permissions\"\n" +
4097 " <permissions-form resource=\"application.resource\" current-permissions=\"application.resource.current_permissions\"\n" +
4096 " possible-permissions=\"application.resource.possible_permissions\" ng-if=\"application.resource.resource_id\"></permissions-form>\n" +
4098 " possible-permissions=\"application.resource.possible_permissions\" ng-if=\"application.resource.resource_id\"></permissions-form>\n" +
4097 "\n" +
4099 "\n" +
4098 " <div class=\"panel panel-info\" ng-show=\"application.resource.resource_id\">\n" +
4100 " <div class=\"panel panel-info\" ng-show=\"application.resource.resource_id\">\n" +
4099 " <div class=\"panel-heading\">\n" +
4101 " <div class=\"panel-heading\">\n" +
4100 " <h3 class=\"panel-title\">Postprocessing</h3>\n" +
4102 " <h3 class=\"panel-title\">Postprocessing</h3>\n" +
4101 " </div>\n" +
4103 " </div>\n" +
4102 " <div class=\"panel-body\">\n" +
4104 " <div class=\"panel-body\">\n" +
4103 " <p>This section allows you influence the rating of report groups - if rule is matched once its not executed anymore</p>\n" +
4105 " <p>This section allows you influence the rating of report groups - if rule is matched once its not executed anymore</p>\n" +
4104 "\n" +
4106 "\n" +
4105 " <p>\n" +
4107 " <p>\n" +
4106 " <a class=\"btn btn-info\" ng-click=\"application.addRule()\"><span class=\"fa fa-plus-circle\"></span> Add rule</a>\n" +
4108 " <a class=\"btn btn-info\" ng-click=\"application.addRule()\"><span class=\"fa fa-plus-circle\"></span> Add rule</a>\n" +
4107 " </p>\n" +
4109 " </p>\n" +
4108 "\n" +
4110 "\n" +
4109 " <post-process-action action=\"action\" resource=\"application.resource\" ng-repeat=\"action in application.resource.postprocessing_rules\"></post-process-action>\n" +
4111 " <post-process-action action=\"action\" resource=\"application.resource\" ng-repeat=\"action in application.resource.postprocessing_rules\"></post-process-action>\n" +
4110 " </div>\n" +
4112 " </div>\n" +
4111 " </div>\n" +
4113 " </div>\n" +
4112 "\n" +
4114 "\n" +
4113 " <div class=\"panel panel-danger\" ng-show=\"application.resource.resource_id\">\n" +
4115 " <div class=\"panel panel-danger\" ng-show=\"application.resource.resource_id\">\n" +
4114 " <div class=\"panel-heading\">\n" +
4116 " <div class=\"panel-heading\">\n" +
4115 " <h3 class=\"panel-title\">Administration</h3>\n" +
4117 " <h3 class=\"panel-title\">Administration</h3>\n" +
4116 " </div>\n" +
4118 " </div>\n" +
4117 " <div class=\"panel-body\">\n" +
4119 " <div class=\"panel-body\">\n" +
4118 " <h2>Transfer ownership</h2>\n" +
4120 " <h2>Transfer ownership</h2>\n" +
4119 " <p>Please note that by transfering ownership you WILL lose access to the application data and new owner needs to give you access permission</p>\n" +
4121 " <p>Please note that by transfering ownership you WILL lose access to the application data and new owner needs to give you access permission</p>\n" +
4120 " <div class=\"confirmation_form\" ng-submit=\"application.transferApplication()\">\n" +
4122 " <div class=\"confirmation_form\" ng-submit=\"application.transferApplication()\">\n" +
4121 " <form class=\"form-horizontal\" name=\"application.formTransfer\">\n" +
4123 " <form class=\"form-horizontal\" name=\"application.formTransfer\">\n" +
4122 " <div class=\"form-group\">\n" +
4124 " <div class=\"form-group\">\n" +
4123 " <data-form-errors errors=\"application.formTransfer.ae_validation.password\"></data-form-errors>\n" +
4125 " <data-form-errors errors=\"application.formTransfer.ae_validation.password\"></data-form-errors>\n" +
4124 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4126 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4125 " Password\n" +
4127 " Password\n" +
4126 " </label>\n" +
4128 " </label>\n" +
4127 " <div class=\"col-sm-8 col-lg-9\">\n" +
4129 " <div class=\"col-sm-8 col-lg-9\">\n" +
4128 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formTransferModel.password\">\n" +
4130 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formTransferModel.password\">\n" +
4129 " </div>\n" +
4131 " </div>\n" +
4130 " </div>\n" +
4132 " </div>\n" +
4131 " <div class=\"form-group\">\n" +
4133 " <div class=\"form-group\">\n" +
4132 " <data-form-errors errors=\"application.formTransfer.ae_validation.user_name\"></data-form-errors>\n" +
4134 " <data-form-errors errors=\"application.formTransfer.ae_validation.user_name\"></data-form-errors>\n" +
4133 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4135 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4134 " New owners username\n" +
4136 " New owners username\n" +
4135 " </label>\n" +
4137 " </label>\n" +
4136 " <div class=\"col-sm-8 col-lg-9\">\n" +
4138 " <div class=\"col-sm-8 col-lg-9\">\n" +
4137 " <input class=\"form-control\" name=\"user_name\" type=\"text\" ng-model=\"application.formTransferModel.user_name\">\n" +
4139 " <input class=\"form-control\" name=\"user_name\" type=\"text\" ng-model=\"application.formTransferModel.user_name\">\n" +
4138 " </div>\n" +
4140 " </div>\n" +
4139 " </div>\n" +
4141 " </div>\n" +
4140 " <div class=\"form-group\">\n" +
4142 " <div class=\"form-group\">\n" +
4141 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4143 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4142 " </label>\n" +
4144 " </label>\n" +
4143 " <div class=\"col-sm-8 col-lg-9\">\n" +
4145 " <div class=\"col-sm-8 col-lg-9\">\n" +
4144 " <button class=\"btn btn-danger\">\n" +
4146 " <button class=\"btn btn-danger\">\n" +
4145 " <span class=\"fa fa-user-plus\"></span>\n" +
4147 " <span class=\"fa fa-user-plus\"></span>\n" +
4146 " Transfer ownership of application\n" +
4148 " Transfer ownership of application\n" +
4147 " </button>\n" +
4149 " </button>\n" +
4148 " </div>\n" +
4150 " </div>\n" +
4149 " </div>\n" +
4151 " </div>\n" +
4150 " </form>\n" +
4152 " </form>\n" +
4151 " </div>\n" +
4153 " </div>\n" +
4152 "\n" +
4154 "\n" +
4153 " <hr/>\n" +
4155 " <hr/>\n" +
4154 "\n" +
4156 "\n" +
4155 " <h2>Remove application</h2>\n" +
4157 " <h2>Remove application</h2>\n" +
4156 " <p><strong>This operation will wipe out all data from database - there is no undo.</strong></p>\n" +
4158 " <p><strong>This operation will wipe out all data from database - there is no undo.</strong></p>\n" +
4157 "\n" +
4159 "\n" +
4158 " <div class=\"confirmation_form\">\n" +
4160 " <div class=\"confirmation_form\">\n" +
4159 " <form class=\"form-horizontal\" name=\"application.formDelete\" ng-submit=\"application.deleteApplication()\">\n" +
4161 " <form class=\"form-horizontal\" name=\"application.formDelete\" ng-submit=\"application.deleteApplication()\">\n" +
4160 " <div class=\"form-group\">\n" +
4162 " <div class=\"form-group\">\n" +
4161 " <data-form-errors errors=\"application.formDelete.ae_validation.password\"></data-form-errors>\n" +
4163 " <data-form-errors errors=\"application.formDelete.ae_validation.password\"></data-form-errors>\n" +
4162 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4164 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4163 " Password\n" +
4165 " Password\n" +
4164 " </label>\n" +
4166 " </label>\n" +
4165 " <div class=\"col-sm-8 col-lg-9\">\n" +
4167 " <div class=\"col-sm-8 col-lg-9\">\n" +
4166 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formDeleteModel.password\">\n" +
4168 " <input class=\"form-control\" name=\"password\" type=\"password\" ng-model=\"application.formDeleteModel.password\">\n" +
4167 " </div>\n" +
4169 " </div>\n" +
4168 " </div>\n" +
4170 " </div>\n" +
4169 " <div class=\"form-group\">\n" +
4171 " <div class=\"form-group\">\n" +
4170 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4172 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
4171 "\n" +
4173 "\n" +
4172 " </label>\n" +
4174 " </label>\n" +
4173 " <div class=\"col-sm-8 col-lg-9\">\n" +
4175 " <div class=\"col-sm-8 col-lg-9\">\n" +
4174 " <button class=\"btn btn-danger\">\n" +
4176 " <button class=\"btn btn-danger\">\n" +
4175 " <span class=\"fa fa-trash-o\"></span>\n" +
4177 " <span class=\"fa fa-trash-o\"></span>\n" +
4176 " Delete my application\n" +
4178 " Delete my application\n" +
4177 " </button>\n" +
4179 " </button>\n" +
4178 " </div>\n" +
4180 " </div>\n" +
4179 " </div>\n" +
4181 " </div>\n" +
4180 " </form>\n" +
4182 " </form>\n" +
4181 " </div>\n" +
4183 " </div>\n" +
4182 " </div>\n" +
4184 " </div>\n" +
4183 " </div>\n" +
4185 " </div>\n" +
4184 "</div>\n"
4186 "</div>\n"
4185 );
4187 );
4186
4188
4187
4189
4188 $templateCache.put('templates/applications/breadcrumbs.html',
4190 $templateCache.put('templates/applications/breadcrumbs.html',
4189 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('applications')\">\n" +
4191 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('applications')\">\n" +
4190 " <li>Applications</li>\n" +
4192 " <li>Applications</li>\n" +
4191 " <li ng-show=\"$state.includes('applications.list')\" ng-class=\"{bold:$state.is('applications.list')}\">Owned applications</li>\n" +
4193 " <li ng-show=\"$state.includes('applications.list')\" ng-class=\"{bold:$state.is('applications.list')}\">Owned applications</li>\n" +
4192 " <li ng-show=\"$state.includes('applications.update')\" ng-class=\"{bold:$state.is('applications.update')}\">Modify application</li>\n" +
4194 " <li ng-show=\"$state.includes('applications.update')\" ng-class=\"{bold:$state.is('applications.update')}\">Modify application</li>\n" +
4193 " <li ng-show=\"$state.includes('applications.integrations')\" ng-class=\"{bold:$state.includes('applications.integrations')}\">Integrations</li>\n" +
4195 " <li ng-show=\"$state.includes('applications.integrations')\" ng-class=\"{bold:$state.includes('applications.integrations')}\">Integrations</li>\n" +
4194 " <li ng-show=\"$state.includes('applications.purge_logs')\" ng-class=\"{bold:$state.includes('applications.purge_logs')}\">Log Purging</li>\n" +
4196 " <li ng-show=\"$state.includes('applications.purge_logs')\" ng-class=\"{bold:$state.includes('applications.purge_logs')}\">Log Purging</li>\n" +
4195 "</ol>\n"
4197 "</ol>\n"
4196 );
4198 );
4197
4199
4198
4200
4199 $templateCache.put('templates/applications/integrations.html',
4201 $templateCache.put('templates/applications/integrations.html',
4200 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application && $state.is('applications.integrations')\"></ng-include>\n" +
4202 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application && $state.is('applications.integrations')\"></ng-include>\n" +
4201 "\n" +
4203 "\n" +
4202 "<ui-view>\n" +
4204 "<ui-view>\n" +
4203 " <div class=\"panel panel-default\" ng-show=\"!integrations.loading.application\">\n" +
4205 " <div class=\"panel panel-default\" ng-show=\"!integrations.loading.application\">\n" +
4204 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4206 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4205 " <div class=\"panel-body\">\n" +
4207 " <div class=\"panel-body\">\n" +
4206 "\n" +
4208 "\n" +
4207 " <a class=\"btn btn-default integration\"\n" +
4209 " <a class=\"btn btn-default integration\"\n" +
4208 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'bitbucket'})\">\n" +
4210 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'bitbucket'})\">\n" +
4209 " <span class=\"fa fa-fw fa-bitbucket fa-3x pull-left\"></span>\n" +
4211 " <span class=\"fa fa-fw fa-bitbucket fa-3x pull-left\"></span>\n" +
4210 " <strong>Bitbucket</strong>\n" +
4212 " <strong>Bitbucket</strong>\n" +
4211 "\n" +
4213 "\n" +
4212 " <p>Send issues and reports to Bitbucket</p>\n" +
4214 " <p>Send issues and reports to Bitbucket</p>\n" +
4213 " </a>\n" +
4215 " </a>\n" +
4214 "\n" +
4216 "\n" +
4215 " <a class=\"btn btn-default integration\"\n" +
4217 " <a class=\"btn btn-default integration\"\n" +
4216 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'campfire'})\">\n" +
4218 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'campfire'})\">\n" +
4217 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4219 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4218 " <strong>Campfire</strong>\n" +
4220 " <strong>Campfire</strong>\n" +
4219 "\n" +
4221 "\n" +
4220 " <p>Receive reports and alerts in your Campfire rooms</p>\n" +
4222 " <p>Receive reports and alerts in your Campfire rooms</p>\n" +
4221 " </a>\n" +
4223 " </a>\n" +
4222 "\n" +
4224 "\n" +
4223 " <a class=\"btn btn-default integration\"\n" +
4225 " <a class=\"btn btn-default integration\"\n" +
4224 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'flowdock'})\">\n" +
4226 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'flowdock'})\">\n" +
4225 " <span class=\"fa fa-fw fa-envelope fa-3x pull-left\"></span>\n" +
4227 " <span class=\"fa fa-fw fa-envelope fa-3x pull-left\"></span>\n" +
4226 " <strong>Flowdock</strong>\n" +
4228 " <strong>Flowdock</strong>\n" +
4227 "\n" +
4229 "\n" +
4228 " <p>Receive reports and alerts on your Flowdock team\n" +
4230 " <p>Receive reports and alerts on your Flowdock team\n" +
4229 " inbox</p>\n" +
4231 " inbox</p>\n" +
4230 " </a>\n" +
4232 " </a>\n" +
4231 "\n" +
4233 "\n" +
4232 " <a class=\"btn btn-default integration\"\n" +
4234 " <a class=\"btn btn-default integration\"\n" +
4233 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'github'})\">\n" +
4235 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'github'})\">\n" +
4234 " <span class=\"fa fa-fw fa-github fa-3x pull-left\"></span>\n" +
4236 " <span class=\"fa fa-fw fa-github fa-3x pull-left\"></span>\n" +
4235 " <strong>Github</strong>\n" +
4237 " <strong>Github</strong>\n" +
4236 "\n" +
4238 "\n" +
4237 " <p>Send issues and reports to Github</p>\n" +
4239 " <p>Send issues and reports to Github</p>\n" +
4238 " </a>\n" +
4240 " </a>\n" +
4239 "\n" +
4241 "\n" +
4240 " <a class=\"btn btn-default integration\"\n" +
4242 " <a class=\"btn btn-default integration\"\n" +
4241 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'hipchat'})\">\n" +
4243 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'hipchat'})\">\n" +
4242 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4244 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4243 " <strong>HipChat</strong>\n" +
4245 " <strong>HipChat</strong>\n" +
4244 "\n" +
4246 "\n" +
4245 " <p>Receive reports and alerts in your Hipchat chanels</p>\n" +
4247 " <p>Receive reports and alerts in your Hipchat chanels</p>\n" +
4246 " </a>\n" +
4248 " </a>\n" +
4247 "\n" +
4249 "\n" +
4248 " <a class=\"btn btn-default integration\"\n" +
4250 " <a class=\"btn btn-default integration\"\n" +
4249 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'jira'})\">\n" +
4251 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'jira'})\">\n" +
4250 " <span class=\"fa fa-fw fa-ticket fa-3x pull-left\"></span>\n" +
4252 " <span class=\"fa fa-fw fa-ticket fa-3x pull-left\"></span>\n" +
4251 " <strong>Jira</strong>\n" +
4253 " <strong>Jira</strong>\n" +
4252 "\n" +
4254 "\n" +
4253 " <p>Send issues and reports to Jira</p>\n" +
4255 " <p>Send issues and reports to Jira</p>\n" +
4254 " </a>\n" +
4256 " </a>\n" +
4255 "\n" +
4257 "\n" +
4256 " <a class=\"btn btn-default integration\"\n" +
4258 " <a class=\"btn btn-default integration\"\n" +
4257 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'slack'})\">\n" +
4259 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'slack'})\">\n" +
4258 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4260 " <span class=\"fa fa-fw fa-comment fa-3x pull-left\"></span>\n" +
4259 " <strong>Slack</strong>\n" +
4261 " <strong>Slack</strong>\n" +
4260 "\n" +
4262 "\n" +
4261 " <p>Receive reports and alerts in your Slack chanels</p>\n" +
4263 " <p>Receive reports and alerts in your Slack chanels</p>\n" +
4262 " </a>\n" +
4264 " </a>\n" +
4263 "\n" +
4265 "\n" +
4264 " <a class=\"btn btn-default integration\"\n" +
4266 " <a class=\"btn btn-default integration\"\n" +
4265 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'webhooks'})\">\n" +
4267 " data-ui-sref=\"applications.integrations.edit({resourceId:integrations.resource.resource_id, integration:'webhooks'})\">\n" +
4266 " <span class=\"fa fa-fw fa-cloud-upload fa-3x pull-left\"></span>\n" +
4268 " <span class=\"fa fa-fw fa-cloud-upload fa-3x pull-left\"></span>\n" +
4267 " <strong>Webhooks</strong>\n" +
4269 " <strong>Webhooks</strong>\n" +
4268 "\n" +
4270 "\n" +
4269 " <p>Notify third party API's of your reports and alerts</p>\n" +
4271 " <p>Notify third party API's of your reports and alerts</p>\n" +
4270 " </a>\n" +
4272 " </a>\n" +
4271 " </div>\n" +
4273 " </div>\n" +
4272 " </div>\n" +
4274 " </div>\n" +
4273 "</ui-view>\n"
4275 "</ui-view>\n"
4274 );
4276 );
4275
4277
4276
4278
4277 $templateCache.put('templates/applications/integrations/bitbucket.html',
4279 $templateCache.put('templates/applications/integrations/bitbucket.html',
4278 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4280 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4279 "\n" +
4281 "\n" +
4280 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4282 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4281 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4283 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4282 " <div class=\"panel-body\">\n" +
4284 " <div class=\"panel-body\">\n" +
4283 "\n" +
4285 "\n" +
4284 " <h1>Bitbucket Integration</h1>\n" +
4286 " <h1>Bitbucket Integration</h1>\n" +
4285 "\n" +
4287 "\n" +
4286 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4288 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4287 " <div class=\"form-group\">\n" +
4289 " <div class=\"form-group\">\n" +
4288 "\n" +
4290 "\n" +
4289 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4291 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4290 "\n" +
4292 "\n" +
4291 " <div class=\"col-sm-8 col-lg-9\">\n" +
4293 " <div class=\"col-sm-8 col-lg-9\">\n" +
4292 "\n" +
4294 "\n" +
4293 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4295 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4294 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4296 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4295 "\n" +
4297 "\n" +
4296 " <div class=\"input-group\">\n" +
4298 " <div class=\"input-group\">\n" +
4297 " <div class=\"input-group-addon\">https://bitbucket.org/</div>\n" +
4299 " <div class=\"input-group-addon\">https://bitbucket.org/</div>\n" +
4298 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4300 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4299 " <div class=\"input-group-addon\">/</div>\n" +
4301 " <div class=\"input-group-addon\">/</div>\n" +
4300 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4302 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4301 " </div>\n" +
4303 " </div>\n" +
4302 "\n" +
4304 "\n" +
4303 " </div>\n" +
4305 " </div>\n" +
4304 " </div>\n" +
4306 " </div>\n" +
4305 " <div class=\"form-group\">\n" +
4307 " <div class=\"form-group\">\n" +
4306 "\n" +
4308 "\n" +
4307 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4309 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4308 "\n" +
4310 "\n" +
4309 " <div class=\"col-sm-8 col-lg-9\">\n" +
4311 " <div class=\"col-sm-8 col-lg-9\">\n" +
4310 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4312 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4311 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4313 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4312 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4314 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4313 " <ul class=\"dropdown-menu\">\n" +
4315 " <ul class=\"dropdown-menu\">\n" +
4314 " <li><a>No</a></li>\n" +
4316 " <li><a>No</a></li>\n" +
4315 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4317 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4316 " </ul>\n" +
4318 " </ul>\n" +
4317 " </span>\n" +
4319 " </span>\n" +
4318 " </div>\n" +
4320 " </div>\n" +
4319 " </div>\n" +
4321 " </div>\n" +
4320 " </form>\n" +
4322 " </form>\n" +
4321 "\n" +
4323 "\n" +
4322 " <p class=\"m-t-1\">Remember you first need to\n" +
4324 " <p class=\"m-t-1\">Remember you first need to\n" +
4323 " <strong>\n" +
4325 " <strong>\n" +
4324 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4326 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4325 " with Bitbucket before we can send issues on your behalf.</p>\n" +
4327 " with Bitbucket before we can send issues on your behalf.</p>\n" +
4326 "\n" +
4328 "\n" +
4327 " <p>Every user will have to authorize AppEnlight to access Bitbucket to be able to post issues.</p>\n" +
4329 " <p>Every user will have to authorize AppEnlight to access Bitbucket to be able to post issues.</p>\n" +
4328 "\n" +
4330 "\n" +
4329 " </div>\n" +
4331 " </div>\n" +
4330 "</div>\n"
4332 "</div>\n"
4331 );
4333 );
4332
4334
4333
4335
4334 $templateCache.put('templates/applications/integrations/campfire.html',
4336 $templateCache.put('templates/applications/integrations/campfire.html',
4335 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4337 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4336 "\n" +
4338 "\n" +
4337 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4339 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4338 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4340 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4339 " <div class=\"panel-body\">\n" +
4341 " <div class=\"panel-body\">\n" +
4340 " <h1>Campfire Integration</h1>\n" +
4342 " <h1>Campfire Integration</h1>\n" +
4341 "\n" +
4343 "\n" +
4342 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4344 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4343 "\n" +
4345 "\n" +
4344 " <div class=\"form-group\">\n" +
4346 " <div class=\"form-group\">\n" +
4345 "\n" +
4347 "\n" +
4346 " <label class=\"control-label col-sm-3 col-lg-2\">Account name</label>\n" +
4348 " <label class=\"control-label col-sm-3 col-lg-2\">Account name</label>\n" +
4347 " <div class=\"col-sm-8 col-lg-9\">\n" +
4349 " <div class=\"col-sm-8 col-lg-9\">\n" +
4348 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4350 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4349 "\n" +
4351 "\n" +
4350 " <div class=\"input-group\">\n" +
4352 " <div class=\"input-group\">\n" +
4351 " <div class=\"input-group-addon\">http://</div>\n" +
4353 " <div class=\"input-group-addon\">http://</div>\n" +
4352 " <input class=\"form-control\" ng-model=\"integration.config.account\" placeholder=\"account\">\n" +
4354 " <input class=\"form-control\" ng-model=\"integration.config.account\" placeholder=\"account\">\n" +
4353 " <div class=\"input-group-addon\">.campfirenow.com</div>\n" +
4355 " <div class=\"input-group-addon\">.campfirenow.com</div>\n" +
4354 " </div>\n" +
4356 " </div>\n" +
4355 " </div>\n" +
4357 " </div>\n" +
4356 " </div>\n" +
4358 " </div>\n" +
4357 "\n" +
4359 "\n" +
4358 " <div class=\"form-group\">\n" +
4360 " <div class=\"form-group\">\n" +
4359 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4361 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4360 " <div class=\"col-sm-8 col-lg-9\">\n" +
4362 " <div class=\"col-sm-8 col-lg-9\">\n" +
4361 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4363 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4362 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\">\n" +
4364 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\">\n" +
4363 " </div>\n" +
4365 " </div>\n" +
4364 " </div>\n" +
4366 " </div>\n" +
4365 "\n" +
4367 "\n" +
4366 " <div class=\"form-group\">\n" +
4368 " <div class=\"form-group\">\n" +
4367 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4369 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4368 " <div class=\"col-sm-8 col-lg-9\">\n" +
4370 " <div class=\"col-sm-8 col-lg-9\">\n" +
4369 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4371 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4370 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\">\n" +
4372 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\">\n" +
4371 " <p>\n" +
4373 " <p>\n" +
4372 " <small>Room ID list separated by comma</small>\n" +
4374 " <small>Room ID list separated by comma</small>\n" +
4373 " </p>\n" +
4375 " </p>\n" +
4374 " </div>\n" +
4376 " </div>\n" +
4375 " </div>\n" +
4377 " </div>\n" +
4376 " <div class=\"form-group\">\n" +
4378 " <div class=\"form-group\">\n" +
4377 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Campfire\">\n" +
4379 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Campfire\">\n" +
4378 "\n" +
4380 "\n" +
4379 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4381 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4380 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4382 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4381 " <ul class=\"dropdown-menu\">\n" +
4383 " <ul class=\"dropdown-menu\">\n" +
4382 " <li><a>No</a></li>\n" +
4384 " <li><a>No</a></li>\n" +
4383 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4385 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4384 " </ul>\n" +
4386 " </ul>\n" +
4385 " </span>\n" +
4387 " </span>\n" +
4386 "\n" +
4388 "\n" +
4387 " <div class=\"btn-group\" uib-dropdown>\n" +
4389 " <div class=\"btn-group\" uib-dropdown>\n" +
4388 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4390 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4389 " Test integration <span class=\"caret\"></span>\n" +
4391 " Test integration <span class=\"caret\"></span>\n" +
4390 " </button>\n" +
4392 " </button>\n" +
4391 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4393 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4392 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4394 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4393 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4395 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4394 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4396 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4395 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4397 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4396 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4398 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4397 " </ul>\n" +
4399 " </ul>\n" +
4398 " </div>\n" +
4400 " </div>\n" +
4399 "\n" +
4401 "\n" +
4400 " </div>\n" +
4402 " </div>\n" +
4401 "\n" +
4403 "\n" +
4402 " </form>\n" +
4404 " </form>\n" +
4403 "\n" +
4405 "\n" +
4404 " </div>\n" +
4406 " </div>\n" +
4405 "</div>\n"
4407 "</div>\n"
4406 );
4408 );
4407
4409
4408
4410
4409 $templateCache.put('templates/applications/integrations/flowdock.html',
4411 $templateCache.put('templates/applications/integrations/flowdock.html',
4410 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4412 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4411 "\n" +
4413 "\n" +
4412 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4414 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4413 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4415 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4414 " <div class=\"panel-body\">\n" +
4416 " <div class=\"panel-body\">\n" +
4415 "\n" +
4417 "\n" +
4416 " <h1>Flowdock Integration</h1>\n" +
4418 " <h1>Flowdock Integration</h1>\n" +
4417 "\n" +
4419 "\n" +
4418 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4420 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4419 "\n" +
4421 "\n" +
4420 " <div class=\"form-group\">\n" +
4422 " <div class=\"form-group\">\n" +
4421 "\n" +
4423 "\n" +
4422 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4424 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4423 "\n" +
4425 "\n" +
4424 " <div class=\"col-sm-8 col-lg-9\">\n" +
4426 " <div class=\"col-sm-8 col-lg-9\">\n" +
4425 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4427 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4426 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4428 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4427 " </div>\n" +
4429 " </div>\n" +
4428 "\n" +
4430 "\n" +
4429 "\n" +
4431 "\n" +
4430 " </div>\n" +
4432 " </div>\n" +
4431 "\n" +
4433 "\n" +
4432 " <div class=\"form-group\">\n" +
4434 " <div class=\"form-group\">\n" +
4433 "\n" +
4435 "\n" +
4434 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4436 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4435 "\n" +
4437 "\n" +
4436 " <div class=\"col-sm-8 col-lg-9\">\n" +
4438 " <div class=\"col-sm-8 col-lg-9\">\n" +
4437 "\n" +
4439 "\n" +
4438 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Flowdock\">\n" +
4440 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Flowdock\">\n" +
4439 "\n" +
4441 "\n" +
4440 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4442 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4441 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4443 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4442 " <ul class=\"dropdown-menu\">\n" +
4444 " <ul class=\"dropdown-menu\">\n" +
4443 " <li><a>No</a></li>\n" +
4445 " <li><a>No</a></li>\n" +
4444 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4446 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4445 " </ul>\n" +
4447 " </ul>\n" +
4446 " </span>\n" +
4448 " </span>\n" +
4447 " <div class=\"btn-group\" uib-dropdown>\n" +
4449 " <div class=\"btn-group\" uib-dropdown>\n" +
4448 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4450 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4449 " Test integration <span class=\"caret\"></span>\n" +
4451 " Test integration <span class=\"caret\"></span>\n" +
4450 " </button>\n" +
4452 " </button>\n" +
4451 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4453 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4452 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4454 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4453 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4455 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4454 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4456 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4455 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4457 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4456 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4458 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4457 " </ul>\n" +
4459 " </ul>\n" +
4458 " </div>\n" +
4460 " </div>\n" +
4459 " </div>\n" +
4461 " </div>\n" +
4460 " </div>\n" +
4462 " </div>\n" +
4461 "\n" +
4463 "\n" +
4462 "\n" +
4464 "\n" +
4463 " </form>\n" +
4465 " </form>\n" +
4464 "\n" +
4466 "\n" +
4465 " </div>\n" +
4467 " </div>\n" +
4466 "</div>\n"
4468 "</div>\n"
4467 );
4469 );
4468
4470
4469
4471
4470 $templateCache.put('templates/applications/integrations/github.html',
4472 $templateCache.put('templates/applications/integrations/github.html',
4471 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4473 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4472 "\n" +
4474 "\n" +
4473 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4475 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4474 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4476 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4475 " <div class=\"panel-body\">\n" +
4477 " <div class=\"panel-body\">\n" +
4476 "\n" +
4478 "\n" +
4477 " <h1>Github Integration</h1>\n" +
4479 " <h1>Github Integration</h1>\n" +
4478 "\n" +
4480 "\n" +
4479 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4481 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4480 "\n" +
4482 "\n" +
4481 "\n" +
4483 "\n" +
4482 " <div class=\"form-group\">\n" +
4484 " <div class=\"form-group\">\n" +
4483 "\n" +
4485 "\n" +
4484 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4486 " <label class=\"control-label col-sm-3 col-lg-2\">Repository</label>\n" +
4485 "\n" +
4487 "\n" +
4486 " <div class=\"col-sm-8 col-lg-9\">\n" +
4488 " <div class=\"col-sm-8 col-lg-9\">\n" +
4487 "\n" +
4489 "\n" +
4488 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4490 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4489 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4491 " <data-form-errors errors=\"integration.integrationForm.ae_validation.repo_name\"></data-form-errors>\n" +
4490 "\n" +
4492 "\n" +
4491 " <div class=\"input-group\">\n" +
4493 " <div class=\"input-group\">\n" +
4492 " <div class=\"input-group-addon\">https://api.github.com/</div>\n" +
4494 " <div class=\"input-group-addon\">https://api.github.com/</div>\n" +
4493 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4495 " <input class=\"form-control\" ng-model=\"integration.config.user_name\" placeholder=\"user\" type=\"text\">\n" +
4494 " <div class=\"input-group-addon\">/</div>\n" +
4496 " <div class=\"input-group-addon\">/</div>\n" +
4495 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4497 " <input class=\"form-control\" ng-model=\"integration.config.repo_name\" placeholder=\"repo_name\" type=\"text\">\n" +
4496 " </div>\n" +
4498 " </div>\n" +
4497 "\n" +
4499 "\n" +
4498 " </div>\n" +
4500 " </div>\n" +
4499 " </div>\n" +
4501 " </div>\n" +
4500 "\n" +
4502 "\n" +
4501 " <div class=\"form-group\">\n" +
4503 " <div class=\"form-group\">\n" +
4502 "\n" +
4504 "\n" +
4503 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4505 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4504 "\n" +
4506 "\n" +
4505 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4507 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Use this repo\">\n" +
4506 "\n" +
4508 "\n" +
4507 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4509 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4508 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4510 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4509 " <ul class=\"dropdown-menu\">\n" +
4511 " <ul class=\"dropdown-menu\">\n" +
4510 " <li><a>No</a></li>\n" +
4512 " <li><a>No</a></li>\n" +
4511 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4513 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4512 " </ul>\n" +
4514 " </ul>\n" +
4513 " </span>\n" +
4515 " </span>\n" +
4514 "\n" +
4516 "\n" +
4515 " </div>\n" +
4517 " </div>\n" +
4516 " </form>\n" +
4518 " </form>\n" +
4517 "\n" +
4519 "\n" +
4518 " <p class=\"m-t-1\">Remember you first need to\n" +
4520 " <p class=\"m-t-1\">Remember you first need to\n" +
4519 " <strong>\n" +
4521 " <strong>\n" +
4520 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4522 " <a data-ui-sref=\"user.profile.identities\">authorize your user account</a></strong>\n" +
4521 " with Github before we can send issues on your behalf.</p>\n" +
4523 " with Github before we can send issues on your behalf.</p>\n" +
4522 "\n" +
4524 "\n" +
4523 " <p>Every user will have to authorize AppEnlight to access Github to be able to post issues.</p>\n" +
4525 " <p>Every user will have to authorize AppEnlight to access Github to be able to post issues.</p>\n" +
4524 "\n" +
4526 "\n" +
4525 " <div class=\"panel panel-warning\">\n" +
4527 " <div class=\"panel panel-warning\">\n" +
4526 " <div class=\"panel-heading\">Private repository access</div>\n" +
4528 " <div class=\"panel-heading\">Private repository access</div>\n" +
4527 " <div class=\"panel-body\">\n" +
4529 " <div class=\"panel-body\">\n" +
4528 " <p>If you need access to private repositories <a data-ui-sref=\"user.profile.identities\">profile page</a> allows you to require token including private repository permissions.</p>\n" +
4530 " <p>If you need access to private repositories <a data-ui-sref=\"user.profile.identities\">profile page</a> allows you to require token including private repository permissions.</p>\n" +
4529 "\n" +
4531 "\n" +
4530 " <p>Registration page OAuth does NOT give you token with private repository access permissions.</p>\n" +
4532 " <p>Registration page OAuth does NOT give you token with private repository access permissions.</p>\n" +
4531 " </div>\n" +
4533 " </div>\n" +
4532 " </div>\n" +
4534 " </div>\n" +
4533 "\n" +
4535 "\n" +
4534 " </div>\n" +
4536 " </div>\n" +
4535 "</div>\n"
4537 "</div>\n"
4536 );
4538 );
4537
4539
4538
4540
4539 $templateCache.put('templates/applications/integrations/hipchat.html',
4541 $templateCache.put('templates/applications/integrations/hipchat.html',
4540 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4542 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4541 "\n" +
4543 "\n" +
4542 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4544 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4543 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4545 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4544 " <div class=\"panel-body\">\n" +
4546 " <div class=\"panel-body\">\n" +
4545 "\n" +
4547 "\n" +
4546 " <h1>Hipchat Integration</h1>\n" +
4548 " <h1>Hipchat Integration</h1>\n" +
4547 "\n" +
4549 "\n" +
4548 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4550 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4549 "\n" +
4551 "\n" +
4550 " <div class=\"form-group\">\n" +
4552 " <div class=\"form-group\">\n" +
4551 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4553 " <label class=\"control-label col-sm-3 col-lg-2\">API Token</label>\n" +
4552 "\n" +
4554 "\n" +
4553 " <div class=\"col-sm-8 col-lg-9\">\n" +
4555 " <div class=\"col-sm-8 col-lg-9\">\n" +
4554 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4556 " <data-form-errors errors=\"integration.integrationForm.ae_validation.api_token\"></data-form-errors>\n" +
4555 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4557 " <input class=\"form-control\" ng-model=\"integration.config.api_token\" placeholder=\"Your API token\" type=\"text\">\n" +
4556 " </div>\n" +
4558 " </div>\n" +
4557 " </div>\n" +
4559 " </div>\n" +
4558 "\n" +
4560 "\n" +
4559 " <div class=\"form-group\">\n" +
4561 " <div class=\"form-group\">\n" +
4560 "\n" +
4562 "\n" +
4561 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4563 " <label class=\"control-label col-sm-3 col-lg-2\">Room ID list</label>\n" +
4562 "\n" +
4564 "\n" +
4563 " <div class=\"col-sm-8 col-lg-9\">\n" +
4565 " <div class=\"col-sm-8 col-lg-9\">\n" +
4564 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4566 " <data-form-errors errors=\"integration.integrationForm.ae_validation.rooms\"></data-form-errors>\n" +
4565 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\" type=\"text\">\n" +
4567 " <input class=\"form-control\" ng-model=\"integration.config.rooms\" placeholder=\"Room ID list\" type=\"text\">\n" +
4566 "\n" +
4568 "\n" +
4567 " <p>\n" +
4569 " <p>\n" +
4568 " <small>Room ID list separated by comma</small>\n" +
4570 " <small>Room ID list separated by comma</small>\n" +
4569 " </p>\n" +
4571 " </p>\n" +
4570 " </div>\n" +
4572 " </div>\n" +
4571 "\n" +
4573 "\n" +
4572 " </div>\n" +
4574 " </div>\n" +
4573 "\n" +
4575 "\n" +
4574 " <div class=\"form-group\">\n" +
4576 " <div class=\"form-group\">\n" +
4575 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4577 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4576 " <div class=\"col-sm-8 col-lg-9\">\n" +
4578 " <div class=\"col-sm-8 col-lg-9\">\n" +
4577 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Hipchat\">\n" +
4579 " <input type=\"submit\" class=\"btn btn-primary\" value=\"Connect to Hipchat\">\n" +
4578 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4580 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4579 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4581 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4580 " <ul class=\"dropdown-menu\">\n" +
4582 " <ul class=\"dropdown-menu\">\n" +
4581 " <li><a>No</a></li>\n" +
4583 " <li><a>No</a></li>\n" +
4582 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4584 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4583 " </ul>\n" +
4585 " </ul>\n" +
4584 " </span>\n" +
4586 " </span>\n" +
4585 "\n" +
4587 "\n" +
4586 " <div class=\"btn-group\" uib-dropdown>\n" +
4588 " <div class=\"btn-group\" uib-dropdown>\n" +
4587 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4589 " <button id=\"single-button\" type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4588 " Test integration <span class=\"caret\"></span>\n" +
4590 " Test integration <span class=\"caret\"></span>\n" +
4589 " </button>\n" +
4591 " </button>\n" +
4590 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4592 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4591 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4593 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4592 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4594 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4593 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4595 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4594 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4596 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4595 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4597 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4596 " </ul>\n" +
4598 " </ul>\n" +
4597 " </div>\n" +
4599 " </div>\n" +
4598 "\n" +
4600 "\n" +
4599 " </div>\n" +
4601 " </div>\n" +
4600 " </div>\n" +
4602 " </div>\n" +
4601 "\n" +
4603 "\n" +
4602 " </form>\n" +
4604 " </form>\n" +
4603 "\n" +
4605 "\n" +
4604 " </div>\n" +
4606 " </div>\n" +
4605 "</div>\n"
4607 "</div>\n"
4606 );
4608 );
4607
4609
4608
4610
4609 $templateCache.put('templates/applications/integrations/jira.html',
4611 $templateCache.put('templates/applications/integrations/jira.html',
4610 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4612 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4611 "\n" +
4613 "\n" +
4612 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4614 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4613 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4615 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4614 " <div class=\"panel-body\">\n" +
4616 " <div class=\"panel-body\">\n" +
4615 "\n" +
4617 "\n" +
4616 " <h1>Jira Integration</h1>\n" +
4618 " <h1>Jira Integration</h1>\n" +
4617 "\n" +
4619 "\n" +
4618 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4620 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4619 "\n" +
4621 "\n" +
4620 " <div class=\"form-group\" id=\"row-host_name\">\n" +
4622 " <div class=\"form-group\" id=\"row-host_name\">\n" +
4621 "\n" +
4623 "\n" +
4622 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4624 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4623 " Server URL <span class=\"required\">*</span>\n" +
4625 " Server URL <span class=\"required\">*</span>\n" +
4624 " </label>\n" +
4626 " </label>\n" +
4625 " <div class=\"col-sm-8 col-lg-9\">\n" +
4627 " <div class=\"col-sm-8 col-lg-9\">\n" +
4626 " <data-form-errors errors=\"integration.integrationForm.ae_validation.host_name\"></data-form-errors>\n" +
4628 " <data-form-errors errors=\"integration.integrationForm.ae_validation.host_name\"></data-form-errors>\n" +
4627 " <input class=\"form-control\" id=\"host_name\" name=\"host_name\" type=\"text\" ng-model=\"integration.config.host_name\">\n" +
4629 " <input class=\"form-control\" id=\"host_name\" name=\"host_name\" type=\"text\" ng-model=\"integration.config.host_name\">\n" +
4628 "\n" +
4630 "\n" +
4629 " <p>\n" +
4631 " <p>\n" +
4630 " <small>https://servername.atlassian.net</small>\n" +
4632 " <small>https://servername.atlassian.net</small>\n" +
4631 " </p>\n" +
4633 " </p>\n" +
4632 "\n" +
4634 "\n" +
4633 " </div>\n" +
4635 " </div>\n" +
4634 " </div>\n" +
4636 " </div>\n" +
4635 " <div class=\"form-group\" id=\"row-user_name\">\n" +
4637 " <div class=\"form-group\" id=\"row-user_name\">\n" +
4636 "\n" +
4638 "\n" +
4637 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4639 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4638 " Username <span class=\"required\">*</span>\n" +
4640 " Username <span class=\"required\">*</span>\n" +
4639 " </label>\n" +
4641 " </label>\n" +
4640 " <div class=\"col-sm-8 col-lg-9\">\n" +
4642 " <div class=\"col-sm-8 col-lg-9\">\n" +
4641 "\n" +
4643 "\n" +
4642 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4644 " <data-form-errors errors=\"integration.integrationForm.ae_validation.user_name\"></data-form-errors>\n" +
4643 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"integration.config.user_name\">\n" +
4645 " <input class=\"form-control\" id=\"user_name\" name=\"user_name\" type=\"text\" ng-model=\"integration.config.user_name\">\n" +
4644 "\n" +
4646 "\n" +
4645 " <p>\n" +
4647 " <p>\n" +
4646 " <small>user@email.com</small>\n" +
4648 " <small>user@email.com</small>\n" +
4647 " </p>\n" +
4649 " </p>\n" +
4648 "\n" +
4650 "\n" +
4649 " </div>\n" +
4651 " </div>\n" +
4650 " </div>\n" +
4652 " </div>\n" +
4651 " <div class=\"form-group\" id=\"row-password\">\n" +
4653 " <div class=\"form-group\" id=\"row-password\">\n" +
4652 "\n" +
4654 "\n" +
4653 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4655 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4654 " Password <span class=\"required\">*</span>\n" +
4656 " Password <span class=\"required\">*</span>\n" +
4655 " </label>\n" +
4657 " </label>\n" +
4656 " <div class=\"col-sm-8 col-lg-9\">\n" +
4658 " <div class=\"col-sm-8 col-lg-9\">\n" +
4657 " <data-form-errors errors=\"integration.integrationForm.ae_validation.password\"></data-form-errors>\n" +
4659 " <data-form-errors errors=\"integration.integrationForm.ae_validation.password\"></data-form-errors>\n" +
4658 " <input class=\"form-control\" id=\"password\" name=\"password\" type=\"password\" ng-model=\"integration.config.password\">\n" +
4660 " <input class=\"form-control\" id=\"password\" name=\"password\" type=\"password\" ng-model=\"integration.config.password\">\n" +
4659 " </div>\n" +
4661 " </div>\n" +
4660 " </div>\n" +
4662 " </div>\n" +
4661 " <div class=\"form-group\" id=\"row-project\">\n" +
4663 " <div class=\"form-group\" id=\"row-project\">\n" +
4662 "\n" +
4664 "\n" +
4663 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4665 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4664 " Project key <span class=\"required\">*</span>\n" +
4666 " Project key <span class=\"required\">*</span>\n" +
4665 " </label>\n" +
4667 " </label>\n" +
4666 " <div class=\"col-sm-8 col-lg-9\">\n" +
4668 " <div class=\"col-sm-8 col-lg-9\">\n" +
4667 " <data-form-errors errors=\"integration.integrationForm.ae_validation.project\"></data-form-errors>\n" +
4669 " <data-form-errors errors=\"integration.integrationForm.ae_validation.project\"></data-form-errors>\n" +
4668 " <input class=\"form-control\" id=\"project\" name=\"project\" type=\"text\" ng-model=\"integration.config.project\">\n" +
4670 " <input class=\"form-control\" id=\"project\" name=\"project\" type=\"text\" ng-model=\"integration.config.project\">\n" +
4669 " </div>\n" +
4671 " </div>\n" +
4670 " </div>\n" +
4672 " </div>\n" +
4671 " <div class=\"form-group\" id=\"row-submit\">\n" +
4673 " <div class=\"form-group\" id=\"row-submit\">\n" +
4672 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4674 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4673 " <div class=\"col-sm-8 col-lg-9\">\n" +
4675 " <div class=\"col-sm-8 col-lg-9\">\n" +
4674 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup Jira\">\n" +
4676 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup Jira\">\n" +
4675 "\n" +
4677 "\n" +
4676 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4678 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4677 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4679 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4678 " <ul class=\"dropdown-menu\">\n" +
4680 " <ul class=\"dropdown-menu\">\n" +
4679 " <li><a>No</a></li>\n" +
4681 " <li><a>No</a></li>\n" +
4680 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4682 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4681 " </ul>\n" +
4683 " </ul>\n" +
4682 " </span>\n" +
4684 " </span>\n" +
4683 " </div>\n" +
4685 " </div>\n" +
4684 " </div>\n" +
4686 " </div>\n" +
4685 "\n" +
4687 "\n" +
4686 " </form>\n" +
4688 " </form>\n" +
4687 "\n" +
4689 "\n" +
4688 "\n" +
4690 "\n" +
4689 " </div>\n" +
4691 " </div>\n" +
4690 "</div>\n"
4692 "</div>\n"
4691 );
4693 );
4692
4694
4693
4695
4694 $templateCache.put('templates/applications/integrations/slack.html',
4696 $templateCache.put('templates/applications/integrations/slack.html',
4695 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4697 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4696 "\n" +
4698 "\n" +
4697 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4699 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4698 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4700 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4699 " <div class=\"panel-body\">\n" +
4701 " <div class=\"panel-body\">\n" +
4700 "\n" +
4702 "\n" +
4701 " <h1>Slack Integration</h1>\n" +
4703 " <h1>Slack Integration</h1>\n" +
4702 "\n" +
4704 "\n" +
4703 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4705 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4704 "\n" +
4706 "\n" +
4705 " <div class=\"form-group\">\n" +
4707 " <div class=\"form-group\">\n" +
4706 "\n" +
4708 "\n" +
4707 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4709 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4708 " API Token <span class=\"required\">*</span>\n" +
4710 " API Token <span class=\"required\">*</span>\n" +
4709 " </label>\n" +
4711 " </label>\n" +
4710 " <div class=\"col-sm-8 col-lg-9\">\n" +
4712 " <div class=\"col-sm-8 col-lg-9\">\n" +
4711 " <data-form-errors errors=\"integration.integrationForm.ae_validation.webhook_url\"></data-form-errors>\n" +
4713 " <data-form-errors errors=\"integration.integrationForm.ae_validation.webhook_url\"></data-form-errors>\n" +
4712 " <input class=\"form-control\" ng-model=\"integration.config.webhook_url\" placeholder=\"Webhook URL\" type=\"webhook_url\">\n" +
4714 " <input class=\"form-control\" ng-model=\"integration.config.webhook_url\" placeholder=\"Webhook URL\" type=\"webhook_url\">\n" +
4713 " </div>\n" +
4715 " </div>\n" +
4714 " </div>\n" +
4716 " </div>\n" +
4715 "\n" +
4717 "\n" +
4716 " <div class=\"form-group\">\n" +
4718 " <div class=\"form-group\">\n" +
4717 "\n" +
4719 "\n" +
4718 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4720 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4719 " <div class=\"col-sm-8 col-lg-9\">\n" +
4721 " <div class=\"col-sm-8 col-lg-9\">\n" +
4720 " <input type=\"submit\" class=\"btn btn-primary\"\n" +
4722 " <input type=\"submit\" class=\"btn btn-primary\"\n" +
4721 " value=\"Connect to Slack\">\n" +
4723 " value=\"Connect to Slack\">\n" +
4722 "\n" +
4724 "\n" +
4723 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4725 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4724 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4726 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4725 " <ul class=\"dropdown-menu\">\n" +
4727 " <ul class=\"dropdown-menu\">\n" +
4726 " <li><a>No</a></li>\n" +
4728 " <li><a>No</a></li>\n" +
4727 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4729 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4728 " </ul>\n" +
4730 " </ul>\n" +
4729 " </span>\n" +
4731 " </span>\n" +
4730 "\n" +
4732 "\n" +
4731 " <div class=\"btn-group\" uib-dropdown>\n" +
4733 " <div class=\"btn-group\" uib-dropdown>\n" +
4732 " <button type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4734 " <button type=\"button\" class=\"btn btn-info\" uib-dropdown-toggle>\n" +
4733 " Test integration <span class=\"caret\"></span>\n" +
4735 " Test integration <span class=\"caret\"></span>\n" +
4734 " </button>\n" +
4736 " </button>\n" +
4735 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4737 " <ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"single-button\">\n" +
4736 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4738 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('report_notification')\">Test report notification</a></li>\n" +
4737 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4739 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('error_alert')\">Test error alert</a></li>\n" +
4738 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4740 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('uptime_alert')\">Test uptime alert</a></li>\n" +
4739 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4741 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('chart_alert')\">Test chart alert</a></li>\n" +
4740 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4742 " <li role=\"menuitem\"><a ng-click=\"integration.testIntegration('daily_digest')\">Test daily digest</a></li>\n" +
4741 " </ul>\n" +
4743 " </ul>\n" +
4742 " </div>\n" +
4744 " </div>\n" +
4743 " </div>\n" +
4745 " </div>\n" +
4744 " </div>\n" +
4746 " </div>\n" +
4745 " </form>\n" +
4747 " </form>\n" +
4746 "\n" +
4748 "\n" +
4747 " </div>\n" +
4749 " </div>\n" +
4748 "</div>\n"
4750 "</div>\n"
4749 );
4751 );
4750
4752
4751
4753
4752 $templateCache.put('templates/applications/integrations/webhooks.html',
4754 $templateCache.put('templates/applications/integrations/webhooks.html',
4753 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4755 "<ng-include src=\"'templates/loader.html'\" ng-if=\"integrations.loading.application || integration.loading.integration\"></ng-include>\n" +
4754 "\n" +
4756 "\n" +
4755 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4757 "<div class=\"panel panel-default\" ng-show=\"!integrations.loading.application && !integration.loading.integration\">\n" +
4756 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4758 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4757 " <div class=\"panel-body\">\n" +
4759 " <div class=\"panel-body\">\n" +
4758 "\n" +
4760 "\n" +
4759 " <h1>Webhooks Integration</h1>\n" +
4761 " <h1>Webhooks Integration</h1>\n" +
4760 "\n" +
4762 "\n" +
4761 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4763 " <form name=\"integration.integrationForm\" ng-submit=\"integration.configureIntegration()\" class=\"form-horizontal\">\n" +
4762 " <div class=\"form-group\" id=\"row-reports_webhook\">\n" +
4764 " <div class=\"form-group\" id=\"row-reports_webhook\">\n" +
4763 "\n" +
4765 "\n" +
4764 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4766 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4765 " Reports webhook <span class=\"required\">*</span>\n" +
4767 " Reports webhook <span class=\"required\">*</span>\n" +
4766 " </label>\n" +
4768 " </label>\n" +
4767 " <div class=\"col-sm-8 col-lg-9\">\n" +
4769 " <div class=\"col-sm-8 col-lg-9\">\n" +
4768 " <data-form-errors errors=\"integration.integrationForm.ae_validation.reports_webhook\"></data-form-errors>\n" +
4770 " <data-form-errors errors=\"integration.integrationForm.ae_validation.reports_webhook\"></data-form-errors>\n" +
4769 " <input class=\"form-control\" id=\"reports_webhook\" name=\"reports_webhook\" type=\"text\" ng-model=\"integration.config.reports_webhook\">\n" +
4771 " <input class=\"form-control\" id=\"reports_webhook\" name=\"reports_webhook\" type=\"text\" ng-model=\"integration.config.reports_webhook\">\n" +
4770 " </div>\n" +
4772 " </div>\n" +
4771 " </div>\n" +
4773 " </div>\n" +
4772 " <div class=\"form-group\" id=\"row-alerts_webhook\">\n" +
4774 " <div class=\"form-group\" id=\"row-alerts_webhook\">\n" +
4773 "\n" +
4775 "\n" +
4774 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4776 " <label class=\"control-label col-sm-3 col-lg-2\">\n" +
4775 " Alerts webhook <span class=\"required\">*</span>\n" +
4777 " Alerts webhook <span class=\"required\">*</span>\n" +
4776 " </label>\n" +
4778 " </label>\n" +
4777 " <div class=\"col-sm-8 col-lg-9\">\n" +
4779 " <div class=\"col-sm-8 col-lg-9\">\n" +
4778 " <data-form-errors errors=\"integration.integrationForm.ae_validation.alerts_webhook\"></data-form-errors>\n" +
4780 " <data-form-errors errors=\"integration.integrationForm.ae_validation.alerts_webhook\"></data-form-errors>\n" +
4779 " <input class=\"form-control StringField None\" id=\"alerts_webhook\" name=\"alerts_webhook\" type=\"text\" ng-model=\"integration.config.alerts_webhook\">\n" +
4781 " <input class=\"form-control StringField None\" id=\"alerts_webhook\" name=\"alerts_webhook\" type=\"text\" ng-model=\"integration.config.alerts_webhook\">\n" +
4780 " </div>\n" +
4782 " </div>\n" +
4781 "\n" +
4783 "\n" +
4782 "\n" +
4784 "\n" +
4783 " </div>\n" +
4785 " </div>\n" +
4784 " <div class=\"form-group\" id=\"row-submit\">\n" +
4786 " <div class=\"form-group\" id=\"row-submit\">\n" +
4785 "\n" +
4787 "\n" +
4786 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4788 " <label class=\"control-label col-sm-3 col-lg-2\"></label>\n" +
4787 " <div class=\"col-sm-8 col-lg-9\">\n" +
4789 " <div class=\"col-sm-8 col-lg-9\">\n" +
4788 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup webhooks\">\n" +
4790 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Setup webhooks\">\n" +
4789 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4791 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
4790 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4792 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove Integration</a>\n" +
4791 " <ul class=\"dropdown-menu\">\n" +
4793 " <ul class=\"dropdown-menu\">\n" +
4792 " <li><a>No</a></li>\n" +
4794 " <li><a>No</a></li>\n" +
4793 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4795 " <li><a ng-click=\"integration.removeIntegration()\">Yes</a></li>\n" +
4794 " </ul>\n" +
4796 " </ul>\n" +
4795 " </span>\n" +
4797 " </span>\n" +
4796 " </div>\n" +
4798 " </div>\n" +
4797 " </div>\n" +
4799 " </div>\n" +
4798 " </form>\n" +
4800 " </form>\n" +
4799 " </div>\n" +
4801 " </div>\n" +
4800 "</div>\n"
4802 "</div>\n"
4801 );
4803 );
4802
4804
4803
4805
4804 $templateCache.put('templates/applications/list.html',
4806 $templateCache.put('templates/applications/list.html',
4805 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
4807 "<ng-include src=\"'templates/loader.html'\" ng-if=\"applications.loading.applications\"></ng-include>\n" +
4806 "\n" +
4808 "\n" +
4807 "<div class=\"panel panel-default\" ng-show=\"!applications.loading.applications\">\n" +
4809 "<div class=\"panel panel-default\" ng-show=\"!applications.loading.applications\">\n" +
4808 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4810 " <div class=\"panel-heading\" ng-include=\"'templates/applications/breadcrumbs.html'\"></div>\n" +
4809 " <div class=\"panel-body\" ng-if=\"applications.applications.length === 0 \">\n" +
4811 " <div class=\"panel-body\" ng-if=\"applications.applications.length === 0 \">\n" +
4810 "\n" +
4812 "\n" +
4811 " <p>You have to create a new application first.</p>\n" +
4813 " <p>You have to create a new application first.</p>\n" +
4812 "\n" +
4814 "\n" +
4813 " </div>\n" +
4815 " </div>\n" +
4814 "\n" +
4816 "\n" +
4815 " <table class=\"table table-striped\" ng-if=\"applications.applications.length > 0\">\n" +
4817 " <table class=\"table table-striped\" ng-if=\"applications.applications.length > 0\">\n" +
4816 " <thead>\n" +
4818 " <thead>\n" +
4817 " <tr>\n" +
4819 " <tr>\n" +
4818 " <th class=\"resource_name\">Resource Name</th>\n" +
4820 " <th class=\"resource_name\">Resource Name</th>\n" +
4819 " <th class=\"domains\">Domains</th>\n" +
4821 " <th class=\"domains\">Domains</th>\n" +
4820 " <th class=\"options\">Options</th>\n" +
4822 " <th class=\"options\">Options</th>\n" +
4821 " </tr>\n" +
4823 " </tr>\n" +
4822 " </thead>\n" +
4824 " </thead>\n" +
4823 " <tbody>\n" +
4825 " <tbody>\n" +
4824 " <tr class=\"r{{$index+1}}\" ng-repeat=\"application in applications.applications\">\n" +
4826 " <tr class=\"r{{$index+1}}\" ng-repeat=\"application in applications.applications\">\n" +
4825 " <td>{{application.resource_name}}</td>\n" +
4827 " <td>{{application.resource_name}}</td>\n" +
4826 " <td>{{application.domains}}</td>\n" +
4828 " <td>{{application.domains}}</td>\n" +
4827 " <td class=\"options\">\n" +
4829 " <td class=\"options\">\n" +
4828 " <a class=\"btn btn-default\" data-ui-sref=\"applications.update({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span> Update</a>\n" +
4830 " <a class=\"btn btn-default\" data-ui-sref=\"applications.update({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Update application\"><span class=\"fa fa-cog\"></span> Update</a>\n" +
4829 " <a class=\"btn btn-default\" data-ui-sref=\"applications.integrations({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Manage Integrations\"><span class=\"fa fa-wrench\"></span> Integrations</a>\n" +
4831 " <a class=\"btn btn-default\" data-ui-sref=\"applications.integrations({resourceId:application.resource_id})\" data-toggle=\"tooltip\" title=\"Manage Integrations\"><span class=\"fa fa-wrench\"></span> Integrations</a>\n" +
4830 " </td>\n" +
4832 " </td>\n" +
4831 " </tr>\n" +
4833 " </tr>\n" +
4832 " </tbody>\n" +
4834 " </tbody>\n" +
4833 " </table>\n" +
4835 " </table>\n" +
4834 "\n" +
4836 "\n" +
4835 "</div>\n"
4837 "</div>\n"
4836 );
4838 );
4837
4839
4838
4840
4839 $templateCache.put('templates/applications/parent_view.html',
4841 $templateCache.put('templates/applications/parent_view.html',
4840 "<div class=\"row application-management\">\n" +
4842 "<div class=\"row application-management\">\n" +
4841 " <div class=\"col-sm-3\" id=\"menu\">\n" +
4843 " <div class=\"col-sm-3\" id=\"menu\">\n" +
4842 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
4844 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
4843 " </div>\n" +
4845 " </div>\n" +
4844 "\n" +
4846 "\n" +
4845 " <div class=\"col-sm-9\" ui-view></div>\n" +
4847 " <div class=\"col-sm-9\" ui-view></div>\n" +
4846 "\n" +
4848 "\n" +
4847 "</div>\n"
4849 "</div>\n"
4848 );
4850 );
4849
4851
4850
4852
4853 $templateCache.put('templates/components/appenlight-app.html',
4854 "<channelstream config=\"AeConfig\"></channelstream>\n" +
4855 "<appenlight-header></appenlight-header>\n" +
4856 "<div id=\"outer-content\">\n" +
4857 " <div ui-view class=\"container\"></div>\n" +
4858 "</div>\n"
4859 );
4860
4861
4862 $templateCache.put('templates/components/appenlight-header.html',
4863 "<!-- Fixed navbar -->\n" +
4864 "<div id=\"top-navbar\" class=\"navbar navbar-default navbar-fixed-top\" role=\"navigation\">\n" +
4865 " <div class=\"pattern\">\n" +
4866 " <div class=\"container\">\n" +
4867 " <div class=\"navbar-header pull-left\">\n" +
4868 " <a data-ui-sref=\"front_dashboard\" class=\"navbar-brand\">\n" +
4869 " <div id=\"logo-normal\" class=\"hidden-sm hidden-xs\"></div>\n" +
4870 " <div id=\"logo-icon\" class=\"visible-sm visible-xs\"></div>\n" +
4871 " </a>\n" +
4872 " </div>\n" +
4873 "\n" +
4874 " <div class=\"container-fluid\">\n" +
4875 " <div>\n" +
4876 " <ul class=\"nav navbar-nav navbar-right\" ng-if=\"$ctrl.stateHolder.AeUser.id !== null\">\n" +
4877 " <li id=\"user-notifications\" class=\"dropdown ng-cloak\" data-uib-dropdown>\n" +
4878 "\n" +
4879 " <a class=\"dropdown-toggle\" data-uib-dropdown-toggle>\n" +
4880 " <span class=\"badge\">{{$ctrl.assignedReports.length}}</span>\n" +
4881 " <span class=\"fa fa-envelope-o\"></span>\n" +
4882 " </a>\n" +
4883 " <ul class=\"dropdown-menu\">\n" +
4884 " <li role=\"presentation\" class=\"dropdown-header\">Assigned reports</li>\n" +
4885 " <li data-ng-repeat=\"report in $ctrl.assignedReports\" role=\"presentation\">\n" +
4886 " <a href=\"{{report.front_url}}\" role=\"menuitem\" tabindex=\"-1\">\n" +
4887 " <small>{{ report.error || 'Slow Report: ' + report.view_name |truncate:65}}</small>\n" +
4888 " </a>\n" +
4889 "\n" +
4890 " </li>\n" +
4891 " <li data-ng-if=\"$ctrl.assignedReports.length == 0\"><a><small>No reports</small></a></li>\n" +
4892 " </ul>\n" +
4893 " </li>\n" +
4894 " <li id=\"alert-notifications\" class=\"dropdown ng-cloak\" data-uib-dropdown auto-close=\"outsideClick\">\n" +
4895 " <a class=\"dropdown-toggle\" data-uib-dropdown-toggle>\n" +
4896 " <span class=\"badge {{ activeEvents ? 'danger' : '' }}\">{{$ctrl.activeEvents}}</span>\n" +
4897 " <span class=\"fa fa-bell-o\"></span></a>\n" +
4898 " <ul class=\"dropdown-menu\">\n" +
4899 " <li role=\"presentation\" class=\"dropdown-header\">\n" +
4900 " <a data-ui-sref=\"events\" class=\"btn btn-xs btn-default\">Show me more</a></li>\n" +
4901 " <li role=\"presentation\" class=\"dropdown-header\">Latest events</li>\n" +
4902 " <li data-ng-repeat=\"event in $ctrl.latestEvents\" role=\"presentation\">\n" +
4903 " <a data-ng-click=\"$ctrl.clickedEvent(event)\"><small class=\"resource-name\">For {{ event.resource_name }}</small><br/>\n" +
4904 " <small>{{ event.text |truncate:65}}</small><br/>\n" +
4905 " <small class=\"date\" data-uib-tooltip=\"{{event.start_date}}\">created: <iso-to-relative-time time=\"{{event.start_date}}\"/></small>\n" +
4906 " <small class=\"date\" data-ng-show=\"event.end_date\" data-uib-tooltip=\"{{event.end_date}}\">closed: <iso-to-relative-time time=\"{{event.end_date}}\"/></small>\n" +
4907 " </a>\n" +
4908 " </li>\n" +
4909 " <li data-ng-if=\"$ctrl.latestEvents.length == 0\"><a><small>No events</small></a></li>\n" +
4910 " </ul>\n" +
4911 " </li>\n" +
4912 "\n" +
4913 " <li id=\"dashboards\" class=\"dropdown\" data-uib-dropdown>\n" +
4914 " <a class=\"dropdown-toggle\" data-uib-dropdown-toggle tooltip-placement=\"bottom\" data-uib-tooltip=\"Dashboards\">\n" +
4915 " <span class=\"fa fa-bar-chart-o \"></span></a>\n" +
4916 " <ul class=\"dropdown-menu\">\n" +
4917 " <li role=\"presentation\"><a data-ui-sref=\"front_dashboard\">Main dashboard</a></li>\n" +
4918 " <li role=\"presentation\" ng-repeat=\"item in $ctrl.AeConfig.topNav.menu_dashboards_items\">\n" +
4919 " <a data-ui-sref=\"{{ item.sref }}\">{{ item.label }}</a>\n" +
4920 " </li>\n" +
4921 " </ul>\n" +
4922 " </li>\n" +
4923 "\n" +
4924 " <li class=\"dropdown\" data-uib-dropdown>\n" +
4925 " <a class=\"dropdown-toggle\" data-uib-dropdown-toggle tooltip-placement=\"bottom\" data-uib-tooltip=\"Reports\">\n" +
4926 " <span class=\"fa fa-exclamation-triangle\"></span></a>\n" +
4927 " <ul class=\"dropdown-menu\">\n" +
4928 " <li role=\"presentation\">\n" +
4929 " <a data-ui-sref=\"report.list({resource:$ctrl.stateHolder.resource})\">Error Reports</a>\n" +
4930 " </li>\n" +
4931 " <li role=\"presentation\">\n" +
4932 " <a data-ui-sref=\"report.list_slow({resource:$ctrl.stateHolder.resource})\">Slowness Reports</a>\n" +
4933 " </li>\n" +
4934 "\n" +
4935 " </ul>\n" +
4936 " </li>\n" +
4937 "\n" +
4938 " <li>\n" +
4939 " <a data-ui-sref=\"logs({resource:$ctrl.stateHolder.resource})\" data-uib-tooltip=\"Logs\" tooltip-placement=\"bottom\"><span class=\"fa fa-list-alt \"></span></a></li>\n" +
4940 " <li>\n" +
4941 " <a data-ui-sref=\"user\" data-uib-tooltip=\"Settings\" tooltip-placement=\"bottom\"><span class=\"fa fa-cog \"></span></a>\n" +
4942 " </li>\n" +
4943 " <li class=\"dropdown\" data-uib-dropdown data-ng-if=\"$ctrl.AeConfig.topNav.menu_admin_items.length\">\n" +
4944 " <a class=\"dropdown-toggle\" data-uib-dropdown-toggle tooltip-placement=\"bottom\" data-uib-tooltip=\"Admin Settings\">\n" +
4945 " <span class=\"fa fa-wrench\"></span></a>\n" +
4946 " <ul class=\"dropdown-menu\">\n" +
4947 " <li role=\"presentation\" ng-repeat=\"item in $ctrl.AeConfig.topNav.menu_admin_items\">\n" +
4948 " <a data-ui-sref=\"{{ item.sref }}\">{{ item.label }}</a>\n" +
4949 " </li>\n" +
4950 " </ul>\n" +
4951 " </li>\n" +
4952 " <li><a href=\"{{ $ctrl.AeConfig.urls.otherRoutes.signOut }}\" target=\"_self\"\n" +
4953 " data-uib-tooltip=\"Sign out\" tooltip-placement=\"bottom\">\n" +
4954 " <span class=\"fa fa-power-off \"></span></a></li>\n" +
4955 " </ul>\n" +
4956 " <ul class=\"nav navbar-nav pull-right\" ng-if=\"$ctrl.stateHolder.AeUser.id === null\">\n" +
4957 " <li><a href=\"{{ $ctrl.AeConfig.urls.otherRoutes.register }}\" target=\"_self\" class=\"btn btn-orange\">Sign In</a></li>\n" +
4958 " </ul>\n" +
4959 " </div><!-- /.navbar-collapse -->\n" +
4960 " </div><!-- /.container-fluid -->\n" +
4961 " </div>\n" +
4962 " </div>\n" +
4963 "</div>\n"
4964 );
4965
4966
4851 $templateCache.put('templates/dashboard.html',
4967 $templateCache.put('templates/dashboard.html',
4852 "<style type=\"text/css\">\n" +
4968 "<style type=\"text/css\">\n" +
4853 " #metrics_chart .c3-line {\n" +
4969 " #metrics_chart .c3-line {\n" +
4854 " stroke-width: 0px;\n" +
4970 " stroke-width: 0px;\n" +
4855 " }\n" +
4971 " }\n" +
4856 "\n" +
4972 "\n" +
4857 " #metrics_chart .c3-area {\n" +
4973 " #metrics_chart .c3-area {\n" +
4858 " stroke-width: 0;\n" +
4974 " stroke-width: 0;\n" +
4859 " opacity: 0.75;\n" +
4975 " opacity: 0.75;\n" +
4860 " }\n" +
4976 " }\n" +
4861 "\n" +
4977 "\n" +
4862 "\n" +
4978 "\n" +
4863 "</style>\n" +
4979 "</style>\n" +
4864 "\n" +
4980 "\n" +
4865 "<div class=\"row\">\n" +
4981 "<div class=\"row\">\n" +
4866 " <div class=\"col-sm-12 dashboard\" id=\"content\">\n" +
4982 " <div class=\"col-sm-12 dashboard\" id=\"content\">\n" +
4867 "\n" +
4983 " <div ng-if=\"!index.stateHolder.AeUser.applications.length\">\n" +
4868 " <div ng-if=\"!stateHolder.AeUser.applications.length\">\n" +
4869 "\n" +
4984 "\n" +
4870 " <div ng-include=\"'templates/quickstart.html'\"></div>\n" +
4985 " <div ng-include=\"'templates/quickstart.html'\"></div>\n" +
4871 "\n" +
4986 "\n" +
4872 " </div>\n" +
4987 " </div>\n" +
4873 "\n" +
4988 "\n" +
4874 " <div ng-if=\"stateHolder.AeUser.applications.length\">\n" +
4989 " <div ng-if=\"index.stateHolder.AeUser.applications.length\">\n" +
4875 "\n" +
4990 "\n" +
4876 " <div class=\"row\">\n" +
4991 " <div class=\"row\">\n" +
4877 " <div class=\"col-sm-6\">\n" +
4992 " <div class=\"col-sm-6\">\n" +
4878 " <div class=\"panel panel-default\">\n" +
4993 " <div class=\"panel panel-default\">\n" +
4879 " <div class=\"panel-body\">\n" +
4994 " <div class=\"panel-body\">\n" +
4880 " <form class=\"graph-type form-inline\">\n" +
4995 " <form class=\"graph-type form-inline\">\n" +
4881 " <select ng-model=\"index.resource\" ng-options=\"r.resource_id as r.resource_name for r in stateHolder.AeUser.applications\" ng-change=\"index.updateSearchParams()\"\n" +
4996 " <select ng-model=\"index.resource\" ng-options=\"r.resource_id as r.resource_name for r in index.stateHolder.AeUser.applications\" ng-change=\"index.updateSearchParams()\"\n" +
4882 " class=\"SelectField form-control input-sm slim-input\"></select>\n" +
4997 " class=\"SelectField form-control input-sm slim-input\"></select>\n" +
4883 "\n" +
4998 "\n" +
4884 " <select class=\"SelectField form-control input-sm slim-input\" ng-model=\"index.timeSpan\"\n" +
4999 " <select class=\"SelectField form-control input-sm slim-input\" ng-model=\"index.timeSpan\"\n" +
4885 " ng-options=\"i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'\" ng-change=\"index.updateSearchParams()\"\n" +
5000 " ng-options=\"i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'\" ng-change=\"index.updateSearchParams()\"\n" +
4886 " class=\"SelectField\"></select>\n" +
5001 " class=\"SelectField\"></select>\n" +
4887 "\n" +
5002 "\n" +
4888 "\n" +
5003 "\n" +
4889 " <div class=\"btn-group\">\n" +
5004 " <div class=\"btn-group\">\n" +
4890 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5005 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
4891 " uib-btn-radio=\"'requests_graphs'\" data-uib-tooltip=\"Requests per second\">\n" +
5006 " uib-btn-radio=\"'requests_graphs'\" data-uib-tooltip=\"Requests per second\">\n" +
4892 " <span class=\"fa fa-line-chart\"></span>\n" +
5007 " <span class=\"fa fa-line-chart\"></span>\n" +
4893 " </button>\n" +
5008 " </button>\n" +
4894 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5009 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
4895 " uib-btn-radio=\"'response_graphs'\" data-uib-tooltip=\"Average response time\">\n" +
5010 " uib-btn-radio=\"'response_graphs'\" data-uib-tooltip=\"Average response time\">\n" +
4896 " <span class=\"fa fa-random\"></span>\n" +
5011 " <span class=\"fa fa-random\"></span>\n" +
4897 " </button>\n" +
5012 " </button>\n" +
4898 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5013 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
4899 " uib-btn-radio=\"'metrics_graphs'\" data-uib-tooltip=\"Time spent per request\">\n" +
5014 " uib-btn-radio=\"'metrics_graphs'\" data-uib-tooltip=\"Time spent per request\">\n" +
4900 " <span class=\"fa fa-bar-chart-o\"></span>\n" +
5015 " <span class=\"fa fa-bar-chart-o\"></span>\n" +
4901 " </button>\n" +
5016 " </button>\n" +
4902 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5017 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
4903 " uib-btn-radio=\"'report_graphs'\" data-uib-tooltip=\"Errors\">\n" +
5018 " uib-btn-radio=\"'report_graphs'\" data-uib-tooltip=\"Errors\">\n" +
4904 " <span class=\"fa fa-exclamation-triangle\"></span>\n" +
5019 " <span class=\"fa fa-exclamation-triangle\"></span>\n" +
4905 " </button>\n" +
5020 " </button>\n" +
4906 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
5021 " <button type=\"button\" class=\"btn btn-primary btn-sm\" ng-model=\"index.graphType.selected\" ng-change=\"index.updateSearchParams()\"\n" +
4907 " uib-btn-radio=\"'slow_report_graphs'\" data-uib-tooltip=\"Slow reports\">\n" +
5022 " uib-btn-radio=\"'slow_report_graphs'\" data-uib-tooltip=\"Slow reports\">\n" +
4908 " <span class=\"fa fa-clock-o\"></span>\n" +
5023 " <span class=\"fa fa-clock-o\"></span>\n" +
4909 " </button>\n" +
5024 " </button>\n" +
4910 " </div>\n" +
5025 " </div>\n" +
4911 " </form>\n" +
5026 " </form>\n" +
4912 " <div class=\"clearfix\"></div>\n" +
5027 " <div class=\"clearfix\"></div>\n" +
4913 "\n" +
5028 "\n" +
4914 " <p ng-if=\"index.loading.series != false\" class=\"text-center\">\n" +
5029 " <p ng-if=\"index.loading.series != false\" class=\"text-center\">\n" +
4915 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5030 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
4916 " </p>\n" +
5031 " </p>\n" +
4917 "\n" +
5032 "\n" +
4918 " <div ng-if=\"index.loading.series == false\">\n" +
5033 " <div ng-if=\"index.loading.series == false\">\n" +
4919 " <div ng-if=\"index.graphType.selected == 'requests_graphs'\">\n" +
5034 " <div ng-if=\"index.graphType.selected == 'requests_graphs'\">\n" +
4920 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.requestsChartData\" data-config=\"index.requestsChartConfig\" update=\"true\">\n" +
5035 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.requestsChartData\" data-config=\"index.requestsChartConfig\" update=\"true\">\n" +
4921 " </c3chart>\n" +
5036 " </c3chart>\n" +
4922 " </div>\n" +
5037 " </div>\n" +
4923 "\n" +
5038 "\n" +
4924 " <div ng-if=\"index.graphType.selected == 'response_graphs'\">\n" +
5039 " <div ng-if=\"index.graphType.selected == 'response_graphs'\">\n" +
4925 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.responseChartData\" data-config=\"index.responseChartConfig\" update=\"true\">\n" +
5040 " <c3chart data-domid=\"reponse_chart\" data-data=\"index.responseChartData\" data-config=\"index.responseChartConfig\" update=\"true\">\n" +
4926 " </c3chart>\n" +
5041 " </c3chart>\n" +
4927 " </div>\n" +
5042 " </div>\n" +
4928 "\n" +
5043 "\n" +
4929 " <div ng-if=\"index.graphType.selected == 'metrics_graphs'\">\n" +
5044 " <div ng-if=\"index.graphType.selected == 'metrics_graphs'\">\n" +
4930 " <c3chart data-domid=\"metrics_chart\" data-data=\"index.metricsChartData\" data-config=\"index.metricsChartConfig\" update=\"true\">\n" +
5045 " <c3chart data-domid=\"metrics_chart\" data-data=\"index.metricsChartData\" data-config=\"index.metricsChartConfig\" update=\"true\">\n" +
4931 " </c3chart>\n" +
5046 " </c3chart>\n" +
4932 " </div>\n" +
5047 " </div>\n" +
4933 " <div ng-if=\"index.graphType.selected == 'report_graphs'\">\n" +
5048 " <div ng-if=\"index.graphType.selected == 'report_graphs'\">\n" +
4934 " <c3chart data-domid=\"reports_chart\" data-data=\"index.reportChartData\" data-config=\"index.reportChartConfig\" update=\"true\">\n" +
5049 " <c3chart data-domid=\"reports_chart\" data-data=\"index.reportChartData\" data-config=\"index.reportChartConfig\" update=\"true\">\n" +
4935 " </c3chart>\n" +
5050 " </c3chart>\n" +
4936 " </div>\n" +
5051 " </div>\n" +
4937 "\n" +
5052 "\n" +
4938 " <div ng-if=\"index.graphType.selected == 'slow_report_graphs'\">\n" +
5053 " <div ng-if=\"index.graphType.selected == 'slow_report_graphs'\">\n" +
4939 " <c3chart data-domid=\"slow_reports_chart\" data-data=\"index.reportSlowChartData\" data-config=\"index.reportSlowChartConfig\" update=\"true\">\n" +
5054 " <c3chart data-domid=\"slow_reports_chart\" data-data=\"index.reportSlowChartData\" data-config=\"index.reportSlowChartConfig\" update=\"true\">\n" +
4940 " </c3chart>\n" +
5055 " </c3chart>\n" +
4941 " </div>\n" +
5056 " </div>\n" +
4942 "\n" +
5057 "\n" +
4943 " <p ng-if=\"index.graphType.selected == 'requests_graphs'\" class=\"text-center\">\n" +
5058 " <p ng-if=\"index.graphType.selected == 'requests_graphs'\" class=\"text-center\">\n" +
4944 " <small>Average requests per second from all servers</small>\n" +
5059 " <small>Average requests per second from all servers</small>\n" +
4945 " </p>\n" +
5060 " </p>\n" +
4946 "\n" +
5061 "\n" +
4947 " <p ng-if=\"index.graphType.selected == 'response_graphs'\" class=\"text-center\">\n" +
5062 " <p ng-if=\"index.graphType.selected == 'response_graphs'\" class=\"text-center\">\n" +
4948 " <small>Average response time from all servers</small>\n" +
5063 " <small>Average response time from all servers</small>\n" +
4949 " </p>\n" +
5064 " </p>\n" +
4950 "\n" +
5065 "\n" +
4951 " <p ng-if=\"index.graphType.selected == 'metrics_graphs'\" class=\"text-center\">\n" +
5066 " <p ng-if=\"index.graphType.selected == 'metrics_graphs'\" class=\"text-center\">\n" +
4952 " <small>Aggregated average time spent per request - broken to layers</small>\n" +
5067 " <small>Aggregated average time spent per request - broken to layers</small>\n" +
4953 " </p>\n" +
5068 " </p>\n" +
4954 "\n" +
5069 "\n" +
4955 " <p ng-if=\"index.graphType.selected == 'report_graphs'\" class=\"text-center\">\n" +
5070 " <p ng-if=\"index.graphType.selected == 'report_graphs'\" class=\"text-center\">\n" +
4956 " <small>Aggregated reports sent by your application</small>\n" +
5071 " <small>Aggregated reports sent by your application</small>\n" +
4957 " </p>\n" +
5072 " </p>\n" +
4958 "\n" +
5073 "\n" +
4959 " <p ng-if=\"index.graphType.selected == 'slow_report_graphs'\" class=\"text-center\">\n" +
5074 " <p ng-if=\"index.graphType.selected == 'slow_report_graphs'\" class=\"text-center\">\n" +
4960 " <small>Aggregated slow reports sent by your application</small>\n" +
5075 " <small>Aggregated slow reports sent by your application</small>\n" +
4961 " </p>\n" +
5076 " </p>\n" +
4962 " </div>\n" +
5077 " </div>\n" +
4963 " </div>\n" +
5078 " </div>\n" +
4964 " </div>\n" +
5079 " </div>\n" +
4965 " </div>\n" +
5080 " </div>\n" +
4966 "\n" +
5081 "\n" +
4967 "\n" +
5082 "\n" +
4968 " <div class=\"col-sm-6\">\n" +
5083 " <div class=\"col-sm-6\">\n" +
4969 "\n" +
5084 "\n" +
4970 " <div id=\"server-container\">\n" +
5085 " <div id=\"server-container\">\n" +
4971 "\n" +
5086 "\n" +
4972 " <div ng-if=\"index.loading.apdex==false\" class=\"text-center m-b-1\">\n" +
5087 " <div ng-if=\"index.loading.apdex==false\" class=\"text-center m-b-1\">\n" +
4973 "\n" +
5088 "\n" +
4974 " <a data-ui-sref=\"report.list({resource:index.resource, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"error-rate\">\n" +
5089 " <a data-ui-sref=\"report.list({resource:index.resource, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"error-rate\">\n" +
4975 " <small>Exceptions</small>\n" +
5090 " <small>Exceptions</small>\n" +
4976 " <br/>\n" +
5091 " <br/>\n" +
4977 " <strong>{{ index.exceptions|numberToThousands}}</strong>\n" +
5092 " <strong>{{ index.exceptions|numberToThousands}}</strong>\n" +
4978 " <span class=\"fa fa-chevron-right\"></span>\n" +
5093 " <span class=\"fa fa-chevron-right\"></span>\n" +
4979 " </a><!--\n" +
5094 " </a><!--\n" +
4980 "\n" +
5095 "\n" +
4981 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"frustrating-requests\" data-uib-tooltip=\"Requests over 4s\">\n" +
5096 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"frustrating-requests\" data-uib-tooltip=\"Requests over 4s\">\n" +
4982 " <small>Frustrating req.</small>\n" +
5097 " <small>Frustrating req.</small>\n" +
4983 " <br/>\n" +
5098 " <br/>\n" +
4984 " <strong>{{index.frustratingRequests|numberToThousands}}</strong>\n" +
5099 " <strong>{{index.frustratingRequests|numberToThousands}}</strong>\n" +
4985 " <span class=\"fa fa-chevron-right\"></span>\n" +
5100 " <span class=\"fa fa-chevron-right\"></span>\n" +
4986 " </a><!--\n" +
5101 " </a><!--\n" +
4987 "\n" +
5102 "\n" +
4988 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"tolerated-requests\"\n" +
5103 " --><a data-ui-sref=\"report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})\" class=\"combined-stat text-center\" id=\"tolerated-requests\"\n" +
4989 " data-uib-tooltip=\"Requests under 4s\">\n" +
5104 " data-uib-tooltip=\"Requests under 4s\">\n" +
4990 " <small>Tolerated req.</small>\n" +
5105 " <small>Tolerated req.</small>\n" +
4991 " <br/>\n" +
5106 " <br/>\n" +
4992 " <strong>{{index.toleratedRequests|numberToThousands}}</strong>\n" +
5107 " <strong>{{index.toleratedRequests|numberToThousands}}</strong>\n" +
4993 " <span class=\"fa fa-chevron-right\"></span>\n" +
5108 " <span class=\"fa fa-chevron-right\"></span>\n" +
4994 " </a><!--\n" +
5109 " </a><!--\n" +
4995 " \n" +
5110 " \n" +
4996 " --><a class=\"combined-stat text-center\" id=\"satisfying-requests\" data-uib-tooltip=\"Requests under 1s\">\n" +
5111 " --><a class=\"combined-stat text-center\" id=\"satisfying-requests\" data-uib-tooltip=\"Requests under 1s\">\n" +
4997 " <small>Satisfying req.</small>\n" +
5112 " <small>Satisfying req.</small>\n" +
4998 " <br/>\n" +
5113 " <br/>\n" +
4999 " <strong>{{index.satisfyingRequests|numberToThousands}}</strong>\n" +
5114 " <strong>{{index.satisfyingRequests|numberToThousands}}</strong>\n" +
5000 " </a><!--\n" +
5115 " </a><!--\n" +
5001 "\n" +
5116 "\n" +
5002 " --><a data-ui-sref=\"uptime({resource:index.resource})\" class=\"combined-stat text-center\" id=\"uptime-stats\" data-uib-tooltip=\"Uptime\">\n" +
5117 " --><a data-ui-sref=\"uptime({resource:index.resource})\" class=\"combined-stat text-center\" id=\"uptime-stats\" data-uib-tooltip=\"Uptime\">\n" +
5003 " <small>Uptime</small>\n" +
5118 " <small>Uptime</small>\n" +
5004 " <br/>\n" +
5119 " <br/>\n" +
5005 " <strong>{{index.uptimeStats}}%</strong>\n" +
5120 " <strong>{{index.uptimeStats}}%</strong>\n" +
5006 " <span class=\"fa fa-chevron-right\"></span>\n" +
5121 " <span class=\"fa fa-chevron-right\"></span>\n" +
5007 " </a>\n" +
5122 " </a>\n" +
5008 "\n" +
5123 "\n" +
5009 " <div class=\"clearfix\"></div>\n" +
5124 " <div class=\"clearfix\"></div>\n" +
5010 " </div>\n" +
5125 " </div>\n" +
5011 "\n" +
5126 "\n" +
5012 " <div id=\"apdex-rate\" class=\"m-b-1 panel panel-default\">\n" +
5127 " <div id=\"apdex-rate\" class=\"m-b-1 panel panel-default\">\n" +
5013 " <table class=\"servers table table-striped\">\n" +
5128 " <table class=\"servers table table-striped\">\n" +
5014 " <thead>\n" +
5129 " <thead>\n" +
5015 " <tr>\n" +
5130 " <tr>\n" +
5016 " <th></th>\n" +
5131 " <th></th>\n" +
5017 " <th>Server</th>\n" +
5132 " <th>Server</th>\n" +
5018 " <th>Apdex\n" +
5133 " <th>Apdex\n" +
5019 " <span class=\"fa fa-question-circle\"\n" +
5134 " <span class=\"fa fa-question-circle\"\n" +
5020 " data-uib-tooltip=\"Application Performance Index - measures viewer satisfaction based on response times and error rates\"></span>\n" +
5135 " data-uib-tooltip=\"Application Performance Index - measures viewer satisfaction based on response times and error rates\"></span>\n" +
5021 " </th>\n" +
5136 " </th>\n" +
5022 " <th>rpm</th>\n" +
5137 " <th>rpm</th>\n" +
5023 " <th>avg. response</th>\n" +
5138 " <th>avg. response</th>\n" +
5024 " </tr>\n" +
5139 " </tr>\n" +
5025 " </thead>\n" +
5140 " </thead>\n" +
5026 " <tbody>\n" +
5141 " <tbody>\n" +
5027 " <tr ng-if=\"index.loading.apdex!=false\" class=\"text-center\">\n" +
5142 " <tr ng-if=\"index.loading.apdex!=false\" class=\"text-center\">\n" +
5028 " <td colspan=\"5\"><span class=\"fa fa-cog fa-spin fa-5x loader\"></span></td>\n" +
5143 " <td colspan=\"5\"><span class=\"fa fa-cog fa-spin fa-5x loader\"></span></td>\n" +
5029 " </tr>\n" +
5144 " </tr>\n" +
5030 " <tr ng-repeat=\"server in index.apdexStats\" class=\"{{ server | apdexValue }}\"\n" +
5145 " <tr ng-repeat=\"server in index.apdexStats\" class=\"{{ server | apdexValue }}\"\n" +
5031 " ng-if=\"index.loading.apdex==false\">\n" +
5146 " ng-if=\"index.loading.apdex==false\">\n" +
5032 " <td><span class=\"fa fa-hdd-o\"></span></td>\n" +
5147 " <td><span class=\"fa fa-hdd-o\"></span></td>\n" +
5033 " <td>\n" +
5148 " <td>\n" +
5034 " <small><strong>{{ server.name }}</strong></small>\n" +
5149 " <small><strong>{{ server.name }}</strong></small>\n" +
5035 " </td>\n" +
5150 " </td>\n" +
5036 " <td class=\"apdex\">\n" +
5151 " <td class=\"apdex\">\n" +
5037 " <small><strong>{{ server.apdex }} %</strong></small>\n" +
5152 " <small><strong>{{ server.apdex }} %</strong></small>\n" +
5038 " </td>\n" +
5153 " </td>\n" +
5039 " <td>\n" +
5154 " <td>\n" +
5040 " <small><strong>{{ server.rpm }}rpm</strong></small>\n" +
5155 " <small><strong>{{ server.rpm }}rpm</strong></small>\n" +
5041 " </td>\n" +
5156 " </td>\n" +
5042 " <td>\n" +
5157 " <td>\n" +
5043 " <small><strong>{{ server.avg_response_time }}s</strong></small>\n" +
5158 " <small><strong>{{ server.avg_response_time }}s</strong></small>\n" +
5044 " </td>\n" +
5159 " </td>\n" +
5045 " </tr>\n" +
5160 " </tr>\n" +
5046 " </tbody>\n" +
5161 " </tbody>\n" +
5047 " </table>\n" +
5162 " </table>\n" +
5048 "\n" +
5163 "\n" +
5049 " </div>\n" +
5164 " </div>\n" +
5050 " </div>\n" +
5165 " </div>\n" +
5051 "\n" +
5166 "\n" +
5052 " </div>\n" +
5167 " </div>\n" +
5053 "\n" +
5168 "\n" +
5054 "\n" +
5169 "\n" +
5055 " </div>\n" +
5170 " </div>\n" +
5056 "\n" +
5171 "\n" +
5057 " <div class=\"row\">\n" +
5172 " <div class=\"row\">\n" +
5058 " <div class=\"col-sm-6\">\n" +
5173 " <div class=\"col-sm-6\">\n" +
5059 "\n" +
5174 "\n" +
5060 " <div class=\"panel panel-default\">\n" +
5175 " <div class=\"panel panel-default\">\n" +
5061 " <div class=\"panel-heading position-relative\">\n" +
5176 " <div class=\"panel-heading position-relative\">\n" +
5062 " <h3 class=\"panel-title\"><span class=\"fa fa-exclamation-triangle\"></span> Newest errors (real-time)\n" +
5177 " <h3 class=\"panel-title\"><span class=\"fa fa-exclamation-triangle\"></span> Newest errors (real-time)\n" +
5063 " </h3>\n" +
5178 " </h3>\n" +
5064 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Play/Pause stream\" class=\"btn btn-primary btn-sm pause_stream\" ng-model=\"index.stream.paused\" uib-btn-checkbox>\n" +
5179 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Play/Pause stream\" class=\"btn btn-primary btn-sm pause_stream\" ng-model=\"index.stream.paused\" uib-btn-checkbox>\n" +
5065 " <span class=\"fa {{stream.paused ? 'fa-play' : 'fa-pause'}}\"></span>\n" +
5180 " <span class=\"fa {{stream.paused ? 'fa-play' : 'fa-pause'}}\"></span>\n" +
5066 " </a>\n" +
5181 " </a>\n" +
5067 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Limit reports to current application\" class=\"btn btn-primary btn-sm limit_stream\" ng-model=\"index.stream.filtered\" uib-btn-checkbox>\n" +
5182 " <a tooltip-append-to-body=\"true\" data-uib-tooltip=\"Limit reports to current application\" class=\"btn btn-primary btn-sm limit_stream\" ng-model=\"index.stream.filtered\" uib-btn-checkbox>\n" +
5068 " <span class=\"fa fa-lock\"></span>\n" +
5183 " <span class=\"fa fa-lock\"></span>\n" +
5069 " </a>\n" +
5184 " </a>\n" +
5070 "\n" +
5185 "\n" +
5071 "\n" +
5186 "\n" +
5072 " </div>\n" +
5187 " </div>\n" +
5073 " <div class=\"panel-body\">\n" +
5188 " <div class=\"panel-body\">\n" +
5074 "\n" +
5189 "\n" +
5075 " <p ng-if=\"index.stream.reports.length === 0\">No new reports</p>\n" +
5190 " <p ng-if=\"index.stream.reports.length === 0\">No new reports</p>\n" +
5076 "\n" +
5191 "\n" +
5077 " <div small-report-list reports=\"index.stream.reports\" applications=\"index.applications\"></div>\n" +
5192 " <div small-report-list reports=\"index.stream.reports\" applications=\"index.applications\"></div>\n" +
5078 " </div>\n" +
5193 " </div>\n" +
5079 " </div>\n" +
5194 " </div>\n" +
5080 " </div>\n" +
5195 " </div>\n" +
5081 "\n" +
5196 "\n" +
5082 " <div class=\"col-sm-6\">\n" +
5197 " <div class=\"col-sm-6\">\n" +
5083 "\n" +
5198 "\n" +
5084 " <div class=\"panel panel-default\">\n" +
5199 " <div class=\"panel panel-default\">\n" +
5085 " <div class=\"panel-heading\">\n" +
5200 " <div class=\"panel-heading\">\n" +
5086 " <h3 class=\"panel-title\"><span class=\"fa fa-sort-amount-desc\"></span> Request breakdown over {{ index.timeSpan.label }}</h3>\n" +
5201 " <h3 class=\"panel-title\"><span class=\"fa fa-sort-amount-desc\"></span> Request breakdown over {{ index.timeSpan.label }}</h3>\n" +
5087 " </div>\n" +
5202 " </div>\n" +
5088 " <div class=\"panel-body\" id=\"view-breakdown-container\">\n" +
5203 " <div class=\"panel-body\" id=\"view-breakdown-container\">\n" +
5089 " <p ng-if=\"index.loading.requestsBreakdown!=false\" class=\"text-center\">\n" +
5204 " <p ng-if=\"index.loading.requestsBreakdown!=false\" class=\"text-center\">\n" +
5090 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5205 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5091 " </p>\n" +
5206 " </p>\n" +
5092 "\n" +
5207 "\n" +
5093 " <div class=\"report-list\">\n" +
5208 " <div class=\"report-list\">\n" +
5094 " <div ng-if=\"index.loading.requestsBreakdown==false\" ng-repeat=\"view in index.requestsBreakdown\">\n" +
5209 " <div ng-if=\"index.loading.requestsBreakdown==false\" ng-repeat=\"view in index.requestsBreakdown\">\n" +
5095 " <div class=\"view-info\">\n" +
5210 " <div class=\"view-info\">\n" +
5096 " <div class=\"view-name\">\n" +
5211 " <div class=\"view-name\">\n" +
5097 " <div class=\"bar\" style=\"width: {{view.percentage}}%\">\n" +
5212 " <div class=\"bar\" style=\"width: {{view.percentage}}%\">\n" +
5098 " </div>\n" +
5213 " </div>\n" +
5099 " </div>\n" +
5214 " </div>\n" +
5100 " <strong ng-if=\"view.latest_details.length\">\n" +
5215 " <strong ng-if=\"view.latest_details.length\">\n" +
5101 " <a data-ui-sref=\"report.list_slow({view_name:view.view_name})\">{{view.view_name}}</a></strong>\n" +
5216 " <a data-ui-sref=\"report.list_slow({view_name:view.view_name})\">{{view.view_name}}</a></strong>\n" +
5102 " <strong ng-if=\"!view.latest_details.length\">{{view.view_name}}</strong>\n" +
5217 " <strong ng-if=\"!view.latest_details.length\">{{view.view_name}}</strong>\n" +
5103 "\n" +
5218 "\n" +
5104 " <div class=\"stats\">\n" +
5219 " <div class=\"stats\">\n" +
5105 " <small>\n" +
5220 " <small>\n" +
5106 " avg. response <strong>{{view.avg_response}}s</strong> in\n" +
5221 " avg. response <strong>{{view.avg_response}}s</strong> in\n" +
5107 " <span class=\"requests\"\n" +
5222 " <span class=\"requests\"\n" +
5108 " data-uib-tooltip=\"Requests\"><strong>{{view.requests|numberToThousands}}</strong> requests</span>\n" +
5223 " data-uib-tooltip=\"Requests\"><strong>{{view.requests|numberToThousands}}</strong> requests</span>\n" +
5109 "\n" +
5224 "\n" +
5110 " <span ng-if=\"view.latest_details\">\n" +
5225 " <span ng-if=\"view.latest_details\">\n" +
5111 " &nbsp;&nbsp; Latest reports:\n" +
5226 " &nbsp;&nbsp; Latest reports:\n" +
5112 " <a ng-repeat=\"d in view.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong></a>\n" +
5227 " <a ng-repeat=\"d in view.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong></a>\n" +
5113 " </span>\n" +
5228 " </span>\n" +
5114 " </small>\n" +
5229 " </small>\n" +
5115 " </div>\n" +
5230 " </div>\n" +
5116 "\n" +
5231 "\n" +
5117 " </div>\n" +
5232 " </div>\n" +
5118 "\n" +
5233 "\n" +
5119 " </div>\n" +
5234 " </div>\n" +
5120 " </div>\n" +
5235 " </div>\n" +
5121 "\n" +
5236 "\n" +
5122 "\n" +
5237 "\n" +
5123 " </div>\n" +
5238 " </div>\n" +
5124 " </div>\n" +
5239 " </div>\n" +
5125 "\n" +
5240 "\n" +
5126 " </div>\n" +
5241 " </div>\n" +
5127 "\n" +
5242 "\n" +
5128 " </div>\n" +
5243 " </div>\n" +
5129 "\n" +
5244 "\n" +
5130 " <div class=\"row\">\n" +
5245 " <div class=\"row\">\n" +
5131 " <div class=\"col-sm-6\">\n" +
5246 " <div class=\"col-sm-6\">\n" +
5132 "\n" +
5247 "\n" +
5133 " <div class=\"panel panel-default\">\n" +
5248 " <div class=\"panel panel-default\">\n" +
5134 " <div class=\"panel-heading\">\n" +
5249 " <div class=\"panel-heading\">\n" +
5135 " <h3 class=\"panel-title\">\n" +
5250 " <h3 class=\"panel-title\">\n" +
5136 " <span class=\"fa fa-exclamation-triangle\"></span> Report groups trending over {{ index.timeSpan.label }}\n" +
5251 " <span class=\"fa fa-exclamation-triangle\"></span> Report groups trending over {{ index.timeSpan.label }}\n" +
5137 " </h3>\n" +
5252 " </h3>\n" +
5138 " </div>\n" +
5253 " </div>\n" +
5139 " <div class=\"panel-body\">\n" +
5254 " <div class=\"panel-body\">\n" +
5140 " <p ng-if=\"index.loading.reports != false\" class=\"text-center\">\n" +
5255 " <p ng-if=\"index.loading.reports != false\" class=\"text-center\">\n" +
5141 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5256 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5142 " </p>\n" +
5257 " </p>\n" +
5143 "\n" +
5258 "\n" +
5144 " <p ng-if=\"index.trendingReports.length == 0 && index.loading.reports == false\">\n" +
5259 " <p ng-if=\"index.trendingReports.length == 0 && index.loading.reports == false\">\n" +
5145 " No reports found\n" +
5260 " No reports found\n" +
5146 " </p>\n" +
5261 " </p>\n" +
5147 "\n" +
5262 "\n" +
5148 " <div small-report-group-list groups=\"index.trendingReports\" applications=\"index.applications\" ng-if=\"index.loading.reports==false\"></div>\n" +
5263 " <div small-report-group-list groups=\"index.trendingReports\" applications=\"index.applications\" ng-if=\"index.loading.reports==false\"></div>\n" +
5149 " </div>\n" +
5264 " </div>\n" +
5150 " </div>\n" +
5265 " </div>\n" +
5151 "\n" +
5266 "\n" +
5152 " </div>\n" +
5267 " </div>\n" +
5153 "\n" +
5268 "\n" +
5154 " <div class=\"col-sm-6\">\n" +
5269 " <div class=\"col-sm-6\">\n" +
5155 "\n" +
5270 "\n" +
5156 "\n" +
5271 "\n" +
5157 " <div class=\"panel panel-default\">\n" +
5272 " <div class=\"panel panel-default\">\n" +
5158 " <div class=\"panel-heading\">\n" +
5273 " <div class=\"panel-heading\">\n" +
5159 " <h3 class=\"panel-title\">\n" +
5274 " <h3 class=\"panel-title\">\n" +
5160 " Most common slow calls over {{ index.timeSpan.label }}\n" +
5275 " Most common slow calls over {{ index.timeSpan.label }}\n" +
5161 " </h3>\n" +
5276 " </h3>\n" +
5162 " </div>\n" +
5277 " </div>\n" +
5163 " <div class=\"panel-body\">\n" +
5278 " <div class=\"panel-body\">\n" +
5164 "\n" +
5279 "\n" +
5165 " <div ng-if=\"index.loading.slowCalls!=false\" class=\"text-center\">\n" +
5280 " <div ng-if=\"index.loading.slowCalls!=false\" class=\"text-center\">\n" +
5166 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5281 " <span class=\"fa fa-cog fa-spin fa-5x loader\"></span>\n" +
5167 " </div>\n" +
5282 " </div>\n" +
5168 "\n" +
5283 "\n" +
5169 " <table id=\"slow-statements\" ng-if=\"index.loading.slowCalls==false\">\n" +
5284 " <table id=\"slow-statements\" ng-if=\"index.loading.slowCalls==false\">\n" +
5170 " <tbody>\n" +
5285 " <tbody>\n" +
5171 " <tr ng-repeat=\"call in index.slowCalls\">\n" +
5286 " <tr ng-repeat=\"call in index.slowCalls\">\n" +
5172 " <td class=\"occurences\">\n" +
5287 " <td class=\"occurences\">\n" +
5173 " <span class=\"occurences\" data-uib-tooltip=\"Occurences\">{{call.occurences|numberToThousands}}</span>\n" +
5288 " <span class=\"occurences\" data-uib-tooltip=\"Occurences\">{{call.occurences|numberToThousands}}</span>\n" +
5174 " </td>\n" +
5289 " </td>\n" +
5175 " <td class=\"ellipsis\">\n" +
5290 " <td class=\"ellipsis\">\n" +
5176 " <small title=\"{{call.statement}}\" class=\"statement\">{{call.statement}}</small>\n" +
5291 " <small title=\"{{call.statement}}\" class=\"statement\">{{call.statement}}</small>\n" +
5177 " <br/>\n" +
5292 " <br/>\n" +
5178 " <span class=\"type\">{{call.statement_type}}</span>\n" +
5293 " <span class=\"type\">{{call.statement_type}}</span>\n" +
5179 " <span class=\"subtype\">{{call.statement_subtype}}</span>\n" +
5294 " <span class=\"subtype\">{{call.statement_subtype}}</span>\n" +
5180 " <span class=\"duration\" data-uib-tooltip=\"Average duration\">{{call.total_duration/call.occurences|round:2}}s</span>\n" +
5295 " <span class=\"duration\" data-uib-tooltip=\"Average duration\">{{call.total_duration/call.occurences|round:2}}s</span>\n" +
5181 " <span class=\"report-list\">\n" +
5296 " <span class=\"report-list\">\n" +
5182 " Latest reports:\n" +
5297 " Latest reports:\n" +
5183 " <a ng-repeat=\"d in call.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong> </a>\n" +
5298 " <a ng-repeat=\"d in call.latest_details\" target=\"_blank\" ui-sref=\"report.view_detail({groupId:d.group_id, reportId:d.report_id})\"> <strong>{{$index+1}}</strong> </a>\n" +
5184 " </span>\n" +
5299 " </span>\n" +
5185 " </td>\n" +
5300 " </td>\n" +
5186 " </tr>\n" +
5301 " </tr>\n" +
5187 " </tbody>\n" +
5302 " </tbody>\n" +
5188 " </table>\n" +
5303 " </table>\n" +
5189 "\n" +
5304 "\n" +
5190 "\n" +
5305 "\n" +
5191 " </div>\n" +
5306 " </div>\n" +
5192 " </div>\n" +
5307 " </div>\n" +
5193 "\n" +
5308 "\n" +
5194 "\n" +
5309 "\n" +
5195 " </div>\n" +
5310 " </div>\n" +
5196 "\n" +
5311 "\n" +
5197 " </div>\n" +
5312 " </div>\n" +
5198 " </div>\n" +
5313 " </div>\n" +
5199 " </div>\n" +
5314 " </div>\n" +
5200 "</div>\n"
5315 "</div>\n"
5201 );
5316 );
5202
5317
5203
5318
5204 $templateCache.put('templates/directives/permissions.html',
5319 $templateCache.put('templates/directives/permissions.html',
5205 "<div class=\"panel panel-default\">\n" +
5320 "<div class=\"panel panel-default\">\n" +
5206 " <div class=\"panel-heading\">\n" +
5321 " <div class=\"panel-heading\">\n" +
5207 " <h3 class=\"panel-title\">Permissions</h3>\n" +
5322 " <h3 class=\"panel-title\">Permissions</h3>\n" +
5208 " </div>\n" +
5323 " </div>\n" +
5209 " <div class=\"panel-body\">\n" +
5324 " <div class=\"panel-body\">\n" +
5210 " <p>Here you can <strong>set permissions</strong> for others to access your app data.</p>\n" +
5325 " <p>Here you can <strong>set permissions</strong> for others to access your app data.</p>\n" +
5211 "\n" +
5326 "\n" +
5212 " <p>For example you can let other staff member view or alter error reports.</p>\n" +
5327 " <p>For example you can let other staff member view or alter error reports.</p>\n" +
5213 "\n" +
5328 "\n" +
5214 " <div ng-if=\"permissions.possibleGroups.length > 0\">\n" +
5329 " <div ng-if=\"permissions.possibleGroups.length > 0\">\n" +
5215 " <h3>Group permissions</h3>\n" +
5330 " <h3>Group permissions</h3>\n" +
5216 "\n" +
5331 "\n" +
5217 " <ul class=\"list-group\">\n" +
5332 " <ul class=\"list-group\">\n" +
5218 " <li ng-repeat=\"perm in permissions.currentPermissions.group\" class=\"animate-repeat list-group-item\">\n" +
5333 " <li ng-repeat=\"perm in permissions.currentPermissions.group\" class=\"animate-repeat list-group-item\">\n" +
5219 " <strong>{{ perm.self.group_name }}</strong>\n" +
5334 " <strong>{{ perm.self.group_name }}</strong>\n" +
5220 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
5335 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
5221 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
5336 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
5222 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
5337 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
5223 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
5338 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
5224 " <ul class=\"dropdown-menu\">\n" +
5339 " <ul class=\"dropdown-menu\">\n" +
5225 " <li><a>No</a></li>\n" +
5340 " <li><a>No</a></li>\n" +
5226 " <li><a ng-click=\"permissions.removeGroupPermission(perm_name, perm)\">Yes</a></li>\n" +
5341 " <li><a ng-click=\"permissions.removeGroupPermission(perm_name, perm)\">Yes</a></li>\n" +
5227 " </ul>\n" +
5342 " </ul>\n" +
5228 " </span>\n" +
5343 " </span>\n" +
5229 " </div>\n" +
5344 " </div>\n" +
5230 " </li>\n" +
5345 " </li>\n" +
5231 " </ul>\n" +
5346 " </ul>\n" +
5232 "\n" +
5347 "\n" +
5233 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setGroupPermission()\">\n" +
5348 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setGroupPermission()\">\n" +
5234 " <div class=\"form-group\">\n" +
5349 " <div class=\"form-group\">\n" +
5235 " <select class=\"form-control\" ng-model=\"permissions.form.selectedGroup\" ng-options=\"g.id as g.group_name for g in permissions.possibleGroups\"></select>\n" +
5350 " <select class=\"form-control\" ng-model=\"permissions.form.selectedGroup\" ng-options=\"g.id as g.group_name for g in permissions.possibleGroups\"></select>\n" +
5236 " </div>\n" +
5351 " </div>\n" +
5237 " <div class=\"form-group\">\n" +
5352 " <div class=\"form-group\">\n" +
5238 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
5353 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
5239 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedGroupPermissions[permission]\"> {{ permission }}\n" +
5354 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedGroupPermissions[permission]\"> {{ permission }}\n" +
5240 " </span>\n" +
5355 " </span>\n" +
5241 " </div>\n" +
5356 " </div>\n" +
5242 " <div class=\"form-group\">\n" +
5357 " <div class=\"form-group\">\n" +
5243 " <button class=\"btn btn-info\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
5358 " <button class=\"btn btn-info\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
5244 " </div>\n" +
5359 " </div>\n" +
5245 " </form>\n" +
5360 " </form>\n" +
5246 "\n" +
5361 "\n" +
5247 " </div>\n" +
5362 " </div>\n" +
5248 "\n" +
5363 "\n" +
5249 " <h3>User permissions</h3>\n" +
5364 " <h3>User permissions</h3>\n" +
5250 " <div>\n" +
5365 " <div>\n" +
5251 " <ul class=\"list-group\">\n" +
5366 " <ul class=\"list-group\">\n" +
5252 " <li ng-repeat=\"perm in permissions.currentPermissions.user\" class=\"animate-repeat list-group-item\">\n" +
5367 " <li ng-repeat=\"perm in permissions.currentPermissions.user\" class=\"animate-repeat list-group-item\">\n" +
5253 " <strong>{{ perm.self.user_name }}</strong>\n" +
5368 " <strong>{{ perm.self.user_name }}</strong>\n" +
5254 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
5369 " <div ng-repeat=\"perm_name in perm.permissions\" class=\"pull-right animate-repeat m-l-1\">\n" +
5255 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
5370 " <span ng-if=\"perm_name == '__all_permissions__'\">Resource owner</span>\n" +
5256 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
5371 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\" ng-if=\"perm_name != '__all_permissions__'\">\n" +
5257 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
5372 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> {{ perm_name }}</a>\n" +
5258 " <ul class=\"dropdown-menu\">\n" +
5373 " <ul class=\"dropdown-menu\">\n" +
5259 " <li><a>No</a></li>\n" +
5374 " <li><a>No</a></li>\n" +
5260 " <li><a ng-click=\"permissions.removeUserPermission(perm_name,perm)\">Yes</a></li>\n" +
5375 " <li><a ng-click=\"permissions.removeUserPermission(perm_name,perm)\">Yes</a></li>\n" +
5261 " </ul>\n" +
5376 " </ul>\n" +
5262 " </span>\n" +
5377 " </span>\n" +
5263 " </div>\n" +
5378 " </div>\n" +
5264 " </li>\n" +
5379 " </li>\n" +
5265 " </ul>\n" +
5380 " </ul>\n" +
5266 " </div>\n" +
5381 " </div>\n" +
5267 " <div>\n" +
5382 " <div>\n" +
5268 " <p>First enter username or full email of person you want to give access to (the person needs to be <strong>already registered in AppEnlight</strong>)</p>\n" +
5383 " <p>First enter username or full email of person you want to give access to (the person needs to be <strong>already registered in AppEnlight</strong>)</p>\n" +
5269 "\n" +
5384 "\n" +
5270 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setUserPermission()\">\n" +
5385 " <form name=\"add_permission\" class=\"form-inline\" ng-submit=\"permissions.setUserPermission()\">\n" +
5271 " <div class=\"form-group\">\n" +
5386 " <div class=\"form-group\">\n" +
5272 " <input type=\"text\" class=\"autocomplete form-control\" placeholder=\"Search for user/email\" ng-model=\"permissions.form.autocompleteUser\"\n" +
5387 " <input type=\"text\" class=\"autocomplete form-control\" placeholder=\"Search for user/email\" ng-model=\"permissions.form.autocompleteUser\"\n" +
5273 " uib-typeahead=\"u.user for u in permissions.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"permissions.searchingUsers\" typeahead-wait-ms=\"250\"\n" +
5388 " uib-typeahead=\"u.user for u in permissions.searchUsers($viewValue) | limitTo:8\" typeahead-loading=\"permissions.searchingUsers\" typeahead-wait-ms=\"250\"\n" +
5274 " typeahead-template-url=\"templates/directives/user_search_type_ahead.html\"\n" +
5389 " typeahead-template-url=\"templates/directives/user_search_type_ahead.html\"\n" +
5275 " />\n" +
5390 " />\n" +
5276 " </div>\n" +
5391 " </div>\n" +
5277 " <div class=\"form-group\">\n" +
5392 " <div class=\"form-group\">\n" +
5278 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
5393 " <span ng-repeat=\"permission in permissions.possiblePermissions\">\n" +
5279 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedUserPermissions[permission]\"> {{ permission }}\n" +
5394 " <input type=\"checkbox\" ng-model=\"permissions.form.selectedUserPermissions[permission]\"> {{ permission }}\n" +
5280 " </span>\n" +
5395 " </span>\n" +
5281 " </div>\n" +
5396 " </div>\n" +
5282 " <div class=\"form-group\">\n" +
5397 " <div class=\"form-group\">\n" +
5283 " <button class=\"btn btn-info\" ng-disabled=\"!permissions.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
5398 " <button class=\"btn btn-info\" ng-disabled=\"!permissions.form.autocompleteUser\"><span class=\"fa fa-user\"></span> Give permission</button>\n" +
5284 " </div>\n" +
5399 " </div>\n" +
5285 " </form>\n" +
5400 " </form>\n" +
5286 " </div>\n" +
5401 " </div>\n" +
5287 " </div>\n" +
5402 " </div>\n" +
5288 "</div>\n"
5403 "</div>\n"
5289 );
5404 );
5290
5405
5291
5406
5292 $templateCache.put('templates/directives/plugin_config.html',
5407 $templateCache.put('templates/directives/plugin_config.html',
5293 "<div ng-repeat=\"tmpl in plugin_ctrlr.inclusions track by $index\">\n" +
5408 "<div ng-repeat=\"tmpl in plugin_ctrlr.inclusions track by $index\">\n" +
5294 " <div><strong>Plugin: {{tmpl.name}}</strong></div>\n" +
5409 " <div><strong>Plugin: {{tmpl.name}}</strong></div>\n" +
5295 " <ng-include src=\"tmpl.template\"></ng-include>\n" +
5410 " <ng-include src=\"tmpl.template\"></ng-include>\n" +
5296 " <hr/>\n" +
5411 " <hr/>\n" +
5297 "</div>\n"
5412 "</div>\n"
5298 );
5413 );
5299
5414
5300
5415
5301 $templateCache.put('templates/directives/postprocess_action.html',
5416 $templateCache.put('templates/directives/postprocess_action.html',
5302 "<div class=\"panel panel-default action\">\n" +
5417 "<div class=\"panel panel-default action\">\n" +
5303 " <div class=\"panel-body form-inline\">\n" +
5418 " <div class=\"panel-body form-inline\">\n" +
5304 " <div class=\"pull-right\">\n" +
5419 " <div class=\"pull-right\">\n" +
5305 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5420 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5306 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5421 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5307 " <ul class=\"dropdown-menu\">\n" +
5422 " <ul class=\"dropdown-menu\">\n" +
5308 " <li><a>No</a></li>\n" +
5423 " <li><a>No</a></li>\n" +
5309 " <li><a ng-click=\"ctrl.deleteAction(ctrl.action)\">Yes</a></li>\n" +
5424 " <li><a ng-click=\"ctrl.deleteAction(ctrl.action)\">Yes</a></li>\n" +
5310 " </ul>\n" +
5425 " </ul>\n" +
5311 " </span>\n" +
5426 " </span>\n" +
5312 " </div>\n" +
5427 " </div>\n" +
5313 "\n" +
5428 "\n" +
5314 " <div class=\"form-group\">\n" +
5429 " <div class=\"form-group\">\n" +
5315 " <label>Action</label>\n" +
5430 " <label>Action</label>\n" +
5316 "\n" +
5431 "\n" +
5317 " <div class=\"form-group\">\n" +
5432 " <div class=\"form-group\">\n" +
5318 " <select class=\"form-control\" ng-model=\"ctrl.action.new_value\" ng-options=\"f[0] as f[1] for f in ctrl.possibleActions\" ng-change=\"ctrl.setDirty()\"></select>\n" +
5433 " <select class=\"form-control\" ng-model=\"ctrl.action.new_value\" ng-options=\"f[0] as f[1] for f in ctrl.possibleActions\" ng-change=\"ctrl.setDirty()\"></select>\n" +
5319 " </div>\n" +
5434 " </div>\n" +
5320 "\n" +
5435 "\n" +
5321 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
5436 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
5322 "\n" +
5437 "\n" +
5323 " </div>\n" +
5438 " </div>\n" +
5324 " <hr/>\n" +
5439 " <hr/>\n" +
5325 " <p>Meeting following criteria:</p>\n" +
5440 " <p>Meeting following criteria:</p>\n" +
5326 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
5441 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
5327 " {{ctrl.rule}}\n" +
5442 " {{ctrl.rule}}\n" +
5328 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
5443 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
5329 " </div>\n" +
5444 " </div>\n" +
5330 "</div>\n"
5445 "</div>\n"
5331 );
5446 );
5332
5447
5333
5448
5334 $templateCache.put('templates/directives/report_alert_action.html',
5449 $templateCache.put('templates/directives/report_alert_action.html',
5335 "<div class=\"panel panel-default action\">\n" +
5450 "<div class=\"panel panel-default action\">\n" +
5336 " <div class=\"panel-body form-inline\">\n" +
5451 " <div class=\"panel-body form-inline\">\n" +
5337 " <div class=\"pull-right\">\n" +
5452 " <div class=\"pull-right\">\n" +
5338 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5453 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5339 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5454 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5340 " <ul class=\"dropdown-menu\">\n" +
5455 " <ul class=\"dropdown-menu\">\n" +
5341 " <li><a>No</a></li>\n" +
5456 " <li><a>No</a></li>\n" +
5342 " <li><a ng-click=\"ctrl.deleteAction(ctrl.actions, ctrl.action)\">Yes</a></li>\n" +
5457 " <li><a ng-click=\"ctrl.deleteAction(ctrl.actions, ctrl.action)\">Yes</a></li>\n" +
5343 " </ul>\n" +
5458 " </ul>\n" +
5344 " </span>\n" +
5459 " </span>\n" +
5345 " </div>\n" +
5460 " </div>\n" +
5346 "\n" +
5461 "\n" +
5347 " <div class=\"form-group\">\n" +
5462 " <div class=\"form-group\">\n" +
5348 " <label>Applies to</label>\n" +
5463 " <label>Applies to</label>\n" +
5349 " <select class=\"form-control\" ng-model=\"ctrl.action.resource_id\" ng-options=\"f.resource_id as f.resource_name for f in ctrl.applications\" ng-change=\"ctrl.setDirty()\">\n" +
5464 " <select class=\"form-control\" ng-model=\"ctrl.action.resource_id\" ng-options=\"f.resource_id as f.resource_name for f in ctrl.applications\" ng-change=\"ctrl.setDirty()\">\n" +
5350 " <option value=\"\">All Resources</option>\n" +
5465 " <option value=\"\">All Resources</option>\n" +
5351 " </select>\n" +
5466 " </select>\n" +
5352 " </div>\n" +
5467 " </div>\n" +
5353 " <div class=\"form-group\">\n" +
5468 " <div class=\"form-group\">\n" +
5354 " <label>Notify</label>\n" +
5469 " <label>Notify</label>\n" +
5355 " <select class=\"form-control\" ng-model=\"ctrl.action.action\" ng-change=\"ctrl.setDirty()\" ng-options=\"f[0] as f[1] for f in ctrl.possibleNotifications\"></select>\n" +
5470 " <select class=\"form-control\" ng-model=\"ctrl.action.action\" ng-change=\"ctrl.setDirty()\" ng-options=\"f[0] as f[1] for f in ctrl.possibleNotifications\"></select>\n" +
5356 "\n" +
5471 "\n" +
5357 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
5472 " <a class=\"btn btn-success\" ng-if=\"ctrl.action.dirty\" ng-click=\"ctrl.saveAction()\"><span class=\"fa fa-save\"></span> &nbsp;Save changes</a>\n" +
5358 "\n" +
5473 "\n" +
5359 " </div>\n" +
5474 " </div>\n" +
5360 " <div>\n" +
5475 " <div>\n" +
5361 " <p><strong>Channels:</strong></p>\n" +
5476 " <p><strong>Channels:</strong></p>\n" +
5362 " <ul class=\"list-group\">\n" +
5477 " <ul class=\"list-group\">\n" +
5363 " <li class=\"list-group-item\" ng-repeat=\"channel in ctrl.action.channels\">\n" +
5478 " <li class=\"list-group-item\" ng-repeat=\"channel in ctrl.action.channels\">\n" +
5364 " <strong>{{channel.channel_visible_value}}</strong>\n" +
5479 " <strong>{{channel.channel_visible_value}}</strong>\n" +
5365 " <div class=\"pull-right\">\n" +
5480 " <div class=\"pull-right\">\n" +
5366 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5481 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5367 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5482 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5368 " <ul class=\"dropdown-menu\">\n" +
5483 " <ul class=\"dropdown-menu\">\n" +
5369 " <li><a>No</a></li>\n" +
5484 " <li><a>No</a></li>\n" +
5370 " <li><a ng-click=\"ctrl.unBindChannel(channel)\">Yes</a></li>\n" +
5485 " <li><a ng-click=\"ctrl.unBindChannel(channel)\">Yes</a></li>\n" +
5371 " </ul>\n" +
5486 " </ul>\n" +
5372 " </span>\n" +
5487 " </span>\n" +
5373 " </div>\n" +
5488 " </div>\n" +
5374 " </li>\n" +
5489 " </li>\n" +
5375 " </ul>\n" +
5490 " </ul>\n" +
5376 " <div class=\"form-group\" ng-if=\"ctrl.possibleChannels.length\">\n" +
5491 " <div class=\"form-group\" ng-if=\"ctrl.possibleChannels.length\">\n" +
5377 " <select class=\"form-control\" ng-model=\"ctrl.channelToBind\" ng-options=\"c as c.channel_visible_value for c in ctrl.possibleChannels |filter: c.supports_report_alerting\"></select>\n" +
5492 " <select class=\"form-control\" ng-model=\"ctrl.channelToBind\" ng-options=\"c as c.channel_visible_value for c in ctrl.possibleChannels |filter: c.supports_report_alerting\"></select>\n" +
5378 " <a class=\"btn btn-info\" ng-click=\"ctrl.bindChannel(channel, ctrl.action)\"><span class=\"fa fa-plus-circle\"></span> Add Channel</a>\n" +
5493 " <a class=\"btn btn-info\" ng-click=\"ctrl.bindChannel(channel, ctrl.action)\"><span class=\"fa fa-plus-circle\"></span> Add Channel</a>\n" +
5379 " </div>\n" +
5494 " </div>\n" +
5380 " <div class=\"alert alert-danger\" ng-if=\"!ctrl.possibleChannels.length\">\n" +
5495 " <div class=\"alert alert-danger\" ng-if=\"!ctrl.possibleChannels.length\">\n" +
5381 " <span class=\"fa fa-exclamation-triangle \"></span>You need to create an alert channel before you can assign it to your rule.\n" +
5496 " <span class=\"fa fa-exclamation-triangle \"></span>You need to create an alert channel before you can assign it to your rule.\n" +
5382 " </div>\n" +
5497 " </div>\n" +
5383 "\n" +
5498 "\n" +
5384 " </div>\n" +
5499 " </div>\n" +
5385 " <hr/>\n" +
5500 " <hr/>\n" +
5386 " <p>Meeting following criteria:</p>\n" +
5501 " <p>Meeting following criteria:</p>\n" +
5387 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
5502 " <form-errors errors=\"ctrl.errors\"></form-errors>\n" +
5388 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
5503 " <rule rule=\"ctrl.action.rule\" rule-definitions=\"ctrl.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"ctrl.action\"></rule>\n" +
5389 " </div>\n" +
5504 " </div>\n" +
5390 "</div>\n"
5505 "</div>\n"
5391 );
5506 );
5392
5507
5393
5508
5394 $templateCache.put('templates/directives/rule_read_only.html',
5509 $templateCache.put('templates/directives/rule_read_only.html',
5395 "<div class=\"rule-read-only\">\n" +
5510 "<div class=\"rule-read-only\">\n" +
5396 "\n" +
5511 "\n" +
5397 " <span class=\"form-group\">\n" +
5512 " <span class=\"form-group\">\n" +
5398 " {{rule_ctrlr.readOnlyPossibleFields[rule_ctrlr.rule.field]}}\n" +
5513 " {{rule_ctrlr.readOnlyPossibleFields[rule_ctrlr.rule.field]}}\n" +
5399 " </span>\n" +
5514 " </span>\n" +
5400 "\n" +
5515 "\n" +
5401 " <span ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\">\n" +
5516 " <span ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\">\n" +
5402 " is {{rule_ctrlr.ruleDefinitions.allOps[rule_ctrlr.rule.op]}} {{rule_ctrlr.rule.value}}\n" +
5517 " is {{rule_ctrlr.ruleDefinitions.allOps[rule_ctrlr.rule.op]}} {{rule_ctrlr.rule.value}}\n" +
5403 " </span>\n" +
5518 " </span>\n" +
5404 "\n" +
5519 "\n" +
5405 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
5520 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
5406 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
5521 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
5407 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
5522 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
5408 "\n" +
5523 "\n" +
5409 " <div class=\"panel panel-default\">\n" +
5524 " <div class=\"panel panel-default\">\n" +
5410 " <div class=\"panel-body form-inline\">\n" +
5525 " <div class=\"panel-body form-inline\">\n" +
5411 " <recursive>\n" +
5526 " <recursive>\n" +
5412 " <rule-read-only rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"rule_ctrlr.parentObj\"></rule-read-only>\n" +
5527 " <rule-read-only rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"null\" parent-obj=\"rule_ctrlr.parentObj\"></rule-read-only>\n" +
5413 " </recursive>\n" +
5528 " </recursive>\n" +
5414 " </div>\n" +
5529 " </div>\n" +
5415 " </div>\n" +
5530 " </div>\n" +
5416 " </div>\n" +
5531 " </div>\n" +
5417 "\n" +
5532 "\n" +
5418 " </span>\n" +
5533 " </span>\n" +
5419 "</div>\n"
5534 "</div>\n"
5420 );
5535 );
5421
5536
5422
5537
5423 $templateCache.put('templates/directives/rule.html',
5538 $templateCache.put('templates/directives/rule.html',
5424 "<div class=\"rule form-inline\">\n" +
5539 "<div class=\"rule form-inline\">\n" +
5425 "\n" +
5540 "\n" +
5426 " <div class=\"form-group\">\n" +
5541 " <div class=\"form-group\">\n" +
5427 " <select class=\"form-control\"\n" +
5542 " <select class=\"form-control\"\n" +
5428 " ng-model=\"rule_ctrlr.rule.field\"\n" +
5543 " ng-model=\"rule_ctrlr.rule.field\"\n" +
5429 " ng-change=\"rule_ctrlr.fieldChange()\"\n" +
5544 " ng-change=\"rule_ctrlr.fieldChange()\"\n" +
5430 " ng-options=\"key as label for (key, label) in rule_ctrlr.ruleDefinitions.possibleFields\"></select>\n" +
5545 " ng-options=\"key as label for (key, label) in rule_ctrlr.ruleDefinitions.possibleFields\"></select>\n" +
5431 " </div>\n" +
5546 " </div>\n" +
5432 "\n" +
5547 "\n" +
5433 " <div ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\" class=\"form-group\">\n" +
5548 " <div ng-if=\"rule_ctrlr.rule.field != '__AND__' && rule_ctrlr.rule.field !='__OR__' && rule_ctrlr.rule.field !='__NOT__'\" class=\"form-group\">\n" +
5434 "\n" +
5549 "\n" +
5435 " <select ng-model=\"rule_ctrlr.rule.op\" class=\"form-control\"\n" +
5550 " <select ng-model=\"rule_ctrlr.rule.op\" class=\"form-control\"\n" +
5436 " ng-change=\"rule_ctrlr.setDirty()\"\n" +
5551 " ng-change=\"rule_ctrlr.setDirty()\"\n" +
5437 " ng-options=\"op as rule_ctrlr.ruleDefinitions.allOps[op] for op in rule_ctrlr.ruleDefinitions.fieldOps[rule_ctrlr.rule.field]\">\n" +
5552 " ng-options=\"op as rule_ctrlr.ruleDefinitions.allOps[op] for op in rule_ctrlr.ruleDefinitions.fieldOps[rule_ctrlr.rule.field]\">\n" +
5438 " </select>\n" +
5553 " </select>\n" +
5439 "\n" +
5554 "\n" +
5440 " <input type=\"text\" placeholder=\"Value\" ng-model=\"rule_ctrlr.rule.value\" ng-change=\"rule_ctrlr.setDirty()\" class=\"form-control\">\n" +
5555 " <input type=\"text\" placeholder=\"Value\" ng-model=\"rule_ctrlr.rule.value\" ng-change=\"rule_ctrlr.setDirty()\" class=\"form-control\">\n" +
5441 "\n" +
5556 "\n" +
5442 " </div>\n" +
5557 " </div>\n" +
5443 "\n" +
5558 "\n" +
5444 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
5559 " <span ng-if=\"rule_ctrlr.rule.field == '__AND__' || rule_ctrlr.rule.field =='__OR__' || rule_ctrlr.rule.field =='__NOT__'\">\n" +
5445 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
5560 " <p ng-if=\"parent\"><strong>Subrules</strong></p>\n" +
5446 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
5561 " <div ng-repeat=\"subrule in rule_ctrlr.rule.rules\" class=\"m-l-2\">\n" +
5447 " <div class=\"panel panel-default\">\n" +
5562 " <div class=\"panel panel-default\">\n" +
5448 " <div class=\"panel-body form-inline\">\n" +
5563 " <div class=\"panel-body form-inline\">\n" +
5449 " <recursive>\n" +
5564 " <recursive>\n" +
5450 " <rule rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"rule_ctrlr.rule\" parent-obj=\"rule_ctrlr.parentObj\"></rule>\n" +
5565 " <rule rule=\"subrule\" rule-definitions=\"rule_ctrlr.ruleDefinitions\" parent-rule=\"rule_ctrlr.rule\" parent-obj=\"rule_ctrlr.parentObj\"></rule>\n" +
5451 " </recursive>\n" +
5566 " </recursive>\n" +
5452 " </div>\n" +
5567 " </div>\n" +
5453 " </div>\n" +
5568 " </div>\n" +
5454 " </div>\n" +
5569 " </div>\n" +
5455 "\n" +
5570 "\n" +
5456 " <span ng-if=\"(rule_ctrlr.config.disable_subrules == false) == false\" class=\"btn btn-info\" ng-click=\"rule_ctrlr.add()\"><span class=\"fa fa-plus-circle\"></span> Add rule</span>\n" +
5571 " <span ng-if=\"(rule_ctrlr.config.disable_subrules == false) == false\" class=\"btn btn-info\" ng-click=\"rule_ctrlr.add()\"><span class=\"fa fa-plus-circle\"></span> Add rule</span>\n" +
5457 "\n" +
5572 "\n" +
5458 " </span>\n" +
5573 " </span>\n" +
5459 " <div class=\"pull-right\" ng-if=\"rule_ctrlr.parentRule\">\n" +
5574 " <div class=\"pull-right\" ng-if=\"rule_ctrlr.parentRule\">\n" +
5460 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5575 " <span class=\"dropdown\" data-uib-dropdown>\n" +
5461 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5576 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
5462 " <ul class=\"dropdown-menu\">\n" +
5577 " <ul class=\"dropdown-menu\">\n" +
5463 " <li><a>No</a></li>\n" +
5578 " <li><a>No</a></li>\n" +
5464 " <li><a ng-click=\"rule_ctrlr.deleteRule(rule_ctrlr.parentRule, rule_ctrlr.rule)\">Yes</a></li>\n" +
5579 " <li><a ng-click=\"rule_ctrlr.deleteRule(rule_ctrlr.parentRule, rule_ctrlr.rule)\">Yes</a></li>\n" +
5465 " </ul>\n" +
5580 " </ul>\n" +
5466 " </span>\n" +
5581 " </span>\n" +
5467 " </div>\n" +
5582 " </div>\n" +
5468 "</div>\n"
5583 "</div>\n"
5469 );
5584 );
5470
5585
5471
5586
5472 $templateCache.put('templates/directives/search_type_ahead.html',
5587 $templateCache.put('templates/directives/search_type_ahead.html',
5473 "<a>\n" +
5588 "<a>\n" +
5474 " <span class=\"tag\" ng-show=\"match.model.tag\">{{match.model.tag}}</span>\n" +
5589 " <span class=\"tag\" ng-show=\"match.model.tag\">{{match.model.tag}}</span>\n" +
5475 " <span class=\"tag\" ng-show=\"!match.model.tag\">{{match.label}}</span>\n" +
5590 " <span class=\"tag\" ng-show=\"!match.model.tag\">{{match.label}}</span>\n" +
5476 " <span ng-show=\"match.model.example\">-</span> <span class=\"example\">{{match.model.example}}</span>\n" +
5591 " <span ng-show=\"match.model.example\">-</span> <span class=\"example\">{{match.model.example}}</span>\n" +
5477 " <div class=\"description\">{{match.model.description}}</div>\n" +
5592 " <div class=\"description\">{{match.model.description}}</div>\n" +
5478 "\n" +
5593 "\n" +
5479 "</a>\n"
5594 "</a>\n"
5480 );
5595 );
5481
5596
5482
5597
5483 $templateCache.put('templates/directives/user_search_type_ahead.html',
5598 $templateCache.put('templates/directives/user_search_type_ahead.html',
5484 "<a>\n" +
5599 "<a>\n" +
5485 " <span>{{match.label}}</span> -\n" +
5600 " <span>{{match.label}}</span> -\n" +
5486 " <span class=\"color-secondary\">{{match.model.name}}</span>\n" +
5601 " <span class=\"color-secondary\">{{match.model.name}}</span>\n" +
5487 "</a>\n"
5602 "</a>\n"
5488 );
5603 );
5489
5604
5490
5605
5491 $templateCache.put('templates/events.html',
5606 $templateCache.put('templates/events.html',
5492 "<div class=\"panel panel-default\">\n" +
5607 "<div class=\"panel panel-default\">\n" +
5493 " <div class=\"panel-body\">\n" +
5608 " <div class=\"panel-body\">\n" +
5494 "\n" +
5609 "\n" +
5495 " <h1>Event history</h1>\n" +
5610 " <h1>Event history</h1>\n" +
5496 "\n" +
5611 "\n" +
5497 " <table class=\"table table-striped event-table\">\n" +
5612 " <table class=\"table table-striped event-table\">\n" +
5498 " <tr ng-repeat=\"event in events.events track by event.id\">\n" +
5613 " <tr ng-repeat=\"event in events.events track by event.id\">\n" +
5499 " <td class=\"text-center icons\">\n" +
5614 " <td class=\"text-center icons\">\n" +
5500 " <span ng-if=\"event.event_type === 1\" class=\"fa fa-exclamation-triangle fa-2x\" style=\"color:orangered\"></span>\n" +
5615 " <span ng-if=\"event.event_type === 1\" class=\"fa fa-exclamation-triangle fa-2x\" style=\"color:orangered\"></span>\n" +
5501 " <span ng-if=\"event.event_type === 3\" class=\"fa fa-clock-o fa-2x\" style=\"color:darkorange\"></span>\n" +
5616 " <span ng-if=\"event.event_type === 3\" class=\"fa fa-clock-o fa-2x\" style=\"color:darkorange\"></span>\n" +
5502 " <span ng-if=\"event.event_type === 7\" class=\"fa fa-question-circle fa-2x\" style=\"color:dimgrey\"></span>\n" +
5617 " <span ng-if=\"event.event_type === 7\" class=\"fa fa-question-circle fa-2x\" style=\"color:dimgrey\"></span>\n" +
5503 " <span ng-if=\"event.event_type === 9\" class=\"fa fa-line-chart fa-2x\" style=\"color:green\"></span>\n" +
5618 " <span ng-if=\"event.event_type === 9\" class=\"fa fa-line-chart fa-2x\" style=\"color:green\"></span>\n" +
5504 " </td>\n" +
5619 " </td>\n" +
5505 " <td>\n" +
5620 " <td>\n" +
5506 " <p>For <strong>{{ event.resource_name }}</strong></p>\n" +
5621 " <p>For <strong>{{ event.resource_name }}</strong></p>\n" +
5507 "\n" +
5622 "\n" +
5508 " <p>{{ event.text }}</p>\n" +
5623 " <p>{{ event.text }}</p>\n" +
5509 " <small class=\"date\" data-uib-tooltip=\"{{event.start_date}}\"> created:\n" +
5624 " <small class=\"date\" data-uib-tooltip=\"{{event.start_date}}\"> created:\n" +
5510 " <iso-to-relative-time time=\"{{event.start_date}}\"/>\n" +
5625 " <iso-to-relative-time time=\"{{event.start_date}}\"/>\n" +
5511 " </small>\n" +
5626 " </small>\n" +
5512 " <small class=\"date\" ng-show=\"event.end_date\" data-uib-tooltip=\"{{event.end_date}}\"> | closed:\n" +
5627 " <small class=\"date\" ng-show=\"event.end_date\" data-uib-tooltip=\"{{event.end_date}}\"> | closed:\n" +
5513 " <iso-to-relative-time time=\"{{event.end_date}}\"/>\n" +
5628 " <iso-to-relative-time time=\"{{event.end_date}}\"/>\n" +
5514 " </small>\n" +
5629 " </small>\n" +
5515 " </td>\n" +
5630 " </td>\n" +
5516 " <td class=\"options\">\n" +
5631 " <td class=\"options\">\n" +
5517 "\n" +
5632 "\n" +
5518 " <span class=\"dropdown pull-right\" ng-if=\"event.status === 1\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5633 " <span class=\"dropdown pull-right\" ng-if=\"event.status === 1\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
5519 " <a class=\"dropdown-toggle btn btn-danger\" data-uib-dropdown-toggle>\n" +
5634 " <a class=\"dropdown-toggle btn btn-danger\" data-uib-dropdown-toggle>\n" +
5520 " <span class=\"fa fa-exclamation-circle\"></span>\n" +
5635 " <span class=\"fa fa-exclamation-circle\"></span>\n" +
5521 " </a>\n" +
5636 " </a>\n" +
5522 " <ul class=\"dropdown-menu\">\n" +
5637 " <ul class=\"dropdown-menu\">\n" +
5523 " <li>\n" +
5638 " <li>\n" +
5524 " <a ng-click=\"events.closeEvent(event)\">Close event</a>\n" +
5639 " <a ng-click=\"events.closeEvent(event)\">Close event</a>\n" +
5525 " <a>Do nothing</a>\n" +
5640 " <a>Do nothing</a>\n" +
5526 " </li>\n" +
5641 " </li>\n" +
5527 " </ul>\n" +
5642 " </ul>\n" +
5528 " </span>\n" +
5643 " </span>\n" +
5529 "\n" +
5644 "\n" +
5530 " </td>\n" +
5645 " </td>\n" +
5531 " </tr>\n" +
5646 " </tr>\n" +
5532 " </table>\n" +
5647 " </table>\n" +
5533 " </div>\n" +
5648 " </div>\n" +
5534 "</div>\n"
5649 "</div>\n"
5535 );
5650 );
5536
5651
5537
5652
5538 $templateCache.put('templates/integrations/bitbucket.html',
5653 $templateCache.put('templates/integrations/bitbucket.html',
5539 " <div class=\"modal-header\">\n" +
5654 " <div class=\"modal-header\">\n" +
5540 " <h3 class=\"m-t-0\">Add issue to Bitbucket</h3>\n" +
5655 " <h3 class=\"m-t-0\">Add issue to Bitbucket</h3>\n" +
5541 " </div>\n" +
5656 " </div>\n" +
5542 " <div class=\"modal-body\">\n" +
5657 " <div class=\"modal-body\">\n" +
5543 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5658 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5544 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5659 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5545 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5660 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5546 " </div>\n" +
5661 " </div>\n" +
5547 "\n" +
5662 "\n" +
5548 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5663 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5549 " <div class=\"form-group\">\n" +
5664 " <div class=\"form-group\">\n" +
5550 " <label for=\"issue_title\">Issue Title</label>\n" +
5665 " <label for=\"issue_title\">Issue Title</label>\n" +
5551 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5666 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5552 " </div>\n" +
5667 " </div>\n" +
5553 " <div class=\"form-group row\">\n" +
5668 " <div class=\"form-group row\">\n" +
5554 " <div class=\"col-sm-6\">\n" +
5669 " <div class=\"col-sm-6\">\n" +
5555 " <label for=\"issue_priority\">Priority</label>\n" +
5670 " <label for=\"issue_priority\">Priority</label>\n" +
5556 " <select class=\"form-control\" id=\"issue_priority\" ng-options=\"s for s in ctrl.priorities\" ng-model=\"ctrl.form.priority\"></select>\n" +
5671 " <select class=\"form-control\" id=\"issue_priority\" ng-options=\"s for s in ctrl.priorities\" ng-model=\"ctrl.form.priority\"></select>\n" +
5557 " </div>\n" +
5672 " </div>\n" +
5558 "\n" +
5673 "\n" +
5559 " <div class=\"col-sm-6\">\n" +
5674 " <div class=\"col-sm-6\">\n" +
5560 " <label for=\"issue_responsible\">Assignee</label>\n" +
5675 " <label for=\"issue_responsible\">Assignee</label>\n" +
5561 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.user for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5676 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.user for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5562 " </div>\n" +
5677 " </div>\n" +
5563 " </div>\n" +
5678 " </div>\n" +
5564 " <div class=\"form-group\">\n" +
5679 " <div class=\"form-group\">\n" +
5565 " <label for=\"issue_content\">Description</label>\n" +
5680 " <label for=\"issue_content\">Description</label>\n" +
5566 " <textarea id=\"issue_content\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5681 " <textarea id=\"issue_content\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5567 " </div>\n" +
5682 " </div>\n" +
5568 " </form>\n" +
5683 " </form>\n" +
5569 "\n" +
5684 "\n" +
5570 " </div>\n" +
5685 " </div>\n" +
5571 " <div class=\"modal-footer\">\n" +
5686 " <div class=\"modal-footer\">\n" +
5572 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5687 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5573 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5688 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5574 " </div>\n"
5689 " </div>\n"
5575 );
5690 );
5576
5691
5577
5692
5578 $templateCache.put('templates/integrations/github.html',
5693 $templateCache.put('templates/integrations/github.html',
5579 " <div class=\"modal-header\">\n" +
5694 " <div class=\"modal-header\">\n" +
5580 " <h3 class=\"m-t-0\">Add issue to Github</h3>\n" +
5695 " <h3 class=\"m-t-0\">Add issue to Github</h3>\n" +
5581 " </div>\n" +
5696 " </div>\n" +
5582 " <div class=\"modal-body\">\n" +
5697 " <div class=\"modal-body\">\n" +
5583 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5698 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5584 "\n" +
5699 "\n" +
5585 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5700 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5586 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5701 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5587 " </div>\n" +
5702 " </div>\n" +
5588 "\n" +
5703 "\n" +
5589 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5704 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5590 " <div class=\"form-group\">\n" +
5705 " <div class=\"form-group\">\n" +
5591 " <label for=\"issue_title\">Issue Title</label>\n" +
5706 " <label for=\"issue_title\">Issue Title</label>\n" +
5592 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5707 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5593 " </div>\n" +
5708 " </div>\n" +
5594 " <div class=\"form-group row\">\n" +
5709 " <div class=\"form-group row\">\n" +
5595 " <div class=\"col-sm-6\">\n" +
5710 " <div class=\"col-sm-6\">\n" +
5596 " <label for=\"issue_status\">Tag</label>\n" +
5711 " <label for=\"issue_status\">Tag</label>\n" +
5597 " <select class=\"form-control\" id=\"issue_status\" ng-options=\"s for s in ctrl.statuses\" ng-model=\"ctrl.form.status\"></select>\n" +
5712 " <select class=\"form-control\" id=\"issue_status\" ng-options=\"s for s in ctrl.statuses\" ng-model=\"ctrl.form.status\"></select>\n" +
5598 " </div>\n" +
5713 " </div>\n" +
5599 "\n" +
5714 "\n" +
5600 " <div class=\"col-sm-6\">\n" +
5715 " <div class=\"col-sm-6\">\n" +
5601 " <label for=\"issue_responsible\">Assignee</label>\n" +
5716 " <label for=\"issue_responsible\">Assignee</label>\n" +
5602 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.user for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5717 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.user for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5603 " </div>\n" +
5718 " </div>\n" +
5604 " </div>\n" +
5719 " </div>\n" +
5605 " <div class=\"form-group\">\n" +
5720 " <div class=\"form-group\">\n" +
5606 " <label for=\"issue_description\">Description</label>\n" +
5721 " <label for=\"issue_description\">Description</label>\n" +
5607 " <textarea id=\"issue_description\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5722 " <textarea id=\"issue_description\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5608 " </div>\n" +
5723 " </div>\n" +
5609 " </form>\n" +
5724 " </form>\n" +
5610 "\n" +
5725 "\n" +
5611 " </div>\n" +
5726 " </div>\n" +
5612 " <div class=\"modal-footer\">\n" +
5727 " <div class=\"modal-footer\">\n" +
5613 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5728 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5614 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5729 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5615 " </div>\n"
5730 " </div>\n"
5616 );
5731 );
5617
5732
5618
5733
5619 $templateCache.put('templates/integrations/jira.html',
5734 $templateCache.put('templates/integrations/jira.html',
5620 " <div class=\"modal-header\">\n" +
5735 " <div class=\"modal-header\">\n" +
5621 " <h3 class=\"m-t-0\">Add issue to Jira</h3>\n" +
5736 " <h3 class=\"m-t-0\">Add issue to Jira</h3>\n" +
5622 " </div>\n" +
5737 " </div>\n" +
5623 " <div class=\"modal-body\">\n" +
5738 " <div class=\"modal-body\">\n" +
5624 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5739 " <div class=\"alert alert-danger\" ng-repeat=\"msg in ctrl.error_messages\">{{msg}}</div>\n" +
5625 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5740 " <div class=\"text-center\" ng-show=\"ctrl.loading\">\n" +
5626 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5741 " <span class=\"fa fa-cog fa-spin fa-5x loader m-a-4\"></span>\n" +
5627 " </div>\n" +
5742 " </div>\n" +
5628 "\n" +
5743 "\n" +
5629 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5744 " <form role=\"form\" ng-show=\"!ctrl.loading\">\n" +
5630 " <div class=\"form-group\">\n" +
5745 " <div class=\"form-group\">\n" +
5631 " <label for=\"issue_title\">Issue Title</label>\n" +
5746 " <label for=\"issue_title\">Issue Title</label>\n" +
5632 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5747 " <input type=\"text\" class=\"form-control\" id=\"issue_title\" placeholder=\"Issue title\" ng-model=\"ctrl.form.title\">\n" +
5633 " </div>\n" +
5748 " </div>\n" +
5634 "\n" +
5749 "\n" +
5635 " <div class=\"form-group\">\n" +
5750 " <div class=\"form-group\">\n" +
5636 " <label for=\"issue_type\">Issue Type</label>\n" +
5751 " <label for=\"issue_type\">Issue Type</label>\n" +
5637 " <select class=\"form-control\" id=\"issue_type\" ng-options=\"i.name for i in ctrl.issue_types\" ng-model=\"ctrl.form.issue_type\"></select>\n" +
5752 " <select class=\"form-control\" id=\"issue_type\" ng-options=\"i.name for i in ctrl.issue_types\" ng-model=\"ctrl.form.issue_type\"></select>\n" +
5638 " </div>\n" +
5753 " </div>\n" +
5639 " <div class=\"form-group row\">\n" +
5754 " <div class=\"form-group row\">\n" +
5640 " <div class=\"col-sm-6\">\n" +
5755 " <div class=\"col-sm-6\">\n" +
5641 " <label for=\"issue_priority\">Priority</label>\n" +
5756 " <label for=\"issue_priority\">Priority</label>\n" +
5642 " <select class=\"form-control\" id=\"issue_priority\" ng-options=\"s.name for s in ctrl.priorities\" ng-model=\"ctrl.form.priority\"></select>\n" +
5757 " <select class=\"form-control\" id=\"issue_priority\" ng-options=\"s.name for s in ctrl.priorities\" ng-model=\"ctrl.form.priority\"></select>\n" +
5643 " </div>\n" +
5758 " </div>\n" +
5644 "\n" +
5759 "\n" +
5645 " <div class=\"col-sm-6\">\n" +
5760 " <div class=\"col-sm-6\">\n" +
5646 " <label for=\"issue_responsible\">Assignee</label>\n" +
5761 " <label for=\"issue_responsible\">Assignee</label>\n" +
5647 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.name for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5762 " <select class=\"form-control\" id=\"issue_responsible\" ng-options=\"a.name for a in ctrl.assignees\" ng-model=\"ctrl.form.responsible\"></select>\n" +
5648 " </div>\n" +
5763 " </div>\n" +
5649 " </div>\n" +
5764 " </div>\n" +
5650 " <div class=\"form-group\">\n" +
5765 " <div class=\"form-group\">\n" +
5651 " <label for=\"issue_content\">Description</label>\n" +
5766 " <label for=\"issue_content\">Description</label>\n" +
5652 " <textarea id=\"issue_content\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5767 " <textarea id=\"issue_content\" class=\"form-control\" ng-model=\"ctrl.form.content\" style=\"min-height: 100px\"></textarea>\n" +
5653 " </div>\n" +
5768 " </div>\n" +
5654 " </form>\n" +
5769 " </form>\n" +
5655 "\n" +
5770 "\n" +
5656 " </div>\n" +
5771 " </div>\n" +
5657 " <div class=\"modal-footer\">\n" +
5772 " <div class=\"modal-footer\">\n" +
5658 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5773 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">Add issue</button>\n" +
5659 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5774 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
5660 " </div>\n"
5775 " </div>\n"
5661 );
5776 );
5662
5777
5663
5778
5664 $templateCache.put('templates/loader.html',
5779 $templateCache.put('templates/loader.html',
5665 "<div class=\"text-center\">\n" +
5780 "<div class=\"text-center\">\n" +
5666 " <span class=\"fa fa-cog fa-spin fa-5x m-a-4\"></span>\n" +
5781 " <span class=\"fa fa-cog fa-spin fa-5x m-a-4\"></span>\n" +
5667 "</div>\n"
5782 "</div>\n"
5668 );
5783 );
5669
5784
5670
5785
5671 $templateCache.put('templates/logs.html',
5786 $templateCache.put('templates/logs.html',
5672 "<ng-include src=\"'templates/loader.html'\" ng-if=\"logs.isLoading.logs\"></ng-include>\n" +
5787 "<ng-include src=\"'templates/loader.html'\" ng-if=\"logs.isLoading.logs\"></ng-include>\n" +
5673 "\n" +
5788 "\n" +
5674 "<div ng-if=\"logs.isLoading.logs === false\">\n" +
5789 "<div ng-if=\"logs.isLoading.logs === false\">\n" +
5675 "\n" +
5790 "\n" +
5676 " <p class=\"search-params\">\n" +
5791 " <p class=\"search-params\">\n" +
5677 " <strong>Search params:</strong>\n" +
5792 " <strong>Search params:</strong>\n" +
5678 " <span ng-repeat=\"tag in logs.searchParams.tags\" class=\"tag\">\n" +
5793 " <span ng-repeat=\"tag in logs.searchParams.tags\" class=\"tag\">\n" +
5679 " <strong>{{tag.type}}</strong>\n" +
5794 " <strong>{{tag.type}}</strong>\n" +
5680 " {{ tag.type == 'resource' ? logs.applications[tag.value].resource_name : tag.value }}\n" +
5795 " {{ tag.type == 'resource' ? logs.applications[tag.value].resource_name : tag.value }}\n" +
5681 "\n" +
5796 "\n" +
5682 " <a ng-click=\"logs.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
5797 " <a ng-click=\"logs.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
5683 " </span>\n" +
5798 " </span>\n" +
5684 " </p>\n" +
5799 " </p>\n" +
5685 "\n" +
5800 "\n" +
5686 " <p>\n" +
5801 " <p>\n" +
5687 "\n" +
5802 "\n" +
5688 " <script type=\"text/ng-template\" id=\"SearchTypeAheadUrl.html\">\n" +
5803 " <script type=\"text/ng-template\" id=\"SearchTypeAheadUrl.html\">\n" +
5689 "\n" +
5804 "\n" +
5690 " </script>\n" +
5805 " </script>\n" +
5691 "\n" +
5806 "\n" +
5692 " <form class=\"form\">\n" +
5807 " <form class=\"form\">\n" +
5693 " <div class=\"typeahead-tags\">\n" +
5808 " <div class=\"typeahead-tags\">\n" +
5694 " <input type=\"text\" id=\"typeAhead\" ng-model=\"logs.filterTypeAhead\" placeholder=\"Start typing to filter logs for events, filter by servers, namespaces, levels.\"\n" +
5809 " <input type=\"text\" id=\"typeAhead\" ng-model=\"logs.filterTypeAhead\" placeholder=\"Start typing to filter logs for events, filter by servers, namespaces, levels.\"\n" +
5695 " ng-keydown=\"logs.typeAheadTag($event)\"\n" +
5810 " ng-keydown=\"logs.typeAheadTag($event)\"\n" +
5696 " uib-typeahead=\"tag as tag.text for tag in logs.filterTypeAheadOptions | filter:$viewValue:logs.aheadFilter\"\n" +
5811 " uib-typeahead=\"tag as tag.text for tag in logs.filterTypeAheadOptions | filter:$viewValue:logs.aheadFilter\"\n" +
5697 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
5812 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
5698 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
5813 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
5699 " </div>\n" +
5814 " </div>\n" +
5700 " </form>\n" +
5815 " </form>\n" +
5701 "\n" +
5816 "\n" +
5702 " <div class=\"well animate-show position-absolute increse-zindex\" ng-if=\"logs.showDatePicker\" ng-model=\"logs.pickerDate\" ng-change=\"logs.pickerDateChanged()\">\n" +
5817 " <div class=\"well animate-show position-absolute increse-zindex\" ng-if=\"logs.showDatePicker\" ng-model=\"logs.pickerDate\" ng-change=\"logs.pickerDateChanged()\">\n" +
5703 " <uib-datepicker></uib-datepicker>\n" +
5818 " <uib-datepicker></uib-datepicker>\n" +
5704 " </div>\n" +
5819 " </div>\n" +
5705 "\n" +
5820 "\n" +
5706 " </p>\n" +
5821 " </p>\n" +
5707 "\n" +
5822 "\n" +
5708 " <div class=\"panel\">\n" +
5823 " <div class=\"panel\">\n" +
5709 "\n" +
5824 "\n" +
5710 " <div class=\"panel-body\">\n" +
5825 " <div class=\"panel-body\">\n" +
5711 " <c3chart data-domid=\"log_events_chart\" data-data=\"logs.logEventsChartData\" data-config=\"logs.logEventsChartConfig\">\n" +
5826 " <c3chart data-domid=\"log_events_chart\" data-data=\"logs.logEventsChartData\" data-config=\"logs.logEventsChartConfig\">\n" +
5712 " </c3chart>\n" +
5827 " </c3chart>\n" +
5713 " </div>\n" +
5828 " </div>\n" +
5714 " </div>\n" +
5829 " </div>\n" +
5715 "\n" +
5830 "\n" +
5716 "\n" +
5831 "\n" +
5717 " <div class=\"text-center\">\n" +
5832 " <div class=\"text-center\">\n" +
5718 " <uib-pagination total-items=\"logs.itemCount\" items-per-page=\"logs.itemsPerPage\" ng-model=\"logs.searchParams.page\" max-size=\"10\"\n" +
5833 " <uib-pagination total-items=\"logs.itemCount\" items-per-page=\"logs.itemsPerPage\" ng-model=\"logs.searchParams.page\" max-size=\"10\"\n" +
5719 " ng-change=\"logs.paginationChange()\"\n" +
5834 " ng-change=\"logs.paginationChange()\"\n" +
5720 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"></uib-pagination>\n" +
5835 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"></uib-pagination>\n" +
5721 " </div>\n" +
5836 " </div>\n" +
5722 "\n" +
5837 "\n" +
5723 " <div class=\"panel panel-default\">\n" +
5838 " <div class=\"panel panel-default\">\n" +
5724 "\n" +
5839 "\n" +
5725 " <table class=\"table table-striped log-list\">\n" +
5840 " <table class=\"table table-striped log-list\">\n" +
5726 " <caption>Logs</caption>\n" +
5841 " <caption>Logs</caption>\n" +
5727 " <thead>\n" +
5842 " <thead>\n" +
5728 " <tr>\n" +
5843 " <tr>\n" +
5729 " <th class=\"c1 resource\">Application</th>\n" +
5844 " <th class=\"c1 resource\">Application</th>\n" +
5730 " <th class=\"c2 message\">Message</th>\n" +
5845 " <th class=\"c2 message\">Message</th>\n" +
5731 " <th class=\"c3 when\">When</th>\n" +
5846 " <th class=\"c3 when\">When</th>\n" +
5732 " </tr>\n" +
5847 " </tr>\n" +
5733 " </thead>\n" +
5848 " </thead>\n" +
5734 " <tbody>\n" +
5849 " <tbody>\n" +
5735 " <tr ng-repeat=\"log in logs.logsPage track by log.log_id\" class=\"{{$odd ? 'odd' : 'even'}}\">\n" +
5850 " <tr ng-repeat=\"log in logs.logsPage track by log.log_id\" class=\"{{$odd ? 'odd' : 'even'}}\">\n" +
5736 " <td class=\"c1\">\n" +
5851 " <td class=\"c1\">\n" +
5737 " <a class=\"tag application\" ng-click=\"logs.addSearchTag({type:'resource', value:log.resource_id})\">\n" +
5852 " <a class=\"tag application\" ng-click=\"logs.addSearchTag({type:'resource', value:log.resource_id})\">\n" +
5738 " <span class=\"name\">{{log.resource_name}}</span></a>\n" +
5853 " <span class=\"name\">{{log.resource_name}}</span></a>\n" +
5739 " </td>\n" +
5854 " </td>\n" +
5740 " <td class=\"c2\">\n" +
5855 " <td class=\"c2\">\n" +
5741 " <a class=\"tag {{log.log_level|lowercase}}\" ng-click=\"logs.addSearchTag({type:'level', value:log.log_level})\">\n" +
5856 " <a class=\"tag {{log.log_level|lowercase}}\" ng-click=\"logs.addSearchTag({type:'level', value:log.log_level})\">\n" +
5742 " <span class=\"name\">level:</span> {{log.log_level}}</a>\n" +
5857 " <span class=\"name\">level:</span> {{log.log_level}}</a>\n" +
5743 " <a class=\"tag\" ng-click=\"logs.addSearchTag({type:'namespace', value:log.namespace})\">\n" +
5858 " <a class=\"tag\" ng-click=\"logs.addSearchTag({type:'namespace', value:log.namespace})\">\n" +
5744 " <span class=\"name\">namespace:</span> {{log.namespace}}</a>\n" +
5859 " <span class=\"name\">namespace:</span> {{log.namespace}}</a>\n" +
5745 " <a ng-repeat=\"(tag, value) in log.tags\" class=\"tag\" ng-click=\"logs.addSearchTag({type:tag, value:value})\">\n" +
5860 " <a ng-repeat=\"(tag, value) in log.tags\" class=\"tag\" ng-click=\"logs.addSearchTag({type:tag, value:value})\">\n" +
5746 " <span class=\"name\">{{tag}}:</span> {{value}}</a>\n" +
5861 " <span class=\"name\">{{tag}}:</span> {{value}}</a>\n" +
5747 " <div class=\"log\">{{log.message}}</div>\n" +
5862 " <div class=\"log\">{{log.message}}</div>\n" +
5748 " </td>\n" +
5863 " </td>\n" +
5749 " <td class=\"c3 when\">\n" +
5864 " <td class=\"c3 when\">\n" +
5750 " <a ng-click=\"logs.filterId(log)\" data-uib-tooltip=\"{{log.timestamp}}\">\n" +
5865 " <a ng-click=\"logs.filterId(log)\" data-uib-tooltip=\"{{log.timestamp}}\">\n" +
5751 " <iso-to-relative-time time=\"{{log.timestamp}}\"/>\n" +
5866 " <iso-to-relative-time time=\"{{log.timestamp}}\"/>\n" +
5752 " </a>\n" +
5867 " </a>\n" +
5753 " </td>\n" +
5868 " </td>\n" +
5754 " </tr>\n" +
5869 " </tr>\n" +
5755 "\n" +
5870 "\n" +
5756 " </tbody>\n" +
5871 " </tbody>\n" +
5757 " </table>\n" +
5872 " </table>\n" +
5758 "\n" +
5873 "\n" +
5759 " </div>\n" +
5874 " </div>\n" +
5760 "\n" +
5875 "\n" +
5761 " <div class=\"text-center\">\n" +
5876 " <div class=\"text-center\">\n" +
5762 " <uib-pagination total-items=\"logs.itemCount\" items-per-page=\"logs.itemsPerPage\" ng-model=\"logs.searchParams.page\" max-size=\"10\"\n" +
5877 " <uib-pagination total-items=\"logs.itemCount\" items-per-page=\"logs.itemsPerPage\" ng-model=\"logs.searchParams.page\" max-size=\"10\"\n" +
5763 " ng-change=\"logs.paginationChange()\"\n" +
5878 " ng-change=\"logs.paginationChange()\"\n" +
5764 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"></uib-pagination>\n" +
5879 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"></uib-pagination>\n" +
5765 " </div>\n" +
5880 " </div>\n" +
5766 "\n" +
5881 "\n" +
5767 "</div>\n"
5882 "</div>\n"
5768 );
5883 );
5769
5884
5770
5885
5771 $templateCache.put('templates/quickstart.html',
5886 $templateCache.put('templates/quickstart.html',
5772 "<h2>AppEnlight quickstart</h2>\n" +
5887 "<h2>AppEnlight quickstart</h2>\n" +
5773 "\n" +
5888 "\n" +
5774 "<p>\n" +
5889 "<p>\n" +
5775 " <span class=\"point\">1</span>\n" +
5890 " <span class=\"point\">1</span>\n" +
5776 " For AppEnlight to operate, you need to\n" +
5891 " For AppEnlight to operate, you need to\n" +
5777 " <a data-ui-sref=\"applications.update({resourceId:'new'})\" target=\"_blank\"><strong>create an app profile</strong></a> that allows\n" +
5892 " <a data-ui-sref=\"applications.update({resourceId:'new'})\" target=\"_blank\"><strong>create an app profile</strong></a> that allows\n" +
5778 " you to\n" +
5893 " you to\n" +
5779 " obtain an <strong>API key</strong> that one of the clients can use.\n" +
5894 " obtain an <strong>API key</strong> that one of the clients can use.\n" +
5780 "</p>\n" +
5895 "</p>\n" +
5781 "\n" +
5896 "\n" +
5782 "<div class=\"clear\"></div>\n" +
5897 "<div class=\"clear\"></div>\n" +
5783 "<hr/>\n" +
5898 "<hr/>\n" +
5784 "\n" +
5899 "\n" +
5785 "<p>\n" +
5900 "<p>\n" +
5786 " <span class=\"point\">2</span>\n" +
5901 " <span class=\"point\">2</span>\n" +
5787 " It is a good idea to configure an\n" +
5902 " It is a good idea to configure an\n" +
5788 " <a data-ui-sref=\"user.alert_channels.email\" target=\"_blank\">\n" +
5903 " <a data-ui-sref=\"user.alert_channels.email\" target=\"_blank\">\n" +
5789 " <strong>email alert channel</strong></a> that you can use to receive\n" +
5904 " <strong>email alert channel</strong></a> that you can use to receive\n" +
5790 " notifications about events that happen in your application.\n" +
5905 " notifications about events that happen in your application.\n" +
5791 "</p>\n" +
5906 "</p>\n" +
5792 "\n" +
5907 "\n" +
5793 "<p>\n" +
5908 "<p>\n" +
5794 " It can be the same email account you used to register withing AppEnlight -\n" +
5909 " It can be the same email account you used to register withing AppEnlight -\n" +
5795 " although we often recommend using a separate <em>errors@...</em> account\n" +
5910 " although we often recommend using a separate <em>errors@...</em> account\n" +
5796 " designated for alert notifications.\n" +
5911 " designated for alert notifications.\n" +
5797 "</p>\n" +
5912 "</p>\n" +
5798 "\n" +
5913 "\n" +
5799 "<div class=\"clear\"></div>\n" +
5914 "<div class=\"clear\"></div>\n" +
5800 "<hr/>\n" +
5915 "<hr/>\n" +
5801 "\n" +
5916 "\n" +
5802 "<p>\n" +
5917 "<p>\n" +
5803 " <span class=\"point\">3</span>\n" +
5918 " <span class=\"point\">3</span>\n" +
5804 " In order for your application to stream meaningful information, you will need to\n" +
5919 " In order for your application to stream meaningful information, you will need to\n" +
5805 " integrate a compatible client for your language of choice.\n" +
5920 " integrate a compatible client for your language of choice.\n" +
5806 "</p>\n" +
5921 "</p>\n" +
5807 "\n" +
5922 "\n" +
5808 "<p>Head over to the <a href=\"{{AeConfig.urls.docs}}\" target=\"_blank\">\n" +
5923 "<p>Head over to the <a href=\"{{AeConfig.urls.docs}}\" target=\"_blank\">\n" +
5809 " <strong>developers section</strong></a> for information on currently available\n" +
5924 " <strong>developers section</strong></a> for information on currently available\n" +
5810 " clients that you can plug into your software</p>\n"
5925 " clients that you can plug into your software</p>\n"
5811 );
5926 );
5812
5927
5813
5928
5814 $templateCache.put('templates/register.html',
5929 $templateCache.put('templates/register.html',
5815 ""
5930 ""
5816 );
5931 );
5817
5932
5818
5933
5819 $templateCache.put('templates/reports/list_slow.html',
5934 $templateCache.put('templates/reports/list_slow.html',
5820 "<ng-include src=\"'templates/loader.html'\" ng-if=\"reports_list.is_loading\"></ng-include>\n" +
5935 "<ng-include src=\"'templates/loader.html'\" ng-if=\"reports_list.is_loading\"></ng-include>\n" +
5821 "\n" +
5936 "\n" +
5822 "<div ng-if=\"reports_list.is_loading === false\">\n" +
5937 "<div ng-if=\"reports_list.is_loading === false\">\n" +
5823 "\n" +
5938 "\n" +
5824 " <p class=\"search-params\">\n" +
5939 " <p class=\"search-params\">\n" +
5825 " <strong>Search params:</strong>\n" +
5940 " <strong>Search params:</strong>\n" +
5826 " <span ng-repeat=\"tag in reports_list.searchParams.tags\" class=\"tag\">\n" +
5941 " <span ng-repeat=\"tag in reports_list.searchParams.tags\" class=\"tag\">\n" +
5827 " <strong>{{tag.type}}</strong>\n" +
5942 " <strong>{{tag.type}}</strong>\n" +
5828 " {{ tag.type == 'resource' ? reports_list.applications[tag.value].resource_name : tag.value }}\n" +
5943 " {{ tag.type == 'resource' ? reports_list.applications[tag.value].resource_name : tag.value }}\n" +
5829 "\n" +
5944 "\n" +
5830 " <a ng-click=\"reports_list.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
5945 " <a ng-click=\"reports_list.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
5831 " </span>\n" +
5946 " </span>\n" +
5832 " </p>\n" +
5947 " </p>\n" +
5833 "\n" +
5948 "\n" +
5834 " <p>\n" +
5949 " <p>\n" +
5835 "\n" +
5950 "\n" +
5836 " <form class=\"form\">\n" +
5951 " <form class=\"form\">\n" +
5837 " <div class=\"typeahead-tags\">\n" +
5952 " <div class=\"typeahead-tags\">\n" +
5838 " <input type=\"text\" id=\"typeAhead\" ng-model=\"reports_list.filterTypeAhead\" placeholder=\"Start typing to filter slowness reports - filter by tags, average response time, priority or other properties.\"\n" +
5953 " <input type=\"text\" id=\"typeAhead\" ng-model=\"reports_list.filterTypeAhead\" placeholder=\"Start typing to filter slowness reports - filter by tags, average response time, priority or other properties.\"\n" +
5839 " ng-keydown=\"reports_list.typeAheadTag($event)\"\n" +
5954 " ng-keydown=\"reports_list.typeAheadTag($event)\"\n" +
5840 " uib-typeahead=\"tag as tag.text for tag in reports_list.filterTypeAheadOptions | filter:$viewValue:aheadFilter\"\n" +
5955 " uib-typeahead=\"tag as tag.text for tag in reports_list.filterTypeAheadOptions | filter:$viewValue:aheadFilter\"\n" +
5841 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
5956 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
5842 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
5957 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
5843 " </div>\n" +
5958 " </div>\n" +
5844 " </form>\n" +
5959 " </form>\n" +
5845 "\n" +
5960 "\n" +
5846 "\n" +
5961 "\n" +
5847 " <div class=\"well position-absolute increse-zindex\" ng-show=\"reports_list.showDatePicker\" ng-model=\"reports_list.pickerDate\" ng-change=\"reports_list.pickerDateChanged()\"\n" +
5962 " <div class=\"well position-absolute increse-zindex\" ng-show=\"reports_list.showDatePicker\" ng-model=\"reports_list.pickerDate\" ng-change=\"reports_list.pickerDateChanged()\"\n" +
5848 " class=\"animate-show\">\n" +
5963 " class=\"animate-show\">\n" +
5849 " <uib-datepicker></uib-datepicker>\n" +
5964 " <uib-datepicker></uib-datepicker>\n" +
5850 " </div>\n" +
5965 " </div>\n" +
5851 "\n" +
5966 "\n" +
5852 " </p>\n" +
5967 " </p>\n" +
5853 "\n" +
5968 "\n" +
5854 "\n" +
5969 "\n" +
5855 " <div class=\"text-center\">\n" +
5970 " <div class=\"text-center\">\n" +
5856 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
5971 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
5857 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
5972 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
5858 " ng-change=\"reports_list.paginationChange()\"\n" +
5973 " ng-change=\"reports_list.paginationChange()\"\n" +
5859 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
5974 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
5860 " </div>\n" +
5975 " </div>\n" +
5861 "\n" +
5976 "\n" +
5862 "\n" +
5977 "\n" +
5863 " <div class=\"panel panel-default\">\n" +
5978 " <div class=\"panel panel-default\">\n" +
5864 " <!-- Default panel contents -->\n" +
5979 " <!-- Default panel contents -->\n" +
5865 "\n" +
5980 "\n" +
5866 " <table class=\"table table-striped report-list\" ng-show=\"!reports_list.is_loading\">\n" +
5981 " <table class=\"table table-striped report-list\" ng-show=\"!reports_list.is_loading\">\n" +
5867 " <caption>Slow Request Reports</caption>\n" +
5982 " <caption>Slow Request Reports</caption>\n" +
5868 " <thead>\n" +
5983 " <thead>\n" +
5869 " <tr>\n" +
5984 " <tr>\n" +
5870 " <td class=\"c1 ordering occurences\">#</td>\n" +
5985 " <td class=\"c1 ordering occurences\">#</td>\n" +
5871 " <td class=\"c2 average_duration\">Avg. duration</td>\n" +
5986 " <td class=\"c2 average_duration\">Avg. duration</td>\n" +
5872 " <td class=\"c3 application\">Application</td>\n" +
5987 " <td class=\"c3 application\">Application</td>\n" +
5873 " <td class=\"c5 when\">When <input type=\"checkbox\" ng-model=\"reports_list.notRelativeTime\"\n" +
5988 " <td class=\"c5 when\">When <input type=\"checkbox\" ng-model=\"reports_list.notRelativeTime\"\n" +
5874 " ng-change=\"reports_list.changeRelativeTime()\"\n" +
5989 " ng-change=\"reports_list.changeRelativeTime()\"\n" +
5875 " title=\"Tick to see UTC time instead relative\"></td>\n" +
5990 " title=\"Tick to see UTC time instead relative\"></td>\n" +
5876 " <td class=\"c6 error_type\">Location</td>\n" +
5991 " <td class=\"c6 error_type\">Location</td>\n" +
5877 " </tr>\n" +
5992 " </tr>\n" +
5878 " </thead>\n" +
5993 " </thead>\n" +
5879 " <tbody>\n" +
5994 " <tbody>\n" +
5880 " <tr ng-repeat=\"report in reports_list.reportsPage track by report.id\">\n" +
5995 " <tr ng-repeat=\"report in reports_list.reportsPage track by report.id\">\n" +
5881 " <td class=\"c1 occurences\">\n" +
5996 " <td class=\"c1 occurences\">\n" +
5882 " <span class=\"priority-{{report.group.priority}}\" data-uib-tooltip=\"Report priority\">{{report.group.priority}}</span>\n" +
5997 " <span class=\"priority-{{report.group.priority}}\" data-uib-tooltip=\"Report priority\">{{report.group.priority}}</span>\n" +
5883 " <span class=\"count {{report.presentation.className}}\" data-uib-tooltip=\"{{report.presentation.tooltip}}\">\n" +
5998 " <span class=\"count {{report.presentation.className}}\" data-uib-tooltip=\"{{report.presentation.tooltip}}\">\n" +
5884 " {{report.group.occurences|numberToThousands}}\n" +
5999 " {{report.group.occurences|numberToThousands}}\n" +
5885 " </span>\n" +
6000 " </span>\n" +
5886 " </td>\n" +
6001 " </td>\n" +
5887 " <td class=\"c2 average_duration\">{{report.group.average_duration.toFixed(3)}}s</td>\n" +
6002 " <td class=\"c2 average_duration\">{{report.group.average_duration.toFixed(3)}}s</td>\n" +
5888 " <td class=\"c3 application\">\n" +
6003 " <td class=\"c3 application\">\n" +
5889 " <div class=\"app_name\">{{report.resource_name}}</div>\n" +
6004 " <div class=\"app_name\">{{report.resource_name}}</div>\n" +
5890 " <span class=\"server\">@{{report.tags.server_name}}</span></td>\n" +
6005 " <span class=\"server\">@{{report.tags.server_name}}</span></td>\n" +
5891 " <td class=\"c4 when\">\n" +
6006 " <td class=\"c4 when\">\n" +
5892 " <span ng-show=\"!reports_list.notRelativeTime\"><span data-uib-tooltip=\"{{report.group.last_timestamp}}\"><iso-to-relative-time\n" +
6007 " <span ng-show=\"!reports_list.notRelativeTime\"><span data-uib-tooltip=\"{{report.group.last_timestamp}}\"><iso-to-relative-time\n" +
5893 " time=\"{{report.group.last_timestamp}}\"/></span>\n" +
6008 " time=\"{{report.group.last_timestamp}}\"/></span>\n" +
5894 " </span>\n" +
6009 " </span>\n" +
5895 " <span ng-show=\"reports_list.notRelativeTime\">{{report.group.last_timestamp.replace('T', ' ').slice(0,16)}}</span>\n" +
6010 " <span ng-show=\"reports_list.notRelativeTime\">{{report.group.last_timestamp.replace('T', ' ').slice(0,16)}}</span>\n" +
5896 " </td>\n" +
6011 " </td>\n" +
5897 " <td class=\"c5 report ellipsis\">\n" +
6012 " <td class=\"c5 report ellipsis\">\n" +
5898 " <a ui-sref=\"report.view_detail({groupId:report.group.id, reportId:report.id})\">{{ report.tags.view_name || report.url_path}} </span></a></td>\n" +
6013 " <a ui-sref=\"report.view_detail({groupId:report.group.id, reportId:report.id})\">{{ report.tags.view_name || report.url_path}} </span></a></td>\n" +
5899 " </td>\n" +
6014 " </td>\n" +
5900 " </tr>\n" +
6015 " </tr>\n" +
5901 "\n" +
6016 "\n" +
5902 " </tbody>\n" +
6017 " </tbody>\n" +
5903 " </table>\n" +
6018 " </table>\n" +
5904 "\n" +
6019 "\n" +
5905 " </div>\n" +
6020 " </div>\n" +
5906 "\n" +
6021 "\n" +
5907 " <div class=\"text-center\">\n" +
6022 " <div class=\"text-center\">\n" +
5908 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
6023 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
5909 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
6024 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
5910 " ng-change=\"reports_list.paginationChange()\"\n" +
6025 " ng-change=\"reports_list.paginationChange()\"\n" +
5911 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
6026 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
5912 " </div>\n" +
6027 " </div>\n" +
5913 "\n" +
6028 "\n" +
5914 "</div>\n"
6029 "</div>\n"
5915 );
6030 );
5916
6031
5917
6032
5918 $templateCache.put('templates/reports/list.html',
6033 $templateCache.put('templates/reports/list.html',
5919 "<ng-include src=\"'templates/loader.html'\" ng-if=\"reports_list.is_loading\"></ng-include>\n" +
6034 "<ng-include src=\"'templates/loader.html'\" ng-if=\"reports_list.is_loading\"></ng-include>\n" +
5920 "\n" +
6035 "\n" +
5921 "<div ng-if=\"reports_list.is_loading === false\">\n" +
6036 "<div ng-if=\"reports_list.is_loading === false\">\n" +
5922 "\n" +
6037 "\n" +
5923 " <p class=\"search-params\">\n" +
6038 " <p class=\"search-params\">\n" +
5924 " <strong>Search params:</strong>\n" +
6039 " <strong>Search params:</strong>\n" +
5925 " <span ng-repeat=\"tag in reports_list.searchParams.tags\" class=\"tag\">\n" +
6040 " <span ng-repeat=\"tag in reports_list.searchParams.tags\" class=\"tag\">\n" +
5926 " <strong>{{tag.type}}</strong>\n" +
6041 " <strong>{{tag.type}}</strong>\n" +
5927 " {{ tag.type == 'resource' ? reports_list.applications[tag.value].resource_name : tag.value }}\n" +
6042 " {{ tag.type == 'resource' ? reports_list.applications[tag.value].resource_name : tag.value }}\n" +
5928 "\n" +
6043 "\n" +
5929 " <a ng-click=\"reports_list.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
6044 " <a ng-click=\"reports_list.removeSearchTag(tag)\"><span class=\"fa fa-times\"></span></a>\n" +
5930 " </span>\n" +
6045 " </span>\n" +
5931 " </p>\n" +
6046 " </p>\n" +
5932 "\n" +
6047 "\n" +
5933 " <form class=\"form\">\n" +
6048 " <form class=\"form\">\n" +
5934 " <div class=\"typeahead-tags\">\n" +
6049 " <div class=\"typeahead-tags\">\n" +
5935 " <input type=\"text\" id=\"typeAhead\" ng-model=\"reports_list.filterTypeAhead\" placeholder=\"Start typing to filter reports - filter by tags, exception, priority or other properties.\"\n" +
6050 " <input type=\"text\" id=\"typeAhead\" ng-model=\"reports_list.filterTypeAhead\" placeholder=\"Start typing to filter reports - filter by tags, exception, priority or other properties.\"\n" +
5936 " ng-keydown=\"reports_list.typeAheadTag($event)\"\n" +
6051 " ng-keydown=\"reports_list.typeAheadTag($event)\"\n" +
5937 " uib-typeahead=\"tag as tag.text for tag in reports_list.filterTypeAheadOptions | filter:$viewValue:aheadFilter\"\n" +
6052 " uib-typeahead=\"tag as tag.text for tag in reports_list.filterTypeAheadOptions | filter:$viewValue:aheadFilter\"\n" +
5938 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
6053 " typeahead-min-length=\"1\" class=\"form-control\"\n" +
5939 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
6054 " typeahead-template-url=\"templates/directives/search_type_ahead.html\">\n" +
5940 " </div>\n" +
6055 " </div>\n" +
5941 " </form>\n" +
6056 " </form>\n" +
5942 "\n" +
6057 "\n" +
5943 "\n" +
6058 "\n" +
5944 " <div class=\"well position-absolute increse-zindex\" ng-show=\"reports_list.showDatePicker\" ng-model=\"reports_list.pickerDate\" ng-change=\"reports_list.pickerDateChanged()\"\n" +
6059 " <div class=\"well position-absolute increse-zindex\" ng-show=\"reports_list.showDatePicker\" ng-model=\"reports_list.pickerDate\" ng-change=\"reports_list.pickerDateChanged()\"\n" +
5945 " class=\"animate-show\">\n" +
6060 " class=\"animate-show\">\n" +
5946 " <uib-datepicker></uib-datepicker>\n" +
6061 " <uib-datepicker></uib-datepicker>\n" +
5947 " </div>\n" +
6062 " </div>\n" +
5948 "\n" +
6063 "\n" +
5949 " </p>\n" +
6064 " </p>\n" +
5950 "\n" +
6065 "\n" +
5951 "\n" +
6066 "\n" +
5952 " <div class=\"text-center\">\n" +
6067 " <div class=\"text-center\">\n" +
5953 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
6068 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
5954 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
6069 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
5955 " ng-change=\"reports_list.paginationChange()\"\n" +
6070 " ng-change=\"reports_list.paginationChange()\"\n" +
5956 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
6071 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
5957 " </div>\n" +
6072 " </div>\n" +
5958 "\n" +
6073 "\n" +
5959 " <div class=\"panel panel-default\">\n" +
6074 " <div class=\"panel panel-default\">\n" +
5960 " <!-- Default panel contents -->\n" +
6075 " <!-- Default panel contents -->\n" +
5961 "\n" +
6076 "\n" +
5962 " <table class=\"table table-striped report-list\" ng-show=\"!reports_list.is_loading\">\n" +
6077 " <table class=\"table table-striped report-list\" ng-show=\"!reports_list.is_loading\">\n" +
5963 " <caption>Reports</caption>\n" +
6078 " <caption>Reports</caption>\n" +
5964 " <thead>\n" +
6079 " <thead>\n" +
5965 " <tr>\n" +
6080 " <tr>\n" +
5966 " <th class=\"c1 ordering occurences\">#</th>\n" +
6081 " <th class=\"c1 ordering occurences\">#</th>\n" +
5967 " <th class=\"c2 application\">Application</th>\n" +
6082 " <th class=\"c2 application\">Application</th>\n" +
5968 " <th class=\"c4 when\">When <input type=\"checkbox\" ng-model=\"reports_list.notRelativeTime\"\n" +
6083 " <th class=\"c4 when\">When <input type=\"checkbox\" ng-model=\"reports_list.notRelativeTime\"\n" +
5969 " ng-change=\"reports_list.changeRelativeTime()\"\n" +
6084 " ng-change=\"reports_list.changeRelativeTime()\"\n" +
5970 " title=\"Tick to see UTC time instead relative\"></th>\n" +
6085 " title=\"Tick to see UTC time instead relative\"></th>\n" +
5971 " <th class=\"c5 error_type\">Error</th>\n" +
6086 " <th class=\"c5 error_type\">Error</th>\n" +
5972 " </tr>\n" +
6087 " </tr>\n" +
5973 " </thead>\n" +
6088 " </thead>\n" +
5974 " <tbody>\n" +
6089 " <tbody>\n" +
5975 " <tr ng-repeat=\"report in reports_list.reportsPage track by report.id\">\n" +
6090 " <tr ng-repeat=\"report in reports_list.reportsPage track by report.id\">\n" +
5976 " <td class=\"c1 occurences\">\n" +
6091 " <td class=\"c1 occurences\">\n" +
5977 " <span class=\"priority-{{report.group.priority}}\" data-uib-tooltip=\"Report priority\">{{report.group.priority}}</span>\n" +
6092 " <span class=\"priority-{{report.group.priority}}\" data-uib-tooltip=\"Report priority\">{{report.group.priority}}</span>\n" +
5978 " <span class=\"count {{report.presentation.className}}\" data-uib-tooltip=\"{{report.presentation.tooltip}}\">\n" +
6093 " <span class=\"count {{report.presentation.className}}\" data-uib-tooltip=\"{{report.presentation.tooltip}}\">\n" +
5979 " {{report.group.occurences|numberToThousands}}\n" +
6094 " {{report.group.occurences|numberToThousands}}\n" +
5980 " </span>\n" +
6095 " </span>\n" +
5981 " </td>\n" +
6096 " </td>\n" +
5982 " <td class=\"c2 application\">\n" +
6097 " <td class=\"c2 application\">\n" +
5983 " <div class=\"app_name\">{{report.resource_name}}</div>\n" +
6098 " <div class=\"app_name\">{{report.resource_name}}</div>\n" +
5984 " <span class=\"server\">@{{report.tags.server_name}}</span></td>\n" +
6099 " <span class=\"server\">@{{report.tags.server_name}}</span></td>\n" +
5985 " <td class=\"c3 when\">\n" +
6100 " <td class=\"c3 when\">\n" +
5986 " <span ng-show=\"!reports_list.notRelativeTime\"><span data-uib-tooltip=\"{{report.group.last_timestamp}}\"><iso-to-relative-time\n" +
6101 " <span ng-show=\"!reports_list.notRelativeTime\"><span data-uib-tooltip=\"{{report.group.last_timestamp}}\"><iso-to-relative-time\n" +
5987 " time=\"{{report.group.last_timestamp}}\"/></span>\n" +
6102 " time=\"{{report.group.last_timestamp}}\"/></span>\n" +
5988 " </span>\n" +
6103 " </span>\n" +
5989 " <span ng-show=\"reports_list.notRelativeTime\">{{report.group.last_timestamp.replace('T', ' ').slice(0,16)}}</span>\n" +
6104 " <span ng-show=\"reports_list.notRelativeTime\">{{report.group.last_timestamp.replace('T', ' ').slice(0,16)}}</span>\n" +
5990 " </td>\n" +
6105 " </td>\n" +
5991 " <td class=\"c4 report ellipsis\"><a ui-sref=\"report.view_detail({groupId:report.group.id, reportId:report.id})\" title=\"{{report.error}}\">{{report.error || 'Unknown Exception'}}</a> <br/>\n" +
6106 " <td class=\"c4 report ellipsis\"><a ui-sref=\"report.view_detail({groupId:report.group.id, reportId:report.id})\" title=\"{{report.error}}\">{{report.error || 'Unknown Exception'}}</a> <br/>\n" +
5992 " <span class=\"url\">{{ report.tags.view_name || report.url_path}}</td>\n" +
6107 " <span class=\"url\">{{ report.tags.view_name || report.url_path}}</td>\n" +
5993 " </tr>\n" +
6108 " </tr>\n" +
5994 "\n" +
6109 "\n" +
5995 " </tbody>\n" +
6110 " </tbody>\n" +
5996 " </table>\n" +
6111 " </table>\n" +
5997 " </div>\n" +
6112 " </div>\n" +
5998 "\n" +
6113 "\n" +
5999 "\n" +
6114 "\n" +
6000 " <div class=\"text-center\">\n" +
6115 " <div class=\"text-center\">\n" +
6001 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
6116 " <uib-pagination total-items=\"reports_list.itemCount\" items-per-page=\"reports_list.itemsPerPage\" ng-model=\"reports_list.searchParams.page\" max-size=\"10\"\n" +
6002 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
6117 " class=\"pagination pagination-sm\" boundary-links=\"true\" direction-links=\"false\"\n" +
6003 " ng-change=\"reports_list.paginationChange()\"\n" +
6118 " ng-change=\"reports_list.paginationChange()\"\n" +
6004 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
6119 " ng-show=\"!reports_list.is_loading\"></uib-pagination>\n" +
6005 " </div>\n" +
6120 " </div>\n" +
6006 "\n" +
6121 "\n" +
6007 "</div>\n"
6122 "</div>\n"
6008 );
6123 );
6009
6124
6010
6125
6011 $templateCache.put('templates/reports/parent_view.html',
6126 $templateCache.put('templates/reports/parent_view.html',
6012 "<div ui-view></div>"
6127 "<div ui-view></div>"
6013 );
6128 );
6014
6129
6015
6130
6016 $templateCache.put('templates/reports/small_report_group_list.html',
6131 $templateCache.put('templates/reports/small_report_group_list.html',
6017 "<table class=\"errors-small-list\">\n" +
6132 "<table class=\"errors-small-list\">\n" +
6018 " <tr ng-repeat=\"report_group in groups track by report_group.id\" class=\"animate-repeat\">\n" +
6133 " <tr ng-repeat=\"report_group in groups track by report_group.id\" class=\"animate-repeat\">\n" +
6019 " <td class=\"c1 occurences\"><span class=\"occurences\" data-uib-tooltip=\"occurences\">{{ report_group.occurences|numberToThousands }}</span></td>\n" +
6134 " <td class=\"c1 occurences\"><span class=\"occurences\" data-uib-tooltip=\"occurences\">{{ report_group.occurences|numberToThousands }}</span></td>\n" +
6020 " <td class=\"ellipsis c2 report_group\">\n" +
6135 " <td class=\"ellipsis c2 report_group\">\n" +
6021 " <a ui-sref=\"report.view_detail({groupId:report_group.id, reportId:report_group.last_report})\" title=\"{{report_group.error}}\" class=\"error-type\">\n" +
6136 " <a ui-sref=\"report.view_detail({groupId:report_group.id, reportId:report_group.last_report})\" title=\"{{report_group.error}}\" class=\"error-type\">\n" +
6022 " {{ report_group.error || \"Slow Report\"}}</a>\n" +
6137 " {{ report_group.error || \"Slow Report\"}}</a>\n" +
6023 " <br/>\n" +
6138 " <br/>\n" +
6024 " <span ng-show=\"report_group.summed_duration\" class=\"duration\" data-uib-tooltip=\"Average duration\">{{report_group.summed_duration/report_group.occurences|round:2}}s</span>\n" +
6139 " <span ng-show=\"report_group.summed_duration\" class=\"duration\" data-uib-tooltip=\"Average duration\">{{report_group.summed_duration/report_group.occurences|round:2}}s</span>\n" +
6025 " <span class=\"url\">{{ report_group.view_name || report_group.url_path}}</span>\n" +
6140 " <span class=\"url\">{{ report_group.view_name || report_group.url_path}}</span>\n" +
6026 " </td>\n" +
6141 " </td>\n" +
6027 " <td class=\"info\">\n" +
6142 " <td class=\"info\">\n" +
6028 " <strong ng-show=\"report_group.resource_id\">@{{applications[report_group.resource_id].resource_name}}</strong><br/>\n" +
6143 " <strong ng-show=\"report_group.resource_id\">@{{applications[report_group.resource_id].resource_name}}</strong><br/>\n" +
6029 " <span class=\"date\">{{report_group.last_timestamp | isoToRelativeTime}}</span>\n" +
6144 " <span class=\"date\">{{report_group.last_timestamp | isoToRelativeTime}}</span>\n" +
6030 " </td>\n" +
6145 " </td>\n" +
6031 " </tr>\n" +
6146 " </tr>\n" +
6032 "</table>\n"
6147 "</table>\n"
6033 );
6148 );
6034
6149
6035
6150
6036 $templateCache.put('templates/reports/small_report_list.html',
6151 $templateCache.put('templates/reports/small_report_list.html',
6037 "<table class=\"errors-small-list\">\n" +
6152 "<table class=\"errors-small-list\">\n" +
6038 " <tr ng-repeat=\"report in reports track by $index\" ng-show=\"reports.length > 0\" class=\"animate-repeat\">\n" +
6153 " <tr ng-repeat=\"report in reports track by $index\" ng-show=\"reports.length > 0\" class=\"animate-repeat\">\n" +
6039 " <td class=\"c1 occurences\"><span class=\"occurences\" data-uib-tooltip=\"occurences\">{{ report.group.occurences|numberToThousands }}</span></td>\n" +
6154 " <td class=\"c1 occurences\"><span class=\"occurences\" data-uib-tooltip=\"occurences\">{{ report.group.occurences|numberToThousands }}</span></td>\n" +
6040 " <td class=\"ellipsis c2 report\">\n" +
6155 " <td class=\"ellipsis c2 report\">\n" +
6041 " <a ui-sref=\"report.view_detail({groupId:report.group_id, reportId:report.report_id})\" title=\"{{report.error}}\" class=\"error-type\">\n" +
6156 " <a ui-sref=\"report.view_detail({groupId:report.group_id, reportId:report.report_id})\" title=\"{{report.error}}\" class=\"error-type\">\n" +
6042 " {{ report.error || \"Slow Report\"}}</a>\n" +
6157 " {{ report.error || \"Slow Report\"}}</a>\n" +
6043 " <br/>\n" +
6158 " <br/>\n" +
6044 " <span ng-show=\"report.group.summed_duration\" class=\"duration\" data-uib-tooltip=\"Average duration\">{{report.group.summed_duration/report.group.occurences|round:2}}s</span>\n" +
6159 " <span ng-show=\"report.group.summed_duration\" class=\"duration\" data-uib-tooltip=\"Average duration\">{{report.group.summed_duration/report.group.occurences|round:2}}s</span>\n" +
6045 " <span class=\"url\">{{ report.view_name || report.url_path}}</span>\n" +
6160 " <span class=\"url\">{{ report.view_name || report.url_path}}</span>\n" +
6046 " </td>\n" +
6161 " </td>\n" +
6047 " <td class=\"info\">\n" +
6162 " <td class=\"info\">\n" +
6048 " <strong ng-show=\"report.resource_id\">@{{applications[report.resource_id].resource_name}}</strong><br/>\n" +
6163 " <strong ng-show=\"report.resource_id\">@{{applications[report.resource_id].resource_name}}</strong><br/>\n" +
6049 " <span class=\"date\">{{report.last_timestamp | isoToRelativeTime}}</span>\n" +
6164 " <span class=\"date\">{{report.last_timestamp | isoToRelativeTime}}</span>\n" +
6050 " </td>\n" +
6165 " </td>\n" +
6051 " </tr>\n" +
6166 " </tr>\n" +
6052 "</table>\n"
6167 "</table>\n"
6053 );
6168 );
6054
6169
6055
6170
6056 $templateCache.put('templates/reports/view.html',
6171 $templateCache.put('templates/reports/view.html',
6057 "<script type=\"text/ng-template\" id=\"slow_call.html\">\n" +
6172 "<script type=\"text/ng-template\" id=\"slow_call.html\">\n" +
6058 " <table class=\"report-table\">\n" +
6173 " <table class=\"report-table\">\n" +
6059 " <tr>\n" +
6174 " <tr>\n" +
6060 " <td class=\"table-label\">Type</td>\n" +
6175 " <td class=\"table-label\">Type</td>\n" +
6061 " <td class=\"data\"><strong>{{call.type}}\n" +
6176 " <td class=\"data\"><strong>{{call.type}}\n" +
6062 " ({{call.subtype}})\n" +
6177 " ({{call.subtype}})\n" +
6063 " </strong></td>\n" +
6178 " </strong></td>\n" +
6064 " </tr>\n" +
6179 " </tr>\n" +
6065 " <tr>\n" +
6180 " <tr>\n" +
6066 " <td class=\"table-label\">Duration</td>\n" +
6181 " <td class=\"table-label\">Duration</td>\n" +
6067 " <td class=\"data\"><strong class=\"textColor_1\">{{call.duration}}</strong></td>\n" +
6182 " <td class=\"data\"><strong class=\"textColor_1\">{{call.duration}}</strong></td>\n" +
6068 " </tr>\n" +
6183 " </tr>\n" +
6069 " <tr>\n" +
6184 " <tr>\n" +
6070 " <td class=\"table-label\">Start Time</td>\n" +
6185 " <td class=\"table-label\">Start Time</td>\n" +
6071 " <td class=\"data\">{{call.timestamp}}</td>\n" +
6186 " <td class=\"data\">{{call.timestamp}}</td>\n" +
6072 " </tr>\n" +
6187 " </tr>\n" +
6073 " <tr>\n" +
6188 " <tr>\n" +
6074 " <td class=\"table-label\">Statement</td>\n" +
6189 " <td class=\"table-label\">Statement</td>\n" +
6075 " <td class=\"data\">\n" +
6190 " <td class=\"data\">\n" +
6076 " <pre class=\"word-wrap\">{{call.statement}}</pre>\n" +
6191 " <pre class=\"word-wrap\">{{call.statement}}</pre>\n" +
6077 " </td>\n" +
6192 " </td>\n" +
6078 " </tr>\n" +
6193 " </tr>\n" +
6079 " <tr ng-if=\"call.location\">\n" +
6194 " <tr ng-if=\"call.location\">\n" +
6080 " <td class=\"table-label\">Location</td>\n" +
6195 " <td class=\"table-label\">Location</td>\n" +
6081 " <td class=\"data\">{{call.location}}</td>\n" +
6196 " <td class=\"data\">{{call.location}}</td>\n" +
6082 " </tr>\n" +
6197 " </tr>\n" +
6083 " <tr>\n" +
6198 " <tr>\n" +
6084 " <td class=\"table-label\">Parameters</td>\n" +
6199 " <td class=\"table-label\">Parameters</td>\n" +
6085 " <td class=\"\">\n" +
6200 " <td class=\"\">\n" +
6086 " <div class=\"var-listing\" human-format vars=\"call.parameters\"></div>\n" +
6201 " <div class=\"var-listing\" human-format vars=\"call.parameters\"></div>\n" +
6087 " </td>\n" +
6202 " </td>\n" +
6088 " </tr>\n" +
6203 " </tr>\n" +
6089 " </table>\n" +
6204 " </table>\n" +
6090 "\n" +
6205 "\n" +
6091 " <div ng-if=\"call.children.length > 0\" class=\"subcalls p-l-8\">\n" +
6206 " <div ng-if=\"call.children.length > 0\" class=\"subcalls p-l-8\">\n" +
6092 "\n" +
6207 "\n" +
6093 " <p><strong>\n" +
6208 " <p><strong>\n" +
6094 " <small>Sub-calls</small>\n" +
6209 " <small>Sub-calls</small>\n" +
6095 " </strong></p>\n" +
6210 " </strong></p>\n" +
6096 "\n" +
6211 "\n" +
6097 " <div class=\"panel panel-default\">\n" +
6212 " <div class=\"panel panel-default\">\n" +
6098 " <div ng-repeat=\"call in call.children\" ng-include=\"'slow_call.html'\" class=\"panel-body\"/>\n" +
6213 " <div ng-repeat=\"call in call.children\" ng-include=\"'slow_call.html'\" class=\"panel-body\"/>\n" +
6099 " </div>\n" +
6214 " </div>\n" +
6100 " </div>\n" +
6215 " </div>\n" +
6101 " </div>\n" +
6216 " </div>\n" +
6102 "\n" +
6217 "\n" +
6103 "</script>\n" +
6218 "</script>\n" +
6104 "\n" +
6219 "\n" +
6105 "<script type=\"text/ng-template\" id=\"AssignReportCtrl.html\">\n" +
6220 "<script type=\"text/ng-template\" id=\"AssignReportCtrl.html\">\n" +
6106 "\n" +
6221 "\n" +
6107 " <div class=\"modal-header\">\n" +
6222 " <div class=\"modal-header\">\n" +
6108 " <h3>Assign users to report</h3>\n" +
6223 " <h3>Assign users to report</h3>\n" +
6109 " </div>\n" +
6224 " </div>\n" +
6110 " <div class=\"modal-body\">\n" +
6225 " <div class=\"modal-body\">\n" +
6111 "\n" +
6226 "\n" +
6112 " <ng-include src=\"'templates/loader.html'\" ng-if=\"ctrl.loading\"></ng-include>\n" +
6227 " <ng-include src=\"'templates/loader.html'\" ng-if=\"ctrl.loading\"></ng-include>\n" +
6113 "\n" +
6228 "\n" +
6114 " <div class=\"row\" ng-if=\"!ctrl.loading\">\n" +
6229 " <div class=\"row\" ng-if=\"!ctrl.loading\">\n" +
6115 " <div class=\"col-sm-6\">\n" +
6230 " <div class=\"col-sm-6\">\n" +
6116 " <strong>Unassigned</strong>\n" +
6231 " <strong>Unassigned</strong>\n" +
6117 "\n" +
6232 "\n" +
6118 " <div class=\"user-assignment\" ng-repeat=\"user in ctrl.unAssignedUsers\"\n" +
6233 " <div class=\"user-assignment\" ng-repeat=\"user in ctrl.unAssignedUsers\"\n" +
6119 " ng-click=\"ctrl.reassignUser(user)\">\n" +
6234 " ng-click=\"ctrl.reassignUser(user)\">\n" +
6120 " <img ng-src=\"{{user.gravatar_url}}\"/>\n" +
6235 " <img ng-src=\"{{user.gravatar_url}}\"/>\n" +
6121 " <strong>{{user.user_name}}</strong><br/>\n" +
6236 " <strong>{{user.user_name}}</strong><br/>\n" +
6122 " {{user.name}}\n" +
6237 " {{user.name}}\n" +
6123 " <div class=\"clear\"></div>\n" +
6238 " <div class=\"clear\"></div>\n" +
6124 " </div>\n" +
6239 " </div>\n" +
6125 " </div>\n" +
6240 " </div>\n" +
6126 "\n" +
6241 "\n" +
6127 " <div class=\"col-sm-6\">\n" +
6242 " <div class=\"col-sm-6\">\n" +
6128 " <strong>Assigned</strong>\n" +
6243 " <strong>Assigned</strong>\n" +
6129 "\n" +
6244 "\n" +
6130 " <div class=\"user-assignment\" ng-repeat=\"user in ctrl.assignedUsers\" ng-click=\"ctrl.reassignUser(user)\">\n" +
6245 " <div class=\"user-assignment\" ng-repeat=\"user in ctrl.assignedUsers\" ng-click=\"ctrl.reassignUser(user)\">\n" +
6131 " <img ng-src=\"{{user.gravatar_url}}\"/>\n" +
6246 " <img ng-src=\"{{user.gravatar_url}}\"/>\n" +
6132 " {{user.user_name}}<br/>\n" +
6247 " {{user.user_name}}<br/>\n" +
6133 " {{user.name}}\n" +
6248 " {{user.name}}\n" +
6134 " <div class=\"clear\"></div>\n" +
6249 " <div class=\"clear\"></div>\n" +
6135 " </div>\n" +
6250 " </div>\n" +
6136 " </div>\n" +
6251 " </div>\n" +
6137 " </div>\n" +
6252 " </div>\n" +
6138 " </div>\n" +
6253 " </div>\n" +
6139 " <div class=\"modal-footer\">\n" +
6254 " <div class=\"modal-footer\">\n" +
6140 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">OK</button>\n" +
6255 " <button class=\"btn btn-primary\" ng-click=\"ctrl.ok()\">OK</button>\n" +
6141 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
6256 " <button class=\"btn btn-warning\" ng-click=\"ctrl.cancel()\">Cancel</button>\n" +
6142 " </div>\n" +
6257 " </div>\n" +
6143 "</script>\n" +
6258 "</script>\n" +
6144 "\n" +
6259 "\n" +
6145 "<ng-include src=\"'templates/loader.html'\" ng-if=\"report.is_loading.report\"></ng-include>\n" +
6260 "<ng-include src=\"'templates/loader.html'\" ng-if=\"report.is_loading.report\"></ng-include>\n" +
6146 "\n" +
6261 "\n" +
6147 "<div ng-if=\"!report.is_loading.report && report.report === null\">\n" +
6262 "<div ng-if=\"!report.is_loading.report && report.report === null\">\n" +
6148 " <strong>OOPS something went wrong :(</strong>\n" +
6263 " <strong>OOPS something went wrong :(</strong>\n" +
6149 "</div>\n" +
6264 "</div>\n" +
6150 "\n" +
6265 "\n" +
6151 "<div ng-if=\"report.report !== null && !report.is_loading.report\">\n" +
6266 "<div ng-if=\"report.report !== null && !report.is_loading.report\">\n" +
6152 "\n" +
6267 "\n" +
6153 " <div ng-if=\"stateHolder.AeUser.id\" class=\"row\">\n" +
6268 " <div ng-if=\"report.stateHolder.AeUser.id\" class=\"row\">\n" +
6154 " <div class=\"col-lg-12\">\n" +
6269 " <div class=\"col-lg-12\">\n" +
6155 " <a onclick=\"window.history.back()\" class=\"btn btn-default\" ng-if=\"report.window.history.length > 2\"><span class=\"fa fa-arrow-circle-o-left\"></span>\n" +
6270 " <a onclick=\"window.history.back()\" class=\"btn btn-default\" ng-if=\"report.window.history.length > 2\"><span class=\"fa fa-arrow-circle-o-left\"></span>\n" +
6156 " Go back</a>\n" +
6271 " Go back</a>\n" +
6157 " <a class=\"btn btn-default\" ng-click=\"report.assignUsersModal()\" ng-if=\"report.reportType == 'report'\"><span\n" +
6272 " <a class=\"btn btn-default\" ng-click=\"report.assignUsersModal()\" ng-if=\"report.reportType == 'report'\"><span\n" +
6158 " class=\"fa fa-flag\"></span> Assign report\n" +
6273 " class=\"fa fa-flag\"></span> Assign report\n" +
6159 " to user</a>\n" +
6274 " to user</a>\n" +
6160 "\n" +
6275 "\n" +
6161 " <a class=\"btn {{ report.report.group.fixed ? 'btn-success' : 'btn-default'}}\" ng-click=\"report.markFixed()\"\n" +
6276 " <a class=\"btn {{ report.report.group.fixed ? 'btn-success' : 'btn-default'}}\" ng-click=\"report.markFixed()\"\n" +
6162 " ng-if=\"report.reportType == 'report'\">\n" +
6277 " ng-if=\"report.reportType == 'report'\">\n" +
6163 " <span class=\"fa fa-check\"></span> Mark fixed</a>\n" +
6278 " <span class=\"fa fa-check\"></span> Mark fixed</a>\n" +
6164 "\n" +
6279 "\n" +
6165 " <span class=\"dropdown\" ng-if=\"report.report.application.integrations.length\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6280 " <span class=\"dropdown\" ng-if=\"report.report.application.integrations.length\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6166 " <a class=\"dropdown-toggle btn btn-default\" data-uib-dropdown-toggle>\n" +
6281 " <a class=\"dropdown-toggle btn btn-default\" data-uib-dropdown-toggle>\n" +
6167 " <span class=\"fa fa-send\"></span> Integrations\n" +
6282 " <span class=\"fa fa-send\"></span> Integrations\n" +
6168 " </a>\n" +
6283 " </a>\n" +
6169 " <ul class=\"dropdown-menu\">\n" +
6284 " <ul class=\"dropdown-menu\">\n" +
6170 " <li ng-repeat=\"choice in report.report.application.integrations\">\n" +
6285 " <li ng-repeat=\"choice in report.report.application.integrations\">\n" +
6171 " <a ng-click=\"report.runIntegration(choice.name)\">{{choice.action}}</a>\n" +
6286 " <a ng-click=\"report.runIntegration(choice.name)\">{{choice.action}}</a>\n" +
6172 " </li>\n" +
6287 " </li>\n" +
6173 " </ul>\n" +
6288 " </ul>\n" +
6174 " </span>\n" +
6289 " </span>\n" +
6175 "\n" +
6290 "\n" +
6176 " <a class=\"btn btn-default\" ng-click=\"report.markPublic()\">Make {{report.group.public ? 'private' : 'public'}}</a>\n" +
6291 " <a class=\"btn btn-default\" ng-click=\"report.markPublic()\">Make {{report.group.public ? 'private' : 'public'}}</a>\n" +
6177 "\n" +
6292 "\n" +
6178 "<span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6293 "<span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6179 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Delete</a>\n" +
6294 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Delete</a>\n" +
6180 " <ul class=\"dropdown-menu\">\n" +
6295 " <ul class=\"dropdown-menu\">\n" +
6181 " <li><a>No</a></li>\n" +
6296 " <li><a>No</a></li>\n" +
6182 " <li><a ng-click=\"report.delete()\">Yes</a></li>\n" +
6297 " <li><a ng-click=\"report.delete()\">Yes</a></li>\n" +
6183 " </ul>\n" +
6298 " </ul>\n" +
6184 "</span>\n" +
6299 "</span>\n" +
6185 " </div>\n" +
6300 " </div>\n" +
6186 " </div>\n" +
6301 " </div>\n" +
6187 "\n" +
6302 "\n" +
6188 " <div class=\"row\">\n" +
6303 " <div class=\"row\">\n" +
6189 " <div class=\"col-lg-4\">\n" +
6304 " <div class=\"col-lg-4\">\n" +
6190 "\n" +
6305 "\n" +
6191 " <div class=\"panel panel-default m-t-1\">\n" +
6306 " <div class=\"panel panel-default m-t-1\">\n" +
6192 " <div class=\"panel-body\">\n" +
6307 " <div class=\"panel-body\">\n" +
6193 "\n" +
6308 "\n" +
6194 " <h3 class=\"m-t-0\">Report Information</h3>\n" +
6309 " <h3 class=\"m-t-0\">Report Information</h3>\n" +
6195 "\n" +
6310 "\n" +
6196 " <table class=\"report-table with-ellipsis\">\n" +
6311 " <table class=\"report-table with-ellipsis\">\n" +
6197 " <tr>\n" +
6312 " <tr>\n" +
6198 " <td class=\"table-label\">Occurences</td>\n" +
6313 " <td class=\"table-label\">Occurences</td>\n" +
6199 " <td class=\"data\">{{report.report.group.occurences}}</td>\n" +
6314 " <td class=\"data\">{{report.report.group.occurences}}</td>\n" +
6200 " </tr>\n" +
6315 " </tr>\n" +
6201 " <tr ng-if=\"report.report.http_status\">\n" +
6316 " <tr ng-if=\"report.report.http_status\">\n" +
6202 " <td class=\"table-label\">HTTP status</td>\n" +
6317 " <td class=\"table-label\">HTTP status</td>\n" +
6203 " <td class=\"data\">{{report.report.http_status}}</td>\n" +
6318 " <td class=\"data\">{{report.report.http_status}}</td>\n" +
6204 " </tr>\n" +
6319 " </tr>\n" +
6205 " <tr ng-if=\"report.report.group.priority\">\n" +
6320 " <tr ng-if=\"report.report.group.priority\">\n" +
6206 " <td class=\"table-label\">Priority</td>\n" +
6321 " <td class=\"table-label\">Priority</td>\n" +
6207 " <td class=\"data\">{{report.report.group.priority}}</td>\n" +
6322 " <td class=\"data\">{{report.report.group.priority}}</td>\n" +
6208 " </tr>\n" +
6323 " </tr>\n" +
6209 " <tr ng-if=\"report.report.group.public\">\n" +
6324 " <tr ng-if=\"report.report.group.public\">\n" +
6210 " <td class=\"table-label\">Public URL</td>\n" +
6325 " <td class=\"table-label\">Public URL</td>\n" +
6211 " <td class=\"data\">\n" +
6326 " <td class=\"data\">\n" +
6212 " <form>\n" +
6327 " <form>\n" +
6213 " <textarea class=\"TextAreaField form-control\" id=\"public-url\" onclick=\"this.select()\">{{$state.href($state.current.name, $state.params, {absolute: true})}}</textarea>\n" +
6328 " <textarea class=\"TextAreaField form-control\" id=\"public-url\" onclick=\"this.select()\">{{report.$state.href(report.$state.current.name, report.$state.params, {absolute: true})}}</textarea>\n" +
6214 " </form>\n" +
6329 " </form>\n" +
6215 " </td>\n" +
6330 " </td>\n" +
6216 " </tr>\n" +
6331 " </tr>\n" +
6217 " <tr data-uib-tooltip=\"{{report.report.url}}\">\n" +
6332 " <tr data-uib-tooltip=\"{{report.report.url}}\">\n" +
6218 " <td class=\"table-label\">URL</td>\n" +
6333 " <td class=\"table-label\">URL</td>\n" +
6219 " <td class=\"data ellipsis\"><a href=\"{{report.report.url}}\">{{report.report.url}}</a></td>\n" +
6334 " <td class=\"data ellipsis\"><a href=\"{{report.report.url}}\">{{report.report.url}}</a></td>\n" +
6220 " </tr>\n" +
6335 " </tr>\n" +
6221 "\n" +
6336 "\n" +
6222 " <tr ng-if=\"report.report.ip\">\n" +
6337 " <tr ng-if=\"report.report.ip\">\n" +
6223 " <td class=\"table-label\">Remote IP</td>\n" +
6338 " <td class=\"table-label\">Remote IP</td>\n" +
6224 " <td class=\"data\">{{report.report.ip}}</td>\n" +
6339 " <td class=\"data\">{{report.report.ip}}</td>\n" +
6225 " </tr>\n" +
6340 " </tr>\n" +
6226 " <tr ng-if=\"report.report.user_agent\" data-uib-tooltip=\"{{report.report.user_agent}}\">\n" +
6341 " <tr ng-if=\"report.report.user_agent\" data-uib-tooltip=\"{{report.report.user_agent}}\">\n" +
6227 " <td class=\"table-label\">User Agent</td>\n" +
6342 " <td class=\"table-label\">User Agent</td>\n" +
6228 " <td class=\"data ellipsis\">{{report.report.user_agent}}</td>\n" +
6343 " <td class=\"data ellipsis\">{{report.report.user_agent}}</td>\n" +
6229 " </tr>\n" +
6344 " </tr>\n" +
6230 " <tr ng-if=\"report.report.message\">\n" +
6345 " <tr ng-if=\"report.report.message\">\n" +
6231 " <td class=\"table-label\">Message</td>\n" +
6346 " <td class=\"table-label\">Message</td>\n" +
6232 " <td class=\"data\">{{report.report.message}}</td>\n" +
6347 " <td class=\"data\">{{report.report.message}}</td>\n" +
6233 " </tr>\n" +
6348 " </tr>\n" +
6234 " <tr ng-if=\"report.report.duration > 0\">\n" +
6349 " <tr ng-if=\"report.report.duration > 0\">\n" +
6235 " <td class=\"table-label\">Duration</td>\n" +
6350 " <td class=\"table-label\">Duration</td>\n" +
6236 " <td class=\"data\">\n" +
6351 " <td class=\"data\">\n" +
6237 " <span>{{report.report.duration}}s</span>\n" +
6352 " <span>{{report.report.duration}}s</span>\n" +
6238 " </td>\n" +
6353 " </td>\n" +
6239 " </tr>\n" +
6354 " </tr>\n" +
6240 " <tr>\n" +
6355 " <tr>\n" +
6241 " <td class=\"table-label\">First occured</td>\n" +
6356 " <td class=\"table-label\">First occured</td>\n" +
6242 " <td class=\"data\">\n" +
6357 " <td class=\"data\">\n" +
6243 " <span uib-tooltip=\"{{report.report.group.first_timestamp}}\"><iso-to-relative-time\n" +
6358 " <span uib-tooltip=\"{{report.report.group.first_timestamp}}\"><iso-to-relative-time\n" +
6244 " time=\"{{report.report.group.first_timestamp}}\"/></span>\n" +
6359 " time=\"{{report.report.group.first_timestamp}}\"/></span>\n" +
6245 " </td>\n" +
6360 " </td>\n" +
6246 " </tr>\n" +
6361 " </tr>\n" +
6247 " <tr>\n" +
6362 " <tr>\n" +
6248 " <td class=\"table-label\">Last occured</td>\n" +
6363 " <td class=\"table-label\">Last occured</td>\n" +
6249 " <td class=\"data\">\n" +
6364 " <td class=\"data\">\n" +
6250 " <span uib-tooltip=\"{{report.report.group.last_timestamp}}\"><iso-to-relative-time\n" +
6365 " <span uib-tooltip=\"{{report.report.group.last_timestamp}}\"><iso-to-relative-time\n" +
6251 " time=\"{{report.report.group.last_timestamp}}\"/></span>\n" +
6366 " time=\"{{report.report.group.last_timestamp}}\"/></span>\n" +
6252 " </td>\n" +
6367 " </td>\n" +
6253 " </tr>\n" +
6368 " </tr>\n" +
6254 " </table>\n" +
6369 " </table>\n" +
6255 "\n" +
6370 "\n" +
6256 " <div ng-if=\"report.requestStats\">\n" +
6371 " <div ng-if=\"report.requestStats\">\n" +
6257 " <h3>Performance stats</h3>\n" +
6372 " <h3>Performance stats</h3>\n" +
6258 "\n" +
6373 "\n" +
6259 " <div class=\"perf_stats\">\n" +
6374 " <div class=\"perf_stats\">\n" +
6260 " <span class=\"stat\" ng-repeat=\"stat in report.requestStats\"\n" +
6375 " <span class=\"stat\" ng-repeat=\"stat in report.requestStats\"\n" +
6261 " ng-if=\"stat.calls > 0 || stat.value > 0\"><strong>\n" +
6376 " ng-if=\"stat.calls > 0 || stat.value > 0\"><strong>\n" +
6262 " <span class=\"{{stat.name}} bar\" style=\"width:10px\"></span> {{stat.calls}}\n" +
6377 " <span class=\"{{stat.name}} bar\" style=\"width:10px\"></span> {{stat.calls}}\n" +
6263 " <span ng-if=\"stat.name!='main'\"><small>{{stat.name}} calls</small></span>\n" +
6378 " <span ng-if=\"stat.name!='main'\"><small>{{stat.name}} calls</small></span>\n" +
6264 " <span ng-if=\"stat.name=='main'\">\n" +
6379 " <span ng-if=\"stat.name=='main'\">\n" +
6265 " <span class=\"fa fa-question-circle\"\n" +
6380 " <span class=\"fa fa-question-circle\"\n" +
6266 " data-uib-tooltip=\"Execution time that didnt get assigned to other layers\"></span> Other</span>\n" +
6381 " data-uib-tooltip=\"Execution time that didnt get assigned to other layers\"></span> Other</span>\n" +
6267 " </strong>\n" +
6382 " </strong>\n" +
6268 " </span>\n" +
6383 " </span>\n" +
6269 "\n" +
6384 "\n" +
6270 " <div style=\"width: 100%; overflow:hidden\">\n" +
6385 " <div style=\"width: 100%; overflow:hidden\">\n" +
6271 " <div class=\"{{stat.name}} bar\" style=\"width:{{stat.percent}}%; height: 25px\"\n" +
6386 " <div class=\"{{stat.name}} bar\" style=\"width:{{stat.percent}}%; height: 25px\"\n" +
6272 " ng-repeat=\"stat in report.requestStats\"\n" +
6387 " ng-repeat=\"stat in report.requestStats\"\n" +
6273 " data-uib-tooltip=\"{{stat.value}}s - Cumulative time spent in this request on all {{ stat.name }} calls\"></div>\n" +
6388 " data-uib-tooltip=\"{{stat.value}}s - Cumulative time spent in this request on all {{ stat.name }} calls\"></div>\n" +
6274 " <div class=\"row\">\n" +
6389 " <div class=\"row\">\n" +
6275 " <div class=\"col-xs-6 text-left\">\n" +
6390 " <div class=\"col-xs-6 text-left\">\n" +
6276 " <small>0s</small>\n" +
6391 " <small>0s</small>\n" +
6277 " </div>\n" +
6392 " </div>\n" +
6278 " <div class=\"col-xs-6 text-right\">\n" +
6393 " <div class=\"col-xs-6 text-right\">\n" +
6279 " <small>{{report.report.duration.toFixed(3)}}s</small>\n" +
6394 " <small>{{report.report.duration.toFixed(3)}}s</small>\n" +
6280 " </div>\n" +
6395 " </div>\n" +
6281 " </div>\n" +
6396 " </div>\n" +
6282 " </div>\n" +
6397 " </div>\n" +
6283 " </div>\n" +
6398 " </div>\n" +
6284 " </div>\n" +
6399 " </div>\n" +
6285 "\n" +
6400 "\n" +
6286 " <h3>Tags</h3>\n" +
6401 " <h3>Tags</h3>\n" +
6287 "\n" +
6402 "\n" +
6288 " <table class=\"report-table with-tags\">\n" +
6403 " <table class=\"report-table with-tags\">\n" +
6289 " <tr ng-repeat=\"(tag, value) in report.report.tags\">\n" +
6404 " <tr ng-repeat=\"(tag, value) in report.report.tags\">\n" +
6290 " <td class=\"table-label\" ng-switch=\"tag\"><!--\n" +
6405 " <td class=\"table-label\" ng-switch=\"tag\"><!--\n" +
6291 " --><span ng-switch-when=\"user_name\">Username/UID</span><!--\n" +
6406 " --><span ng-switch-when=\"user_name\">Username/UID</span><!--\n" +
6292 " --><span ng-switch-when=\"view_name\">View Name</span><!--\n" +
6407 " --><span ng-switch-when=\"view_name\">View Name</span><!--\n" +
6293 " --><span ng-switch-when=\"server_name\">Server Name</span><!--\n" +
6408 " --><span ng-switch-when=\"server_name\">Server Name</span><!--\n" +
6294 " --><span ng-switch-default>{{ tag }}</span>\n" +
6409 " --><span ng-switch-default>{{ tag }}</span>\n" +
6295 " </td>\n" +
6410 " </td>\n" +
6296 " <td class=\"data\"><a ng-click=\"report.searchTag(tag, value)\">{{ value }}</td>\n" +
6411 " <td class=\"data\"><a ng-click=\"report.searchTag(tag, value)\">{{ value }}</td>\n" +
6297 " </tr>\n" +
6412 " </tr>\n" +
6298 " </table>\n" +
6413 " </table>\n" +
6299 "\n" +
6414 "\n" +
6300 " </div>\n" +
6415 " </div>\n" +
6301 " </div>\n" +
6416 " </div>\n" +
6302 "\n" +
6417 "\n" +
6303 "\n" +
6418 "\n" +
6304 " </div>\n" +
6419 " </div>\n" +
6305 " <div class=\"col-lg-8\">\n" +
6420 " <div class=\"col-lg-8\">\n" +
6306 " <div class=\"frames\">\n" +
6421 " <div class=\"frames\">\n" +
6307 " <p class=\"text-center\">Report history</p>\n" +
6422 " <p class=\"text-center\">Report history</p>\n" +
6308 "\n" +
6423 "\n" +
6309 " <div class=\"panel\" ng-if=\"!report.is_loading.history\">\n" +
6424 " <div class=\"panel\" ng-if=\"!report.is_loading.history\">\n" +
6310 " <div class=\"panel-body\">\n" +
6425 " <div class=\"panel-body\">\n" +
6311 " <c3chart data-domid=\"report_history_chart\" data-data=\"report.reportHistoryData\" data-config=\"report.reportHistoryConfig\">\n" +
6426 " <c3chart data-domid=\"report_history_chart\" data-data=\"report.reportHistoryData\" data-config=\"report.reportHistoryConfig\">\n" +
6312 " </c3chart>\n" +
6427 " </c3chart>\n" +
6313 " </div>\n" +
6428 " </div>\n" +
6314 " </div>\n" +
6429 " </div>\n" +
6315 "\n" +
6430 "\n" +
6316 " <div class=\"row m-b-1\">\n" +
6431 " <div class=\"row m-b-1\">\n" +
6317 " <div class=\"col-sm-2 text-left\">\n" +
6432 " <div class=\"col-sm-2 text-left\">\n" +
6318 " <a class=\"switch_detail btn btn-sm btn-default {{report.report.group.previous_report ? '' : 'disabled'}}\"\n" +
6433 " <a class=\"switch_detail btn btn-sm btn-default {{report.report.group.previous_report ? '' : 'disabled'}}\"\n" +
6319 " ng-click=\"report.previousDetail()\">\n" +
6434 " ng-click=\"report.previousDetail()\">\n" +
6320 " <span class=\"fa fa-arrow-left\"></span>\n" +
6435 " <span class=\"fa fa-arrow-left\"></span>\n" +
6321 " Prev. detail</a>\n" +
6436 " Prev. detail</a>\n" +
6322 "\n" +
6437 "\n" +
6323 " </div>\n" +
6438 " </div>\n" +
6324 " <div class=\"col-sm-8 text-center\">\n" +
6439 " <div class=\"col-sm-8 text-center\">\n" +
6325 " <small>\n" +
6440 " <small>\n" +
6326 " <span uib-tooltip=\"{{report.report.start_time|isoToRelativeTime}}\" class=\"m-r-1\">\n" +
6441 " <span uib-tooltip=\"{{report.report.start_time|isoToRelativeTime}}\" class=\"m-r-1\">\n" +
6327 " {{report.report.start_time.replace('T', ' ')}} UTC</span>\n" +
6442 " {{report.report.start_time.replace('T', ' ')}} UTC</span>\n" +
6328 " <span class=\"text-muted\">ID: {{report.report.request_id}}</span>\n" +
6443 " <span class=\"text-muted\">ID: {{report.report.request_id}}</span>\n" +
6329 " </small>\n" +
6444 " </small>\n" +
6330 " </div>\n" +
6445 " </div>\n" +
6331 " <div class=\"col-sm-2 text-right\">\n" +
6446 " <div class=\"col-sm-2 text-right\">\n" +
6332 " <a class=\"switch_detail btn btn-sm btn-default {{report.report.group.next_report ? '' : 'disabled'}}\"\n" +
6447 " <a class=\"switch_detail btn btn-sm btn-default {{report.report.group.next_report ? '' : 'disabled'}}\"\n" +
6333 " ng-click=\"report.nextDetail()\">\n" +
6448 " ng-click=\"report.nextDetail()\">\n" +
6334 " Next detail <span class=\"fa fa-arrow-right\"></span></a>\n" +
6449 " Next detail <span class=\"fa fa-arrow-right\"></span></a>\n" +
6335 " </div>\n" +
6450 " </div>\n" +
6336 " </div>\n" +
6451 " </div>\n" +
6337 "\n" +
6452 "\n" +
6338 " <h3 class=\"word-wrap\">{{report.report.error}}</h3>\n" +
6453 " <h3 class=\"word-wrap\">{{report.report.error}}</h3>\n" +
6339 "\n" +
6454 "\n" +
6340 " <div ng-if=\"report.report.traceback\">\n" +
6455 " <div ng-if=\"report.report.traceback\">\n" +
6341 "\n" +
6456 "\n" +
6342 " <h3><strong>Traceback</strong></h3>\n" +
6457 " <h3><strong>Traceback</strong></h3>\n" +
6343 "\n" +
6458 "\n" +
6344 " <div class=\"btn-group\">\n" +
6459 " <div class=\"btn-group\">\n" +
6345 " <a ng-if=\"report.traceback.length-10 > 0 \" ng-click=\"report.showLong = !report.showLong\"\n" +
6460 " <a ng-if=\"report.traceback.length-10 > 0 \" ng-click=\"report.showLong = !report.showLong\"\n" +
6346 " class=\"btn btn-default {{report.showLong ? 'active' : ''}}\">\n" +
6461 " class=\"btn btn-default {{report.showLong ? 'active' : ''}}\">\n" +
6347 " <span class=\"fa fa-align-left\"></span>\n" +
6462 " <span class=\"fa fa-align-left\"></span>\n" +
6348 " <small>Show {{report.traceback.length-10}} remaining frames</small>\n" +
6463 " <small>Show {{report.traceback.length-10}} remaining frames</small>\n" +
6349 " </a>\n" +
6464 " </a>\n" +
6350 "\n" +
6465 "\n" +
6351 " <a class=\"btn btn-default {{report.showRaw ? 'active' : ''}}\" ng-click=\"report.showRaw = !report.showRaw\">\n" +
6466 " <a class=\"btn btn-default {{report.showRaw ? 'active' : ''}}\" ng-click=\"report.showRaw = !report.showRaw\">\n" +
6352 " <span class=\"fa fa-list\"></span>\n" +
6467 " <span class=\"fa fa-list\"></span>\n" +
6353 " <small>Raw version</small>\n" +
6468 " <small>Raw version</small>\n" +
6354 " </a>\n" +
6469 " </a>\n" +
6355 " </div>\n" +
6470 " </div>\n" +
6356 "\n" +
6471 "\n" +
6357 " <div ng-if=\"report.showRaw\" class=\"m-t-1\">\n" +
6472 " <div ng-if=\"report.showRaw\" class=\"m-t-1\">\n" +
6358 " <pre>{{report.rawTraceback}}</pre>\n" +
6473 " <pre>{{report.rawTraceback}}</pre>\n" +
6359 " </div>\n" +
6474 " </div>\n" +
6360 " <div ng-if=\"!report.showRaw\" class=\"m-t-1\">\n" +
6475 " <div ng-if=\"!report.showRaw\" class=\"m-t-1\">\n" +
6361 "\n" +
6476 "\n" +
6362 " <div ng-repeat=\"frame in report.traceback\" class=\"frame {{$odd ? 'odd' : 'even'}}\"\n" +
6477 " <div ng-repeat=\"frame in report.traceback\" class=\"frame {{$odd ? 'odd' : 'even'}}\"\n" +
6363 " ng-if=\"$index >= report.traceback.length-10 || report.traceback.length <= 10 || report.showLong\">\n" +
6478 " ng-if=\"$index >= report.traceback.length-10 || report.traceback.length <= 10 || report.showLong\">\n" +
6364 " <div class=\"frameline\" ng-if=\"frame.line\">\n" +
6479 " <div class=\"frameline\" ng-if=\"frame.line\">\n" +
6365 " <a class=\"inspect_vars\" ng-click=\"frame.showVars = !frame.showVars\" ng-if=\"frame.vars\">\n" +
6480 " <a class=\"inspect_vars\" ng-click=\"frame.showVars = !frame.showVars\" ng-if=\"frame.vars\">\n" +
6366 " <span class=\"fa fa-search dim btn btn-default\"\n" +
6481 " <span class=\"fa fa-search dim btn btn-default\"\n" +
6367 " uib-tooltip=\"Show local vars\"> </span>\n" +
6482 " uib-tooltip=\"Show local vars\"> </span>\n" +
6368 " </a>\n" +
6483 " </a>\n" +
6369 "\n" +
6484 "\n" +
6370 " <span class=\"no-vars\" ng-if=\"frame.vars.length == 0\"></span>\n" +
6485 " <span class=\"no-vars\" ng-if=\"frame.vars.length == 0\"></span>\n" +
6371 "\n" +
6486 "\n" +
6372 " <span ng-if=\"frame.file\">\n" +
6487 " <span ng-if=\"frame.file\">\n" +
6373 " <span class=\"mono\">File</span> <span class=\"file mono\">{{frame.file || 'Unknown file'}}</span>,\n" +
6488 " <span class=\"mono\">File</span> <span class=\"file mono\">{{frame.file || 'Unknown file'}}</span>,\n" +
6374 " </span>\n" +
6489 " </span>\n" +
6375 " <span ng-if=\"frame.module && !frame.file\">\n" +
6490 " <span ng-if=\"frame.module && !frame.file\">\n" +
6376 " <span class=\"mono\">Module</span> <span class=\"file mono\">{{frame.module || 'Unknown module'}}</span>,\n" +
6491 " <span class=\"mono\">Module</span> <span class=\"file mono\">{{frame.module || 'Unknown module'}}</span>,\n" +
6377 " </span>\n" +
6492 " </span>\n" +
6378 " <span class=\"mono\">line</span> <span class=\"line mono\">{{frame.line || 'Unknown line'}}</span>\n" +
6493 " <span class=\"mono\">line</span> <span class=\"line mono\">{{frame.line || 'Unknown line'}}</span>\n" +
6379 "\n" +
6494 "\n" +
6380 " <span ng-if=\"frame.fn\"><span class=\"mono\">in</span> <strong\n" +
6495 " <span ng-if=\"frame.fn\"><span class=\"mono\">in</span> <strong\n" +
6381 " class=\"fn mono\">{{frame.fn || 'Unknown function'}}</strong></span>\n" +
6496 " class=\"fn mono\">{{frame.fn || 'Unknown function'}}</strong></span>\n" +
6382 "\n" +
6497 "\n" +
6383 " </div>\n" +
6498 " </div>\n" +
6384 " <div class=\"cline mono\" ng-if=\"frame.cline\">{{frame.cline || 'Unknown context'}}</div>\n" +
6499 " <div class=\"cline mono\" ng-if=\"frame.cline\">{{frame.cline || 'Unknown context'}}</div>\n" +
6385 "\n" +
6500 "\n" +
6386 " <div class=\"vars\" ng-if=\"frame.showVars\">\n" +
6501 " <div class=\"vars\" ng-if=\"frame.showVars\">\n" +
6387 " <table class=\"var-listing small\">\n" +
6502 " <table class=\"var-listing small\">\n" +
6388 " <tr ng-repeat=\"fvar in frame.vars track by $index\" class=\"frame {{$odd ? 'odd' : 'even'}}\">\n" +
6503 " <tr ng-repeat=\"fvar in frame.vars track by $index\" class=\"frame {{$odd ? 'odd' : 'even'}}\">\n" +
6389 " <td class=\"var-label\">{{ fvar[0] }}</td>\n" +
6504 " <td class=\"var-label\">{{ fvar[0] }}</td>\n" +
6390 " <td>\n" +
6505 " <td>\n" +
6391 " <span human-format vars=\"fvar[1]\"></span>\n" +
6506 " <span human-format vars=\"fvar[1]\"></span>\n" +
6392 " </td>\n" +
6507 " </td>\n" +
6393 " </tr>\n" +
6508 " </tr>\n" +
6394 " </table>\n" +
6509 " </table>\n" +
6395 "\n" +
6510 "\n" +
6396 " </div>\n" +
6511 " </div>\n" +
6397 " </div>\n" +
6512 " </div>\n" +
6398 " </div>\n" +
6513 " </div>\n" +
6399 "\n" +
6514 "\n" +
6400 "\n" +
6515 "\n" +
6401 " </div>\n" +
6516 " </div>\n" +
6402 "\n" +
6517 "\n" +
6403 "\n" +
6518 "\n" +
6404 " <uib-tabset>\n" +
6519 " <uib-tabset>\n" +
6405 " <uib-tab select=\"report.selectedTab('slow_calls')\" active=\"report.tabs.slow_calls\">\n" +
6520 " <uib-tab select=\"report.selectedTab('slow_calls')\" active=\"report.tabs.slow_calls\">\n" +
6406 " <uib-tab-heading>\n" +
6521 " <uib-tab-heading>\n" +
6407 " Slow Calls\n" +
6522 " Slow Calls\n" +
6408 " </uib-tab-heading>\n" +
6523 " </uib-tab-heading>\n" +
6409 "\n" +
6524 "\n" +
6410 " <h3><strong>Slow Calls</strong></h3>\n" +
6525 " <h3><strong>Slow Calls</strong></h3>\n" +
6411 "\n" +
6526 "\n" +
6412 " <div ng-if=\"report.report.slow_calls.length > 0\">\n" +
6527 " <div ng-if=\"report.report.slow_calls.length > 0\">\n" +
6413 " <div ng-repeat=\"call in report.report.slow_calls\" ng-include=\"'slow_call.html'\"></div>\n" +
6528 " <div ng-repeat=\"call in report.report.slow_calls\" ng-include=\"'slow_call.html'\"></div>\n" +
6414 " </div>\n" +
6529 " </div>\n" +
6415 "\n" +
6530 "\n" +
6416 " <div ng-if=\"report.report.slow_calls.length == 0\">\n" +
6531 " <div ng-if=\"report.report.slow_calls.length == 0\">\n" +
6417 " No slow calls reported\n" +
6532 " No slow calls reported\n" +
6418 " </div>\n" +
6533 " </div>\n" +
6419 "\n" +
6534 "\n" +
6420 " </uib-tab>\n" +
6535 " </uib-tab>\n" +
6421 "\n" +
6536 "\n" +
6422 "\n" +
6537 "\n" +
6423 " <uib-tab select=\"report.selectedTab('request_details')\" active=\"report.tabs.request_details\">\n" +
6538 " <uib-tab select=\"report.selectedTab('request_details')\" active=\"report.tabs.request_details\">\n" +
6424 " <uib-tab-heading>\n" +
6539 " <uib-tab-heading>\n" +
6425 " Request details\n" +
6540 " Request details\n" +
6426 " </uib-tab-heading>\n" +
6541 " </uib-tab-heading>\n" +
6427 "\n" +
6542 "\n" +
6428 " <h3><strong>Extra</strong></h3>\n" +
6543 " <h3><strong>Extra</strong></h3>\n" +
6429 " <div class=\"var-listing\" human-format vars=\"report.report.extra\"></div>\n" +
6544 " <div class=\"var-listing\" human-format vars=\"report.report.extra\"></div>\n" +
6430 " <h3><strong>Request details</strong></h3>\n" +
6545 " <h3><strong>Request details</strong></h3>\n" +
6431 " <div class=\"var-listing\" human-format vars=\"report.report.request\"></div>\n" +
6546 " <div class=\"var-listing\" human-format vars=\"report.report.request\"></div>\n" +
6432 "\n" +
6547 "\n" +
6433 " </uib-tab>\n" +
6548 " </uib-tab>\n" +
6434 "\n" +
6549 "\n" +
6435 " <uib-tab select=\"report.selectedTab('logs')\" active=\"report.tabs.logs\">\n" +
6550 " <uib-tab select=\"report.selectedTab('logs')\" active=\"report.tabs.logs\">\n" +
6436 " <uib-tab-heading>\n" +
6551 " <uib-tab-heading>\n" +
6437 " Logs\n" +
6552 " Logs\n" +
6438 " </uib-tab-heading>\n" +
6553 " </uib-tab-heading>\n" +
6439 "\n" +
6554 "\n" +
6440 " <div ng-if=\"report.is_loading.logs!=false\" class=\"text-center\">\n" +
6555 " <div ng-if=\"report.is_loading.logs!=false\" class=\"text-center\">\n" +
6441 " <span class=\"fa fa-cog fa-spin fa-3x loader\"></span>\n" +
6556 " <span class=\"fa fa-cog fa-spin fa-3x loader\"></span>\n" +
6442 " </div>\n" +
6557 " </div>\n" +
6443 " <p ng-if=\"report.reportLogs.length == 0\"> No logs found</p>\n" +
6558 " <p ng-if=\"report.reportLogs.length == 0\"> No logs found</p>\n" +
6444 "\n" +
6559 "\n" +
6445 " <table class=\"table table-striped log-list\" ng-if=\"report.reportLogs.length > 0\">\n" +
6560 " <table class=\"table table-striped log-list\" ng-if=\"report.reportLogs.length > 0\">\n" +
6446 "\n" +
6561 "\n" +
6447 " <caption>Logs</caption>\n" +
6562 " <caption>Logs</caption>\n" +
6448 " <thead>\n" +
6563 " <thead>\n" +
6449 " <tr>\n" +
6564 " <tr>\n" +
6450 " <th class=\"message\">Message</th>\n" +
6565 " <th class=\"message\">Message</th>\n" +
6451 " <th class=\"when\">When</th>\n" +
6566 " <th class=\"when\">When</th>\n" +
6452 " </tr>\n" +
6567 " </tr>\n" +
6453 " </thead>\n" +
6568 " </thead>\n" +
6454 " <tbody>\n" +
6569 " <tbody>\n" +
6455 " <tr ng-repeat=\"log in report.reportLogs track by log.log_id\">\n" +
6570 " <tr ng-repeat=\"log in report.reportLogs track by log.log_id\">\n" +
6456 " <td>\n" +
6571 " <td>\n" +
6457 " <a class=\"tag {{log.log_level|lowercase}}\">\n" +
6572 " <a class=\"tag {{log.log_level|lowercase}}\">\n" +
6458 " <span class=\"name\">level:</span> {{log.log_level}}</a>\n" +
6573 " <span class=\"name\">level:</span> {{log.log_level}}</a>\n" +
6459 " <a class=\"tag\">\n" +
6574 " <a class=\"tag\">\n" +
6460 " <span class=\"name\">namespace:</span> {{log.namespace}}</a>\n" +
6575 " <span class=\"name\">namespace:</span> {{log.namespace}}</a>\n" +
6461 " <a ng-repeat=\"(tag, value) in log.tags\" class=\"tag\">\n" +
6576 " <a ng-repeat=\"(tag, value) in log.tags\" class=\"tag\">\n" +
6462 " <span class=\"name\">{{tag}}:</span> {{value}}</a>\n" +
6577 " <span class=\"name\">{{tag}}:</span> {{value}}</a>\n" +
6463 " <div class=\"log\">\n" +
6578 " <div class=\"log\">\n" +
6464 " {{log.message}}\n" +
6579 " {{log.message}}\n" +
6465 " </div>\n" +
6580 " </div>\n" +
6466 " </td>\n" +
6581 " </td>\n" +
6467 " <td class=\"when\">\n" +
6582 " <td class=\"when\">\n" +
6468 " <a data-uib-tooltip=\"{{log.timestamp}}\">\n" +
6583 " <a data-uib-tooltip=\"{{log.timestamp}}\">\n" +
6469 " <iso-to-relative-time time=\"{{log.timestamp}}\"/>\n" +
6584 " <iso-to-relative-time time=\"{{log.timestamp}}\"/>\n" +
6470 " </a>\n" +
6585 " </a>\n" +
6471 " </td>\n" +
6586 " </td>\n" +
6472 " </tr>\n" +
6587 " </tr>\n" +
6473 "\n" +
6588 "\n" +
6474 " </tbody>\n" +
6589 " </tbody>\n" +
6475 " </table>\n" +
6590 " </table>\n" +
6476 "\n" +
6591 "\n" +
6477 " </uib-tab>\n" +
6592 " </uib-tab>\n" +
6478 "\n" +
6593 "\n" +
6479 "\n" +
6594 "\n" +
6480 " <uib-tab select=\"report.selectedTab('comments')\" active=\"report.tabs.comments\">\n" +
6595 " <uib-tab select=\"report.selectedTab('comments')\" active=\"report.tabs.comments\">\n" +
6481 " <uib-tab-heading>\n" +
6596 " <uib-tab-heading>\n" +
6482 " Comments\n" +
6597 " Comments\n" +
6483 " <span class=\"label label-info\">{{report.report.comments.length}}</span>\n" +
6598 " <span class=\"label label-info\">{{report.report.comments.length}}</span>\n" +
6484 "\n" +
6599 "\n" +
6485 " </uib-tab-heading>\n" +
6600 " </uib-tab-heading>\n" +
6486 "\n" +
6601 "\n" +
6487 " <h3><strong>Comments</strong></h3>\n" +
6602 " <h3><strong>Comments</strong></h3>\n" +
6488 "\n" +
6603 "\n" +
6489 " <p ng-if=\"report.report.comments.length == 0\">No comments yet - be first to add one!</p>\n" +
6604 " <p ng-if=\"report.report.comments.length == 0\">No comments yet - be first to add one!</p>\n" +
6490 "\n" +
6605 "\n" +
6491 " <div class=\"comment\" ng-repeat=\"comment in report.report.comments\">\n" +
6606 " <div class=\"comment\" ng-repeat=\"comment in report.report.comments\">\n" +
6492 " <p name=\"comment-{{comment.comment_id}}\"><span class=\"fa fa-comment\"></span>\n" +
6607 " <p name=\"comment-{{comment.comment_id}}\"><span class=\"fa fa-comment\"></span>\n" +
6493 " <strong>{{comment.user_name}}</strong>\n" +
6608 " <strong>{{comment.user_name}}</strong>\n" +
6494 " <iso-to-relative-time time=\"{{comment.created_timestamp}}\"/>\n" +
6609 " <iso-to-relative-time time=\"{{comment.created_timestamp}}\"/>\n" +
6495 " </p>\n" +
6610 " </p>\n" +
6496 " <p class=\"well\">{{comment.body}}</p>\n" +
6611 " <p class=\"well\">{{comment.body}}</p>\n" +
6497 " </div>\n" +
6612 " </div>\n" +
6498 "\n" +
6613 "\n" +
6499 " <form name=\"commentForm\" ng-submit=\"report.addComment()\">\n" +
6614 " <form name=\"commentForm\" ng-submit=\"report.addComment()\">\n" +
6500 " <div class=\"form-group\">\n" +
6615 " <div class=\"form-group\">\n" +
6501 " <textarea type=\"text\" class=\"form-control\" id=\"report.commentForm\" ng-model=\"report.comment\" required\n" +
6616 " <textarea type=\"text\" class=\"form-control\" id=\"report.commentForm\" ng-model=\"report.comment\" required\n" +
6502 " mentio mentio-search=\"report.searchMentionedPeople(term)\" mentio-items=\"report.mentionedPeople| filter:label:typedTerm\" class=\"form-control\"></textarea>\n" +
6617 " mentio mentio-search=\"report.searchMentionedPeople(term)\" mentio-items=\"report.mentionedPeople| filter:label:typedTerm\" class=\"form-control\"></textarea>\n" +
6503 "\n" +
6618 "\n" +
6504 " </div>\n" +
6619 " </div>\n" +
6505 " <div class=\"form-group\">\n" +
6620 " <div class=\"form-group\">\n" +
6506 " <button class=\"btn btn-info\" ng-disabled=\"report.commentForm.$invalid\">Comment</button>\n" +
6621 " <button class=\"btn btn-info\" ng-disabled=\"report.commentForm.$invalid\">Comment</button>\n" +
6507 " </div>\n" +
6622 " </div>\n" +
6508 " </form>\n" +
6623 " </form>\n" +
6509 "\n" +
6624 "\n" +
6510 " <div ng-repeat=\"comment in report.report.comments\" class=\"{{$odd ? 'odd' : 'even'}}\" class=\"repeat-animate\">\n" +
6625 " <div ng-repeat=\"comment in report.report.comments\" class=\"{{$odd ? 'odd' : 'even'}}\" class=\"repeat-animate\">\n" +
6511 " </div>\n" +
6626 " </div>\n" +
6512 "\n" +
6627 "\n" +
6513 " </uib-tab>\n" +
6628 " </uib-tab>\n" +
6514 "\n" +
6629 "\n" +
6515 " <uib-tab select=\"report.selectedTab('affected_users')\" active=\"report.tabs.affected_users\">\n" +
6630 " <uib-tab select=\"report.selectedTab('affected_users')\" active=\"report.tabs.affected_users\">\n" +
6516 " <uib-tab-heading>\n" +
6631 " <uib-tab-heading>\n" +
6517 " Affected users\n" +
6632 " Affected users\n" +
6518 " <span class=\"label label-warning\">{{report.report.affected_users_count}}</span>\n" +
6633 " <span class=\"label label-warning\">{{report.report.affected_users_count}}</span>\n" +
6519 "\n" +
6634 "\n" +
6520 " </uib-tab-heading>\n" +
6635 " </uib-tab-heading>\n" +
6521 "\n" +
6636 "\n" +
6522 " <h3><strong>50 most affected users ID's by this issue:</strong></h3>\n" +
6637 " <h3><strong>50 most affected users ID's by this issue:</strong></h3>\n" +
6523 " <ul class=\"affected-user-list\">\n" +
6638 " <ul class=\"affected-user-list\">\n" +
6524 " <li ng-repeat=\"user in report.report.top_affected_users\">\n" +
6639 " <li ng-repeat=\"user in report.report.top_affected_users\">\n" +
6525 " <strong>{{user.username}}</strong> <span class=\"badge\" uib-tooltip=\"occurences\">{{user.count}}</span>\n" +
6640 " <strong>{{user.username}}</strong> <span class=\"badge\" uib-tooltip=\"occurences\">{{user.count}}</span>\n" +
6526 " </li>\n" +
6641 " </li>\n" +
6527 " </ul>\n" +
6642 " </ul>\n" +
6528 "\n" +
6643 "\n" +
6529 " </uib-tab>\n" +
6644 " </uib-tab>\n" +
6530 "\n" +
6645 "\n" +
6531 " </uib-tabset>\n" +
6646 " </uib-tabset>\n" +
6532 "\n" +
6647 "\n" +
6533 "\n" +
6648 "\n" +
6534 " </div>\n" +
6649 " </div>\n" +
6535 "\n" +
6650 "\n" +
6536 " </div>\n" +
6651 " </div>\n" +
6537 " </div>\n" +
6652 " </div>\n" +
6538 "</div>\n"
6653 "</div>\n"
6539 );
6654 );
6540
6655
6541
6656
6542 $templateCache.put('templates/user/alert_channels_email.html',
6657 $templateCache.put('templates/user/alert_channels_email.html',
6543 "<ng-include src=\"'templates/loader.html'\" ng-if=\"email.loading.email\"></ng-include>\n" +
6658 "<ng-include src=\"'templates/loader.html'\" ng-if=\"email.loading.email\"></ng-include>\n" +
6544 "\n" +
6659 "\n" +
6545 "<div ng-show=\"!email.loading.email\">\n" +
6660 "<div ng-show=\"!email.loading.email\">\n" +
6546 "\n" +
6661 "\n" +
6547 " <div class=\"panel panel-default\">\n" +
6662 " <div class=\"panel panel-default\">\n" +
6548 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6663 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6549 " <div class=\"panel-body\">\n" +
6664 " <div class=\"panel-body\">\n" +
6550 " <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>\n" +
6665 " <p>Adding email alert channel - after you authorize your email in the system we can send alerts directly to this mailbox.</p>\n" +
6551 " <form class=\"form-horizontal\" name=\"email.channelForm\" ng-submit=\"email.createChannel()\">\n" +
6666 " <form class=\"form-horizontal\" name=\"email.channelForm\" ng-submit=\"email.createChannel()\">\n" +
6552 " <div class=\"form-group\" id=\"row-email\">\n" +
6667 " <div class=\"form-group\" id=\"row-email\">\n" +
6553 " <data-form-errors errors=\"email.channelForm.ae_validation.email\"></data-form-errors>\n" +
6668 " <data-form-errors errors=\"email.channelForm.ae_validation.email\"></data-form-errors>\n" +
6554 " <label id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6669 " <label id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6555 " Email Address\n" +
6670 " Email Address\n" +
6556 " <span class=\"required\">*</span>\n" +
6671 " <span class=\"required\">*</span>\n" +
6557 " </label>\n" +
6672 " </label>\n" +
6558 " <div class=\"col-sm-8 col-lg-9\">\n" +
6673 " <div class=\"col-sm-8 col-lg-9\">\n" +
6559 " <input class=\"form-control\" type=\"text\" ng-model=\"email.form.email\">\n" +
6674 " <input class=\"form-control\" type=\"text\" ng-model=\"email.form.email\">\n" +
6560 " </div>\n" +
6675 " </div>\n" +
6561 " </div>\n" +
6676 " </div>\n" +
6562 " <div class=\"form-group\">\n" +
6677 " <div class=\"form-group\">\n" +
6563 " <label for=\"submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6678 " <label for=\"submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6564 " </label>\n" +
6679 " </label>\n" +
6565 " <div class=\"col-sm-8 col-lg-9\">\n" +
6680 " <div class=\"col-sm-8 col-lg-9\">\n" +
6566 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Add email channel\">\n" +
6681 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Add email channel\">\n" +
6567 " </div>\n" +
6682 " </div>\n" +
6568 " </div>\n" +
6683 " </div>\n" +
6569 " </form>\n" +
6684 " </form>\n" +
6570 " </div>\n" +
6685 " </div>\n" +
6571 " </div>\n" +
6686 " </div>\n" +
6572 "</div>\n"
6687 "</div>\n"
6573 );
6688 );
6574
6689
6575
6690
6576 $templateCache.put('templates/user/alert_channels_list.html',
6691 $templateCache.put('templates/user/alert_channels_list.html',
6577 "<ng-include src=\"'templates/loader.html'\" ng-if=\"channels.loading.channels || channels.loading.applications\"></ng-include>\n" +
6692 "<ng-include src=\"'templates/loader.html'\" ng-if=\"channels.loading.channels || channels.loading.applications\"></ng-include>\n" +
6578 "\n" +
6693 "\n" +
6579 "<div ng-if=\"!channels.loading.channels && !channels.loading.applications && !channels.loading.actions\">\n" +
6694 "<div ng-if=\"!channels.loading.channels && !channels.loading.applications && !channels.loading.actions\">\n" +
6580 "\n" +
6695 "\n" +
6581 " <div class=\"panel panel-default\">\n" +
6696 " <div class=\"panel panel-default\">\n" +
6582 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6697 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6583 " <div class=\"panel-body\">\n" +
6698 " <div class=\"panel-body\">\n" +
6584 " <h1>Report alert rules</h1>\n" +
6699 " <h1>Report alert rules</h1>\n" +
6585 " <p>\n" +
6700 " <p>\n" +
6586 " <a class=\"btn btn-info\" ng-click=\"channels.addAction()\"><span class=\"fa fa-plus-circle\"></span> Add top-level rule</a>\n" +
6701 " <a class=\"btn btn-info\" ng-click=\"channels.addAction()\"><span class=\"fa fa-plus-circle\"></span> Add top-level rule</a>\n" +
6587 " </p>\n" +
6702 " </p>\n" +
6588 "\n" +
6703 "\n" +
6589 " <report-alert-action action=\"action\" rule-definitions=\"channels.ruleDefinitions\"\n" +
6704 " <report-alert-action action=\"action\" rule-definitions=\"channels.ruleDefinitions\"\n" +
6590 " possible-channels=\"channels.alertChannels\"\n" +
6705 " possible-channels=\"channels.alertChannels\"\n" +
6591 " actions=\"channels.alertActions\" applications=\"channels.applications\"\n" +
6706 " actions=\"channels.alertActions\" applications=\"channels.applications\"\n" +
6592 " ng-repeat=\"action in channels.alertActions | filter: {type:'report'}\"></report-alert-action>\n" +
6707 " ng-repeat=\"action in channels.alertActions | filter: {type:'report'}\"></report-alert-action>\n" +
6593 "\n" +
6708 "\n" +
6594 " </div>\n" +
6709 " </div>\n" +
6595 " </div>\n" +
6710 " </div>\n" +
6596 "\n" +
6711 "\n" +
6597 " <div class=\"panel panel-default\">\n" +
6712 " <div class=\"panel panel-default\">\n" +
6598 " <div class=\"panel-body\">\n" +
6713 " <div class=\"panel-body\">\n" +
6599 " <h1>Alert channels</h1>\n" +
6714 " <h1>Alert channels</h1>\n" +
6600 "\n" +
6715 "\n" +
6601 " <p>Here you can configure your <em>alert channels</em>.</p>\n" +
6716 " <p>Here you can configure your <em>alert channels</em>.</p>\n" +
6602 "\n" +
6717 "\n" +
6603 " <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>\n" +
6718 " <p>An alert channel serves as means of delivery of notifications about important events that happen in your applications.</p>\n" +
6604 "\n" +
6719 "\n" +
6605 " <div class=\"alert alert-success\">You can add more integrations that support different alert channels via application management panel.</div>\n" +
6720 " <div class=\"alert alert-success\">You can add more integrations that support different alert channels via application management panel.</div>\n" +
6606 "\n" +
6721 "\n" +
6607 " <table class=\"table table-striped\">\n" +
6722 " <table class=\"table table-striped\">\n" +
6608 " <tr ng-repeat=\"channel in channels.alertChannels\" class=\"animate-repeat\">\n" +
6723 " <tr ng-repeat=\"channel in channels.alertChannels\" class=\"animate-repeat\">\n" +
6609 " <td><strong>{{ channel.channel_visible_value }}</strong></td>\n" +
6724 " <td><strong>{{ channel.channel_visible_value }}</strong></td>\n" +
6610 " <td class=\"text-right\">\n" +
6725 " <td class=\"text-right\">\n" +
6611 " <span class=\"btn btn-default\" data-uib-tooltip=\"Channel is {{ channel.channel_validated? '' :'NOT' }} validated\" tooltip-append-to-body=\"true\"\n" +
6726 " <span class=\"btn btn-default\" data-uib-tooltip=\"Channel is {{ channel.channel_validated? '' :'NOT' }} validated\" tooltip-append-to-body=\"true\"\n" +
6612 " ng-class=\"{dim:!channel.channel_validated}\">\n" +
6727 " ng-class=\"{dim:!channel.channel_validated}\">\n" +
6613 " <span class=\"fa\" ng-class=\"{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}\"></span>\n" +
6728 " <span class=\"fa\" ng-class=\"{'fa-check-circle':channel.channel_validated, 'fa-times-circle':!channel.channel_validated}\"></span>\n" +
6614 " </span>\n" +
6729 " </span>\n" +
6615 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel\"\n" +
6730 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.send_alerts ? 'OFF' : 'ON' }} alerting on this chanel\"\n" +
6616 " ng-click=\"channels.updateChannel(channel,'send_alerts')\" ng-class=\"{dim:!channel.send_alerts}\" tooltip-append-to-body=\"true\">\n" +
6731 " ng-click=\"channels.updateChannel(channel,'send_alerts')\" ng-class=\"{dim:!channel.send_alerts}\" tooltip-append-to-body=\"true\">\n" +
6617 " <span class=\"fa fa-rss\"></span> Alerts\n" +
6732 " <span class=\"fa fa-rss\"></span> Alerts\n" +
6618 " </a>\n" +
6733 " </a>\n" +
6619 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel\"\n" +
6734 " <a class=\"btn btn-default\" data-uib-tooltip=\"Press to turn {{ channel.daily_digest ? 'OFF' : 'ON' }} daily digests on this channel\"\n" +
6620 " ng-click=\"channels.updateChannel(channel,'daily_digest')\" ng-class=\"{dim:!channel.daily_digest}\" tooltip-append-to-body=\"true\">\n" +
6735 " ng-click=\"channels.updateChannel(channel,'daily_digest')\" ng-class=\"{dim:!channel.daily_digest}\" tooltip-append-to-body=\"true\">\n" +
6621 " <span class=\"fa fa-envelope\"></span> Daily digests\n" +
6736 " <span class=\"fa fa-envelope\"></span> Daily digests\n" +
6622 " </a>\n" +
6737 " </a>\n" +
6623 "\n" +
6738 "\n" +
6624 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6739 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6625 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove</a>\n" +
6740 " <a class=\"btn btn-default\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span> Remove</a>\n" +
6626 " <ul class=\"dropdown-menu\">\n" +
6741 " <ul class=\"dropdown-menu\">\n" +
6627 " <li><a>No</a></li>\n" +
6742 " <li><a>No</a></li>\n" +
6628 " <li><a ng-click=\"channels.removeChannel(channel)\">Yes</a></li>\n" +
6743 " <li><a ng-click=\"channels.removeChannel(channel)\">Yes</a></li>\n" +
6629 " </ul>\n" +
6744 " </ul>\n" +
6630 " </span>\n" +
6745 " </span>\n" +
6631 "\n" +
6746 "\n" +
6632 " </td>\n" +
6747 " </td>\n" +
6633 " </tr>\n" +
6748 " </tr>\n" +
6634 " </table>\n" +
6749 " </table>\n" +
6635 "\n" +
6750 "\n" +
6636 " </div>\n" +
6751 " </div>\n" +
6637 " </div>\n" +
6752 " </div>\n" +
6638 "\n" +
6753 "\n" +
6639 "</div>\n"
6754 "</div>\n"
6640 );
6755 );
6641
6756
6642
6757
6643 $templateCache.put('templates/user/alert_channels.html',
6758 $templateCache.put('templates/user/alert_channels.html',
6644 "<ui-view></ui-view>"
6759 "<ui-view></ui-view>"
6645 );
6760 );
6646
6761
6647
6762
6648 $templateCache.put('templates/user/auth_tokens.html',
6763 $templateCache.put('templates/user/auth_tokens.html',
6649 "<ng-include src=\"'templates/loader.html'\" ng-if=\"auth_tokens.loading.tokens\"></ng-include>\n" +
6764 "<ng-include src=\"'templates/loader.html'\" ng-if=\"auth_tokens.loading.tokens\"></ng-include>\n" +
6650 "\n" +
6765 "\n" +
6651 "<div ng-show=\"!auth_tokens.loading.tokens\">\n" +
6766 "<div ng-show=\"!auth_tokens.loading.tokens\">\n" +
6652 "\n" +
6767 "\n" +
6653 " <div class=\"panel panel-default\">\n" +
6768 " <div class=\"panel panel-default\">\n" +
6654 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6769 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6655 "\n" +
6770 "\n" +
6656 " <div class=\"panel-body\">\n" +
6771 " <div class=\"panel-body\">\n" +
6657 "\n" +
6772 "\n" +
6658 " <div class=\"alert alert-success\">You can use those tokens to authenticate yourself when performing various API calls</div>\n" +
6773 " <div class=\"alert alert-success\">You can use those tokens to authenticate yourself when performing various API calls</div>\n" +
6659 "\n" +
6774 "\n" +
6660 " <hr/>\n" +
6775 " <hr/>\n" +
6661 "\n" +
6776 "\n" +
6662 " <form method=\"post\" class=\"form-inline\" name=\"auth_tokens.TokenForm\" ng-submit=\"auth_tokens.addToken()\" novalidate>\n" +
6777 " <form method=\"post\" class=\"form-inline\" name=\"auth_tokens.TokenForm\" ng-submit=\"auth_tokens.addToken()\" novalidate>\n" +
6663 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.description\"></data-form-errors>\n" +
6778 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.description\"></data-form-errors>\n" +
6664 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.expires\"></data-form-errors>\n" +
6779 " <data-form-errors errors=\"auth_tokens.TokenForm.ae_validation.expires\"></data-form-errors>\n" +
6665 " <div class=\"form-group\">\n" +
6780 " <div class=\"form-group\">\n" +
6666 " <label>\n" +
6781 " <label>\n" +
6667 " Description\n" +
6782 " Description\n" +
6668 " </label>\n" +
6783 " </label>\n" +
6669 " <input class=\"form-control\" name=\"description\" placeholder=\"Token description\" type=\"text\" ng-model=\"auth_tokens.form.description\">\n" +
6784 " <input class=\"form-control\" name=\"description\" placeholder=\"Token description\" type=\"text\" ng-model=\"auth_tokens.form.description\">\n" +
6670 " </div>\n" +
6785 " </div>\n" +
6671 " <div class=\"form-group\">\n" +
6786 " <div class=\"form-group\">\n" +
6672 " <label>\n" +
6787 " <label>\n" +
6673 " Expires\n" +
6788 " Expires\n" +
6674 " </label>\n" +
6789 " </label>\n" +
6675 " <select class=\"form-control\" ng-model=\"auth_tokens.form.expires\" ng-options=\"i.key as i.label for i in auth_tokens.expireOptions | objectToOrderedArray:'minutes'\">\n" +
6790 " <select class=\"form-control\" ng-model=\"auth_tokens.form.expires\" ng-options=\"i.key as i.label for i in auth_tokens.expireOptions | objectToOrderedArray:'minutes'\">\n" +
6676 " <option value=\"\">Never</option>\n" +
6791 " <option value=\"\">Never</option>\n" +
6677 " </select>\n" +
6792 " </select>\n" +
6678 " </div>\n" +
6793 " </div>\n" +
6679 " <div class=\"form-group\">\n" +
6794 " <div class=\"form-group\">\n" +
6680 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
6795 " <label class=\"control-label col-sm-4 col-lg-3\">\n" +
6681 " </label>\n" +
6796 " </label>\n" +
6682 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Create Token\">\n" +
6797 " <input class=\"form-control btn btn-primary\" name=\"submit\" type=\"submit\" value=\"Create Token\">\n" +
6683 " </div>\n" +
6798 " </div>\n" +
6684 " </form>\n" +
6799 " </form>\n" +
6685 "\n" +
6800 "\n" +
6686 " </div>\n" +
6801 " </div>\n" +
6687 "\n" +
6802 "\n" +
6688 "\n" +
6803 "\n" +
6689 " </div>\n" +
6804 " </div>\n" +
6690 "\n" +
6805 "\n" +
6691 " <div class=\"panel panel-default\">\n" +
6806 " <div class=\"panel panel-default\">\n" +
6692 " <table st-table=\"displayedCollection\" st-safe-src=\"auth_tokens.tokens\" class=\"table table-striped\">\n" +
6807 " <table st-table=\"displayedCollection\" st-safe-src=\"auth_tokens.tokens\" class=\"table table-striped\">\n" +
6693 " <caption>Your current tokens</caption>\n" +
6808 " <caption>Your current tokens</caption>\n" +
6694 " <thead>\n" +
6809 " <thead>\n" +
6695 " <tr>\n" +
6810 " <tr>\n" +
6696 " <th st-sort=\"description\"><a>Description</a></th>\n" +
6811 " <th st-sort=\"description\"><a>Description</a></th>\n" +
6697 " <th class=\"created\"><a>Created</a></th>\n" +
6812 " <th class=\"created\"><a>Created</a></th>\n" +
6698 " <th class=\"expires\"><a>Expires</a></th>\n" +
6813 " <th class=\"expires\"><a>Expires</a></th>\n" +
6699 " <th class=\"options\"></th>\n" +
6814 " <th class=\"options\"></th>\n" +
6700 " </tr>\n" +
6815 " </tr>\n" +
6701 " <tr>\n" +
6816 " <tr>\n" +
6702 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
6817 " <th><input st-search=\"description\" placeholder=\"search for description\" class=\"form-control\" type=\"search\" st-delay=\"1\"/></th>\n" +
6703 " <th></th>\n" +
6818 " <th></th>\n" +
6704 " <th></th>\n" +
6819 " <th></th>\n" +
6705 " <th></th>\n" +
6820 " <th></th>\n" +
6706 " </tr>\n" +
6821 " </tr>\n" +
6707 " </thead>\n" +
6822 " </thead>\n" +
6708 " <tbody>\n" +
6823 " <tbody>\n" +
6709 "\n" +
6824 "\n" +
6710 " <tr ng-repeat=\"token in displayedCollection\">\n" +
6825 " <tr ng-repeat=\"token in displayedCollection\">\n" +
6711 " <td><p>{{token.description}}</p>\n" +
6826 " <td><p>{{token.description}}</p>\n" +
6712 " <pre ng-init=\"token.limit = 8\" ng-mouseover=\"token.limit = 99\" ng-mouseleave=\"token.limit = 8\">{{token.token| limitTo:token.limit}}...</pre>\n" +
6827 " <pre ng-init=\"token.limit = 8\" ng-mouseover=\"token.limit = 99\" ng-mouseleave=\"token.limit = 8\">{{token.token| limitTo:token.limit}}...</pre>\n" +
6713 " </td>\n" +
6828 " </td>\n" +
6714 " <td><span data-uib-tooltip=\"{{token.creation_date}}\">{{token.creation_date | isoToRelativeTime}}</span></td>\n" +
6829 " <td><span data-uib-tooltip=\"{{token.creation_date}}\">{{token.creation_date | isoToRelativeTime}}</span></td>\n" +
6715 " <td><span ng-if=\"token.expires\" data-uib-tooltip=\"{{token.expires}}\">{{token.expires | isoToRelativeTime}}</span>\n" +
6830 " <td><span ng-if=\"token.expires\" data-uib-tooltip=\"{{token.expires}}\">{{token.expires | isoToRelativeTime}}</span>\n" +
6716 " <span ng-if=\"!token.expires\">Never</span></td>\n" +
6831 " <span ng-if=\"!token.expires\">Never</span></td>\n" +
6717 " <td>\n" +
6832 " <td>\n" +
6718 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6833 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6719 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
6834 " <a class=\"btn btn-danger\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
6720 " <ul class=\"dropdown-menu\">\n" +
6835 " <ul class=\"dropdown-menu\">\n" +
6721 " <li><a>No</a></li>\n" +
6836 " <li><a>No</a></li>\n" +
6722 " <li><a ng-click=\"auth_tokens.removeToken(token)\">Yes</a></li>\n" +
6837 " <li><a ng-click=\"auth_tokens.removeToken(token)\">Yes</a></li>\n" +
6723 " </ul>\n" +
6838 " </ul>\n" +
6724 " </span>\n" +
6839 " </span>\n" +
6725 " </td>\n" +
6840 " </td>\n" +
6726 " </tr>\n" +
6841 " </tr>\n" +
6727 " </tbody>\n" +
6842 " </tbody>\n" +
6728 " </table>\n" +
6843 " </table>\n" +
6729 " </div>\n" +
6844 " </div>\n" +
6730 "\n" +
6845 "\n" +
6731 "</div>\n"
6846 "</div>\n"
6732 );
6847 );
6733
6848
6734
6849
6735 $templateCache.put('templates/user/breadcrumbs.html',
6850 $templateCache.put('templates/user/breadcrumbs.html',
6736 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.profile')\">\n" +
6851 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.profile')\">\n" +
6737 " <li>Settings</li>\n" +
6852 " <li>Settings</li>\n" +
6738 " <li ng-show=\"$state.includes('user.profile.edit')\" ng-class=\"{bold:$state.is('user.profile.edit')}\">User Profile</li>\n" +
6853 " <li ng-show=\"$state.includes('user.profile.edit')\" ng-class=\"{bold:$state.is('user.profile.edit')}\">User Profile</li>\n" +
6739 " <li ng-show=\"$state.includes('user.profile.password')\" ng-class=\"{bold:$state.is('user.profile.password')}\">Password</li>\n" +
6854 " <li ng-show=\"$state.includes('user.profile.password')\" ng-class=\"{bold:$state.is('user.profile.password')}\">Password</li>\n" +
6740 " <li ng-show=\"$state.includes('user.profile.identities')\" ng-class=\"{bold:$state.is('user.profile.identities')}\">Identities</li>\n" +
6855 " <li ng-show=\"$state.includes('user.profile.identities')\" ng-class=\"{bold:$state.is('user.profile.identities')}\">Identities</li>\n" +
6741 "</ol>\n" +
6856 "</ol>\n" +
6742 "\n" +
6857 "\n" +
6743 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.alert_channels')\">\n" +
6858 "<ol class=\"breadcrumb\" ng-show=\"$state.includes('user.alert_channels')\">\n" +
6744 "<li>Notifications</li>\n" +
6859 "<li>Notifications</li>\n" +
6745 "<li ng-show=\"$state.includes('user.alert_channels.list')\" ng-class=\"{bold:$state.is('user.alert_channels.list')}\">Alert Channels</li>\n" +
6860 "<li ng-show=\"$state.includes('user.alert_channels.list')\" ng-class=\"{bold:$state.is('user.alert_channels.list')}\">Alert Channels</li>\n" +
6746 "<li ng-show=\"$state.includes('user.alert_channels.email')\" ng-class=\"{bold:$state.is('user.alert_channels.email')}\">Create email channel</li>\n" +
6861 "<li ng-show=\"$state.includes('user.alert_channels.email')\" ng-class=\"{bold:$state.is('user.alert_channels.email')}\">Create email channel</li>\n" +
6747 "</ol>\n"
6862 "</ol>\n"
6748 );
6863 );
6749
6864
6750
6865
6751 $templateCache.put('templates/user/index.html',
6866 $templateCache.put('templates/user/index.html',
6752 ""
6867 ""
6753 );
6868 );
6754
6869
6755
6870
6756 $templateCache.put('templates/user/menu.html',
6871 $templateCache.put('templates/user/menu.html',
6757 "<div class=\"panel panel-default\">\n" +
6872 "<div class=\"panel panel-default\">\n" +
6758 " <div class=\"panel-heading\">Applications</div>\n" +
6873 " <div class=\"panel-heading\">Applications</div>\n" +
6759 " <ul class=\"list-group\">\n" +
6874 " <ul class=\"list-group\">\n" +
6760 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.list\"><span class=\"fa fa-cog\"></span> List applications</a></li>\n" +
6875 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.list\"><span class=\"fa fa-cog\"></span> List applications</a></li>\n" +
6761 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.update({resourceId:'new'})\"><span class=\"fa fa-plus-circle\"></span> Create application</a></li>\n" +
6876 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.update({resourceId:'new'})\"><span class=\"fa fa-plus-circle\"></span> Create application</a></li>\n" +
6762 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.purge_logs\"><span class=\"fa fa-trash-o\"></span> Purge logs</a></li>\n" +
6877 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"applications.purge_logs\"><span class=\"fa fa-trash-o\"></span> Purge logs</a></li>\n" +
6763 " </ul>\n" +
6878 " </ul>\n" +
6764 "</div>\n" +
6879 "</div>\n" +
6765 "\n" +
6880 "\n" +
6766 "\n" +
6881 "\n" +
6767 "<div class=\"panel panel-default\">\n" +
6882 "<div class=\"panel panel-default\">\n" +
6768 " <div class=\"panel-heading\">Settings</div>\n" +
6883 " <div class=\"panel-heading\">Settings</div>\n" +
6769 " <ul class=\"list-group\">\n" +
6884 " <ul class=\"list-group\">\n" +
6770 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.edit\"><span class=\"fa fa-user\"></span> Profile details</a></li>\n" +
6885 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.edit\"><span class=\"fa fa-user\"></span> Profile details</a></li>\n" +
6771 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.password\"><span class=\"fa fa-lock\"></span> Change Password</a></li>\n" +
6886 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.password\"><span class=\"fa fa-lock\"></span> Change Password</a></li>\n" +
6772 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.identities\"><span class=\"fa fa-link\"></span> External Identities</a></li>\n" +
6887 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.identities\"><span class=\"fa fa-link\"></span> External Identities</a></li>\n" +
6773 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.auth_tokens\"><span class=\"fa fa-unlock\"></span> Auth Tokens</a></li>\n" +
6888 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.profile.auth_tokens\"><span class=\"fa fa-unlock\"></span> Auth Tokens</a></li>\n" +
6774 " </ul>\n" +
6889 " </ul>\n" +
6775 "</div>\n" +
6890 "</div>\n" +
6776 "\n" +
6891 "\n" +
6777 "<div class=\"panel panel-default\">\n" +
6892 "<div class=\"panel panel-default\">\n" +
6778 " <div class=\"panel-heading\">Notifications</div>\n" +
6893 " <div class=\"panel-heading\">Notifications</div>\n" +
6779 " <ul class=\"list-group\">\n" +
6894 " <ul class=\"list-group\">\n" +
6780 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.alert_channels.list\"><span class=\"fa fa-bullhorn\"></span> Alert channels</a></li>\n" +
6895 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.alert_channels.list\"><span class=\"fa fa-bullhorn\"></span> Alert channels</a></li>\n" +
6781 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.alert_channels.email\"><span class=\"fa fa-envelope\"></span> Add email channel</a></li>\n" +
6896 " <li class=\"list-group-item\" ui-sref-active-eq=\"active\"><a data-ui-sref=\"user.alert_channels.email\"><span class=\"fa fa-envelope\"></span> Add email channel</a></li>\n" +
6782 " </ul>\n" +
6897 " </ul>\n" +
6783 "</div>"
6898 "</div>"
6784 );
6899 );
6785
6900
6786
6901
6787 $templateCache.put('templates/user/parent_view.html',
6902 $templateCache.put('templates/user/parent_view.html',
6788 "<div class=\"row\">\n" +
6903 "<div class=\"row\">\n" +
6789 " <div class=\"col-sm-3\" id=\"menu\">\n" +
6904 " <div class=\"col-sm-3\" id=\"menu\">\n" +
6790 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
6905 " <div ng-include=\"'templates/user/menu.html'\"></div>\n" +
6791 " </div>\n" +
6906 " </div>\n" +
6792 "\n" +
6907 "\n" +
6793 " <div class=\"col-sm-9\" ui-view></div>\n" +
6908 " <div class=\"col-sm-9\" ui-view></div>\n" +
6794 "</div>\n"
6909 "</div>\n"
6795 );
6910 );
6796
6911
6797
6912
6798 $templateCache.put('templates/user/profile_edit.html',
6913 $templateCache.put('templates/user/profile_edit.html',
6799 "<ng-include src=\"'templates/loader.html'\" ng-if=\"profile.loading.profile\"></ng-include>\n" +
6914 "<ng-include src=\"'templates/loader.html'\" ng-if=\"profile.loading.profile\"></ng-include>\n" +
6800 "\n" +
6915 "\n" +
6801 "<div ng-show=\"!profile.loading.profile\">\n" +
6916 "<div ng-show=\"!profile.loading.profile\">\n" +
6802 " <div class=\"panel panel-default\">\n" +
6917 " <div class=\"panel panel-default\">\n" +
6803 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6918 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6804 " <div class=\"panel-body\">\n" +
6919 " <div class=\"panel-body\">\n" +
6805 " <form name=\"profile.profileForm\" class=\"form-horizontal\" ng-submit=\"profile.updateProfile()\">\n" +
6920 " <form name=\"profile.profileForm\" class=\"form-horizontal\" ng-submit=\"profile.updateProfile()\">\n" +
6806 " <div class=\"form-group\" id=\"row-email\">\n" +
6921 " <div class=\"form-group\" id=\"row-email\">\n" +
6807 " <data-form-errors errors=\"profile.profileForm.ae_validation.email\"></data-form-errors>\n" +
6922 " <data-form-errors errors=\"profile.profileForm.ae_validation.email\"></data-form-errors>\n" +
6808 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6923 " <label for=\"email\" id=\"label-email\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6809 " Email Address\n" +
6924 " Email Address\n" +
6810 " <span class=\"required\">*</span>\n" +
6925 " <span class=\"required\">*</span>\n" +
6811 " </label>\n" +
6926 " </label>\n" +
6812 " <div class=\"col-sm-8 col-lg-9\">\n" +
6927 " <div class=\"col-sm-8 col-lg-9\">\n" +
6813 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"profile.user.email\">\n" +
6928 " <input class=\"form-control\" id=\"email\" name=\"email\" type=\"text\" ng-model=\"profile.user.email\">\n" +
6814 " </div>\n" +
6929 " </div>\n" +
6815 " </div>\n" +
6930 " </div>\n" +
6816 "\n" +
6931 "\n" +
6817 " <div class=\"form-group\" id=\"row-first_name\">\n" +
6932 " <div class=\"form-group\" id=\"row-first_name\">\n" +
6818 " <data-form-errors errors=\"profile.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
6933 " <data-form-errors errors=\"profile.profileForm.ae_validation.first_name\"></data-form-errors>\n" +
6819 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6934 " <label for=\"first_name\" id=\"label-first_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6820 " First Name\n" +
6935 " First Name\n" +
6821 " </label>\n" +
6936 " </label>\n" +
6822 " <div class=\"col-sm-8 col-lg-9\">\n" +
6937 " <div class=\"col-sm-8 col-lg-9\">\n" +
6823 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"profile.user.first_name\">\n" +
6938 " <input class=\"form-control\" id=\"first_name\" name=\"first_name\" type=\"text\" ng-model=\"profile.user.first_name\">\n" +
6824 " </div>\n" +
6939 " </div>\n" +
6825 " </div>\n" +
6940 " </div>\n" +
6826 " <div class=\"form-group\" id=\"row-last_name\">\n" +
6941 " <div class=\"form-group\" id=\"row-last_name\">\n" +
6827 " <data-form-errors errors=\"profile.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
6942 " <data-form-errors errors=\"profile.profileForm.ae_validation.last_name\"></data-form-errors>\n" +
6828 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6943 " <label for=\"last_name\" id=\"label-last_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6829 " Last Name\n" +
6944 " Last Name\n" +
6830 " </label>\n" +
6945 " </label>\n" +
6831 " <div class=\"col-sm-8 col-lg-9\">\n" +
6946 " <div class=\"col-sm-8 col-lg-9\">\n" +
6832 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"profile.user.last_name\">\n" +
6947 " <input class=\"form-control\" id=\"last_name\" name=\"last_name\" type=\"text\" ng-model=\"profile.user.last_name\">\n" +
6833 " </div>\n" +
6948 " </div>\n" +
6834 " </div>\n" +
6949 " </div>\n" +
6835 " <div class=\"form-group\" id=\"row-company_name\">\n" +
6950 " <div class=\"form-group\" id=\"row-company_name\">\n" +
6836 " <data-form-errors errors=\"profile.profileForm.ae_validation.company_name\"></data-form-errors>\n" +
6951 " <data-form-errors errors=\"profile.profileForm.ae_validation.company_name\"></data-form-errors>\n" +
6837 " <label for=\"company_name\" id=\"label-company_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6952 " <label for=\"company_name\" id=\"label-company_name\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6838 " Company Name\n" +
6953 " Company Name\n" +
6839 " </label>\n" +
6954 " </label>\n" +
6840 " <div class=\"col-sm-8 col-lg-9\">\n" +
6955 " <div class=\"col-sm-8 col-lg-9\">\n" +
6841 " <input class=\"form-control\" id=\"company_name\" name=\"company_name\" type=\"text\" ng-model=\"profile.user.company_name\">\n" +
6956 " <input class=\"form-control\" id=\"company_name\" name=\"company_name\" type=\"text\" ng-model=\"profile.user.company_name\">\n" +
6842 " </div>\n" +
6957 " </div>\n" +
6843 " </div>\n" +
6958 " </div>\n" +
6844 " <div class=\"form-group\" id=\"row-company_address\">\n" +
6959 " <div class=\"form-group\" id=\"row-company_address\">\n" +
6845 " <data-form-errors errors=\"profile.profileForm.ae_validation.company_address\"></data-form-errors>\n" +
6960 " <data-form-errors errors=\"profile.profileForm.ae_validation.company_address\"></data-form-errors>\n" +
6846 " <label for=\"company_address\" id=\"label-company_address\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6961 " <label for=\"company_address\" id=\"label-company_address\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6847 " Company Address\n" +
6962 " Company Address\n" +
6848 " </label>\n" +
6963 " </label>\n" +
6849 " <div class=\"col-sm-8 col-lg-9\">\n" +
6964 " <div class=\"col-sm-8 col-lg-9\">\n" +
6850 " <textarea class=\"form-control\" id=\"company_address\" name=\"company_address\" ng-model=\"profile.user.company_address\"></textarea>\n" +
6965 " <textarea class=\"form-control\" id=\"company_address\" name=\"company_address\" ng-model=\"profile.user.company_address\"></textarea>\n" +
6851 " </div>\n" +
6966 " </div>\n" +
6852 " </div>\n" +
6967 " </div>\n" +
6853 " <div class=\"form-group\" id=\"row-zip_code\">\n" +
6968 " <div class=\"form-group\" id=\"row-zip_code\">\n" +
6854 " <data-form-errors errors=\"profile.profileForm.ae_validation.zip_code\"></data-form-errors>\n" +
6969 " <data-form-errors errors=\"profile.profileForm.ae_validation.zip_code\"></data-form-errors>\n" +
6855 " <label for=\"zip_code\" id=\"label-zip_code\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6970 " <label for=\"zip_code\" id=\"label-zip_code\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6856 " ZIP code\n" +
6971 " ZIP code\n" +
6857 " </label>\n" +
6972 " </label>\n" +
6858 " <div class=\"col-sm-8 col-lg-9\">\n" +
6973 " <div class=\"col-sm-8 col-lg-9\">\n" +
6859 " <input class=\"form-control\" id=\"zip_code\" name=\"zip_code\" type=\"text\" ng-model=\"profile.user.zip_code\">\n" +
6974 " <input class=\"form-control\" id=\"zip_code\" name=\"zip_code\" type=\"text\" ng-model=\"profile.user.zip_code\">\n" +
6860 " </div>\n" +
6975 " </div>\n" +
6861 " </div>\n" +
6976 " </div>\n" +
6862 " <div class=\"form-group\" id=\"row-city\">\n" +
6977 " <div class=\"form-group\" id=\"row-city\">\n" +
6863 " <data-form-errors errors=\"profile.profileForm.ae_validation.city\"></data-form-errors>\n" +
6978 " <data-form-errors errors=\"profile.profileForm.ae_validation.city\"></data-form-errors>\n" +
6864 " <label for=\"city\" id=\"label-city\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6979 " <label for=\"city\" id=\"label-city\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6865 " City\n" +
6980 " City\n" +
6866 " </label>\n" +
6981 " </label>\n" +
6867 " <div class=\"col-sm-8 col-lg-9\">\n" +
6982 " <div class=\"col-sm-8 col-lg-9\">\n" +
6868 " <input class=\"form-control\" id=\"city\" name=\"city\" type=\"text\" ng-model=\"profile.user.city\">\n" +
6983 " <input class=\"form-control\" id=\"city\" name=\"city\" type=\"text\" ng-model=\"profile.user.city\">\n" +
6869 " </div>\n" +
6984 " </div>\n" +
6870 " </div>\n" +
6985 " </div>\n" +
6871 " <div class=\"form-group\" id=\"row-notifications\">\n" +
6986 " <div class=\"form-group\" id=\"row-notifications\">\n" +
6872 " <data-form-errors errors=\"profile.profileForm.ae_validation.notifications\"></data-form-errors>\n" +
6987 " <data-form-errors errors=\"profile.profileForm.ae_validation.notifications\"></data-form-errors>\n" +
6873 " <label for=\"notifications\" id=\"label-notifications\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6988 " <label for=\"notifications\" id=\"label-notifications\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6874 " Account notifications\n" +
6989 " Account notifications\n" +
6875 " </label>\n" +
6990 " </label>\n" +
6876 " <div class=\"col-sm-8 col-lg-9\">\n" +
6991 " <div class=\"col-sm-8 col-lg-9\">\n" +
6877 " <input checked class=\"form-control\" id=\"notifications\" name=\"notifications\" type=\"checkbox\" ng-model=\"profile.user.notifications\">\n" +
6992 " <input checked class=\"form-control\" id=\"notifications\" name=\"notifications\" type=\"checkbox\" ng-model=\"profile.user.notifications\">\n" +
6878 " </div>\n" +
6993 " </div>\n" +
6879 " </div>\n" +
6994 " </div>\n" +
6880 " <div class=\"form-group\" id=\"row-submit\">\n" +
6995 " <div class=\"form-group\" id=\"row-submit\">\n" +
6881 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6996 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6882 " </label>\n" +
6997 " </label>\n" +
6883 " <div class=\"col-sm-8 col-lg-9\">\n" +
6998 " <div class=\"col-sm-8 col-lg-9\">\n" +
6884 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Update Account\">\n" +
6999 " <input class=\"form-control btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Update Account\">\n" +
6885 " </div>\n" +
7000 " </div>\n" +
6886 " </div>\n" +
7001 " </div>\n" +
6887 " </form>\n" +
7002 " </form>\n" +
6888 " </div>\n" +
7003 " </div>\n" +
6889 " </div>\n" +
7004 " </div>\n" +
6890 "</div>\n"
7005 "</div>\n"
6891 );
7006 );
6892
7007
6893
7008
6894 $templateCache.put('templates/user/profile_identities.html',
7009 $templateCache.put('templates/user/profile_identities.html',
6895 "<ng-include src=\"'templates/loader.html'\" ng-if=\"identities.loading.identities\"></ng-include>\n" +
7010 "<ng-include src=\"'templates/loader.html'\" ng-if=\"identities.loading.identities\"></ng-include>\n" +
6896 "\n" +
7011 "\n" +
6897 "<div ng-show=\"!identities.loading.identities\">\n" +
7012 "<div ng-show=\"!identities.loading.identities\">\n" +
6898 "\n" +
7013 "\n" +
6899 " <div class=\"panel panel-default\">\n" +
7014 " <div class=\"panel panel-default\">\n" +
6900 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
7015 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6901 " <div class=\"panel-body\">\n" +
7016 " <div class=\"panel-body\">\n" +
6902 "\n" +
7017 "\n" +
6903 " <div class=\"col-sm-6\">\n" +
7018 " <div class=\"col-sm-6\">\n" +
6904 " <p ng-show=\"identities.identities.length === 0\">No external providers linked yet</p>\n" +
7019 " <p ng-show=\"identities.identities.length === 0\">No external providers linked yet</p>\n" +
6905 " <ul class=\"list-group\">\n" +
7020 " <ul class=\"list-group\">\n" +
6906 " <li ng-repeat=\"provider in identities.identities\" class=\"animate-repeat list-group-item\">\n" +
7021 " <li ng-repeat=\"provider in identities.identities\" class=\"animate-repeat list-group-item\">\n" +
6907 " <div class=\"pull-right\">\n" +
7022 " <div class=\"pull-right\">\n" +
6908 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
7023 " <span class=\"dropdown\" data-uib-dropdown on-toggle=\"toggled(open)\">\n" +
6909 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
7024 " <a class=\"btn btn-danger btn-xs\" data-uib-dropdown-toggle><span class=\"fa fa-trash-o\"></span></a>\n" +
6910 " <ul class=\"dropdown-menu\">\n" +
7025 " <ul class=\"dropdown-menu\">\n" +
6911 " <li><a>No</a></li>\n" +
7026 " <li><a>No</a></li>\n" +
6912 " <li><a ng-click=\"identities.removeProvider(provider)\">Yes</a></li>\n" +
7027 " <li><a ng-click=\"identities.removeProvider(provider)\">Yes</a></li>\n" +
6913 " </ul>\n" +
7028 " </ul>\n" +
6914 " </span>\n" +
7029 " </span>\n" +
6915 " </div>\n" +
7030 " </div>\n" +
6916 " <em>@{{ provider.provider }}</em>: <strong>{{ provider.id }}</strong>\n" +
7031 " <em>@{{ provider.provider }}</em>: <strong>{{ provider.id }}</strong>\n" +
6917 " </li>\n" +
7032 " </li>\n" +
6918 " </ul>\n" +
7033 " </ul>\n" +
6919 " </div>\n" +
7034 " </div>\n" +
6920 " <div class=\"col-sm-6\">\n" +
7035 " <div class=\"col-sm-6\">\n" +
6921 " <ul class=\"list-group\">\n" +
7036 " <ul class=\"list-group\">\n" +
6922 " <li class=\"list-group-item\">\n" +
7037 " <li class=\"list-group-item\">\n" +
6923 " <a href=\"{{AeConfig.urls.social_auth.google}}\" target=\"_self\">\n" +
7038 " <a href=\"{{AeConfig.urls.social_auth.google}}\" target=\"_self\">\n" +
6924 " <span class=\"fa fa-google-plus-square fa-2x\"></span> Connect with Google</a>\n" +
7039 " <span class=\"fa fa-google-plus-square fa-2x\"></span> Connect with Google</a>\n" +
6925 " </li>\n" +
7040 " </li>\n" +
6926 " <li class=\"list-group-item\">\n" +
7041 " <li class=\"list-group-item\">\n" +
6927 " <a href=\"{{AeConfig.urls.social_auth.twitter}}\" target=\"_self\">\n" +
7042 " <a href=\"{{AeConfig.urls.social_auth.twitter}}\" target=\"_self\">\n" +
6928 " <span class=\"fa fa-twitter fa-2x\"></span> Connect with Twitter</a>\n" +
7043 " <span class=\"fa fa-twitter fa-2x\"></span> Connect with Twitter</a>\n" +
6929 " </li>\n" +
7044 " </li>\n" +
6930 " <li class=\"list-group-item\">\n" +
7045 " <li class=\"list-group-item\">\n" +
6931 " <a href=\"{{AeConfig.urls.social_auth.bitbucket}}\" target=\"_self\">\n" +
7046 " <a href=\"{{AeConfig.urls.social_auth.bitbucket}}\" target=\"_self\">\n" +
6932 " <span class=\"fa fa-bitbucket fa-2x\"></span> Connect with Bitbucket</a>\n" +
7047 " <span class=\"fa fa-bitbucket fa-2x\"></span> Connect with Bitbucket</a>\n" +
6933 " </li>\n" +
7048 " </li>\n" +
6934 " <li class=\"list-group-item\">\n" +
7049 " <li class=\"list-group-item\">\n" +
6935 " <a href=\"{{AeConfig.urls.social_auth.github}}\" target=\"_self\">\n" +
7050 " <a href=\"{{AeConfig.urls.social_auth.github}}\" target=\"_self\">\n" +
6936 " <span class=\"fa fa-github fa-2x\"></span> Connect with Github including private repo access</a>\n" +
7051 " <span class=\"fa fa-github fa-2x\"></span> Connect with Github including private repo access</a>\n" +
6937 " </li>\n" +
7052 " </li>\n" +
6938 " </ul>\n" +
7053 " </ul>\n" +
6939 " </div>\n" +
7054 " </div>\n" +
6940 " </div>\n" +
7055 " </div>\n" +
6941 " </div>\n" +
7056 " </div>\n" +
6942 "</div>\n"
7057 "</div>\n"
6943 );
7058 );
6944
7059
6945
7060
6946 $templateCache.put('templates/user/profile_password.html',
7061 $templateCache.put('templates/user/profile_password.html',
6947 "<ng-include src=\"'templates/loader.html'\" ng-if=\"password.loading.password\"></ng-include>\n" +
7062 "<ng-include src=\"'templates/loader.html'\" ng-if=\"password.loading.password\"></ng-include>\n" +
6948 "\n" +
7063 "\n" +
6949 "<div ng-show=\"!password.loading.password\">\n" +
7064 "<div ng-show=\"!password.loading.password\">\n" +
6950 "\n" +
7065 "\n" +
6951 " <div class=\"panel panel-default\">\n" +
7066 " <div class=\"panel panel-default\">\n" +
6952 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
7067 " <div class=\"panel-heading\" ng-include=\"'templates/user/breadcrumbs.html'\"></div>\n" +
6953 " <div class=\"panel-body\">\n" +
7068 " <div class=\"panel-body\">\n" +
6954 "\n" +
7069 "\n" +
6955 " <form class=\"form-horizontal\" name=\"password.passwordForm\" ng-submit=\"password.updatePassword()\">\n" +
7070 " <form class=\"form-horizontal\" name=\"password.passwordForm\" ng-submit=\"password.updatePassword()\">\n" +
6956 " <div class=\"form-group\" id=\"row-old_password\">\n" +
7071 " <div class=\"form-group\" id=\"row-old_password\">\n" +
6957 " <data-form-errors errors=\"password.passwordForm.ae_validation.old_password\"></data-form-errors>\n" +
7072 " <data-form-errors errors=\"password.passwordForm.ae_validation.old_password\"></data-form-errors>\n" +
6958 " <label for=\"old_password\" id=\"label-old_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7073 " <label for=\"old_password\" id=\"label-old_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6959 " Old Password\n" +
7074 " Old Password\n" +
6960 " <span class=\"required\">*</span>\n" +
7075 " <span class=\"required\">*</span>\n" +
6961 " </label>\n" +
7076 " </label>\n" +
6962 " <div class=\"col-sm-8 col-lg-9\">\n" +
7077 " <div class=\"col-sm-8 col-lg-9\">\n" +
6963 " <input class=\"form-control\" id=\"old_password\" name=\"old_password\" type=\"password\" ng-model=\"password.form.old_password\">\n" +
7078 " <input class=\"form-control\" id=\"old_password\" name=\"old_password\" type=\"password\" ng-model=\"password.form.old_password\">\n" +
6964 " </div>\n" +
7079 " </div>\n" +
6965 " </div>\n" +
7080 " </div>\n" +
6966 " <div class=\"form-group\" id=\"row-new_password\">\n" +
7081 " <div class=\"form-group\" id=\"row-new_password\">\n" +
6967 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password\"></data-form-errors>\n" +
7082 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password\"></data-form-errors>\n" +
6968 " <label for=\"new_password\" id=\"label-new_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7083 " <label for=\"new_password\" id=\"label-new_password\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6969 " New Password\n" +
7084 " New Password\n" +
6970 " <span class=\"required\">*</span>\n" +
7085 " <span class=\"required\">*</span>\n" +
6971 " </label>\n" +
7086 " </label>\n" +
6972 " <div class=\"col-sm-8 col-lg-9\">\n" +
7087 " <div class=\"col-sm-8 col-lg-9\">\n" +
6973 " <input class=\"form-control\" id=\"new_password\" name=\"new_password\" type=\"password\" ng-model=\"password.form.new_password\">\n" +
7088 " <input class=\"form-control\" id=\"new_password\" name=\"new_password\" type=\"password\" ng-model=\"password.form.new_password\">\n" +
6974 " </div>\n" +
7089 " </div>\n" +
6975 " </div>\n" +
7090 " </div>\n" +
6976 " <div class=\"form-group\" id=\"row-new_password_confirm\">\n" +
7091 " <div class=\"form-group\" id=\"row-new_password_confirm\">\n" +
6977 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password_confirm\"></data-form-errors>\n" +
7092 " <data-form-errors errors=\"password.passwordForm.ae_validation.new_password_confirm\"></data-form-errors>\n" +
6978 " <label for=\"new_password_confirm\" id=\"label-new_password_confirm\" class=\"control-label col-sm-4 col-lg-3\">\n" +
7093 " <label for=\"new_password_confirm\" id=\"label-new_password_confirm\" class=\"control-label col-sm-4 col-lg-3\">\n" +
6979 " Confirm Password\n" +
7094 " Confirm Password\n" +
6980 " <span class=\"required\">*</span>\n" +
7095 " <span class=\"required\">*</span>\n" +
6981 " </label>\n" +
7096 " </label>\n" +
6982 " <div class=\"col-sm-8 col-lg-9\">\n" +
7097 " <div class=\"col-sm-8 col-lg-9\">\n" +
6983 " <input class=\"form-control\" id=\"new_password_confirm\" name=\"new_password_confirm\" type=\"password\" ng-model=\"password.form.new_password_confirm\">\n" +
7098 " <input class=\"form-control\" id=\"new_password_confirm\" name=\"new_password_confirm\" type=\"password\" ng-model=\"password.form.new_password_confirm\">\n" +
6984 " </div>\n" +
7099 " </div>\n" +
6985 " </div>\n" +
7100 " </div>\n" +
6986 " <div class=\"form-group\" id=\"row-submit\">\n" +
7101 " <div class=\"form-group\" id=\"row-submit\">\n" +
6987 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\"></label>\n" +
7102 " <label for=\"submit\" id=\"label-submit\" class=\"control-label col-sm-4 col-lg-3\"></label>\n" +
6988 " <div class=\"col-sm-8 col-lg-9\">\n" +
7103 " <div class=\"col-sm-8 col-lg-9\">\n" +
6989 " <input class=\"form-control SubmitField btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Change Password\">\n" +
7104 " <input class=\"form-control SubmitField btn btn-primary\" id=\"submit\" name=\"submit\" type=\"submit\" value=\"Change Password\">\n" +
6990 " </div>\n" +
7105 " </div>\n" +
6991 " </div>\n" +
7106 " </div>\n" +
6992 " </form>\n" +
7107 " </form>\n" +
6993 "\n" +
7108 "\n" +
6994 " </div>\n" +
7109 " </div>\n" +
6995 " </div>\n" +
7110 " </div>\n" +
6996 "</div>\n"
7111 "</div>\n"
6997 );
7112 );
6998
7113
6999
7114
7000 $templateCache.put('templates/user/profile.html',
7115 $templateCache.put('templates/user/profile.html',
7001 "<ui-view></ui-view>"
7116 "<ui-view></ui-view>"
7002 );
7117 );
7003
7118
7004 }]);
7119 }]);
7005
7120
7006 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7121 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7007 // #
7122 // #
7008 // # This program is free software: you can redistribute it and/or modify
7123 // # This program is free software: you can redistribute it and/or modify
7009 // # it under the terms of the GNU Affero General Public License, version 3
7124 // # it under the terms of the GNU Affero General Public License, version 3
7010 // # (only), as published by the Free Software Foundation.
7125 // # (only), as published by the Free Software Foundation.
7011 // #
7126 // #
7012 // # This program is distributed in the hope that it will be useful,
7127 // # This program is distributed in the hope that it will be useful,
7013 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7128 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7014 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7129 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7015 // # GNU General Public License for more details.
7130 // # GNU General Public License for more details.
7016 // #
7131 // #
7017 // # You should have received a copy of the GNU Affero General Public License
7132 // # You should have received a copy of the GNU Affero General Public License
7018 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7133 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7019 // #
7134 // #
7020 // # This program is dual-licensed. If you wish to learn more about the
7135 // # This program is dual-licensed. If you wish to learn more about the
7021 // # AppEnlight Enterprise Edition, including its added features, Support
7136 // # AppEnlight Enterprise Edition, including its added features, Support
7022 // # services, and proprietary license terms, please see
7137 // # services, and proprietary license terms, please see
7023 // # https://rhodecode.com/licenses/
7138 // # https://rhodecode.com/licenses/
7024
7139
7140 angular.module('appenlight.components.appenlightApp', [])
7141 .component('appenlightApp', {
7142 templateUrl: 'templates/components/appenlight-app.html',
7143 controller: AppEnlightAppController
7144 });
7145
7146 AppEnlightAppController.$inject = ['$scope','$state', 'stateHolder', 'AeConfig'];
7147
7148 function AppEnlightAppController($scope, $state, stateHolder, AeConfig){
7149
7150 // to keep bw compatibility
7151 $scope.$state = $state;
7152 $scope.stateHolder = stateHolder;
7153 $scope.flash = stateHolder.flashMessages.list;
7154 $scope.closeAlert = stateHolder.flashMessages.closeAlert;
7155 $scope.AeConfig = AeConfig;
7156 }
7157
7158 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7159 // #
7160 // # This program is free software: you can redistribute it and/or modify
7161 // # it under the terms of the GNU Affero General Public License, version 3
7162 // # (only), as published by the Free Software Foundation.
7163 // #
7164 // # This program is distributed in the hope that it will be useful,
7165 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7166 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7167 // # GNU General Public License for more details.
7168 // #
7169 // # You should have received a copy of the GNU Affero General Public License
7170 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7171 // #
7172 // # This program is dual-licensed. If you wish to learn more about the
7173 // # AppEnlight Enterprise Edition, including its added features, Support
7174 // # services, and proprietary license terms, please see
7175 // # https://rhodecode.com/licenses/
7176
7177 angular.module('appenlight.components.appenlightHeader', [])
7178 .component('appenlightFooter', {
7179 templateUrl: 'templates/components/appenlight-footer.html',
7180 controller: AppEnlightFooterController
7181 });
7182
7183 ChannelstreamController.$inject = ['stateHolder', 'AeConfig'];
7184
7185 function AppEnlightFooterController(stateHolder, AeConfig){
7186 var vm = this;
7187 vm.AeConfig = AeConfig;
7188 vm.stateHolder = stateHolder;
7189 }
7190
7191 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7192 // #
7193 // # This program is free software: you can redistribute it and/or modify
7194 // # it under the terms of the GNU Affero General Public License, version 3
7195 // # (only), as published by the Free Software Foundation.
7196 // #
7197 // # This program is distributed in the hope that it will be useful,
7198 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7199 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7200 // # GNU General Public License for more details.
7201 // #
7202 // # You should have received a copy of the GNU Affero General Public License
7203 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7204 // #
7205 // # This program is dual-licensed. If you wish to learn more about the
7206 // # AppEnlight Enterprise Edition, including its added features, Support
7207 // # services, and proprietary license terms, please see
7208 // # https://rhodecode.com/licenses/
7209
7210 angular.module('appenlight.components.appenlightHeader', [])
7211 .component('appenlightHeader', {
7212 templateUrl: 'templates/components/appenlight-header.html',
7213 controller: AppEnlightHeaderController
7214 });
7215
7216 ChannelstreamController.$inject = ['$state', 'stateHolder', 'AeConfig'];
7217
7218 function AppEnlightHeaderController($state, stateHolder, AeConfig){
7219 var vm = this;
7220 vm.AeConfig = AeConfig;
7221 vm.stateHolder = stateHolder;
7222 vm.assignedReports = stateHolder.AeUser.assigned_reports;
7223 vm.latestEvents = stateHolder.AeUser.latest_events;
7224 vm.activeEvents = 0;
7225 _.each(vm.latestEvents, function (event) {
7226 if (event.status === 1 && event.end_date === null) {
7227 vm.activeEvents += 1;
7228 }
7229 });
7230
7231 vm.clickedEvent = function(event){
7232 // exception reports
7233 if (_.contains([1,2], event.event_type)){
7234 $state.go('report.list', {resource:event.resource_id, start_date:event.start_date});
7235 }
7236 // slowness reports
7237 else if (_.contains([3,4], event.event_type)){
7238 $state.go('report.list_slow', {resource:event.resource_id, start_date:event.start_date});
7239 }
7240 // uptime reports
7241 else if (_.contains([7,8], event.event_type)){
7242 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
7243 }
7244 else{
7245
7246 }
7247 }
7248 }
7249
7250 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7251 // #
7252 // # This program is free software: you can redistribute it and/or modify
7253 // # it under the terms of the GNU Affero General Public License, version 3
7254 // # (only), as published by the Free Software Foundation.
7255 // #
7256 // # This program is distributed in the hope that it will be useful,
7257 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7258 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7259 // # GNU General Public License for more details.
7260 // #
7261 // # You should have received a copy of the GNU Affero General Public License
7262 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7263 // #
7264 // # This program is dual-licensed. If you wish to learn more about the
7265 // # AppEnlight Enterprise Edition, including its added features, Support
7266 // # services, and proprietary license terms, please see
7267 // # https://rhodecode.com/licenses/
7268
7025 angular.module('appenlight.components.channelstream', [])
7269 angular.module('appenlight.components.channelstream', [])
7026 .component('channelstream', {
7270 .component('channelstream', {
7027 controller: ChannelstreamController,
7271 controller: ChannelstreamController,
7028 bindings: {
7272 bindings: {
7029 config: '='
7273 config: '='
7030 }
7274 }
7031 });
7275 });
7032
7276
7033 ChannelstreamController.$inject = ['$rootScope', 'stateHolder', 'userSelfPropertyResource'];
7277 ChannelstreamController.$inject = ['$rootScope', 'stateHolder', 'userSelfPropertyResource'];
7034
7278
7035 function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResource){
7279 function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResource){
7036 if (stateHolder.AeUser.id === null){
7280 if (stateHolder.AeUser.id === null){
7037 return
7281 return
7038 }
7282 }
7039 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
7283 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
7040 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
7284 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
7041 stateHolder.websocket.onopen = function (event) {
7285 stateHolder.websocket.onopen = function (event) {
7042
7286
7043 };
7287 };
7044 stateHolder.websocket.onmessage = function (event) {
7288 stateHolder.websocket.onmessage = function (event) {
7045 var data = JSON.parse(event.data);
7289 var data = JSON.parse(event.data);
7046 $rootScope.$apply(function (scope) {
7290 $rootScope.$apply(function (scope) {
7047 _.each(data, function (message) {
7291 _.each(data, function (message) {
7048
7292
7049 if(typeof message.message.topic !== 'undefined'){
7293 if(typeof message.message.topic !== 'undefined'){
7050 $rootScope.$broadcast(
7294 $rootScope.$emit(
7051 'channelstream-message.'+message.message.topic, message);
7295 'channelstream-message.'+message.message.topic, message);
7052 }
7296 }
7053 else{
7297 else{
7054 $rootScope.$broadcast('channelstream-message', message);
7298 $rootScope.$emit('channelstream-message', message);
7055 }
7299 }
7056 });
7300 });
7057 });
7301 });
7058 };
7302 };
7059 stateHolder.websocket.onclose = function (event) {
7303 stateHolder.websocket.onclose = function (event) {
7060
7304
7061 };
7305 };
7062
7306
7063 stateHolder.websocket.onerror = function (event) {
7307 stateHolder.websocket.onerror = function (event) {
7064
7308
7065 };
7309 };
7066 }.bind(this));
7310 }.bind(this));
7067 }
7311 }
7068
7312
7069 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7313 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7070 // #
7314 // #
7071 // # This program is free software: you can redistribute it and/or modify
7315 // # This program is free software: you can redistribute it and/or modify
7072 // # it under the terms of the GNU Affero General Public License, version 3
7316 // # it under the terms of the GNU Affero General Public License, version 3
7073 // # (only), as published by the Free Software Foundation.
7317 // # (only), as published by the Free Software Foundation.
7074 // #
7318 // #
7075 // # This program is distributed in the hope that it will be useful,
7319 // # This program is distributed in the hope that it will be useful,
7076 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7320 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7077 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7321 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7078 // # GNU General Public License for more details.
7322 // # GNU General Public License for more details.
7079 // #
7323 // #
7080 // # You should have received a copy of the GNU Affero General Public License
7324 // # You should have received a copy of the GNU Affero General Public License
7081 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7325 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7082 // #
7326 // #
7083 // # This program is dual-licensed. If you wish to learn more about the
7327 // # This program is dual-licensed. If you wish to learn more about the
7084 // # AppEnlight Enterprise Edition, including its added features, Support
7328 // # AppEnlight Enterprise Edition, including its added features, Support
7085 // # services, and proprietary license terms, please see
7329 // # services, and proprietary license terms, please see
7086 // # https://rhodecode.com/licenses/
7330 // # https://rhodecode.com/licenses/
7087
7331
7088 var aeconfig = angular.module('appenlight.config', []);
7332 var aeconfig = angular.module('appenlight.config', []);
7089 aeconfig.factory('AeConfig', function () {
7333 aeconfig.factory('AeConfig', function () {
7090 var obj = {};
7334 var obj = {};
7091 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
7335 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
7092 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
7336 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
7093 obj.plugins = decodeEncodedJSON(window.AE.plugins);
7337 obj.plugins = decodeEncodedJSON(window.AE.plugins);
7338 obj.topNav = decodeEncodedJSON(window.AE.topNav);
7094 obj.ws_url = window.AE.ws_url;
7339 obj.ws_url = window.AE.ws_url;
7095 obj.urls = window.AE.urls;
7340 obj.urls = window.AE.urls;
7096
7097 // set keys on values because we wont be able to retrieve them everywhere
7341 // set keys on values because we wont be able to retrieve them everywhere
7098 for (var key in obj.timeOptions) {
7342 for (var key in obj.timeOptions) {
7099 obj.timeOptions[key]['key'] = key;
7343 obj.timeOptions[key]['key'] = key;
7100 }
7344 }
7101 console.info('config', obj);
7345 console.info('config', obj);
7102 return obj;
7346 return obj;
7103 });
7347 });
7104
7348
7105 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7349 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7106 // #
7350 // #
7107 // # This program is free software: you can redistribute it and/or modify
7351 // # This program is free software: you can redistribute it and/or modify
7108 // # it under the terms of the GNU Affero General Public License, version 3
7352 // # it under the terms of the GNU Affero General Public License, version 3
7109 // # (only), as published by the Free Software Foundation.
7353 // # (only), as published by the Free Software Foundation.
7110 // #
7354 // #
7111 // # This program is distributed in the hope that it will be useful,
7355 // # This program is distributed in the hope that it will be useful,
7112 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7356 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7113 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7357 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7114 // # GNU General Public License for more details.
7358 // # GNU General Public License for more details.
7115 // #
7359 // #
7116 // # You should have received a copy of the GNU Affero General Public License
7360 // # You should have received a copy of the GNU Affero General Public License
7117 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7361 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7118 // #
7362 // #
7119 // # This program is dual-licensed. If you wish to learn more about the
7363 // # This program is dual-licensed. If you wish to learn more about the
7120 // # AppEnlight Enterprise Edition, including its added features, Support
7364 // # AppEnlight Enterprise Edition, including its added features, Support
7121 // # services, and proprietary license terms, please see
7365 // # services, and proprietary license terms, please see
7122 // # https://rhodecode.com/licenses/
7366 // # https://rhodecode.com/licenses/
7123
7367
7124 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
7368 angular.module('appenlight.controllers').controller('AdminApplicationsListController', AdminApplicationsListController);
7125
7369
7126 AdminApplicationsListController.$inject = ['applicationsResource'];
7370 AdminApplicationsListController.$inject = ['applicationsResource'];
7127
7371
7128 function AdminApplicationsListController(applicationsResource) {
7372 function AdminApplicationsListController(applicationsResource) {
7129
7373
7130 var vm = this;
7374 var vm = this;
7131 vm.loading = {applications: true};
7375 vm.loading = {applications: true};
7132
7376
7133 vm.applications = applicationsResource.query({
7377 vm.applications = applicationsResource.query({
7134 root_list: true,
7378 root_list: true,
7135 resource_type: 'application'
7379 resource_type: 'application'
7136 }, function (data) {
7380 }, function (data) {
7137 vm.loading = {applications: false};
7381 vm.loading = {applications: false};
7138 });
7382 });
7139 };
7383 };
7140
7384
7141 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7385 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7142 // #
7386 // #
7143 // # This program is free software: you can redistribute it and/or modify
7387 // # This program is free software: you can redistribute it and/or modify
7144 // # it under the terms of the GNU Affero General Public License, version 3
7388 // # it under the terms of the GNU Affero General Public License, version 3
7145 // # (only), as published by the Free Software Foundation.
7389 // # (only), as published by the Free Software Foundation.
7146 // #
7390 // #
7147 // # This program is distributed in the hope that it will be useful,
7391 // # This program is distributed in the hope that it will be useful,
7148 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7392 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7149 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7393 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7150 // # GNU General Public License for more details.
7394 // # GNU General Public License for more details.
7151 // #
7395 // #
7152 // # You should have received a copy of the GNU Affero General Public License
7396 // # You should have received a copy of the GNU Affero General Public License
7153 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7397 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7154 // #
7398 // #
7155 // # This program is dual-licensed. If you wish to learn more about the
7399 // # This program is dual-licensed. If you wish to learn more about the
7156 // # AppEnlight Enterprise Edition, including its added features, Support
7400 // # AppEnlight Enterprise Edition, including its added features, Support
7157 // # services, and proprietary license terms, please see
7401 // # services, and proprietary license terms, please see
7158 // # https://rhodecode.com/licenses/
7402 // # https://rhodecode.com/licenses/
7159
7403
7160 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
7404 angular.module('appenlight.controllers').controller('ConfigsListController', ConfigsListController);
7161
7405
7162 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
7406 ConfigsListController.$inject = ['configsResource', 'configsNoIdResource'];
7163
7407
7164 function ConfigsListController(configsResource, configsNoIdResource) {
7408 function ConfigsListController(configsResource, configsNoIdResource) {
7165 var vm = this;
7409 var vm = this;
7166 vm.loading = {config: true};
7410 vm.loading = {config: true};
7167
7411
7168 var filters = [
7412 var filters = [
7169 'template_footer_html:global',
7413 'template_footer_html:global',
7170 'list_groups_to_non_admins:global',
7414 'list_groups_to_non_admins:global',
7171 'per_application_reports_rate_limit:global',
7415 'per_application_reports_rate_limit:global',
7172 'per_application_logs_rate_limit:global',
7416 'per_application_logs_rate_limit:global',
7173 'per_application_metrics_rate_limit:global',
7417 'per_application_metrics_rate_limit:global',
7174 ];
7418 ];
7175
7419
7176 vm.configs = {};
7420 vm.configs = {};
7177
7421
7178 vm.configList = configsResource.query({filter: filters},
7422 vm.configList = configsResource.query({filter: filters},
7179 function (data) {
7423 function (data) {
7180 vm.loading = {config: false};
7424 vm.loading = {config: false};
7181 _.each(data, function (item) {
7425 _.each(data, function (item) {
7182 if (vm.configs[item.section] === undefined) {
7426 if (vm.configs[item.section] === undefined) {
7183 vm.configs[item.section] = {};
7427 vm.configs[item.section] = {};
7184 }
7428 }
7185 vm.configs[item.section][item.key] = item;
7429 vm.configs[item.section][item.key] = item;
7186 });
7430 });
7187 });
7431 });
7188
7432
7189 vm.save = function () {
7433 vm.save = function () {
7190 vm.loading.config = true;
7434 vm.loading.config = true;
7191 _.each(vm.configList, function (item) {
7435 _.each(vm.configList, function (item) {
7192 item.$save();
7436 item.$save();
7193 });
7437 });
7194 vm.loading.config = false;
7438 vm.loading.config = false;
7195 };
7439 };
7196
7440
7197 };
7441 };
7198
7442
7199 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7443 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7200 // #
7444 // #
7201 // # This program is free software: you can redistribute it and/or modify
7445 // # This program is free software: you can redistribute it and/or modify
7202 // # it under the terms of the GNU Affero General Public License, version 3
7446 // # it under the terms of the GNU Affero General Public License, version 3
7203 // # (only), as published by the Free Software Foundation.
7447 // # (only), as published by the Free Software Foundation.
7204 // #
7448 // #
7205 // # This program is distributed in the hope that it will be useful,
7449 // # This program is distributed in the hope that it will be useful,
7206 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7450 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7207 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7451 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7208 // # GNU General Public License for more details.
7452 // # GNU General Public License for more details.
7209 // #
7453 // #
7210 // # You should have received a copy of the GNU Affero General Public License
7454 // # You should have received a copy of the GNU Affero General Public License
7211 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7455 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7212 // #
7456 // #
7213 // # This program is dual-licensed. If you wish to learn more about the
7457 // # This program is dual-licensed. If you wish to learn more about the
7214 // # AppEnlight Enterprise Edition, including its added features, Support
7458 // # AppEnlight Enterprise Edition, including its added features, Support
7215 // # services, and proprietary license terms, please see
7459 // # services, and proprietary license terms, please see
7216 // # https://rhodecode.com/licenses/
7460 // # https://rhodecode.com/licenses/
7217
7461
7218 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
7462 angular.module('appenlight.controllers').controller('AdminGroupsCreateController', AdminGroupsCreateController);
7219
7463
7220 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
7464 AdminGroupsCreateController.$inject = ['$state', 'groupsResource', 'groupsPropertyResource', 'sectionViewResource', 'AeConfig'];
7221
7465
7222 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
7466 function AdminGroupsCreateController($state, groupsResource, groupsPropertyResource, sectionViewResource, AeConfig) {
7223
7467
7224 var vm = this;
7468 var vm = this;
7225 vm.loading = {
7469 vm.loading = {
7226 group: false,
7470 group: false,
7227 resource_permissions: false,
7471 resource_permissions: false,
7228 users: false
7472 users: false
7229 };
7473 };
7230
7474
7231 vm.form = {
7475 vm.form = {
7232 autocompleteUser: '',
7476 autocompleteUser: '',
7233 }
7477 }
7234
7478
7235
7479
7236 if (typeof $state.params.groupId !== 'undefined') {
7480 if (typeof $state.params.groupId !== 'undefined') {
7237 vm.loading.group = true;
7481 vm.loading.group = true;
7238 var groupId = $state.params.groupId;
7482 var groupId = $state.params.groupId;
7239 vm.group = groupsResource.get({groupId: groupId}, function (data) {
7483 vm.group = groupsResource.get({groupId: groupId}, function (data) {
7240 vm.loading.group = false;
7484 vm.loading.group = false;
7241 });
7485 });
7242
7486
7243 vm.resource_permissions = groupsPropertyResource.query(
7487 vm.resource_permissions = groupsPropertyResource.query(
7244 {groupId: groupId, key: 'resource_permissions'}, function (data) {
7488 {groupId: groupId, key: 'resource_permissions'}, function (data) {
7245 vm.loading.resource_permissions = false;
7489 vm.loading.resource_permissions = false;
7246 var tmpObj = {
7490 var tmpObj = {
7247 'group': {
7491 'group': {
7248 'application': {},
7492 'application': {},
7249 'dashboard': {}
7493 'dashboard': {}
7250 }
7494 }
7251 };
7495 };
7252 _.each(data, function (item) {
7496 _.each(data, function (item) {
7253
7497
7254 var section = tmpObj[item.type][item.resource_type];
7498 var section = tmpObj[item.type][item.resource_type];
7255 if (typeof section[item.resource_id] == 'undefined') {
7499 if (typeof section[item.resource_id] == 'undefined') {
7256 section[item.resource_id] = {
7500 section[item.resource_id] = {
7257 self: item,
7501 self: item,
7258 permissions: []
7502 permissions: []
7259 }
7503 }
7260 }
7504 }
7261 section[item.resource_id].permissions.push(item.perm_name);
7505 section[item.resource_id].permissions.push(item.perm_name);
7262
7506
7263 });
7507 });
7264 vm.resourcePermissions = tmpObj;
7508 vm.resourcePermissions = tmpObj;
7265 });
7509 });
7266
7510
7267 vm.users = groupsPropertyResource.query(
7511 vm.users = groupsPropertyResource.query(
7268 {groupId: groupId, key: 'users'}, function (data) {
7512 {groupId: groupId, key: 'users'}, function (data) {
7269 vm.loading.users = false;
7513 vm.loading.users = false;
7270 }, function () {
7514 }, function () {
7271 vm.loading.users = false;
7515 vm.loading.users = false;
7272 });
7516 });
7273
7517
7274 }
7518 }
7275 else {
7519 else {
7276 var groupId = null;
7520 var groupId = null;
7277 }
7521 }
7278
7522
7279 var formResponse = function (response) {
7523 var formResponse = function (response) {
7280 if (response.status === 422) {
7524 if (response.status === 422) {
7281 setServerValidation(vm.groupForm, response.data);
7525 setServerValidation(vm.groupForm, response.data);
7282 }
7526 }
7283 vm.loading.group = false;
7527 vm.loading.group = false;
7284 };
7528 };
7285
7529
7286 vm.createGroup = function () {
7530 vm.createGroup = function () {
7287 vm.loading.group = true;
7531 vm.loading.group = true;
7288 if (groupId) {
7532 if (groupId) {
7289 groupsResource.update({groupId: vm.group.id}, vm.group, function (data) {
7533 groupsResource.update({groupId: vm.group.id}, vm.group, function (data) {
7290 setServerValidation(vm.groupForm);
7534 setServerValidation(vm.groupForm);
7291 vm.loading.group = false;
7535 vm.loading.group = false;
7292 }, formResponse);
7536 }, formResponse);
7293 }
7537 }
7294 else {
7538 else {
7295 groupsResource.save(vm.group, function (data) {
7539 groupsResource.save(vm.group, function (data) {
7296 $state.go('admin.group.update', {groupId: data.id});
7540 $state.go('admin.group.update', {groupId: data.id});
7297 }, formResponse);
7541 }, formResponse);
7298 }
7542 }
7299 };
7543 };
7300
7544
7301 vm.removeUser = function (user) {
7545 vm.removeUser = function (user) {
7302 groupsPropertyResource.delete(
7546 groupsPropertyResource.delete(
7303 {groupId: groupId, key: 'users', user_name: user.user_name},
7547 {groupId: groupId, key: 'users', user_name: user.user_name},
7304 function (data) {
7548 function (data) {
7305 vm.loading.users = false;
7549 vm.loading.users = false;
7306 vm.users = _.filter(vm.users, function (item) {
7550 vm.users = _.filter(vm.users, function (item) {
7307 return item != user;
7551 return item != user;
7308 });
7552 });
7309 }, function () {
7553 }, function () {
7310 vm.loading.users = false;
7554 vm.loading.users = false;
7311 });
7555 });
7312 };
7556 };
7313
7557
7314 vm.addUser = function () {
7558 vm.addUser = function () {
7315 groupsPropertyResource.save(
7559 groupsPropertyResource.save(
7316 {groupId: groupId, key: 'users'},
7560 {groupId: groupId, key: 'users'},
7317 {user_name: vm.form.autocompleteUser},
7561 {user_name: vm.form.autocompleteUser},
7318 function (data) {
7562 function (data) {
7319 vm.loading.users = false;
7563 vm.loading.users = false;
7320 vm.users.push(data);
7564 vm.users.push(data);
7321 vm.form.autocompleteUser = '';
7565 vm.form.autocompleteUser = '';
7322 }, function () {
7566 }, function () {
7323 vm.loading.users = false;
7567 vm.loading.users = false;
7324 });
7568 });
7325 }
7569 }
7326
7570
7327 vm.searchUsers = function (searchPhrase) {
7571 vm.searchUsers = function (searchPhrase) {
7328
7572
7329 return sectionViewResource.query({
7573 return sectionViewResource.query({
7330 section: 'users_section',
7574 section: 'users_section',
7331 view: 'search_users',
7575 view: 'search_users',
7332 'user_name': searchPhrase
7576 'user_name': searchPhrase
7333 }).$promise.then(function (data) {
7577 }).$promise.then(function (data) {
7334 return _.map(data, function (item) {
7578 return _.map(data, function (item) {
7335 return item.user;
7579 return item.user;
7336 });
7580 });
7337 });
7581 });
7338 }
7582 }
7339 };
7583 };
7340
7584
7341 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7585 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7342 // #
7586 // #
7343 // # This program is free software: you can redistribute it and/or modify
7587 // # This program is free software: you can redistribute it and/or modify
7344 // # it under the terms of the GNU Affero General Public License, version 3
7588 // # it under the terms of the GNU Affero General Public License, version 3
7345 // # (only), as published by the Free Software Foundation.
7589 // # (only), as published by the Free Software Foundation.
7346 // #
7590 // #
7347 // # This program is distributed in the hope that it will be useful,
7591 // # This program is distributed in the hope that it will be useful,
7348 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7592 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7349 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7593 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7350 // # GNU General Public License for more details.
7594 // # GNU General Public License for more details.
7351 // #
7595 // #
7352 // # You should have received a copy of the GNU Affero General Public License
7596 // # You should have received a copy of the GNU Affero General Public License
7353 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7597 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7354 // #
7598 // #
7355 // # This program is dual-licensed. If you wish to learn more about the
7599 // # This program is dual-licensed. If you wish to learn more about the
7356 // # AppEnlight Enterprise Edition, including its added features, Support
7600 // # AppEnlight Enterprise Edition, including its added features, Support
7357 // # services, and proprietary license terms, please see
7601 // # services, and proprietary license terms, please see
7358 // # https://rhodecode.com/licenses/
7602 // # https://rhodecode.com/licenses/
7359
7603
7360 angular.module('appenlight.controllers').controller('AdminGroupsController', AdminGroupsController);
7604 angular.module('appenlight.controllers').controller('AdminGroupsController', AdminGroupsController);
7361
7605
7362 AdminGroupsController.$inject = ['groupsResource'];
7606 AdminGroupsController.$inject = ['groupsResource'];
7363
7607
7364 function AdminGroupsController(groupsResource) {
7608 function AdminGroupsController(groupsResource) {
7365
7609
7366 var vm = this;
7610 var vm = this;
7367 vm.loading = {groups: true};
7611 vm.loading = {groups: true};
7368
7612
7369 vm.groups = groupsResource.query({}, function (data) {
7613 vm.groups = groupsResource.query({}, function (data) {
7370 vm.loading = {groups: false};
7614 vm.loading = {groups: false};
7371 vm.activeUsers = _.reduce(vm.groups, function(memo, val){
7615 vm.activeUsers = _.reduce(vm.groups, function(memo, val){
7372 if (val.status == 1){
7616 if (val.status == 1){
7373 return memo + 1;
7617 return memo + 1;
7374 }
7618 }
7375 return memo;
7619 return memo;
7376 }, 0);
7620 }, 0);
7377
7621
7378 });
7622 });
7379
7623
7380
7624
7381 vm.removeGroup = function (group) {
7625 vm.removeGroup = function (group) {
7382 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
7626 groupsResource.remove({groupId: group.id}, function (data, responseHeaders) {
7383
7627
7384 if (data) {
7628 if (data) {
7385 var index = vm.groups.indexOf(group);
7629 var index = vm.groups.indexOf(group);
7386 if (index !== -1) {
7630 if (index !== -1) {
7387 vm.groups.splice(index, 1);
7631 vm.groups.splice(index, 1);
7388 vm.activeGroups -= 1;
7632 vm.activeGroups -= 1;
7389 }
7633 }
7390 }
7634 }
7391 });
7635 });
7392 }
7636 }
7393 };
7637 };
7394
7638
7395 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7639 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7396 // #
7640 // #
7397 // # This program is free software: you can redistribute it and/or modify
7641 // # This program is free software: you can redistribute it and/or modify
7398 // # it under the terms of the GNU Affero General Public License, version 3
7642 // # it under the terms of the GNU Affero General Public License, version 3
7399 // # (only), as published by the Free Software Foundation.
7643 // # (only), as published by the Free Software Foundation.
7400 // #
7644 // #
7401 // # This program is distributed in the hope that it will be useful,
7645 // # This program is distributed in the hope that it will be useful,
7402 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7646 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7403 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7647 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7404 // # GNU General Public License for more details.
7648 // # GNU General Public License for more details.
7405 // #
7649 // #
7406 // # You should have received a copy of the GNU Affero General Public License
7650 // # You should have received a copy of the GNU Affero General Public License
7407 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7651 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7408 // #
7652 // #
7409 // # This program is dual-licensed. If you wish to learn more about the
7653 // # This program is dual-licensed. If you wish to learn more about the
7410 // # AppEnlight Enterprise Edition, including its added features, Support
7654 // # AppEnlight Enterprise Edition, including its added features, Support
7411 // # services, and proprietary license terms, please see
7655 // # services, and proprietary license terms, please see
7412 // # https://rhodecode.com/licenses/
7656 // # https://rhodecode.com/licenses/
7413
7657
7414 angular.module('appenlight.controllers').controller('AdminPartitionsController', AdminPartitionsController);
7658 angular.module('appenlight.controllers').controller('AdminPartitionsController', AdminPartitionsController);
7415
7659
7416 AdminPartitionsController.$inject = ['sectionViewResource'];
7660 AdminPartitionsController.$inject = ['sectionViewResource'];
7417
7661
7418 function AdminPartitionsController(sectionViewResource) {
7662 function AdminPartitionsController(sectionViewResource) {
7419 var vm = this;
7663 var vm = this;
7420 vm.permanentPartitions = [];
7664 vm.permanentPartitions = [];
7421 vm.dailyPartitions = [];
7665 vm.dailyPartitions = [];
7422 vm.loading = {partitions: true};
7666 vm.loading = {partitions: true};
7423 vm.dailyChecked = false;
7667 vm.dailyChecked = false;
7424 vm.permChecked = false;
7668 vm.permChecked = false;
7425 vm.dailyConfirm = '';
7669 vm.dailyConfirm = '';
7426 vm.permConfirm = '';
7670 vm.permConfirm = '';
7427
7671
7428
7672
7429 vm.loadPartitions = function (data) {
7673 vm.loadPartitions = function (data) {
7430 var permanentPartitions = vm.transformPartitionList(
7674 var permanentPartitions = vm.transformPartitionList(
7431 data.permanent_partitions);
7675 data.permanent_partitions);
7432 var dailyPartitions = vm.transformPartitionList(
7676 var dailyPartitions = vm.transformPartitionList(
7433 data.daily_partitions);
7677 data.daily_partitions);
7434 vm.permanentPartitions = permanentPartitions;
7678 vm.permanentPartitions = permanentPartitions;
7435 vm.dailyPartitions = dailyPartitions;
7679 vm.dailyPartitions = dailyPartitions;
7436 vm.loading = {partitions: false};
7680 vm.loading = {partitions: false};
7437 };
7681 };
7438
7682
7439 vm.setCheckedList = function (scope) {
7683 vm.setCheckedList = function (scope) {
7440 var toTest = null;
7684 var toTest = null;
7441 if (scope === 'dailyPartitions'){
7685 if (scope === 'dailyPartitions'){
7442 toTest = 'dailyChecked';
7686 toTest = 'dailyChecked';
7443 }
7687 }
7444 else{
7688 else{
7445 toTest = 'permChecked';
7689 toTest = 'permChecked';
7446 }
7690 }
7447
7691
7448 if (vm[toTest]) {
7692 if (vm[toTest]) {
7449 var val = true;
7693 var val = true;
7450 }
7694 }
7451 else {
7695 else {
7452 var val = false;
7696 var val = false;
7453 }
7697 }
7454
7698
7455 _.each(vm[scope], function (item) {
7699 _.each(vm[scope], function (item) {
7456 _.each(item[1].pg, function (index) {
7700 _.each(item[1].pg, function (index) {
7457 index.checked = val;
7701 index.checked = val;
7458 });
7702 });
7459 _.each(item[1].elasticsearch, function (index) {
7703 _.each(item[1].elasticsearch, function (index) {
7460 index.checked = val;
7704 index.checked = val;
7461 });
7705 });
7462 });
7706 });
7463 }
7707 }
7464
7708
7465
7709
7466 vm.transformPartitionList = function (inputList) {
7710 vm.transformPartitionList = function (inputList) {
7467 var outputList = [];
7711 var outputList = [];
7468
7712
7469 _.each(inputList, function (item) {
7713 _.each(inputList, function (item) {
7470 var time = [item[0], {
7714 var time = [item[0], {
7471 elasticsearch: [],
7715 elasticsearch: [],
7472 pg: []
7716 pg: []
7473 }]
7717 }]
7474 _.each(item[1].pg, function (index) {
7718 _.each(item[1].pg, function (index) {
7475 time[1].pg.push({name: index, checked: false})
7719 time[1].pg.push({name: index, checked: false})
7476 });
7720 });
7477 _.each(item[1].elasticsearch, function (index) {
7721 _.each(item[1].elasticsearch, function (index) {
7478 time[1].elasticsearch.push({
7722 time[1].elasticsearch.push({
7479 name: index,
7723 name: index,
7480 checked: false
7724 checked: false
7481 })
7725 })
7482 });
7726 });
7483 outputList.push(time);
7727 outputList.push(time);
7484 });
7728 });
7485 return outputList;
7729 return outputList;
7486 };
7730 };
7487
7731
7488 sectionViewResource.get({section:'admin_section', view: 'partitions'},
7732 sectionViewResource.get({section:'admin_section', view: 'partitions'},
7489 vm.loadPartitions);
7733 vm.loadPartitions);
7490
7734
7491 vm.partitionsDelete = function (partitionType) {
7735 vm.partitionsDelete = function (partitionType) {
7492 var es_indices = [];
7736 var es_indices = [];
7493 var pg_indices = [];
7737 var pg_indices = [];
7494 _.each(vm[partitionType], function (item) {
7738 _.each(vm[partitionType], function (item) {
7495 _.each(item[1].pg, function (index) {
7739 _.each(item[1].pg, function (index) {
7496 if (index.checked) {
7740 if (index.checked) {
7497 pg_indices.push(index.name)
7741 pg_indices.push(index.name)
7498 }
7742 }
7499 });
7743 });
7500 _.each(item[1].elasticsearch, function (index) {
7744 _.each(item[1].elasticsearch, function (index) {
7501 if (index.checked) {
7745 if (index.checked) {
7502 es_indices.push(index.name)
7746 es_indices.push(index.name)
7503 }
7747 }
7504 });
7748 });
7505 });
7749 });
7506
7750
7507
7751
7508 vm.loading = {partitions: true};
7752 vm.loading = {partitions: true};
7509 sectionViewResource.save({section:'admin_section',
7753 sectionViewResource.save({section:'admin_section',
7510 view: 'partitions_remove'}, {
7754 view: 'partitions_remove'}, {
7511 es_indices: es_indices,
7755 es_indices: es_indices,
7512 pg_indices: pg_indices,
7756 pg_indices: pg_indices,
7513 confirm: 'CONFIRM'
7757 confirm: 'CONFIRM'
7514 }, vm.loadPartitions);
7758 }, vm.loadPartitions);
7515
7759
7516 }
7760 }
7517
7761
7518 }
7762 }
7519
7763
7520 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7764 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7521 // #
7765 // #
7522 // # This program is free software: you can redistribute it and/or modify
7766 // # This program is free software: you can redistribute it and/or modify
7523 // # it under the terms of the GNU Affero General Public License, version 3
7767 // # it under the terms of the GNU Affero General Public License, version 3
7524 // # (only), as published by the Free Software Foundation.
7768 // # (only), as published by the Free Software Foundation.
7525 // #
7769 // #
7526 // # This program is distributed in the hope that it will be useful,
7770 // # This program is distributed in the hope that it will be useful,
7527 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7771 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7528 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7772 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7529 // # GNU General Public License for more details.
7773 // # GNU General Public License for more details.
7530 // #
7774 // #
7531 // # You should have received a copy of the GNU Affero General Public License
7775 // # You should have received a copy of the GNU Affero General Public License
7532 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7776 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7533 // #
7777 // #
7534 // # This program is dual-licensed. If you wish to learn more about the
7778 // # This program is dual-licensed. If you wish to learn more about the
7535 // # AppEnlight Enterprise Edition, including its added features, Support
7779 // # AppEnlight Enterprise Edition, including its added features, Support
7536 // # services, and proprietary license terms, please see
7780 // # services, and proprietary license terms, please see
7537 // # https://rhodecode.com/licenses/
7781 // # https://rhodecode.com/licenses/
7538
7782
7539 angular.module('appenlight.controllers').controller('AdminSystemController', AdminSystemController);
7783 angular.module('appenlight.controllers').controller('AdminSystemController', AdminSystemController);
7540
7784
7541 AdminSystemController.$inject = ['sectionViewResource'];
7785 AdminSystemController.$inject = ['sectionViewResource'];
7542
7786
7543 function AdminSystemController(sectionViewResource) {
7787 function AdminSystemController(sectionViewResource) {
7544 var vm = this;
7788 var vm = this;
7545 vm.tables = [];
7789 vm.tables = [];
7546 vm.loading = {system: true};
7790 vm.loading = {system: true};
7547 sectionViewResource.get({
7791 sectionViewResource.get({
7548 section: 'admin_section',
7792 section: 'admin_section',
7549 view: 'system'
7793 view: 'system'
7550 }, null, function (data) {
7794 }, null, function (data) {
7551 vm.DBtables = data.db_tables;
7795 vm.DBtables = data.db_tables;
7552 vm.ESIndices = data.es_indices;
7796 vm.ESIndices = data.es_indices;
7553 vm.queueStats = data.queue_stats;
7797 vm.queueStats = data.queue_stats;
7554 vm.systemLoad = data.system_load;
7798 vm.systemLoad = data.system_load;
7555 vm.packages = data.packages;
7799 vm.packages = data.packages;
7556 vm.processInfo = data.process_info;
7800 vm.processInfo = data.process_info;
7557 vm.disks = data.disks;
7801 vm.disks = data.disks;
7558 vm.memory = data.memory;
7802 vm.memory = data.memory;
7559 vm.selfInfo = data.self_info;
7803 vm.selfInfo = data.self_info;
7560
7804
7561 vm.loading.system = false;
7805 vm.loading.system = false;
7562 });
7806 });
7563 };
7807 };
7564
7808
7565 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7809 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7566 // #
7810 // #
7567 // # This program is free software: you can redistribute it and/or modify
7811 // # This program is free software: you can redistribute it and/or modify
7568 // # it under the terms of the GNU Affero General Public License, version 3
7812 // # it under the terms of the GNU Affero General Public License, version 3
7569 // # (only), as published by the Free Software Foundation.
7813 // # (only), as published by the Free Software Foundation.
7570 // #
7814 // #
7571 // # This program is distributed in the hope that it will be useful,
7815 // # This program is distributed in the hope that it will be useful,
7572 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7816 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7573 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7817 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7574 // # GNU General Public License for more details.
7818 // # GNU General Public License for more details.
7575 // #
7819 // #
7576 // # You should have received a copy of the GNU Affero General Public License
7820 // # You should have received a copy of the GNU Affero General Public License
7577 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7821 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7578 // #
7822 // #
7579 // # This program is dual-licensed. If you wish to learn more about the
7823 // # This program is dual-licensed. If you wish to learn more about the
7580 // # AppEnlight Enterprise Edition, including its added features, Support
7824 // # AppEnlight Enterprise Edition, including its added features, Support
7581 // # services, and proprietary license terms, please see
7825 // # services, and proprietary license terms, please see
7582 // # https://rhodecode.com/licenses/
7826 // # https://rhodecode.com/licenses/
7583
7827
7584 angular.module('appenlight.controllers').controller('AdminUsersCreateController', AdminUsersCreateController);
7828 angular.module('appenlight.controllers').controller('AdminUsersCreateController', AdminUsersCreateController);
7585
7829
7586 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
7830 AdminUsersCreateController.$inject = ['$state', 'usersResource', 'usersPropertyResource', 'sectionViewResource', 'AeConfig'];
7587
7831
7588 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
7832 function AdminUsersCreateController($state, usersResource, usersPropertyResource, sectionViewResource, AeConfig) {
7589
7833
7590 var vm = this;
7834 var vm = this;
7591 vm.loading = {user: false};
7835 vm.loading = {user: false};
7592
7836
7593
7837
7594 if (typeof $state.params.userId !== 'undefined') {
7838 if (typeof $state.params.userId !== 'undefined') {
7595 vm.loading.user = true;
7839 vm.loading.user = true;
7596 var userId = $state.params.userId;
7840 var userId = $state.params.userId;
7597 vm.user = usersResource.get({userId: userId}, function (data) {
7841 vm.user = usersResource.get({userId: userId}, function (data) {
7598 vm.loading.user = false;
7842 vm.loading.user = false;
7599 // cast to true for angular checkbox
7843 // cast to true for angular checkbox
7600 if (vm.user.status === 1) {
7844 if (vm.user.status === 1) {
7601 vm.user.status = true;
7845 vm.user.status = true;
7602 }
7846 }
7603 });
7847 });
7604
7848
7605 vm.resource_permissions = usersPropertyResource.query(
7849 vm.resource_permissions = usersPropertyResource.query(
7606 {userId: userId, key: 'resource_permissions'}, function (data) {
7850 {userId: userId, key: 'resource_permissions'}, function (data) {
7607 vm.loading.resource_permissions = false;
7851 vm.loading.resource_permissions = false;
7608 var tmpObj = {
7852 var tmpObj = {
7609 'user': {
7853 'user': {
7610 'application': {},
7854 'application': {},
7611 'dashboard': {}
7855 'dashboard': {}
7612 },
7856 },
7613 'group': {
7857 'group': {
7614 'application': {},
7858 'application': {},
7615 'dashboard': {}
7859 'dashboard': {}
7616 }
7860 }
7617 };
7861 };
7618 _.each(data, function (item) {
7862 _.each(data, function (item) {
7619
7863
7620 var section = tmpObj[item.type][item.resource_type];
7864 var section = tmpObj[item.type][item.resource_type];
7621 if (typeof section[item.resource_id] == 'undefined'){
7865 if (typeof section[item.resource_id] == 'undefined'){
7622 section[item.resource_id] = {
7866 section[item.resource_id] = {
7623 self:item,
7867 self:item,
7624 permissions: []
7868 permissions: []
7625 }
7869 }
7626 }
7870 }
7627 section[item.resource_id].permissions.push(item.perm_name);
7871 section[item.resource_id].permissions.push(item.perm_name);
7628
7872
7629 });
7873 });
7630 vm.resourcePermissions = tmpObj;
7874 vm.resourcePermissions = tmpObj;
7631 });
7875 });
7632
7876
7633 }
7877 }
7634 else {
7878 else {
7635 var userId = null;
7879 var userId = null;
7636 vm.user = {
7880 vm.user = {
7637 status: true
7881 status: true
7638 }
7882 }
7639 }
7883 }
7640
7884
7641 var formResponse = function (response) {
7885 var formResponse = function (response) {
7642 if (response.status == 422) {
7886 if (response.status == 422) {
7643 setServerValidation(vm.profileForm, response.data);
7887 setServerValidation(vm.profileForm, response.data);
7644 }
7888 }
7645 vm.loading.user = false;
7889 vm.loading.user = false;
7646 }
7890 }
7647
7891
7648 vm.createUser = function () {
7892 vm.createUser = function () {
7649 vm.loading.user = true;
7893 vm.loading.user = true;
7650
7894
7651 if (userId) {
7895 if (userId) {
7652 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
7896 usersResource.update({userId: vm.user.id}, vm.user, function (data) {
7653 setServerValidation(vm.profileForm);
7897 setServerValidation(vm.profileForm);
7654 vm.loading.user = false;
7898 vm.loading.user = false;
7655 }, formResponse);
7899 }, formResponse);
7656 }
7900 }
7657 else {
7901 else {
7658 usersResource.save(vm.user, function (data) {
7902 usersResource.save(vm.user, function (data) {
7659 $state.go('admin.user.update', {userId: data.id});
7903 $state.go('admin.user.update', {userId: data.id});
7660 }, formResponse);
7904 }, formResponse);
7661 }
7905 }
7662 }
7906 }
7663
7907
7664 vm.generatePassword = function () {
7908 vm.generatePassword = function () {
7665 var length = 8;
7909 var length = 8;
7666 var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
7910 var charset = "abcdefghijklnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
7667 vm.gen_pass = "";
7911 vm.gen_pass = "";
7668 for (var i = 0, n = charset.length; i < length; ++i) {
7912 for (var i = 0, n = charset.length; i < length; ++i) {
7669 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
7913 vm.gen_pass += charset.charAt(Math.floor(Math.random() * n));
7670 }
7914 }
7671 vm.user.user_password = '' + vm.gen_pass;
7915 vm.user.user_password = '' + vm.gen_pass;
7672
7916
7673 }
7917 }
7674
7918
7675 vm.reloginUser = function () {
7919 vm.reloginUser = function () {
7676 sectionViewResource.get({
7920 sectionViewResource.get({
7677 section: 'admin_section', view: 'relogin_user',
7921 section: 'admin_section', view: 'relogin_user',
7678 user_id: vm.user.id
7922 user_id: vm.user.id
7679 }, function () {
7923 }, function () {
7680 window.location = AeConfig.urls.baseUrl;
7924 window.location = AeConfig.urls.baseUrl;
7681 });
7925 });
7682
7926
7683 }
7927 }
7684 };
7928 };
7685
7929
7686 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7930 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7687 // #
7931 // #
7688 // # This program is free software: you can redistribute it and/or modify
7932 // # This program is free software: you can redistribute it and/or modify
7689 // # it under the terms of the GNU Affero General Public License, version 3
7933 // # it under the terms of the GNU Affero General Public License, version 3
7690 // # (only), as published by the Free Software Foundation.
7934 // # (only), as published by the Free Software Foundation.
7691 // #
7935 // #
7692 // # This program is distributed in the hope that it will be useful,
7936 // # This program is distributed in the hope that it will be useful,
7693 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7937 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7694 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7938 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7695 // # GNU General Public License for more details.
7939 // # GNU General Public License for more details.
7696 // #
7940 // #
7697 // # You should have received a copy of the GNU Affero General Public License
7941 // # You should have received a copy of the GNU Affero General Public License
7698 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7942 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7699 // #
7943 // #
7700 // # This program is dual-licensed. If you wish to learn more about the
7944 // # This program is dual-licensed. If you wish to learn more about the
7701 // # AppEnlight Enterprise Edition, including its added features, Support
7945 // # AppEnlight Enterprise Edition, including its added features, Support
7702 // # services, and proprietary license terms, please see
7946 // # services, and proprietary license terms, please see
7703 // # https://rhodecode.com/licenses/
7947 // # https://rhodecode.com/licenses/
7704
7948
7705 angular.module('appenlight.controllers').controller('AdminUsersController', AdminUsersController);
7949 angular.module('appenlight.controllers').controller('AdminUsersController', AdminUsersController);
7706
7950
7707 AdminUsersController.$inject = ['usersResource'];
7951 AdminUsersController.$inject = ['usersResource'];
7708
7952
7709 function AdminUsersController(usersResource) {
7953 function AdminUsersController(usersResource) {
7710
7954
7711 var vm = this;
7955 var vm = this;
7712 vm.loading = {users: true};
7956 vm.loading = {users: true};
7713
7957
7714 vm.users = usersResource.query({}, function (data) {
7958 vm.users = usersResource.query({}, function (data) {
7715 vm.loading = {users: false};
7959 vm.loading = {users: false};
7716 vm.activeUsers = _.reduce(vm.users, function(memo, val){
7960 vm.activeUsers = _.reduce(vm.users, function(memo, val){
7717 if (val.status == 1){
7961 if (val.status == 1){
7718 return memo + 1;
7962 return memo + 1;
7719 }
7963 }
7720 return memo;
7964 return memo;
7721 }, 0);
7965 }, 0);
7722
7966
7723 });
7967 });
7724
7968
7725
7969
7726 vm.removeUser = function (user) {
7970 vm.removeUser = function (user) {
7727 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
7971 usersResource.remove({userId: user.id}, function (data, responseHeaders) {
7728
7972
7729 if (data) {
7973 if (data) {
7730 var index = vm.users.indexOf(user);
7974 var index = vm.users.indexOf(user);
7731 if (index !== -1) {
7975 if (index !== -1) {
7732 vm.users.splice(index, 1);
7976 vm.users.splice(index, 1);
7733 vm.activeUsers -= 1;
7977 vm.activeUsers -= 1;
7734 }
7978 }
7735 }
7979 }
7736 });
7980 });
7737 }
7981 }
7738 };
7982 };
7739
7983
7740 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7984 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7741 // #
7985 // #
7742 // # This program is free software: you can redistribute it and/or modify
7986 // # This program is free software: you can redistribute it and/or modify
7743 // # it under the terms of the GNU Affero General Public License, version 3
7987 // # it under the terms of the GNU Affero General Public License, version 3
7744 // # (only), as published by the Free Software Foundation.
7988 // # (only), as published by the Free Software Foundation.
7745 // #
7989 // #
7746 // # This program is distributed in the hope that it will be useful,
7990 // # This program is distributed in the hope that it will be useful,
7747 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7991 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7748 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7992 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7749 // # GNU General Public License for more details.
7993 // # GNU General Public License for more details.
7750 // #
7994 // #
7751 // # You should have received a copy of the GNU Affero General Public License
7995 // # You should have received a copy of the GNU Affero General Public License
7752 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7996 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7753 // #
7997 // #
7754 // # This program is dual-licensed. If you wish to learn more about the
7998 // # This program is dual-licensed. If you wish to learn more about the
7755 // # AppEnlight Enterprise Edition, including its added features, Support
7999 // # AppEnlight Enterprise Edition, including its added features, Support
7756 // # services, and proprietary license terms, please see
8000 // # services, and proprietary license terms, please see
7757 // # https://rhodecode.com/licenses/
8001 // # https://rhodecode.com/licenses/
7758
8002
7759 angular.module('appenlight.controllers')
8003 angular.module('appenlight.controllers')
7760 .controller('ApplicationsUpdateController', ApplicationsUpdateController)
8004 .controller('ApplicationsUpdateController', ApplicationsUpdateController)
7761
8005
7762 ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder'];
8006 ApplicationsUpdateController.$inject = ['$state', 'applicationsNoIdResource', 'applicationsResource', 'applicationsPropertyResource', 'stateHolder'];
7763
8007
7764 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
8008 function ApplicationsUpdateController($state, applicationsNoIdResource, applicationsResource, applicationsPropertyResource, stateHolder) {
7765 'use strict';
8009 'use strict';
7766
8010
7767 var vm = this;
8011 var vm = this;
7768 vm.loading = {application: false};
8012 vm.loading = {application: false};
7769
8013
7770 vm.groupingOptions = [
8014 vm.groupingOptions = [
7771 ['url_type', 'Error Type + location'],
8015 ['url_type', 'Error Type + location'],
7772 ['url_traceback', 'Traceback + location'],
8016 ['url_traceback', 'Traceback + location'],
7773 ['traceback_server', 'Traceback + Server'],
8017 ['traceback_server', 'Traceback + Server'],
7774 ];
8018 ];
7775
8019
7776 var resourceId = $state.params.resourceId;
8020 var resourceId = $state.params.resourceId;
7777
8021
7778
8022
7779 var options = {};
8023 var options = {};
7780
8024
7781 vm.momentJs = moment;
8025 vm.momentJs = moment;
7782
8026
7783 vm.formTransferModel = {password:''};
8027 vm.formTransferModel = {password:''};
7784
8028
7785 // set initial data
8029 // set initial data
7786
8030
7787 if (resourceId === 'new') {
8031 if (resourceId === 'new') {
7788 vm.resource = {
8032 vm.resource = {
7789 resource_id: null,
8033 resource_id: null,
7790 slow_report_threshold: 10,
8034 slow_report_threshold: 10,
7791 error_report_threshold: 10,
8035 error_report_threshold: 10,
7792 allow_permanent_storage: true,
8036 allow_permanent_storage: true,
7793 default_grouping: vm.groupingOptions[1][0]
8037 default_grouping: vm.groupingOptions[1][0]
7794 };
8038 };
7795 }
8039 }
7796 else {
8040 else {
7797 vm.loading.application = true;
8041 vm.loading.application = true;
7798 vm.resource = applicationsResource.get({
8042 vm.resource = applicationsResource.get({
7799 'resourceId': resourceId
8043 'resourceId': resourceId
7800 }, function (data) {
8044 }, function (data) {
7801 vm.loading.application = false;
8045 vm.loading.application = false;
7802 });
8046 });
7803 }
8047 }
7804
8048
7805
8049
7806 vm.updateBasicForm = function () {
8050 vm.updateBasicForm = function () {
7807 vm.loading.application = true;
8051 vm.loading.application = true;
7808 if (vm.resource.resource_id === null) {
8052 if (vm.resource.resource_id === null) {
7809 applicationsNoIdResource.save(null, vm.resource, function (data) {
8053 applicationsNoIdResource.save(null, vm.resource, function (data) {
7810 stateHolder.AeUser.addApplication(data);
8054 stateHolder.AeUser.addApplication(data);
7811 $state.go('applications.update', {resourceId: data.resource_id});
8055 $state.go('applications.update', {resourceId: data.resource_id});
7812 setServerValidation(vm.BasicForm);
8056 setServerValidation(vm.BasicForm);
7813 }, function (response) {
8057 }, function (response) {
7814 if (response.status == 422) {
8058 if (response.status == 422) {
7815 setServerValidation(vm.BasicForm, response.data);
8059 setServerValidation(vm.BasicForm, response.data);
7816 }
8060 }
7817 vm.loading.application = false;
8061 vm.loading.application = false;
7818
8062
7819 });
8063 });
7820 }
8064 }
7821 else {
8065 else {
7822 applicationsResource.update({resourceId: vm.resource.resource_id},
8066 applicationsResource.update({resourceId: vm.resource.resource_id},
7823 vm.resource, function (data) {
8067 vm.resource, function (data) {
7824 vm.resource = data;
8068 vm.resource = data;
7825 vm.loading.application = false;
8069 vm.loading.application = false;
7826 setServerValidation(vm.BasicForm);
8070 setServerValidation(vm.BasicForm);
7827 }, function (response) {
8071 }, function (response) {
7828 if (response.status == 422) {
8072 if (response.status == 422) {
7829 setServerValidation(vm.BasicForm, response.data);
8073 setServerValidation(vm.BasicForm, response.data);
7830 }
8074 }
7831 vm.loading.application = false;
8075 vm.loading.application = false;
7832 });
8076 });
7833 }
8077 }
7834 };
8078 };
7835
8079
7836 vm.addRule = function () {
8080 vm.addRule = function () {
7837
8081
7838 applicationsPropertyResource.save({
8082 applicationsPropertyResource.save({
7839 resourceId: vm.resource.resource_id,
8083 resourceId: vm.resource.resource_id,
7840 key: 'postprocessing_rules'
8084 key: 'postprocessing_rules'
7841 }, null,
8085 }, null,
7842 function (data) {
8086 function (data) {
7843 vm.resource.postprocessing_rules.push(data);
8087 vm.resource.postprocessing_rules.push(data);
7844 }
8088 }
7845 );
8089 );
7846 };
8090 };
7847
8091
7848 vm.regenerateAPIKeys = function(){
8092 vm.regenerateAPIKeys = function(){
7849 vm.loading.application = true;
8093 vm.loading.application = true;
7850 applicationsPropertyResource.save({
8094 applicationsPropertyResource.save({
7851 resourceId: vm.resource.resource_id,
8095 resourceId: vm.resource.resource_id,
7852 key: 'api_key'
8096 key: 'api_key'
7853 }, {password: vm.regenerateAPIKeysPassword},
8097 }, {password: vm.regenerateAPIKeysPassword},
7854 function (data) {
8098 function (data) {
7855 vm.resource = data;
8099 vm.resource = data;
7856 vm.loading.application = false;
8100 vm.loading.application = false;
7857 vm.regenerateAPIKeysPassword = '';
8101 vm.regenerateAPIKeysPassword = '';
7858 setServerValidation(vm.regenerateAPIKeysForm);
8102 setServerValidation(vm.regenerateAPIKeysForm);
7859 },
8103 },
7860 function (response) {
8104 function (response) {
7861 if (response.status == 422) {
8105 if (response.status == 422) {
7862 setServerValidation(vm.regenerateAPIKeysForm, response.data);
8106 setServerValidation(vm.regenerateAPIKeysForm, response.data);
7863
8107
7864 }
8108 }
7865 vm.loading.application = false;
8109 vm.loading.application = false;
7866 }
8110 }
7867 )
8111 )
7868 };
8112 };
7869
8113
7870 vm.deleteApplication = function(){
8114 vm.deleteApplication = function(){
7871 vm.loading.application = true;
8115 vm.loading.application = true;
7872 applicationsPropertyResource.update({
8116 applicationsPropertyResource.update({
7873 resourceId: vm.resource.resource_id,
8117 resourceId: vm.resource.resource_id,
7874 key: 'delete_resource'
8118 key: 'delete_resource'
7875 }, vm.formDeleteModel,
8119 }, vm.formDeleteModel,
7876 function (data) {
8120 function (data) {
7877 stateHolder.AeUser.removeApplicationById(vm.resource.resource_id);
8121 stateHolder.AeUser.removeApplicationById(vm.resource.resource_id);
7878 $state.go('applications.list');
8122 $state.go('applications.list');
7879 },
8123 },
7880 function (response) {
8124 function (response) {
7881 if (response.status == 422) {
8125 if (response.status == 422) {
7882 setServerValidation(vm.formDelete, response.data);
8126 setServerValidation(vm.formDelete, response.data);
7883
8127
7884 }
8128 }
7885 vm.loading.application = false;
8129 vm.loading.application = false;
7886 }
8130 }
7887 );
8131 );
7888 };
8132 };
7889
8133
7890 vm.transferApplication = function(){
8134 vm.transferApplication = function(){
7891 vm.loading.application = true;
8135 vm.loading.application = true;
7892 applicationsPropertyResource.update({
8136 applicationsPropertyResource.update({
7893 resourceId: vm.resource.resource_id,
8137 resourceId: vm.resource.resource_id,
7894 key: 'owner'
8138 key: 'owner'
7895 }, vm.formTransferModel,
8139 }, vm.formTransferModel,
7896 function (data) {
8140 function (data) {
7897 $state.go('applications.list');
8141 $state.go('applications.list');
7898 },
8142 },
7899 function (response) {
8143 function (response) {
7900 if (response.status == 422) {
8144 if (response.status == 422) {
7901 setServerValidation(vm.formTransfer, response.data);
8145 setServerValidation(vm.formTransfer, response.data);
7902
8146
7903 }
8147 }
7904 vm.loading.application = false;
8148 vm.loading.application = false;
7905 }
8149 }
7906 )
8150 )
7907 }
8151 }
7908
8152
7909 }
8153 }
7910
8154
7911 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8155 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
7912 // #
8156 // #
7913 // # This program is free software: you can redistribute it and/or modify
8157 // # This program is free software: you can redistribute it and/or modify
7914 // # it under the terms of the GNU Affero General Public License, version 3
8158 // # it under the terms of the GNU Affero General Public License, version 3
7915 // # (only), as published by the Free Software Foundation.
8159 // # (only), as published by the Free Software Foundation.
7916 // #
8160 // #
7917 // # This program is distributed in the hope that it will be useful,
8161 // # This program is distributed in the hope that it will be useful,
7918 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8162 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
7919 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8163 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7920 // # GNU General Public License for more details.
8164 // # GNU General Public License for more details.
7921 // #
8165 // #
7922 // # You should have received a copy of the GNU Affero General Public License
8166 // # You should have received a copy of the GNU Affero General Public License
7923 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8167 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
7924 // #
8168 // #
7925 // # This program is dual-licensed. If you wish to learn more about the
8169 // # This program is dual-licensed. If you wish to learn more about the
7926 // # AppEnlight Enterprise Edition, including its added features, Support
8170 // # AppEnlight Enterprise Edition, including its added features, Support
7927 // # services, and proprietary license terms, please see
8171 // # services, and proprietary license terms, please see
7928 // # https://rhodecode.com/licenses/
8172 // # https://rhodecode.com/licenses/
7929
8173
7930 angular.module('appenlight.controllers')
8174 angular.module('appenlight.controllers')
7931 .controller('IntegrationController', IntegrationController)
8175 .controller('IntegrationController', IntegrationController)
7932
8176
7933 IntegrationController.$inject = ['$state', 'integrationResource'];
8177 IntegrationController.$inject = ['$state', 'integrationResource'];
7934
8178
7935 function IntegrationController($state, integrationResource) {
8179 function IntegrationController($state, integrationResource) {
7936
8180
7937 var vm = this;
8181 var vm = this;
7938 vm.loading = {integration: true};
8182 vm.loading = {integration: true};
7939 vm.config = integrationResource.get(
8183 vm.config = integrationResource.get(
7940 {
8184 {
7941 integration: $state.params.integration,
8185 integration: $state.params.integration,
7942 action: 'setup',
8186 action: 'setup',
7943 resourceId: $state.params.resourceId
8187 resourceId: $state.params.resourceId
7944 }, function (data) {
8188 }, function (data) {
7945 vm.loading.integration = false;
8189 vm.loading.integration = false;
7946 });
8190 });
7947
8191
7948 vm.configureIntegration = function () {
8192 vm.configureIntegration = function () {
7949 console.info('configureIntegration');
8193 console.info('configureIntegration');
7950 vm.loading.integration = true;
8194 vm.loading.integration = true;
7951 integrationResource.save(
8195 integrationResource.save(
7952 {
8196 {
7953 integration: $state.params.integration,
8197 integration: $state.params.integration,
7954 action: 'setup',
8198 action: 'setup',
7955 resourceId: $state.params.resourceId
8199 resourceId: $state.params.resourceId
7956 }, vm.config, function (data) {
8200 }, vm.config, function (data) {
7957 vm.loading.integration = false;
8201 vm.loading.integration = false;
7958 setServerValidation(vm.integrationForm);
8202 setServerValidation(vm.integrationForm);
7959 }, function (response) {
8203 }, function (response) {
7960 if (response.status == 422) {
8204 if (response.status == 422) {
7961 setServerValidation(vm.integrationForm, response.data);
8205 setServerValidation(vm.integrationForm, response.data);
7962 }
8206 }
7963 vm.loading.integration = false;
8207 vm.loading.integration = false;
7964 });
8208 });
7965 };
8209 };
7966
8210
7967 vm.removeIntegration = function () {
8211 vm.removeIntegration = function () {
7968 console.info('removeIntegration');
8212 console.info('removeIntegration');
7969 integrationResource.remove({
8213 integrationResource.remove({
7970 integration: $state.params.integration,
8214 integration: $state.params.integration,
7971 resourceId: $state.params.resourceId,
8215 resourceId: $state.params.resourceId,
7972 action: 'delete'
8216 action: 'delete'
7973 },
8217 },
7974 function () {
8218 function () {
7975 $state.go('applications.integrations',
8219 $state.go('applications.integrations',
7976 {resourceId: $state.params.resourceId});
8220 {resourceId: $state.params.resourceId});
7977 }
8221 }
7978 );
8222 );
7979 }
8223 }
7980
8224
7981 vm.testIntegration = function(to_test){
8225 vm.testIntegration = function(to_test){
7982 console.info('testIntegration', to_test);
8226 console.info('testIntegration', to_test);
7983 vm.loading.integration = true;
8227 vm.loading.integration = true;
7984 integrationResource.save(
8228 integrationResource.save(
7985 {
8229 {
7986 integration: $state.params.integration,
8230 integration: $state.params.integration,
7987 action: 'test_'+ to_test,
8231 action: 'test_'+ to_test,
7988 resourceId: $state.params.resourceId
8232 resourceId: $state.params.resourceId
7989 }, vm.config, function (data) {
8233 }, vm.config, function (data) {
7990 vm.loading.integration = false;
8234 vm.loading.integration = false;
7991 }, function (response) {
8235 }, function (response) {
7992 vm.loading.integration = false;
8236 vm.loading.integration = false;
7993 });
8237 });
7994 }
8238 }
7995
8239
7996
8240
7997 }
8241 }
7998
8242
7999 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8243 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8000 // #
8244 // #
8001 // # This program is free software: you can redistribute it and/or modify
8245 // # This program is free software: you can redistribute it and/or modify
8002 // # it under the terms of the GNU Affero General Public License, version 3
8246 // # it under the terms of the GNU Affero General Public License, version 3
8003 // # (only), as published by the Free Software Foundation.
8247 // # (only), as published by the Free Software Foundation.
8004 // #
8248 // #
8005 // # This program is distributed in the hope that it will be useful,
8249 // # This program is distributed in the hope that it will be useful,
8006 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8250 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8007 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8251 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8008 // # GNU General Public License for more details.
8252 // # GNU General Public License for more details.
8009 // #
8253 // #
8010 // # You should have received a copy of the GNU Affero General Public License
8254 // # You should have received a copy of the GNU Affero General Public License
8011 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8255 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8012 // #
8256 // #
8013 // # This program is dual-licensed. If you wish to learn more about the
8257 // # This program is dual-licensed. If you wish to learn more about the
8014 // # AppEnlight Enterprise Edition, including its added features, Support
8258 // # AppEnlight Enterprise Edition, including its added features, Support
8015 // # services, and proprietary license terms, please see
8259 // # services, and proprietary license terms, please see
8016 // # https://rhodecode.com/licenses/
8260 // # https://rhodecode.com/licenses/
8017
8261
8018 angular.module('appenlight.controllers')
8262 angular.module('appenlight.controllers')
8019 .controller('IntegrationsListController', IntegrationsListController)
8263 .controller('IntegrationsListController', IntegrationsListController)
8020
8264
8021 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
8265 IntegrationsListController.$inject = ['$state', 'applicationsResource'];
8022
8266
8023 function IntegrationsListController($state, applicationsResource) {
8267 function IntegrationsListController($state, applicationsResource) {
8024
8268
8025 var vm = this;
8269 var vm = this;
8026 vm.loading = {application: true};
8270 vm.loading = {application: true};
8027 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
8271 vm.resource = applicationsResource.get({resourceId: $state.params.resourceId}, function (data) {
8028 vm.loading.application = false;
8272 vm.loading.application = false;
8029 $state.current.data.resource = vm.resource;
8273 $state.current.data.resource = vm.resource;
8030 });
8274 });
8031 }
8275 }
8032
8276
8033 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8277 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8034 // #
8278 // #
8035 // # This program is free software: you can redistribute it and/or modify
8279 // # This program is free software: you can redistribute it and/or modify
8036 // # it under the terms of the GNU Affero General Public License, version 3
8280 // # it under the terms of the GNU Affero General Public License, version 3
8037 // # (only), as published by the Free Software Foundation.
8281 // # (only), as published by the Free Software Foundation.
8038 // #
8282 // #
8039 // # This program is distributed in the hope that it will be useful,
8283 // # This program is distributed in the hope that it will be useful,
8040 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8284 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8041 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8285 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8042 // # GNU General Public License for more details.
8286 // # GNU General Public License for more details.
8043 // #
8287 // #
8044 // # You should have received a copy of the GNU Affero General Public License
8288 // # You should have received a copy of the GNU Affero General Public License
8045 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8289 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8046 // #
8290 // #
8047 // # This program is dual-licensed. If you wish to learn more about the
8291 // # This program is dual-licensed. If you wish to learn more about the
8048 // # AppEnlight Enterprise Edition, including its added features, Support
8292 // # AppEnlight Enterprise Edition, including its added features, Support
8049 // # services, and proprietary license terms, please see
8293 // # services, and proprietary license terms, please see
8050 // # https://rhodecode.com/licenses/
8294 // # https://rhodecode.com/licenses/
8051
8295
8052 angular.module('appenlight.controllers')
8296 angular.module('appenlight.controllers')
8053 .controller('ApplicationsListController', ApplicationsListController)
8297 .controller('ApplicationsListController', ApplicationsListController)
8054
8298
8055 ApplicationsListController.$inject = ['applicationsResource'];
8299 ApplicationsListController.$inject = ['applicationsResource'];
8056
8300
8057 function ApplicationsListController(applicationsResource) {
8301 function ApplicationsListController(applicationsResource) {
8058
8302
8059 var vm = this;
8303 var vm = this;
8060 vm.loading = {applications: true};
8304 vm.loading = {applications: true};
8061 vm.applications = applicationsResource.query(null, function(){
8305 vm.applications = applicationsResource.query(null, function(){
8062 vm.loading.applications = false;
8306 vm.loading.applications = false;
8063 });
8307 });
8064 }
8308 }
8065
8309
8066 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8310 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8067 // #
8311 // #
8068 // # This program is free software: you can redistribute it and/or modify
8312 // # This program is free software: you can redistribute it and/or modify
8069 // # it under the terms of the GNU Affero General Public License, version 3
8313 // # it under the terms of the GNU Affero General Public License, version 3
8070 // # (only), as published by the Free Software Foundation.
8314 // # (only), as published by the Free Software Foundation.
8071 // #
8315 // #
8072 // # This program is distributed in the hope that it will be useful,
8316 // # This program is distributed in the hope that it will be useful,
8073 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8317 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8074 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8318 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8075 // # GNU General Public License for more details.
8319 // # GNU General Public License for more details.
8076 // #
8320 // #
8077 // # You should have received a copy of the GNU Affero General Public License
8321 // # You should have received a copy of the GNU Affero General Public License
8078 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8322 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8079 // #
8323 // #
8080 // # This program is dual-licensed. If you wish to learn more about the
8324 // # This program is dual-licensed. If you wish to learn more about the
8081 // # AppEnlight Enterprise Edition, including its added features, Support
8325 // # AppEnlight Enterprise Edition, including its added features, Support
8082 // # services, and proprietary license terms, please see
8326 // # services, and proprietary license terms, please see
8083 // # https://rhodecode.com/licenses/
8327 // # https://rhodecode.com/licenses/
8084
8328
8085 angular.module('appenlight.controllers')
8329 angular.module('appenlight.controllers')
8086 .controller('ApplicationsPurgeLogsController', ApplicationsPurgeLogsController)
8330 .controller('ApplicationsPurgeLogsController', ApplicationsPurgeLogsController)
8087
8331
8088 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
8332 ApplicationsPurgeLogsController.$inject = ['applicationsResource', 'sectionViewResource', 'logsNoIdResource'];
8089
8333
8090 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
8334 function ApplicationsPurgeLogsController(applicationsResource, sectionViewResource, logsNoIdResource) {
8091
8335
8092 var vm = this;
8336 var vm = this;
8093 vm.loading = {applications: true};
8337 vm.loading = {applications: true};
8094
8338
8095 vm.namespace = null;
8339 vm.namespace = null;
8096 vm.selectedResource = null;
8340 vm.selectedResource = null;
8097 vm.commonNamespaces = [];
8341 vm.commonNamespaces = [];
8098
8342
8099 vm.applications = applicationsResource.query({'type':'update_reports'}, function () {
8343 vm.applications = applicationsResource.query({'type':'update_reports'}, function () {
8100 vm.loading.applications = false;
8344 vm.loading.applications = false;
8101 vm.selectedResource = vm.applications[0].resource_id;
8345 vm.selectedResource = vm.applications[0].resource_id;
8102 vm.getCommonKeys();
8346 vm.getCommonKeys();
8103 });
8347 });
8104
8348
8105 /**
8349 /**
8106 * Fetches most commonly used tags in logs
8350 * Fetches most commonly used tags in logs
8107 */
8351 */
8108 vm.getCommonKeys = function () {
8352 vm.getCommonKeys = function () {
8109 sectionViewResource.get({
8353 sectionViewResource.get({
8110 section: 'logs_section',
8354 section: 'logs_section',
8111 view: 'common_tags',
8355 view: 'common_tags',
8112 resource: vm.selectedResource
8356 resource: vm.selectedResource
8113 }, function (data) {
8357 }, function (data) {
8114 vm.commonNamespaces = data['namespaces']
8358 vm.commonNamespaces = data['namespaces']
8115 });
8359 });
8116 };
8360 };
8117
8361
8118 vm.purgeLogs = function () {
8362 vm.purgeLogs = function () {
8119 vm.loading.applications = true;
8363 vm.loading.applications = true;
8120 logsNoIdResource.delete({resource:vm.selectedResource,
8364 logsNoIdResource.delete({resource:vm.selectedResource,
8121 namespace: vm.namespace}, function(){
8365 namespace: vm.namespace}, function(){
8122 vm.loading.applications = false;
8366 vm.loading.applications = false;
8123 });
8367 });
8124 }
8368 }
8125 }
8369 }
8126
8370
8127 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8371 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8128 // #
8372 // #
8129 // # This program is free software: you can redistribute it and/or modify
8373 // # This program is free software: you can redistribute it and/or modify
8130 // # it under the terms of the GNU Affero General Public License, version 3
8374 // # it under the terms of the GNU Affero General Public License, version 3
8131 // # (only), as published by the Free Software Foundation.
8375 // # (only), as published by the Free Software Foundation.
8132 // #
8376 // #
8133 // # This program is distributed in the hope that it will be useful,
8377 // # This program is distributed in the hope that it will be useful,
8134 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8378 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8135 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8379 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8136 // # GNU General Public License for more details.
8380 // # GNU General Public License for more details.
8137 // #
8381 // #
8138 // # You should have received a copy of the GNU Affero General Public License
8382 // # You should have received a copy of the GNU Affero General Public License
8139 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8383 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8140 // #
8384 // #
8141 // # This program is dual-licensed. If you wish to learn more about the
8385 // # This program is dual-licensed. If you wish to learn more about the
8142 // # AppEnlight Enterprise Edition, including its added features, Support
8386 // # AppEnlight Enterprise Edition, including its added features, Support
8143 // # services, and proprietary license terms, please see
8387 // # services, and proprietary license terms, please see
8144 // # https://rhodecode.com/licenses/
8388 // # https://rhodecode.com/licenses/
8145
8389
8146 angular.module('appenlight.controllers').controller('EventsController', EventsController);
8390 angular.module('appenlight.controllers').controller('EventsController', EventsController);
8147
8391
8148 EventsController.$inject = ['eventsNoIdResource', 'eventsResource'];
8392 EventsController.$inject = ['eventsNoIdResource', 'eventsResource'];
8149
8393
8150 function EventsController(eventsNoIdResource, eventsResource) {
8394 function EventsController(eventsNoIdResource, eventsResource) {
8151 console.info('EventsController');
8395 console.info('EventsController');
8152 var vm = this;
8396 var vm = this;
8153
8397
8154 vm.loading = {events: true};
8398 vm.loading = {events: true};
8155
8399
8156 vm.events = eventsNoIdResource.query(
8400 vm.events = eventsNoIdResource.query(
8157 {key: 'events'},
8401 {key: 'events'},
8158 function (data) {
8402 function (data) {
8159 vm.loading.events = false;
8403 vm.loading.events = false;
8160 });
8404 });
8161
8405
8162
8406
8163 vm.closeEvent = function (event) {
8407 vm.closeEvent = function (event) {
8164
8408
8165 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
8409 eventsResource.update({eventId: event.id}, {status: 0}, function (data) {
8166 event.status = 0;
8410 event.status = 0;
8167 });
8411 });
8168 }
8412 }
8169
8413
8170 }
8414 }
8171
8415
8172 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8416 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8173 // #
8417 // #
8174 // # This program is free software: you can redistribute it and/or modify
8418 // # This program is free software: you can redistribute it and/or modify
8175 // # it under the terms of the GNU Affero General Public License, version 3
8419 // # it under the terms of the GNU Affero General Public License, version 3
8176 // # (only), as published by the Free Software Foundation.
8420 // # (only), as published by the Free Software Foundation.
8177 // #
8421 // #
8178 // # This program is distributed in the hope that it will be useful,
8422 // # This program is distributed in the hope that it will be useful,
8179 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8423 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8180 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8424 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8181 // # GNU General Public License for more details.
8425 // # GNU General Public License for more details.
8182 // #
8426 // #
8183 // # You should have received a copy of the GNU Affero General Public License
8427 // # You should have received a copy of the GNU Affero General Public License
8184 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8428 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8185 // #
8429 // #
8186 // # This program is dual-licensed. If you wish to learn more about the
8430 // # This program is dual-licensed. If you wish to learn more about the
8187 // # AppEnlight Enterprise Edition, including its added features, Support
8431 // # AppEnlight Enterprise Edition, including its added features, Support
8188 // # services, and proprietary license terms, please see
8432 // # services, and proprietary license terms, please see
8189 // # https://rhodecode.com/licenses/
8433 // # https://rhodecode.com/licenses/
8190
8434
8191 angular.module('appenlight.controllers')
8435 angular.module('appenlight.controllers')
8192 .controller('IndexDashboardController', IndexDashboardController);
8436 .controller('IndexDashboardController', IndexDashboardController);
8193
8437
8194 IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig'];
8438 IndexDashboardController.$inject = ['$rootScope', '$scope', '$location','$cookies', '$interval', 'stateHolder', 'applicationsPropertyResource', 'AeConfig'];
8195
8439
8196 function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig) {
8440 function IndexDashboardController($rootScope, $scope, $location, $cookies, $interval, stateHolder, applicationsPropertyResource, AeConfig) {
8197 var vm = this;
8441 var vm = this;
8198 stateHolder.section = 'dashboard';
8442 stateHolder.section = 'dashboard';
8199 vm.timeOptions = {};
8443 vm.timeOptions = {};
8200 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
8444 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
8201 _.each(allowed, function (key) {
8445 _.each(allowed, function (key) {
8202 if (allowed.indexOf(key) !== -1) {
8446 if (allowed.indexOf(key) !== -1) {
8203 vm.timeOptions[key] = AeConfig.timeOptions[key];
8447 vm.timeOptions[key] = AeConfig.timeOptions[key];
8204 }
8448 }
8205 });
8449 });
8450 vm.stateHolder = stateHolder;
8206 vm.urls = AeConfig.urls;
8451 vm.urls = AeConfig.urls;
8207 vm.applications = stateHolder.AeUser.applications_map;
8452 vm.applications = stateHolder.AeUser.applications_map;
8208 vm.show_dashboard = false;
8453 vm.show_dashboard = false;
8209 vm.resource = null;
8454 vm.resource = null;
8210 vm.graphType = {selected: null};
8455 vm.graphType = {selected: null};
8211 vm.timeSpan = vm.timeOptions['1h'];
8456 vm.timeSpan = vm.timeOptions['1h'];
8212 vm.trendingReports = [];
8457 vm.trendingReports = [];
8213 vm.exceptions = 0;
8458 vm.exceptions = 0;
8214 vm.satisfyingRequests = 0;
8459 vm.satisfyingRequests = 0;
8215 vm.toleratedRequests = 0;
8460 vm.toleratedRequests = 0;
8216 vm.frustratingRequests = 0;
8461 vm.frustratingRequests = 0;
8217 vm.uptimeStats = 0;
8462 vm.uptimeStats = 0;
8218 vm.apdexStats = [];
8463 vm.apdexStats = [];
8219 vm.seriesRequestsData = [];
8464 vm.seriesRequestsData = [];
8220 vm.seriesMetricsData = [];
8465 vm.seriesMetricsData = [];
8221 vm.seriesSlowData = [];
8466 vm.seriesSlowData = [];
8222 vm.slowCalls = [];
8467 vm.slowCalls = [];
8223 vm.slowURIS = [];
8468 vm.slowURIS = [];
8224
8469
8225 vm.reportChartConfig = {
8470 vm.reportChartConfig = {
8226 data: {
8471 data: {
8227 json: [],
8472 json: [],
8228 xFormat: '%Y-%m-%dT%H:%M:%S'
8473 xFormat: '%Y-%m-%dT%H:%M:%S'
8229 },
8474 },
8230 color: {
8475 color: {
8231 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8476 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8232 },
8477 },
8233 axis: {
8478 axis: {
8234 x: {
8479 x: {
8235 type: 'timeseries',
8480 type: 'timeseries',
8236 tick: {
8481 tick: {
8237 culling: {
8482 culling: {
8238 max: 6 // the number of tick texts will be adjusted to less than this value
8483 max: 6 // the number of tick texts will be adjusted to less than this value
8239 },
8484 },
8240 format: '%Y-%m-%d %H:%M'
8485 format: '%Y-%m-%d %H:%M'
8241 }
8486 }
8242 },
8487 },
8243 y: {
8488 y: {
8244 tick: {
8489 tick: {
8245 count: 5,
8490 count: 5,
8246 format: d3.format('.2s')
8491 format: d3.format('.2s')
8247 }
8492 }
8248 }
8493 }
8249 },
8494 },
8250 subchart: {
8495 subchart: {
8251 show: true,
8496 show: true,
8252 size: {
8497 size: {
8253 height: 20
8498 height: 20
8254 }
8499 }
8255 },
8500 },
8256 size: {
8501 size: {
8257 height: 250
8502 height: 250
8258 },
8503 },
8259 zoom: {
8504 zoom: {
8260 rescale: true
8505 rescale: true
8261 },
8506 },
8262 grid: {
8507 grid: {
8263 x: {
8508 x: {
8264 show: true
8509 show: true
8265 },
8510 },
8266 y: {
8511 y: {
8267 show: true
8512 show: true
8268 }
8513 }
8269 },
8514 },
8270 tooltip: {
8515 tooltip: {
8271 format: {
8516 format: {
8272 title: function (d) {
8517 title: function (d) {
8273 return '' + d;
8518 return '' + d;
8274 },
8519 },
8275 value: function (v) {
8520 value: function (v) {
8276 return v
8521 return v
8277 }
8522 }
8278 }
8523 }
8279 }
8524 }
8280 };
8525 };
8281 vm.reportChartData = {};
8526 vm.reportChartData = {};
8282
8527
8283 vm.reportSlowChartConfig = {
8528 vm.reportSlowChartConfig = {
8284 data: {
8529 data: {
8285 json: [],
8530 json: [],
8286 xFormat: '%Y-%m-%dT%H:%M:%S'
8531 xFormat: '%Y-%m-%dT%H:%M:%S'
8287 },
8532 },
8288 color: {
8533 color: {
8289 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8534 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
8290 },
8535 },
8291 axis: {
8536 axis: {
8292 x: {
8537 x: {
8293 type: 'timeseries',
8538 type: 'timeseries',
8294 tick: {
8539 tick: {
8295 culling: {
8540 culling: {
8296 max: 6 // the number of tick texts will be adjusted to less than this value
8541 max: 6 // the number of tick texts will be adjusted to less than this value
8297 },
8542 },
8298 format: '%Y-%m-%d %H:%M'
8543 format: '%Y-%m-%d %H:%M'
8299 }
8544 }
8300 },
8545 },
8301 y: {
8546 y: {
8302 tick: {
8547 tick: {
8303 count: 5,
8548 count: 5,
8304 format: d3.format('.2s')
8549 format: d3.format('.2s')
8305 }
8550 }
8306 }
8551 }
8307 },
8552 },
8308 subchart: {
8553 subchart: {
8309 show: true,
8554 show: true,
8310 size: {
8555 size: {
8311 height: 20
8556 height: 20
8312 }
8557 }
8313 },
8558 },
8314 size: {
8559 size: {
8315 height: 250
8560 height: 250
8316 },
8561 },
8317 zoom: {
8562 zoom: {
8318 rescale: true
8563 rescale: true
8319 },
8564 },
8320 grid: {
8565 grid: {
8321 x: {
8566 x: {
8322 show: true
8567 show: true
8323 },
8568 },
8324 y: {
8569 y: {
8325 show: true
8570 show: true
8326 }
8571 }
8327 },
8572 },
8328 tooltip: {
8573 tooltip: {
8329 format: {
8574 format: {
8330 title: function (d) {
8575 title: function (d) {
8331 return '' + d;
8576 return '' + d;
8332 },
8577 },
8333 value: function (v) {
8578 value: function (v) {
8334 return v
8579 return v
8335 }
8580 }
8336 }
8581 }
8337 }
8582 }
8338 };
8583 };
8339 vm.reportSlowChartData = {};
8584 vm.reportSlowChartData = {};
8340
8585
8341 vm.metricsChartConfig = {
8586 vm.metricsChartConfig = {
8342 data: {
8587 data: {
8343 json: [],
8588 json: [],
8344 xFormat: '%Y-%m-%dT%H:%M:%S',
8589 xFormat: '%Y-%m-%dT%H:%M:%S',
8345 keys: {
8590 keys: {
8346 x: 'x',
8591 x: 'x',
8347 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8592 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8348 },
8593 },
8349 names: {
8594 names: {
8350 main: 'View/Application logic',
8595 main: 'View/Application logic',
8351 sql: 'Relational database queries',
8596 sql: 'Relational database queries',
8352 nosql: 'NoSql datastore calls',
8597 nosql: 'NoSql datastore calls',
8353 tmpl: 'Template rendering',
8598 tmpl: 'Template rendering',
8354 custom: 'Custom timed calls',
8599 custom: 'Custom timed calls',
8355 remote: 'Requests to remote resources'
8600 remote: 'Requests to remote resources'
8356 },
8601 },
8357 type: 'area',
8602 type: 'area',
8358 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8603 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8359 order: null
8604 order: null
8360 },
8605 },
8361 color: {
8606 color: {
8362 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
8607 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
8363 },
8608 },
8364 axis: {
8609 axis: {
8365 x: {
8610 x: {
8366 type: 'timeseries',
8611 type: 'timeseries',
8367 tick: {
8612 tick: {
8368 culling: {
8613 culling: {
8369 max: 6 // the number of tick texts will be adjusted to less than this value
8614 max: 6 // the number of tick texts will be adjusted to less than this value
8370 },
8615 },
8371 format: '%Y-%m-%d %H:%M'
8616 format: '%Y-%m-%d %H:%M'
8372 }
8617 }
8373 },
8618 },
8374 y: {
8619 y: {
8375 tick: {
8620 tick: {
8376 count: 5,
8621 count: 5,
8377 format: d3.format('.2f')
8622 format: d3.format('.2f')
8378 }
8623 }
8379 }
8624 }
8380 },
8625 },
8381 point: {
8626 point: {
8382 show: false
8627 show: false
8383 },
8628 },
8384 subchart: {
8629 subchart: {
8385 show: true,
8630 show: true,
8386 size: {
8631 size: {
8387 height: 20
8632 height: 20
8388 }
8633 }
8389 },
8634 },
8390 size: {
8635 size: {
8391 height: 350
8636 height: 350
8392 },
8637 },
8393 zoom: {
8638 zoom: {
8394 rescale: true
8639 rescale: true
8395 },
8640 },
8396 grid: {
8641 grid: {
8397 x: {
8642 x: {
8398 show: true
8643 show: true
8399 },
8644 },
8400 y: {
8645 y: {
8401 show: true
8646 show: true
8402 }
8647 }
8403 },
8648 },
8404 tooltip: {
8649 tooltip: {
8405 format: {
8650 format: {
8406 title: function (d) {
8651 title: function (d) {
8407 return '' + d;
8652 return '' + d;
8408 },
8653 },
8409 value: function (v) {
8654 value: function (v) {
8410 return v
8655 return v
8411 }
8656 }
8412 }
8657 }
8413 }
8658 }
8414 };
8659 };
8415 vm.metricsChartData = {};
8660 vm.metricsChartData = {};
8416
8661
8417 vm.responseChartConfig = {
8662 vm.responseChartConfig = {
8418 data: {
8663 data: {
8419 json: [],
8664 json: [],
8420 xFormat: '%Y-%m-%dT%H:%M:%S'
8665 xFormat: '%Y-%m-%dT%H:%M:%S'
8421 },
8666 },
8422 color: {
8667 color: {
8423 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8668 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8424 },
8669 },
8425 axis: {
8670 axis: {
8426 x: {
8671 x: {
8427 type: 'timeseries',
8672 type: 'timeseries',
8428 tick: {
8673 tick: {
8429 culling: {
8674 culling: {
8430 max: 6 // the number of tick texts will be adjusted to less than this value
8675 max: 6 // the number of tick texts will be adjusted to less than this value
8431 },
8676 },
8432 format: '%Y-%m-%d %H:%M'
8677 format: '%Y-%m-%d %H:%M'
8433 }
8678 }
8434 },
8679 },
8435 y: {
8680 y: {
8436 tick: {
8681 tick: {
8437 count: 5,
8682 count: 5,
8438 format: d3.format('.2f')
8683 format: d3.format('.2f')
8439 }
8684 }
8440 }
8685 }
8441 },
8686 },
8442 point: {
8687 point: {
8443 show: false
8688 show: false
8444 },
8689 },
8445 subchart: {
8690 subchart: {
8446 show: true,
8691 show: true,
8447 size: {
8692 size: {
8448 height: 20
8693 height: 20
8449 }
8694 }
8450 },
8695 },
8451 size: {
8696 size: {
8452 height: 350
8697 height: 350
8453 },
8698 },
8454 zoom: {
8699 zoom: {
8455 rescale: true
8700 rescale: true
8456 },
8701 },
8457 grid: {
8702 grid: {
8458 x: {
8703 x: {
8459 show: true
8704 show: true
8460 },
8705 },
8461 y: {
8706 y: {
8462 show: true
8707 show: true
8463 }
8708 }
8464 },
8709 },
8465 tooltip: {
8710 tooltip: {
8466 format: {
8711 format: {
8467 title: function (d) {
8712 title: function (d) {
8468 return '' + d;
8713 return '' + d;
8469 },
8714 },
8470 value: function (v) {
8715 value: function (v) {
8471 return v
8716 return v
8472 }
8717 }
8473 }
8718 }
8474 }
8719 }
8475 };
8720 };
8476 vm.responseChartData = {};
8721 vm.responseChartData = {};
8477
8722
8478 vm.requestsChartConfig = {
8723 vm.requestsChartConfig = {
8479 data: {
8724 data: {
8480 json: [],
8725 json: [],
8481 xFormat: '%Y-%m-%dT%H:%M:%S'
8726 xFormat: '%Y-%m-%dT%H:%M:%S'
8482 },
8727 },
8483 color: {
8728 color: {
8484 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8729 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
8485 },
8730 },
8486 axis: {
8731 axis: {
8487 x: {
8732 x: {
8488 type: 'timeseries',
8733 type: 'timeseries',
8489 tick: {
8734 tick: {
8490 culling: {
8735 culling: {
8491 max: 6 // the number of tick texts will be adjusted to less than this value
8736 max: 6 // the number of tick texts will be adjusted to less than this value
8492 },
8737 },
8493 format: '%Y-%m-%d %H:%M'
8738 format: '%Y-%m-%d %H:%M'
8494 }
8739 }
8495 },
8740 },
8496 y: {
8741 y: {
8497 tick: {
8742 tick: {
8498 count: 5,
8743 count: 5,
8499 format: d3.format('.2f')
8744 format: d3.format('.2f')
8500 }
8745 }
8501 }
8746 }
8502 },
8747 },
8503 point: {
8748 point: {
8504 show: false
8749 show: false
8505 },
8750 },
8506 subchart: {
8751 subchart: {
8507 show: true,
8752 show: true,
8508 size: {
8753 size: {
8509 height: 20
8754 height: 20
8510 }
8755 }
8511 },
8756 },
8512 size: {
8757 size: {
8513 height: 350
8758 height: 350
8514 },
8759 },
8515 zoom: {
8760 zoom: {
8516 rescale: true
8761 rescale: true
8517 },
8762 },
8518 grid: {
8763 grid: {
8519 x: {
8764 x: {
8520 show: true
8765 show: true
8521 },
8766 },
8522 y: {
8767 y: {
8523 show: true
8768 show: true
8524 }
8769 }
8525 },
8770 },
8526 tooltip: {
8771 tooltip: {
8527 format: {
8772 format: {
8528 title: function (d) {
8773 title: function (d) {
8529 return '' + d;
8774 return '' + d;
8530 },
8775 },
8531 value: function (v) {
8776 value: function (v) {
8532 return v
8777 return v
8533 }
8778 }
8534 }
8779 }
8535 }
8780 }
8536 };
8781 };
8537 vm.requestsChartData = {};
8782 vm.requestsChartData = {};
8538
8783
8539 vm.loading = {
8784 vm.loading = {
8540 'apdex': true,
8785 'apdex': true,
8541 'reports': true,
8786 'reports': true,
8542 'graphs': true,
8787 'graphs': true,
8543 'slowCalls': true,
8788 'slowCalls': true,
8544 'slowURIS': true,
8789 'slowURIS': true,
8545 'requestsBreakdown': true,
8790 'requestsBreakdown': true,
8546 'series': true
8791 'series': true
8547 };
8792 };
8548 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
8793 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
8549
8794
8550 $scope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
8795 $rootScope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
8551 var ws_report = message.message.report;
8796 var ws_report = message.message.report;
8552 if (ws_report.http_status != 500) {
8797 if (ws_report.http_status != 500) {
8553 return
8798 return
8554 }
8799 }
8555 if (vm.stream.paused == true) {
8800 if (vm.stream.paused == true) {
8556 return
8801 return
8557 }
8802 }
8558 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
8803 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
8559 return
8804 return
8560 }
8805 }
8561 var should_insert = true;
8806 var should_insert = true;
8562 _.each(vm.stream.reports, function (report) {
8807 _.each(vm.stream.reports, function (report) {
8563 if (report.report_id == ws_report.report_id) {
8808 if (report.report_id == ws_report.report_id) {
8564 report.occurences = ws_report.occurences;
8809 report.occurences = ws_report.occurences;
8565 should_insert = false;
8810 should_insert = false;
8566 }
8811 }
8567 });
8812 });
8568 if (should_insert) {
8813 if (should_insert) {
8569 if (vm.stream.reports.length > 7) {
8814 if (vm.stream.reports.length > 7) {
8570 vm.stream.reports.pop();
8815 vm.stream.reports.pop();
8571 }
8816 }
8572 vm.stream.reports.unshift(ws_report);
8817 vm.stream.reports.unshift(ws_report);
8573 }
8818 }
8574 });
8819 });
8575
8820
8576 vm.determineStartState = function () {
8821 vm.determineStartState = function () {
8577 if (stateHolder.AeUser.applications.length) {
8822 if (stateHolder.AeUser.applications.length) {
8578 vm.resource = Number($location.search().resource);
8823 vm.resource = Number($location.search().resource);
8579
8824
8580 if (!vm.resource){
8825 if (!vm.resource){
8581 var cookieResource = $cookies.getObject('resource');
8826 var cookieResource = $cookies.getObject('resource');
8582
8827
8583
8828
8584 if (cookieResource) {
8829 if (cookieResource) {
8585 vm.resource = cookieResource;
8830 vm.resource = cookieResource;
8586 }
8831 }
8587 else{
8832 else{
8588 vm.resource = stateHolder.AeUser.applications[0].resource_id;
8833 vm.resource = stateHolder.AeUser.applications[0].resource_id;
8589 }
8834 }
8590 }
8835 }
8591 }
8836 }
8592
8837
8593 var timespan = $location.search().timespan;
8838 var timespan = $location.search().timespan;
8594
8839
8595 if(_.has(vm.timeOptions, timespan)){
8840 if(_.has(vm.timeOptions, timespan)){
8596 vm.timeSpan = vm.timeOptions[timespan];
8841 vm.timeSpan = vm.timeOptions[timespan];
8597 }
8842 }
8598 else{
8843 else{
8599 vm.timeSpan = vm.timeOptions['1h'];
8844 vm.timeSpan = vm.timeOptions['1h'];
8600 }
8845 }
8601
8846
8602 var graphType = $location.search().graphtype;
8847 var graphType = $location.search().graphtype;
8603 if(!graphType){
8848 if(!graphType){
8604 vm.graphType = {selected: 'metrics_graphs'};
8849 vm.graphType = {selected: 'metrics_graphs'};
8605 }
8850 }
8606 else{
8851 else{
8607 vm.graphType = {selected: graphType};
8852 vm.graphType = {selected: graphType};
8608 }
8853 }
8609 vm.updateSearchParams();
8854 vm.updateSearchParams();
8610 };
8855 };
8611
8856
8612 vm.updateSearchParams = function () {
8857 vm.updateSearchParams = function () {
8613 $location.search('resource', vm.resource);
8858 $location.search('resource', vm.resource);
8614 $location.search('timespan', vm.timeSpan.key);
8859 $location.search('timespan', vm.timeSpan.key);
8615 $location.search('graphtype', vm.graphType.selected);
8860 $location.search('graphtype', vm.graphType.selected);
8616 stateHolder.resource = vm.resource;
8861 stateHolder.resource = vm.resource;
8617 if (vm.resource){
8862 if (vm.resource){
8618 $cookies.putObject('resource', vm.resource,
8863 $cookies.putObject('resource', vm.resource,
8619 {expires:new Date(3000, 1, 1)});
8864 {expires:new Date(3000, 1, 1)});
8620 }
8865 }
8621 };
8866 };
8622
8867
8623 vm.refreshData = function () {
8868 vm.refreshData = function () {
8624 vm.fetchApdexStats();
8869 vm.fetchApdexStats();
8625 vm.fetchTrendingReports();
8870 vm.fetchTrendingReports();
8626 vm.fetchMetrics();
8871 vm.fetchMetrics();
8627 vm.fetchRequestsBreakdown();
8872 vm.fetchRequestsBreakdown();
8628 vm.fetchSlowCalls();
8873 vm.fetchSlowCalls();
8629 };
8874 };
8630
8875
8631 vm.changedTimeSpan = function(){
8876 vm.changedTimeSpan = function(){
8632 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
8877 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
8633 vm.refreshData();
8878 vm.refreshData();
8634 };
8879 };
8635
8880
8636 var intervalId = $interval(function () {
8881 var intervalId = $interval(function () {
8637 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
8882 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
8638 // don't do anything if window is unfocused
8883 // don't do anything if window is unfocused
8639 if(document.hidden === true){
8884 if(document.hidden === true){
8640 return ;
8885 return ;
8641 }
8886 }
8642 vm.refreshData();
8887 vm.refreshData();
8643 }
8888 }
8644 }, 60000);
8889 }, 60000);
8645
8890
8646 vm.fetchApdexStats = function () {
8891 vm.fetchApdexStats = function () {
8647 vm.loading.apdex = true;
8892 vm.loading.apdex = true;
8648 vm.apdexStats = applicationsPropertyResource.query({
8893 vm.apdexStats = applicationsPropertyResource.query({
8649 'key': 'apdex_stats',
8894 'key': 'apdex_stats',
8650 'resourceId': vm.resource,
8895 'resourceId': vm.resource,
8651 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8896 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8652 },
8897 },
8653 function (data) {
8898 function (data) {
8654 vm.loading.apdex = false;
8899 vm.loading.apdex = false;
8655
8900
8656 vm.exceptions = _.reduce(data, function (memo, row) {
8901 vm.exceptions = _.reduce(data, function (memo, row) {
8657 return memo + row.errors;
8902 return memo + row.errors;
8658 }, 0);
8903 }, 0);
8659 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
8904 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
8660 return memo + row.satisfying_requests;
8905 return memo + row.satisfying_requests;
8661 }, 0);
8906 }, 0);
8662 vm.toleratedRequests = _.reduce(data, function (memo, row) {
8907 vm.toleratedRequests = _.reduce(data, function (memo, row) {
8663 return memo + row.tolerated_requests;
8908 return memo + row.tolerated_requests;
8664 }, 0);
8909 }, 0);
8665 vm.frustratingRequests = _.reduce(data, function (memo, row) {
8910 vm.frustratingRequests = _.reduce(data, function (memo, row) {
8666 return memo + row.frustrating_requests;
8911 return memo + row.frustrating_requests;
8667 }, 0);
8912 }, 0);
8668 if (data.length) {
8913 if (data.length) {
8669 vm.uptimeStats = data[0].uptime;
8914 vm.uptimeStats = data[0].uptime;
8670 }
8915 }
8671
8916
8672 },
8917 },
8673 function () {
8918 function () {
8674 vm.loading.apdex = false;
8919 vm.loading.apdex = false;
8675 }
8920 }
8676 );
8921 );
8677 }
8922 }
8678
8923
8679 vm.fetchMetrics = function () {
8924 vm.fetchMetrics = function () {
8680 vm.loading.series = true;
8925 vm.loading.series = true;
8681 applicationsPropertyResource.query({
8926 applicationsPropertyResource.query({
8682 'resourceId': vm.resource,
8927 'resourceId': vm.resource,
8683 'key': vm.graphType.selected,
8928 'key': vm.graphType.selected,
8684 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8929 "start_date": timeSpanToStartDate(vm.timeSpan.key)
8685 }, function (data) {
8930 }, function (data) {
8686 if (vm.graphType.selected == 'metrics_graphs') {
8931 if (vm.graphType.selected == 'metrics_graphs') {
8687 vm.metricsChartData = {
8932 vm.metricsChartData = {
8688 json: data,
8933 json: data,
8689 xFormat: '%Y-%m-%dT%H:%M:%S',
8934 xFormat: '%Y-%m-%dT%H:%M:%S',
8690 keys: {
8935 keys: {
8691 x: 'x',
8936 x: 'x',
8692 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8937 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
8693 },
8938 },
8694 names: {
8939 names: {
8695 main: 'View/Application logic',
8940 main: 'View/Application logic',
8696 sql: 'Relational database queries',
8941 sql: 'Relational database queries',
8697 nosql: 'NoSql datastore calls',
8942 nosql: 'NoSql datastore calls',
8698 tmpl: 'Template rendering',
8943 tmpl: 'Template rendering',
8699 custom: 'Custom timed calls',
8944 custom: 'Custom timed calls',
8700 remote: 'Requests to remote resources'
8945 remote: 'Requests to remote resources'
8701 },
8946 },
8702 type: 'area',
8947 type: 'area',
8703 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8948 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
8704 order: null
8949 order: null
8705 };
8950 };
8706 }
8951 }
8707 else if (vm.graphType.selected == 'report_graphs') {
8952 else if (vm.graphType.selected == 'report_graphs') {
8708 vm.reportChartData = {
8953 vm.reportChartData = {
8709 json: data,
8954 json: data,
8710 xFormat: '%Y-%m-%dT%H:%M:%S',
8955 xFormat: '%Y-%m-%dT%H:%M:%S',
8711 keys: {
8956 keys: {
8712 x: 'x',
8957 x: 'x',
8713 value: ["not_found", "report"]
8958 value: ["not_found", "report"]
8714 },
8959 },
8715 names: {
8960 names: {
8716 report: 'Errors',
8961 report: 'Errors',
8717 not_found: '404\'s requests'
8962 not_found: '404\'s requests'
8718 },
8963 },
8719 type: 'bar'
8964 type: 'bar'
8720 };
8965 };
8721 }
8966 }
8722 else if (vm.graphType.selected == 'slow_report_graphs') {
8967 else if (vm.graphType.selected == 'slow_report_graphs') {
8723 vm.reportSlowChartData = {
8968 vm.reportSlowChartData = {
8724 json: data,
8969 json: data,
8725 xFormat: '%Y-%m-%dT%H:%M:%S',
8970 xFormat: '%Y-%m-%dT%H:%M:%S',
8726 keys: {
8971 keys: {
8727 x: 'x',
8972 x: 'x',
8728 value: ["slow_report"]
8973 value: ["slow_report"]
8729 },
8974 },
8730 names: {
8975 names: {
8731 slow_report: 'Slow reports'
8976 slow_report: 'Slow reports'
8732 },
8977 },
8733 type: 'bar'
8978 type: 'bar'
8734 };
8979 };
8735 }
8980 }
8736 else if (vm.graphType.selected == 'response_graphs') {
8981 else if (vm.graphType.selected == 'response_graphs') {
8737 vm.responseChartData = {
8982 vm.responseChartData = {
8738 json: data,
8983 json: data,
8739 xFormat: '%Y-%m-%dT%H:%M:%S',
8984 xFormat: '%Y-%m-%dT%H:%M:%S',
8740 keys: {
8985 keys: {
8741 x: 'x',
8986 x: 'x',
8742 value: ["today", "days_ago_2", "days_ago_7"]
8987 value: ["today", "days_ago_2", "days_ago_7"]
8743 },
8988 },
8744 names: {
8989 names: {
8745 today: 'Today',
8990 today: 'Today',
8746 "days_ago_2": '2 days ago',
8991 "days_ago_2": '2 days ago',
8747 "days_ago_7": '7 days ago'
8992 "days_ago_7": '7 days ago'
8748 }
8993 }
8749 };
8994 };
8750 }
8995 }
8751 else if (vm.graphType.selected == 'requests_graphs') {
8996 else if (vm.graphType.selected == 'requests_graphs') {
8752 vm.requestsChartData = {
8997 vm.requestsChartData = {
8753 json: data,
8998 json: data,
8754 xFormat: '%Y-%m-%dT%H:%M:%S',
8999 xFormat: '%Y-%m-%dT%H:%M:%S',
8755 keys: {
9000 keys: {
8756 x: 'x',
9001 x: 'x',
8757 value: ["requests"]
9002 value: ["requests"]
8758 },
9003 },
8759 names: {
9004 names: {
8760 requests: 'Requests/s'
9005 requests: 'Requests/s'
8761 }
9006 }
8762 };
9007 };
8763 }
9008 }
8764 vm.loading.series = false;
9009 vm.loading.series = false;
8765 }, function(){
9010 }, function(){
8766 vm.loading.series = false;
9011 vm.loading.series = false;
8767 });
9012 });
8768 }
9013 }
8769
9014
8770 vm.fetchSlowCalls = function () {
9015 vm.fetchSlowCalls = function () {
8771 vm.loading.slowCalls = true;
9016 vm.loading.slowCalls = true;
8772 applicationsPropertyResource.query({
9017 applicationsPropertyResource.query({
8773 'resourceId': vm.resource,
9018 'resourceId': vm.resource,
8774 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9019 "start_date": timeSpanToStartDate(vm.timeSpan.key),
8775 'key': 'slow_calls'
9020 'key': 'slow_calls'
8776 }, function (data) {
9021 }, function (data) {
8777 vm.slowCalls = data;
9022 vm.slowCalls = data;
8778 vm.loading.slowCalls = false;
9023 vm.loading.slowCalls = false;
8779 }, function () {
9024 }, function () {
8780 vm.loading.slowCalls = false;
9025 vm.loading.slowCalls = false;
8781 });
9026 });
8782 }
9027 }
8783
9028
8784 vm.fetchRequestsBreakdown = function () {
9029 vm.fetchRequestsBreakdown = function () {
8785 vm.loading.requestsBreakdown = true;
9030 vm.loading.requestsBreakdown = true;
8786 applicationsPropertyResource.query({
9031 applicationsPropertyResource.query({
8787 'resourceId': vm.resource,
9032 'resourceId': vm.resource,
8788 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9033 "start_date": timeSpanToStartDate(vm.timeSpan.key),
8789 'key': 'requests_breakdown'
9034 'key': 'requests_breakdown'
8790 }, function (data) {
9035 }, function (data) {
8791 vm.requestsBreakdown = data;
9036 vm.requestsBreakdown = data;
8792 vm.loading.requestsBreakdown = false;
9037 vm.loading.requestsBreakdown = false;
8793 }, function () {
9038 }, function () {
8794 vm.loading.requestsBreakdown = false;
9039 vm.loading.requestsBreakdown = false;
8795 });
9040 });
8796 }
9041 }
8797
9042
8798 vm.fetchTrendingReports = function () {
9043 vm.fetchTrendingReports = function () {
8799
9044
8800 if (vm.graphType.selected == 'slow_report_graphs') {
9045 if (vm.graphType.selected == 'slow_report_graphs') {
8801 var report_type = 'slow';
9046 var report_type = 'slow';
8802 }
9047 }
8803 else {
9048 else {
8804 var report_type = 'error';
9049 var report_type = 'error';
8805 }
9050 }
8806
9051
8807 vm.loading.reports = true;
9052 vm.loading.reports = true;
8808 vm.trendingReports = applicationsPropertyResource.query({
9053 vm.trendingReports = applicationsPropertyResource.query({
8809 'key': 'trending_reports',
9054 'key': 'trending_reports',
8810 'resourceId': vm.resource,
9055 'resourceId': vm.resource,
8811 "start_date": timeSpanToStartDate(vm.timeSpan.key),
9056 "start_date": timeSpanToStartDate(vm.timeSpan.key),
8812 "report_type": report_type
9057 "report_type": report_type
8813 },
9058 },
8814 function () {
9059 function () {
8815 vm.loading.reports = false;
9060 vm.loading.reports = false;
8816 },
9061 },
8817 function () {
9062 function () {
8818 vm.loading.reports = false;
9063 vm.loading.reports = false;
8819 }
9064 }
8820 )
9065 );
8821 ;
9066 };
8822 }
8823
9067
8824 if (stateHolder.AeUser.applications.length){
9068 if (stateHolder.AeUser.applications.length){
8825 vm.show_dashboard = true;
9069 vm.show_dashboard = true;
8826 vm.determineStartState();
9070 vm.determineStartState();
8827 vm.refreshData();
9071 vm.refreshData();
8828 }
9072 }
8829
9073
8830 $scope.$on('$locationChangeSuccess', function () {
9074 $scope.$on('$locationChangeSuccess', function () {
8831
9075
8832 if (vm.loading.series === false) {
9076 if (vm.loading.series === false) {
8833 vm.determineStartState();
9077 vm.determineStartState();
8834 vm.refreshData();
9078 vm.refreshData();
8835 }
9079 }
8836 });
9080 });
8837
9081
8838
8839 }
8840
8841 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8842 // #
8843 // # This program is free software: you can redistribute it and/or modify
8844 // # it under the terms of the GNU Affero General Public License, version 3
8845 // # (only), as published by the Free Software Foundation.
8846 // #
8847 // # This program is distributed in the hope that it will be useful,
8848 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8849 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8850 // # GNU General Public License for more details.
8851 // #
8852 // # You should have received a copy of the GNU Affero General Public License
8853 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8854 // #
8855 // # This program is dual-licensed. If you wish to learn more about the
8856 // # AppEnlight Enterprise Edition, including its added features, Support
8857 // # services, and proprietary license terms, please see
8858 // # https://rhodecode.com/licenses/
8859
8860 angular.module('appenlight.controllers')
8861 .controller('HeaderCtrl', HeaderCtrl);
8862
8863 HeaderCtrl.$inject = ['$state', 'stateHolder'];
8864
8865 function HeaderCtrl($state, stateHolder) {
8866 var vm = this;
8867 vm.stateHolder = stateHolder;
8868 vm.assignedReports = stateHolder.AeUser.assigned_reports;
8869 vm.latestEvents = stateHolder.AeUser.latest_events;
8870 vm.activeEvents = 0;
8871 _.each(vm.latestEvents, function (event) {
8872 if (event.status === 1 && event.end_date === null) {
8873 vm.activeEvents += 1;
8874 }
8875 });
8876
8877 vm.clickedEvent = function(event){
8878
8879 // (from Event model)
8880 // exception reports
8881 if (_.contains([1,2], event.event_type)){
8882 $state.go('report.list', {resource:event.resource_id, start_date:event.start_date});
8883 }
8884 // slowness reports
8885 else if (_.contains([3,4], event.event_type)){
8886 $state.go('report.list_slow', {resource:event.resource_id, start_date:event.start_date});
8887 }
8888 // uptime reports
8889 else if (_.contains([7,8], event.event_type)){
8890 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
8891 }
8892 else{
8893
8894 }
8895 }
8896 }
9082 }
8897
9083
8898 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9084 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8899 // #
9085 // #
8900 // # This program is free software: you can redistribute it and/or modify
9086 // # This program is free software: you can redistribute it and/or modify
8901 // # it under the terms of the GNU Affero General Public License, version 3
9087 // # it under the terms of the GNU Affero General Public License, version 3
8902 // # (only), as published by the Free Software Foundation.
9088 // # (only), as published by the Free Software Foundation.
8903 // #
9089 // #
8904 // # This program is distributed in the hope that it will be useful,
9090 // # This program is distributed in the hope that it will be useful,
8905 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9091 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8906 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9092 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8907 // # GNU General Public License for more details.
9093 // # GNU General Public License for more details.
8908 // #
9094 // #
8909 // # You should have received a copy of the GNU Affero General Public License
9095 // # You should have received a copy of the GNU Affero General Public License
8910 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9096 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8911 // #
9097 // #
8912 // # This program is dual-licensed. If you wish to learn more about the
9098 // # This program is dual-licensed. If you wish to learn more about the
8913 // # AppEnlight Enterprise Edition, including its added features, Support
9099 // # AppEnlight Enterprise Edition, including its added features, Support
8914 // # services, and proprietary license terms, please see
9100 // # services, and proprietary license terms, please see
8915 // # https://rhodecode.com/licenses/
9101 // # https://rhodecode.com/licenses/
8916
9102
8917 angular.module('appenlight.controllers').controller('IndexCtrl', IndexCtrl);
9103 angular.module('appenlight.controllers').controller('IndexCtrl', IndexCtrl);
8918
9104
8919 IndexCtrl.$inject = [IndexCtrl];
9105 IndexCtrl.$inject = [IndexCtrl];
8920
9106
8921 function IndexCtrl() {
9107 function IndexCtrl() {
8922 var vm = this;
9108 var vm = this;
8923 vm.selected_section = 'errors';
9109 vm.selected_section = 'errors';
8924 }
9110 }
8925
9111
8926 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9112 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
8927 // #
9113 // #
8928 // # This program is free software: you can redistribute it and/or modify
9114 // # This program is free software: you can redistribute it and/or modify
8929 // # it under the terms of the GNU Affero General Public License, version 3
9115 // # it under the terms of the GNU Affero General Public License, version 3
8930 // # (only), as published by the Free Software Foundation.
9116 // # (only), as published by the Free Software Foundation.
8931 // #
9117 // #
8932 // # This program is distributed in the hope that it will be useful,
9118 // # This program is distributed in the hope that it will be useful,
8933 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9119 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8934 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9120 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8935 // # GNU General Public License for more details.
9121 // # GNU General Public License for more details.
8936 // #
9122 // #
8937 // # You should have received a copy of the GNU Affero General Public License
9123 // # You should have received a copy of the GNU Affero General Public License
8938 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9124 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
8939 // #
9125 // #
8940 // # This program is dual-licensed. If you wish to learn more about the
9126 // # This program is dual-licensed. If you wish to learn more about the
8941 // # AppEnlight Enterprise Edition, including its added features, Support
9127 // # AppEnlight Enterprise Edition, including its added features, Support
8942 // # services, and proprietary license terms, please see
9128 // # services, and proprietary license terms, please see
8943 // # https://rhodecode.com/licenses/
9129 // # https://rhodecode.com/licenses/
8944
9130
8945 angular.module('appenlight.controllers')
9131 angular.module('appenlight.controllers')
8946 .controller('BitbucketIntegrationCtrl', BitbucketIntegrationCtrl)
9132 .controller('BitbucketIntegrationCtrl', BitbucketIntegrationCtrl)
8947
9133
8948 BitbucketIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
9134 BitbucketIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
8949
9135
8950 function BitbucketIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
9136 function BitbucketIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
8951 var vm = this;
9137 var vm = this;
8952 vm.loading = true;
9138 vm.loading = true;
8953 vm.assignees = [];
9139 vm.assignees = [];
8954 vm.report = report;
9140 vm.report = report;
8955 vm.integrationName = integrationName;
9141 vm.integrationName = integrationName;
8956 vm.statuses = [];
9142 vm.statuses = [];
8957 vm.priorities = [];
9143 vm.priorities = [];
8958 vm.error_messages = [];
9144 vm.error_messages = [];
8959 vm.form = {
9145 vm.form = {
8960 content: '\n' +
9146 content: '\n' +
8961 'Issue created for report: ' +
9147 'Issue created for report: ' +
8962 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
9148 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
8963 };
9149 };
8964
9150
8965 vm.fetchInfo = function () {
9151 vm.fetchInfo = function () {
8966 integrationResource.get({
9152 integrationResource.get({
8967 resourceId: vm.report.resource_id,
9153 resourceId: vm.report.resource_id,
8968 action: 'info',
9154 action: 'info',
8969 integration: vm.integrationName
9155 integration: vm.integrationName
8970 }, null,
9156 }, null,
8971 function (data) {
9157 function (data) {
8972 vm.loading = false;
9158 vm.loading = false;
8973 if (data.error_messages) {
9159 if (data.error_messages) {
8974 vm.error_messages = data.error_messages;
9160 vm.error_messages = data.error_messages;
8975 }
9161 }
8976 vm.assignees = data.assignees;
9162 vm.assignees = data.assignees;
8977 vm.priorities = data.priorities;
9163 vm.priorities = data.priorities;
8978 vm.form.responsible = vm.assignees[0];
9164 vm.form.responsible = vm.assignees[0];
8979 vm.form.priority = vm.priorities[0];
9165 vm.form.priority = vm.priorities[0];
8980 }, function (error_data) {
9166 }, function (error_data) {
8981 if (error_data.data.error_messages) {
9167 if (error_data.data.error_messages) {
8982 vm.error_messages = error_data.data.error_messages;
9168 vm.error_messages = error_data.data.error_messages;
8983 }
9169 }
8984 else {
9170 else {
8985 vm.error_messages = ['There was a problem processing your request'];
9171 vm.error_messages = ['There was a problem processing your request'];
8986 }
9172 }
8987 });
9173 });
8988 };
9174 };
8989 vm.ok = function () {
9175 vm.ok = function () {
8990 vm.loading = true;
9176 vm.loading = true;
8991 vm.form.group_id = vm.report.group_id;
9177 vm.form.group_id = vm.report.group_id;
8992 integrationResource.save({
9178 integrationResource.save({
8993 resourceId: vm.report.resource_id,
9179 resourceId: vm.report.resource_id,
8994 action: 'create-issue',
9180 action: 'create-issue',
8995 integration: vm.integrationName
9181 integration: vm.integrationName
8996 }, vm.form,
9182 }, vm.form,
8997 function (data) {
9183 function (data) {
8998 vm.loading = false;
9184 vm.loading = false;
8999 if (data.error_messages) {
9185 if (data.error_messages) {
9000 vm.error_messages = data.error_messages;
9186 vm.error_messages = data.error_messages;
9001 }
9187 }
9002 if (data !== false) {
9188 if (data !== false) {
9003 $uibModalInstance.dismiss('success');
9189 $uibModalInstance.dismiss('success');
9004 }
9190 }
9005 }, function (error_data) {
9191 }, function (error_data) {
9006 if (error_data.data.error_messages) {
9192 if (error_data.data.error_messages) {
9007 vm.error_messages = error_data.data.error_messages;
9193 vm.error_messages = error_data.data.error_messages;
9008 }
9194 }
9009 else {
9195 else {
9010 vm.error_messages = ['There was a problem processing your request'];
9196 vm.error_messages = ['There was a problem processing your request'];
9011 }
9197 }
9012 });
9198 });
9013 };
9199 };
9014 vm.cancel = function () {
9200 vm.cancel = function () {
9015 $uibModalInstance.dismiss('cancel');
9201 $uibModalInstance.dismiss('cancel');
9016 };
9202 };
9017 vm.fetchInfo();
9203 vm.fetchInfo();
9018 }
9204 }
9019
9205
9020 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9206 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9021 // #
9207 // #
9022 // # This program is free software: you can redistribute it and/or modify
9208 // # This program is free software: you can redistribute it and/or modify
9023 // # it under the terms of the GNU Affero General Public License, version 3
9209 // # it under the terms of the GNU Affero General Public License, version 3
9024 // # (only), as published by the Free Software Foundation.
9210 // # (only), as published by the Free Software Foundation.
9025 // #
9211 // #
9026 // # This program is distributed in the hope that it will be useful,
9212 // # This program is distributed in the hope that it will be useful,
9027 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9213 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9028 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9214 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9029 // # GNU General Public License for more details.
9215 // # GNU General Public License for more details.
9030 // #
9216 // #
9031 // # You should have received a copy of the GNU Affero General Public License
9217 // # You should have received a copy of the GNU Affero General Public License
9032 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9218 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9033 // #
9219 // #
9034 // # This program is dual-licensed. If you wish to learn more about the
9220 // # This program is dual-licensed. If you wish to learn more about the
9035 // # AppEnlight Enterprise Edition, including its added features, Support
9221 // # AppEnlight Enterprise Edition, including its added features, Support
9036 // # services, and proprietary license terms, please see
9222 // # services, and proprietary license terms, please see
9037 // # https://rhodecode.com/licenses/
9223 // # https://rhodecode.com/licenses/
9038
9224
9039 angular.module('appenlight.controllers')
9225 angular.module('appenlight.controllers')
9040 .controller('GithubIntegrationCtrl', GithubIntegrationCtrl);
9226 .controller('GithubIntegrationCtrl', GithubIntegrationCtrl);
9041
9227
9042 GithubIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
9228 GithubIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
9043
9229
9044 function GithubIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
9230 function GithubIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
9045 var vm = this;
9231 var vm = this;
9046 vm.loading = true;
9232 vm.loading = true;
9047 vm.assignees = [];
9233 vm.assignees = [];
9048 vm.report = report;
9234 vm.report = report;
9049 vm.integrationName = integrationName;
9235 vm.integrationName = integrationName;
9050 vm.statuses = [];
9236 vm.statuses = [];
9051 vm.assignees = [];
9237 vm.assignees = [];
9052 vm.error_messages = [];
9238 vm.error_messages = [];
9053 vm.form = {
9239 vm.form = {
9054 content: '\n' +
9240 content: '\n' +
9055 'Issue created for report: ' +
9241 'Issue created for report: ' +
9056 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
9242 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
9057 };
9243 };
9058
9244
9059 vm.fetchInfo = function () {
9245 vm.fetchInfo = function () {
9060 integrationResource.get({
9246 integrationResource.get({
9061 resourceId: vm.report.resource_id,
9247 resourceId: vm.report.resource_id,
9062 action: 'info',
9248 action: 'info',
9063 integration: vm.integrationName
9249 integration: vm.integrationName
9064 }, null,
9250 }, null,
9065 function (data) {
9251 function (data) {
9066 vm.loading = false;
9252 vm.loading = false;
9067 if (data.error_messages) {
9253 if (data.error_messages) {
9068 vm.error_messages = data.error_messages;
9254 vm.error_messages = data.error_messages;
9069 }
9255 }
9070 else {
9256 else {
9071 vm.assignees = data.assignees;
9257 vm.assignees = data.assignees;
9072 vm.statuses = data.statuses;
9258 vm.statuses = data.statuses;
9073 vm.form.responsible = vm.assignees[0];
9259 vm.form.responsible = vm.assignees[0];
9074 vm.form.status = vm.statuses[0];
9260 vm.form.status = vm.statuses[0];
9075 }
9261 }
9076 }, function (error_data) {
9262 }, function (error_data) {
9077 if (error_data.data.error_messages) {
9263 if (error_data.data.error_messages) {
9078 vm.error_messages = error_data.data.error_messages;
9264 vm.error_messages = error_data.data.error_messages;
9079 }
9265 }
9080 else {
9266 else {
9081 vm.error_messages = ['There was a problem processing your request'];
9267 vm.error_messages = ['There was a problem processing your request'];
9082 }
9268 }
9083 });
9269 });
9084 };
9270 };
9085 vm.ok = function () {
9271 vm.ok = function () {
9086 vm.loading = true;
9272 vm.loading = true;
9087 vm.form.group_id = vm.report.group_id;
9273 vm.form.group_id = vm.report.group_id;
9088 integrationResource.save({
9274 integrationResource.save({
9089 resourceId: vm.report.resource_id,
9275 resourceId: vm.report.resource_id,
9090 action: 'create-issue',
9276 action: 'create-issue',
9091 integration: vm.integrationName
9277 integration: vm.integrationName
9092 }, vm.form,
9278 }, vm.form,
9093 function (data) {
9279 function (data) {
9094 vm.loading = false;
9280 vm.loading = false;
9095 if (data.error_messages) {
9281 if (data.error_messages) {
9096 vm.error_messages = data.error_messages;
9282 vm.error_messages = data.error_messages;
9097 }
9283 }
9098 else {
9284 else {
9099 $uibModalInstance.dismiss('success');
9285 $uibModalInstance.dismiss('success');
9100 }
9286 }
9101 }, function (error_data) {
9287 }, function (error_data) {
9102 if (error_data.data.error_messages) {
9288 if (error_data.data.error_messages) {
9103 vm.error_messages = error_data.data.error_messages;
9289 vm.error_messages = error_data.data.error_messages;
9104 }
9290 }
9105 else {
9291 else {
9106 vm.error_messages = ['There was a problem processing your request'];
9292 vm.error_messages = ['There was a problem processing your request'];
9107 }
9293 }
9108 });
9294 });
9109 };
9295 };
9110 vm.cancel = function () {
9296 vm.cancel = function () {
9111 $uibModalInstance.dismiss('cancel');
9297 $uibModalInstance.dismiss('cancel');
9112 };
9298 };
9113 vm.fetchInfo();
9299 vm.fetchInfo();
9114 }
9300 }
9115
9301
9116 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9302 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9117 // #
9303 // #
9118 // # This program is free software: you can redistribute it and/or modify
9304 // # This program is free software: you can redistribute it and/or modify
9119 // # it under the terms of the GNU Affero General Public License, version 3
9305 // # it under the terms of the GNU Affero General Public License, version 3
9120 // # (only), as published by the Free Software Foundation.
9306 // # (only), as published by the Free Software Foundation.
9121 // #
9307 // #
9122 // # This program is distributed in the hope that it will be useful,
9308 // # This program is distributed in the hope that it will be useful,
9123 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9309 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9124 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9310 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9125 // # GNU General Public License for more details.
9311 // # GNU General Public License for more details.
9126 // #
9312 // #
9127 // # You should have received a copy of the GNU Affero General Public License
9313 // # You should have received a copy of the GNU Affero General Public License
9128 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9314 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9129 // #
9315 // #
9130 // # This program is dual-licensed. If you wish to learn more about the
9316 // # This program is dual-licensed. If you wish to learn more about the
9131 // # AppEnlight Enterprise Edition, including its added features, Support
9317 // # AppEnlight Enterprise Edition, including its added features, Support
9132 // # services, and proprietary license terms, please see
9318 // # services, and proprietary license terms, please see
9133 // # https://rhodecode.com/licenses/
9319 // # https://rhodecode.com/licenses/
9134
9320
9135 angular.module('appenlight.controllers')
9321 angular.module('appenlight.controllers')
9136 .controller('JiraIntegrationCtrl', JiraIntegrationCtrl)
9322 .controller('JiraIntegrationCtrl', JiraIntegrationCtrl)
9137
9323
9138 JiraIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
9324 JiraIntegrationCtrl.$inject = ['$uibModalInstance', '$state', 'report', 'integrationName', 'integrationResource'];
9139
9325
9140 function JiraIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
9326 function JiraIntegrationCtrl($uibModalInstance, $state, report, integrationName, integrationResource) {
9141 var vm = this;
9327 var vm = this;
9142 vm.loading = true;
9328 vm.loading = true;
9143 vm.assignees = [];
9329 vm.assignees = [];
9144 vm.report = report;
9330 vm.report = report;
9145 vm.integrationName = integrationName;
9331 vm.integrationName = integrationName;
9146 vm.statuses = [];
9332 vm.statuses = [];
9147 vm.priorities = [];
9333 vm.priorities = [];
9148 vm.issue_types = [];
9334 vm.issue_types = [];
9149 vm.error_messages = [];
9335 vm.error_messages = [];
9150 vm.form = {
9336 vm.form = {
9151 content: '\n' +
9337 content: '\n' +
9152 'Issue created for report: ' +
9338 'Issue created for report: ' +
9153 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
9339 $state.href('report.view_detail', {groupId:report.group_id, reportId:report.id}, {absolute:true})
9154 };
9340 };
9155
9341
9156 vm.fetchInfo = function () {
9342 vm.fetchInfo = function () {
9157 integrationResource.get({
9343 integrationResource.get({
9158 resourceId: vm.report.resource_id,
9344 resourceId: vm.report.resource_id,
9159 action: 'info',
9345 action: 'info',
9160 integration: vm.integrationName
9346 integration: vm.integrationName
9161 }, null,
9347 }, null,
9162 function (data) {
9348 function (data) {
9163 vm.loading = false;
9349 vm.loading = false;
9164 if (data.error_messages) {
9350 if (data.error_messages) {
9165 vm.error_messages = data.error_messages;
9351 vm.error_messages = data.error_messages;
9166 }
9352 }
9167 vm.assignees = data.assignees;
9353 vm.assignees = data.assignees;
9168 vm.priorities = data.priorities;
9354 vm.priorities = data.priorities;
9169 vm.issue_types = data.issue_types;
9355 vm.issue_types = data.issue_types;
9170 vm.form.issue_type = vm.issue_types[0];
9356 vm.form.issue_type = vm.issue_types[0];
9171 vm.form.responsible = vm.assignees[0];
9357 vm.form.responsible = vm.assignees[0];
9172 vm.form.priority = vm.priorities[0];
9358 vm.form.priority = vm.priorities[0];
9173 }, function (error_data) {
9359 }, function (error_data) {
9174
9360
9175 if (error_data.data.error_messages) {
9361 if (error_data.data.error_messages) {
9176 vm.error_messages = error_data.data.error_messages;
9362 vm.error_messages = error_data.data.error_messages;
9177 }
9363 }
9178 else {
9364 else {
9179 vm.error_messages = ['There was a problem processing your request'];
9365 vm.error_messages = ['There was a problem processing your request'];
9180 }
9366 }
9181 });
9367 });
9182 };
9368 };
9183 vm.ok = function () {
9369 vm.ok = function () {
9184 vm.loading = true;
9370 vm.loading = true;
9185 vm.form.group_id = vm.report.group_id;
9371 vm.form.group_id = vm.report.group_id;
9186 integrationResource.save({
9372 integrationResource.save({
9187 resourceId: vm.report.resource_id,
9373 resourceId: vm.report.resource_id,
9188 action: 'create-issue',
9374 action: 'create-issue',
9189 integration: vm.integrationName
9375 integration: vm.integrationName
9190 }, vm.form,
9376 }, vm.form,
9191 function (data) {
9377 function (data) {
9192 vm.loading = false;
9378 vm.loading = false;
9193 if (data.error_messages) {
9379 if (data.error_messages) {
9194 vm.error_messages = data.error_messages;
9380 vm.error_messages = data.error_messages;
9195 }
9381 }
9196 if (data !== false) {
9382 if (data !== false) {
9197 $uibModalInstance.dismiss('success');
9383 $uibModalInstance.dismiss('success');
9198 }
9384 }
9199 }, function (error_data) {
9385 }, function (error_data) {
9200 if (error_data.data.error_messages) {
9386 if (error_data.data.error_messages) {
9201 vm.error_messages = error_data.data.error_messages;
9387 vm.error_messages = error_data.data.error_messages;
9202 }
9388 }
9203 else {
9389 else {
9204 vm.error_messages = ['There was a problem processing your request'];
9390 vm.error_messages = ['There was a problem processing your request'];
9205 }
9391 }
9206 });
9392 });
9207 };
9393 };
9208 vm.cancel = function () {
9394 vm.cancel = function () {
9209 $uibModalInstance.dismiss('cancel');
9395 $uibModalInstance.dismiss('cancel');
9210 };
9396 };
9211 vm.fetchInfo();
9397 vm.fetchInfo();
9212 }
9398 }
9213
9399
9214 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9400 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9215 // #
9401 // #
9216 // # This program is free software: you can redistribute it and/or modify
9402 // # This program is free software: you can redistribute it and/or modify
9217 // # it under the terms of the GNU Affero General Public License, version 3
9403 // # it under the terms of the GNU Affero General Public License, version 3
9218 // # (only), as published by the Free Software Foundation.
9404 // # (only), as published by the Free Software Foundation.
9219 // #
9405 // #
9220 // # This program is distributed in the hope that it will be useful,
9406 // # This program is distributed in the hope that it will be useful,
9221 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9407 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9222 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9408 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9223 // # GNU General Public License for more details.
9409 // # GNU General Public License for more details.
9224 // #
9410 // #
9225 // # You should have received a copy of the GNU Affero General Public License
9411 // # You should have received a copy of the GNU Affero General Public License
9226 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9412 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9227 // #
9413 // #
9228 // # This program is dual-licensed. If you wish to learn more about the
9414 // # This program is dual-licensed. If you wish to learn more about the
9229 // # AppEnlight Enterprise Edition, including its added features, Support
9415 // # AppEnlight Enterprise Edition, including its added features, Support
9230 // # services, and proprietary license terms, please see
9416 // # services, and proprietary license terms, please see
9231 // # https://rhodecode.com/licenses/
9417 // # https://rhodecode.com/licenses/
9232
9418
9233 angular.module('appenlight.controllers').controller('LogsController', LogsController);
9419 angular.module('appenlight.controllers').controller('LogsController', LogsController);
9234
9420
9235 LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource'];
9421 LogsController.$inject = ['$scope', '$location', 'stateHolder', 'typeAheadTagHelper', 'logsNoIdResource', 'sectionViewResource'];
9236
9422
9237 function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource) {
9423 function LogsController($scope, $location, stateHolder, typeAheadTagHelper, logsNoIdResource, sectionViewResource) {
9238 var vm = this;
9424 var vm = this;
9239 vm.logEventsChartConfig = {
9425 vm.logEventsChartConfig = {
9240 data: {
9426 data: {
9241 json: [],
9427 json: [],
9242 xFormat: '%Y-%m-%dT%H:%M:%S'
9428 xFormat: '%Y-%m-%dT%H:%M:%S'
9243 },
9429 },
9244 color: {
9430 color: {
9245 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
9431 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
9246 },
9432 },
9247 axis: {
9433 axis: {
9248 x: {
9434 x: {
9249 type: 'timeseries',
9435 type: 'timeseries',
9250 tick: {
9436 tick: {
9251 format: '%Y-%m-%d'
9437 format: '%Y-%m-%d'
9252 }
9438 }
9253 },
9439 },
9254 y: {
9440 y: {
9255 tick: {
9441 tick: {
9256 count: 5,
9442 count: 5,
9257 format: d3.format('.2s')
9443 format: d3.format('.2s')
9258 }
9444 }
9259 }
9445 }
9260 },
9446 },
9261 subchart: {
9447 subchart: {
9262 show: true,
9448 show: true,
9263 size: {
9449 size: {
9264 height: 20
9450 height: 20
9265 }
9451 }
9266 },
9452 },
9267 size: {
9453 size: {
9268 height: 250
9454 height: 250
9269 },
9455 },
9270 zoom: {
9456 zoom: {
9271 rescale: true
9457 rescale: true
9272 },
9458 },
9273 grid: {
9459 grid: {
9274 x: {
9460 x: {
9275 show: true
9461 show: true
9276 },
9462 },
9277 y: {
9463 y: {
9278 show: true
9464 show: true
9279 }
9465 }
9280 },
9466 },
9281 tooltip: {
9467 tooltip: {
9282 format: {
9468 format: {
9283 title: function (d) {
9469 title: function (d) {
9284 return '' + d;
9470 return '' + d;
9285 },
9471 },
9286 value: function (v) {
9472 value: function (v) {
9287 return v
9473 return v
9288 }
9474 }
9289 }
9475 }
9290 }
9476 }
9291 };
9477 };
9292 vm.logEventsChartData = {};
9478 vm.logEventsChartData = {};
9293 stateHolder.section = 'logs';
9479 stateHolder.section = 'logs';
9294 vm.today = function () {
9480 vm.today = function () {
9295 vm.pickerDate = new Date();
9481 vm.pickerDate = new Date();
9296 };
9482 };
9297 vm.today();
9483 vm.today();
9298
9484
9299 vm.applications = stateHolder.AeUser.applications_map;
9485 vm.applications = stateHolder.AeUser.applications_map;
9300 vm.logsPage = [];
9486 vm.logsPage = [];
9301 vm.itemCount = 0;
9487 vm.itemCount = 0;
9302 vm.itemsPerPage = 250;
9488 vm.itemsPerPage = 250;
9303 vm.searchParams = parseSearchToTags($location.search());
9489 vm.searchParams = parseSearchToTags($location.search());
9304 vm.$location = $location;
9490 vm.$location = $location;
9305 vm.isLoading = {
9491 vm.isLoading = {
9306 logs: true,
9492 logs: true,
9307 series: true
9493 series: true
9308 };
9494 };
9309 vm.filterTypeAheadOptions = [
9495 vm.filterTypeAheadOptions = [
9310 {
9496 {
9311 type: 'message',
9497 type: 'message',
9312 text: 'message:',
9498 text: 'message:',
9313 'description': 'Full-text search in your logs',
9499 'description': 'Full-text search in your logs',
9314 tag: 'Message',
9500 tag: 'Message',
9315 example: 'message:text-im-looking-for'
9501 example: 'message:text-im-looking-for'
9316 },
9502 },
9317 {
9503 {
9318 type: 'namespace',
9504 type: 'namespace',
9319 text: 'namespace:',
9505 text: 'namespace:',
9320 'description': 'Query logs from specific namespace',
9506 'description': 'Query logs from specific namespace',
9321 tag: 'Namespace',
9507 tag: 'Namespace',
9322 example: "namespace:module.foo"
9508 example: "namespace:module.foo"
9323 },
9509 },
9324 {
9510 {
9325 type: 'resource',
9511 type: 'resource',
9326 text: 'resource:',
9512 text: 'resource:',
9327 'description': 'Restrict resultset to application',
9513 'description': 'Restrict resultset to application',
9328 tag: 'Application',
9514 tag: 'Application',
9329 example: "resource:ID"
9515 example: "resource:ID"
9330 },
9516 },
9331 {
9517 {
9332 type: 'request_id',
9518 type: 'request_id',
9333 text: 'request_id:',
9519 text: 'request_id:',
9334 'description': 'Show logs with specific request id',
9520 'description': 'Show logs with specific request id',
9335 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
9521 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
9336 tag: 'Request ID'
9522 tag: 'Request ID'
9337 },
9523 },
9338 {
9524 {
9339 type: 'level',
9525 type: 'level',
9340 text: 'level:',
9526 text: 'level:',
9341 'description': 'Show entries with specific log level',
9527 'description': 'Show entries with specific log level',
9342 example: 'level:warning',
9528 example: 'level:warning',
9343 tag: 'Level'
9529 tag: 'Level'
9344 },
9530 },
9345 {
9531 {
9346 type: 'server_name',
9532 type: 'server_name',
9347 text: 'server_name:',
9533 text: 'server_name:',
9348 'description': 'Show entries tagged with this key/value pair',
9534 'description': 'Show entries tagged with this key/value pair',
9349 example: 'server_name:hostname',
9535 example: 'server_name:hostname',
9350 tag: 'Tag'
9536 tag: 'Tag'
9351 },
9537 },
9352 {
9538 {
9353 type: 'start_date',
9539 type: 'start_date',
9354 text: 'start_date:',
9540 text: 'start_date:',
9355 'description': 'Show results newer than this date (press TAB for dropdown)',
9541 'description': 'Show results newer than this date (press TAB for dropdown)',
9356 example: 'start_date:2014-08-15T13:00',
9542 example: 'start_date:2014-08-15T13:00',
9357 tag: 'Start Date'
9543 tag: 'Start Date'
9358 },
9544 },
9359 {
9545 {
9360 type: 'end_date',
9546 type: 'end_date',
9361 text: 'end_date:',
9547 text: 'end_date:',
9362 'description': 'Show results older than this date (press TAB for dropdown)',
9548 'description': 'Show results older than this date (press TAB for dropdown)',
9363 example: 'start_date:2014-08-15T23:59',
9549 example: 'start_date:2014-08-15T23:59',
9364 tag: 'End Date'
9550 tag: 'End Date'
9365 },
9551 },
9366 {type: 'level', value: 'debug', text: 'level:debug'},
9552 {type: 'level', value: 'debug', text: 'level:debug'},
9367 {type: 'level', value: 'info', text: 'level:info'},
9553 {type: 'level', value: 'info', text: 'level:info'},
9368 {type: 'level', value: 'warning', text: 'level:warning'},
9554 {type: 'level', value: 'warning', text: 'level:warning'},
9369 {type: 'level', value: 'critical', text: 'level:critical'}
9555 {type: 'level', value: 'critical', text: 'level:critical'}
9370 ];
9556 ];
9371 vm.filterTypeAhead = null;
9557 vm.filterTypeAhead = null;
9372 vm.showDatePicker = false;
9558 vm.showDatePicker = false;
9373 vm.manualOpen = false;
9559 vm.manualOpen = false;
9374 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
9560 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
9375 vm.removeSearchTag = function (tag) {
9561 vm.removeSearchTag = function (tag) {
9376 $location.search(tag.type, null);
9562 $location.search(tag.type, null);
9377 };
9563 };
9378 vm.addSearchTag = function (tag) {
9564 vm.addSearchTag = function (tag) {
9379 $location.search(tag.type, tag.value);
9565 $location.search(tag.type, tag.value);
9380 };
9566 };
9381
9567
9382 vm.paginationChange = function(){
9568 vm.paginationChange = function(){
9383 $location.search('page', vm.searchParams.page);
9569 $location.search('page', vm.searchParams.page);
9384 };
9570 };
9385
9571
9386
9572
9387 _.each(vm.applications, function (item) {
9573 _.each(vm.applications, function (item) {
9388 vm.filterTypeAheadOptions.push({
9574 vm.filterTypeAheadOptions.push({
9389 type: 'resource',
9575 type: 'resource',
9390 text: 'resource:' + item.resource_id + ':' + item.resource_name,
9576 text: 'resource:' + item.resource_id + ':' + item.resource_name,
9391 example: 'resource:' + item.resource_id,
9577 example: 'resource:' + item.resource_id,
9392 'tag': item.resource_name,
9578 'tag': item.resource_name,
9393 'description': 'Restrict resultset to this application'
9579 'description': 'Restrict resultset to this application'
9394 });
9580 });
9395 });
9581 });
9396
9582
9397 vm.typeAheadTag = function (event) {
9583 vm.typeAheadTag = function (event) {
9398 var text = vm.filterTypeAhead;
9584 var text = vm.filterTypeAhead;
9399 if (_.isObject(vm.filterTypeAhead)) {
9585 if (_.isObject(vm.filterTypeAhead)) {
9400 text = vm.filterTypeAhead.text;
9586 text = vm.filterTypeAhead.text;
9401 }
9587 }
9402 ;
9588 ;
9403 if (!vm.filterTypeAhead) {
9589 if (!vm.filterTypeAhead) {
9404 return
9590 return
9405 }
9591 }
9406 var parsed = text.split(':');
9592 var parsed = text.split(':');
9407 var tag = {'type': null, 'value': null};
9593 var tag = {'type': null, 'value': null};
9408 // app tags have : twice
9594 // app tags have : twice
9409 if (parsed.length > 2 && parsed[0] == 'resource') {
9595 if (parsed.length > 2 && parsed[0] == 'resource') {
9410 tag.type = 'resource';
9596 tag.type = 'resource';
9411 tag.value = parsed[1];
9597 tag.value = parsed[1];
9412 }
9598 }
9413 // normal tag:value
9599 // normal tag:value
9414 else if (parsed.length > 1) {
9600 else if (parsed.length > 1) {
9415 tag.type = parsed[0];
9601 tag.type = parsed[0];
9416 tag.value = parsed.slice(1).join(':');
9602 tag.value = parsed.slice(1).join(':');
9417 }
9603 }
9418 else {
9604 else {
9419 tag.type = 'message';
9605 tag.type = 'message';
9420 tag.value = parsed.join(':');
9606 tag.value = parsed.join(':');
9421 }
9607 }
9422
9608
9423 // set datepicker hour based on type of field
9609 // set datepicker hour based on type of field
9424 if ('start_date:' == text) {
9610 if ('start_date:' == text) {
9425 vm.showDatePicker = true;
9611 vm.showDatePicker = true;
9426 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9612 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9427 }
9613 }
9428 else if ('end_date:' == text) {
9614 else if ('end_date:' == text) {
9429 vm.showDatePicker = true;
9615 vm.showDatePicker = true;
9430 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9616 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9431 }
9617 }
9432
9618
9433 if (event.keyCode != 13 || !tag.type || !tag.value) {
9619 if (event.keyCode != 13 || !tag.type || !tag.value) {
9434 return
9620 return
9435 }
9621 }
9436 vm.showDatePicker = false;
9622 vm.showDatePicker = false;
9437 // aka we selected one of main options
9623 // aka we selected one of main options
9438 $location.search(tag.type, tag.value);
9624 $location.search(tag.type, tag.value);
9439
9625
9440 // clear typeahead
9626 // clear typeahead
9441 vm.filterTypeAhead = undefined;
9627 vm.filterTypeAhead = undefined;
9442 };
9628 };
9443
9629
9444
9630
9445 vm.pickerDateChanged = function(){
9631 vm.pickerDateChanged = function(){
9446 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
9632 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
9447 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9633 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9448 }
9634 }
9449 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
9635 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
9450 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9636 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9451 }
9637 }
9452 vm.showDatePicker = false;
9638 vm.showDatePicker = false;
9453 };
9639 };
9454
9640
9455 vm.fetchLogs = function (searchParams) {
9641 vm.fetchLogs = function (searchParams) {
9456 vm.isLoading.logs = true;
9642 vm.isLoading.logs = true;
9457 logsNoIdResource.query(searchParams, function (data, getResponseHeaders) {
9643 logsNoIdResource.query(searchParams, function (data, getResponseHeaders) {
9458 vm.isLoading.logs = false;
9644 vm.isLoading.logs = false;
9459 var headers = getResponseHeaders();
9645 var headers = getResponseHeaders();
9460 vm.logsPage = data;
9646 vm.logsPage = data;
9461 vm.itemCount = headers['x-total-count'];
9647 vm.itemCount = headers['x-total-count'];
9462 vm.itemsPerPage = headers['x-items-per-page'];
9648 vm.itemsPerPage = headers['x-items-per-page'];
9463 }, function () {
9649 }, function () {
9464 vm.isLoading.logs = false;
9650 vm.isLoading.logs = false;
9465 });
9651 });
9466 };
9652 };
9467
9653
9468 vm.fetchSeriesData = function (searchParams) {
9654 vm.fetchSeriesData = function (searchParams) {
9469 searchParams['section'] = 'logs_section';
9655 searchParams['section'] = 'logs_section';
9470 searchParams['view'] = 'fetch_series';
9656 searchParams['view'] = 'fetch_series';
9471 vm.isLoading.series = true;
9657 vm.isLoading.series = true;
9472 sectionViewResource.query(searchParams, function (data) {
9658 sectionViewResource.query(searchParams, function (data) {
9473
9659
9474 vm.logEventsChartData = {
9660 vm.logEventsChartData = {
9475 json: data,
9661 json: data,
9476 xFormat: '%Y-%m-%dT%H:%M:%S',
9662 xFormat: '%Y-%m-%dT%H:%M:%S',
9477 keys: {
9663 keys: {
9478 x: 'x',
9664 x: 'x',
9479 value: ["logs"]
9665 value: ["logs"]
9480 },
9666 },
9481 names: {
9667 names: {
9482 logs: 'Log events'
9668 logs: 'Log events'
9483 },
9669 },
9484 type: 'bar'
9670 type: 'bar'
9485 };
9671 };
9486 vm.isLoading.series = false;
9672 vm.isLoading.series = false;
9487 }, function () {
9673 }, function () {
9488 vm.isLoading.series = false;
9674 vm.isLoading.series = false;
9489 });
9675 });
9490 };
9676 };
9491
9677
9492 vm.filterId = function (log) {
9678 vm.filterId = function (log) {
9493 $location.search('request_id', log.request_id);
9679 $location.search('request_id', log.request_id);
9494 };
9680 };
9495
9681
9496 var params = parseTagsToSearch(vm.searchParams);
9682 var params = parseTagsToSearch(vm.searchParams);
9497 vm.fetchLogs(params);
9683 vm.fetchLogs(params);
9498 vm.fetchSeriesData(params);
9684 vm.fetchSeriesData(params);
9499
9685
9500 $scope.$on('$locationChangeSuccess', function () {
9686 $scope.$on('$locationChangeSuccess', function () {
9501
9687
9502 vm.searchParams = parseSearchToTags($location.search());
9688 vm.searchParams = parseSearchToTags($location.search());
9503 var params = parseTagsToSearch(vm.searchParams);
9689 var params = parseTagsToSearch(vm.searchParams);
9504
9690
9505 if (vm.isLoading.logs === false) {
9691 if (vm.isLoading.logs === false) {
9506
9692
9507 vm.fetchLogs(params);
9693 vm.fetchLogs(params);
9508 vm.fetchSeriesData(params);
9694 vm.fetchSeriesData(params);
9509 }
9695 }
9510 });
9696 });
9511
9697
9512 }
9698 }
9513
9699
9514 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9700 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9515 // #
9701 // #
9516 // # This program is free software: you can redistribute it and/or modify
9702 // # This program is free software: you can redistribute it and/or modify
9517 // # it under the terms of the GNU Affero General Public License, version 3
9703 // # it under the terms of the GNU Affero General Public License, version 3
9518 // # (only), as published by the Free Software Foundation.
9704 // # (only), as published by the Free Software Foundation.
9519 // #
9705 // #
9520 // # This program is distributed in the hope that it will be useful,
9706 // # This program is distributed in the hope that it will be useful,
9521 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9707 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9522 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9708 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9523 // # GNU General Public License for more details.
9709 // # GNU General Public License for more details.
9524 // #
9710 // #
9525 // # You should have received a copy of the GNU Affero General Public License
9711 // # You should have received a copy of the GNU Affero General Public License
9526 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9712 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9527 // #
9713 // #
9528 // # This program is dual-licensed. If you wish to learn more about the
9714 // # This program is dual-licensed. If you wish to learn more about the
9529 // # AppEnlight Enterprise Edition, including its added features, Support
9715 // # AppEnlight Enterprise Edition, including its added features, Support
9530 // # services, and proprietary license terms, please see
9716 // # services, and proprietary license terms, please see
9531 // # https://rhodecode.com/licenses/
9717 // # https://rhodecode.com/licenses/
9532
9718
9533 angular.module('appenlight.controllers')
9719 angular.module('appenlight.controllers')
9534 .controller('OverviewCtrl', OverviewCtrl);
9720 .controller('OverviewCtrl', OverviewCtrl);
9535
9721
9536 OverviewCtrl.$inject = [];
9722 OverviewCtrl.$inject = [];
9537
9723
9538 function OverviewCtrl() {
9724 function OverviewCtrl() {
9539
9725
9540 }
9726 }
9541
9727
9542 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9728 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9543 // #
9729 // #
9544 // # This program is free software: you can redistribute it and/or modify
9730 // # This program is free software: you can redistribute it and/or modify
9545 // # it under the terms of the GNU Affero General Public License, version 3
9731 // # it under the terms of the GNU Affero General Public License, version 3
9546 // # (only), as published by the Free Software Foundation.
9732 // # (only), as published by the Free Software Foundation.
9547 // #
9733 // #
9548 // # This program is distributed in the hope that it will be useful,
9734 // # This program is distributed in the hope that it will be useful,
9549 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9735 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9550 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9736 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9551 // # GNU General Public License for more details.
9737 // # GNU General Public License for more details.
9552 // #
9738 // #
9553 // # You should have received a copy of the GNU Affero General Public License
9739 // # You should have received a copy of the GNU Affero General Public License
9554 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9740 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9555 // #
9741 // #
9556 // # This program is dual-licensed. If you wish to learn more about the
9742 // # This program is dual-licensed. If you wish to learn more about the
9557 // # AppEnlight Enterprise Edition, including its added features, Support
9743 // # AppEnlight Enterprise Edition, including its added features, Support
9558 // # services, and proprietary license terms, please see
9744 // # services, and proprietary license terms, please see
9559 // # https://rhodecode.com/licenses/
9745 // # https://rhodecode.com/licenses/
9560
9746
9561 angular.module('appenlight.controllers')
9747 angular.module('appenlight.controllers')
9562 .controller('RegisterController', RegisterController);
9748 .controller('RegisterController', RegisterController);
9563
9749
9564 RegisterController.$inject = ['$scope', '$location'];
9750 RegisterController.$inject = ['$scope', '$location'];
9565
9751
9566 function RegisterController() {
9752 function RegisterController() {
9567 var vm = this;
9753 var vm = this;
9568 vm.selected_form = 'sign-up';
9754 vm.selected_form = 'sign-up';
9569 if (window.location.search.indexOf('sign_in') != -1 || window.location.search.indexOf('came_from') != -1) {
9755 if (window.location.search.indexOf('sign_in') != -1 || window.location.search.indexOf('came_from') != -1) {
9570 vm.selected_form = 'sign-in';
9756 vm.selected_form = 'sign-in';
9571 }
9757 }
9572 }
9758 }
9573
9759
9574 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9760 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9575 // #
9761 // #
9576 // # This program is free software: you can redistribute it and/or modify
9762 // # This program is free software: you can redistribute it and/or modify
9577 // # it under the terms of the GNU Affero General Public License, version 3
9763 // # it under the terms of the GNU Affero General Public License, version 3
9578 // # (only), as published by the Free Software Foundation.
9764 // # (only), as published by the Free Software Foundation.
9579 // #
9765 // #
9580 // # This program is distributed in the hope that it will be useful,
9766 // # This program is distributed in the hope that it will be useful,
9581 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9767 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9582 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9768 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9583 // # GNU General Public License for more details.
9769 // # GNU General Public License for more details.
9584 // #
9770 // #
9585 // # You should have received a copy of the GNU Affero General Public License
9771 // # You should have received a copy of the GNU Affero General Public License
9586 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9772 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9587 // #
9773 // #
9588 // # This program is dual-licensed. If you wish to learn more about the
9774 // # This program is dual-licensed. If you wish to learn more about the
9589 // # AppEnlight Enterprise Edition, including its added features, Support
9775 // # AppEnlight Enterprise Edition, including its added features, Support
9590 // # services, and proprietary license terms, please see
9776 // # services, and proprietary license terms, please see
9591 // # https://rhodecode.com/licenses/
9777 // # https://rhodecode.com/licenses/
9592
9778
9593 angular.module('appenlight.controllers').controller('AssignReportCtrl', AssignReportCtrl);
9779 angular.module('appenlight.controllers').controller('AssignReportCtrl', AssignReportCtrl);
9594 AssignReportCtrl.$inject = ['$uibModalInstance', 'reportGroupPropertyResource', 'report'];
9780 AssignReportCtrl.$inject = ['$uibModalInstance', 'reportGroupPropertyResource', 'report'];
9595
9781
9596 function AssignReportCtrl($uibModalInstance, reportGroupPropertyResource, report) {
9782 function AssignReportCtrl($uibModalInstance, reportGroupPropertyResource, report) {
9597 var vm = this;
9783 var vm = this;
9598 vm.loading = true;
9784 vm.loading = true;
9599 vm.assignedUsers = [];
9785 vm.assignedUsers = [];
9600 vm.unAssignedUsers = [];
9786 vm.unAssignedUsers = [];
9601 vm.report = report;
9787 vm.report = report;
9602 vm.fetchAssignments = function () {
9788 vm.fetchAssignments = function () {
9603 reportGroupPropertyResource.get({
9789 reportGroupPropertyResource.get({
9604 groupId: vm.report.group_id,
9790 groupId: vm.report.group_id,
9605 key: 'assigned_users'
9791 key: 'assigned_users'
9606 }, null,
9792 }, null,
9607 function (data) {
9793 function (data) {
9608 vm.assignedUsers = data.assigned;
9794 vm.assignedUsers = data.assigned;
9609 vm.unAssignedUsers = data.unassigned;
9795 vm.unAssignedUsers = data.unassigned;
9610 vm.loading = false;
9796 vm.loading = false;
9611 });
9797 });
9612 }
9798 }
9613
9799
9614 vm.reassignUser = function (user) {
9800 vm.reassignUser = function (user) {
9615 var is_assigned = vm.assignedUsers.indexOf(user);
9801 var is_assigned = vm.assignedUsers.indexOf(user);
9616 if (is_assigned != -1) {
9802 if (is_assigned != -1) {
9617 vm.assignedUsers.splice(is_assigned, 1);
9803 vm.assignedUsers.splice(is_assigned, 1);
9618 vm.unAssignedUsers.push(user);
9804 vm.unAssignedUsers.push(user);
9619 return
9805 return
9620 }
9806 }
9621 var is_unassigned = vm.unAssignedUsers.indexOf(user);
9807 var is_unassigned = vm.unAssignedUsers.indexOf(user);
9622 if (is_unassigned != -1) {
9808 if (is_unassigned != -1) {
9623 vm.unAssignedUsers.splice(is_unassigned, 1);
9809 vm.unAssignedUsers.splice(is_unassigned, 1);
9624 vm.assignedUsers.push(user);
9810 vm.assignedUsers.push(user);
9625 return
9811 return
9626 }
9812 }
9627 }
9813 }
9628 vm.updateAssignments = function () {
9814 vm.updateAssignments = function () {
9629 var post = {'unassigned': [], 'assigned': []};
9815 var post = {'unassigned': [], 'assigned': []};
9630 _.each(vm.assignedUsers, function (u) {
9816 _.each(vm.assignedUsers, function (u) {
9631 post['assigned'].push(u.user_name)
9817 post['assigned'].push(u.user_name)
9632 });
9818 });
9633 _.each(vm.unAssignedUsers, function (u) {
9819 _.each(vm.unAssignedUsers, function (u) {
9634 post['unassigned'].push(u.user_name)
9820 post['unassigned'].push(u.user_name)
9635 });
9821 });
9636 vm.loading = true;
9822 vm.loading = true;
9637 reportGroupPropertyResource.update({
9823 reportGroupPropertyResource.update({
9638 groupId: vm.report.group_id,
9824 groupId: vm.report.group_id,
9639 key: 'assigned_users'
9825 key: 'assigned_users'
9640 }, post,
9826 }, post,
9641 function (data) {
9827 function (data) {
9642 vm.loading = false;
9828 vm.loading = false;
9643 $uibModalInstance.close(vm.report);
9829 $uibModalInstance.close(vm.report);
9644 });
9830 });
9645 };
9831 };
9646
9832
9647
9833
9648 vm.ok = function () {
9834 vm.ok = function () {
9649 vm.updateAssignments();
9835 vm.updateAssignments();
9650 };
9836 };
9651
9837
9652 vm.cancel = function () {
9838 vm.cancel = function () {
9653 $uibModalInstance.dismiss('cancel');
9839 $uibModalInstance.dismiss('cancel');
9654 };
9840 };
9655
9841
9656 vm.fetchAssignments();
9842 vm.fetchAssignments();
9657
9843
9658 }
9844 }
9659
9845
9660 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9846 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9661 // #
9847 // #
9662 // # This program is free software: you can redistribute it and/or modify
9848 // # This program is free software: you can redistribute it and/or modify
9663 // # it under the terms of the GNU Affero General Public License, version 3
9849 // # it under the terms of the GNU Affero General Public License, version 3
9664 // # (only), as published by the Free Software Foundation.
9850 // # (only), as published by the Free Software Foundation.
9665 // #
9851 // #
9666 // # This program is distributed in the hope that it will be useful,
9852 // # This program is distributed in the hope that it will be useful,
9667 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9853 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9668 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9854 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9669 // # GNU General Public License for more details.
9855 // # GNU General Public License for more details.
9670 // #
9856 // #
9671 // # You should have received a copy of the GNU Affero General Public License
9857 // # You should have received a copy of the GNU Affero General Public License
9672 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9858 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9673 // #
9859 // #
9674 // # This program is dual-licensed. If you wish to learn more about the
9860 // # This program is dual-licensed. If you wish to learn more about the
9675 // # AppEnlight Enterprise Edition, including its added features, Support
9861 // # AppEnlight Enterprise Edition, including its added features, Support
9676 // # services, and proprietary license terms, please see
9862 // # services, and proprietary license terms, please see
9677 // # https://rhodecode.com/licenses/
9863 // # https://rhodecode.com/licenses/
9678
9864
9679 'use strict';
9865 'use strict';
9680
9866
9681 /* Controllers */
9867 /* Controllers */
9682
9868
9683 angular.module('appenlight.controllers')
9869 angular.module('appenlight.controllers')
9684 .controller('ReportsListSlowController', ReportsListSlowController);
9870 .controller('ReportsListSlowController', ReportsListSlowController);
9685
9871
9686 ReportsListSlowController.$inject = ['$scope', '$location', '$cookies',
9872 ReportsListSlowController.$inject = ['$scope', '$location', '$cookies',
9687 'stateHolder', 'typeAheadTagHelper', 'slowReportsResource']
9873 'stateHolder', 'typeAheadTagHelper', 'slowReportsResource']
9688
9874
9689 function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource) {
9875 function ReportsListSlowController($scope, $location, $cookies, stateHolder, typeAheadTagHelper, slowReportsResource) {
9690 var vm = this;
9876 var vm = this;
9691 vm.applications = stateHolder.AeUser.applications_map;
9877 vm.applications = stateHolder.AeUser.applications_map;
9692 stateHolder.section = 'slow_reports';
9878 stateHolder.section = 'slow_reports';
9693 vm.today = function () {
9879 vm.today = function () {
9694 vm.pickerDate = new Date();
9880 vm.pickerDate = new Date();
9695 };
9881 };
9696 vm.today();
9882 vm.today();
9697 vm.reportsPage = [];
9883 vm.reportsPage = [];
9698 vm.itemCount = 0;
9884 vm.itemCount = 0;
9699 vm.itemsPerPage = 250;
9885 vm.itemsPerPage = 250;
9700 typeAheadTagHelper.tags = [];
9886 typeAheadTagHelper.tags = [];
9701 vm.searchParams = {tags: [], page: 1, type: 'slow_report'};
9887 vm.searchParams = {tags: [], page: 1, type: 'slow_report'};
9702 vm.searchParams = parseSearchToTags($location.search());
9888 vm.searchParams = parseSearchToTags($location.search());
9703 vm.is_loading = false;
9889 vm.is_loading = false;
9704 vm.filterTypeAheadOptions = [
9890 vm.filterTypeAheadOptions = [
9705 {
9891 {
9706 type: 'view_name',
9892 type: 'view_name',
9707 text: 'view_name:',
9893 text: 'view_name:',
9708 'description': 'Query reports occured in specific views',
9894 'description': 'Query reports occured in specific views',
9709 tag: 'View Name',
9895 tag: 'View Name',
9710 example: "view_name:module.foo"
9896 example: "view_name:module.foo"
9711 },
9897 },
9712 {
9898 {
9713 type: 'resource',
9899 type: 'resource',
9714 text: 'resource:',
9900 text: 'resource:',
9715 'description': 'Restrict resultset to application',
9901 'description': 'Restrict resultset to application',
9716 tag: 'Application',
9902 tag: 'Application',
9717 example: "resource:ID"
9903 example: "resource:ID"
9718 },
9904 },
9719 {
9905 {
9720 type: 'priority',
9906 type: 'priority',
9721 text: 'priority:',
9907 text: 'priority:',
9722 'description': 'Show reports with specific priority',
9908 'description': 'Show reports with specific priority',
9723 example: 'priority:8',
9909 example: 'priority:8',
9724 tag: 'Priority'
9910 tag: 'Priority'
9725 },
9911 },
9726 {
9912 {
9727 type: 'min_occurences',
9913 type: 'min_occurences',
9728 text: 'min_occurences:',
9914 text: 'min_occurences:',
9729 'description': 'Show reports from groups with at least X occurences',
9915 'description': 'Show reports from groups with at least X occurences',
9730 example: 'min_occurences:25',
9916 example: 'min_occurences:25',
9731 tag: 'Min. occurences'
9917 tag: 'Min. occurences'
9732 },
9918 },
9733 {
9919 {
9734 type: 'min_duration',
9920 type: 'min_duration',
9735 text: 'min_duration:',
9921 text: 'min_duration:',
9736 'description': 'Show reports from groups with average duration >= Xs',
9922 'description': 'Show reports from groups with average duration >= Xs',
9737 example: 'min_duration:4.5',
9923 example: 'min_duration:4.5',
9738 tag: 'Min. duration'
9924 tag: 'Min. duration'
9739 },
9925 },
9740 {
9926 {
9741 type: 'url_path',
9927 type: 'url_path',
9742 text: 'url_path:',
9928 text: 'url_path:',
9743 'description': 'Show reports from specific URL paths',
9929 'description': 'Show reports from specific URL paths',
9744 example: 'url_path:/foo/bar/baz',
9930 example: 'url_path:/foo/bar/baz',
9745 tag: 'Url Path'
9931 tag: 'Url Path'
9746 },
9932 },
9747 {
9933 {
9748 type: 'url_domain',
9934 type: 'url_domain',
9749 text: 'url_domain:',
9935 text: 'url_domain:',
9750 'description': 'Show reports from specific domain',
9936 'description': 'Show reports from specific domain',
9751 example: 'url_domain:domain.com',
9937 example: 'url_domain:domain.com',
9752 tag: 'Domain'
9938 tag: 'Domain'
9753 },
9939 },
9754 {
9940 {
9755 type: 'request_id',
9941 type: 'request_id',
9756 text: 'request_id:',
9942 text: 'request_id:',
9757 'description': 'Show reports with specific request id',
9943 'description': 'Show reports with specific request id',
9758 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
9944 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
9759 tag: 'Request ID'
9945 tag: 'Request ID'
9760 },
9946 },
9761 {
9947 {
9762 type: 'report_status',
9948 type: 'report_status',
9763 text: 'report_status:',
9949 text: 'report_status:',
9764 'description': 'Show reports from groups with specific status',
9950 'description': 'Show reports from groups with specific status',
9765 example: 'report_status:never_reviewed',
9951 example: 'report_status:never_reviewed',
9766 tag: 'Status'
9952 tag: 'Status'
9767 },
9953 },
9768 {
9954 {
9769 type: 'server_name',
9955 type: 'server_name',
9770 text: 'server_name:',
9956 text: 'server_name:',
9771 'description': 'Show reports tagged with this key/value pair',
9957 'description': 'Show reports tagged with this key/value pair',
9772 example: 'server_name:hostname',
9958 example: 'server_name:hostname',
9773 tag: 'Tag'
9959 tag: 'Tag'
9774 },
9960 },
9775 {
9961 {
9776 type: 'start_date',
9962 type: 'start_date',
9777 text: 'start_date:',
9963 text: 'start_date:',
9778 'description': 'Show reports newer than this date (press TAB for dropdown)',
9964 'description': 'Show reports newer than this date (press TAB for dropdown)',
9779 example: 'start_date:2014-08-15T13:00',
9965 example: 'start_date:2014-08-15T13:00',
9780 tag: 'Start Date'
9966 tag: 'Start Date'
9781 },
9967 },
9782 {
9968 {
9783 type: 'end_date',
9969 type: 'end_date',
9784 text: 'end_date:',
9970 text: 'end_date:',
9785 'description': 'Show reports older than this date (press TAB for dropdown)',
9971 'description': 'Show reports older than this date (press TAB for dropdown)',
9786 example: 'start_date:2014-08-15T23:59',
9972 example: 'start_date:2014-08-15T23:59',
9787 tag: 'End Date'
9973 tag: 'End Date'
9788 }
9974 }
9789 ];
9975 ];
9790
9976
9791 vm.filterTypeAhead = undefined;
9977 vm.filterTypeAhead = undefined;
9792 vm.showDatePicker = false;
9978 vm.showDatePicker = false;
9793 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
9979 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
9794 vm.removeSearchTag = function (tag) {
9980 vm.removeSearchTag = function (tag) {
9795 $location.search(tag.type, null);
9981 $location.search(tag.type, null);
9796 };
9982 };
9797 vm.addSearchTag = function (tag) {
9983 vm.addSearchTag = function (tag) {
9798 $location.search(tag.type, tag.value);
9984 $location.search(tag.type, tag.value);
9799 };
9985 };
9800 vm.manualOpen = false;
9986 vm.manualOpen = false;
9801 vm.notRelativeTime = false;
9987 vm.notRelativeTime = false;
9802 if ($cookies.notRelativeTime) {
9988 if ($cookies.notRelativeTime) {
9803 vm.notRelativeTime = JSON.parse($cookies.notRelativeTime);
9989 vm.notRelativeTime = JSON.parse($cookies.notRelativeTime);
9804 }
9990 }
9805
9991
9806
9992
9807 vm.changeRelativeTime = function () {
9993 vm.changeRelativeTime = function () {
9808 $cookies.notRelativeTime = JSON.stringify(vm.notRelativeTime);
9994 $cookies.notRelativeTime = JSON.stringify(vm.notRelativeTime);
9809 };
9995 };
9810
9996
9811 _.each(_.range(1, 11), function (priority) {
9997 _.each(_.range(1, 11), function (priority) {
9812 vm.filterTypeAheadOptions.push({
9998 vm.filterTypeAheadOptions.push({
9813 type: 'priority',
9999 type: 'priority',
9814 text: 'priority:' + priority.toString(),
10000 text: 'priority:' + priority.toString(),
9815 description: 'Show entries with specific priority',
10001 description: 'Show entries with specific priority',
9816 example: 'priority:' + priority,
10002 example: 'priority:' + priority,
9817 tag: 'Priority'
10003 tag: 'Priority'
9818 });
10004 });
9819 });
10005 });
9820 _.each(['never_reviewed', 'reviewed', 'fixed', 'public'], function (status) {
10006 _.each(['never_reviewed', 'reviewed', 'fixed', 'public'], function (status) {
9821 vm.filterTypeAheadOptions.push({
10007 vm.filterTypeAheadOptions.push({
9822 type: 'report_status',
10008 type: 'report_status',
9823 text: 'report_status:' + status,
10009 text: 'report_status:' + status,
9824 'description': 'Show only reports with this status',
10010 'description': 'Show only reports with this status',
9825 example: 'report_status:' + status,
10011 example: 'report_status:' + status,
9826 tag: 'Status ' + status.toUpperCase()
10012 tag: 'Status ' + status.toUpperCase()
9827 });
10013 });
9828 });
10014 });
9829 _.each(stateHolder.AeUser.applications, function (item) {
10015 _.each(stateHolder.AeUser.applications, function (item) {
9830 vm.filterTypeAheadOptions.push({
10016 vm.filterTypeAheadOptions.push({
9831 type: 'resource',
10017 type: 'resource',
9832 text: 'resource:' + item.resource_id + ':' + item.resource_name,
10018 text: 'resource:' + item.resource_id + ':' + item.resource_name,
9833 example: 'resource:' + item.resource_id,
10019 example: 'resource:' + item.resource_id,
9834 'tag': item.resource_name,
10020 'tag': item.resource_name,
9835 'description': 'Restrict resultset to this application'
10021 'description': 'Restrict resultset to this application'
9836 });
10022 });
9837 });
10023 });
9838
10024
9839 vm.typeAheadTag = function (event) {
10025 vm.typeAheadTag = function (event) {
9840 var text = vm.filterTypeAhead;
10026 var text = vm.filterTypeAhead;
9841 if (_.isObject(vm.filterTypeAhead)) {
10027 if (_.isObject(vm.filterTypeAhead)) {
9842 text = vm.filterTypeAhead.text;
10028 text = vm.filterTypeAhead.text;
9843 }
10029 }
9844 ;
10030 ;
9845 if (!vm.filterTypeAhead) {
10031 if (!vm.filterTypeAhead) {
9846 return
10032 return
9847 }
10033 }
9848 var parsed = text.split(':');
10034 var parsed = text.split(':');
9849 var tag = {'type': null, 'value': null};
10035 var tag = {'type': null, 'value': null};
9850 // app tags have : twice
10036 // app tags have : twice
9851 if (parsed.length > 2 && parsed[0] == 'resource') {
10037 if (parsed.length > 2 && parsed[0] == 'resource') {
9852 tag.type = 'resource';
10038 tag.type = 'resource';
9853 tag.value = parsed[1];
10039 tag.value = parsed[1];
9854 }
10040 }
9855 // normal tag:value
10041 // normal tag:value
9856 else if (parsed.length > 1) {
10042 else if (parsed.length > 1) {
9857 tag.type = parsed[0];
10043 tag.type = parsed[0];
9858 var tagValue = parsed.slice(1);
10044 var tagValue = parsed.slice(1);
9859 if (tagValue) {
10045 if (tagValue) {
9860 tag.value = tagValue.join(':');
10046 tag.value = tagValue.join(':');
9861 }
10047 }
9862 }
10048 }
9863
10049
9864 // set datepicker hour based on type of field
10050 // set datepicker hour based on type of field
9865 if ('start_date:' == text) {
10051 if ('start_date:' == text) {
9866 vm.showDatePicker = true;
10052 vm.showDatePicker = true;
9867 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10053 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9868 }
10054 }
9869 else if ('end_date:' == text) {
10055 else if ('end_date:' == text) {
9870 vm.showDatePicker = true;
10056 vm.showDatePicker = true;
9871 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10057 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9872 }
10058 }
9873
10059
9874 if (event.keyCode != 13 || !tag.type || !tag.value) {
10060 if (event.keyCode != 13 || !tag.type || !tag.value) {
9875 return
10061 return
9876 }
10062 }
9877 vm.showDatePicker = false;
10063 vm.showDatePicker = false;
9878 // aka we selected one of main options
10064 // aka we selected one of main options
9879 $location.search(tag.type, tag.value);
10065 $location.search(tag.type, tag.value);
9880 // clear typeahead
10066 // clear typeahead
9881 vm.filterTypeAhead = undefined;
10067 vm.filterTypeAhead = undefined;
9882 }
10068 }
9883
10069
9884 vm.paginationChange = function(){
10070 vm.paginationChange = function(){
9885 $location.search('page', vm.searchParams.page);
10071 $location.search('page', vm.searchParams.page);
9886 }
10072 }
9887
10073
9888 vm.pickerDateChanged = function(){
10074 vm.pickerDateChanged = function(){
9889 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
10075 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
9890 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10076 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
9891 }
10077 }
9892 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
10078 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
9893 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10079 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
9894 }
10080 }
9895 vm.showDatePicker = false;
10081 vm.showDatePicker = false;
9896 }
10082 }
9897
10083
9898 var reportPresentation = function (report) {
10084 var reportPresentation = function (report) {
9899 report.presentation = {};
10085 report.presentation = {};
9900 if (report.group.public) {
10086 if (report.group.public) {
9901 report.presentation.className = 'public';
10087 report.presentation.className = 'public';
9902 report.presentation.tooltip = 'Public';
10088 report.presentation.tooltip = 'Public';
9903 }
10089 }
9904 else if (report.group.fixed) {
10090 else if (report.group.fixed) {
9905 report.presentation.className = 'fixed';
10091 report.presentation.className = 'fixed';
9906 report.presentation.tooltip = 'Fixed';
10092 report.presentation.tooltip = 'Fixed';
9907 }
10093 }
9908 else if (report.group.read) {
10094 else if (report.group.read) {
9909 report.presentation.className = 'reviewed';
10095 report.presentation.className = 'reviewed';
9910 report.presentation.tooltip = 'Reviewed';
10096 report.presentation.tooltip = 'Reviewed';
9911 }
10097 }
9912 else {
10098 else {
9913 report.presentation.className = 'new';
10099 report.presentation.className = 'new';
9914 report.presentation.tooltip = 'New';
10100 report.presentation.tooltip = 'New';
9915 }
10101 }
9916 return report;
10102 return report;
9917 }
10103 }
9918
10104
9919 vm.fetchReports = function (searchParams) {
10105 vm.fetchReports = function (searchParams) {
9920 vm.is_loading = true;
10106 vm.is_loading = true;
9921 slowReportsResource.query(searchParams, function (data, getResponseHeaders) {
10107 slowReportsResource.query(searchParams, function (data, getResponseHeaders) {
9922 var headers = getResponseHeaders();
10108 var headers = getResponseHeaders();
9923
10109
9924 vm.is_loading = false;
10110 vm.is_loading = false;
9925 vm.reportsPage = _.map(data, function (item) {
10111 vm.reportsPage = _.map(data, function (item) {
9926 return reportPresentation(item);
10112 return reportPresentation(item);
9927 });
10113 });
9928 vm.itemCount = headers['x-total-count'];
10114 vm.itemCount = headers['x-total-count'];
9929 vm.itemsPerPage = headers['x-items-per-page'];
10115 vm.itemsPerPage = headers['x-items-per-page'];
9930 }, function () {
10116 }, function () {
9931 vm.is_loading = false;
10117 vm.is_loading = false;
9932 });
10118 });
9933 }
10119 }
9934
10120
9935 vm.filterId = function (log) {
10121 vm.filterId = function (log) {
9936 vm.searchParams.tags.push({
10122 vm.searchParams.tags.push({
9937 type: "request_id",
10123 type: "request_id",
9938 value: log.request_id
10124 value: log.request_id
9939 });
10125 });
9940 }
10126 }
9941 //initial load
10127 //initial load
9942 var params = parseTagsToSearch(vm.searchParams);
10128 var params = parseTagsToSearch(vm.searchParams);
9943 vm.fetchReports(params);
10129 vm.fetchReports(params);
9944
10130
9945 $scope.$on('$locationChangeSuccess', function () {
10131 $scope.$on('$locationChangeSuccess', function () {
9946
10132
9947 vm.searchParams = parseSearchToTags($location.search());
10133 vm.searchParams = parseSearchToTags($location.search());
9948 var params = parseTagsToSearch(vm.searchParams);
10134 var params = parseTagsToSearch(vm.searchParams);
9949
10135
9950 if (vm.is_loading === false) {
10136 if (vm.is_loading === false) {
9951
10137
9952 vm.fetchReports(params);
10138 vm.fetchReports(params);
9953 }
10139 }
9954 });
10140 });
9955
10141
9956
10142
9957 }
10143 }
9958
10144
9959 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10145 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
9960 // #
10146 // #
9961 // # This program is free software: you can redistribute it and/or modify
10147 // # This program is free software: you can redistribute it and/or modify
9962 // # it under the terms of the GNU Affero General Public License, version 3
10148 // # it under the terms of the GNU Affero General Public License, version 3
9963 // # (only), as published by the Free Software Foundation.
10149 // # (only), as published by the Free Software Foundation.
9964 // #
10150 // #
9965 // # This program is distributed in the hope that it will be useful,
10151 // # This program is distributed in the hope that it will be useful,
9966 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10152 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9967 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10153 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9968 // # GNU General Public License for more details.
10154 // # GNU General Public License for more details.
9969 // #
10155 // #
9970 // # You should have received a copy of the GNU Affero General Public License
10156 // # You should have received a copy of the GNU Affero General Public License
9971 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10157 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
9972 // #
10158 // #
9973 // # This program is dual-licensed. If you wish to learn more about the
10159 // # This program is dual-licensed. If you wish to learn more about the
9974 // # AppEnlight Enterprise Edition, including its added features, Support
10160 // # AppEnlight Enterprise Edition, including its added features, Support
9975 // # services, and proprietary license terms, please see
10161 // # services, and proprietary license terms, please see
9976 // # https://rhodecode.com/licenses/
10162 // # https://rhodecode.com/licenses/
9977
10163
9978 angular.module('appenlight.controllers')
10164 angular.module('appenlight.controllers')
9979 .controller('ReportsListController', ReportsListController);
10165 .controller('ReportsListController', ReportsListController);
9980
10166
9981 ReportsListController.$inject = ['$scope', '$location', '$cookies',
10167 ReportsListController.$inject = ['$scope', '$location', '$cookies',
9982 'stateHolder', 'typeAheadTagHelper', 'reportsResource'];
10168 'stateHolder', 'typeAheadTagHelper', 'reportsResource'];
9983
10169
9984 function ReportsListController($scope, $location, $cookies, stateHolder,
10170 function ReportsListController($scope, $location, $cookies, stateHolder,
9985 typeAheadTagHelper, reportsResource) {
10171 typeAheadTagHelper, reportsResource) {
9986 var vm = this;
10172 var vm = this;
9987 vm.applications = stateHolder.AeUser.applications_map;
10173 vm.applications = stateHolder.AeUser.applications_map;
9988 stateHolder.section = 'reports';
10174 stateHolder.section = 'reports';
9989 vm.today = function () {
10175 vm.today = function () {
9990 vm.pickerDate = new Date();
10176 vm.pickerDate = new Date();
9991 };
10177 };
9992 vm.today();
10178 vm.today();
9993 vm.reportsPage = [];
10179 vm.reportsPage = [];
9994 vm.itemCount = 0;
10180 vm.itemCount = 0;
9995 vm.itemsPerPage = 250;
10181 vm.itemsPerPage = 250;
9996 typeAheadTagHelper.tags = [];
10182 typeAheadTagHelper.tags = [];
9997 vm.searchParams = {tags: [], page: 1, type: 'report'};
10183 vm.searchParams = {tags: [], page: 1, type: 'report'};
9998 vm.searchParams = parseSearchToTags($location.search());
10184 vm.searchParams = parseSearchToTags($location.search());
9999 vm.is_loading = false;
10185 vm.is_loading = false;
10000 vm.filterTypeAheadOptions = [
10186 vm.filterTypeAheadOptions = [
10001 {
10187 {
10002 type: 'error',
10188 type: 'error',
10003 text: 'error:',
10189 text: 'error:',
10004 'description': 'Full-text search in your reports',
10190 'description': 'Full-text search in your reports',
10005 example: 'error:text-im-looking-for',
10191 example: 'error:text-im-looking-for',
10006 tag: 'Error'
10192 tag: 'Error'
10007 },
10193 },
10008 {
10194 {
10009 type: 'view_name',
10195 type: 'view_name',
10010 text: 'view_name:',
10196 text: 'view_name:',
10011 'description': 'Query reports occured in specific views',
10197 'description': 'Query reports occured in specific views',
10012 example: "view_name:module.foo",
10198 example: "view_name:module.foo",
10013 tag: 'View Name'
10199 tag: 'View Name'
10014 },
10200 },
10015 {
10201 {
10016 type: 'resource',
10202 type: 'resource',
10017 text: 'resource:',
10203 text: 'resource:',
10018 'description': 'Restrict resultset to application',
10204 'description': 'Restrict resultset to application',
10019 example: "resource:ID",
10205 example: "resource:ID",
10020 tag: 'Application'
10206 tag: 'Application'
10021 },
10207 },
10022 {
10208 {
10023 type: 'priority',
10209 type: 'priority',
10024 text: 'priority:',
10210 text: 'priority:',
10025 'description': 'Show reports with specific priority',
10211 'description': 'Show reports with specific priority',
10026 example: 'priority:8',
10212 example: 'priority:8',
10027 tag: 'Priority'
10213 tag: 'Priority'
10028 },
10214 },
10029 {
10215 {
10030 type: 'min_occurences',
10216 type: 'min_occurences',
10031 text: 'min_occurences:',
10217 text: 'min_occurences:',
10032 'description': 'Show reports from groups with at least X occurences',
10218 'description': 'Show reports from groups with at least X occurences',
10033 example: 'min_occurences:25',
10219 example: 'min_occurences:25',
10034 tag: 'Occurences'
10220 tag: 'Occurences'
10035 },
10221 },
10036 {
10222 {
10037 type: 'url_path',
10223 type: 'url_path',
10038 text: 'url_path:',
10224 text: 'url_path:',
10039 'description': 'Show reports from specific URL paths',
10225 'description': 'Show reports from specific URL paths',
10040 example: 'url_path:/foo/bar/baz',
10226 example: 'url_path:/foo/bar/baz',
10041 tag: 'Url Path'
10227 tag: 'Url Path'
10042 },
10228 },
10043 {
10229 {
10044 type: 'url_domain',
10230 type: 'url_domain',
10045 text: 'url_domain:',
10231 text: 'url_domain:',
10046 'description': 'Show reports from specific domain',
10232 'description': 'Show reports from specific domain',
10047 example: 'url_domain:domain.com',
10233 example: 'url_domain:domain.com',
10048 tag: 'Domain'
10234 tag: 'Domain'
10049 },
10235 },
10050 {
10236 {
10051 type: 'report_status',
10237 type: 'report_status',
10052 text: 'report_status:',
10238 text: 'report_status:',
10053 'description': 'Show reports from groups with specific status',
10239 'description': 'Show reports from groups with specific status',
10054 example: 'report_status:never_reviewed',
10240 example: 'report_status:never_reviewed',
10055 tag: 'Status'
10241 tag: 'Status'
10056 },
10242 },
10057 {
10243 {
10058 type: 'request_id',
10244 type: 'request_id',
10059 text: 'request_id:',
10245 text: 'request_id:',
10060 'description': 'Show reports with specific request id',
10246 'description': 'Show reports with specific request id',
10061 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
10247 example: "request_id:883143dc572e4c38aceae92af0ea5ae0",
10062 tag: 'Request ID'
10248 tag: 'Request ID'
10063 },
10249 },
10064 {
10250 {
10065 type: 'server_name',
10251 type: 'server_name',
10066 text: 'server_name:',
10252 text: 'server_name:',
10067 'description': 'Show reports tagged with this key/value pair',
10253 'description': 'Show reports tagged with this key/value pair',
10068 example: 'server_name:hostname',
10254 example: 'server_name:hostname',
10069 tag: 'Tag'
10255 tag: 'Tag'
10070 },
10256 },
10071 {
10257 {
10072 type: 'http_status',
10258 type: 'http_status',
10073 text: 'http_status:',
10259 text: 'http_status:',
10074 'description': 'Show reports with specific HTTP status code',
10260 'description': 'Show reports with specific HTTP status code',
10075 example: "http_status:",
10261 example: "http_status:",
10076 tag: 'HTTP Status'
10262 tag: 'HTTP Status'
10077 },
10263 },
10078 {
10264 {
10079 type: 'http_status',
10265 type: 'http_status',
10080 text: 'http_status:500',
10266 text: 'http_status:500',
10081 'description': 'Show reports with specific HTTP status code',
10267 'description': 'Show reports with specific HTTP status code',
10082 example: "http_status:500",
10268 example: "http_status:500",
10083 tag: 'HTTP Status'
10269 tag: 'HTTP Status'
10084 },
10270 },
10085 {
10271 {
10086 type: 'http_status',
10272 type: 'http_status',
10087 text: 'http_status:404',
10273 text: 'http_status:404',
10088 'description': 'Include 404 reports in your search',
10274 'description': 'Include 404 reports in your search',
10089 example: "http_status:404",
10275 example: "http_status:404",
10090 tag: 'HTTP Status'
10276 tag: 'HTTP Status'
10091 },
10277 },
10092 {
10278 {
10093 type: 'start_date',
10279 type: 'start_date',
10094 text: 'start_date:',
10280 text: 'start_date:',
10095 'description': 'Show reports newer than this date (press TAB for dropdown)',
10281 'description': 'Show reports newer than this date (press TAB for dropdown)',
10096 example: 'start_date:2014-08-15T13:00',
10282 example: 'start_date:2014-08-15T13:00',
10097 tag: 'Start Date'
10283 tag: 'Start Date'
10098 },
10284 },
10099 {
10285 {
10100 type: 'end_date',
10286 type: 'end_date',
10101 text: 'end_date:',
10287 text: 'end_date:',
10102 'description': 'Show reports older than this date (press TAB for dropdown)',
10288 'description': 'Show reports older than this date (press TAB for dropdown)',
10103 example: 'start_date:2014-08-15T23:59',
10289 example: 'start_date:2014-08-15T23:59',
10104 tag: 'End Date'
10290 tag: 'End Date'
10105 }
10291 }
10106 ];
10292 ];
10107
10293
10108 vm.filterTypeAhead = undefined;
10294 vm.filterTypeAhead = undefined;
10109 vm.showDatePicker = false;
10295 vm.showDatePicker = false;
10110 vm.manualOpen = false;
10296 vm.manualOpen = false;
10111 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
10297 vm.aheadFilter = typeAheadTagHelper.aheadFilter;
10112 vm.removeSearchTag = function (tag) {
10298 vm.removeSearchTag = function (tag) {
10113 $location.search(tag.type, null);
10299 $location.search(tag.type, null);
10114 };
10300 };
10115 vm.addSearchTag = function (tag) {
10301 vm.addSearchTag = function (tag) {
10116 $location.search(tag.type, tag.value);
10302 $location.search(tag.type, tag.value);
10117 };
10303 };
10118 vm.notRelativeTime = false;
10304 vm.notRelativeTime = false;
10119 if ($cookies.notRelativeTime) {
10305 if ($cookies.notRelativeTime) {
10120 vm.notRelativeTime = JSON.parse($cookies.notRelativeTime);
10306 vm.notRelativeTime = JSON.parse($cookies.notRelativeTime);
10121 }
10307 }
10122
10308
10123 vm.changeRelativeTime = function () {
10309 vm.changeRelativeTime = function () {
10124 $cookies.notRelativeTime = JSON.stringify(vm.notRelativeTime);
10310 $cookies.notRelativeTime = JSON.stringify(vm.notRelativeTime);
10125 }
10311 }
10126
10312
10127 _.each(_.range(1, 11), function (priority) {
10313 _.each(_.range(1, 11), function (priority) {
10128 vm.filterTypeAheadOptions.push({
10314 vm.filterTypeAheadOptions.push({
10129 type: 'priority',
10315 type: 'priority',
10130 text: 'priority:' + priority.toString(),
10316 text: 'priority:' + priority.toString(),
10131 description: 'Show entries with specific priority',
10317 description: 'Show entries with specific priority',
10132 example: 'priority:' + priority,
10318 example: 'priority:' + priority,
10133 tag: 'Priority'
10319 tag: 'Priority'
10134 });
10320 });
10135 });
10321 });
10136 _.each(['never_reviewed', 'reviewed', 'fixed', 'public'], function (status) {
10322 _.each(['never_reviewed', 'reviewed', 'fixed', 'public'], function (status) {
10137 vm.filterTypeAheadOptions.push({
10323 vm.filterTypeAheadOptions.push({
10138 type: 'report_status',
10324 type: 'report_status',
10139 text: 'report_status:' + status,
10325 text: 'report_status:' + status,
10140 'description': 'Show only reports with this status',
10326 'description': 'Show only reports with this status',
10141 example: 'report_status:' + status,
10327 example: 'report_status:' + status,
10142 tag: 'Status ' + status.toUpperCase()
10328 tag: 'Status ' + status.toUpperCase()
10143 });
10329 });
10144 });
10330 });
10145 _.each(stateHolder.AeUser.applications, function (item) {
10331 _.each(stateHolder.AeUser.applications, function (item) {
10146 vm.filterTypeAheadOptions.push({
10332 vm.filterTypeAheadOptions.push({
10147 type: 'resource',
10333 type: 'resource',
10148 text: 'resource:' + item.resource_id + ':' + item.resource_name,
10334 text: 'resource:' + item.resource_id + ':' + item.resource_name,
10149 example: 'resource:' + item.resource_id,
10335 example: 'resource:' + item.resource_id,
10150 'tag': item.resource_name,
10336 'tag': item.resource_name,
10151 'description': 'Restrict resultset to this application'
10337 'description': 'Restrict resultset to this application'
10152 });
10338 });
10153 });
10339 });
10154
10340
10155 vm.paginationChange = function(){
10341 vm.paginationChange = function(){
10156 $location.search('page', vm.searchParams.page);
10342 $location.search('page', vm.searchParams.page);
10157 };
10343 };
10158
10344
10159 vm.typeAheadTag = function (event) {
10345 vm.typeAheadTag = function (event) {
10160 var text = vm.filterTypeAhead;
10346 var text = vm.filterTypeAhead;
10161 if (_.isObject(vm.filterTypeAhead)) {
10347 if (_.isObject(vm.filterTypeAhead)) {
10162 text = vm.filterTypeAhead.text;
10348 text = vm.filterTypeAhead.text;
10163 }
10349 }
10164 if (!vm.filterTypeAhead) {
10350 if (!vm.filterTypeAhead) {
10165 return
10351 return
10166 }
10352 }
10167
10353
10168 var parsed = text.split(':');
10354 var parsed = text.split(':');
10169 var tag = {'type': null, 'value': null};
10355 var tag = {'type': null, 'value': null};
10170 // app tags have : twice
10356 // app tags have : twice
10171 if (parsed.length > 2 && parsed[0] == 'resource') {
10357 if (parsed.length > 2 && parsed[0] == 'resource') {
10172 tag.type = 'resource';
10358 tag.type = 'resource';
10173 tag.value = parsed[1];
10359 tag.value = parsed[1];
10174 }
10360 }
10175 // normal tag:value
10361 // normal tag:value
10176 else if (parsed.length > 1) {
10362 else if (parsed.length > 1) {
10177 tag.type = parsed[0];
10363 tag.type = parsed[0];
10178 var tagValue = parsed.slice(1);
10364 var tagValue = parsed.slice(1);
10179 if (tagValue) {
10365 if (tagValue) {
10180 tag.value = tagValue.join(':');
10366 tag.value = tagValue.join(':');
10181 }
10367 }
10182 }
10368 }
10183 else {
10369 else {
10184 tag.type = 'error';
10370 tag.type = 'error';
10185 tag.value = parsed.join(':');
10371 tag.value = parsed.join(':');
10186 }
10372 }
10187
10373
10188 // set datepicker hour based on type of field
10374 // set datepicker hour based on type of field
10189 if ('start_date:' == text) {
10375 if ('start_date:' == text) {
10190 vm.showDatePicker = true;
10376 vm.showDatePicker = true;
10191 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10377 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10192 }
10378 }
10193 else if ('end_date:' == text) {
10379 else if ('end_date:' == text) {
10194 vm.showDatePicker = true;
10380 vm.showDatePicker = true;
10195 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10381 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10196 }
10382 }
10197
10383
10198 if (event.keyCode != 13 || !tag.type || !tag.value) {
10384 if (event.keyCode != 13 || !tag.type || !tag.value) {
10199 return
10385 return
10200 }
10386 }
10201 vm.showDatePicker = false;
10387 vm.showDatePicker = false;
10202 // aka we selected one of main options
10388 // aka we selected one of main options
10203 $location.search(tag.type, tag.value);
10389 $location.search(tag.type, tag.value);
10204 // clear typeahead
10390 // clear typeahead
10205 vm.filterTypeAhead = undefined;
10391 vm.filterTypeAhead = undefined;
10206 }
10392 }
10207
10393
10208 vm.pickerDateChanged = function(){
10394 vm.pickerDateChanged = function(){
10209 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
10395 if (vm.filterTypeAhead.indexOf('start_date:') == '0') {
10210 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10396 vm.filterTypeAhead = 'start_date:' + moment(vm.pickerDate).utc().format();
10211 }
10397 }
10212 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
10398 else if (vm.filterTypeAhead.indexOf('end_date:') == '0') {
10213 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10399 vm.filterTypeAhead = 'end_date:' + moment(vm.pickerDate).utc().hour(23).minute(59).format();
10214 }
10400 }
10215 vm.showDatePicker = false;
10401 vm.showDatePicker = false;
10216 };
10402 };
10217
10403
10218 var reportPresentation = function (report) {
10404 var reportPresentation = function (report) {
10219 report.presentation = {};
10405 report.presentation = {};
10220 if (report.group.public) {
10406 if (report.group.public) {
10221 report.presentation.className = 'public';
10407 report.presentation.className = 'public';
10222 report.presentation.tooltip = 'Public';
10408 report.presentation.tooltip = 'Public';
10223 }
10409 }
10224 else if (report.group.fixed) {
10410 else if (report.group.fixed) {
10225 report.presentation.className = 'fixed';
10411 report.presentation.className = 'fixed';
10226 report.presentation.tooltip = 'Fixed';
10412 report.presentation.tooltip = 'Fixed';
10227 }
10413 }
10228 else if (report.group.read) {
10414 else if (report.group.read) {
10229 report.presentation.className = 'reviewed';
10415 report.presentation.className = 'reviewed';
10230 report.presentation.tooltip = 'Reviewed';
10416 report.presentation.tooltip = 'Reviewed';
10231 }
10417 }
10232 else {
10418 else {
10233 report.presentation.className = 'new';
10419 report.presentation.className = 'new';
10234 report.presentation.tooltip = 'New';
10420 report.presentation.tooltip = 'New';
10235 }
10421 }
10236 return report;
10422 return report;
10237 };
10423 };
10238
10424
10239 vm.fetchReports = function (searchParams) {
10425 vm.fetchReports = function (searchParams) {
10240 vm.is_loading = true;
10426 vm.is_loading = true;
10241 reportsResource.query(searchParams, function (data, getResponseHeaders) {
10427 reportsResource.query(searchParams, function (data, getResponseHeaders) {
10242 var headers = getResponseHeaders();
10428 var headers = getResponseHeaders();
10243
10429
10244 vm.is_loading = false;
10430 vm.is_loading = false;
10245 vm.reportsPage = _.map(data, function (item) {
10431 vm.reportsPage = _.map(data, function (item) {
10246 return reportPresentation(item);
10432 return reportPresentation(item);
10247 });
10433 });
10248 vm.itemCount = headers['x-total-count'];
10434 vm.itemCount = headers['x-total-count'];
10249 vm.itemsPerPage = headers['x-items-per-page'];
10435 vm.itemsPerPage = headers['x-items-per-page'];
10250 }, function () {
10436 }, function () {
10251 vm.is_loading = false;
10437 vm.is_loading = false;
10252 });
10438 });
10253 };
10439 };
10254
10440
10255 vm.filterId = function (log) {
10441 vm.filterId = function (log) {
10256 vm.searchParams.tags.push({
10442 vm.searchParams.tags.push({
10257 type: "request_id",
10443 type: "request_id",
10258 value: log.request_id
10444 value: log.request_id
10259 });
10445 });
10260 };
10446 };
10261 // initial load
10447 // initial load
10262 var params = parseTagsToSearch(vm.searchParams);
10448 var params = parseTagsToSearch(vm.searchParams);
10263 vm.fetchReports(params);
10449 vm.fetchReports(params);
10264
10450
10265 $scope.$on('$locationChangeSuccess', function () {
10451 $scope.$on('$locationChangeSuccess', function () {
10266
10452
10267 vm.searchParams = parseSearchToTags($location.search());
10453 vm.searchParams = parseSearchToTags($location.search());
10268 var params = parseTagsToSearch(vm.searchParams);
10454 var params = parseTagsToSearch(vm.searchParams);
10269
10455
10270 if (vm.is_loading === false) {
10456 if (vm.is_loading === false) {
10271
10457
10272 vm.fetchReports(params);
10458 vm.fetchReports(params);
10273 }
10459 }
10274
10460
10275 });
10461 });
10276
10462
10277
10463
10278 }
10464 }
10279
10465
10280 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10466 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10281 // #
10467 // #
10282 // # This program is free software: you can redistribute it and/or modify
10468 // # This program is free software: you can redistribute it and/or modify
10283 // # it under the terms of the GNU Affero General Public License, version 3
10469 // # it under the terms of the GNU Affero General Public License, version 3
10284 // # (only), as published by the Free Software Foundation.
10470 // # (only), as published by the Free Software Foundation.
10285 // #
10471 // #
10286 // # This program is distributed in the hope that it will be useful,
10472 // # This program is distributed in the hope that it will be useful,
10287 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10473 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10288 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10474 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10289 // # GNU General Public License for more details.
10475 // # GNU General Public License for more details.
10290 // #
10476 // #
10291 // # You should have received a copy of the GNU Affero General Public License
10477 // # You should have received a copy of the GNU Affero General Public License
10292 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10478 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10293 // #
10479 // #
10294 // # This program is dual-licensed. If you wish to learn more about the
10480 // # This program is dual-licensed. If you wish to learn more about the
10295 // # AppEnlight Enterprise Edition, including its added features, Support
10481 // # AppEnlight Enterprise Edition, including its added features, Support
10296 // # services, and proprietary license terms, please see
10482 // # services, and proprietary license terms, please see
10297 // # https://rhodecode.com/licenses/
10483 // # https://rhodecode.com/licenses/
10298
10484
10299 angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController);
10485 angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController);
10300 ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal',
10486 ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal',
10301 '$cookies', 'reportGroupPropertyResource', 'reportGroupResource',
10487 '$cookies', 'reportGroupPropertyResource', 'reportGroupResource',
10302 'logsNoIdResource', 'stateHolder'];
10488 'logsNoIdResource', 'stateHolder'];
10303
10489
10304 function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) {
10490 function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) {
10305 var vm = this;
10491 var vm = this;
10306 vm.window = $window;
10492 vm.window = $window;
10493 vm.stateHolder = stateHolder;
10494 vm.$state = $state;
10307 vm.reportHistoryConfig = {
10495 vm.reportHistoryConfig = {
10308 data: {
10496 data: {
10309 json: [],
10497 json: [],
10310 xFormat: '%Y-%m-%dT%H:%M:%S'
10498 xFormat: '%Y-%m-%dT%H:%M:%S'
10311 },
10499 },
10312 color: {
10500 color: {
10313 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
10501 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
10314 },
10502 },
10315 axis: {
10503 axis: {
10316 x: {
10504 x: {
10317 type: 'timeseries',
10505 type: 'timeseries',
10318 tick: {
10506 tick: {
10319 format: '%Y-%m-%d'
10507 format: '%Y-%m-%d'
10320 }
10508 }
10321 },
10509 },
10322 y: {
10510 y: {
10323 tick: {
10511 tick: {
10324 count: 5,
10512 count: 5,
10325 format: d3.format('.2s')
10513 format: d3.format('.2s')
10326 }
10514 }
10327 }
10515 }
10328 },
10516 },
10329 subchart: {
10517 subchart: {
10330 show: true,
10518 show: true,
10331 size: {
10519 size: {
10332 height: 20
10520 height: 20
10333 }
10521 }
10334 },
10522 },
10335 size: {
10523 size: {
10336 height: 250
10524 height: 250
10337 },
10525 },
10338 zoom: {
10526 zoom: {
10339 rescale: true
10527 rescale: true
10340 },
10528 },
10341 grid: {
10529 grid: {
10342 x: {
10530 x: {
10343 show: true
10531 show: true
10344 },
10532 },
10345 y: {
10533 y: {
10346 show: true
10534 show: true
10347 }
10535 }
10348 },
10536 },
10349 tooltip: {
10537 tooltip: {
10350 format: {
10538 format: {
10351 title: function (d) {
10539 title: function (d) {
10352 return '' + d;
10540 return '' + d;
10353 },
10541 },
10354 value: function (v) {
10542 value: function (v) {
10355 return v
10543 return v
10356 }
10544 }
10357 }
10545 }
10358 }
10546 }
10359 };
10547 };
10360 vm.mentionedPeople = [];
10548 vm.mentionedPeople = [];
10361 vm.reportHistoryData = {};
10549 vm.reportHistoryData = {};
10362 vm.textTraceback = true;
10550 vm.textTraceback = true;
10363 vm.rawTraceback = '';
10551 vm.rawTraceback = '';
10364 vm.traceback = '';
10552 vm.traceback = '';
10365 vm.reportType = 'report';
10553 vm.reportType = 'report';
10366 vm.report = null;
10554 vm.report = null;
10367 vm.showLong = false;
10555 vm.showLong = false;
10368 vm.reportLogs = null;
10556 vm.reportLogs = null;
10369 vm.requestStats = null;
10557 vm.requestStats = null;
10370 vm.comment = null;
10558 vm.comment = null;
10371 vm.is_loading = {
10559 vm.is_loading = {
10372 report: true,
10560 report: true,
10373 logs: true,
10561 logs: true,
10374 history: true
10562 history: true
10375 };
10563 };
10376
10564
10377 vm.searchMentionedPeople = function(term){
10565 vm.searchMentionedPeople = function(term){
10378 //vm.mentionedPeople = [];
10566 //vm.mentionedPeople = [];
10379 var term = term.toLowerCase();
10567 var term = term.toLowerCase();
10380 reportGroupPropertyResource.get({
10568 reportGroupPropertyResource.get({
10381 groupId: vm.report.group_id,
10569 groupId: vm.report.group_id,
10382 key: 'assigned_users'
10570 key: 'assigned_users'
10383 }, null,
10571 }, null,
10384 function (data) {
10572 function (data) {
10385 var users = [];
10573 var users = [];
10386 _.each(data.assigned, function(u){
10574 _.each(data.assigned, function(u){
10387 users.push({label: u.user_name});
10575 users.push({label: u.user_name});
10388 });
10576 });
10389 _.each(data.unassigned, function(u){
10577 _.each(data.unassigned, function(u){
10390 users.push({label: u.user_name});
10578 users.push({label: u.user_name});
10391 });
10579 });
10392
10580
10393 var result = _.filter(users, function(u){
10581 var result = _.filter(users, function(u){
10394 return u.label.toLowerCase().indexOf(term) !== -1;
10582 return u.label.toLowerCase().indexOf(term) !== -1;
10395 });
10583 });
10396 vm.mentionedPeople = result;
10584 vm.mentionedPeople = result;
10397 });
10585 });
10398 };
10586 };
10399
10587
10400 vm.searchTag = function (tag, value) {
10588 vm.searchTag = function (tag, value) {
10401
10589
10402 if (vm.report.report_type === 3) {
10590 if (vm.report.report_type === 3) {
10403 $location.url($state.href('report.list_slow'));
10591 $location.url($state.href('report.list_slow'));
10404 }
10592 }
10405 else {
10593 else {
10406 $location.url($state.href('report.list'));
10594 $location.url($state.href('report.list'));
10407 }
10595 }
10408 $location.search(tag, value);
10596 $location.search(tag, value);
10409 };
10597 };
10410
10598
10411 vm.tabs = {
10599 vm.tabs = {
10412 slow_calls:false,
10600 slow_calls:false,
10413 request_details:false,
10601 request_details:false,
10414 logs:false,
10602 logs:false,
10415 comments:false,
10603 comments:false,
10416 affected_users:false
10604 affected_users:false
10417 };
10605 };
10418 if ($cookies.selectedReportTab) {
10606 if ($cookies.selectedReportTab) {
10419 vm.tabs[$cookies.selectedReportTab] = true;
10607 vm.tabs[$cookies.selectedReportTab] = true;
10420 }
10608 }
10421 else{
10609 else{
10422 $cookies.selectedReportTab = 'request_details';
10610 $cookies.selectedReportTab = 'request_details';
10423 vm.tabs.request_details = true;
10611 vm.tabs.request_details = true;
10424 }
10612 }
10425
10613
10426 vm.fetchLogs = function () {
10614 vm.fetchLogs = function () {
10427 if (!vm.report.request_id){
10615 if (!vm.report.request_id){
10428 return
10616 return
10429 }
10617 }
10430 vm.is_loading.logs = true;
10618 vm.is_loading.logs = true;
10431 logsNoIdResource.query({request_id: vm.report.request_id},
10619 logsNoIdResource.query({request_id: vm.report.request_id},
10432 function (data) {
10620 function (data) {
10433 vm.is_loading.logs = false;
10621 vm.is_loading.logs = false;
10434 vm.reportLogs = data;
10622 vm.reportLogs = data;
10435 }, function () {
10623 }, function () {
10436 vm.is_loading.logs = false;
10624 vm.is_loading.logs = false;
10437 });
10625 });
10438 };
10626 };
10439 vm.addComment = function () {
10627 vm.addComment = function () {
10440 reportGroupPropertyResource.save({
10628 reportGroupPropertyResource.save({
10441 groupId: vm.report.group_id,
10629 groupId: vm.report.group_id,
10442 key: 'comments'
10630 key: 'comments'
10443 }, {body: vm.comment},
10631 }, {body: vm.comment},
10444 function (data) {
10632 function (data) {
10445 vm.report.comments.push(data);
10633 vm.report.comments.push(data);
10446 });
10634 });
10447 vm.comment = '';
10635 vm.comment = '';
10448 };
10636 };
10449
10637
10450 vm.fetchReport = function () {
10638 vm.fetchReport = function () {
10451 vm.is_loading.report = true;
10639 vm.is_loading.report = true;
10452 reportGroupResource.get($state.params, function (data) {
10640 reportGroupResource.get($state.params, function (data) {
10453 vm.is_loading.report = false;
10641 vm.is_loading.report = false;
10454 if (data.request) {
10642 if (data.request) {
10455 try {
10643 try {
10456 var to_sort = _.pairs(data.request);
10644 var to_sort = _.pairs(data.request);
10457 data.request = _.object(_.sortBy(to_sort, function (i) {
10645 data.request = _.object(_.sortBy(to_sort, function (i) {
10458 return i[0]
10646 return i[0]
10459 }));
10647 }));
10460 }
10648 }
10461 catch (err) {
10649 catch (err) {
10462 }
10650 }
10463 }
10651 }
10464 vm.report = data;
10652 vm.report = data;
10465 if (vm.report.req_stats) {
10653 if (vm.report.req_stats) {
10466 vm.requestStats = [];
10654 vm.requestStats = [];
10467 _.each(_.pairs(vm.report.req_stats['percentages']), function (p) {
10655 _.each(_.pairs(vm.report.req_stats['percentages']), function (p) {
10468 vm.requestStats.push({
10656 vm.requestStats.push({
10469 name: p[0],
10657 name: p[0],
10470 value: vm.report.req_stats[p[0]].toFixed(3),
10658 value: vm.report.req_stats[p[0]].toFixed(3),
10471 percent: p[1],
10659 percent: p[1],
10472 calls: vm.report.req_stats[p[0] + '_calls']
10660 calls: vm.report.req_stats[p[0] + '_calls']
10473 })
10661 })
10474 });
10662 });
10475 }
10663 }
10476 vm.traceback = data.traceback;
10664 vm.traceback = data.traceback;
10477 _.each(vm.traceback, function (frame) {
10665 _.each(vm.traceback, function (frame) {
10478 if (frame.line) {
10666 if (frame.line) {
10479 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
10667 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
10480 }
10668 }
10481 vm.rawTraceback += ' ' + frame.cline + "\r\n";
10669 vm.rawTraceback += ' ' + frame.cline + "\r\n";
10482 });
10670 });
10483
10671
10484 if (stateHolder.AeUser.id){
10672 if (stateHolder.AeUser.id){
10485 vm.fetchHistory();
10673 vm.fetchHistory();
10486 }
10674 }
10487
10675
10488 vm.selectedTab($cookies.selectedReportTab);
10676 vm.selectedTab($cookies.selectedReportTab);
10489
10677
10490 }, function (response) {
10678 }, function (response) {
10491
10679
10492 if (response.status == 403) {
10680 if (response.status == 403) {
10493 var uid = response.headers('x-appenlight-uid');
10681 var uid = response.headers('x-appenlight-uid');
10494 if (!uid) {
10682 if (!uid) {
10495 window.location = '/register?came_from=' + encodeURIComponent(window.location);
10683 window.location = '/register?came_from=' + encodeURIComponent(window.location);
10496 }
10684 }
10497 }
10685 }
10498 vm.is_loading.report = false;
10686 vm.is_loading.report = false;
10499 });
10687 });
10500 };
10688 };
10501
10689
10502 vm.selectedTab = function(tab_name){
10690 vm.selectedTab = function(tab_name){
10503 $cookies.selectedReportTab = tab_name;
10691 $cookies.selectedReportTab = tab_name;
10504 if (tab_name == 'logs' && vm.reportLogs === null) {
10692 if (tab_name == 'logs' && vm.reportLogs === null) {
10505 vm.fetchLogs();
10693 vm.fetchLogs();
10506 }
10694 }
10507 };
10695 };
10508
10696
10509 vm.markFixed = function () {
10697 vm.markFixed = function () {
10510 reportGroupResource.update({
10698 reportGroupResource.update({
10511 groupId: vm.report.group_id
10699 groupId: vm.report.group_id
10512 }, {fixed: !vm.report.group.fixed},
10700 }, {fixed: !vm.report.group.fixed},
10513 function (data) {
10701 function (data) {
10514 vm.report.group.fixed = data.fixed;
10702 vm.report.group.fixed = data.fixed;
10515 });
10703 });
10516 };
10704 };
10517
10705
10518 vm.markPublic = function () {
10706 vm.markPublic = function () {
10519 reportGroupResource.update({
10707 reportGroupResource.update({
10520 groupId: vm.report.group_id
10708 groupId: vm.report.group_id
10521 }, {public: !vm.report.group.public},
10709 }, {public: !vm.report.group.public},
10522 function (data) {
10710 function (data) {
10523 vm.report.group.public = data.public;
10711 vm.report.group.public = data.public;
10524 });
10712 });
10525 };
10713 };
10526
10714
10527 vm.delete = function () {
10715 vm.delete = function () {
10528 reportGroupResource.delete({'groupId': vm.report.group_id},
10716 reportGroupResource.delete({'groupId': vm.report.group_id},
10529 function (data) {
10717 function (data) {
10530 $state.go('report.list');
10718 $state.go('report.list');
10531 })
10719 })
10532 };
10720 };
10533
10721
10534 vm.assignUsersModal = function (index) {
10722 vm.assignUsersModal = function (index) {
10535 vm.opts = {
10723 vm.opts = {
10536 backdrop: 'static',
10724 backdrop: 'static',
10537 templateUrl: 'AssignReportCtrl.html',
10725 templateUrl: 'AssignReportCtrl.html',
10538 controller: 'AssignReportCtrl as ctrl',
10726 controller: 'AssignReportCtrl as ctrl',
10539 resolve: {
10727 resolve: {
10540 report: function () {
10728 report: function () {
10541 return vm.report;
10729 return vm.report;
10542 }
10730 }
10543 }
10731 }
10544 };
10732 };
10545 var modalInstance = $uibModal.open(vm.opts);
10733 var modalInstance = $uibModal.open(vm.opts);
10546 modalInstance.result.then(function (report) {
10734 modalInstance.result.then(function (report) {
10547
10735
10548 }, function () {
10736 }, function () {
10549 console.info('Modal dismissed at: ' + new Date());
10737 console.info('Modal dismissed at: ' + new Date());
10550 });
10738 });
10551
10739
10552 };
10740 };
10553
10741
10554 vm.fetchHistory = function () {
10742 vm.fetchHistory = function () {
10555 reportGroupPropertyResource.query({
10743 reportGroupPropertyResource.query({
10556 groupId: vm.report.group_id,
10744 groupId: vm.report.group_id,
10557 key: 'history'
10745 key: 'history'
10558 }, function (data) {
10746 }, function (data) {
10559 vm.reportHistoryData = {
10747 vm.reportHistoryData = {
10560 json: data,
10748 json: data,
10561 keys: {
10749 keys: {
10562 x: 'x',
10750 x: 'x',
10563 value: ["reports"]
10751 value: ["reports"]
10564 },
10752 },
10565 names: {
10753 names: {
10566 reports: 'Reports history'
10754 reports: 'Reports history'
10567 },
10755 },
10568 type: 'bar'
10756 type: 'bar'
10569 };
10757 };
10570 vm.is_loading.history = false;
10758 vm.is_loading.history = false;
10571 });
10759 });
10572 };
10760 };
10573
10761
10574 vm.nextDetail = function () {
10762 vm.nextDetail = function () {
10575 $state.go('report.view_detail', {
10763 $state.go('report.view_detail', {
10576 groupId: vm.report.group_id,
10764 groupId: vm.report.group_id,
10577 reportId: vm.report.group.next_report
10765 reportId: vm.report.group.next_report
10578 });
10766 });
10579 };
10767 };
10580 vm.previousDetail = function () {
10768 vm.previousDetail = function () {
10581 $state.go('report.view_detail', {
10769 $state.go('report.view_detail', {
10582 groupId: vm.report.group_id,
10770 groupId: vm.report.group_id,
10583 reportId: vm.report.group.previous_report
10771 reportId: vm.report.group.previous_report
10584 });
10772 });
10585 };
10773 };
10586
10774
10587 vm.runIntegration = function (integration_name) {
10775 vm.runIntegration = function (integration_name) {
10588
10776
10589 if (integration_name == 'bitbucket') {
10777 if (integration_name == 'bitbucket') {
10590 var controller = 'BitbucketIntegrationCtrl as ctrl';
10778 var controller = 'BitbucketIntegrationCtrl as ctrl';
10591 var template_url = 'templates/integrations/bitbucket.html';
10779 var template_url = 'templates/integrations/bitbucket.html';
10592 }
10780 }
10593 else if (integration_name == 'github') {
10781 else if (integration_name == 'github') {
10594 var controller = 'GithubIntegrationCtrl as ctrl';
10782 var controller = 'GithubIntegrationCtrl as ctrl';
10595 var template_url = 'templates/integrations/github.html';
10783 var template_url = 'templates/integrations/github.html';
10596 }
10784 }
10597 else if (integration_name == 'jira') {
10785 else if (integration_name == 'jira') {
10598 var controller = 'JiraIntegrationCtrl as ctrl';
10786 var controller = 'JiraIntegrationCtrl as ctrl';
10599 var template_url = 'templates/integrations/jira.html';
10787 var template_url = 'templates/integrations/jira.html';
10600 }
10788 }
10601 else {
10789 else {
10602 return false;
10790 return false;
10603 }
10791 }
10604
10792
10605 vm.opts = {
10793 vm.opts = {
10606 backdrop: 'static',
10794 backdrop: 'static',
10607 templateUrl: template_url,
10795 templateUrl: template_url,
10608 controller: controller,
10796 controller: controller,
10609 resolve: {
10797 resolve: {
10610 integrationName: function () {
10798 integrationName: function () {
10611 return integration_name
10799 return integration_name
10612 },
10800 },
10613 report: function () {
10801 report: function () {
10614 return vm.report;
10802 return vm.report;
10615 }
10803 }
10616 }
10804 }
10617 };
10805 };
10618 var modalInstance = $uibModal.open(vm.opts);
10806 var modalInstance = $uibModal.open(vm.opts);
10619 modalInstance.result.then(function (report) {
10807 modalInstance.result.then(function (report) {
10620
10808
10621 }, function () {
10809 }, function () {
10622 console.info('Modal dismissed at: ' + new Date());
10810 console.info('Modal dismissed at: ' + new Date());
10623 });
10811 });
10624
10812
10625 };
10813 };
10626
10814
10627 // load report
10815 // load report
10628 vm.fetchReport();
10816 vm.fetchReport();
10629
10817
10630
10818
10631 }
10819 }
10632
10820
10633 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10821 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10634 // #
10822 // #
10635 // # This program is free software: you can redistribute it and/or modify
10823 // # This program is free software: you can redistribute it and/or modify
10636 // # it under the terms of the GNU Affero General Public License, version 3
10824 // # it under the terms of the GNU Affero General Public License, version 3
10637 // # (only), as published by the Free Software Foundation.
10825 // # (only), as published by the Free Software Foundation.
10638 // #
10826 // #
10639 // # This program is distributed in the hope that it will be useful,
10827 // # This program is distributed in the hope that it will be useful,
10640 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10828 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10641 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10829 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10642 // # GNU General Public License for more details.
10830 // # GNU General Public License for more details.
10643 // #
10831 // #
10644 // # You should have received a copy of the GNU Affero General Public License
10832 // # You should have received a copy of the GNU Affero General Public License
10645 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10833 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10646 // #
10834 // #
10647 // # This program is dual-licensed. If you wish to learn more about the
10835 // # This program is dual-licensed. If you wish to learn more about the
10648 // # AppEnlight Enterprise Edition, including its added features, Support
10836 // # AppEnlight Enterprise Edition, including its added features, Support
10649 // # services, and proprietary license terms, please see
10837 // # services, and proprietary license terms, please see
10650 // # https://rhodecode.com/licenses/
10838 // # https://rhodecode.com/licenses/
10651
10839
10652 angular.module('appenlight.controllers')
10840 angular.module('appenlight.controllers')
10653 .controller('AlertChannelsEmailController', AlertChannelsEmailController)
10841 .controller('AlertChannelsEmailController', AlertChannelsEmailController)
10654
10842
10655 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
10843 AlertChannelsEmailController.$inject = ['$state','userSelfPropertyResource'];
10656
10844
10657 function AlertChannelsEmailController($state, userSelfPropertyResource) {
10845 function AlertChannelsEmailController($state, userSelfPropertyResource) {
10658
10846
10659 var vm = this;
10847 var vm = this;
10660 vm.loading = {email: false};
10848 vm.loading = {email: false};
10661 vm.form = {};
10849 vm.form = {};
10662
10850
10663 vm.createChannel = function () {
10851 vm.createChannel = function () {
10664 vm.loading.email = true;
10852 vm.loading.email = true;
10665
10853
10666 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
10854 userSelfPropertyResource.save({key: 'alert_channels'}, vm.form, function () {
10667 //vm.loading.email = false;
10855 //vm.loading.email = false;
10668 //setServerValidation(vm.channelForm);
10856 //setServerValidation(vm.channelForm);
10669 //vm.form = {};
10857 //vm.form = {};
10670 $state.go('user.alert_channels.list');
10858 $state.go('user.alert_channels.list');
10671 }, function (response) {
10859 }, function (response) {
10672 if (response.status == 422) {
10860 if (response.status == 422) {
10673 setServerValidation(vm.channelForm, response.data);
10861 setServerValidation(vm.channelForm, response.data);
10674 }
10862 }
10675 vm.loading.email = false;
10863 vm.loading.email = false;
10676 });
10864 });
10677 }
10865 }
10678 }
10866 }
10679
10867
10680 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10868 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10681 // #
10869 // #
10682 // # This program is free software: you can redistribute it and/or modify
10870 // # This program is free software: you can redistribute it and/or modify
10683 // # it under the terms of the GNU Affero General Public License, version 3
10871 // # it under the terms of the GNU Affero General Public License, version 3
10684 // # (only), as published by the Free Software Foundation.
10872 // # (only), as published by the Free Software Foundation.
10685 // #
10873 // #
10686 // # This program is distributed in the hope that it will be useful,
10874 // # This program is distributed in the hope that it will be useful,
10687 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10875 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10688 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10876 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10689 // # GNU General Public License for more details.
10877 // # GNU General Public License for more details.
10690 // #
10878 // #
10691 // # You should have received a copy of the GNU Affero General Public License
10879 // # You should have received a copy of the GNU Affero General Public License
10692 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10880 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10693 // #
10881 // #
10694 // # This program is dual-licensed. If you wish to learn more about the
10882 // # This program is dual-licensed. If you wish to learn more about the
10695 // # AppEnlight Enterprise Edition, including its added features, Support
10883 // # AppEnlight Enterprise Edition, including its added features, Support
10696 // # services, and proprietary license terms, please see
10884 // # services, and proprietary license terms, please see
10697 // # https://rhodecode.com/licenses/
10885 // # https://rhodecode.com/licenses/
10698
10886
10699 angular.module('appenlight.controllers').controller('AlertChannelsController', AlertChannelsController);
10887 angular.module('appenlight.controllers').controller('AlertChannelsController', AlertChannelsController);
10700
10888
10701 AlertChannelsController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
10889 AlertChannelsController.$inject = ['userSelfPropertyResource', 'applicationsNoIdResource'];
10702
10890
10703 function AlertChannelsController(userSelfPropertyResource, applicationsNoIdResource) {
10891 function AlertChannelsController(userSelfPropertyResource, applicationsNoIdResource) {
10704
10892
10705 var vm = this;
10893 var vm = this;
10706 vm.loading = {channels: true, applications: true, actions:true};
10894 vm.loading = {channels: true, applications: true, actions:true};
10707
10895
10708 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
10896 vm.alertChannels = userSelfPropertyResource.query({key: 'alert_channels'},
10709 function (data) {
10897 function (data) {
10710 vm.loading.channels = false;
10898 vm.loading.channels = false;
10711 });
10899 });
10712
10900
10713 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
10901 vm.alertActions = userSelfPropertyResource.query({key: 'alert_actions'},
10714 function (data) {
10902 function (data) {
10715 vm.loading.actions = false;
10903 vm.loading.actions = false;
10716 });
10904 });
10717
10905
10718 vm.applications = applicationsNoIdResource.query({permission: 'view'},
10906 vm.applications = applicationsNoIdResource.query({permission: 'view'},
10719 function (data) {
10907 function (data) {
10720 vm.loading.applications = false;
10908 vm.loading.applications = false;
10721 });
10909 });
10722
10910
10723 var allOps = {
10911 var allOps = {
10724 'eq': 'Equal',
10912 'eq': 'Equal',
10725 'ne': 'Not equal',
10913 'ne': 'Not equal',
10726 'ge': 'Greater or equal',
10914 'ge': 'Greater or equal',
10727 'gt': 'Greater than',
10915 'gt': 'Greater than',
10728 'le': 'Lesser or equal',
10916 'le': 'Lesser or equal',
10729 'lt': 'Lesser than',
10917 'lt': 'Lesser than',
10730 'startswith': 'Starts with',
10918 'startswith': 'Starts with',
10731 'endswith': 'Ends with',
10919 'endswith': 'Ends with',
10732 'contains': 'Contains'
10920 'contains': 'Contains'
10733 };
10921 };
10734
10922
10735 var fieldOps = {};
10923 var fieldOps = {};
10736 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
10924 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
10737 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
10925 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
10738 fieldOps['duration'] = ['ge', 'le'];
10926 fieldOps['duration'] = ['ge', 'le'];
10739 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
10927 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
10740 'contains'];
10928 'contains'];
10741 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
10929 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
10742 'contains'];
10930 'contains'];
10743 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
10931 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
10744 'contains'];
10932 'contains'];
10745 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
10933 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
10746 'contains'];
10934 'contains'];
10747 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
10935 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
10748
10936
10749 var possibleFields = {
10937 var possibleFields = {
10750 '__AND__': 'All met (composite rule)',
10938 '__AND__': 'All met (composite rule)',
10751 '__OR__': 'One met (composite rule)',
10939 '__OR__': 'One met (composite rule)',
10752 '__NOT__': 'Not met (composite rule)',
10940 '__NOT__': 'Not met (composite rule)',
10753 'http_status': 'HTTP Status',
10941 'http_status': 'HTTP Status',
10754 'duration': 'Request duration',
10942 'duration': 'Request duration',
10755 'group:priority': 'Group -> Priority',
10943 'group:priority': 'Group -> Priority',
10756 'url_domain': 'Domain',
10944 'url_domain': 'Domain',
10757 'url_path': 'URL Path',
10945 'url_path': 'URL Path',
10758 'error': 'Error',
10946 'error': 'Error',
10759 'tags:server_name': 'Tag -> Server name',
10947 'tags:server_name': 'Tag -> Server name',
10760 'group:occurences': 'Group -> Occurences'
10948 'group:occurences': 'Group -> Occurences'
10761 };
10949 };
10762
10950
10763 vm.ruleDefinitions = {
10951 vm.ruleDefinitions = {
10764 fieldOps: fieldOps,
10952 fieldOps: fieldOps,
10765 allOps: allOps,
10953 allOps: allOps,
10766 possibleFields: possibleFields
10954 possibleFields: possibleFields
10767 };
10955 };
10768
10956
10769 vm.addAction = function (channel) {
10957 vm.addAction = function (channel) {
10770
10958
10771 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
10959 userSelfPropertyResource.save({key: 'alert_channels_rules'}, {}, function (data) {
10772 vm.alertActions.push(data);
10960 vm.alertActions.push(data);
10773 }, function (response) {
10961 }, function (response) {
10774 if (response.status == 422) {
10962 if (response.status == 422) {
10775
10963
10776 }
10964 }
10777 });
10965 });
10778 };
10966 };
10779
10967
10780 vm.updateChannel = function (channel, subKey) {
10968 vm.updateChannel = function (channel, subKey) {
10781 var params = {
10969 var params = {
10782 key: 'alert_channels',
10970 key: 'alert_channels',
10783 channel_name: channel['channel_name'],
10971 channel_name: channel['channel_name'],
10784 channel_value: channel['channel_value']
10972 channel_value: channel['channel_value']
10785 };
10973 };
10786 var toUpdate = {};
10974 var toUpdate = {};
10787 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
10975 if (['daily_digest', 'send_alerts'].indexOf(subKey) !== -1) {
10788 toUpdate[subKey] = !channel[subKey];
10976 toUpdate[subKey] = !channel[subKey];
10789 }
10977 }
10790 userSelfPropertyResource.update(params, toUpdate, function (data) {
10978 userSelfPropertyResource.update(params, toUpdate, function (data) {
10791 _.extend(channel, data);
10979 _.extend(channel, data);
10792 });
10980 });
10793 };
10981 };
10794
10982
10795 vm.removeChannel = function (channel) {
10983 vm.removeChannel = function (channel) {
10796
10984
10797 userSelfPropertyResource.delete({
10985 userSelfPropertyResource.delete({
10798 key: 'alert_channels',
10986 key: 'alert_channels',
10799 channel_name: channel.channel_name,
10987 channel_name: channel.channel_name,
10800 channel_value: channel.channel_value
10988 channel_value: channel.channel_value
10801 }, function () {
10989 }, function () {
10802 vm.alertChannels = _.filter(vm.alertChannels, function(item){
10990 vm.alertChannels = _.filter(vm.alertChannels, function(item){
10803 return item != channel;
10991 return item != channel;
10804 });
10992 });
10805 });
10993 });
10806
10994
10807 }
10995 }
10808
10996
10809 }
10997 }
10810
10998
10811 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10999 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10812 // #
11000 // #
10813 // # This program is free software: you can redistribute it and/or modify
11001 // # This program is free software: you can redistribute it and/or modify
10814 // # it under the terms of the GNU Affero General Public License, version 3
11002 // # it under the terms of the GNU Affero General Public License, version 3
10815 // # (only), as published by the Free Software Foundation.
11003 // # (only), as published by the Free Software Foundation.
10816 // #
11004 // #
10817 // # This program is distributed in the hope that it will be useful,
11005 // # This program is distributed in the hope that it will be useful,
10818 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11006 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10819 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11007 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10820 // # GNU General Public License for more details.
11008 // # GNU General Public License for more details.
10821 // #
11009 // #
10822 // # You should have received a copy of the GNU Affero General Public License
11010 // # You should have received a copy of the GNU Affero General Public License
10823 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11011 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10824 // #
11012 // #
10825 // # This program is dual-licensed. If you wish to learn more about the
11013 // # This program is dual-licensed. If you wish to learn more about the
10826 // # AppEnlight Enterprise Edition, including its added features, Support
11014 // # AppEnlight Enterprise Edition, including its added features, Support
10827 // # services, and proprietary license terms, please see
11015 // # services, and proprietary license terms, please see
10828 // # https://rhodecode.com/licenses/
11016 // # https://rhodecode.com/licenses/
10829
11017
10830 angular.module('appenlight.controllers').controller('UserAuthTokensController', UserAuthTokensController);
11018 angular.module('appenlight.controllers').controller('UserAuthTokensController', UserAuthTokensController);
10831
11019
10832 UserAuthTokensController.$inject = ['$filter', 'userSelfPropertyResource', 'AeConfig'];
11020 UserAuthTokensController.$inject = ['$filter', 'userSelfPropertyResource', 'AeConfig'];
10833
11021
10834 function UserAuthTokensController($filter, userSelfPropertyResource, AeConfig) {
11022 function UserAuthTokensController($filter, userSelfPropertyResource, AeConfig) {
10835
11023
10836 var vm = this;
11024 var vm = this;
10837 vm.loading = {tokens: true};
11025 vm.loading = {tokens: true};
10838
11026
10839 vm.expireOptions = AeConfig.timeOptions;
11027 vm.expireOptions = AeConfig.timeOptions;
10840
11028
10841 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
11029 vm.tokens = userSelfPropertyResource.query({key: 'auth_tokens'},
10842 function (data) {
11030 function (data) {
10843 vm.loading.tokens = false;
11031 vm.loading.tokens = false;
10844 });
11032 });
10845
11033
10846 vm.addToken = function () {
11034 vm.addToken = function () {
10847 vm.loading.tokens = true;
11035 vm.loading.tokens = true;
10848 userSelfPropertyResource.save({key: 'auth_tokens'},
11036 userSelfPropertyResource.save({key: 'auth_tokens'},
10849 vm.form,
11037 vm.form,
10850 function (data) {
11038 function (data) {
10851 vm.loading.tokens = false;
11039 vm.loading.tokens = false;
10852 setServerValidation(vm.TokenForm);
11040 setServerValidation(vm.TokenForm);
10853 vm.form = {};
11041 vm.form = {};
10854 vm.tokens.push(data);
11042 vm.tokens.push(data);
10855 }, function (response) {
11043 }, function (response) {
10856 vm.loading.tokens = false;
11044 vm.loading.tokens = false;
10857 if (response.status == 422) {
11045 if (response.status == 422) {
10858 setServerValidation(vm.TokenForm, response.data);
11046 setServerValidation(vm.TokenForm, response.data);
10859 }
11047 }
10860 })
11048 })
10861 }
11049 }
10862
11050
10863 vm.removeToken = function (token) {
11051 vm.removeToken = function (token) {
10864 userSelfPropertyResource.delete({key: 'auth_tokens',
11052 userSelfPropertyResource.delete({key: 'auth_tokens',
10865 token:token.token},
11053 token:token.token},
10866 function () {
11054 function () {
10867 var index = vm.tokens.indexOf(token);
11055 var index = vm.tokens.indexOf(token);
10868 if (index !== -1) {
11056 if (index !== -1) {
10869 vm.tokens.splice(index, 1);
11057 vm.tokens.splice(index, 1);
10870 }
11058 }
10871 })
11059 })
10872 }
11060 }
10873 }
11061 }
10874
11062
10875 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11063 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10876 // #
11064 // #
10877 // # This program is free software: you can redistribute it and/or modify
11065 // # This program is free software: you can redistribute it and/or modify
10878 // # it under the terms of the GNU Affero General Public License, version 3
11066 // # it under the terms of the GNU Affero General Public License, version 3
10879 // # (only), as published by the Free Software Foundation.
11067 // # (only), as published by the Free Software Foundation.
10880 // #
11068 // #
10881 // # This program is distributed in the hope that it will be useful,
11069 // # This program is distributed in the hope that it will be useful,
10882 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11070 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10883 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11071 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10884 // # GNU General Public License for more details.
11072 // # GNU General Public License for more details.
10885 // #
11073 // #
10886 // # You should have received a copy of the GNU Affero General Public License
11074 // # You should have received a copy of the GNU Affero General Public License
10887 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11075 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10888 // #
11076 // #
10889 // # This program is dual-licensed. If you wish to learn more about the
11077 // # This program is dual-licensed. If you wish to learn more about the
10890 // # AppEnlight Enterprise Edition, including its added features, Support
11078 // # AppEnlight Enterprise Edition, including its added features, Support
10891 // # services, and proprietary license terms, please see
11079 // # services, and proprietary license terms, please see
10892 // # https://rhodecode.com/licenses/
11080 // # https://rhodecode.com/licenses/
10893
11081
10894 angular.module('appenlight.controllers')
11082 angular.module('appenlight.controllers')
10895 .controller('UserIdentitiesController', UserIdentitiesController)
11083 .controller('UserIdentitiesController', UserIdentitiesController)
10896
11084
10897 UserIdentitiesController.$inject = ['userSelfPropertyResource'];
11085 UserIdentitiesController.$inject = ['userSelfPropertyResource'];
10898
11086
10899 function UserIdentitiesController(userSelfPropertyResource) {
11087 function UserIdentitiesController(userSelfPropertyResource) {
10900
11088
10901 var vm = this;
11089 var vm = this;
10902 vm.loading = {identities: true};
11090 vm.loading = {identities: true};
10903
11091
10904 vm.identities = userSelfPropertyResource.query(
11092 vm.identities = userSelfPropertyResource.query(
10905 {key: 'external_identities'},
11093 {key: 'external_identities'},
10906 function (data) {
11094 function (data) {
10907 vm.loading.identities = false;
11095 vm.loading.identities = false;
10908
11096
10909 });
11097 });
10910
11098
10911 vm.removeProvider = function (provider) {
11099 vm.removeProvider = function (provider) {
10912
11100
10913 userSelfPropertyResource.delete(
11101 userSelfPropertyResource.delete(
10914 {
11102 {
10915 key: 'external_identities',
11103 key: 'external_identities',
10916 provider: provider.provider,
11104 provider: provider.provider,
10917 id: provider.id
11105 id: provider.id
10918 },
11106 },
10919 function (status) {
11107 function (status) {
10920 if (status){
11108 if (status){
10921 vm.identities = _.filter(vm.identities, function (item) {
11109 vm.identities = _.filter(vm.identities, function (item) {
10922 return item != provider
11110 return item != provider
10923 });
11111 });
10924 }
11112 }
10925
11113
10926 });
11114 });
10927 }
11115 }
10928 }
11116 }
10929
11117
10930 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11118 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10931 // #
11119 // #
10932 // # This program is free software: you can redistribute it and/or modify
11120 // # This program is free software: you can redistribute it and/or modify
10933 // # it under the terms of the GNU Affero General Public License, version 3
11121 // # it under the terms of the GNU Affero General Public License, version 3
10934 // # (only), as published by the Free Software Foundation.
11122 // # (only), as published by the Free Software Foundation.
10935 // #
11123 // #
10936 // # This program is distributed in the hope that it will be useful,
11124 // # This program is distributed in the hope that it will be useful,
10937 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11125 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10938 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11126 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10939 // # GNU General Public License for more details.
11127 // # GNU General Public License for more details.
10940 // #
11128 // #
10941 // # You should have received a copy of the GNU Affero General Public License
11129 // # You should have received a copy of the GNU Affero General Public License
10942 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11130 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10943 // #
11131 // #
10944 // # This program is dual-licensed. If you wish to learn more about the
11132 // # This program is dual-licensed. If you wish to learn more about the
10945 // # AppEnlight Enterprise Edition, including its added features, Support
11133 // # AppEnlight Enterprise Edition, including its added features, Support
10946 // # services, and proprietary license terms, please see
11134 // # services, and proprietary license terms, please see
10947 // # https://rhodecode.com/licenses/
11135 // # https://rhodecode.com/licenses/
10948
11136
10949 angular.module('appenlight.controllers')
11137 angular.module('appenlight.controllers')
10950 .controller('UserPasswordController', UserPasswordController)
11138 .controller('UserPasswordController', UserPasswordController)
10951
11139
10952 UserPasswordController.$inject = ['userSelfPropertyResource'];
11140 UserPasswordController.$inject = ['userSelfPropertyResource'];
10953
11141
10954 function UserPasswordController(userSelfPropertyResource) {
11142 function UserPasswordController(userSelfPropertyResource) {
10955
11143
10956 var vm = this;
11144 var vm = this;
10957 vm.loading = {password: false};
11145 vm.loading = {password: false};
10958 vm.form = {};
11146 vm.form = {};
10959
11147
10960 vm.updatePassword = function () {
11148 vm.updatePassword = function () {
10961 vm.loading.password = true;
11149 vm.loading.password = true;
10962
11150
10963 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
11151 userSelfPropertyResource.update({key: 'password'}, vm.form, function () {
10964 vm.loading.password = false;
11152 vm.loading.password = false;
10965 vm.form = {};
11153 vm.form = {};
10966 setServerValidation(vm.passwordForm);
11154 setServerValidation(vm.passwordForm);
10967 }, function (response) {
11155 }, function (response) {
10968 if (response.status == 422) {
11156 if (response.status == 422) {
10969
11157
10970 setServerValidation(vm.passwordForm, response.data);
11158 setServerValidation(vm.passwordForm, response.data);
10971
11159
10972 }
11160 }
10973 vm.loading.password = false;
11161 vm.loading.password = false;
10974 });
11162 });
10975 }
11163 }
10976 }
11164 }
10977
11165
10978 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11166 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
10979 // #
11167 // #
10980 // # This program is free software: you can redistribute it and/or modify
11168 // # This program is free software: you can redistribute it and/or modify
10981 // # it under the terms of the GNU Affero General Public License, version 3
11169 // # it under the terms of the GNU Affero General Public License, version 3
10982 // # (only), as published by the Free Software Foundation.
11170 // # (only), as published by the Free Software Foundation.
10983 // #
11171 // #
10984 // # This program is distributed in the hope that it will be useful,
11172 // # This program is distributed in the hope that it will be useful,
10985 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11173 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
10986 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11174 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10987 // # GNU General Public License for more details.
11175 // # GNU General Public License for more details.
10988 // #
11176 // #
10989 // # You should have received a copy of the GNU Affero General Public License
11177 // # You should have received a copy of the GNU Affero General Public License
10990 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11178 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
10991 // #
11179 // #
10992 // # This program is dual-licensed. If you wish to learn more about the
11180 // # This program is dual-licensed. If you wish to learn more about the
10993 // # AppEnlight Enterprise Edition, including its added features, Support
11181 // # AppEnlight Enterprise Edition, including its added features, Support
10994 // # services, and proprietary license terms, please see
11182 // # services, and proprietary license terms, please see
10995 // # https://rhodecode.com/licenses/
11183 // # https://rhodecode.com/licenses/
10996
11184
10997 angular.module('appenlight.controllers')
11185 angular.module('appenlight.controllers')
10998 .controller('UserProfileController', UserProfileController)
11186 .controller('UserProfileController', UserProfileController)
10999
11187
11000 UserProfileController.$inject = ['userSelfResource'];
11188 UserProfileController.$inject = ['userSelfResource'];
11001
11189
11002 function UserProfileController(userSelfResource) {
11190 function UserProfileController(userSelfResource) {
11003
11191
11004 var vm = this;
11192 var vm = this;
11005 vm.loading = {profile: true};
11193 vm.loading = {profile: true};
11006
11194
11007 vm.user = userSelfResource.get(null, function (data) {
11195 vm.user = userSelfResource.get(null, function (data) {
11008 vm.loading.profile = false;
11196 vm.loading.profile = false;
11009
11197
11010 });
11198 });
11011
11199
11012 vm.updateProfile = function () {
11200 vm.updateProfile = function () {
11013 vm.loading.profile = true;
11201 vm.loading.profile = true;
11014
11202
11015
11203
11016 vm.user.$update(null, function () {
11204 vm.user.$update(null, function () {
11017 vm.loading.profile = false;
11205 vm.loading.profile = false;
11018 setServerValidation(vm.profileForm);
11206 setServerValidation(vm.profileForm);
11019 }, function (response) {
11207 }, function (response) {
11020 if (response.status == 422) {
11208 if (response.status == 422) {
11021 setServerValidation(vm.profileForm, response.data);
11209 setServerValidation(vm.profileForm, response.data);
11022 }
11210 }
11023 vm.loading.profile = false;
11211 vm.loading.profile = false;
11024 });
11212 });
11025 }
11213 }
11026 }
11214 }
11027
11215
11028 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11216 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11029 // #
11217 // #
11030 // # This program is free software: you can redistribute it and/or modify
11218 // # This program is free software: you can redistribute it and/or modify
11031 // # it under the terms of the GNU Affero General Public License, version 3
11219 // # it under the terms of the GNU Affero General Public License, version 3
11032 // # (only), as published by the Free Software Foundation.
11220 // # (only), as published by the Free Software Foundation.
11033 // #
11221 // #
11034 // # This program is distributed in the hope that it will be useful,
11222 // # This program is distributed in the hope that it will be useful,
11035 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11223 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11036 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11224 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11037 // # GNU General Public License for more details.
11225 // # GNU General Public License for more details.
11038 // #
11226 // #
11039 // # You should have received a copy of the GNU Affero General Public License
11227 // # You should have received a copy of the GNU Affero General Public License
11040 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11228 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11041 // #
11229 // #
11042 // # This program is dual-licensed. If you wish to learn more about the
11230 // # This program is dual-licensed. If you wish to learn more about the
11043 // # AppEnlight Enterprise Edition, including its added features, Support
11231 // # AppEnlight Enterprise Edition, including its added features, Support
11044 // # services, and proprietary license terms, please see
11232 // # services, and proprietary license terms, please see
11045 // # https://rhodecode.com/licenses/
11233 // # https://rhodecode.com/licenses/
11046
11234
11047 angular.module('appenlight.directives.appVersion', []).
11235 angular.module('appenlight.directives.appVersion', []).
11048 directive('appVersion', ['version', function (version) {
11236 directive('appVersion', ['version', function (version) {
11049 return function (scope, elm, attrs) {
11237 return function (scope, elm, attrs) {
11050 elm.text(version);
11238 elm.text(version);
11051 };
11239 };
11052 }])
11240 }])
11053
11241
11054 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11242 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11055 // #
11243 // #
11056 // # This program is free software: you can redistribute it and/or modify
11244 // # This program is free software: you can redistribute it and/or modify
11057 // # it under the terms of the GNU Affero General Public License, version 3
11245 // # it under the terms of the GNU Affero General Public License, version 3
11058 // # (only), as published by the Free Software Foundation.
11246 // # (only), as published by the Free Software Foundation.
11059 // #
11247 // #
11060 // # This program is distributed in the hope that it will be useful,
11248 // # This program is distributed in the hope that it will be useful,
11061 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11249 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11062 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11250 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11063 // # GNU General Public License for more details.
11251 // # GNU General Public License for more details.
11064 // #
11252 // #
11065 // # You should have received a copy of the GNU Affero General Public License
11253 // # You should have received a copy of the GNU Affero General Public License
11066 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11254 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11067 // #
11255 // #
11068 // # This program is dual-licensed. If you wish to learn more about the
11256 // # This program is dual-licensed. If you wish to learn more about the
11069 // # AppEnlight Enterprise Edition, including its added features, Support
11257 // # AppEnlight Enterprise Edition, including its added features, Support
11070 // # services, and proprietary license terms, please see
11258 // # services, and proprietary license terms, please see
11071 // # https://rhodecode.com/licenses/
11259 // # https://rhodecode.com/licenses/
11072
11260
11073 // This code is inspired by https://github.com/jettro/c3-angular-sample/tree/master/js
11261 // This code is inspired by https://github.com/jettro/c3-angular-sample/tree/master/js
11074 // License is MIT
11262 // License is MIT
11075
11263
11076
11264
11077 angular.module('appenlight.directives.c3chart', [])
11265 angular.module('appenlight.directives.c3chart', [])
11078 .controller('ChartCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
11266 .controller('ChartCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
11079 $scope.chart = null;
11267 $scope.chart = null;
11080 this.showGraph = function () {
11268 this.showGraph = function () {
11081 var config = angular.copy($scope.config);
11269 var config = angular.copy($scope.config);
11082 var firstLoad = true;
11270 var firstLoad = true;
11083 config.bindto = "#" + $scope.domid;
11271 config.bindto = "#" + $scope.domid;
11084 var originalXTickCount = null;
11272 var originalXTickCount = null;
11085 if ($scope.data && $scope.config) {
11273 if ($scope.data && $scope.config) {
11086 if (!_.isEmpty($scope.data)) {
11274 if (!_.isEmpty($scope.data)) {
11087 _.extend(config.data, angular.copy($scope.data));
11275 _.extend(config.data, angular.copy($scope.data));
11088 }
11276 }
11089
11277
11090 config.onresized = function () {
11278 config.onresized = function () {
11091 if (this.currentWidth < 400){
11279 if (this.currentWidth < 400){
11092 $scope.chart.internal.config.axis_x_tick_culling_max = 3;
11280 $scope.chart.internal.config.axis_x_tick_culling_max = 3;
11093 }
11281 }
11094 else if (this.currentWidth < 600){
11282 else if (this.currentWidth < 600){
11095 $scope.chart.internal.config.axis_x_tick_culling_max = 5;
11283 $scope.chart.internal.config.axis_x_tick_culling_max = 5;
11096 }
11284 }
11097 else{
11285 else{
11098 $scope.chart.internal.config.axis_x_tick_culling_max = originalXTickCount;
11286 $scope.chart.internal.config.axis_x_tick_culling_max = originalXTickCount;
11099 }
11287 }
11100 $scope.chart.flush();
11288 $scope.chart.flush();
11101 };
11289 };
11102
11290
11103
11291
11104 $scope.chart = c3.generate(config);
11292 $scope.chart = c3.generate(config);
11105 originalXTickCount = $scope.chart.internal.config.axis_x_tick_culling_max;
11293 originalXTickCount = $scope.chart.internal.config.axis_x_tick_culling_max;
11106 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11294 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11107 }
11295 }
11108
11296
11109 if ($scope.update) {
11297 if ($scope.update) {
11110
11298
11111 $scope.$watch('data', function () {
11299 $scope.$watch('data', function () {
11112 if (!firstLoad) {
11300 if (!firstLoad) {
11113
11301
11114 $scope.chart.load(angular.copy($scope.data), {unload: true});
11302 $scope.chart.load(angular.copy($scope.data), {unload: true});
11115 if (typeof $scope.data.groups != 'undefined') {
11303 if (typeof $scope.data.groups != 'undefined') {
11116
11304
11117 $scope.chart.groups($scope.data.groups);
11305 $scope.chart.groups($scope.data.groups);
11118 }
11306 }
11119 if (typeof $scope.data.names != 'undefined') {
11307 if (typeof $scope.data.names != 'undefined') {
11120
11308
11121 $scope.chart.data.names($scope.data.names);
11309 $scope.chart.data.names($scope.data.names);
11122 }
11310 }
11123 $scope.chart.flush();
11311 $scope.chart.flush();
11124 }
11312 }
11125 }, true);
11313 }, true);
11126 }
11314 }
11127 $scope.$watch('config.regions', function (newValue, oldValue) {
11315 $scope.$watch('config.regions', function (newValue, oldValue) {
11128 if (newValue === oldValue) {
11316 if (newValue === oldValue) {
11129 return
11317 return
11130 }
11318 }
11131 if (typeof $scope.config.regions != 'undefined') {
11319 if (typeof $scope.config.regions != 'undefined') {
11132
11320
11133 $scope.chart.regions($scope.config.regions);
11321 $scope.chart.regions($scope.config.regions);
11134 }
11322 }
11135 });
11323 });
11136
11324
11137 firstLoad = false;
11325 firstLoad = false;
11138 $scope.$watch('resizetrigger', function (newValue, oldValue) {
11326 $scope.$watch('resizetrigger', function (newValue, oldValue) {
11139 if (newValue !== oldValue) {
11327 if (newValue !== oldValue) {
11140 $timeout(function () {
11328 $timeout(function () {
11141 $scope.chart.resize();
11329 $scope.chart.resize();
11142 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11330 $scope.chart.internal.config.onresized.call($scope.chart.internal);
11143 });
11331 });
11144 }
11332 }
11145 });
11333 });
11146 };
11334 };
11147 }])
11335 }])
11148 .directive('c3chart', function ($timeout) {
11336 .directive('c3chart', function ($timeout) {
11149 var chartLinker = function (scope, element, attrs, chartCtrl) {
11337 var chartLinker = function (scope, element, attrs, chartCtrl) {
11150 // Trick to wait for all rendering of the DOM to be finished.
11338 // Trick to wait for all rendering of the DOM to be finished.
11151 // then we can tell c3js to "connect" to our dom node
11339 // then we can tell c3js to "connect" to our dom node
11152 $timeout(function () {
11340 $timeout(function () {
11153 chartCtrl.showGraph()
11341 chartCtrl.showGraph()
11154 });
11342 });
11155
11343
11156 scope.$on("$destroy", function () {
11344 scope.$on("$destroy", function () {
11157 if (scope.chart !== null) {
11345 if (scope.chart !== null) {
11158 scope.chart = scope.chart.destroy();
11346 scope.chart = scope.chart.destroy();
11159 delete element;
11347 delete element;
11160 delete scope.chart;
11348 delete scope.chart;
11161
11349
11162 }
11350 }
11163 }
11351 }
11164 );
11352 );
11165 };
11353 };
11166 return {
11354 return {
11167 "restrict": "E",
11355 "restrict": "E",
11168 "controller": "ChartCtrl",
11356 "controller": "ChartCtrl",
11169 "scope": {
11357 "scope": {
11170 "domid": "@domid",
11358 "domid": "@domid",
11171 "config": "=config",
11359 "config": "=config",
11172 "data": "=data",
11360 "data": "=data",
11173 "resizetrigger": "=resizetrigger",
11361 "resizetrigger": "=resizetrigger",
11174 "update": "=update"
11362 "update": "=update"
11175 },
11363 },
11176 "template": "<div id='{{domid}}' class='chart'></div>",
11364 "template": "<div id='{{domid}}' class='chart'></div>",
11177 "replace": true,
11365 "replace": true,
11178 "link": chartLinker
11366 "link": chartLinker
11179 }
11367 }
11180 });
11368 });
11181
11369
11182 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11370 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11183 // #
11371 // #
11184 // # This program is free software: you can redistribute it and/or modify
11372 // # This program is free software: you can redistribute it and/or modify
11185 // # it under the terms of the GNU Affero General Public License, version 3
11373 // # it under the terms of the GNU Affero General Public License, version 3
11186 // # (only), as published by the Free Software Foundation.
11374 // # (only), as published by the Free Software Foundation.
11187 // #
11375 // #
11188 // # This program is distributed in the hope that it will be useful,
11376 // # This program is distributed in the hope that it will be useful,
11189 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11377 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11190 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11378 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11191 // # GNU General Public License for more details.
11379 // # GNU General Public License for more details.
11192 // #
11380 // #
11193 // # You should have received a copy of the GNU Affero General Public License
11381 // # You should have received a copy of the GNU Affero General Public License
11194 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11382 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11195 // #
11383 // #
11196 // # This program is dual-licensed. If you wish to learn more about the
11384 // # This program is dual-licensed. If you wish to learn more about the
11197 // # AppEnlight Enterprise Edition, including its added features, Support
11385 // # AppEnlight Enterprise Edition, including its added features, Support
11198 // # services, and proprietary license terms, please see
11386 // # services, and proprietary license terms, please see
11199 // # https://rhodecode.com/licenses/
11387 // # https://rhodecode.com/licenses/
11200
11388
11201 angular.module('appenlight.directives.confirmValidate', []).
11389 angular.module('appenlight.directives.confirmValidate', []).
11202 directive('confirmValidate', [function () {
11390 directive('confirmValidate', [function () {
11203 return {
11391 return {
11204 restrict: 'A',
11392 restrict: 'A',
11205 require: 'ngModel',
11393 require: 'ngModel',
11206 link: function ($scope, elem, attrs, ngModel) {
11394 link: function ($scope, elem, attrs, ngModel) {
11207 ngModel.$validators.confirm = function (modelValue, viewValue) {
11395 ngModel.$validators.confirm = function (modelValue, viewValue) {
11208 var value = modelValue || viewValue;
11396 var value = modelValue || viewValue;
11209
11397
11210 if (value.toLowerCase() == 'confirm') {
11398 if (value.toLowerCase() == 'confirm') {
11211 return true;
11399 return true;
11212 }
11400 }
11213 return false;
11401 return false;
11214 }
11402 }
11215 }
11403 }
11216 }
11404 }
11217 }])
11405 }])
11218
11406
11219 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11407 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11220 // #
11408 // #
11221 // # This program is free software: you can redistribute it and/or modify
11409 // # This program is free software: you can redistribute it and/or modify
11222 // # it under the terms of the GNU Affero General Public License, version 3
11410 // # it under the terms of the GNU Affero General Public License, version 3
11223 // # (only), as published by the Free Software Foundation.
11411 // # (only), as published by the Free Software Foundation.
11224 // #
11412 // #
11225 // # This program is distributed in the hope that it will be useful,
11413 // # This program is distributed in the hope that it will be useful,
11226 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11414 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11227 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11415 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11228 // # GNU General Public License for more details.
11416 // # GNU General Public License for more details.
11229 // #
11417 // #
11230 // # You should have received a copy of the GNU Affero General Public License
11418 // # You should have received a copy of the GNU Affero General Public License
11231 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11419 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11232 // #
11420 // #
11233 // # This program is dual-licensed. If you wish to learn more about the
11421 // # This program is dual-licensed. If you wish to learn more about the
11234 // # AppEnlight Enterprise Edition, including its added features, Support
11422 // # AppEnlight Enterprise Edition, including its added features, Support
11235 // # services, and proprietary license terms, please see
11423 // # services, and proprietary license terms, please see
11236 // # https://rhodecode.com/licenses/
11424 // # https://rhodecode.com/licenses/
11237
11425
11238 angular.module('appenlight.directives.focus', []).directive('focus', function () {
11426 angular.module('appenlight.directives.focus', []).directive('focus', function () {
11239 return function (scope, element, attrs) {
11427 return function (scope, element, attrs) {
11240 attrs.$observe('focus', function (newValue) {
11428 attrs.$observe('focus', function (newValue) {
11241 newValue === 'true' && element[0].focus();
11429 newValue === 'true' && element[0].focus();
11242 });
11430 });
11243 }
11431 }
11244 });
11432 });
11245
11433
11246 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11434 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11247 // #
11435 // #
11248 // # This program is free software: you can redistribute it and/or modify
11436 // # This program is free software: you can redistribute it and/or modify
11249 // # it under the terms of the GNU Affero General Public License, version 3
11437 // # it under the terms of the GNU Affero General Public License, version 3
11250 // # (only), as published by the Free Software Foundation.
11438 // # (only), as published by the Free Software Foundation.
11251 // #
11439 // #
11252 // # This program is distributed in the hope that it will be useful,
11440 // # This program is distributed in the hope that it will be useful,
11253 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11441 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11254 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11442 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11255 // # GNU General Public License for more details.
11443 // # GNU General Public License for more details.
11256 // #
11444 // #
11257 // # You should have received a copy of the GNU Affero General Public License
11445 // # You should have received a copy of the GNU Affero General Public License
11258 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11446 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11259 // #
11447 // #
11260 // # This program is dual-licensed. If you wish to learn more about the
11448 // # This program is dual-licensed. If you wish to learn more about the
11261 // # AppEnlight Enterprise Edition, including its added features, Support
11449 // # AppEnlight Enterprise Edition, including its added features, Support
11262 // # services, and proprietary license terms, please see
11450 // # services, and proprietary license terms, please see
11263 // # https://rhodecode.com/licenses/
11451 // # https://rhodecode.com/licenses/
11264
11452
11265 angular.module('appenlight.directives.formErrors', []).
11453 angular.module('appenlight.directives.formErrors', []).
11266 directive('formErrors', function() {
11454 directive('formErrors', function() {
11267 return {
11455 return {
11268 scope: {
11456 scope: {
11269 errors: '='
11457 errors: '='
11270 },
11458 },
11271 template: '<div ng-repeat="errorMessage in errors"><div class="form-error alert alert-error">{{ errorMessage }}</div></div>'
11459 template: '<div ng-repeat="errorMessage in errors"><div class="form-error alert alert-error">{{ errorMessage }}</div></div>'
11272 }
11460 }
11273 })
11461 })
11274
11462
11275 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11463 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11276 // #
11464 // #
11277 // # This program is free software: you can redistribute it and/or modify
11465 // # This program is free software: you can redistribute it and/or modify
11278 // # it under the terms of the GNU Affero General Public License, version 3
11466 // # it under the terms of the GNU Affero General Public License, version 3
11279 // # (only), as published by the Free Software Foundation.
11467 // # (only), as published by the Free Software Foundation.
11280 // #
11468 // #
11281 // # This program is distributed in the hope that it will be useful,
11469 // # This program is distributed in the hope that it will be useful,
11282 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11470 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11283 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11471 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11284 // # GNU General Public License for more details.
11472 // # GNU General Public License for more details.
11285 // #
11473 // #
11286 // # You should have received a copy of the GNU Affero General Public License
11474 // # You should have received a copy of the GNU Affero General Public License
11287 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11475 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11288 // #
11476 // #
11289 // # This program is dual-licensed. If you wish to learn more about the
11477 // # This program is dual-licensed. If you wish to learn more about the
11290 // # AppEnlight Enterprise Edition, including its added features, Support
11478 // # AppEnlight Enterprise Edition, including its added features, Support
11291 // # services, and proprietary license terms, please see
11479 // # services, and proprietary license terms, please see
11292 // # https://rhodecode.com/licenses/
11480 // # https://rhodecode.com/licenses/
11293
11481
11294 angular.module('appenlight.directives.humanFormat', []).
11482 angular.module('appenlight.directives.humanFormat', []).
11295 directive('humanFormat', [function () {
11483 directive('humanFormat', [function () {
11296 /* json inspector */
11484 /* json inspector */
11297 return {
11485 return {
11298 restrict: "A",
11486 restrict: "A",
11299 scope: {
11487 scope: {
11300 vars: '=',
11488 vars: '=',
11301 },
11489 },
11302 "link": function (scope, element, attrs) {
11490 "link": function (scope, element, attrs) {
11303 scope.$watch('vars', function (newValue, oldValue, scope) {
11491 scope.$watch('vars', function (newValue, oldValue, scope) {
11304 element.empty();
11492 element.empty();
11305 element.append(JsonHuman.format(scope.vars));
11493 element.append(JsonHuman.format(scope.vars));
11306 });
11494 });
11307
11495
11308 }
11496 }
11309 }
11497 }
11310 }])
11498 }])
11311
11499
11312 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11500 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11313 // #
11501 // #
11314 // # This program is free software: you can redistribute it and/or modify
11502 // # This program is free software: you can redistribute it and/or modify
11315 // # it under the terms of the GNU Affero General Public License, version 3
11503 // # it under the terms of the GNU Affero General Public License, version 3
11316 // # (only), as published by the Free Software Foundation.
11504 // # (only), as published by the Free Software Foundation.
11317 // #
11505 // #
11318 // # This program is distributed in the hope that it will be useful,
11506 // # This program is distributed in the hope that it will be useful,
11319 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11507 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11320 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11508 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11321 // # GNU General Public License for more details.
11509 // # GNU General Public License for more details.
11322 // #
11510 // #
11323 // # You should have received a copy of the GNU Affero General Public License
11511 // # You should have received a copy of the GNU Affero General Public License
11324 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11512 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11325 // #
11513 // #
11326 // # This program is dual-licensed. If you wish to learn more about the
11514 // # This program is dual-licensed. If you wish to learn more about the
11327 // # AppEnlight Enterprise Edition, including its added features, Support
11515 // # AppEnlight Enterprise Edition, including its added features, Support
11328 // # services, and proprietary license terms, please see
11516 // # services, and proprietary license terms, please see
11329 // # https://rhodecode.com/licenses/
11517 // # https://rhodecode.com/licenses/
11330
11518
11331 angular.module('appenlight.directives.isoToRelativeTime', []).
11519 angular.module('appenlight.directives.isoToRelativeTime', []).
11332 directive('isoToRelativeTime', function () {
11520 directive('isoToRelativeTime', function () {
11333 return {
11521 return {
11334 "restrict": "E",
11522 "restrict": "E",
11335 scope: {
11523 scope: {
11336 time: '@'
11524 time: '@'
11337 },
11525 },
11338 "link": function (scope, element) {
11526 "link": function (scope, element) {
11339 scope.$watch('time', function(newValue, oldValue, scope){
11527 scope.$watch('time', function(newValue, oldValue, scope){
11340 element.empty();
11528 element.empty();
11341 element.html(moment.utc(newValue).fromNow());
11529 element.html(moment.utc(newValue).fromNow());
11342 });
11530 });
11343 }
11531 }
11344 }
11532 }
11345 })
11533 })
11346
11534
11347 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11535 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11348 // #
11536 // #
11349 // # This program is free software: you can redistribute it and/or modify
11537 // # This program is free software: you can redistribute it and/or modify
11350 // # it under the terms of the GNU Affero General Public License, version 3
11538 // # it under the terms of the GNU Affero General Public License, version 3
11351 // # (only), as published by the Free Software Foundation.
11539 // # (only), as published by the Free Software Foundation.
11352 // #
11540 // #
11353 // # This program is distributed in the hope that it will be useful,
11541 // # This program is distributed in the hope that it will be useful,
11354 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11542 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11355 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11543 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11356 // # GNU General Public License for more details.
11544 // # GNU General Public License for more details.
11357 // #
11545 // #
11358 // # You should have received a copy of the GNU Affero General Public License
11546 // # You should have received a copy of the GNU Affero General Public License
11359 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11547 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11360 // #
11548 // #
11361 // # This program is dual-licensed. If you wish to learn more about the
11549 // # This program is dual-licensed. If you wish to learn more about the
11362 // # AppEnlight Enterprise Edition, including its added features, Support
11550 // # AppEnlight Enterprise Edition, including its added features, Support
11363 // # services, and proprietary license terms, please see
11551 // # services, and proprietary license terms, please see
11364 // # https://rhodecode.com/licenses/
11552 // # https://rhodecode.com/licenses/
11365
11553
11366 angular.module('appenlight.controllers')
11554 angular.module('appenlight.controllers')
11367 .controller('ApplicationPermissionsController', ApplicationPermissionsController);
11555 .controller('ApplicationPermissionsController', ApplicationPermissionsController);
11368
11556
11369 ApplicationPermissionsController.$inject = ['sectionViewResource',
11557 ApplicationPermissionsController.$inject = ['sectionViewResource',
11370 'applicationsPropertyResource', 'groupsResource']
11558 'applicationsPropertyResource', 'groupsResource']
11371
11559
11372
11560
11373 function ApplicationPermissionsController(sectionViewResource, applicationsPropertyResource , groupsResource) {
11561 function ApplicationPermissionsController(sectionViewResource, applicationsPropertyResource , groupsResource) {
11374 var vm = this;
11562 var vm = this;
11375 vm.form = {
11563 vm.form = {
11376 autocompleteUser: '',
11564 autocompleteUser: '',
11377 selectedGroup: null,
11565 selectedGroup: null,
11378 selectedUserPermissions: {},
11566 selectedUserPermissions: {},
11379 selectedGroupPermissions: {}
11567 selectedGroupPermissions: {}
11380 }
11568 }
11381 vm.possibleGroups = groupsResource.query(null, function(){
11569 vm.possibleGroups = groupsResource.query(null, function(){
11382 if (vm.possibleGroups.length > 0){
11570 if (vm.possibleGroups.length > 0){
11383 vm.form.selectedGroup = vm.possibleGroups[0].id;
11571 vm.form.selectedGroup = vm.possibleGroups[0].id;
11384 }
11572 }
11385 });
11573 });
11386
11574
11387 vm.possibleUsers = [];
11575 vm.possibleUsers = [];
11388 _.each(vm.resource.possible_permissions, function (perm) {
11576 _.each(vm.resource.possible_permissions, function (perm) {
11389 vm.form.selectedUserPermissions[perm] = false;
11577 vm.form.selectedUserPermissions[perm] = false;
11390 vm.form.selectedGroupPermissions[perm] = false;
11578 vm.form.selectedGroupPermissions[perm] = false;
11391 });
11579 });
11392
11580
11393 /**
11581 /**
11394 * Converts the permission list into {user, permission_list objects}
11582 * Converts the permission list into {user, permission_list objects}
11395 * for rendering in templates
11583 * for rendering in templates
11396 * **/
11584 * **/
11397 var tmpObj = {
11585 var tmpObj = {
11398 user: {},
11586 user: {},
11399 group: {}
11587 group: {}
11400 };
11588 };
11401 _.each(vm.currentPermissions, function (perm) {
11589 _.each(vm.currentPermissions, function (perm) {
11402
11590
11403 if (perm.type == 'user') {
11591 if (perm.type == 'user') {
11404 if (typeof tmpObj[perm.type][perm.user_name] === 'undefined') {
11592 if (typeof tmpObj[perm.type][perm.user_name] === 'undefined') {
11405 tmpObj[perm.type][perm.user_name] = {
11593 tmpObj[perm.type][perm.user_name] = {
11406 self: perm,
11594 self: perm,
11407 permissions: []
11595 permissions: []
11408 }
11596 }
11409 }
11597 }
11410 if (tmpObj[perm.type][perm.user_name].permissions.indexOf(perm.perm_name) === -1) {
11598 if (tmpObj[perm.type][perm.user_name].permissions.indexOf(perm.perm_name) === -1) {
11411 tmpObj[perm.type][perm.user_name].permissions.push(perm.perm_name);
11599 tmpObj[perm.type][perm.user_name].permissions.push(perm.perm_name);
11412 }
11600 }
11413 }
11601 }
11414 else {
11602 else {
11415 if (typeof tmpObj[perm.type][perm.group_name] === 'undefined') {
11603 if (typeof tmpObj[perm.type][perm.group_name] === 'undefined') {
11416 tmpObj[perm.type][perm.group_name] = {
11604 tmpObj[perm.type][perm.group_name] = {
11417 self: perm,
11605 self: perm,
11418 permissions: []
11606 permissions: []
11419 }
11607 }
11420 }
11608 }
11421 if (tmpObj[perm.type][perm.group_name].permissions.indexOf(perm.perm_name) === -1) {
11609 if (tmpObj[perm.type][perm.group_name].permissions.indexOf(perm.perm_name) === -1) {
11422 tmpObj[perm.type][perm.group_name].permissions.push(perm.perm_name);
11610 tmpObj[perm.type][perm.group_name].permissions.push(perm.perm_name);
11423 }
11611 }
11424
11612
11425 }
11613 }
11426 });
11614 });
11427 vm.currentPermissions = {
11615 vm.currentPermissions = {
11428 user: _.values(tmpObj.user),
11616 user: _.values(tmpObj.user),
11429 group: _.values(tmpObj.group),
11617 group: _.values(tmpObj.group),
11430 };
11618 };
11431
11619
11432
11620
11433
11621
11434 vm.searchUsers = function (searchPhrase) {
11622 vm.searchUsers = function (searchPhrase) {
11435
11623
11436 vm.searchingUsers = true;
11624 vm.searchingUsers = true;
11437 return sectionViewResource.query({
11625 return sectionViewResource.query({
11438 section: 'users_section',
11626 section: 'users_section',
11439 view: 'search_users',
11627 view: 'search_users',
11440 'user_name': searchPhrase
11628 'user_name': searchPhrase
11441 }).$promise.then(function (data) {
11629 }).$promise.then(function (data) {
11442 vm.searchingUsers = false;
11630 vm.searchingUsers = false;
11443 return _.map(data, function (item) {
11631 return _.map(data, function (item) {
11444 return item;
11632 return item;
11445 });
11633 });
11446 });
11634 });
11447 };
11635 };
11448
11636
11449
11637
11450 vm.setGroupPermission = function(){
11638 vm.setGroupPermission = function(){
11451 var POSTObj = {
11639 var POSTObj = {
11452 'group_id': vm.form.selectedGroup,
11640 'group_id': vm.form.selectedGroup,
11453 'permissions': []
11641 'permissions': []
11454 };
11642 };
11455 for (var key in vm.form.selectedGroupPermissions) {
11643 for (var key in vm.form.selectedGroupPermissions) {
11456 if (vm.form.selectedGroupPermissions[key]) {
11644 if (vm.form.selectedGroupPermissions[key]) {
11457 POSTObj.permissions.push(key)
11645 POSTObj.permissions.push(key)
11458 }
11646 }
11459 }
11647 }
11460 applicationsPropertyResource.save({
11648 applicationsPropertyResource.save({
11461 key: 'group_permissions',
11649 key: 'group_permissions',
11462 resourceId: vm.resource.resource_id
11650 resourceId: vm.resource.resource_id
11463 }, POSTObj,
11651 }, POSTObj,
11464 function (data) {
11652 function (data) {
11465 var found_row = false;
11653 var found_row = false;
11466 _.each(vm.currentPermissions.group, function (perm) {
11654 _.each(vm.currentPermissions.group, function (perm) {
11467 if (perm.self.group_id == data.group.id) {
11655 if (perm.self.group_id == data.group.id) {
11468 perm['permissions'] = data['permissions'];
11656 perm['permissions'] = data['permissions'];
11469 found_row = true;
11657 found_row = true;
11470 }
11658 }
11471 });
11659 });
11472 if (!found_row) {
11660 if (!found_row) {
11473 data.self = data.group;
11661 data.self = data.group;
11474 // normalize data format
11662 // normalize data format
11475 data.self.group_id = data.self.id;
11663 data.self.group_id = data.self.id;
11476 vm.currentPermissions.group.push(data);
11664 vm.currentPermissions.group.push(data);
11477 }
11665 }
11478 });
11666 });
11479
11667
11480 }
11668 }
11481
11669
11482
11670
11483 vm.setUserPermission = function () {
11671 vm.setUserPermission = function () {
11484
11672
11485 var POSTObj = {
11673 var POSTObj = {
11486 'user_name': vm.form.autocompleteUser,
11674 'user_name': vm.form.autocompleteUser,
11487 'permissions': []
11675 'permissions': []
11488 };
11676 };
11489 for (var key in vm.form.selectedUserPermissions) {
11677 for (var key in vm.form.selectedUserPermissions) {
11490 if (vm.form.selectedUserPermissions[key]) {
11678 if (vm.form.selectedUserPermissions[key]) {
11491 POSTObj.permissions.push(key)
11679 POSTObj.permissions.push(key)
11492 }
11680 }
11493 }
11681 }
11494 applicationsPropertyResource.save({
11682 applicationsPropertyResource.save({
11495 key: 'user_permissions',
11683 key: 'user_permissions',
11496 resourceId: vm.resource.resource_id
11684 resourceId: vm.resource.resource_id
11497 }, POSTObj,
11685 }, POSTObj,
11498 function (data) {
11686 function (data) {
11499 var found_row = false;
11687 var found_row = false;
11500 _.each(vm.currentPermissions.user, function (perm) {
11688 _.each(vm.currentPermissions.user, function (perm) {
11501 if (perm.self.user_name == data['user_name']) {
11689 if (perm.self.user_name == data['user_name']) {
11502 perm['permissions'] = data['permissions'];
11690 perm['permissions'] = data['permissions'];
11503 found_row = true;
11691 found_row = true;
11504 }
11692 }
11505 });
11693 });
11506 if (!found_row) {
11694 if (!found_row) {
11507 data.self = data;
11695 data.self = data;
11508 vm.currentPermissions.user.push(data);
11696 vm.currentPermissions.user.push(data);
11509 }
11697 }
11510 });
11698 });
11511 }
11699 }
11512
11700
11513 vm.removeUserPermission = function (perm_name, curr_perm) {
11701 vm.removeUserPermission = function (perm_name, curr_perm) {
11514
11702
11515
11703
11516 var POSTObj = {
11704 var POSTObj = {
11517 key: 'user_permissions',
11705 key: 'user_permissions',
11518 user_name: curr_perm.self.user_name,
11706 user_name: curr_perm.self.user_name,
11519 permissions: [perm_name],
11707 permissions: [perm_name],
11520 resourceId: vm.resource.resource_id
11708 resourceId: vm.resource.resource_id
11521 }
11709 }
11522 applicationsPropertyResource.delete(POSTObj, function (data) {
11710 applicationsPropertyResource.delete(POSTObj, function (data) {
11523 _.each(vm.currentPermissions.user, function (perm) {
11711 _.each(vm.currentPermissions.user, function (perm) {
11524 if (perm.self.user_name == data['user_name']) {
11712 if (perm.self.user_name == data['user_name']) {
11525 perm['permissions'] = data['permissions']
11713 perm['permissions'] = data['permissions']
11526 }
11714 }
11527 });
11715 });
11528 });
11716 });
11529 }
11717 }
11530
11718
11531 vm.removeGroupPermission = function (perm_name, curr_perm) {
11719 vm.removeGroupPermission = function (perm_name, curr_perm) {
11532
11720
11533 var POSTObj = {
11721 var POSTObj = {
11534 key: 'group_permissions',
11722 key: 'group_permissions',
11535 group_id: curr_perm.self.group_id,
11723 group_id: curr_perm.self.group_id,
11536 permissions: [perm_name],
11724 permissions: [perm_name],
11537 resourceId: vm.resource.resource_id
11725 resourceId: vm.resource.resource_id
11538 }
11726 }
11539 applicationsPropertyResource.delete(POSTObj, function (data) {
11727 applicationsPropertyResource.delete(POSTObj, function (data) {
11540 _.each(vm.currentPermissions.group, function (perm) {
11728 _.each(vm.currentPermissions.group, function (perm) {
11541 if (perm.self.group_id == data.group.id) {
11729 if (perm.self.group_id == data.group.id) {
11542 perm['permissions'] = data['permissions']
11730 perm['permissions'] = data['permissions']
11543 }
11731 }
11544 });
11732 });
11545 });
11733 });
11546 }
11734 }
11547 }
11735 }
11548
11736
11549 angular.module('appenlight.directives.permissionsForm',[])
11737 angular.module('appenlight.directives.permissionsForm',[])
11550 .directive('permissionsForm', function () {
11738 .directive('permissionsForm', function () {
11551 return {
11739 return {
11552 "restrict": "E",
11740 "restrict": "E",
11553 "controller": "ApplicationPermissionsController",
11741 "controller": "ApplicationPermissionsController",
11554 controllerAs: 'permissions',
11742 controllerAs: 'permissions',
11555 bindToController: true,
11743 bindToController: true,
11556 scope: {
11744 scope: {
11557 currentPermissions: '=',
11745 currentPermissions: '=',
11558 possiblePermissions: '=',
11746 possiblePermissions: '=',
11559 resource: '='
11747 resource: '='
11560 },
11748 },
11561 templateUrl: 'templates/directives/permissions.html'
11749 templateUrl: 'templates/directives/permissions.html'
11562 }
11750 }
11563 })
11751 })
11564
11752
11565 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11753 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11566 // #
11754 // #
11567 // # This program is free software: you can redistribute it and/or modify
11755 // # This program is free software: you can redistribute it and/or modify
11568 // # it under the terms of the GNU Affero General Public License, version 3
11756 // # it under the terms of the GNU Affero General Public License, version 3
11569 // # (only), as published by the Free Software Foundation.
11757 // # (only), as published by the Free Software Foundation.
11570 // #
11758 // #
11571 // # This program is distributed in the hope that it will be useful,
11759 // # This program is distributed in the hope that it will be useful,
11572 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11760 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11573 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11761 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11574 // # GNU General Public License for more details.
11762 // # GNU General Public License for more details.
11575 // #
11763 // #
11576 // # You should have received a copy of the GNU Affero General Public License
11764 // # You should have received a copy of the GNU Affero General Public License
11577 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11765 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11578 // #
11766 // #
11579 // # This program is dual-licensed. If you wish to learn more about the
11767 // # This program is dual-licensed. If you wish to learn more about the
11580 // # AppEnlight Enterprise Edition, including its added features, Support
11768 // # AppEnlight Enterprise Edition, including its added features, Support
11581 // # services, and proprietary license terms, please see
11769 // # services, and proprietary license terms, please see
11582 // # https://rhodecode.com/licenses/
11770 // # https://rhodecode.com/licenses/
11583
11771
11584 angular.module('appenlight.directives.pluginConfig', []).directive('pluginConfig', function () {
11772 angular.module('appenlight.directives.pluginConfig', []).directive('pluginConfig', function () {
11585 return {
11773 return {
11586 scope: {},
11774 scope: {},
11587 bindToController: {
11775 bindToController: {
11588 resource: '=',
11776 resource: '=',
11589 section: '='
11777 section: '='
11590 },
11778 },
11591 restrict: 'E',
11779 restrict: 'E',
11592 templateUrl: 'templates/directives/plugin_config.html',
11780 templateUrl: 'templates/directives/plugin_config.html',
11593 controller: PluginConfig,
11781 controller: PluginConfig,
11594 controllerAs: 'plugin_ctrlr'
11782 controllerAs: 'plugin_ctrlr'
11595 };
11783 };
11596
11784
11597 PluginConfig.$inject = ['stateHolder'];
11785 PluginConfig.$inject = ['stateHolder'];
11598
11786
11599 function PluginConfig(stateHolder) {
11787 function PluginConfig(stateHolder) {
11600 var vm = this;
11788 var vm = this;
11601 vm.plugins = {};
11789 vm.plugins = {};
11602 vm.inclusions = stateHolder.plugins.inclusions[vm.section];
11790 vm.inclusions = stateHolder.plugins.inclusions[vm.section];
11603 }
11791 }
11604 });
11792 });
11605
11793
11606 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11794 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11607 // #
11795 // #
11608 // # This program is free software: you can redistribute it and/or modify
11796 // # This program is free software: you can redistribute it and/or modify
11609 // # it under the terms of the GNU Affero General Public License, version 3
11797 // # it under the terms of the GNU Affero General Public License, version 3
11610 // # (only), as published by the Free Software Foundation.
11798 // # (only), as published by the Free Software Foundation.
11611 // #
11799 // #
11612 // # This program is distributed in the hope that it will be useful,
11800 // # This program is distributed in the hope that it will be useful,
11613 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11801 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11614 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11802 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11615 // # GNU General Public License for more details.
11803 // # GNU General Public License for more details.
11616 // #
11804 // #
11617 // # You should have received a copy of the GNU Affero General Public License
11805 // # You should have received a copy of the GNU Affero General Public License
11618 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11806 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11619 // #
11807 // #
11620 // # This program is dual-licensed. If you wish to learn more about the
11808 // # This program is dual-licensed. If you wish to learn more about the
11621 // # AppEnlight Enterprise Edition, including its added features, Support
11809 // # AppEnlight Enterprise Edition, including its added features, Support
11622 // # services, and proprietary license terms, please see
11810 // # services, and proprietary license terms, please see
11623 // # https://rhodecode.com/licenses/
11811 // # https://rhodecode.com/licenses/
11624
11812
11625 angular.module('appenlight.directives.postProcessAction', []).directive('postProcessAction', ['applicationsPropertyResource', function (applicationsPropertyResource) {
11813 angular.module('appenlight.directives.postProcessAction', []).directive('postProcessAction', ['applicationsPropertyResource', function (applicationsPropertyResource) {
11626 return {
11814 return {
11627 scope: {},
11815 scope: {},
11628 bindToController:{
11816 bindToController:{
11629 action: '=',
11817 action: '=',
11630 resource: '='
11818 resource: '='
11631 },
11819 },
11632 controller:postProcessActionController,
11820 controller:postProcessActionController,
11633 controllerAs:'ctrl',
11821 controllerAs:'ctrl',
11634 restrict: 'E',
11822 restrict: 'E',
11635 templateUrl: 'templates/directives/postprocess_action.html'
11823 templateUrl: 'templates/directives/postprocess_action.html'
11636 };
11824 };
11637 function postProcessActionController(){
11825 function postProcessActionController(){
11638 var vm = this;
11826 var vm = this;
11639
11827
11640 var allOps = {
11828 var allOps = {
11641 'eq': 'Equal',
11829 'eq': 'Equal',
11642 'ne': 'Not equal',
11830 'ne': 'Not equal',
11643 'ge': 'Greater or equal',
11831 'ge': 'Greater or equal',
11644 'gt': 'Greater than',
11832 'gt': 'Greater than',
11645 'le': 'Lesser or equal',
11833 'le': 'Lesser or equal',
11646 'lt': 'Lesser than',
11834 'lt': 'Lesser than',
11647 'startswith': 'Starts with',
11835 'startswith': 'Starts with',
11648 'endswith': 'Ends with',
11836 'endswith': 'Ends with',
11649 'contains': 'Contains'
11837 'contains': 'Contains'
11650 };
11838 };
11651
11839
11652 var fieldOps = {};
11840 var fieldOps = {};
11653 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
11841 fieldOps['http_status'] = ['eq', 'ne', 'ge', 'le'];
11654 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
11842 fieldOps['group:priority'] = ['eq', 'ne', 'ge', 'le'];
11655 fieldOps['duration'] = ['ge', 'le'];
11843 fieldOps['duration'] = ['ge', 'le'];
11656 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
11844 fieldOps['url_domain'] = ['eq', 'ne', 'startswith', 'endswith',
11657 'contains'];
11845 'contains'];
11658 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
11846 fieldOps['url_path'] = ['eq', 'ne', 'startswith', 'endswith',
11659 'contains'];
11847 'contains'];
11660 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
11848 fieldOps['error'] = ['eq', 'ne', 'startswith', 'endswith',
11661 'contains'];
11849 'contains'];
11662 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
11850 fieldOps['tags:server_name'] = ['eq', 'ne', 'startswith', 'endswith',
11663 'contains'];
11851 'contains'];
11664 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
11852 fieldOps['group:occurences'] = ['eq', 'ne', 'ge', 'le'];
11665
11853
11666 var possibleFields = {
11854 var possibleFields = {
11667 '__AND__': 'All met (composite rule)',
11855 '__AND__': 'All met (composite rule)',
11668 '__OR__': 'One met (composite rule)',
11856 '__OR__': 'One met (composite rule)',
11669 '__NOT__': 'Not met (composite rule)',
11857 '__NOT__': 'Not met (composite rule)',
11670 'http_status': 'HTTP Status',
11858 'http_status': 'HTTP Status',
11671 'duration': 'Request duration',
11859 'duration': 'Request duration',
11672 'group:priority': 'Group -> Priority',
11860 'group:priority': 'Group -> Priority',
11673 'url_domain': 'Domain',
11861 'url_domain': 'Domain',
11674 'url_path': 'URL Path',
11862 'url_path': 'URL Path',
11675 'error': 'Error',
11863 'error': 'Error',
11676 'tags:server_name': 'Tag -> Server name',
11864 'tags:server_name': 'Tag -> Server name',
11677 'group:occurences': 'Group -> Occurences'
11865 'group:occurences': 'Group -> Occurences'
11678 };
11866 };
11679
11867
11680 vm.ruleDefinitions = {
11868 vm.ruleDefinitions = {
11681 fieldOps: fieldOps,
11869 fieldOps: fieldOps,
11682 allOps: allOps,
11870 allOps: allOps,
11683 possibleFields: possibleFields
11871 possibleFields: possibleFields
11684 };
11872 };
11685
11873
11686 vm.possibleActions = [
11874 vm.possibleActions = [
11687 ['1', 'Priority +1'],
11875 ['1', 'Priority +1'],
11688 ['-1', 'Priority -1']
11876 ['-1', 'Priority -1']
11689 ];
11877 ];
11690
11878
11691 vm.deleteAction = function (action) {
11879 vm.deleteAction = function (action) {
11692 applicationsPropertyResource.remove({
11880 applicationsPropertyResource.remove({
11693 pkey: vm.action.pkey,
11881 pkey: vm.action.pkey,
11694 resourceId: vm.resource.resource_id,
11882 resourceId: vm.resource.resource_id,
11695 key: 'postprocessing_rules'
11883 key: 'postprocessing_rules'
11696 }, function () {
11884 }, function () {
11697 vm.resource.postprocessing_rules.splice(
11885 vm.resource.postprocessing_rules.splice(
11698 vm.resource.postprocessing_rules.indexOf(action), 1);
11886 vm.resource.postprocessing_rules.indexOf(action), 1);
11699 });
11887 });
11700 };
11888 };
11701
11889
11702
11890
11703 vm.saveAction = function () {
11891 vm.saveAction = function () {
11704 var params = {
11892 var params = {
11705 'pkey': vm.action.pkey,
11893 'pkey': vm.action.pkey,
11706 'resourceId': vm.resource.resource_id,
11894 'resourceId': vm.resource.resource_id,
11707 key: 'postprocessing_rules'
11895 key: 'postprocessing_rules'
11708 };
11896 };
11709 applicationsPropertyResource.update(params, vm.action,
11897 applicationsPropertyResource.update(params, vm.action,
11710 function (data) {
11898 function (data) {
11711 vm.action.dirty = false;
11899 vm.action.dirty = false;
11712 vm.errors = [];
11900 vm.errors = [];
11713 }, function (response) {
11901 }, function (response) {
11714 if (response.status == 422) {
11902 if (response.status == 422) {
11715 var errorDict = angular.fromJson(response.data);
11903 var errorDict = angular.fromJson(response.data);
11716 vm.errors = _.values(errorDict);
11904 vm.errors = _.values(errorDict);
11717 }
11905 }
11718 });
11906 });
11719 };
11907 };
11720
11908
11721 vm.setDirty = function() {
11909 vm.setDirty = function() {
11722 vm.action.dirty = true;
11910 vm.action.dirty = true;
11723
11911
11724 };
11912 };
11725 }
11913 }
11726
11914
11727 }]);
11915 }]);
11728
11916
11729 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11917 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11730 // #
11918 // #
11731 // # This program is free software: you can redistribute it and/or modify
11919 // # This program is free software: you can redistribute it and/or modify
11732 // # it under the terms of the GNU Affero General Public License, version 3
11920 // # it under the terms of the GNU Affero General Public License, version 3
11733 // # (only), as published by the Free Software Foundation.
11921 // # (only), as published by the Free Software Foundation.
11734 // #
11922 // #
11735 // # This program is distributed in the hope that it will be useful,
11923 // # This program is distributed in the hope that it will be useful,
11736 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11924 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11737 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11925 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11738 // # GNU General Public License for more details.
11926 // # GNU General Public License for more details.
11739 // #
11927 // #
11740 // # You should have received a copy of the GNU Affero General Public License
11928 // # You should have received a copy of the GNU Affero General Public License
11741 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11929 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11742 // #
11930 // #
11743 // # This program is dual-licensed. If you wish to learn more about the
11931 // # This program is dual-licensed. If you wish to learn more about the
11744 // # AppEnlight Enterprise Edition, including its added features, Support
11932 // # AppEnlight Enterprise Edition, including its added features, Support
11745 // # services, and proprietary license terms, please see
11933 // # services, and proprietary license terms, please see
11746 // # https://rhodecode.com/licenses/
11934 // # https://rhodecode.com/licenses/
11747
11935
11748 angular.module('appenlight.directives.recursive', []).directive("recursive", function ($compile) {
11936 angular.module('appenlight.directives.recursive', []).directive("recursive", function ($compile) {
11749 return {
11937 return {
11750 restrict: "EACM",
11938 restrict: "EACM",
11751 priority: 100000,
11939 priority: 100000,
11752 compile: function (tElement, tAttr) {
11940 compile: function (tElement, tAttr) {
11753 var contents = tElement.contents().remove();
11941 var contents = tElement.contents().remove();
11754 var compiledContents;
11942 var compiledContents;
11755 return function (scope, iElement, iAttr) {
11943 return function (scope, iElement, iAttr) {
11756 if (!compiledContents) {
11944 if (!compiledContents) {
11757 compiledContents = $compile(contents);
11945 compiledContents = $compile(contents);
11758 }
11946 }
11759 iElement.append(compiledContents(scope, function (clone) {
11947 iElement.append(compiledContents(scope, function (clone) {
11760 return clone;
11948 return clone;
11761 }));
11949 }));
11762 };
11950 };
11763 }
11951 }
11764 };
11952 };
11765 });
11953 });
11766
11954
11767 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11955 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11768 // #
11956 // #
11769 // # This program is free software: you can redistribute it and/or modify
11957 // # This program is free software: you can redistribute it and/or modify
11770 // # it under the terms of the GNU Affero General Public License, version 3
11958 // # it under the terms of the GNU Affero General Public License, version 3
11771 // # (only), as published by the Free Software Foundation.
11959 // # (only), as published by the Free Software Foundation.
11772 // #
11960 // #
11773 // # This program is distributed in the hope that it will be useful,
11961 // # This program is distributed in the hope that it will be useful,
11774 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11962 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11775 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11963 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11776 // # GNU General Public License for more details.
11964 // # GNU General Public License for more details.
11777 // #
11965 // #
11778 // # You should have received a copy of the GNU Affero General Public License
11966 // # You should have received a copy of the GNU Affero General Public License
11779 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11967 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11780 // #
11968 // #
11781 // # This program is dual-licensed. If you wish to learn more about the
11969 // # This program is dual-licensed. If you wish to learn more about the
11782 // # AppEnlight Enterprise Edition, including its added features, Support
11970 // # AppEnlight Enterprise Edition, including its added features, Support
11783 // # services, and proprietary license terms, please see
11971 // # services, and proprietary license terms, please see
11784 // # https://rhodecode.com/licenses/
11972 // # https://rhodecode.com/licenses/
11785
11973
11786 angular.module('appenlight.directives.reportAlertAction', []).directive('reportAlertAction', ['userSelfPropertyResource', function (userSelfPropertyResource) {
11974 angular.module('appenlight.directives.reportAlertAction', []).directive('reportAlertAction', ['userSelfPropertyResource', function (userSelfPropertyResource) {
11787 return {
11975 return {
11788 scope: {},
11976 scope: {},
11789 bindToController:{
11977 bindToController:{
11790 action: '=',
11978 action: '=',
11791 applications: '=',
11979 applications: '=',
11792 possibleChannels: '=',
11980 possibleChannels: '=',
11793 actions: '=',
11981 actions: '=',
11794 ruleDefinitions: '='
11982 ruleDefinitions: '='
11795 },
11983 },
11796 controller:reportAlertActionController,
11984 controller:reportAlertActionController,
11797 controllerAs:'ctrl',
11985 controllerAs:'ctrl',
11798 restrict: 'E',
11986 restrict: 'E',
11799 templateUrl: 'templates/directives/report_alert_action.html'
11987 templateUrl: 'templates/directives/report_alert_action.html'
11800 };
11988 };
11801 function reportAlertActionController(){
11989 function reportAlertActionController(){
11802 var vm = this;
11990 var vm = this;
11803 vm.deleteAction = function (actions, action) {
11991 vm.deleteAction = function (actions, action) {
11804 var get = {
11992 var get = {
11805 key: 'alert_channels_rules',
11993 key: 'alert_channels_rules',
11806 pkey: action.pkey
11994 pkey: action.pkey
11807 };
11995 };
11808 userSelfPropertyResource.remove(get, function (data) {
11996 userSelfPropertyResource.remove(get, function (data) {
11809 actions.splice(actions.indexOf(action), 1);
11997 actions.splice(actions.indexOf(action), 1);
11810 });
11998 });
11811
11999
11812 };
12000 };
11813
12001
11814 vm.bindChannel = function(){
12002 vm.bindChannel = function(){
11815 var post = {
12003 var post = {
11816 channel_pkey: vm.channelToBind.pkey,
12004 channel_pkey: vm.channelToBind.pkey,
11817 action_pkey: vm.action.pkey
12005 action_pkey: vm.action.pkey
11818 };
12006 };
11819
12007
11820 userSelfPropertyResource.save({key: 'alert_channels_actions_binds'}, post,
12008 userSelfPropertyResource.save({key: 'alert_channels_actions_binds'}, post,
11821 function (data) {
12009 function (data) {
11822 vm.action.channels = [];
12010 vm.action.channels = [];
11823 vm.action.channels = data.channels;
12011 vm.action.channels = data.channels;
11824 }, function (response) {
12012 }, function (response) {
11825 if (response.status == 422) {
12013 if (response.status == 422) {
11826
12014
11827 }
12015 }
11828 });
12016 });
11829 };
12017 };
11830
12018
11831 vm.unBindChannel = function(channel){
12019 vm.unBindChannel = function(channel){
11832 userSelfPropertyResource.delete({
12020 userSelfPropertyResource.delete({
11833 key: 'alert_channels_actions_binds',
12021 key: 'alert_channels_actions_binds',
11834 channel_pkey: channel.pkey,
12022 channel_pkey: channel.pkey,
11835 action_pkey: vm.action.pkey
12023 action_pkey: vm.action.pkey
11836 },
12024 },
11837 function (data) {
12025 function (data) {
11838 vm.action.channels = [];
12026 vm.action.channels = [];
11839 vm.action.channels = data.channels;
12027 vm.action.channels = data.channels;
11840 }, function (response) {
12028 }, function (response) {
11841 if (response.status == 422) {
12029 if (response.status == 422) {
11842
12030
11843 }
12031 }
11844 });
12032 });
11845 };
12033 };
11846
12034
11847 vm.saveAction = function () {
12035 vm.saveAction = function () {
11848 var params = {
12036 var params = {
11849 key: 'alert_channels_rules',
12037 key: 'alert_channels_rules',
11850 pkey: vm.action.pkey
12038 pkey: vm.action.pkey
11851 };
12039 };
11852 userSelfPropertyResource.update(params, vm.action,
12040 userSelfPropertyResource.update(params, vm.action,
11853 function (data) {
12041 function (data) {
11854 vm.action.dirty = false;
12042 vm.action.dirty = false;
11855 vm.errors = [];
12043 vm.errors = [];
11856 }, function (response) {
12044 }, function (response) {
11857 if (response.status == 422) {
12045 if (response.status == 422) {
11858 var errorDict = angular.fromJson(response.data);
12046 var errorDict = angular.fromJson(response.data);
11859 vm.errors = _.values(errorDict);
12047 vm.errors = _.values(errorDict);
11860 }
12048 }
11861 });
12049 });
11862 };
12050 };
11863
12051
11864 vm.possibleNotifications = [
12052 vm.possibleNotifications = [
11865 ['always', 'Always'],
12053 ['always', 'Always'],
11866 ['only_first', 'Only New'],
12054 ['only_first', 'Only New'],
11867 ];
12055 ];
11868
12056
11869 vm.possibleChannels = _.filter(vm.possibleChannels, function(c){
12057 vm.possibleChannels = _.filter(vm.possibleChannels, function(c){
11870 return c.supports_report_alerting }
12058 return c.supports_report_alerting }
11871 );
12059 );
11872
12060
11873 if (vm.possibleChannels.length > 0){
12061 if (vm.possibleChannels.length > 0){
11874 vm.channelToBind = vm.possibleChannels[0];
12062 vm.channelToBind = vm.possibleChannels[0];
11875 }
12063 }
11876
12064
11877 vm.setDirty = function() {
12065 vm.setDirty = function() {
11878 vm.action.dirty = true;
12066 vm.action.dirty = true;
11879
12067
11880 };
12068 };
11881 }
12069 }
11882
12070
11883 }]);
12071 }]);
11884
12072
11885 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12073 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11886 // #
12074 // #
11887 // # This program is free software: you can redistribute it and/or modify
12075 // # This program is free software: you can redistribute it and/or modify
11888 // # it under the terms of the GNU Affero General Public License, version 3
12076 // # it under the terms of the GNU Affero General Public License, version 3
11889 // # (only), as published by the Free Software Foundation.
12077 // # (only), as published by the Free Software Foundation.
11890 // #
12078 // #
11891 // # This program is distributed in the hope that it will be useful,
12079 // # This program is distributed in the hope that it will be useful,
11892 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12080 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11893 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12081 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11894 // # GNU General Public License for more details.
12082 // # GNU General Public License for more details.
11895 // #
12083 // #
11896 // # You should have received a copy of the GNU Affero General Public License
12084 // # You should have received a copy of the GNU Affero General Public License
11897 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12085 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11898 // #
12086 // #
11899 // # This program is dual-licensed. If you wish to learn more about the
12087 // # This program is dual-licensed. If you wish to learn more about the
11900 // # AppEnlight Enterprise Edition, including its added features, Support
12088 // # AppEnlight Enterprise Edition, including its added features, Support
11901 // # services, and proprietary license terms, please see
12089 // # services, and proprietary license terms, please see
11902 // # https://rhodecode.com/licenses/
12090 // # https://rhodecode.com/licenses/
11903
12091
11904 angular.module('appenlight.directives.ruleReadOnly', []).directive('ruleReadOnly', ['userSelfPropertyResource', function (userSelfPropertyResource) {
12092 angular.module('appenlight.directives.ruleReadOnly', []).directive('ruleReadOnly', ['userSelfPropertyResource', function (userSelfPropertyResource) {
11905 return {
12093 return {
11906 scope: {},
12094 scope: {},
11907 bindToController:{
12095 bindToController:{
11908 parentObj: '=',
12096 parentObj: '=',
11909 rule: '=',
12097 rule: '=',
11910 ruleDefinitions: '=',
12098 ruleDefinitions: '=',
11911 parentRule: "=",
12099 parentRule: "=",
11912 config: "="
12100 config: "="
11913 },
12101 },
11914 restrict: 'E',
12102 restrict: 'E',
11915 templateUrl: 'templates/directives/rule_read_only.html',
12103 templateUrl: 'templates/directives/rule_read_only.html',
11916 controller:RuleController,
12104 controller:RuleController,
11917 controllerAs:'rule_ctrlr'
12105 controllerAs:'rule_ctrlr'
11918 }
12106 }
11919 function RuleController(){
12107 function RuleController(){
11920 var vm = this;
12108 var vm = this;
11921 vm.readOnlyPossibleFields = {};
12109 vm.readOnlyPossibleFields = {};
11922 var labelPairs = _.pairs(vm.parentObj.config);
12110 var labelPairs = _.pairs(vm.parentObj.config);
11923 _.each(labelPairs, function (entry) {
12111 _.each(labelPairs, function (entry) {
11924 vm.readOnlyPossibleFields[entry[0]] = entry[1].human_label;
12112 vm.readOnlyPossibleFields[entry[0]] = entry[1].human_label;
11925 });
12113 });
11926 }
12114 }
11927 }]);
12115 }]);
11928
12116
11929 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12117 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
11930 // #
12118 // #
11931 // # This program is free software: you can redistribute it and/or modify
12119 // # This program is free software: you can redistribute it and/or modify
11932 // # it under the terms of the GNU Affero General Public License, version 3
12120 // # it under the terms of the GNU Affero General Public License, version 3
11933 // # (only), as published by the Free Software Foundation.
12121 // # (only), as published by the Free Software Foundation.
11934 // #
12122 // #
11935 // # This program is distributed in the hope that it will be useful,
12123 // # This program is distributed in the hope that it will be useful,
11936 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12124 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
11937 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12125 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11938 // # GNU General Public License for more details.
12126 // # GNU General Public License for more details.
11939 // #
12127 // #
11940 // # You should have received a copy of the GNU Affero General Public License
12128 // # You should have received a copy of the GNU Affero General Public License
11941 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12129 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
11942 // #
12130 // #
11943 // # This program is dual-licensed. If you wish to learn more about the
12131 // # This program is dual-licensed. If you wish to learn more about the
11944 // # AppEnlight Enterprise Edition, including its added features, Support
12132 // # AppEnlight Enterprise Edition, including its added features, Support
11945 // # services, and proprietary license terms, please see
12133 // # services, and proprietary license terms, please see
11946 // # https://rhodecode.com/licenses/
12134 // # https://rhodecode.com/licenses/
11947
12135
11948 angular.module('appenlight.directives.rule', []).directive('rule', function () {
12136 angular.module('appenlight.directives.rule', []).directive('rule', function () {
11949 return {
12137 return {
11950 scope: {},
12138 scope: {},
11951 bindToController:{
12139 bindToController:{
11952 parentObj: '=',
12140 parentObj: '=',
11953 rule: '=',
12141 rule: '=',
11954 ruleDefinitions: '=',
12142 ruleDefinitions: '=',
11955 parentRule: "=",
12143 parentRule: "=",
11956 config: "="
12144 config: "="
11957 },
12145 },
11958 restrict: 'E',
12146 restrict: 'E',
11959 templateUrl: 'templates/directives/rule.html',
12147 templateUrl: 'templates/directives/rule.html',
11960 controller:RuleController,
12148 controller:RuleController,
11961 controllerAs:'rule_ctrlr'
12149 controllerAs:'rule_ctrlr'
11962 };
12150 };
11963 function RuleController(){
12151 function RuleController(){
11964 var vm = this;
12152 var vm = this;
11965
12153
11966 vm.rule.dirty = false;
12154 vm.rule.dirty = false;
11967 vm.oldField = vm.rule.field;
12155 vm.oldField = vm.rule.field;
11968
12156
11969 vm.add = function () {
12157 vm.add = function () {
11970 vm.rule.rules.push(
12158 vm.rule.rules.push(
11971 {op: "eq", field: 'http_status', value: ""}
12159 {op: "eq", field: 'http_status', value: ""}
11972 );
12160 );
11973 vm.setDirty();
12161 vm.setDirty();
11974 };
12162 };
11975
12163
11976 vm.setDirty = function() {
12164 vm.setDirty = function() {
11977 vm.rule.dirty = true;
12165 vm.rule.dirty = true;
11978
12166
11979 if (vm.parentObj){
12167 if (vm.parentObj){
11980
12168
11981
12169
11982 vm.parentObj.dirty = true;
12170 vm.parentObj.dirty = true;
11983 }
12171 }
11984 };
12172 };
11985
12173
11986 vm.fieldChange = function () {
12174 vm.fieldChange = function () {
11987 var compound_types = ['__AND__', '__OR__', '__NOT__'];
12175 var compound_types = ['__AND__', '__OR__', '__NOT__'];
11988 var new_is_compound = compound_types.indexOf(vm.rule.field) !== -1;
12176 var new_is_compound = compound_types.indexOf(vm.rule.field) !== -1;
11989 var old_was_compound = compound_types.indexOf(vm.oldField) !== -1;
12177 var old_was_compound = compound_types.indexOf(vm.oldField) !== -1;
11990
12178
11991 if (!new_is_compound) {
12179 if (!new_is_compound) {
11992 vm.rule.op = vm.ruleDefinitions.fieldOps[vm.rule.field][0];
12180 vm.rule.op = vm.ruleDefinitions.fieldOps[vm.rule.field][0];
11993 }
12181 }
11994 if ((new_is_compound && !old_was_compound)) {
12182 if ((new_is_compound && !old_was_compound)) {
11995
12183
11996 delete vm.rule.value;
12184 delete vm.rule.value;
11997 vm.rule.rules = [];
12185 vm.rule.rules = [];
11998 vm.add();
12186 vm.add();
11999 }
12187 }
12000 else if (!new_is_compound && old_was_compound) {
12188 else if (!new_is_compound && old_was_compound) {
12001
12189
12002 delete vm.rule.rules;
12190 delete vm.rule.rules;
12003 vm.rule.value = '';
12191 vm.rule.value = '';
12004 }
12192 }
12005 vm.oldField = vm.rule.field;
12193 vm.oldField = vm.rule.field;
12006 vm.setDirty();
12194 vm.setDirty();
12007 };
12195 };
12008
12196
12009 vm.deleteRule = function (parent, rule) {
12197 vm.deleteRule = function (parent, rule) {
12010 parent.rules.splice(parent.rules.indexOf(rule), 1);
12198 parent.rules.splice(parent.rules.indexOf(rule), 1);
12011 vm.setDirty();
12199 vm.setDirty();
12012 }
12200 }
12013 }
12201 }
12014 });
12202 });
12015
12203
12016 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12204 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12017 // #
12205 // #
12018 // # This program is free software: you can redistribute it and/or modify
12206 // # This program is free software: you can redistribute it and/or modify
12019 // # it under the terms of the GNU Affero General Public License, version 3
12207 // # it under the terms of the GNU Affero General Public License, version 3
12020 // # (only), as published by the Free Software Foundation.
12208 // # (only), as published by the Free Software Foundation.
12021 // #
12209 // #
12022 // # This program is distributed in the hope that it will be useful,
12210 // # This program is distributed in the hope that it will be useful,
12023 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12211 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12024 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12212 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12025 // # GNU General Public License for more details.
12213 // # GNU General Public License for more details.
12026 // #
12214 // #
12027 // # You should have received a copy of the GNU Affero General Public License
12215 // # You should have received a copy of the GNU Affero General Public License
12028 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12216 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12029 // #
12217 // #
12030 // # This program is dual-licensed. If you wish to learn more about the
12218 // # This program is dual-licensed. If you wish to learn more about the
12031 // # AppEnlight Enterprise Edition, including its added features, Support
12219 // # AppEnlight Enterprise Edition, including its added features, Support
12032 // # services, and proprietary license terms, please see
12220 // # services, and proprietary license terms, please see
12033 // # https://rhodecode.com/licenses/
12221 // # https://rhodecode.com/licenses/
12034
12222
12035 angular.module('appenlight.directives.smallReportGroupList',[]).
12223 angular.module('appenlight.directives.smallReportGroupList',[]).
12036 directive('smallReportGroupList', [function () {
12224 directive('smallReportGroupList', [function () {
12037 return {
12225 return {
12038 restrict: "A",
12226 restrict: "A",
12039 scope: {
12227 scope: {
12040 groups: '=',
12228 groups: '=',
12041 applications: '='
12229 applications: '='
12042 },
12230 },
12043 templateUrl: 'templates/reports/small_report_group_list.html'
12231 templateUrl: 'templates/reports/small_report_group_list.html'
12044 }
12232 }
12045 }])
12233 }])
12046
12234
12047 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12235 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12048 // #
12236 // #
12049 // # This program is free software: you can redistribute it and/or modify
12237 // # This program is free software: you can redistribute it and/or modify
12050 // # it under the terms of the GNU Affero General Public License, version 3
12238 // # it under the terms of the GNU Affero General Public License, version 3
12051 // # (only), as published by the Free Software Foundation.
12239 // # (only), as published by the Free Software Foundation.
12052 // #
12240 // #
12053 // # This program is distributed in the hope that it will be useful,
12241 // # This program is distributed in the hope that it will be useful,
12054 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12242 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12055 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12243 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12056 // # GNU General Public License for more details.
12244 // # GNU General Public License for more details.
12057 // #
12245 // #
12058 // # You should have received a copy of the GNU Affero General Public License
12246 // # You should have received a copy of the GNU Affero General Public License
12059 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12247 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12060 // #
12248 // #
12061 // # This program is dual-licensed. If you wish to learn more about the
12249 // # This program is dual-licensed. If you wish to learn more about the
12062 // # AppEnlight Enterprise Edition, including its added features, Support
12250 // # AppEnlight Enterprise Edition, including its added features, Support
12063 // # services, and proprietary license terms, please see
12251 // # services, and proprietary license terms, please see
12064 // # https://rhodecode.com/licenses/
12252 // # https://rhodecode.com/licenses/
12065
12253
12066 angular.module('appenlight.directives.smallReportList', []).
12254 angular.module('appenlight.directives.smallReportList', []).
12067 directive('smallReportList', [function () {
12255 directive('smallReportList', [function () {
12068 return {
12256 return {
12069 restrict: "A",
12257 restrict: "A",
12070 scope: {
12258 scope: {
12071 reports: '=',
12259 reports: '=',
12072 applications: '='
12260 applications: '='
12073 },
12261 },
12074 templateUrl: 'templates/reports/small_report_list.html'
12262 templateUrl: 'templates/reports/small_report_list.html'
12075 }
12263 }
12076 }])
12264 }])
12077
12265
12078 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12266 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12079 // #
12267 // #
12080 // # This program is free software: you can redistribute it and/or modify
12268 // # This program is free software: you can redistribute it and/or modify
12081 // # it under the terms of the GNU Affero General Public License, version 3
12269 // # it under the terms of the GNU Affero General Public License, version 3
12082 // # (only), as published by the Free Software Foundation.
12270 // # (only), as published by the Free Software Foundation.
12083 // #
12271 // #
12084 // # This program is distributed in the hope that it will be useful,
12272 // # This program is distributed in the hope that it will be useful,
12085 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12273 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12086 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12274 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12087 // # GNU General Public License for more details.
12275 // # GNU General Public License for more details.
12088 // #
12276 // #
12089 // # You should have received a copy of the GNU Affero General Public License
12277 // # You should have received a copy of the GNU Affero General Public License
12090 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12278 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12091 // #
12279 // #
12092 // # This program is dual-licensed. If you wish to learn more about the
12280 // # This program is dual-licensed. If you wish to learn more about the
12093 // # AppEnlight Enterprise Edition, including its added features, Support
12281 // # AppEnlight Enterprise Edition, including its added features, Support
12094 // # services, and proprietary license terms, please see
12282 // # services, and proprietary license terms, please see
12095 // # https://rhodecode.com/licenses/
12283 // # https://rhodecode.com/licenses/
12096
12284
12097 'use strict';
12285 'use strict';
12098
12286
12099 /* Filters */
12287 /* Filters */
12100
12288
12101 angular.module('appenlight.filters').
12289 angular.module('appenlight.filters').
12102 filter('interpolate', ['version', function (version) {
12290 filter('interpolate', ['version', function (version) {
12103 return function (text) {
12291 return function (text) {
12104 return String(text).replace(/\%VERSION\%/mg, version);
12292 return String(text).replace(/\%VERSION\%/mg, version);
12105 }
12293 }
12106 }])
12294 }])
12107 .filter('isoToRelativeTime', function () {
12295 .filter('isoToRelativeTime', function () {
12108 return function (input) {
12296 return function (input) {
12109 return moment.utc(input).fromNow();
12297 return moment.utc(input).fromNow();
12110 }
12298 }
12111 })
12299 })
12112
12300
12113 .filter('round', function () {
12301 .filter('round', function () {
12114 return function (input, precision) {
12302 return function (input, precision) {
12115 return input.toFixed(precision)
12303 return input.toFixed(precision)
12116 }
12304 }
12117 })
12305 })
12118
12306
12119 .filter('numberToThousands', function () {
12307 .filter('numberToThousands', function () {
12120 return function (input) {
12308 return function (input) {
12121 if (input > 1000000) {
12309 if (input > 1000000) {
12122 var i = input / 1000000;
12310 var i = input / 1000000;
12123 return i.toFixed(1).toString() + 'M'
12311 return i.toFixed(1).toString() + 'M'
12124 }
12312 }
12125 else if (input > 1000) {
12313 else if (input > 1000) {
12126 var i = input / 1000;
12314 var i = input / 1000;
12127 return i.toFixed(1).toString() + 'k'
12315 return i.toFixed(1).toString() + 'k'
12128 }
12316 }
12129 else {
12317 else {
12130 return input;
12318 return input;
12131 }
12319 }
12132 }
12320 }
12133 })
12321 })
12134 .filter('getOrdered', function () {
12322 .filter('getOrdered', function () {
12135 return function (input, filterOn) {
12323 return function (input, filterOn) {
12136 var ordered = {};
12324 var ordered = {};
12137 for (var key in input) {
12325 for (var key in input) {
12138 ordered[input[key][filterOn]] = input[key];
12326 ordered[input[key][filterOn]] = input[key];
12139 }
12327 }
12140 return ordered;
12328 return ordered;
12141 };
12329 };
12142 })
12330 })
12143 .filter('objectToOrderedArray', function(){
12331 .filter('objectToOrderedArray', function(){
12144 return function(items, field, reverse) {
12332 return function(items, field, reverse) {
12145 var filtered = [];
12333 var filtered = [];
12146 angular.forEach(items, function(item) {
12334 angular.forEach(items, function(item) {
12147 filtered.push(item);
12335 filtered.push(item);
12148 });
12336 });
12149 filtered.sort(function (a, b) {
12337 filtered.sort(function (a, b) {
12150 return (a[field] > b[field] ? 1 : -1);
12338 return (a[field] > b[field] ? 1 : -1);
12151 });
12339 });
12152 if(reverse) filtered.reverse();
12340 if(reverse) filtered.reverse();
12153 return filtered;
12341 return filtered;
12154 };
12342 };
12155 })
12343 })
12156 .filter('apdexValue', function () {
12344 .filter('apdexValue', function () {
12157 return function (input) {
12345 return function (input) {
12158 if (input.apdex >= 95) {
12346 if (input.apdex >= 95) {
12159 return 'satisfactory';
12347 return 'satisfactory';
12160 } else if (input.apdex >= 80) {
12348 } else if (input.apdex >= 80) {
12161 return 'tolerating';
12349 return 'tolerating';
12162 } else {
12350 } else {
12163 return 'frustrating';
12351 return 'frustrating';
12164 }
12352 }
12165 };
12353 };
12166 })
12354 })
12167 .filter('truncate', function(){
12355 .filter('truncate', function(){
12168 return function (text, length, end) {
12356 return function (text, length, end) {
12169 if (isNaN(length))
12357 if (isNaN(length))
12170 length = 10;
12358 length = 10;
12171
12359
12172 if (end === undefined)
12360 if (end === undefined)
12173 end = "...";
12361 end = "...";
12174
12362
12175 if (text.length <= length || text.length - end.length <= length) {
12363 if (text.length <= length || text.length - end.length <= length) {
12176 return text;
12364 return text;
12177 }
12365 }
12178 else {
12366 else {
12179 return String(text).substring(0, length-end.length) + end;
12367 return String(text).substring(0, length-end.length) + end;
12180 }
12368 }
12181
12369
12182 };
12370 };
12183 })
12371 })
12184
12372
12185 ;
12373 ;
12186
12374
12187 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12375 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12188 // #
12376 // #
12189 // # This program is free software: you can redistribute it and/or modify
12377 // # This program is free software: you can redistribute it and/or modify
12190 // # it under the terms of the GNU Affero General Public License, version 3
12378 // # it under the terms of the GNU Affero General Public License, version 3
12191 // # (only), as published by the Free Software Foundation.
12379 // # (only), as published by the Free Software Foundation.
12192 // #
12380 // #
12193 // # This program is distributed in the hope that it will be useful,
12381 // # This program is distributed in the hope that it will be useful,
12194 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12382 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12195 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12383 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12196 // # GNU General Public License for more details.
12384 // # GNU General Public License for more details.
12197 // #
12385 // #
12198 // # You should have received a copy of the GNU Affero General Public License
12386 // # You should have received a copy of the GNU Affero General Public License
12199 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12387 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12200 // #
12388 // #
12201 // # This program is dual-licensed. If you wish to learn more about the
12389 // # This program is dual-licensed. If you wish to learn more about the
12202 // # AppEnlight Enterprise Edition, including its added features, Support
12390 // # AppEnlight Enterprise Edition, including its added features, Support
12203 // # services, and proprietary license terms, please see
12391 // # services, and proprietary license terms, please see
12204 // # https://rhodecode.com/licenses/
12392 // # https://rhodecode.com/licenses/
12205
12393
12206 angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
12394 angular.module('appenlight').config(['$stateProvider', '$urlRouterProvider', function ($stateProvider, $urlRouterProvider) {
12207
12395
12208 $urlRouterProvider.otherwise('/ui');
12396 $urlRouterProvider.otherwise('/ui');
12209
12397
12210 $stateProvider.state('logs', {
12398 $stateProvider.state('logs', {
12211 url: '/ui/logs?resource',
12399 url: '/ui/logs?resource',
12212 templateUrl: 'templates/logs.html',
12400 templateUrl: 'templates/logs.html',
12213 controller: 'LogsController as logs'
12401 controller: 'LogsController as logs'
12214 });
12402 });
12215
12403
12216 $stateProvider.state('front_dashboard', {
12404 $stateProvider.state('front_dashboard', {
12217 url: '/ui',
12405 url: '/ui',
12218 templateUrl: 'templates/dashboard.html',
12406 templateUrl: 'templates/dashboard.html',
12219 controller: 'IndexDashboardController as index'
12407 controller: 'IndexDashboardController as index'
12220 });
12408 });
12221
12409
12222 $stateProvider.state('report', {
12410 $stateProvider.state('report', {
12223 abstract: true,
12411 abstract: true,
12224 url: '/ui/report',
12412 url: '/ui/report',
12225 templateUrl: 'templates/reports/parent_view.html'
12413 templateUrl: 'templates/reports/parent_view.html'
12226 });
12414 });
12227
12415
12228 $stateProvider.state('report.list', {
12416 $stateProvider.state('report.list', {
12229 url: '?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
12417 url: '?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
12230 templateUrl: 'templates/reports/list.html',
12418 templateUrl: 'templates/reports/list.html',
12231 controller: 'ReportsListController as reports_list'
12419 controller: 'ReportsListController as reports_list'
12232 });
12420 });
12233
12421
12234 $stateProvider.state('report.list_slow', {
12422 $stateProvider.state('report.list_slow', {
12235 url: '/list_slow?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
12423 url: '/list_slow?start_date&min_duration&max_duration&{view_name:any}&{server_name:any}&resource',
12236 templateUrl: 'templates/reports/list_slow.html',
12424 templateUrl: 'templates/reports/list_slow.html',
12237 controller: 'ReportsListSlowController as reports_list'
12425 controller: 'ReportsListSlowController as reports_list'
12238 });
12426 });
12239
12427
12240 $stateProvider.state('report.view_detail', {
12428 $stateProvider.state('report.view_detail', {
12241 url: '/:groupId/:reportId',
12429 url: '/:groupId/:reportId',
12242 templateUrl: 'templates/reports/view.html',
12430 templateUrl: 'templates/reports/view.html',
12243 controller: 'ReportsViewController as report'
12431 controller: 'ReportsViewController as report'
12244 });
12432 });
12245 $stateProvider.state('report.view_group', {
12433 $stateProvider.state('report.view_group', {
12246 url: '/:groupId',
12434 url: '/:groupId',
12247 templateUrl: 'templates/reports/view.html',
12435 templateUrl: 'templates/reports/view.html',
12248 controller: 'ReportsViewController as report'
12436 controller: 'ReportsViewController as report'
12249 });
12437 });
12250 $stateProvider.state('events', {
12438 $stateProvider.state('events', {
12251 url: '/ui/events',
12439 url: '/ui/events',
12252 templateUrl: 'templates/events.html',
12440 templateUrl: 'templates/events.html',
12253 controller: 'EventsController as events'
12441 controller: 'EventsController as events'
12254 });
12442 });
12255 $stateProvider.state('admin', {
12443 $stateProvider.state('admin', {
12256 url: '/ui/admin',
12444 url: '/ui/admin',
12257 templateUrl: 'templates/admin/parent_view.html'
12445 templateUrl: 'templates/admin/parent_view.html'
12258 });
12446 });
12259 $stateProvider.state('admin.user', {
12447 $stateProvider.state('admin.user', {
12260 abstract: true,
12448 abstract: true,
12261 url: '/user',
12449 url: '/user',
12262 templateUrl: 'templates/admin/users/parent_view.html'
12450 templateUrl: 'templates/admin/users/parent_view.html'
12263 });
12451 });
12264 $stateProvider.state('admin.user.list', {
12452 $stateProvider.state('admin.user.list', {
12265 url: '/list',
12453 url: '/list',
12266 templateUrl: 'templates/admin/users/users_list.html',
12454 templateUrl: 'templates/admin/users/users_list.html',
12267 controller: 'AdminUsersController as users'
12455 controller: 'AdminUsersController as users'
12268 });
12456 });
12269 $stateProvider.state('admin.user.create', {
12457 $stateProvider.state('admin.user.create', {
12270 url: '/create',
12458 url: '/create',
12271 templateUrl: 'templates/admin/users/users_create.html',
12459 templateUrl: 'templates/admin/users/users_create.html',
12272 controller: 'AdminUsersCreateController as user'
12460 controller: 'AdminUsersCreateController as user'
12273 });
12461 });
12274 $stateProvider.state('admin.user.update', {
12462 $stateProvider.state('admin.user.update', {
12275 url: '/{userId}/update',
12463 url: '/{userId}/update',
12276 templateUrl: 'templates/admin/users/users_create.html',
12464 templateUrl: 'templates/admin/users/users_create.html',
12277 controller: 'AdminUsersCreateController as user'
12465 controller: 'AdminUsersCreateController as user'
12278 });
12466 });
12279
12467
12280
12468
12281 $stateProvider.state('admin.group', {
12469 $stateProvider.state('admin.group', {
12282 abstract: true,
12470 abstract: true,
12283 url: '/group',
12471 url: '/group',
12284 templateUrl: 'templates/admin/groups/parent_view.html'
12472 templateUrl: 'templates/admin/groups/parent_view.html'
12285 });
12473 });
12286 $stateProvider.state('admin.group.list', {
12474 $stateProvider.state('admin.group.list', {
12287 url: '/list',
12475 url: '/list',
12288 templateUrl: 'templates/admin/groups/groups_list.html',
12476 templateUrl: 'templates/admin/groups/groups_list.html',
12289 controller: 'AdminGroupsController as groups'
12477 controller: 'AdminGroupsController as groups'
12290 });
12478 });
12291 $stateProvider.state('admin.group.create', {
12479 $stateProvider.state('admin.group.create', {
12292 url: '/create',
12480 url: '/create',
12293 templateUrl: 'templates/admin/groups/groups_create.html',
12481 templateUrl: 'templates/admin/groups/groups_create.html',
12294 controller: 'AdminGroupsCreateController as group'
12482 controller: 'AdminGroupsCreateController as group'
12295 });
12483 });
12296 $stateProvider.state('admin.group.update', {
12484 $stateProvider.state('admin.group.update', {
12297 url: '/{groupId}/update',
12485 url: '/{groupId}/update',
12298 templateUrl: 'templates/admin/groups/groups_create.html',
12486 templateUrl: 'templates/admin/groups/groups_create.html',
12299 controller: 'AdminGroupsCreateController as group'
12487 controller: 'AdminGroupsCreateController as group'
12300 });
12488 });
12301
12489
12302 $stateProvider.state('admin.application', {
12490 $stateProvider.state('admin.application', {
12303 abstract: true,
12491 abstract: true,
12304 url: '/application',
12492 url: '/application',
12305 templateUrl: 'templates/admin/users/parent_view.html'
12493 templateUrl: 'templates/admin/users/parent_view.html'
12306 });
12494 });
12307
12495
12308 $stateProvider.state('admin.application.list', {
12496 $stateProvider.state('admin.application.list', {
12309 url: '/list',
12497 url: '/list',
12310 templateUrl: 'templates/admin/applications/applications_list.html',
12498 templateUrl: 'templates/admin/applications/applications_list.html',
12311 controller: 'AdminApplicationsListController as applications'
12499 controller: 'AdminApplicationsListController as applications'
12312 });
12500 });
12313
12501
12314 $stateProvider.state('admin.partitions', {
12502 $stateProvider.state('admin.partitions', {
12315 url: '/partitions',
12503 url: '/partitions',
12316 templateUrl: 'templates/admin/partitions.html',
12504 templateUrl: 'templates/admin/partitions.html',
12317 controller: 'AdminPartitionsController as partitions'
12505 controller: 'AdminPartitionsController as partitions'
12318 });
12506 });
12319 $stateProvider.state('admin.system', {
12507 $stateProvider.state('admin.system', {
12320 url: '/system',
12508 url: '/system',
12321 templateUrl: 'templates/admin/system.html',
12509 templateUrl: 'templates/admin/system.html',
12322 controller: 'AdminSystemController as system'
12510 controller: 'AdminSystemController as system'
12323 });
12511 });
12324
12512
12325 $stateProvider.state('admin.configs', {
12513 $stateProvider.state('admin.configs', {
12326 abstract: true,
12514 abstract: true,
12327 url: '/configs',
12515 url: '/configs',
12328 templateUrl: 'templates/admin/configs/parent_view.html'
12516 templateUrl: 'templates/admin/configs/parent_view.html'
12329 });
12517 });
12330
12518
12331 $stateProvider.state('admin.configs.list', {
12519 $stateProvider.state('admin.configs.list', {
12332 url: '',
12520 url: '',
12333 templateUrl: 'templates/admin/configs/edit.html',
12521 templateUrl: 'templates/admin/configs/edit.html',
12334 controller: 'ConfigsListController as configs'
12522 controller: 'ConfigsListController as configs'
12335 });
12523 });
12336
12524
12337 $stateProvider.state('user', {
12525 $stateProvider.state('user', {
12338 url: '/ui/user',
12526 url: '/ui/user',
12339 templateUrl: 'templates/user/parent_view.html'
12527 templateUrl: 'templates/user/parent_view.html'
12340 });
12528 });
12341
12529
12342 $stateProvider.state('user.profile', {
12530 $stateProvider.state('user.profile', {
12343 abstract: true,
12531 abstract: true,
12344 url: '/profile',
12532 url: '/profile',
12345 templateUrl: 'templates/user/profile.html'
12533 templateUrl: 'templates/user/profile.html'
12346 });
12534 });
12347 $stateProvider.state('user.profile.edit', {
12535 $stateProvider.state('user.profile.edit', {
12348 url: '',
12536 url: '',
12349 templateUrl: 'templates/user/profile_edit.html',
12537 templateUrl: 'templates/user/profile_edit.html',
12350 controller: 'UserProfileController as profile'
12538 controller: 'UserProfileController as profile'
12351 });
12539 });
12352
12540
12353
12541
12354 $stateProvider.state('user.profile.password', {
12542 $stateProvider.state('user.profile.password', {
12355 url: '/password',
12543 url: '/password',
12356 templateUrl: 'templates/user/profile_password.html',
12544 templateUrl: 'templates/user/profile_password.html',
12357 controller: 'UserPasswordController as password'
12545 controller: 'UserPasswordController as password'
12358 });
12546 });
12359
12547
12360 $stateProvider.state('user.profile.identities', {
12548 $stateProvider.state('user.profile.identities', {
12361 url: '/identities',
12549 url: '/identities',
12362 templateUrl: 'templates/user/profile_identities.html',
12550 templateUrl: 'templates/user/profile_identities.html',
12363 controller: 'UserIdentitiesController as identities'
12551 controller: 'UserIdentitiesController as identities'
12364 });
12552 });
12365
12553
12366 $stateProvider.state('user.profile.auth_tokens', {
12554 $stateProvider.state('user.profile.auth_tokens', {
12367 url: '/auth_tokens',
12555 url: '/auth_tokens',
12368 templateUrl: 'templates/user/auth_tokens.html',
12556 templateUrl: 'templates/user/auth_tokens.html',
12369 controller: 'UserAuthTokensController as auth_tokens'
12557 controller: 'UserAuthTokensController as auth_tokens'
12370 });
12558 });
12371
12559
12372 $stateProvider.state('user.alert_channels', {
12560 $stateProvider.state('user.alert_channels', {
12373 abstract: true,
12561 abstract: true,
12374 url: '/alert_channels',
12562 url: '/alert_channels',
12375 templateUrl: 'templates/user/alert_channels.html'
12563 templateUrl: 'templates/user/alert_channels.html'
12376 });
12564 });
12377
12565
12378 $stateProvider.state('user.alert_channels.list', {
12566 $stateProvider.state('user.alert_channels.list', {
12379 url: '',
12567 url: '',
12380 templateUrl: 'templates/user/alert_channels_list.html',
12568 templateUrl: 'templates/user/alert_channels_list.html',
12381 controller: 'AlertChannelsController as channels'
12569 controller: 'AlertChannelsController as channels'
12382 });
12570 });
12383
12571
12384 $stateProvider.state('user.alert_channels.email', {
12572 $stateProvider.state('user.alert_channels.email', {
12385 url: '/email',
12573 url: '/email',
12386 templateUrl: 'templates/user/alert_channels_email.html',
12574 templateUrl: 'templates/user/alert_channels_email.html',
12387 controller: 'AlertChannelsEmailController as email'
12575 controller: 'AlertChannelsEmailController as email'
12388 });
12576 });
12389
12577
12390 $stateProvider.state('applications', {
12578 $stateProvider.state('applications', {
12391 abstract: true,
12579 abstract: true,
12392 url: '/ui/applications',
12580 url: '/ui/applications',
12393 templateUrl: 'templates/applications/parent_view.html'
12581 templateUrl: 'templates/applications/parent_view.html'
12394 });
12582 });
12395
12583
12396 $stateProvider.state('applications.list', {
12584 $stateProvider.state('applications.list', {
12397 url: '',
12585 url: '',
12398 templateUrl: 'templates/applications/list.html',
12586 templateUrl: 'templates/applications/list.html',
12399 controller: 'ApplicationsListController as applications'
12587 controller: 'ApplicationsListController as applications'
12400 });
12588 });
12401 $stateProvider.state('applications.update', {
12589 $stateProvider.state('applications.update', {
12402 url: '/{resourceId}/update',
12590 url: '/{resourceId}/update',
12403 templateUrl: 'templates/applications/applications_update.html',
12591 templateUrl: 'templates/applications/applications_update.html',
12404 controller: 'ApplicationsUpdateController as application'
12592 controller: 'ApplicationsUpdateController as application'
12405 });
12593 });
12406
12594
12407 $stateProvider.state('applications.integrations', {
12595 $stateProvider.state('applications.integrations', {
12408 url: '/{resourceId}/integrations',
12596 url: '/{resourceId}/integrations',
12409 templateUrl: 'templates/applications/integrations.html',
12597 templateUrl: 'templates/applications/integrations.html',
12410 controller: 'IntegrationsListController as integrations',
12598 controller: 'IntegrationsListController as integrations',
12411 data: {
12599 data: {
12412 resource: null
12600 resource: null
12413 }
12601 }
12414 });
12602 });
12415
12603
12416 $stateProvider.state('applications.purge_logs', {
12604 $stateProvider.state('applications.purge_logs', {
12417 url: '/purge_logs',
12605 url: '/purge_logs',
12418 templateUrl: 'templates/applications/applications_purge_logs.html',
12606 templateUrl: 'templates/applications/applications_purge_logs.html',
12419 controller: 'ApplicationsPurgeLogsController as applications_purge'
12607 controller: 'ApplicationsPurgeLogsController as applications_purge'
12420 });
12608 });
12421
12609
12422 $stateProvider.state('applications.integrations.edit', {
12610 $stateProvider.state('applications.integrations.edit', {
12423 url: '/{integration}',
12611 url: '/{integration}',
12424 templateUrl: function ($stateParams) {
12612 templateUrl: function ($stateParams) {
12425 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
12613 return 'templates/applications/integrations/' + $stateParams.integration + '.html'
12426 },
12614 },
12427 controller: 'IntegrationController as integration'
12615 controller: 'IntegrationController as integration'
12428 });
12616 });
12429
12617
12430 $stateProvider.state('tests', {
12618 $stateProvider.state('tests', {
12431 url: '/ui/tests',
12619 url: '/ui/tests',
12432 templateUrl: 'templates/user/alert_channels_test.html',
12620 templateUrl: 'templates/user/alert_channels_test.html',
12433 controller: 'AlertChannelsTestController as test_action'
12621 controller: 'AlertChannelsTestController as test_action'
12434 });
12622 });
12435
12623
12436 }]);
12624 }]);
12437
12625
12438 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12626 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12439 // #
12627 // #
12440 // # This program is free software: you can redistribute it and/or modify
12628 // # This program is free software: you can redistribute it and/or modify
12441 // # it under the terms of the GNU Affero General Public License, version 3
12629 // # it under the terms of the GNU Affero General Public License, version 3
12442 // # (only), as published by the Free Software Foundation.
12630 // # (only), as published by the Free Software Foundation.
12443 // #
12631 // #
12444 // # This program is distributed in the hope that it will be useful,
12632 // # This program is distributed in the hope that it will be useful,
12445 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12633 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12446 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12634 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12447 // # GNU General Public License for more details.
12635 // # GNU General Public License for more details.
12448 // #
12636 // #
12449 // # You should have received a copy of the GNU Affero General Public License
12637 // # You should have received a copy of the GNU Affero General Public License
12450 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12638 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12451 // #
12639 // #
12452 // # This program is dual-licensed. If you wish to learn more about the
12640 // # This program is dual-licensed. If you wish to learn more about the
12453 // # AppEnlight Enterprise Edition, including its added features, Support
12641 // # AppEnlight Enterprise Edition, including its added features, Support
12454 // # services, and proprietary license terms, please see
12642 // # services, and proprietary license terms, please see
12455 // # https://rhodecode.com/licenses/
12643 // # https://rhodecode.com/licenses/
12456
12644
12457 angular.module('appenlight.services.chartResultParser',[]).factory('chartResultParser', function () {
12645 angular.module('appenlight.services.chartResultParser',[]).factory('chartResultParser', function () {
12458
12646
12459 function transform(data) {
12647 function transform(data) {
12460
12648
12461 /** transform result to a format that is more friendly
12649 /** transform result to a format that is more friendly
12462 * to c3js we don't want to export this way as default
12650 * to c3js we don't want to export this way as default
12463 * as TSV stuff is less readable overall
12651 * as TSV stuff is less readable overall
12464 *
12652 *
12465 * we want format of:
12653 * we want format of:
12466 * {x: [unix_timestamps],
12654 * {x: [unix_timestamps],
12467 * key1: [val,list],
12655 * key1: [val,list],
12468 * key2: [val,list]...}
12656 * key2: [val,list]...}
12469 *
12657 *
12470 * OR
12658 * OR
12471 *
12659 *
12472 * handle special case where we want pie/donut for
12660 * handle special case where we want pie/donut for
12473 * aggregation with a single metric, we need to transform
12661 * aggregation with a single metric, we need to transform
12474 * the data from:
12662 * the data from:
12475 * [y:list, categories:[cat1,cat2,...]]
12663 * [y:list, categories:[cat1,cat2,...]]
12476 * to
12664 * to
12477 * [cat1: val, cat2:val...] format to render properly
12665 * [cat1: val, cat2:val...] format to render properly
12478 */
12666 */
12479 var chartC3Config = {
12667 var chartC3Config = {
12480 data: {
12668 data: {
12481 json: [],
12669 json: [],
12482 type: 'bar'
12670 type: 'bar'
12483 },
12671 },
12484 point: {
12672 point: {
12485 show: false
12673 show: false
12486 },
12674 },
12487 tooltip: {
12675 tooltip: {
12488 format: {
12676 format: {
12489 title: function (d) {
12677 title: function (d) {
12490 if (d) {
12678 if (d) {
12491 return '' + d;
12679 return '' + d;
12492 }
12680 }
12493 return '';
12681 return '';
12494 },
12682 },
12495 value: function (value, ratio, id, index) {
12683 value: function (value, ratio, id, index) {
12496 return d3.round(value, 3);
12684 return d3.round(value, 3);
12497 }
12685 }
12498 }
12686 }
12499 },
12687 },
12500 regions: data.rect_regions
12688 regions: data.rect_regions
12501 };
12689 };
12502 var labels = _.keys(data.system_labels);
12690 var labels = _.keys(data.system_labels);
12503 var specialCases = ['pie', 'donut', 'gauge'];
12691 var specialCases = ['pie', 'donut', 'gauge'];
12504 if (labels.length === 1 && _.contains(specialCases,
12692 if (labels.length === 1 && _.contains(specialCases,
12505 data.chart_type.type)) {
12693 data.chart_type.type)) {
12506 var transformedData = {};
12694 var transformedData = {};
12507
12695
12508 _.each(data.series, function (item) {
12696 _.each(data.series, function (item) {
12509 transformedData[item['key']] = item[labels[0]];
12697 transformedData[item['key']] = item[labels[0]];
12510 });
12698 });
12511 }
12699 }
12512 else {
12700 else {
12513 var transformedData = {'key': []};
12701 var transformedData = {'key': []};
12514
12702
12515 _.each(labels, function (label) {
12703 _.each(labels, function (label) {
12516 transformedData[label] = [];
12704 transformedData[label] = [];
12517 });
12705 });
12518
12706
12519 _.each(data.series, function (item) {
12707 _.each(data.series, function (item) {
12520 for (key in item) {
12708 for (key in item) {
12521 transformedData[key].push(item[key])
12709 transformedData[key].push(item[key])
12522 }
12710 }
12523 });
12711 });
12524 }
12712 }
12525
12713
12526
12714
12527 if (data.parent_agg.type === 'time_histogram') {
12715 if (data.parent_agg.type === 'time_histogram') {
12528 chartC3Config.axis = {
12716 chartC3Config.axis = {
12529 x: {
12717 x: {
12530 type: 'timeseries',
12718 type: 'timeseries',
12531 tick: {
12719 tick: {
12532 format: '%Y-%m-%d'
12720 format: '%Y-%m-%d'
12533 }
12721 }
12534 }
12722 }
12535 };
12723 };
12536 chartC3Config.data.xFormat = '%Y-%m-%dT%H:%M:%S';
12724 chartC3Config.data.xFormat = '%Y-%m-%dT%H:%M:%S';
12537 }
12725 }
12538 else if (data.categories) {
12726 else if (data.categories) {
12539 chartC3Config.axis = {
12727 chartC3Config.axis = {
12540 x: {
12728 x: {
12541 type: 'category',
12729 type: 'category',
12542 categories: data.categories
12730 categories: data.categories
12543 }
12731 }
12544 };
12732 };
12545 // we don't want to show key as label if it is being
12733 // we don't want to show key as label if it is being
12546 // used as a category instead
12734 // used as a category instead
12547 if (data.categories) {
12735 if (data.categories) {
12548 delete transformedData['key'];
12736 delete transformedData['key'];
12549 }
12737 }
12550 }
12738 }
12551
12739
12552 var human_labels = {};
12740 var human_labels = {};
12553 _.each(_.pairs(data.system_labels), function(entry){
12741 _.each(_.pairs(data.system_labels), function(entry){
12554 human_labels[entry[0]] = entry[1].human_label;
12742 human_labels[entry[0]] = entry[1].human_label;
12555 });
12743 });
12556 var chartC3Data = {
12744 var chartC3Data = {
12557 json: transformedData,
12745 json: transformedData,
12558 names: human_labels,
12746 names: human_labels,
12559 groups: data.groups,
12747 groups: data.groups,
12560 type: data.chart_type.type
12748 type: data.chart_type.type
12561 };
12749 };
12562
12750
12563 if (data.parent_agg.type == 'time_histogram') {
12751 if (data.parent_agg.type == 'time_histogram') {
12564 chartC3Data.x = 'key';
12752 chartC3Data.x = 'key';
12565 }
12753 }
12566 return {chartC3Data: chartC3Data, chartC3Config: chartC3Config}
12754 return {chartC3Data: chartC3Data, chartC3Config: chartC3Config}
12567 }
12755 }
12568
12756
12569 return transform
12757 return transform
12570 });
12758 });
12571
12759
12572 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12760 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12573 // #
12761 // #
12574 // # This program is free software: you can redistribute it and/or modify
12762 // # This program is free software: you can redistribute it and/or modify
12575 // # it under the terms of the GNU Affero General Public License, version 3
12763 // # it under the terms of the GNU Affero General Public License, version 3
12576 // # (only), as published by the Free Software Foundation.
12764 // # (only), as published by the Free Software Foundation.
12577 // #
12765 // #
12578 // # This program is distributed in the hope that it will be useful,
12766 // # This program is distributed in the hope that it will be useful,
12579 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12767 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12580 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12768 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12581 // # GNU General Public License for more details.
12769 // # GNU General Public License for more details.
12582 // #
12770 // #
12583 // # You should have received a copy of the GNU Affero General Public License
12771 // # You should have received a copy of the GNU Affero General Public License
12584 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12772 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12585 // #
12773 // #
12586 // # This program is dual-licensed. If you wish to learn more about the
12774 // # This program is dual-licensed. If you wish to learn more about the
12587 // # AppEnlight Enterprise Edition, including its added features, Support
12775 // # AppEnlight Enterprise Edition, including its added features, Support
12588 // # services, and proprietary license terms, please see
12776 // # services, and proprietary license terms, please see
12589 // # https://rhodecode.com/licenses/
12777 // # https://rhodecode.com/licenses/
12590
12778
12591 var DEFAULT_ACTIONS = {
12779 var DEFAULT_ACTIONS = {
12592 'get': {method: 'GET', timeout: 60000 * 2},
12780 'get': {method: 'GET', timeout: 60000 * 2},
12593 'save': {method: 'POST', timeout: 60000 * 2},
12781 'save': {method: 'POST', timeout: 60000 * 2},
12594 'query': {method: 'GET', isArray: true, timeout: 60000 * 2},
12782 'query': {method: 'GET', isArray: true, timeout: 60000 * 2},
12595 'remove': {method: 'DELETE', timeout: 30000},
12783 'remove': {method: 'DELETE', timeout: 30000},
12596 'update': {method: 'PATCH', timeout: 30000},
12784 'update': {method: 'PATCH', timeout: 30000},
12597 'delete': {method: 'DELETE', timeout: 30000}
12785 'delete': {method: 'DELETE', timeout: 30000}
12598 };
12786 };
12599
12787
12600 angular.module('appenlight.services.resources', []).factory('usersResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12788 angular.module('appenlight.services.resources', []).factory('usersResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12601 return $resource(AeConfig.urls.users, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12789 return $resource(AeConfig.urls.users, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12602 }]);
12790 }]);
12603
12791
12604 angular.module('appenlight.services.resources').factory('userResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12792 angular.module('appenlight.services.resources').factory('userResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12605 return $resource(AeConfig.urls.user, null, angular.copy(DEFAULT_ACTIONS));
12793 return $resource(AeConfig.urls.user, null, angular.copy(DEFAULT_ACTIONS));
12606 }]);
12794 }]);
12607
12795
12608 angular.module('appenlight.services.resources').factory('usersPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12796 angular.module('appenlight.services.resources').factory('usersPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12609 return $resource(AeConfig.urls.usersProperty, null, angular.copy(DEFAULT_ACTIONS));
12797 return $resource(AeConfig.urls.usersProperty, null, angular.copy(DEFAULT_ACTIONS));
12610 }]);
12798 }]);
12611
12799
12612 angular.module('appenlight.services.resources').factory('userSelfResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12800 angular.module('appenlight.services.resources').factory('userSelfResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12613 return $resource(AeConfig.urls.userSelf, null, angular.copy(DEFAULT_ACTIONS));
12801 return $resource(AeConfig.urls.userSelf, null, angular.copy(DEFAULT_ACTIONS));
12614 }]);
12802 }]);
12615
12803
12616 angular.module('appenlight.services.resources').factory('userSelfPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12804 angular.module('appenlight.services.resources').factory('userSelfPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12617 return $resource(AeConfig.urls.userSelfProperty, null, angular.copy(DEFAULT_ACTIONS));
12805 return $resource(AeConfig.urls.userSelfProperty, null, angular.copy(DEFAULT_ACTIONS));
12618 }]);
12806 }]);
12619
12807
12620 angular.module('appenlight.services.resources').factory('logsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12808 angular.module('appenlight.services.resources').factory('logsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12621 return $resource(AeConfig.urls.logsNoId, null, angular.copy(DEFAULT_ACTIONS));
12809 return $resource(AeConfig.urls.logsNoId, null, angular.copy(DEFAULT_ACTIONS));
12622 }]);
12810 }]);
12623
12811
12624 angular.module('appenlight.services.resources').factory('reportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12812 angular.module('appenlight.services.resources').factory('reportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12625 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12813 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12626 }]);
12814 }]);
12627
12815
12628 angular.module('appenlight.services.resources').factory('slowReportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12816 angular.module('appenlight.services.resources').factory('slowReportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12629 return $resource(AeConfig.urls.slowReports, null, angular.copy(DEFAULT_ACTIONS));
12817 return $resource(AeConfig.urls.slowReports, null, angular.copy(DEFAULT_ACTIONS));
12630 }]);
12818 }]);
12631
12819
12632 angular.module('appenlight.services.resources').factory('reportGroupResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12820 angular.module('appenlight.services.resources').factory('reportGroupResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12633 return $resource(AeConfig.urls.reportGroup, null, angular.copy(DEFAULT_ACTIONS));
12821 return $resource(AeConfig.urls.reportGroup, null, angular.copy(DEFAULT_ACTIONS));
12634 }]);
12822 }]);
12635
12823
12636 angular.module('appenlight.services.resources').factory('reportGroupPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12824 angular.module('appenlight.services.resources').factory('reportGroupPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12637 return $resource(AeConfig.urls.reportGroupProperty, null, angular.copy(DEFAULT_ACTIONS));
12825 return $resource(AeConfig.urls.reportGroupProperty, null, angular.copy(DEFAULT_ACTIONS));
12638 }]);
12826 }]);
12639
12827
12640
12828
12641 angular.module('appenlight.services.resources').factory('reportResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12829 angular.module('appenlight.services.resources').factory('reportResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12642 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12830 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12643 }]);
12831 }]);
12644
12832
12645 angular.module('appenlight.services.resources').factory('analyticsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12833 angular.module('appenlight.services.resources').factory('analyticsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12646 return $resource(AeConfig.urls.analyticsAction, null, angular.copy(DEFAULT_ACTIONS));
12834 return $resource(AeConfig.urls.analyticsAction, null, angular.copy(DEFAULT_ACTIONS));
12647 }]);
12835 }]);
12648
12836
12649 angular.module('appenlight.services.resources').factory('reportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12837 angular.module('appenlight.services.resources').factory('reportsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12650 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12838 return $resource(AeConfig.urls.reports, null, angular.copy(DEFAULT_ACTIONS));
12651 }]);
12839 }]);
12652
12840
12653 angular.module('appenlight.services.resources').factory('integrationResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12841 angular.module('appenlight.services.resources').factory('integrationResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12654 return $resource(AeConfig.urls.integrationAction, null, angular.copy(DEFAULT_ACTIONS));
12842 return $resource(AeConfig.urls.integrationAction, null, angular.copy(DEFAULT_ACTIONS));
12655 }]);
12843 }]);
12656
12844
12657
12845
12658 angular.module('appenlight.services.resources').factory('adminResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12846 angular.module('appenlight.services.resources').factory('adminResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12659 return $resource(AeConfig.urls.adminAction, null, angular.copy(DEFAULT_ACTIONS));
12847 return $resource(AeConfig.urls.adminAction, null, angular.copy(DEFAULT_ACTIONS));
12660 }]);
12848 }]);
12661
12849
12662 angular.module('appenlight.services.resources').factory('applicationsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12850 angular.module('appenlight.services.resources').factory('applicationsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12663 return $resource(AeConfig.urls.applicationsNoId, null, angular.copy(DEFAULT_ACTIONS));
12851 return $resource(AeConfig.urls.applicationsNoId, null, angular.copy(DEFAULT_ACTIONS));
12664 }]);
12852 }]);
12665
12853
12666 angular.module('appenlight.services.resources').factory('applicationsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12854 angular.module('appenlight.services.resources').factory('applicationsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12667 return $resource(AeConfig.urls.applicationsProperty, null, angular.copy(DEFAULT_ACTIONS));
12855 return $resource(AeConfig.urls.applicationsProperty, null, angular.copy(DEFAULT_ACTIONS));
12668 }]);
12856 }]);
12669 angular.module('appenlight.services.resources').factory('applicationsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12857 angular.module('appenlight.services.resources').factory('applicationsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12670 return $resource(AeConfig.urls.applications, null, angular.copy(DEFAULT_ACTIONS));
12858 return $resource(AeConfig.urls.applications, null, angular.copy(DEFAULT_ACTIONS));
12671 }]);
12859 }]);
12672
12860
12673 angular.module('appenlight.services.resources').factory('sectionViewResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12861 angular.module('appenlight.services.resources').factory('sectionViewResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12674 return $resource(AeConfig.urls.sectionView, null, angular.copy(DEFAULT_ACTIONS));
12862 return $resource(AeConfig.urls.sectionView, null, angular.copy(DEFAULT_ACTIONS));
12675 }]);
12863 }]);
12676
12864
12677 angular.module('appenlight.services.resources').factory('groupsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12865 angular.module('appenlight.services.resources').factory('groupsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12678 return $resource(AeConfig.urls.groupsNoId, null, angular.copy(DEFAULT_ACTIONS));
12866 return $resource(AeConfig.urls.groupsNoId, null, angular.copy(DEFAULT_ACTIONS));
12679 }]);
12867 }]);
12680
12868
12681
12869
12682 angular.module('appenlight.services.resources').factory('groupsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12870 angular.module('appenlight.services.resources').factory('groupsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12683 return $resource(AeConfig.urls.groups, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12871 return $resource(AeConfig.urls.groups, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12684 }]);
12872 }]);
12685
12873
12686 angular.module('appenlight.services.resources').factory('groupsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12874 angular.module('appenlight.services.resources').factory('groupsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12687 return $resource(AeConfig.urls.groupsProperty, null, angular.copy(DEFAULT_ACTIONS));
12875 return $resource(AeConfig.urls.groupsProperty, null, angular.copy(DEFAULT_ACTIONS));
12688 }]);
12876 }]);
12689
12877
12690
12878
12691 angular.module('appenlight.services.resources').factory('eventsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12879 angular.module('appenlight.services.resources').factory('eventsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12692 return $resource(AeConfig.urls.eventsNoId, null, angular.copy(DEFAULT_ACTIONS));
12880 return $resource(AeConfig.urls.eventsNoId, null, angular.copy(DEFAULT_ACTIONS));
12693 }]);
12881 }]);
12694
12882
12695
12883
12696 angular.module('appenlight.services.resources').factory('eventsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12884 angular.module('appenlight.services.resources').factory('eventsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12697 return $resource(AeConfig.urls.events, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12885 return $resource(AeConfig.urls.events, {userId: '@id'}, angular.copy(DEFAULT_ACTIONS));
12698 }]);
12886 }]);
12699
12887
12700 angular.module('appenlight.services.resources').factory('eventsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12888 angular.module('appenlight.services.resources').factory('eventsPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12701 return $resource(AeConfig.urls.eventsProperty, null, angular.copy(DEFAULT_ACTIONS));
12889 return $resource(AeConfig.urls.eventsProperty, null, angular.copy(DEFAULT_ACTIONS));
12702 }]);
12890 }]);
12703
12891
12704 angular.module('appenlight.services.resources').factory('configsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12892 angular.module('appenlight.services.resources').factory('configsNoIdResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12705 return $resource(AeConfig.urls.configsNoId, null, angular.copy(DEFAULT_ACTIONS));
12893 return $resource(AeConfig.urls.configsNoId, null, angular.copy(DEFAULT_ACTIONS));
12706 }]);
12894 }]);
12707
12895
12708 angular.module('appenlight.services.resources').factory('configsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12896 angular.module('appenlight.services.resources').factory('configsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12709 return $resource(AeConfig.urls.configs, {
12897 return $resource(AeConfig.urls.configs, {
12710 key: '@key',
12898 key: '@key',
12711 section: '@section'
12899 section: '@section'
12712 }, angular.copy(DEFAULT_ACTIONS));
12900 }, angular.copy(DEFAULT_ACTIONS));
12713 }]);
12901 }]);
12714
12902
12715 angular.module('appenlight.services.resources').factory('pluginConfigsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12903 angular.module('appenlight.services.resources').factory('pluginConfigsResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12716 return $resource(AeConfig.urls.pluginConfigs, {
12904 return $resource(AeConfig.urls.pluginConfigs, {
12717 id: '@id',
12905 id: '@id',
12718 plugin_name: '@plugin_name'
12906 plugin_name: '@plugin_name'
12719 }, angular.copy(DEFAULT_ACTIONS));
12907 }, angular.copy(DEFAULT_ACTIONS));
12720 }]);
12908 }]);
12721
12909
12722 angular.module('appenlight.services.resources').factory('resourcesPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12910 angular.module('appenlight.services.resources').factory('resourcesPropertyResource', ['$resource', 'AeConfig', function ($resource, AeConfig) {
12723 return $resource(AeConfig.urls.resourceProperty, null, angular.copy(DEFAULT_ACTIONS));
12911 return $resource(AeConfig.urls.resourceProperty, null, angular.copy(DEFAULT_ACTIONS));
12724 }]);
12912 }]);
12725
12913
12726 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12914 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12727 // #
12915 // #
12728 // # This program is free software: you can redistribute it and/or modify
12916 // # This program is free software: you can redistribute it and/or modify
12729 // # it under the terms of the GNU Affero General Public License, version 3
12917 // # it under the terms of the GNU Affero General Public License, version 3
12730 // # (only), as published by the Free Software Foundation.
12918 // # (only), as published by the Free Software Foundation.
12731 // #
12919 // #
12732 // # This program is distributed in the hope that it will be useful,
12920 // # This program is distributed in the hope that it will be useful,
12733 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12921 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12734 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12922 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12735 // # GNU General Public License for more details.
12923 // # GNU General Public License for more details.
12736 // #
12924 // #
12737 // # You should have received a copy of the GNU Affero General Public License
12925 // # You should have received a copy of the GNU Affero General Public License
12738 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12926 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12739 // #
12927 // #
12740 // # This program is dual-licensed. If you wish to learn more about the
12928 // # This program is dual-licensed. If you wish to learn more about the
12741 // # AppEnlight Enterprise Edition, including its added features, Support
12929 // # AppEnlight Enterprise Edition, including its added features, Support
12742 // # services, and proprietary license terms, please see
12930 // # services, and proprietary license terms, please see
12743 // # https://rhodecode.com/licenses/
12931 // # https://rhodecode.com/licenses/
12744
12932
12745 angular.module('appenlight.services.stateHolder', []).factory('stateHolder',
12933 angular.module('appenlight.services.stateHolder', []).factory('stateHolder',
12746 ['$timeout', 'AeConfig', function ($timeout, AeConfig) {
12934 ['$timeout', 'AeConfig', function ($timeout, AeConfig) {
12747
12935
12748 var AeUser = {"user_name": null, "id": null};
12936 var AeUser = {"user_name": null, "id": null};
12749 AeUser.update = function (jsonData) {
12937 AeUser.update = function (jsonData) {
12750 jsonData = jsonData || {};
12938 jsonData = jsonData || {};
12751 this.applications_map = {};
12939 this.applications_map = {};
12752 this.dashboards_map = {};
12940 this.dashboards_map = {};
12753 this.user_name = jsonData.user_name || null;
12941 this.user_name = jsonData.user_name || null;
12754 this.id = jsonData.id;
12942 this.id = jsonData.id;
12755 this.assigned_reports = jsonData.assigned_reports || null;
12943 this.assigned_reports = jsonData.assigned_reports || null;
12756 this.latest_events = jsonData.latest_events || null;
12944 this.latest_events = jsonData.latest_events || null;
12757 this.permissions = jsonData.permissions || null;
12945 this.permissions = jsonData.permissions || null;
12758 this.groups = jsonData.groups || null;
12946 this.groups = jsonData.groups || null;
12759 this.applications = [];
12947 this.applications = [];
12760 this.dashboards = [];
12948 this.dashboards = [];
12761 _.each(jsonData.applications, function (item) {
12949 _.each(jsonData.applications, function (item) {
12762 this.addApplication(item);
12950 this.addApplication(item);
12763 }.bind(this));
12951 }.bind(this));
12764 _.each(jsonData.dashboards, function (item) {
12952 _.each(jsonData.dashboards, function (item) {
12765 this.addDashboard(item);
12953 this.addDashboard(item);
12766 }.bind(this));
12954 }.bind(this));
12767 };
12955 };
12768 AeUser.addApplication = function (item) {
12956 AeUser.addApplication = function (item) {
12769 this.applications.push(item);
12957 this.applications.push(item);
12770 this.applications_map[item.resource_id] = item;
12958 this.applications_map[item.resource_id] = item;
12771 };
12959 };
12772 AeUser.addDashboard = function (item) {
12960 AeUser.addDashboard = function (item) {
12773 this.dashboards.push(item);
12961 this.dashboards.push(item);
12774 this.dashboards_map[item.resource_id] = item;
12962 this.dashboards_map[item.resource_id] = item;
12775 };
12963 };
12776
12964
12777 AeUser.removeApplicationById = function (applicationId) {
12965 AeUser.removeApplicationById = function (applicationId) {
12778 this.applications = _.filter(this.applications, function (item) {
12966 this.applications = _.filter(this.applications, function (item) {
12779 return item.resource_id != applicationId;
12967 return item.resource_id != applicationId;
12780 });
12968 });
12781 delete this.applications_map[applicationId];
12969 delete this.applications_map[applicationId];
12782 };
12970 };
12783 AeUser.removeDashboardById = function (dashboardId) {
12971 AeUser.removeDashboardById = function (dashboardId) {
12784 this.dashboards = _.filter(this.dashboards, function (item) {
12972 this.dashboards = _.filter(this.dashboards, function (item) {
12785 return item.resource_id != dashboardId;
12973 return item.resource_id != dashboardId;
12786 });
12974 });
12787 delete this.dashboards_map[dashboardId];
12975 delete this.dashboards_map[dashboardId];
12788 };
12976 };
12789
12977
12790 AeUser.hasAppPermission = function (perm_name) {
12978 AeUser.hasAppPermission = function (perm_name) {
12791 if (this.permissions.indexOf('root_administration') !== -1) {
12979 if (this.permissions.indexOf('root_administration') !== -1) {
12792 return true
12980 return true
12793 }
12981 }
12794 return this.permissions.indexOf(perm_name) !== -1;
12982 return this.permissions.indexOf(perm_name) !== -1;
12795 };
12983 };
12796
12984
12797 AeUser.hasContextPermission = function (permName, ACLList) {
12985 AeUser.hasContextPermission = function (permName, ACLList) {
12798 var hasPerm = false;
12986 var hasPerm = false;
12799 _.each(ACLList, function (ACL) {
12987 _.each(ACLList, function (ACL) {
12800 // is this the right perm?
12988 // is this the right perm?
12801 if (ACL.perm_name == permName ||
12989 if (ACL.perm_name == permName ||
12802 ACL.perm_name == '__all_permissions__') {
12990 ACL.perm_name == '__all_permissions__') {
12803 // perm for this user or a group user belongs to
12991 // perm for this user or a group user belongs to
12804 if (ACL.user_name === this.user_name ||
12992 if (ACL.user_name === this.user_name ||
12805 this.groups.indexOf(ACL.group_name) !== -1) {
12993 this.groups.indexOf(ACL.group_name) !== -1) {
12806 hasPerm = true
12994 hasPerm = true
12807 }
12995 }
12808 }
12996 }
12809 }.bind(this));
12997 }.bind(this));
12810
12998
12811 return hasPerm;
12999 return hasPerm;
12812 };
13000 };
12813
13001
12814 /**
13002 /**
12815 * Holds some common stuff like flash messages, but important part is
13003 * Holds some common stuff like flash messages, but important part is
12816 * plugins property that is a registry that holds all information about
13004 * plugins property that is a registry that holds all information about
12817 * loaded plugins, its mutated via .run() functions on inclusion
13005 * loaded plugins, its mutated via .run() functions on inclusion
12818 * @type {{list: Array, timeout: null, extend: flashMessages.extend, pop: flashMessages.pop, cancelTimeout: flashMessages.cancelTimeout, removeMessages: flashMessages.removeMessages}}
13006 * @type {{list: Array, timeout: null, extend: flashMessages.extend, pop: flashMessages.pop, cancelTimeout: flashMessages.cancelTimeout, removeMessages: flashMessages.removeMessages}}
12819 */
13007 */
12820 var flashMessages = {
13008 var flashMessages = {
12821 list: [],
13009 list: [],
12822 timeout: null,
13010 timeout: null,
12823 extend: function (values) {
13011 extend: function (values) {
12824
13012
12825 if (this.list.length > 2) {
13013 if (this.list.length > 2) {
12826 this.list.splice(0, this.list.length - 2);
13014 this.list.splice(0, this.list.length - 2);
12827 }
13015 }
12828 this.list.push.apply(this.list, values);
13016 this.list.push.apply(this.list, values);
12829 this.cancelTimeout();
13017 this.cancelTimeout();
12830 this.removeMessages();
13018 this.removeMessages();
12831 },
13019 },
12832 pop: function () {
13020 pop: function () {
12833
13021
12834 this.list.pop();
13022 this.list.pop();
12835 },
13023 },
12836 cancelTimeout: function () {
13024 cancelTimeout: function () {
12837 if (this.timeout) {
13025 if (this.timeout) {
12838 $timeout.cancel(this.timeout);
13026 $timeout.cancel(this.timeout);
12839 }
13027 }
12840 },
13028 },
12841 removeMessages: function () {
13029 removeMessages: function () {
12842 var self = this;
13030 var self = this;
12843 this.timeout = $timeout(function () {
13031 this.timeout = $timeout(function () {
12844 while (self.list.length > 0) {
13032 while (self.list.length > 0) {
12845 self.list.pop();
13033 self.list.pop();
12846 }
13034 }
12847 }, 10000);
13035 }, 10000);
12848 }
13036 }
12849 };
13037 };
12850 flashMessages.closeAlert = angular.bind(flashMessages, function (index) {
13038 flashMessages.closeAlert = angular.bind(flashMessages, function (index) {
12851 this.list.splice(index, 1);
13039 this.list.splice(index, 1);
12852 this.cancelTimeout();
13040 this.cancelTimeout();
12853 });
13041 });
12854 /* add flash messages from template generated on non-xhr request level */
13042 /* add flash messages from template generated on non-xhr request level */
12855 try {
13043 try {
12856 if (AeConfig.flashMessages.length > 0) {
13044 if (AeConfig.flashMessages.length > 0) {
12857 flashMessages.list = AeConfig.flashMessages;
13045 flashMessages.list = AeConfig.flashMessages;
12858 }
13046 }
12859 }
13047 }
12860 catch (exc) {
13048 catch (exc) {
12861
13049
12862 }
13050 }
12863
13051
12864 var Plugins = {
13052 var Plugins = {
12865 enabled: [],
13053 enabled: [],
12866 configs: {},
13054 configs: {},
12867 inclusions: {},
13055 inclusions: {},
12868 addInclusion: function (name, inclusion) {
13056 addInclusion: function (name, inclusion) {
12869 var self = this;
13057 var self = this;
12870 if (self.inclusions.hasOwnProperty(name) === false) {
13058 if (self.inclusions.hasOwnProperty(name) === false) {
12871 self.inclusions[name] = [];
13059 self.inclusions[name] = [];
12872 }
13060 }
12873 self.inclusions[name].push(inclusion);
13061 self.inclusions[name].push(inclusion);
12874 }
13062 }
12875 };
13063 };
12876
13064
12877 var stateHolder = {
13065 var stateHolder = {
12878 section: 'settings',
13066 section: 'settings',
12879 resource: null,
13067 resource: null,
12880 plugins: Plugins,
13068 plugins: Plugins,
12881 flashMessages: flashMessages,
13069 flashMessages: flashMessages,
12882 AeUser: AeUser
13070 AeUser: AeUser,
13071 AeConfig: AeConfig
12883 };
13072 };
12884 return stateHolder;
13073 return stateHolder;
12885 }]);
13074 }]);
12886
13075
12887 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
13076 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12888 // #
13077 // #
12889 // # This program is free software: you can redistribute it and/or modify
13078 // # This program is free software: you can redistribute it and/or modify
12890 // # it under the terms of the GNU Affero General Public License, version 3
13079 // # it under the terms of the GNU Affero General Public License, version 3
12891 // # (only), as published by the Free Software Foundation.
13080 // # (only), as published by the Free Software Foundation.
12892 // #
13081 // #
12893 // # This program is distributed in the hope that it will be useful,
13082 // # This program is distributed in the hope that it will be useful,
12894 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
13083 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12895 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13084 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12896 // # GNU General Public License for more details.
13085 // # GNU General Public License for more details.
12897 // #
13086 // #
12898 // # You should have received a copy of the GNU Affero General Public License
13087 // # You should have received a copy of the GNU Affero General Public License
12899 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13088 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12900 // #
13089 // #
12901 // # This program is dual-licensed. If you wish to learn more about the
13090 // # This program is dual-licensed. If you wish to learn more about the
12902 // # AppEnlight Enterprise Edition, including its added features, Support
13091 // # AppEnlight Enterprise Edition, including its added features, Support
12903 // # services, and proprietary license terms, please see
13092 // # services, and proprietary license terms, please see
12904 // # https://rhodecode.com/licenses/
13093 // # https://rhodecode.com/licenses/
12905
13094
12906 angular.module('appenlight.services.typeAheadTagHelper', []).factory('typeAheadTagHelper', function () {
13095 angular.module('appenlight.services.typeAheadTagHelper', []).factory('typeAheadTagHelper', function () {
12907 var typeAheadTagHelper = {tags: []};
13096 var typeAheadTagHelper = {tags: []};
12908 typeAheadTagHelper.aheadFilter = function (item, viewValue) {
13097 typeAheadTagHelper.aheadFilter = function (item, viewValue) {
12909 //dont show "deeper" autocomplete like level:foo with exception of application ones
13098 //dont show "deeper" autocomplete like level:foo with exception of application ones
12910 var label_text = item.text || item;
13099 var label_text = item.text || item;
12911 if (label_text.charAt(label_text.length - 1) != ':' && viewValue.indexOf(':') === -1 && label_text.indexOf('resource:') !== 0) {
13100 if (label_text.charAt(label_text.length - 1) != ':' && viewValue.indexOf(':') === -1 && label_text.indexOf('resource:') !== 0) {
12912 return false;
13101 return false;
12913 }
13102 }
12914 if (viewValue.length > 2) {
13103 if (viewValue.length > 2) {
12915 // with apps we need to do it differently
13104 // with apps we need to do it differently
12916 if (viewValue.toLowerCase().indexOf('resource:') == 0) {
13105 if (viewValue.toLowerCase().indexOf('resource:') == 0) {
12917 viewValue = viewValue.split(':').pop();
13106 viewValue = viewValue.split(':').pop();
12918 }
13107 }
12919 // check if tags match
13108 // check if tags match
12920 if (label_text.toLowerCase().indexOf(viewValue.toLowerCase()) === -1) {
13109 if (label_text.toLowerCase().indexOf(viewValue.toLowerCase()) === -1) {
12921 return false;
13110 return false;
12922 }
13111 }
12923 }
13112 }
12924 return true;
13113 return true;
12925 };
13114 };
12926 typeAheadTagHelper.removeSearchTag = function (tag) {
13115 typeAheadTagHelper.removeSearchTag = function (tag) {
12927
13116
12928 var indexValue = _.indexOf(typeAheadTagHelper.tags, tag);
13117 var indexValue = _.indexOf(typeAheadTagHelper.tags, tag);
12929 typeAheadTagHelper.tags.splice(indexValue, 1);
13118 typeAheadTagHelper.tags.splice(indexValue, 1);
12930
13119
12931 };
13120 };
12932 typeAheadTagHelper.addSearchTag = function (tag) {
13121 typeAheadTagHelper.addSearchTag = function (tag) {
12933 // do not allow dupes - angular will complain
13122 // do not allow dupes - angular will complain
12934 var found = _.find(typeAheadTagHelper.tags, function (existingTag) {
13123 var found = _.find(typeAheadTagHelper.tags, function (existingTag) {
12935 return existingTag.type == tag.type && existingTag.value == tag.value
13124 return existingTag.type == tag.type && existingTag.value == tag.value
12936 });
13125 });
12937 if (!found) {
13126 if (!found) {
12938 typeAheadTagHelper.tags.push(tag);
13127 typeAheadTagHelper.tags.push(tag);
12939 }
13128 }
12940 };
13129 };
12941
13130
12942 return typeAheadTagHelper;
13131 return typeAheadTagHelper;
12943 });
13132 });
12944
13133
12945 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
13134 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12946 // #
13135 // #
12947 // # This program is free software: you can redistribute it and/or modify
13136 // # This program is free software: you can redistribute it and/or modify
12948 // # it under the terms of the GNU Affero General Public License, version 3
13137 // # it under the terms of the GNU Affero General Public License, version 3
12949 // # (only), as published by the Free Software Foundation.
13138 // # (only), as published by the Free Software Foundation.
12950 // #
13139 // #
12951 // # This program is distributed in the hope that it will be useful,
13140 // # This program is distributed in the hope that it will be useful,
12952 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
13141 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12953 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13142 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12954 // # GNU General Public License for more details.
13143 // # GNU General Public License for more details.
12955 // #
13144 // #
12956 // # You should have received a copy of the GNU Affero General Public License
13145 // # You should have received a copy of the GNU Affero General Public License
12957 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13146 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12958 // #
13147 // #
12959 // # This program is dual-licensed. If you wish to learn more about the
13148 // # This program is dual-licensed. If you wish to learn more about the
12960 // # AppEnlight Enterprise Edition, including its added features, Support
13149 // # AppEnlight Enterprise Edition, including its added features, Support
12961 // # services, and proprietary license terms, please see
13150 // # services, and proprietary license terms, please see
12962 // # https://rhodecode.com/licenses/
13151 // # https://rhodecode.com/licenses/
12963
13152
12964 angular.module('appenlight.services.UUIDProvider', []).factory('UUIDProvider', function () {
13153 angular.module('appenlight.services.UUIDProvider', []).factory('UUIDProvider', function () {
12965 var provider = {
13154 var provider = {
12966 genUUID4: function () {
13155 genUUID4: function () {
12967 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
13156 return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(
12968 /[xy]/g, function (c) {
13157 /[xy]/g, function (c) {
12969 var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;
13158 var r = Math.random() * 16 | 0, v = c == 'x' ? r : r & 0x3 | 0x8;
12970 return v.toString(16);
13159 return v.toString(16);
12971 }
13160 }
12972 );
13161 );
12973 }
13162 }
12974 };
13163 };
12975 return provider;
13164 return provider;
12976 });
13165 });
12977
13166
12978 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
13167 ;// # Copyright (C) 2010-2016 RhodeCode GmbH
12979 // #
13168 // #
12980 // # This program is free software: you can redistribute it and/or modify
13169 // # This program is free software: you can redistribute it and/or modify
12981 // # it under the terms of the GNU Affero General Public License, version 3
13170 // # it under the terms of the GNU Affero General Public License, version 3
12982 // # (only), as published by the Free Software Foundation.
13171 // # (only), as published by the Free Software Foundation.
12983 // #
13172 // #
12984 // # This program is distributed in the hope that it will be useful,
13173 // # This program is distributed in the hope that it will be useful,
12985 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
13174 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
12986 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13175 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12987 // # GNU General Public License for more details.
13176 // # GNU General Public License for more details.
12988 // #
13177 // #
12989 // # You should have received a copy of the GNU Affero General Public License
13178 // # You should have received a copy of the GNU Affero General Public License
12990 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13179 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
12991 // #
13180 // #
12992 // # This program is dual-licensed. If you wish to learn more about the
13181 // # This program is dual-licensed. If you wish to learn more about the
12993 // # AppEnlight Enterprise Edition, including its added features, Support
13182 // # AppEnlight Enterprise Edition, including its added features, Support
12994 // # services, and proprietary license terms, please see
13183 // # services, and proprietary license terms, please see
12995 // # https://rhodecode.com/licenses/
13184 // # https://rhodecode.com/licenses/
12996
13185
12997 var underscore = angular.module('underscore', []);
13186 var underscore = angular.module('underscore', []);
12998 underscore.factory('_', function () {
13187 underscore.factory('_', function () {
12999 return window._; // assumes underscore has already been loaded on the page
13188 return window._; // assumes underscore has already been loaded on the page
13000 });
13189 });
@@ -1,187 +1,188 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2016 RhodeCode GmbH
3 # Copyright (C) 2010-2016 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # AppEnlight Enterprise Edition, including its added features, Support
18 # AppEnlight Enterprise Edition, including its added features, Support
19 # services, and proprietary license terms, please see
19 # services, and proprietary license terms, please see
20 # https://rhodecode.com/licenses/
20 # https://rhodecode.com/licenses/
21
21
22 import hashlib
22 import hashlib
23 import os
23 import os
24
24
25 from pyramid.i18n import TranslationStringFactory
25 from pyramid.i18n import TranslationStringFactory
26 from pyramid import threadlocal
26 from pyramid import threadlocal
27
27
28 _ = TranslationStringFactory('pyramid')
28 _ = TranslationStringFactory('pyramid')
29
29
30 from appenlight import security
30 from appenlight import security
31 from appenlight.lib import helpers, generate_random_string
31 from appenlight.lib import helpers, generate_random_string
32 from appenlight.models.services.config import ConfigService
32 from appenlight.models.services.config import ConfigService
33
33
34
34
35 def gen_urls(request):
35 def gen_urls(request):
36 urls = {
36 urls = {
37 'baseUrl': request.route_url('/'),
37 'baseUrl': request.route_url('/'),
38 'applicationsNoId': request.route_url('applications_no_id'),
38 'applicationsNoId': request.route_url('applications_no_id'),
39 'applications': request.route_url('applications', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId'),
39 'applications': request.route_url('applications', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId'),
40 'applicationsProperty': request.route_url('applications_property',key='REPLACE_KEY', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId').replace('REPLACE_KEY',':key'),
40 'applicationsProperty': request.route_url('applications_property',key='REPLACE_KEY', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId').replace('REPLACE_KEY',':key'),
41 'configsNoId': request.route_url('admin_configs'),
41 'configsNoId': request.route_url('admin_configs'),
42 'configs': request.route_url('admin_config', key='REPLACE_KEY', section='REPLACE_SECTION').replace('REPLACE_SECTION',':section').replace('REPLACE_KEY',':key'),
42 'configs': request.route_url('admin_config', key='REPLACE_KEY', section='REPLACE_SECTION').replace('REPLACE_SECTION',':section').replace('REPLACE_KEY',':key'),
43 'docs': 'http://getappenlight.com/page/api/main.html',
43 'docs': 'http://getappenlight.com/page/api/main.html',
44 'eventsNoId': request.route_url('events_no_id'),
44 'eventsNoId': request.route_url('events_no_id'),
45 'events': request.route_url('events', event_id='REPLACE_ID').replace('REPLACE_ID',':eventId'),
45 'events': request.route_url('events', event_id='REPLACE_ID').replace('REPLACE_ID',':eventId'),
46 'eventsProperty': request.route_url('events_property',key='REPLACE_KEY', event_id='REPLACE_ID').replace('REPLACE_ID',':eventId').replace('REPLACE_KEY',':key'),
46 'eventsProperty': request.route_url('events_property',key='REPLACE_KEY', event_id='REPLACE_ID').replace('REPLACE_ID',':eventId').replace('REPLACE_KEY',':key'),
47 'groupsNoId': request.route_url('groups_no_id'),
47 'groupsNoId': request.route_url('groups_no_id'),
48 'groups': request.route_url('groups', group_id='REPLACE_ID').replace('REPLACE_ID',':groupId'),
48 'groups': request.route_url('groups', group_id='REPLACE_ID').replace('REPLACE_ID',':groupId'),
49 'groupsProperty': request.route_url('groups_property',key='REPLACE_KEY', group_id='REPLACE_ID').replace('REPLACE_ID',':groupId').replace('REPLACE_KEY',':key'),
49 'groupsProperty': request.route_url('groups_property',key='REPLACE_KEY', group_id='REPLACE_ID').replace('REPLACE_ID',':groupId').replace('REPLACE_KEY',':key'),
50 'logsNoId': request.route_url('logs_no_id'),
50 'logsNoId': request.route_url('logs_no_id'),
51 'integrationAction': request.route_url('integrations_id',action='REPLACE_ACT', resource_id='REPLACE_RID', integration='REPLACE_IID').replace('REPLACE_RID',':resourceId').replace('REPLACE_ACT',':action').replace('REPLACE_IID',':integration'),
51 'integrationAction': request.route_url('integrations_id',action='REPLACE_ACT', resource_id='REPLACE_RID', integration='REPLACE_IID').replace('REPLACE_RID',':resourceId').replace('REPLACE_ACT',':action').replace('REPLACE_IID',':integration'),
52 'usersNoId': request.route_url('users_no_id'),
52 'usersNoId': request.route_url('users_no_id'),
53 'users': request.route_url('users', user_id='REPLACE_ID').replace('REPLACE_ID',':userId'),
53 'users': request.route_url('users', user_id='REPLACE_ID').replace('REPLACE_ID',':userId'),
54 'usersProperty': request.route_url('users_property',key='REPLACE_KEY', user_id='REPLACE_ID').replace('REPLACE_ID',':userId').replace('REPLACE_KEY',':key'),
54 'usersProperty': request.route_url('users_property',key='REPLACE_KEY', user_id='REPLACE_ID').replace('REPLACE_ID',':userId').replace('REPLACE_KEY',':key'),
55 'userSelf': request.route_url('users_self'),
55 'userSelf': request.route_url('users_self'),
56 'userSelfProperty': request.route_url('users_self_property',key='REPLACE_KEY').replace('REPLACE_KEY',':key'),
56 'userSelfProperty': request.route_url('users_self_property',key='REPLACE_KEY').replace('REPLACE_KEY',':key'),
57 'reports': request.route_url('reports'),
57 'reports': request.route_url('reports'),
58 'reportGroup': request.route_url('report_groups', group_id='REPLACE_RID').replace('REPLACE_RID',':groupId'),
58 'reportGroup': request.route_url('report_groups', group_id='REPLACE_RID').replace('REPLACE_RID',':groupId'),
59 'reportGroupProperty': request.route_url('report_groups_property', key='REPLACE_KEY', group_id='REPLACE_GID').replace('REPLACE_KEY',':key').replace('REPLACE_GID',':groupId'),
59 'reportGroupProperty': request.route_url('report_groups_property', key='REPLACE_KEY', group_id='REPLACE_GID').replace('REPLACE_KEY',':key').replace('REPLACE_GID',':groupId'),
60 'pluginConfigsNoId': request.route_url('plugin_configs', plugin_name='REPLACE_TYPE').replace('REPLACE_TYPE',':plugin_name'),
60 'pluginConfigsNoId': request.route_url('plugin_configs', plugin_name='REPLACE_TYPE').replace('REPLACE_TYPE',':plugin_name'),
61 'pluginConfigs': request.route_url('plugin_config', id='REPLACE_ID', plugin_name='REPLACE_TYPE').replace('REPLACE_ID',':id').replace('REPLACE_TYPE',':plugin_name'),
61 'pluginConfigs': request.route_url('plugin_config', id='REPLACE_ID', plugin_name='REPLACE_TYPE').replace('REPLACE_ID',':id').replace('REPLACE_TYPE',':plugin_name'),
62 'resourceProperty': request.route_url('resources_property',key='REPLACE_KEY', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId').replace('REPLACE_KEY',':key'),
62 'resourceProperty': request.route_url('resources_property',key='REPLACE_KEY', resource_id='REPLACE_ID').replace('REPLACE_ID',':resourceId').replace('REPLACE_KEY',':key'),
63 'slowReports': request.route_url('slow_reports'),
63 'slowReports': request.route_url('slow_reports'),
64 'sectionView': request.route_url('section_view', section='REPLACE_S', view='REPLACE_V').replace('REPLACE_S',':section').replace('REPLACE_V',':view'),
64 'sectionView': request.route_url('section_view', section='REPLACE_S', view='REPLACE_V').replace('REPLACE_S',':section').replace('REPLACE_V',':view'),
65 'otherRoutes': {
65 'otherRoutes': {
66 'register': request.route_url('register') ,
66 'register': request.route_url('register') ,
67 'lostPassword': request.route_url('lost_password') ,
67 'lostPassword': request.route_url('lost_password') ,
68 'lostPasswordGenerate': request.route_url('lost_password_generate')
68 'lostPasswordGenerate': request.route_url('lost_password_generate'),
69 'signOut': request.route_url('ziggurat.routes.sign_out')
69 },
70 },
70 'social_auth': {
71 'social_auth': {
71 'google':request.route_url('social_auth', provider='google'),
72 'google':request.route_url('social_auth', provider='google'),
72 'twitter':request.route_url('social_auth', provider='twitter'),
73 'twitter':request.route_url('social_auth', provider='twitter'),
73 'bitbucket':request.route_url('social_auth', provider='bitbucket'),
74 'bitbucket':request.route_url('social_auth', provider='bitbucket'),
74 'github':request.route_url('social_auth', provider='github'),
75 'github':request.route_url('social_auth', provider='github'),
75 },
76 },
76 "plugins":{},
77 "plugins":{},
77 "adminAction": request.route_url('admin', action="REPLACE_ACT").replace('REPLACE_ACT',':action')
78 "adminAction": request.route_url('admin', action="REPLACE_ACT").replace('REPLACE_ACT',':action')
78 }
79 }
79 return urls
80 return urls
80
81
81 def new_request(event):
82 def new_request(event):
82 environ = event.request.environ
83 environ = event.request.environ
83 event.request.response.headers['X-Frame-Options'] = 'SAMEORIGIN'
84 event.request.response.headers['X-Frame-Options'] = 'SAMEORIGIN'
84 event.request.response.headers['X-XSS-Protection'] = '1; mode=block'
85 event.request.response.headers['X-XSS-Protection'] = '1; mode=block'
85 # can this be enabled on non https deployments?
86 # can this be enabled on non https deployments?
86 # event.request.response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubdomains;'
87 # event.request.response.headers['Strict-Transport-Security'] = 'max-age=31536000; includeSubdomains;'
87
88
88 # do not send XSRF token with /api calls
89 # do not send XSRF token with /api calls
89 if not event.request.path.startswith('/api'):
90 if not event.request.path.startswith('/api'):
90 if environ['wsgi.url_scheme'] == 'https':
91 if environ['wsgi.url_scheme'] == 'https':
91 event.request.response.set_cookie(
92 event.request.response.set_cookie(
92 'XSRF-TOKEN', event.request.session.get_csrf_token(),
93 'XSRF-TOKEN', event.request.session.get_csrf_token(),
93 secure=True)
94 secure=True)
94 else:
95 else:
95 event.request.response.set_cookie(
96 event.request.response.set_cookie(
96 'XSRF-TOKEN', event.request.session.get_csrf_token())
97 'XSRF-TOKEN', event.request.session.get_csrf_token())
97 if event.request.user:
98 if event.request.user:
98 event.request.response.headers[
99 event.request.response.headers[
99 'x-appenlight-uid'] = '%s' % event.request.user.id
100 'x-appenlight-uid'] = '%s' % event.request.user.id
100
101
101
102
102 def add_renderer_globals(event):
103 def add_renderer_globals(event):
103 request = event.get("request") or threadlocal.get_current_request()
104 request = event.get("request") or threadlocal.get_current_request()
104
105
105 renderer_globals = event
106 renderer_globals = event
106 renderer_globals["h"] = helpers
107 renderer_globals["h"] = helpers
107 renderer_globals["js_hash"] = request.registry.js_hash
108 renderer_globals["js_hash"] = request.registry.js_hash
108 renderer_globals["css_hash"] = request.registry.css_hash
109 renderer_globals["css_hash"] = request.registry.css_hash
109 renderer_globals['_'] = _
110 renderer_globals['_'] = _
110 renderer_globals['security'] = security
111 renderer_globals['security'] = security
111 renderer_globals['flash_msgs'] = []
112 renderer_globals['flash_msgs'] = []
112 renderer_globals['js_plugins'] = []
113 renderer_globals['js_plugins'] = []
113 renderer_globals['top_nav'] = {
114 renderer_globals['top_nav'] = {
114 'menu_dashboards_items': [],
115 'menu_dashboards_items': [],
115 'menu_reports_items': [],
116 'menu_reports_items': [],
116 'menu_logs_items': [],
117 'menu_logs_items': [],
117 'menu_settings_items': [],
118 'menu_settings_items': [],
118 'menu_admin_items': [],
119 'menu_admin_items': [],
119 }
120 }
120
121
121 if 'jinja' in event['renderer_info'].type:
122 if 'jinja' in event['renderer_info'].type:
122 renderer_globals['url_list'] = gen_urls(request)
123 renderer_globals['url_list'] = gen_urls(request)
123 # add footer html and some other global vars to renderer
124 # add footer html and some other global vars to renderer
124 for module, config in request.registry.appenlight_plugins.items():
125 for module, config in request.registry.appenlight_plugins.items():
125 if config['url_gen']:
126 if config['url_gen']:
126 urls = config['url_gen'](request)
127 urls = config['url_gen'](request)
127 renderer_globals['url_list']['plugins'][module] = urls
128 renderer_globals['url_list']['plugins'][module] = urls
128
129
129 if config['javascript']:
130 if config['javascript']:
130 renderer_globals['js_plugins'].append(
131 renderer_globals['js_plugins'].append(
131 ({'name':module, 'config':config['javascript']}))
132 ({'name':module, 'config':config['javascript']}))
132 for nav_key in renderer_globals['top_nav'].keys():
133 for nav_key in renderer_globals['top_nav'].keys():
133 if nav_key in config['top_nav'] and config['top_nav'][nav_key]:
134 if nav_key in config['top_nav'] and config['top_nav'][nav_key]:
134 renderer_globals['top_nav'][nav_key].append(
135 renderer_globals['top_nav'][nav_key].append(
135 config['top_nav'][nav_key])
136 config['top_nav'][nav_key])
136
137
137 if request.has_permission('root_administration',
138 if request.has_permission('root_administration',
138 security.RootFactory(request)):
139 security.RootFactory(request)):
139 renderer_globals['top_nav']['menu_admin_items'].append(
140 renderer_globals['top_nav']['menu_admin_items'].append(
140 {'sref': 'admin', 'label': 'Admin Settings'}
141 {'sref': 'admin', 'label': 'Admin Settings'}
141 )
142 )
142
143
143 footer_config = ConfigService.by_key_and_section(
144 footer_config = ConfigService.by_key_and_section(
144 'template_footer_html', 'global', default_value='')
145 'template_footer_html', 'global', default_value='')
145
146
146 renderer_globals['template_footer_html'] = footer_config.value
147 renderer_globals['template_footer_html'] = footer_config.value
147 try:
148 try:
148 renderer_globals['root_administrator'] = request.has_permission(
149 renderer_globals['root_administrator'] = request.has_permission(
149 'root_administration', security.RootFactory(request))
150 'root_administration', security.RootFactory(request))
150 except AttributeError:
151 except AttributeError:
151 renderer_globals['root_administrator'] = False
152 renderer_globals['root_administrator'] = False
152
153
153 renderer_globals['_mail_url'] = request.registry.settings['_mail_url']
154 renderer_globals['_mail_url'] = request.registry.settings['_mail_url']
154
155
155 if not request:
156 if not request:
156 return
157 return
157
158
158 # do not sens flash headers with /api calls
159 # do not sens flash headers with /api calls
159 if not request.path.startswith('/api'):
160 if not request.path.startswith('/api'):
160 flash_msgs = helpers.get_type_formatted_flash(request)
161 flash_msgs = helpers.get_type_formatted_flash(request)
161 renderer_globals['flash_msgs'] = flash_msgs
162 renderer_globals['flash_msgs'] = flash_msgs
162 request.add_flash_to_headers()
163 request.add_flash_to_headers()
163
164
164 def application_created(app):
165 def application_created(app):
165 webassets_dir = app.app.registry.settings.get('webassets.dir')
166 webassets_dir = app.app.registry.settings.get('webassets.dir')
166 js_hash = generate_random_string()
167 js_hash = generate_random_string()
167 css_hash = generate_random_string()
168 css_hash = generate_random_string()
168 if webassets_dir:
169 if webassets_dir:
169 js_hasher = hashlib.md5()
170 js_hasher = hashlib.md5()
170 css_hasher = hashlib.md5()
171 css_hasher = hashlib.md5()
171 for root, dirs, files in os.walk(webassets_dir):
172 for root, dirs, files in os.walk(webassets_dir):
172 for name in files:
173 for name in files:
173 filename = os.path.join(root, name)
174 filename = os.path.join(root, name)
174 if name.endswith('css'):
175 if name.endswith('css'):
175 with open(filename, 'r', encoding='utf8',
176 with open(filename, 'r', encoding='utf8',
176 errors='replace') as f:
177 errors='replace') as f:
177 for line in f:
178 for line in f:
178 css_hasher.update(line.encode('utf8'))
179 css_hasher.update(line.encode('utf8'))
179 elif name.endswith('js'):
180 elif name.endswith('js'):
180 with open(filename, 'r', encoding='utf8',
181 with open(filename, 'r', encoding='utf8',
181 errors='replace') as f:
182 errors='replace') as f:
182 for line in f:
183 for line in f:
183 js_hasher.update(line.encode('utf8'))
184 js_hasher.update(line.encode('utf8'))
184 js_hash = js_hasher.hexdigest()
185 js_hash = js_hasher.hexdigest()
185 css_hash = css_hasher.hexdigest()
186 css_hash = css_hasher.hexdigest()
186 app.app.registry.js_hash = js_hash
187 app.app.registry.js_hash = js_hash
187 app.app.registry.css_hash = css_hash
188 app.app.registry.css_hash = css_hash
@@ -1,12 +1,10 b''
1 {% extends "/layout.jinja2" %}
1 {% extends "/layout.jinja2" %}
2 {% set layout_disable_menu = True %}
2 {% set layout_disable_menu = True %}
3 {% block content %}
3 {% block content %}
4 <div class="col-sm-10 col-sm-offset-1" id="content">
4 <div class="col-sm-10 col-sm-offset-1" id="content">
5
5
6 <span class="fa fa-ambulance" style="float: left; font-size: 666%; margin: 20px 20px"></span>
6 <span class="fa fa-ambulance" style="float: left; font-size: 666%; margin: 20px 20px"></span>
7
8
9 <p class="heading-text"><strong>500:</strong> OMG!!! Internal Server Error </p>
7 <p class="heading-text"><strong>500:</strong> OMG!!! Internal Server Error </p>
10 </div>
8 </div>
11 {% endblock %}
9 {% endblock %}
12 {% block section_name %}errorPage{% endblock %} No newline at end of file
10 {% block section_name %}errorPage{% endblock %}
@@ -1,9 +1,6 b''
1 <div class="footer">
1 <div class="footer">
2 <div class="container">
2 <div class="container">
3
4 {{ template_footer_html |safe }}
3 {{ template_footer_html |safe }}
5
6 </div>
4 </div>
7
8 <div id="app_instance">{{ appenlight_app_instance }}</div>
5 <div id="app_instance">{{ appenlight_app_instance }}</div>
9 </div>
6 </div>
@@ -1,115 +1,22 b''
1 <!-- Fixed navbar -->
1 <!-- Fixed navbar -->
2 <div id="top-navbar" class="navbar navbar-default navbar-fixed-top" role="navigation" data-ng-controller="HeaderCtrl as header">
2 <div id="top-navbar" class="navbar navbar-default navbar-fixed-top"
3 {% raw %}<channelstream config="AeConfig"></channelstream>{% endraw %}
3 role="navigation">
4 <div class="pattern">
4 <div class="pattern">
5 <div class="container">
5 <div class="container">
6 <div class="navbar-header pull-left">
6 <div class="navbar-header pull-left">
7 <a href="{{ request.route_url('/') }}" class="navbar-brand">
7 <a href="{{ request.route_url('/') }}" class="navbar-brand">
8 <div id="logo-normal" class="hidden-sm hidden-xs"></div>
8 <div id="logo-normal" class="hidden-sm hidden-xs"></div>
9 <div id="logo-icon" class="visible-sm visible-xs"></div>
9 <div id="logo-icon" class="visible-sm visible-xs"></div>
10 </a>
10 </a>
11 </div>
11 </div>
12
13 <div class="container-fluid">
12 <div class="container-fluid">
14 <div>
15 {% if request.user -%}
16 <ul class="nav navbar-nav navbar-right">
17 <li id="user-notifications" class="dropdown ng-cloak" data-uib-dropdown>
18
19 <a class="dropdown-toggle" data-uib-dropdown-toggle>
20 <span class="badge">{% raw %}{{header.assignedReports.length}}{% endraw %}</span>
21 <span class="fa fa-envelope-o"></span>
22 </a>
23 <ul class="dropdown-menu">
24 <li role="presentation" class="dropdown-header">Assigned reports</li>
25 {% raw %}
26 <li data-ng-repeat="report in header.assignedReports" role="presentation">
27 <a href="{{report.front_url}}" role="menuitem" tabindex="-1">
28 <small>{{ report.error || 'Slow Report: ' + report.view_name |truncate:65}}</small>
29 </a>
30
31 </li>
32 <li data-ng-if="header.assignedReports.length == 0"><a><small>No reports</small></a></li>
33 {% endraw %}
34 </ul>
35 </li>
36 <li id="alert-notifications" class="dropdown ng-cloak" data-uib-dropdown auto-close="outsideClick">
37 {% raw %}
38 <a class="dropdown-toggle" data-uib-dropdown-toggle>
39 <span class="badge {{ activeEvents ? 'danger' : '' }}">{{header.activeEvents}}</span>
40 <span class="fa fa-bell-o"></span></a>
41 <ul class="dropdown-menu">
42 <li role="presentation" class="dropdown-header">
43 <a data-ui-sref="events" class="btn btn-xs btn-default">Show me more</a></li>
44 <li role="presentation" class="dropdown-header">Latest events</li>
45 <li data-ng-repeat="event in header.latestEvents" role="presentation">
46 <a data-ng-click="header.clickedEvent(event)"><small class="resource-name">For {{ event.resource_name }}</small><br/>
47 <small>{{ event.text |truncate:65}}</small><br/>
48 <small class="date" data-uib-tooltip="{{event.start_date}}">created: <iso-to-relative-time time="{{event.start_date}}"/></small>
49 <small class="date" data-ng-show="event.end_date" data-uib-tooltip="{{event.end_date}}">closed: <iso-to-relative-time time="{{event.end_date}}"/></small>
50 </a>
51 </li>
52 <li data-ng-if="header.latestEvents.length == 0"><a><small>No events</small></a></li>
53 {% endraw %}
54 </ul>
55 </li>
56
57 <li id="dashboards" class="dropdown" data-uib-dropdown>
58 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Dashboards">
59 <span class="fa fa-bar-chart-o "></span></a>
60 <ul class="dropdown-menu">
61 <li role="presentation"><a data-ui-sref="front_dashboard">Main dashboard</a>
62 {% for item in top_nav['menu_dashboards_items'] %}
63 <li role="presentation">
64 <a data-ui-sref="{{ item.sref }}">{{ item.label }}</a>
65 </li>
66 {% endfor %}
67 </ul>
68 </li>
69
70 <li class="dropdown" data-uib-dropdown>
71 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Reports">
72 <span class="fa fa-exclamation-triangle"></span></a>
73 <ul class="dropdown-menu">
74 <li role="presentation">
75 <a data-ui-sref="report.list({resource:stateHolder.resource})">Error Reports</a>
76 </li>
77 <li role="presentation">
78 <a data-ui-sref="report.list_slow({resource:stateHolder.resource})">Slowness Reports</a>
79 </li>
80
81 </ul>
82 </li>
83
84 <li>
85 <a data-ui-sref="logs({resource:stateHolder.resource})" data-uib-tooltip="Logs" tooltip-placement="bottom"><span class="fa fa-list-alt "></span></a></li>
86 <li>
87 <a data-ui-sref="user" data-uib-tooltip="Settings" tooltip-placement="bottom"><span class="fa fa-cog "></span></a>
88 </li>
89 {% if top_nav['menu_admin_items'] %}
90 <li class="dropdown" data-uib-dropdown>
91 <a class="dropdown-toggle" data-uib-dropdown-toggle tooltip-placement="bottom" data-uib-tooltip="Admin Settings">
92 <span class="fa fa-wrench"></span></a>
93 <ul class="dropdown-menu">
94 {% for item in top_nav['menu_admin_items'] %}
95 <li role="presentation">
96 <a data-ui-sref="{{ item.sref }}">{{ item.label }}</a>
97 </li>
98 {% endfor %}
99 </ul>
100 </li>
101 {% endif %}
102 <li><a href="{{ request.route_url('ziggurat.routes.sign_out') }}" target="_self"
103 data-uib-tooltip="Sign out" tooltip-placement="bottom">
104 <span class="fa fa-power-off "></span></a></li>
105 </ul>
106 {% else -%}
107 <ul class="nav navbar-nav pull-right">
13 <ul class="nav navbar-nav pull-right">
108 <li><a href="{{ request.route_url('register', _query={'sign_in':'1'}) }}" target="_self" class="btn btn-orange">{{ _('Sign In') }}</a></li>
14 <li>
15 <a href="{{ request.route_url('register', _query={'sign_in':'1'}) }}"
16 target="_self"
17 class="btn btn-orange">{{ _('Sign In') }}</a></li>
109 </ul>
18 </ul>
110 {% endif %}
111 </div><!-- /.navbar-collapse -->
112 </div><!-- /.container-fluid -->
19 </div><!-- /.container-fluid -->
20 </div>
113 </div>
21 </div>
114 </div>
22 </div>
115 </div>
@@ -1,25 +1,18 b''
1 {% extends "/layout_base.jinja2" %}
1 {% extends "/layout_base.jinja2" %}
2
2
3 {% block outer_content %}
3 {% block outer_content %}
4 <!-- Begin page content -->
4 <!-- Begin page content -->
5 <div class="container">
5 <div class="container">
6 <div class="row ng-cloak" data-ng-if="flash.length" style="margin-bottom: 10px">
6 <div class="row ng-cloak" data-ng-if="flash.length" style="margin-bottom: 10px">
7 <div class="col-xs-12">
7 <div class="col-xs-12">
8 {% raw %}
8 {% raw %}
9 <uib-alert data-ng-repeat="message in flash" type="{{ message.type}}" close="closeAlert($index)" class="animate-repeat">{{message.msg}}</uib-alert>
9 <uib-alert data-ng-repeat="message in flash" type="{{ message.type}}" close="closeAlert($index)" class="animate-repeat">{{message.msg}}</uib-alert>
10 {% endraw %}
10 {% endraw %}
11 </div>
11 </div>
12 </div>
12 </div>
13
13 <div class="row">
14 <div {% block ng_view %}{% endblock %}>
14 {% block content %}{% endblock %}
15 <div class="row">
16 <!-- container -->
17 <!-- content -->
18 {% block content %}{% endblock %}
19 <!-- content -->
20 <!-- container -->
21 </div>
22 </div>
15 </div>
23 </div>
16 </div>
24
17
25 {% endblock %}
18 {% endblock %}
@@ -1,116 +1,122 b''
1 {% import 'widgets.jinja2' as widgets %}
1 {% import 'widgets.jinja2' as widgets %}
2 <!DOCTYPE html>
2 <!DOCTYPE html>
3 <html {% block ng_controller %}{% endblock %}>
3 <html>
4 <head>
4 <head>
5 <title>{% block title %}Application performance, exception and error monitoring for Python,
5 <title>{% block title %}Application performance, exception and error monitoring for Python,
6 Django, Flask and Javascript - AppEnlight{% endblock %}</title>
6 Django, Flask and Javascript - AppEnlight{% endblock %}</title>
7 {% block meta %}
7 {% block meta %}
8 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
8 <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
9 <meta name="robots" content="all">
9 <meta name="robots" content="all">
10 <meta name="Description"
10 <meta name="Description"
11 content="AppEnlight provides a helpful interface to let you and your team save time spent on debugging and reproducing issues from a production environment.">
11 content="AppEnlight provides a helpful interface to let you and your team save time spent on debugging and reproducing issues from a production environment.">
12 <meta name="Keywords"
12 <meta name="Keywords"
13 content="monitoring, debugging, alerting, errors, programming, python, ruby, django, flask, profiling">
13 content="monitoring, debugging, alerting, errors, programming, python, ruby, django, flask, profiling">
14 <meta name="Author" content="RhodeCode - sales@rhodecode.com">
14 <meta name="Author" content="RhodeCode - sales@rhodecode.com">
15 <meta name="Copyright" content="RhodeCode">
15 <meta name="Copyright" content="RhodeCode">
16 <base href="{{ request.route_path('/') }}">
16 <base href="{{ request.route_path('/') }}">
17 <link rel="shortcut icon" href="{{ request.static_url('appenlight:webassets/appenlight/favicon.ico')}}"/>
17 <link rel="shortcut icon" href="{{ request.static_url('appenlight:webassets/appenlight/favicon.ico')}}"/>
18 {% endblock %}
18 {% endblock %}
19 {% block styles %}
19 {% block styles %}
20 <link href="{{ request.static_url('appenlight:webassets/appenlight/css/front.css', _query={'rev':css_hash}) }}" rel="stylesheet" type="text/css"/>
20 <link href="{{ request.static_url('appenlight:webassets/appenlight/css/front.css', _query={'rev':css_hash}) }}" rel="stylesheet" type="text/css"/>
21 <meta name="viewport" content="width=device-width, initial-scale=1.0">
21 <meta name="viewport" content="width=device-width, initial-scale=1.0">
22
23 {% endblock %}
22 {% endblock %}
24 {% block additional_styles %}{% endblock %}
25 <script type="text/javascript">
23 <script type="text/javascript">
26 var AE = {};
24 var AE = {};
27 AE.urls = {{ url_list|tojson|safe }};
25 AE.urls = {{ url_list|tojson|safe }};
28 AE.ws_url = '{{ request.registry.settings['cometd.ws_url'] }}';
26 AE.ws_url = '{{ request.registry.settings['cometd.ws_url'] }}';
29 AE.flash_messages = {{ flash_msgs|toJSONUnsafe }};
27 AE.flash_messages = {{ flash_msgs|toJSONUnsafe }};
30 AE.timeOptions = {{ h.time_options|toJSONUnsafe }};
28 AE.timeOptions = {{ h.time_options|toJSONUnsafe }};
31 AE.plugins = {{ js_plugins|toJSONUnsafe }};
29 AE.plugins = {{ js_plugins|toJSONUnsafe }};
30 AE.topNav = {{ top_nav|toJSONUnsafe }};
32 </script>
31 </script>
33 {% if request.registry.settings.get('appenlight.public_api_key') %}
32 {% if request.registry.settings.get('appenlight.public_api_key') %}
34 <script type="application/javascript">
33 <script type="application/javascript">
35 var initAppEnlight = function () {
34 var initAppEnlight = function () {
36 if(this.readyState!='loading'){
35 if(this.readyState!='loading'){
37 AppEnlight.init({
36 AppEnlight.init({
38 apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}',
37 apiKey:'{{ request.registry.settings.get('appenlight.public_api_key') }}',
39 windowOnError: 1 // enable to hook to window.onerror
38 windowOnError: 1 // enable to hook to window.onerror
40 });
39 });
41 // setting request info is completly optional
40 // setting request info is completly optional
42 AppEnlight.setRequestInfo({
41 AppEnlight.setRequestInfo({
43 server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}",
42 server:"{{ request.environ.get('SERVER_NAME', '<unknown>') }}",
44 {% if request.user %}
43 {% if request.user %}
45 username:'{{ request.user.user_name }}',
44 username:'{{ request.user.user_name }}',
46 {% endif %}
45 {% endif %}
47 ip: "{{ request.environ.get('REMOTE_ADDR', '') }}",
46 ip: "{{ request.environ.get('REMOTE_ADDR', '') }}",
48 request_id:"{{ request.environ.get('appenlight.request_id', '') }}"
47 request_id:"{{ request.environ.get('appenlight.request_id', '') }}"
49 });
48 });
50
49
51 AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'});
50 AppEnlight.addGlobalTags({framework:'angular', 'language':'javascript'});
52 AppEnlight.addGlobalExtra({some_key:'on every request'});
51 AppEnlight.addGlobalExtra({some_key:'on every request'});
53
52
54 }
53 }
55 };
54 };
56 // load the script asynchroneously
55 // load the script asynchroneously
57 var scrElem = document.createElement('script');
56 var scrElem = document.createElement('script');
58 scrElem.type = 'text/javascript';
57 scrElem.type = 'text/javascript';
59 scrElem.async = true;
58 scrElem.async = true;
60 scrElem.onload = scrElem.onreadystatechange = initAppEnlight;
59 scrElem.onload = scrElem.onreadystatechange = initAppEnlight;
61 scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js";
60 scrElem.src = "//cdn.jsdelivr.net/appenlight/latest/appenlight-client.min.js";
62 var p = document.getElementsByTagName('script')[0];
61 var p = document.getElementsByTagName('script')[0];
63 p.parentNode.insertBefore(scrElem, p);
62 p.parentNode.insertBefore(scrElem, p);
64 </script>
63 </script>
65 {% endif %}
64 {% endif %}
66 <script src="{{ request.static_url('appenlight:webassets/appenlight/js/appenlight.js', _query={'rev':js_hash}) }}"></script>
65 <script src="{{ request.static_url('appenlight:webassets/appenlight/js/appenlight.js', _query={'rev':js_hash}) }}"></script>
67 {% for plugin in js_plugins %}
66 {% for plugin in js_plugins %}
68 <script src="{{ request.static_url('appenlight:webassets/{}/js/{}'.format(plugin['name'], plugin['config']['src']), _query={'rev':js_hash}) }}"></script>
67 <script src="{{ request.static_url('appenlight:webassets/{}/js/{}'.format(plugin['name'], plugin['config']['src']), _query={'rev':js_hash}) }}"></script>
69 {% endfor %}
68 {% endfor %}
70 <script>
69 <script>
71 var xhr = new XMLHttpRequest();
70 var xhr = new XMLHttpRequest();
72 xhr.open('GET', AE.urls.userSelf);
71 xhr.open('GET', AE.urls.userSelf);
73 xhr.onload = function() {
72 xhr.onload = function() {
74 if (xhr.status === 200) {
73 if (xhr.status === 200) {
75 kickstartAE(JSON.parse(xhr.responseText));
74 kickstartAE(JSON.parse(xhr.responseText));
76 angular.bootstrap(document, ['appenlight']);
75 angular.bootstrap(document, ['appenlight']);
77 }
76 }
78 else {
77 else {
79 kickstartAE(null);
78 kickstartAE(null);
80 angular.bootstrap(document, ['appenlight']);
79 angular.bootstrap(document, ['appenlight']);
81 }
80 }
82 };
81 };
83 // do not run angular on register page
82 // do not run angular on register page
84
83
85 var noAngularRoutes = [
84 var noAngularRoutes = [
86 AE.urls.otherRoutes.register,
85 AE.urls.otherRoutes.register,
87 AE.urls.otherRoutes.lostPassword,
86 AE.urls.otherRoutes.lostPassword,
88 AE.urls.otherRoutes.lostPasswordGenerate,
87 AE.urls.otherRoutes.lostPasswordGenerate,
89 ];
88 ];
90 shouldRunAngular = true;
89 shouldRunAngular = true;
91 for (var i=0; i< noAngularRoutes.length; i++){
90 for (var i=0; i< noAngularRoutes.length; i++){
92 if (window.location.toString().indexOf(noAngularRoutes[i]) !== -1) {
91 if (window.location.toString().indexOf(noAngularRoutes[i]) !== -1) {
93 shouldRunAngular = false;
92 shouldRunAngular = false;
94 }
93 }
95 }
94 }
96 if (shouldRunAngular) {
95 if (shouldRunAngular) {
97 xhr.send();
96 xhr.send();
98 }
97 }
99 </script>
98 </script>
100 </head>
99 </head>
101 <body class="{% block section_name %}{% endblock %} {% raw %}top-state-{{$state.current.name.split('.')[0].replace('.', '-').replace('.', '-')}} state-{{$state.current.name.replace('.', '-').replace('.', '-')}}{% endraw %} {% if request.user %}user-logged {% else %}user-unlogged{% endif %}" id="html_body">
100 <body class="{% block section_name %}{% endblock %} {% raw %}top-state-{{$state.current.name.split('.')[0].replace('.', '-').replace('.', '-')}} state-{{$state.current.name.replace('.', '-').replace('.', '-')}}{% endraw %} {% if request.user %}user-logged {% else %}user-unlogged{% endif %}" id="html_body">
102 <div class="extra-deco1"></div>
103 <div class="extra-deco2"></div>
104
105
106 <div id="holder">
101 <div id="holder">
107 {% include "/header.jinja2" with context %}
102 {% block app_block %}
108 <div id="outer-content">
103 <appenlight-app>
109 {% block outer_content %}Content{% endblock %}
104 <div class="text-center">
110 </div>
105 <span class="fa fa-cog fa-spin fa-5x loader"></span>
106 </div>
107 </appenlight-app>
108 {% endblock %}
109
110 {% block non_angular_content %}
111 {% if not request.user %}
112 {% include "/header.jinja2" with context %}
113 <div id="outer-content">
114 {% block outer_content %}{% endblock %}
115 </div>
116 {% endif %}
117 {% endblock %}
111
118
112 {% include "/footer.jinja2" %}
119 {% include "/footer.jinja2" %}
113 </div>
120 </div>
114
115 </body>
121 </body>
116 </html>
122 </html>
@@ -1,16 +1,17 b''
1 {% extends "/layout.jinja2" %}
1 {% extends "/layout.jinja2" %}
2 {% block app_block %}{% endblock %}
2 {% block content %}
3 {% block content %}
3
4
4 <div class="col-sm-offset-1 col-sm-10">
5 <div class="col-sm-offset-1 col-sm-10">
5
6
6 <div class="m-t-1 row">
7 <div class="m-t-1 row">
7 {{ widgets.render_flash_messages(flash_msgs) }}
8 {{ widgets.render_flash_messages(flash_msgs) }}
8 </div>
9 </div>
9
10
10 <h1 class="page-title">{{_('Recover your password')}}</h1>
11 <h1 class="page-title">{{_('Recover your password')}}</h1>
11 <form action="{{request.route_url('lost_password')}}" method="post"
12 <form action="{{request.route_url('lost_password')}}" method="post"
12 class="decorate" id="lost_password">
13 class="decorate" id="lost_password">
13 {{widgets.render_form(form)}}
14 {{widgets.render_form(form)}}
14 </form>
15 </form>
15 </div>
16 </div>
16 {% endblock %}
17 {% endblock %}
@@ -1,15 +1,16 b''
1 {% extends "/layout.jinja2" %}
1 {% extends "/layout.jinja2" %}
2 {% block app_block %}{% endblock %}
2 {% block content %}
3 {% block content %}
3 <div class="col-sm-offset-1 col-sm-10">
4 <div class="col-sm-offset-1 col-sm-10">
4
5
5 <div class="m-t-1 row">
6 <div class="m-t-1 row">
6 {{ widgets.render_flash_messages(flash_msgs) }}
7 {{ widgets.render_flash_messages(flash_msgs) }}
7 </div>
8 </div>
8
9
9 <h1 class="page-title">{{_('Set your new password')}}</h1>
10 <h1 class="page-title">{{_('Set your new password')}}</h1>
10 <form action="{{request.route_url('lost_password_generate', _query=request.GET)}}" method="post"
11 <form action="{{request.route_url('lost_password_generate', _query=request.GET)}}" method="post"
11 class="decorate" id="lost_password">
12 class="decorate" id="lost_password">
12 {{widgets.render_form(form)}}
13 {{widgets.render_form(form)}}
13 </form>
14 </form>
14 </div>
15 </div>
15 {% endblock %}
16 {% endblock %}
@@ -1,88 +1,86 b''
1 {% extends "/layout.jinja2" %}
1 {% extends "/layout.jinja2" %}
2 {% block ng_controller %} data-ng-controller="RegisterController as
3 register" {% endblock %}
4 {% block content_class %}two-col equal{% endblock %}
2 {% block content_class %}two-col equal{% endblock %}
5 {% block section_name %}register-section{% endblock %}
3 {% block section_name %}register-section{% endblock %}
6
4 {% block app_block %}{% endblock %}
7 {% block page_title %}{% endblock %}
5 {% block page_title %}{% endblock %}
8
6
9 {% block content %}
7 {% block content %}
10 <div class="container">
8 <div class="container">
11
9
12 <div class="m-t-1 row">
10 <div class="m-t-1 row">
13 {{ widgets.render_flash_messages(flash_msgs) }}
11 {{ widgets.render_flash_messages(flash_msgs) }}
14 </div>
12 </div>
15 {% if social_plugins %}
13 {% if social_plugins %}
16 <div class="row">
14 <div class="row">
17
15
18 <div class="col-sm-12 text-center" id="social-form">
16 <div class="col-sm-12 text-center" id="social-form">
19
17
20 <h2>Log in or register using</h2>
18 <h2>Log in or register using</h2>
21 {% if social_plugins.get('google') %}
19 {% if social_plugins.get('google') %}
22 <a href="{{ request.route_url('social_auth', provider='google') }}"
20 <a href="{{ request.route_url('social_auth', provider='google') }}"
23 class="btn btn-default social" id="btn-google">
21 class="btn btn-default social" id="btn-google">
24 <span class="fa fa-google-plus-square fa-2x"></span> {{ _('Google') }}
22 <span class="fa fa-google-plus-square fa-2x"></span> {{ _('Google') }}
25 </a>
23 </a>
26 {% endif %}
24 {% endif %}
27 {% if social_plugins.get('twitter') %}
25 {% if social_plugins.get('twitter') %}
28 <a href="{{ request.route_url('social_auth', provider='twitter') }}"
26 <a href="{{ request.route_url('social_auth', provider='twitter') }}"
29 class="btn btn-default social" id="btn-twitter">
27 class="btn btn-default social" id="btn-twitter">
30 <span class="fa fa-twitter fa-2x"></span> {{ _('Twitter') }}
28 <span class="fa fa-twitter fa-2x"></span> {{ _('Twitter') }}
31 </a>
29 </a>
32 {% endif %}
30 {% endif %}
33 {% if social_plugins.get('bitbucket') %}
31 {% if social_plugins.get('bitbucket') %}
34 <a href="{{ request.route_url('social_auth', provider='bitbucket') }}"
32 <a href="{{ request.route_url('social_auth', provider='bitbucket') }}"
35 class="btn btn-default social" id="btn-bitbucket">
33 class="btn btn-default social" id="btn-bitbucket">
36 <span class="fa fa-bitbucket fa-2x"></span> {{ _(' Bitbucket') }}
34 <span class="fa fa-bitbucket fa-2x"></span> {{ _(' Bitbucket') }}
37 </a>
35 </a>
38 {% endif %}
36 {% endif %}
39 {% if social_plugins.get('github') %}
37 {% if social_plugins.get('github') %}
40 <a tooltip-placement="bottom"
38 <a tooltip-placement="bottom"
41 data-uib-tooltip="Why do you ask private repository permissions?
39 data-uib-tooltip="Why do you ask private repository permissions?
42 Unfortunately Github doesn't allow issue tracker integration
40 Unfortunately Github doesn't allow issue tracker integration
43 to send issues to private repositories without full repo access"
41 to send issues to private repositories without full repo access"
44 href="{{ request.route_url('social_auth', provider='github') }}"
42 href="{{ request.route_url('social_auth', provider='github') }}"
45 class="btn btn-default social" id="btn-github">
43 class="btn btn-default social" id="btn-github">
46 <span class="fa fa-github fa-2x"></span> {{ _('Github') }}
44 <span class="fa fa-github fa-2x"></span> {{ _('Github') }}
47 </a>
45 </a>
48 {% endif %}
46 {% endif %}
49
47
50 </div>
48 </div>
51 </div>
49 </div>
52 <hr/>
50 <hr/>
53
51
54 {% endif %}
52 {% endif %}
55
53
56 <div class="row">
54 <div class="row">
57
55
58 <div class="col-sm-5">
56 <div class="col-sm-5">
59 <div id="sign-in-form">
57 <div id="sign-in-form">
60 <h2 class="">Log in</h2>
58 <h2 class="">Log in</h2>
61 <form action="{{ request.route_url('ziggurat.routes.sign_in') }}"
59 <form action="{{ request.route_url('ziggurat.routes.sign_in') }}"
62 method="post">
60 method="post">
63 {{ widgets.render_form(sign_in_form) }}
61 {{ widgets.render_form(sign_in_form) }}
64 <input type="submit" class="btn btn-primary"
62 <input type="submit" class="btn btn-primary"
65 value="Sign In">
63 value="Sign In">
66 <a href="{{ request.route_url('lost_password') }}"
64 <a href="{{ request.route_url('lost_password') }}"
67 class="btn btn-info">{{ _('Lost password') }}</a>
65 class="btn btn-info">{{ _('Lost password') }}</a>
68 </form>
66 </form>
69 </div>
67 </div>
70
68
71 </div>
69 </div>
72
70
73
71
74 <div class="col-sm-6 col-sm-offset-1">
72 <div class="col-sm-6 col-sm-offset-1">
75 <div id="sign-up-form">
73 <div id="sign-up-form">
76 <h2>Register here</h2>
74 <h2>Register here</h2>
77 <form action="{{ request.route_url('register') }}"
75 <form action="{{ request.route_url('register') }}"
78 method="post" id="register_user">
76 method="post" id="register_user">
79 {{ widgets.render_form(form) }}
77 {{ widgets.render_form(form) }}
80 <input type="submit" class="btn btn-primary"
78 <input type="submit" class="btn btn-primary"
81 value="Register">
79 value="Register">
82 </form>
80 </form>
83 </div>
81 </div>
84 </div>
82 </div>
85
83
86 </div>
84 </div>
87 </div>
85 </div>
88 {% endblock %}
86 {% endblock %}
@@ -1,242 +1,242 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2
2
3 # Copyright (C) 2010-2016 RhodeCode GmbH
3 # Copyright (C) 2010-2016 RhodeCode GmbH
4 #
4 #
5 # This program is free software: you can redistribute it and/or modify
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License, version 3
6 # it under the terms of the GNU Affero General Public License, version 3
7 # (only), as published by the Free Software Foundation.
7 # (only), as published by the Free Software Foundation.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU Affero General Public License
14 # You should have received a copy of the GNU Affero General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16 #
16 #
17 # This program is dual-licensed. If you wish to learn more about the
17 # This program is dual-licensed. If you wish to learn more about the
18 # AppEnlight Enterprise Edition, including its added features, Support
18 # AppEnlight Enterprise Edition, including its added features, Support
19 # services, and proprietary license terms, please see
19 # services, and proprietary license terms, please see
20 # https://rhodecode.com/licenses/
20 # https://rhodecode.com/licenses/
21
21
22 import datetime
22 import datetime
23 import logging
23 import logging
24 import uuid
24 import uuid
25
25
26 import pyramid.security as security
26 import pyramid.security as security
27
27
28 from pyramid.view import view_config
28 from pyramid.view import view_config
29 from pyramid.httpexceptions import HTTPFound
29 from pyramid.httpexceptions import HTTPFound
30 from pyramid.response import Response
30 from pyramid.response import Response
31 from pyramid.security import NO_PERMISSION_REQUIRED
31 from pyramid.security import NO_PERMISSION_REQUIRED
32 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignInSuccess
32 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignInSuccess
33 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignInBadAuth
33 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignInBadAuth
34 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignOut
34 from ziggurat_foundations.ext.pyramid.sign_in import ZigguratSignOut
35
35
36 from appenlight.lib.social import handle_social_data
36 from appenlight.lib.social import handle_social_data
37 from appenlight.models import DBSession
37 from appenlight.models import DBSession
38 from appenlight.models.user import User
38 from appenlight.models.user import User
39 from appenlight.models.services.user import UserService
39 from appenlight.models.services.user import UserService
40 from appenlight.subscribers import _
40 from appenlight.subscribers import _
41 from appenlight import forms
41 from appenlight import forms
42 from webob.multidict import MultiDict
42 from webob.multidict import MultiDict
43
43
44 log = logging.getLogger(__name__)
44 log = logging.getLogger(__name__)
45
45
46
46
47 @view_config(context=ZigguratSignInSuccess, permission=NO_PERMISSION_REQUIRED)
47 @view_config(context=ZigguratSignInSuccess, permission=NO_PERMISSION_REQUIRED)
48 def sign_in(request):
48 def sign_in(request):
49 """
49 """
50 Performs sign in by sending proper user identification headers
50 Performs sign in by sending proper user identification headers
51 Regenerates CSRF token
51 Regenerates CSRF token
52 """
52 """
53 user = request.context.user
53 user = request.context.user
54 if user.status == 1:
54 if user.status == 1:
55 request.session.new_csrf_token()
55 request.session.new_csrf_token()
56 user.last_login_date = datetime.datetime.utcnow()
56 user.last_login_date = datetime.datetime.utcnow()
57 social_data = request.session.get('zigg.social_auth')
57 social_data = request.session.get('zigg.social_auth')
58 if social_data:
58 if social_data:
59 handle_social_data(request, user, social_data)
59 handle_social_data(request, user, social_data)
60 else:
60 else:
61 request.session.flash(_('Account got disabled'))
61 request.session.flash(_('Account got disabled'))
62
62
63 if request.context.came_from != '/':
63 if request.context.came_from != '/':
64 return HTTPFound(location=request.context.came_from,
64 return HTTPFound(location=request.context.came_from,
65 headers=request.context.headers)
65 headers=request.context.headers)
66 else:
66 else:
67 return HTTPFound(location=request.route_url('/'),
67 return HTTPFound(location=request.route_url('/'),
68 headers=request.context.headers)
68 headers=request.context.headers)
69
69
70
70
71 @view_config(context=ZigguratSignInBadAuth, permission=NO_PERMISSION_REQUIRED)
71 @view_config(context=ZigguratSignInBadAuth, permission=NO_PERMISSION_REQUIRED)
72 def bad_auth(request):
72 def bad_auth(request):
73 """
73 """
74 Handles incorrect login flow
74 Handles incorrect login flow
75 """
75 """
76 request.session.flash(_('Incorrect username or password'), 'warning')
76 request.session.flash(_('Incorrect username or password'), 'warning')
77 return HTTPFound(location=request.route_url('register'),
77 return HTTPFound(location=request.route_url('register'),
78 headers=request.context.headers)
78 headers=request.context.headers)
79
79
80
80
81 @view_config(context=ZigguratSignOut, permission=NO_PERMISSION_REQUIRED)
81 @view_config(context=ZigguratSignOut, permission=NO_PERMISSION_REQUIRED)
82 def sign_out(request):
82 def sign_out(request):
83 """
83 """
84 Removes user identification cookie
84 Removes user identification cookie
85 """
85 """
86 return HTTPFound(location=request.route_url('register'),
86 return HTTPFound(location=request.route_url('register'),
87 headers=request.context.headers)
87 headers=request.context.headers)
88
88
89
89
90 @view_config(route_name='lost_password',
90 @view_config(route_name='lost_password',
91 renderer='appenlight:templates/user/lost_password.jinja2',
91 renderer='appenlight:templates/user/lost_password.jinja2',
92 permission=NO_PERMISSION_REQUIRED)
92 permission=NO_PERMISSION_REQUIRED)
93 def lost_password(request):
93 def lost_password(request):
94 """
94 """
95 Presents lost password page - sends password reset link to
95 Presents lost password page - sends password reset link to
96 specified email address.
96 specified email address.
97 This link is valid only for 10 minutes
97 This link is valid only for 10 minutes
98 """
98 """
99 form = forms.LostPasswordForm(request.POST, csrf_context=request)
99 form = forms.LostPasswordForm(request.POST, csrf_context=request)
100 if request.method == 'POST' and form.validate():
100 if request.method == 'POST' and form.validate():
101 user = User.by_email(form.email.data)
101 user = User.by_email(form.email.data)
102 if user:
102 if user:
103 user.regenerate_security_code()
103 user.regenerate_security_code()
104 user.security_code_date = datetime.datetime.utcnow()
104 user.security_code_date = datetime.datetime.utcnow()
105 email_vars = {
105 email_vars = {
106 'user': user,
106 'user': user,
107 'request': request,
107 'request': request,
108 'email_title': "AppEnlight :: New password request"
108 'email_title': "AppEnlight :: New password request"
109 }
109 }
110 UserService.send_email(
110 UserService.send_email(
111 request, recipients=[user.email],
111 request, recipients=[user.email],
112 variables=email_vars,
112 variables=email_vars,
113 template='/email_templates/lost_password.jinja2')
113 template='/email_templates/lost_password.jinja2')
114 msg = 'Password reset email had been sent. ' \
114 msg = 'Password reset email had been sent. ' \
115 'Please check your mailbox for further instructions.'
115 'Please check your mailbox for further instructions.'
116 request.session.flash(_(msg))
116 request.session.flash(_(msg))
117 return HTTPFound(location=request.route_url('lost_password'))
117 return HTTPFound(location=request.route_url('lost_password'))
118 return {"form": form}
118 return {"form": form}
119
119
120
120
121 @view_config(route_name='lost_password_generate',
121 @view_config(route_name='lost_password_generate',
122 permission=NO_PERMISSION_REQUIRED,
122 permission=NO_PERMISSION_REQUIRED,
123 renderer='appenlight:templates/user/lost_password_generate.jinja2')
123 renderer='appenlight:templates/user/lost_password_generate.jinja2')
124 def lost_password_generate(request):
124 def lost_password_generate(request):
125 """
125 """
126 Shows new password form - perform time check and set new password for user
126 Shows new password form - perform time check and set new password for user
127 """
127 """
128 user = User.by_user_name_and_security_code(
128 user = User.by_user_name_and_security_code(
129 request.GET.get('user_name'), request.GET.get('security_code'))
129 request.GET.get('user_name'), request.GET.get('security_code'))
130 if user:
130 if user:
131 delta = datetime.datetime.utcnow() - user.security_code_date
131 delta = datetime.datetime.utcnow() - user.security_code_date
132
132
133 if user and delta.total_seconds() < 600:
133 if user and delta.total_seconds() < 600:
134 form = forms.NewPasswordForm(request.POST, csrf_context=request)
134 form = forms.NewPasswordForm(request.POST, csrf_context=request)
135 if request.method == "POST" and form.validate():
135 if request.method == "POST" and form.validate():
136 user.set_password(form.new_password.data)
136 user.set_password(form.new_password.data)
137 request.session.flash(_('You can sign in with your new password.'))
137 request.session.flash(_('You can sign in with your new password.'))
138 return HTTPFound(location=request.route_url('register'))
138 return HTTPFound(location=request.route_url('register'))
139 else:
139 else:
140 return {"form": form}
140 return {"form": form}
141 else:
141 else:
142 return Response('Security code expired')
142 return Response('Security code expired')
143
143
144
144
145 @view_config(route_name='register',
145 @view_config(route_name='register',
146 renderer='appenlight:templates/user/register.jinja2',
146 renderer='appenlight:templates/user/register.jinja2',
147 permission=NO_PERMISSION_REQUIRED)
147 permission=NO_PERMISSION_REQUIRED)
148 def register(request):
148 def register(request):
149 """
149 """
150 Render register page with form
150 Render register page with form
151 Also handles oAuth flow for registration
151 Also handles oAuth flow for registration
152 """
152 """
153 login_url = request.route_url('ziggurat.routes.sign_in')
153 login_url = request.route_url('ziggurat.routes.sign_in')
154 if request.query_string:
154 if request.query_string:
155 query_string = '?%s' % request.query_string
155 query_string = '?%s' % request.query_string
156 else:
156 else:
157 query_string = ''
157 query_string = ''
158 referrer = '%s%s' % (request.path, query_string)
158 referrer = '%s%s' % (request.path, query_string)
159
159
160 if referrer in [login_url, '/register', '/register?sign_in=1']:
160 if referrer in [login_url, '/register', '/register?sign_in=1']:
161 referrer = '/' # never use the login form itself as came_from
161 referrer = '/' # never use the login form itself as came_from
162 sign_in_form = forms.SignInForm(
162 sign_in_form = forms.SignInForm(
163 came_from=request.params.get('came_from', referrer),
163 came_from=request.params.get('came_from', referrer),
164 csrf_context=request)
164 csrf_context=request)
165
165
166 # populate form from oAuth session data returned by authomatic
166 # populate form from oAuth session data returned by authomatic
167 social_data = request.session.get('zigg.social_auth')
167 social_data = request.session.get('zigg.social_auth')
168 if request.method != 'POST' and social_data:
168 if request.method != 'POST' and social_data:
169 log.debug(social_data)
169 log.debug(social_data)
170 user_name = social_data['user'].get('user_name', '').split('@')[0]
170 user_name = social_data['user'].get('user_name', '').split('@')[0]
171 form_data = {
171 form_data = {
172 'user_name': user_name,
172 'user_name': user_name,
173 'email': social_data['user'].get('email')
173 'email': social_data['user'].get('email')
174 }
174 }
175 form_data['user_password'] = str(uuid.uuid4())
175 form_data['user_password'] = str(uuid.uuid4())
176 form = forms.UserRegisterForm(MultiDict(form_data),
176 form = forms.UserRegisterForm(MultiDict(form_data),
177 csrf_context=request)
177 csrf_context=request)
178 form.user_password.widget.hide_value = False
178 form.user_password.widget.hide_value = False
179 else:
179 else:
180 form = forms.UserRegisterForm(request.POST, csrf_context=request)
180 form = forms.UserRegisterForm(request.POST, csrf_context=request)
181 if request.method == 'POST' and form.validate():
181 if request.method == 'POST' and form.validate():
182 log.info('registering user')
182 log.info('registering user')
183 # insert new user here
183 # insert new user here
184 new_user = User()
184 new_user = User()
185 DBSession.add(new_user)
185 DBSession.add(new_user)
186 form.populate_obj(new_user)
186 form.populate_obj(new_user)
187 new_user.regenerate_security_code()
187 new_user.regenerate_security_code()
188 new_user.status = 1
188 new_user.status = 1
189 new_user.set_password(new_user.user_password)
189 new_user.set_password(new_user.user_password)
190 new_user.registration_ip = request.environ.get('REMOTE_ADDR')
190 new_user.registration_ip = request.environ.get('REMOTE_ADDR')
191
191
192 if social_data:
192 if social_data:
193 handle_social_data(request, new_user, social_data)
193 handle_social_data(request, new_user, social_data)
194
194
195 email_vars = {'user': new_user,
195 email_vars = {'user': new_user,
196 'request': request,
196 'request': request,
197 'email_title': "AppEnlight :: Start information"}
197 'email_title': "AppEnlight :: Start information"}
198 UserService.send_email(
198 UserService.send_email(
199 request, recipients=[new_user.email], variables=email_vars,
199 request, recipients=[new_user.email], variables=email_vars,
200 template='/email_templates/registered.jinja2')
200 template='/email_templates/registered.jinja2')
201 request.session.flash(_('You have successfully registered.'))
201 request.session.flash(_('You have successfully registered.'))
202 DBSession.flush()
202 DBSession.flush()
203 headers = security.remember(request, new_user.id)
203 headers = security.remember(request, new_user.id)
204 return HTTPFound(location=request.route_url('/'),
204 return HTTPFound(location=request.route_url('/'),
205 headers=headers)
205 headers=headers)
206 settings = request.registry.settings
206 settings = request.registry.settings
207 social_plugins = {}
207 social_plugins = {}
208 if settings.get('authomatic.pr.twitter.key', ''):
208 if settings.get('authomatic.pr.twitter.key', ''):
209 social_plugins['twitter'] = True
209 social_plugins['twitter'] = True
210 if settings.get('authomatic.pr.google.key', ''):
210 if settings.get('authomatic.pr.google.key', ''):
211 social_plugins['google'] = True
211 social_plugins['google'] = True
212 if settings.get('authomatic.pr.github.key', ''):
212 if settings.get('authomatic.pr.github.key', ''):
213 social_plugins['github'] = True
213 social_plugins['github'] = True
214 if settings.get('authomatic.pr.bitbucket.key', ''):
214 if settings.get('authomatic.pr.bitbucket.key', ''):
215 social_plugins['bitbucket'] = True
215 social_plugins['bitbucket'] = True
216
216
217 return {
217 return {
218 "form": form,
218 "form": form,
219 "sign_in_form": sign_in_form,
219 "sign_in_form": sign_in_form,
220 "social_plugins": social_plugins
220 "social_plugins": social_plugins
221 }
221 }
222
222
223
223
224 @view_config(route_name='/',
224 @view_config(route_name='/',
225 renderer='appenlight:templates/dashboard/index.jinja2',
225 renderer='appenlight:templates/app.jinja2',
226 permission=NO_PERMISSION_REQUIRED)
226 permission=NO_PERMISSION_REQUIRED)
227 @view_config(route_name='angular_app_ui',
227 @view_config(route_name='angular_app_ui',
228 renderer='appenlight:templates/dashboard/index.jinja2',
228 renderer='appenlight:templates/app.jinja2',
229 permission=NO_PERMISSION_REQUIRED)
229 permission=NO_PERMISSION_REQUIRED)
230 @view_config(route_name='angular_app_ui_ix',
230 @view_config(route_name='angular_app_ui_ix',
231 renderer='appenlight:templates/dashboard/index.jinja2',
231 renderer='appenlight:templates/app.jinja2',
232 permission=NO_PERMISSION_REQUIRED)
232 permission=NO_PERMISSION_REQUIRED)
233 def app_main_index(request):
233 def app_main_index(request):
234 """
234 """
235 Render dashoard/report browser page page along with:
235 Render dashoard/report browser page page along with:
236 - flash messages
236 - flash messages
237 - application list
237 - application list
238 - assigned reports
238 - assigned reports
239 - latest events
239 - latest events
240 (those last two come from subscribers.py that sets global renderer variables)
240 (those last two come from subscribers.py that sets global renderer variables)
241 """
241 """
242 return {}
242 return {}
@@ -1,199 +1,201 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 'use strict';
20 'use strict';
21
21
22 // Declare app level module which depends on filters, and services
22 // Declare app level module which depends on filters, and services
23 angular.module('appenlight.base', [
23 angular.module('appenlight.base', [
24 'ngRoute',
24 'ngRoute',
25 'ui.router',
25 'ui.router',
26 'ui.router.router',
26 'ui.router.router',
27 'underscore',
27 'underscore',
28 'ui.bootstrap',
28 'ui.bootstrap',
29 'ngResource',
29 'ngResource',
30 'ngAnimate',
30 'ngAnimate',
31 'ngCookies',
31 'ngCookies',
32 'smart-table',
32 'smart-table',
33 'angular-toArrayFilter',
33 'angular-toArrayFilter',
34 'mentio'
34 'mentio'
35 ]);
35 ]);
36
36
37 angular.module('appenlight.filters', []);
37 angular.module('appenlight.filters', []);
38 angular.module('appenlight.templates', []);
38 angular.module('appenlight.templates', []);
39 angular.module('appenlight.controllers', [
39 angular.module('appenlight.controllers', [
40 'appenlight.base'
40 'appenlight.base'
41 ]);
41 ]);
42 angular.module('appenlight.components', [
42 angular.module('appenlight.components', [
43 'appenlight.components.channelstream'
43 'appenlight.components.channelstream',
44 'appenlight.components.appenlightApp',
45 'appenlight.components.appenlightHeader'
44 ]);
46 ]);
45 angular.module('appenlight.directives', [
47 angular.module('appenlight.directives', [
46 'appenlight.directives.appVersion',
48 'appenlight.directives.appVersion',
47 'appenlight.directives.c3chart',
49 'appenlight.directives.c3chart',
48 'appenlight.directives.confirmValidate',
50 'appenlight.directives.confirmValidate',
49 'appenlight.directives.focus',
51 'appenlight.directives.focus',
50 'appenlight.directives.formErrors',
52 'appenlight.directives.formErrors',
51 'appenlight.directives.humanFormat',
53 'appenlight.directives.humanFormat',
52 'appenlight.directives.isoToRelativeTime',
54 'appenlight.directives.isoToRelativeTime',
53 'appenlight.directives.permissionsForm',
55 'appenlight.directives.permissionsForm',
54 'appenlight.directives.smallReportGroupList',
56 'appenlight.directives.smallReportGroupList',
55 'appenlight.directives.smallReportList',
57 'appenlight.directives.smallReportList',
56 'appenlight.directives.pluginConfig',
58 'appenlight.directives.pluginConfig',
57 'appenlight.directives.recursive',
59 'appenlight.directives.recursive',
58 'appenlight.directives.reportAlertAction',
60 'appenlight.directives.reportAlertAction',
59 'appenlight.directives.postProcessAction',
61 'appenlight.directives.postProcessAction',
60 'appenlight.directives.rule',
62 'appenlight.directives.rule',
61 'appenlight.directives.ruleReadOnly'
63 'appenlight.directives.ruleReadOnly'
62 ]);
64 ]);
63 angular.module('appenlight.services', [
65 angular.module('appenlight.services', [
64 'appenlight.services.chartResultParser',
66 'appenlight.services.chartResultParser',
65 'appenlight.services.resources',
67 'appenlight.services.resources',
66 'appenlight.services.stateHolder',
68 'appenlight.services.stateHolder',
67 'appenlight.services.typeAheadTagHelper',
69 'appenlight.services.typeAheadTagHelper',
68 'appenlight.services.UUIDProvider'
70 'appenlight.services.UUIDProvider'
69 ]).value('version', '0.1');
71 ]).value('version', '0.1');
70
72
71
73
72 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
74 var pluginsToLoad = _.map(decodeEncodedJSON(window.AE.plugins),
73 function(item){
75 function(item){
74 return item.config.angular_module
76 return item.config.angular_module
75 });
77 });
76 console.log(pluginsToLoad);
78 console.log(pluginsToLoad);
77 angular.module('appenlight.plugins', pluginsToLoad);
79 angular.module('appenlight.plugins', pluginsToLoad);
78
80
79 var app = angular.module('appenlight', [
81 var app = angular.module('appenlight', [
80 'appenlight.base',
82 'appenlight.base',
81 'appenlight.config',
83 'appenlight.config',
82 'appenlight.templates',
84 'appenlight.templates',
83 'appenlight.filters',
85 'appenlight.filters',
84 'appenlight.services',
86 'appenlight.services',
85 'appenlight.directives',
87 'appenlight.directives',
86 'appenlight.controllers',
88 'appenlight.controllers',
87 'appenlight.components',
89 'appenlight.components',
88 'appenlight.plugins'
90 'appenlight.plugins'
89 ]);
91 ]);
90
92
91 // needs manual execution because of plugin files
93 // needs manual execution because of plugin files
92 function kickstartAE(initialUserData) {
94 function kickstartAE(initialUserData) {
93 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
95 app.config(['$httpProvider', '$uibTooltipProvider', '$locationProvider', function ($httpProvider, $uibTooltipProvider, $locationProvider) {
94 $locationProvider.html5Mode(true);
96 $locationProvider.html5Mode(true);
95 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
97 $httpProvider.interceptors.push(['$q', '$rootScope', '$timeout', 'stateHolder', function ($q, $rootScope, $timeout, stateHolder) {
96 return {
98 return {
97 'response': function (response) {
99 'response': function (response) {
98 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
100 var flashMessages = angular.fromJson(response.headers('x-flash-messages'));
99 if (flashMessages && flashMessages.length > 0) {
101 if (flashMessages && flashMessages.length > 0) {
100 stateHolder.flashMessages.extend(flashMessages);
102 stateHolder.flashMessages.extend(flashMessages);
101 }
103 }
102 return response;
104 return response;
103 },
105 },
104 'responseError': function (rejection) {
106 'responseError': function (rejection) {
105 if (rejection.status > 299 && rejection.status !== 422) {
107 if (rejection.status > 299 && rejection.status !== 422) {
106 stateHolder.flashMessages.extend([{
108 stateHolder.flashMessages.extend([{
107 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
109 msg: 'Response status code: ' + rejection.status + ', "' + rejection.statusText + '", url: ' + rejection.config.url,
108 type: 'error'
110 type: 'error'
109 }]);
111 }]);
110 }
112 }
111 if (rejection.status == 0) {
113 if (rejection.status == 0) {
112 stateHolder.flashMessages.extend([{
114 stateHolder.flashMessages.extend([{
113 msg: 'Response timeout',
115 msg: 'Response timeout',
114 type: 'error'
116 type: 'error'
115 }]);
117 }]);
116 }
118 }
117 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
119 var flashMessages = angular.fromJson(rejection.headers('x-flash-messages'));
118 if (flashMessages && flashMessages.length > 0) {
120 if (flashMessages && flashMessages.length > 0) {
119 stateHolder.flashMessages.extend(flashMessages);
121 stateHolder.flashMessages.extend(flashMessages);
120 }
122 }
121
123
122 return $q.reject(rejection);
124 return $q.reject(rejection);
123 }
125 }
124 }
126 }
125 }]);
127 }]);
126
128
127 $uibTooltipProvider.options({appendToBody: true});
129 $uibTooltipProvider.options({appendToBody: true});
128
130
129 }]);
131 }]);
130
132
131
133
132 app.config(function ($provide) {
134 app.config(function ($provide) {
133 $provide.decorator("$exceptionHandler", function ($delegate) {
135 $provide.decorator("$exceptionHandler", function ($delegate) {
134 return function (exception, cause) {
136 return function (exception, cause) {
135 $delegate(exception, cause);
137 $delegate(exception, cause);
136 if (typeof AppEnlight !== 'undefined') {
138 if (typeof AppEnlight !== 'undefined') {
137 AppEnlight.grabError(exception);
139 AppEnlight.grabError(exception);
138 }
140 }
139 };
141 };
140 });
142 });
141 });
143 });
142
144
143 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
145 app.run(['$rootScope', '$timeout', 'stateHolder', '$state', '$location', '$transitions', '$window', 'AeConfig',
144 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
146 function ($rootScope, $timeout, stateHolder, $state, $location, $transitions, $window, AeConfig) {
145 if (initialUserData){
147 if (initialUserData){
146 stateHolder.AeUser.update(initialUserData);
148 stateHolder.AeUser.update(initialUserData);
147 }
149 }
148 $rootScope.$state = $state;
150 $rootScope.$state = $state;
149 $rootScope.stateHolder = stateHolder;
151 $rootScope.stateHolder = stateHolder;
150 $rootScope.flash = stateHolder.flashMessages.list;
152 $rootScope.flash = stateHolder.flashMessages.list;
151 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
153 $rootScope.closeAlert = stateHolder.flashMessages.closeAlert;
152 $rootScope.AeConfig = AeConfig;
154 $rootScope.AeConfig = AeConfig;
153
155
154 var transitionApp = function($transition$, $state) {
156 var transitionApp = function($transition$, $state) {
155 // redirect user to /register unless its one of open views
157 // redirect user to /register unless its one of open views
156 var isGuestState = [
158 var isGuestState = [
157 'report.view_detail',
159 'report.view_detail',
158 'report.view_group',
160 'report.view_group',
159 'dashboard.view'
161 'dashboard.view'
160 ].indexOf($transition$.to().name) !== -1;
162 ].indexOf($transition$.to().name) !== -1;
161
163
162 var path = $window.location.pathname;
164 var path = $window.location.pathname;
163 // strip trailing slash
165 // strip trailing slash
164 if (path.substr(path.length - 1) === '/') {
166 if (path.substr(path.length - 1) === '/') {
165 path = path.substr(0, path.length - 1);
167 path = path.substr(0, path.length - 1);
166 }
168 }
167 var isOpenView = false;
169 var isOpenView = false;
168 var openViews = [
170 var openViews = [
169 AeConfig.urls.otherRoutes.lostPassword,
171 AeConfig.urls.otherRoutes.lostPassword,
170 AeConfig.urls.otherRoutes.lostPasswordGenerate
172 AeConfig.urls.otherRoutes.lostPasswordGenerate
171 ];
173 ];
172 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
174 console.log('$transitions.onBefore', path, $transition$.to().name, $state);
173 _.each(openViews, function (url) {
175 _.each(openViews, function (url) {
174 var url = '/' + url.split('/').slice(3).join('/');
176 var url = '/' + url.split('/').slice(3).join('/');
175 if (url === path) {
177 if (url === path) {
176 isOpenView = true;
178 isOpenView = true;
177 }
179 }
178 });
180 });
179 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
181 if (stateHolder.AeUser.id === null && !isGuestState && !isOpenView) {
180 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
182 if (window.location.toString().indexOf(AeConfig.urls.otherRoutes.register) === -1) {
181 console.log('redirect to register');
183 console.log('redirect to register');
182 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
184 var newLocation = AeConfig.urls.otherRoutes.register + '?came_from=' + encodeURIComponent(window.location);
183 // fix infinite digest here
185 // fix infinite digest here
184 $rootScope.$on('$locationChangeStart',
186 $rootScope.$on('$locationChangeStart',
185 function(event, toState, toParams, fromState, fromParams, options){
187 function(event, toState, toParams, fromState, fromParams, options){
186 event.preventDefault();
188 event.preventDefault();
187 $window.location = newLocation;
189 $window.location = newLocation;
188 });
190 });
189 $window.location = newLocation;
191 $window.location = newLocation;
190 return false;
192 return false;
191 }
193 }
192 return false;
194 return false;
193 }
195 }
194 return true;
196 return true;
195 };
197 };
196 $transitions.onBefore({}, transitionApp);
198 $transitions.onBefore({}, transitionApp);
197
199
198 }]);
200 }]);
199 }
201 }
@@ -1,56 +1,58 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.controllers')
20 angular.module('appenlight.components.appenlightHeader', [])
21 .controller('HeaderCtrl', HeaderCtrl);
21 .component('appenlightHeader', {
22 templateUrl: 'templates/components/appenlight-header.html',
23 controller: AppEnlightHeaderController
24 });
22
25
23 HeaderCtrl.$inject = ['$state', 'stateHolder'];
26 ChannelstreamController.$inject = ['$state', 'stateHolder', 'AeConfig'];
24
27
25 function HeaderCtrl($state, stateHolder) {
28 function AppEnlightHeaderController($state, stateHolder, AeConfig){
26 var vm = this;
29 var vm = this;
30 vm.AeConfig = AeConfig;
27 vm.stateHolder = stateHolder;
31 vm.stateHolder = stateHolder;
28 vm.assignedReports = stateHolder.AeUser.assigned_reports;
32 vm.assignedReports = stateHolder.AeUser.assigned_reports;
29 vm.latestEvents = stateHolder.AeUser.latest_events;
33 vm.latestEvents = stateHolder.AeUser.latest_events;
30 vm.activeEvents = 0;
34 vm.activeEvents = 0;
31 _.each(vm.latestEvents, function (event) {
35 _.each(vm.latestEvents, function (event) {
32 if (event.status === 1 && event.end_date === null) {
36 if (event.status === 1 && event.end_date === null) {
33 vm.activeEvents += 1;
37 vm.activeEvents += 1;
34 }
38 }
35 });
39 });
36
40
37 vm.clickedEvent = function(event){
41 vm.clickedEvent = function(event){
38 console.log(event);
39 // (from Event model)
40 // exception reports
42 // exception reports
41 if (_.contains([1,2], event.event_type)){
43 if (_.contains([1,2], event.event_type)){
42 $state.go('report.list', {resource:event.resource_id, start_date:event.start_date});
44 $state.go('report.list', {resource:event.resource_id, start_date:event.start_date});
43 }
45 }
44 // slowness reports
46 // slowness reports
45 else if (_.contains([3,4], event.event_type)){
47 else if (_.contains([3,4], event.event_type)){
46 $state.go('report.list_slow', {resource:event.resource_id, start_date:event.start_date});
48 $state.go('report.list_slow', {resource:event.resource_id, start_date:event.start_date});
47 }
49 }
48 // uptime reports
50 // uptime reports
49 else if (_.contains([7,8], event.event_type)){
51 else if (_.contains([7,8], event.event_type)){
50 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
52 $state.go('uptime', {resource:event.resource_id, start_date:event.start_date});
51 }
53 }
52 else{
54 else{
53 console.log('other');
55 console.log('other');
54 }
56 }
55 }
57 }
56 }
58 }
@@ -1,62 +1,62 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.components.channelstream', [])
20 angular.module('appenlight.components.channelstream', [])
21 .component('channelstream', {
21 .component('channelstream', {
22 controller: ChannelstreamController,
22 controller: ChannelstreamController,
23 bindings: {
23 bindings: {
24 config: '='
24 config: '='
25 }
25 }
26 });
26 });
27
27
28 ChannelstreamController.$inject = ['$rootScope', 'stateHolder', 'userSelfPropertyResource'];
28 ChannelstreamController.$inject = ['$rootScope', 'stateHolder', 'userSelfPropertyResource'];
29
29
30 function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResource){
30 function ChannelstreamController($rootScope, stateHolder, userSelfPropertyResource){
31 if (stateHolder.AeUser.id === null){
31 if (stateHolder.AeUser.id === null){
32 return
32 return
33 }
33 }
34 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
34 userSelfPropertyResource.get({key: 'websocket'}, function (data) {
35 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
35 stateHolder.websocket = new ReconnectingWebSocket(this.config.ws_url + '/ws?conn_id=' + data.conn_id);
36 stateHolder.websocket.onopen = function (event) {
36 stateHolder.websocket.onopen = function (event) {
37 console.log('open');
37 console.log('open');
38 };
38 };
39 stateHolder.websocket.onmessage = function (event) {
39 stateHolder.websocket.onmessage = function (event) {
40 var data = JSON.parse(event.data);
40 var data = JSON.parse(event.data);
41 $rootScope.$apply(function (scope) {
41 $rootScope.$apply(function (scope) {
42 _.each(data, function (message) {
42 _.each(data, function (message) {
43 console.log('channelstream-message', message);
43 console.log('channelstream-message', message);
44 if(typeof message.message.topic !== 'undefined'){
44 if(typeof message.message.topic !== 'undefined'){
45 $rootScope.$broadcast(
45 $rootScope.$emit(
46 'channelstream-message.'+message.message.topic, message);
46 'channelstream-message.'+message.message.topic, message);
47 }
47 }
48 else{
48 else{
49 $rootScope.$broadcast('channelstream-message', message);
49 $rootScope.$emit('channelstream-message', message);
50 }
50 }
51 });
51 });
52 });
52 });
53 };
53 };
54 stateHolder.websocket.onclose = function (event) {
54 stateHolder.websocket.onclose = function (event) {
55 console.log('closed');
55 console.log('closed');
56 };
56 };
57
57
58 stateHolder.websocket.onerror = function (event) {
58 stateHolder.websocket.onerror = function (event) {
59 console.log('error');
59 console.log('error');
60 };
60 };
61 }.bind(this));
61 }.bind(this));
62 }
62 }
@@ -1,35 +1,35 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 var aeconfig = angular.module('appenlight.config', []);
20 var aeconfig = angular.module('appenlight.config', []);
21 aeconfig.factory('AeConfig', function () {
21 aeconfig.factory('AeConfig', function () {
22 var obj = {};
22 var obj = {};
23 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
23 obj.flashMessages = decodeEncodedJSON(window.AE.flash_messages);
24 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
24 obj.timeOptions = decodeEncodedJSON(window.AE.timeOptions);
25 obj.plugins = decodeEncodedJSON(window.AE.plugins);
25 obj.plugins = decodeEncodedJSON(window.AE.plugins);
26 obj.topNav = decodeEncodedJSON(window.AE.topNav);
26 obj.ws_url = window.AE.ws_url;
27 obj.ws_url = window.AE.ws_url;
27 obj.urls = window.AE.urls;
28 obj.urls = window.AE.urls;
28
29 // set keys on values because we wont be able to retrieve them everywhere
29 // set keys on values because we wont be able to retrieve them everywhere
30 for (var key in obj.timeOptions) {
30 for (var key in obj.timeOptions) {
31 obj.timeOptions[key]['key'] = key;
31 obj.timeOptions[key]['key'] = key;
32 }
32 }
33 console.info('config', obj);
33 console.info('config', obj);
34 return obj;
34 return obj;
35 });
35 });
@@ -1,668 +1,667 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.controllers')
20 angular.module('appenlight.controllers')
21 .controller('IndexDashboardController', IndexDashboardController);
21 .controller('IndexDashboardController', IndexDashboardController);
22
22
23 IndexDashboardController.$inject = ['$scope', '$location','$cookies', '$interval', 'stateHolder', 'userSelfPropertyResource', 'applicationsPropertyResource', 'AeConfig'];
23 IndexDashboardController.$inject = ['$rootScope', '$scope', '$location','$cookies', '$interval', 'stateHolder', 'applicationsPropertyResource', 'AeConfig'];
24
24
25 function IndexDashboardController($scope, $location, $cookies, $interval, stateHolder, userSelfPropertyResource, applicationsPropertyResource, AeConfig) {
25 function IndexDashboardController($rootScope, $scope, $location, $cookies, $interval, stateHolder, applicationsPropertyResource, AeConfig) {
26 var vm = this;
26 var vm = this;
27 stateHolder.section = 'dashboard';
27 stateHolder.section = 'dashboard';
28 vm.timeOptions = {};
28 vm.timeOptions = {};
29 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
29 var allowed = ['1h', '4h', '12h', '24h', '1w', '2w', '1M'];
30 _.each(allowed, function (key) {
30 _.each(allowed, function (key) {
31 if (allowed.indexOf(key) !== -1) {
31 if (allowed.indexOf(key) !== -1) {
32 vm.timeOptions[key] = AeConfig.timeOptions[key];
32 vm.timeOptions[key] = AeConfig.timeOptions[key];
33 }
33 }
34 });
34 });
35 vm.stateHolder = stateHolder;
35 vm.urls = AeConfig.urls;
36 vm.urls = AeConfig.urls;
36 vm.applications = stateHolder.AeUser.applications_map;
37 vm.applications = stateHolder.AeUser.applications_map;
37 vm.show_dashboard = false;
38 vm.show_dashboard = false;
38 vm.resource = null;
39 vm.resource = null;
39 vm.graphType = {selected: null};
40 vm.graphType = {selected: null};
40 vm.timeSpan = vm.timeOptions['1h'];
41 vm.timeSpan = vm.timeOptions['1h'];
41 vm.trendingReports = [];
42 vm.trendingReports = [];
42 vm.exceptions = 0;
43 vm.exceptions = 0;
43 vm.satisfyingRequests = 0;
44 vm.satisfyingRequests = 0;
44 vm.toleratedRequests = 0;
45 vm.toleratedRequests = 0;
45 vm.frustratingRequests = 0;
46 vm.frustratingRequests = 0;
46 vm.uptimeStats = 0;
47 vm.uptimeStats = 0;
47 vm.apdexStats = [];
48 vm.apdexStats = [];
48 vm.seriesRequestsData = [];
49 vm.seriesRequestsData = [];
49 vm.seriesMetricsData = [];
50 vm.seriesMetricsData = [];
50 vm.seriesSlowData = [];
51 vm.seriesSlowData = [];
51 vm.slowCalls = [];
52 vm.slowCalls = [];
52 vm.slowURIS = [];
53 vm.slowURIS = [];
53
54
54 vm.reportChartConfig = {
55 vm.reportChartConfig = {
55 data: {
56 data: {
56 json: [],
57 json: [],
57 xFormat: '%Y-%m-%dT%H:%M:%S'
58 xFormat: '%Y-%m-%dT%H:%M:%S'
58 },
59 },
59 color: {
60 color: {
60 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
61 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
61 },
62 },
62 axis: {
63 axis: {
63 x: {
64 x: {
64 type: 'timeseries',
65 type: 'timeseries',
65 tick: {
66 tick: {
66 culling: {
67 culling: {
67 max: 6 // the number of tick texts will be adjusted to less than this value
68 max: 6 // the number of tick texts will be adjusted to less than this value
68 },
69 },
69 format: '%Y-%m-%d %H:%M'
70 format: '%Y-%m-%d %H:%M'
70 }
71 }
71 },
72 },
72 y: {
73 y: {
73 tick: {
74 tick: {
74 count: 5,
75 count: 5,
75 format: d3.format('.2s')
76 format: d3.format('.2s')
76 }
77 }
77 }
78 }
78 },
79 },
79 subchart: {
80 subchart: {
80 show: true,
81 show: true,
81 size: {
82 size: {
82 height: 20
83 height: 20
83 }
84 }
84 },
85 },
85 size: {
86 size: {
86 height: 250
87 height: 250
87 },
88 },
88 zoom: {
89 zoom: {
89 rescale: true
90 rescale: true
90 },
91 },
91 grid: {
92 grid: {
92 x: {
93 x: {
93 show: true
94 show: true
94 },
95 },
95 y: {
96 y: {
96 show: true
97 show: true
97 }
98 }
98 },
99 },
99 tooltip: {
100 tooltip: {
100 format: {
101 format: {
101 title: function (d) {
102 title: function (d) {
102 return '' + d;
103 return '' + d;
103 },
104 },
104 value: function (v) {
105 value: function (v) {
105 return v
106 return v
106 }
107 }
107 }
108 }
108 }
109 }
109 };
110 };
110 vm.reportChartData = {};
111 vm.reportChartData = {};
111
112
112 vm.reportSlowChartConfig = {
113 vm.reportSlowChartConfig = {
113 data: {
114 data: {
114 json: [],
115 json: [],
115 xFormat: '%Y-%m-%dT%H:%M:%S'
116 xFormat: '%Y-%m-%dT%H:%M:%S'
116 },
117 },
117 color: {
118 color: {
118 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
119 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
119 },
120 },
120 axis: {
121 axis: {
121 x: {
122 x: {
122 type: 'timeseries',
123 type: 'timeseries',
123 tick: {
124 tick: {
124 culling: {
125 culling: {
125 max: 6 // the number of tick texts will be adjusted to less than this value
126 max: 6 // the number of tick texts will be adjusted to less than this value
126 },
127 },
127 format: '%Y-%m-%d %H:%M'
128 format: '%Y-%m-%d %H:%M'
128 }
129 }
129 },
130 },
130 y: {
131 y: {
131 tick: {
132 tick: {
132 count: 5,
133 count: 5,
133 format: d3.format('.2s')
134 format: d3.format('.2s')
134 }
135 }
135 }
136 }
136 },
137 },
137 subchart: {
138 subchart: {
138 show: true,
139 show: true,
139 size: {
140 size: {
140 height: 20
141 height: 20
141 }
142 }
142 },
143 },
143 size: {
144 size: {
144 height: 250
145 height: 250
145 },
146 },
146 zoom: {
147 zoom: {
147 rescale: true
148 rescale: true
148 },
149 },
149 grid: {
150 grid: {
150 x: {
151 x: {
151 show: true
152 show: true
152 },
153 },
153 y: {
154 y: {
154 show: true
155 show: true
155 }
156 }
156 },
157 },
157 tooltip: {
158 tooltip: {
158 format: {
159 format: {
159 title: function (d) {
160 title: function (d) {
160 return '' + d;
161 return '' + d;
161 },
162 },
162 value: function (v) {
163 value: function (v) {
163 return v
164 return v
164 }
165 }
165 }
166 }
166 }
167 }
167 };
168 };
168 vm.reportSlowChartData = {};
169 vm.reportSlowChartData = {};
169
170
170 vm.metricsChartConfig = {
171 vm.metricsChartConfig = {
171 data: {
172 data: {
172 json: [],
173 json: [],
173 xFormat: '%Y-%m-%dT%H:%M:%S',
174 xFormat: '%Y-%m-%dT%H:%M:%S',
174 keys: {
175 keys: {
175 x: 'x',
176 x: 'x',
176 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
177 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
177 },
178 },
178 names: {
179 names: {
179 main: 'View/Application logic',
180 main: 'View/Application logic',
180 sql: 'Relational database queries',
181 sql: 'Relational database queries',
181 nosql: 'NoSql datastore calls',
182 nosql: 'NoSql datastore calls',
182 tmpl: 'Template rendering',
183 tmpl: 'Template rendering',
183 custom: 'Custom timed calls',
184 custom: 'Custom timed calls',
184 remote: 'Requests to remote resources'
185 remote: 'Requests to remote resources'
185 },
186 },
186 type: 'area',
187 type: 'area',
187 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
188 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
188 order: null
189 order: null
189 },
190 },
190 color: {
191 color: {
191 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
192 pattern: ['#6baed6', '#c7e9c0', '#fd8d3c', '#d6616b', '#ffcc00', '#c6dbef']
192 },
193 },
193 axis: {
194 axis: {
194 x: {
195 x: {
195 type: 'timeseries',
196 type: 'timeseries',
196 tick: {
197 tick: {
197 culling: {
198 culling: {
198 max: 6 // the number of tick texts will be adjusted to less than this value
199 max: 6 // the number of tick texts will be adjusted to less than this value
199 },
200 },
200 format: '%Y-%m-%d %H:%M'
201 format: '%Y-%m-%d %H:%M'
201 }
202 }
202 },
203 },
203 y: {
204 y: {
204 tick: {
205 tick: {
205 count: 5,
206 count: 5,
206 format: d3.format('.2f')
207 format: d3.format('.2f')
207 }
208 }
208 }
209 }
209 },
210 },
210 point: {
211 point: {
211 show: false
212 show: false
212 },
213 },
213 subchart: {
214 subchart: {
214 show: true,
215 show: true,
215 size: {
216 size: {
216 height: 20
217 height: 20
217 }
218 }
218 },
219 },
219 size: {
220 size: {
220 height: 350
221 height: 350
221 },
222 },
222 zoom: {
223 zoom: {
223 rescale: true
224 rescale: true
224 },
225 },
225 grid: {
226 grid: {
226 x: {
227 x: {
227 show: true
228 show: true
228 },
229 },
229 y: {
230 y: {
230 show: true
231 show: true
231 }
232 }
232 },
233 },
233 tooltip: {
234 tooltip: {
234 format: {
235 format: {
235 title: function (d) {
236 title: function (d) {
236 return '' + d;
237 return '' + d;
237 },
238 },
238 value: function (v) {
239 value: function (v) {
239 return v
240 return v
240 }
241 }
241 }
242 }
242 }
243 }
243 };
244 };
244 vm.metricsChartData = {};
245 vm.metricsChartData = {};
245
246
246 vm.responseChartConfig = {
247 vm.responseChartConfig = {
247 data: {
248 data: {
248 json: [],
249 json: [],
249 xFormat: '%Y-%m-%dT%H:%M:%S'
250 xFormat: '%Y-%m-%dT%H:%M:%S'
250 },
251 },
251 color: {
252 color: {
252 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
253 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
253 },
254 },
254 axis: {
255 axis: {
255 x: {
256 x: {
256 type: 'timeseries',
257 type: 'timeseries',
257 tick: {
258 tick: {
258 culling: {
259 culling: {
259 max: 6 // the number of tick texts will be adjusted to less than this value
260 max: 6 // the number of tick texts will be adjusted to less than this value
260 },
261 },
261 format: '%Y-%m-%d %H:%M'
262 format: '%Y-%m-%d %H:%M'
262 }
263 }
263 },
264 },
264 y: {
265 y: {
265 tick: {
266 tick: {
266 count: 5,
267 count: 5,
267 format: d3.format('.2f')
268 format: d3.format('.2f')
268 }
269 }
269 }
270 }
270 },
271 },
271 point: {
272 point: {
272 show: false
273 show: false
273 },
274 },
274 subchart: {
275 subchart: {
275 show: true,
276 show: true,
276 size: {
277 size: {
277 height: 20
278 height: 20
278 }
279 }
279 },
280 },
280 size: {
281 size: {
281 height: 350
282 height: 350
282 },
283 },
283 zoom: {
284 zoom: {
284 rescale: true
285 rescale: true
285 },
286 },
286 grid: {
287 grid: {
287 x: {
288 x: {
288 show: true
289 show: true
289 },
290 },
290 y: {
291 y: {
291 show: true
292 show: true
292 }
293 }
293 },
294 },
294 tooltip: {
295 tooltip: {
295 format: {
296 format: {
296 title: function (d) {
297 title: function (d) {
297 return '' + d;
298 return '' + d;
298 },
299 },
299 value: function (v) {
300 value: function (v) {
300 return v
301 return v
301 }
302 }
302 }
303 }
303 }
304 }
304 };
305 };
305 vm.responseChartData = {};
306 vm.responseChartData = {};
306
307
307 vm.requestsChartConfig = {
308 vm.requestsChartConfig = {
308 data: {
309 data: {
309 json: [],
310 json: [],
310 xFormat: '%Y-%m-%dT%H:%M:%S'
311 xFormat: '%Y-%m-%dT%H:%M:%S'
311 },
312 },
312 color: {
313 color: {
313 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
314 pattern: ['#d6616b', '#6baed6', '#fd8d3c']
314 },
315 },
315 axis: {
316 axis: {
316 x: {
317 x: {
317 type: 'timeseries',
318 type: 'timeseries',
318 tick: {
319 tick: {
319 culling: {
320 culling: {
320 max: 6 // the number of tick texts will be adjusted to less than this value
321 max: 6 // the number of tick texts will be adjusted to less than this value
321 },
322 },
322 format: '%Y-%m-%d %H:%M'
323 format: '%Y-%m-%d %H:%M'
323 }
324 }
324 },
325 },
325 y: {
326 y: {
326 tick: {
327 tick: {
327 count: 5,
328 count: 5,
328 format: d3.format('.2f')
329 format: d3.format('.2f')
329 }
330 }
330 }
331 }
331 },
332 },
332 point: {
333 point: {
333 show: false
334 show: false
334 },
335 },
335 subchart: {
336 subchart: {
336 show: true,
337 show: true,
337 size: {
338 size: {
338 height: 20
339 height: 20
339 }
340 }
340 },
341 },
341 size: {
342 size: {
342 height: 350
343 height: 350
343 },
344 },
344 zoom: {
345 zoom: {
345 rescale: true
346 rescale: true
346 },
347 },
347 grid: {
348 grid: {
348 x: {
349 x: {
349 show: true
350 show: true
350 },
351 },
351 y: {
352 y: {
352 show: true
353 show: true
353 }
354 }
354 },
355 },
355 tooltip: {
356 tooltip: {
356 format: {
357 format: {
357 title: function (d) {
358 title: function (d) {
358 return '' + d;
359 return '' + d;
359 },
360 },
360 value: function (v) {
361 value: function (v) {
361 return v
362 return v
362 }
363 }
363 }
364 }
364 }
365 }
365 };
366 };
366 vm.requestsChartData = {};
367 vm.requestsChartData = {};
367
368
368 vm.loading = {
369 vm.loading = {
369 'apdex': true,
370 'apdex': true,
370 'reports': true,
371 'reports': true,
371 'graphs': true,
372 'graphs': true,
372 'slowCalls': true,
373 'slowCalls': true,
373 'slowURIS': true,
374 'slowURIS': true,
374 'requestsBreakdown': true,
375 'requestsBreakdown': true,
375 'series': true
376 'series': true
376 };
377 };
377 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
378 vm.stream = {paused: false, filtered: false, messages: [], reports: []};
378
379
379 $scope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
380 $rootScope.$on('channelstream-message.front_dashboard.new_topic', function(event, message){
380 var ws_report = message.message.report;
381 var ws_report = message.message.report;
381 if (ws_report.http_status != 500) {
382 if (ws_report.http_status != 500) {
382 return
383 return
383 }
384 }
384 if (vm.stream.paused == true) {
385 if (vm.stream.paused == true) {
385 return
386 return
386 }
387 }
387 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
388 if (vm.stream.filtered && ws_report.resource_id != vm.resource) {
388 return
389 return
389 }
390 }
390 var should_insert = true;
391 var should_insert = true;
391 _.each(vm.stream.reports, function (report) {
392 _.each(vm.stream.reports, function (report) {
392 if (report.report_id == ws_report.report_id) {
393 if (report.report_id == ws_report.report_id) {
393 report.occurences = ws_report.occurences;
394 report.occurences = ws_report.occurences;
394 should_insert = false;
395 should_insert = false;
395 }
396 }
396 });
397 });
397 if (should_insert) {
398 if (should_insert) {
398 if (vm.stream.reports.length > 7) {
399 if (vm.stream.reports.length > 7) {
399 vm.stream.reports.pop();
400 vm.stream.reports.pop();
400 }
401 }
401 vm.stream.reports.unshift(ws_report);
402 vm.stream.reports.unshift(ws_report);
402 }
403 }
403 });
404 });
404
405
405 vm.determineStartState = function () {
406 vm.determineStartState = function () {
406 if (stateHolder.AeUser.applications.length) {
407 if (stateHolder.AeUser.applications.length) {
407 vm.resource = Number($location.search().resource);
408 vm.resource = Number($location.search().resource);
408
409
409 if (!vm.resource){
410 if (!vm.resource){
410 var cookieResource = $cookies.getObject('resource');
411 var cookieResource = $cookies.getObject('resource');
411 console.log('cookieResource', cookieResource);
412 console.log('cookieResource', cookieResource);
412
413
413 if (cookieResource) {
414 if (cookieResource) {
414 vm.resource = cookieResource;
415 vm.resource = cookieResource;
415 }
416 }
416 else{
417 else{
417 vm.resource = stateHolder.AeUser.applications[0].resource_id;
418 vm.resource = stateHolder.AeUser.applications[0].resource_id;
418 }
419 }
419 }
420 }
420 }
421 }
421
422
422 var timespan = $location.search().timespan;
423 var timespan = $location.search().timespan;
423
424
424 if(_.has(vm.timeOptions, timespan)){
425 if(_.has(vm.timeOptions, timespan)){
425 vm.timeSpan = vm.timeOptions[timespan];
426 vm.timeSpan = vm.timeOptions[timespan];
426 }
427 }
427 else{
428 else{
428 vm.timeSpan = vm.timeOptions['1h'];
429 vm.timeSpan = vm.timeOptions['1h'];
429 }
430 }
430
431
431 var graphType = $location.search().graphtype;
432 var graphType = $location.search().graphtype;
432 if(!graphType){
433 if(!graphType){
433 vm.graphType = {selected: 'metrics_graphs'};
434 vm.graphType = {selected: 'metrics_graphs'};
434 }
435 }
435 else{
436 else{
436 vm.graphType = {selected: graphType};
437 vm.graphType = {selected: graphType};
437 }
438 }
438 vm.updateSearchParams();
439 vm.updateSearchParams();
439 };
440 };
440
441
441 vm.updateSearchParams = function () {
442 vm.updateSearchParams = function () {
442 $location.search('resource', vm.resource);
443 $location.search('resource', vm.resource);
443 $location.search('timespan', vm.timeSpan.key);
444 $location.search('timespan', vm.timeSpan.key);
444 $location.search('graphtype', vm.graphType.selected);
445 $location.search('graphtype', vm.graphType.selected);
445 stateHolder.resource = vm.resource;
446 stateHolder.resource = vm.resource;
446 if (vm.resource){
447 if (vm.resource){
447 $cookies.putObject('resource', vm.resource,
448 $cookies.putObject('resource', vm.resource,
448 {expires:new Date(3000, 1, 1)});
449 {expires:new Date(3000, 1, 1)});
449 }
450 }
450 };
451 };
451
452
452 vm.refreshData = function () {
453 vm.refreshData = function () {
453 vm.fetchApdexStats();
454 vm.fetchApdexStats();
454 vm.fetchTrendingReports();
455 vm.fetchTrendingReports();
455 vm.fetchMetrics();
456 vm.fetchMetrics();
456 vm.fetchRequestsBreakdown();
457 vm.fetchRequestsBreakdown();
457 vm.fetchSlowCalls();
458 vm.fetchSlowCalls();
458 };
459 };
459
460
460 vm.changedTimeSpan = function(){
461 vm.changedTimeSpan = function(){
461 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
462 vm.startDateFilter = timeSpanToStartDate(vm.timeSpan.key);
462 vm.refreshData();
463 vm.refreshData();
463 };
464 };
464
465
465 var intervalId = $interval(function () {
466 var intervalId = $interval(function () {
466 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
467 if (_.contains(['30m', "1h"], vm.timeSpan.key)) {
467 // don't do anything if window is unfocused
468 // don't do anything if window is unfocused
468 if(document.hidden === true){
469 if(document.hidden === true){
469 return ;
470 return ;
470 }
471 }
471 vm.refreshData();
472 vm.refreshData();
472 }
473 }
473 }, 60000);
474 }, 60000);
474
475
475 vm.fetchApdexStats = function () {
476 vm.fetchApdexStats = function () {
476 vm.loading.apdex = true;
477 vm.loading.apdex = true;
477 vm.apdexStats = applicationsPropertyResource.query({
478 vm.apdexStats = applicationsPropertyResource.query({
478 'key': 'apdex_stats',
479 'key': 'apdex_stats',
479 'resourceId': vm.resource,
480 'resourceId': vm.resource,
480 "start_date": timeSpanToStartDate(vm.timeSpan.key)
481 "start_date": timeSpanToStartDate(vm.timeSpan.key)
481 },
482 },
482 function (data) {
483 function (data) {
483 vm.loading.apdex = false;
484 vm.loading.apdex = false;
484
485
485 vm.exceptions = _.reduce(data, function (memo, row) {
486 vm.exceptions = _.reduce(data, function (memo, row) {
486 return memo + row.errors;
487 return memo + row.errors;
487 }, 0);
488 }, 0);
488 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
489 vm.satisfyingRequests = _.reduce(data, function (memo, row) {
489 return memo + row.satisfying_requests;
490 return memo + row.satisfying_requests;
490 }, 0);
491 }, 0);
491 vm.toleratedRequests = _.reduce(data, function (memo, row) {
492 vm.toleratedRequests = _.reduce(data, function (memo, row) {
492 return memo + row.tolerated_requests;
493 return memo + row.tolerated_requests;
493 }, 0);
494 }, 0);
494 vm.frustratingRequests = _.reduce(data, function (memo, row) {
495 vm.frustratingRequests = _.reduce(data, function (memo, row) {
495 return memo + row.frustrating_requests;
496 return memo + row.frustrating_requests;
496 }, 0);
497 }, 0);
497 if (data.length) {
498 if (data.length) {
498 vm.uptimeStats = data[0].uptime;
499 vm.uptimeStats = data[0].uptime;
499 }
500 }
500
501
501 },
502 },
502 function () {
503 function () {
503 vm.loading.apdex = false;
504 vm.loading.apdex = false;
504 }
505 }
505 );
506 );
506 }
507 }
507
508
508 vm.fetchMetrics = function () {
509 vm.fetchMetrics = function () {
509 vm.loading.series = true;
510 vm.loading.series = true;
510 applicationsPropertyResource.query({
511 applicationsPropertyResource.query({
511 'resourceId': vm.resource,
512 'resourceId': vm.resource,
512 'key': vm.graphType.selected,
513 'key': vm.graphType.selected,
513 "start_date": timeSpanToStartDate(vm.timeSpan.key)
514 "start_date": timeSpanToStartDate(vm.timeSpan.key)
514 }, function (data) {
515 }, function (data) {
515 if (vm.graphType.selected == 'metrics_graphs') {
516 if (vm.graphType.selected == 'metrics_graphs') {
516 vm.metricsChartData = {
517 vm.metricsChartData = {
517 json: data,
518 json: data,
518 xFormat: '%Y-%m-%dT%H:%M:%S',
519 xFormat: '%Y-%m-%dT%H:%M:%S',
519 keys: {
520 keys: {
520 x: 'x',
521 x: 'x',
521 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
522 value: ["main", "sql", "nosql", "tmpl", "remote", "custom"]
522 },
523 },
523 names: {
524 names: {
524 main: 'View/Application logic',
525 main: 'View/Application logic',
525 sql: 'Relational database queries',
526 sql: 'Relational database queries',
526 nosql: 'NoSql datastore calls',
527 nosql: 'NoSql datastore calls',
527 tmpl: 'Template rendering',
528 tmpl: 'Template rendering',
528 custom: 'Custom timed calls',
529 custom: 'Custom timed calls',
529 remote: 'Requests to remote resources'
530 remote: 'Requests to remote resources'
530 },
531 },
531 type: 'area',
532 type: 'area',
532 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
533 groups: [["main", "sql", "nosql", "remote", "custom", "tmpl"]],
533 order: null
534 order: null
534 };
535 };
535 }
536 }
536 else if (vm.graphType.selected == 'report_graphs') {
537 else if (vm.graphType.selected == 'report_graphs') {
537 vm.reportChartData = {
538 vm.reportChartData = {
538 json: data,
539 json: data,
539 xFormat: '%Y-%m-%dT%H:%M:%S',
540 xFormat: '%Y-%m-%dT%H:%M:%S',
540 keys: {
541 keys: {
541 x: 'x',
542 x: 'x',
542 value: ["not_found", "report"]
543 value: ["not_found", "report"]
543 },
544 },
544 names: {
545 names: {
545 report: 'Errors',
546 report: 'Errors',
546 not_found: '404\'s requests'
547 not_found: '404\'s requests'
547 },
548 },
548 type: 'bar'
549 type: 'bar'
549 };
550 };
550 }
551 }
551 else if (vm.graphType.selected == 'slow_report_graphs') {
552 else if (vm.graphType.selected == 'slow_report_graphs') {
552 vm.reportSlowChartData = {
553 vm.reportSlowChartData = {
553 json: data,
554 json: data,
554 xFormat: '%Y-%m-%dT%H:%M:%S',
555 xFormat: '%Y-%m-%dT%H:%M:%S',
555 keys: {
556 keys: {
556 x: 'x',
557 x: 'x',
557 value: ["slow_report"]
558 value: ["slow_report"]
558 },
559 },
559 names: {
560 names: {
560 slow_report: 'Slow reports'
561 slow_report: 'Slow reports'
561 },
562 },
562 type: 'bar'
563 type: 'bar'
563 };
564 };
564 }
565 }
565 else if (vm.graphType.selected == 'response_graphs') {
566 else if (vm.graphType.selected == 'response_graphs') {
566 vm.responseChartData = {
567 vm.responseChartData = {
567 json: data,
568 json: data,
568 xFormat: '%Y-%m-%dT%H:%M:%S',
569 xFormat: '%Y-%m-%dT%H:%M:%S',
569 keys: {
570 keys: {
570 x: 'x',
571 x: 'x',
571 value: ["today", "days_ago_2", "days_ago_7"]
572 value: ["today", "days_ago_2", "days_ago_7"]
572 },
573 },
573 names: {
574 names: {
574 today: 'Today',
575 today: 'Today',
575 "days_ago_2": '2 days ago',
576 "days_ago_2": '2 days ago',
576 "days_ago_7": '7 days ago'
577 "days_ago_7": '7 days ago'
577 }
578 }
578 };
579 };
579 }
580 }
580 else if (vm.graphType.selected == 'requests_graphs') {
581 else if (vm.graphType.selected == 'requests_graphs') {
581 vm.requestsChartData = {
582 vm.requestsChartData = {
582 json: data,
583 json: data,
583 xFormat: '%Y-%m-%dT%H:%M:%S',
584 xFormat: '%Y-%m-%dT%H:%M:%S',
584 keys: {
585 keys: {
585 x: 'x',
586 x: 'x',
586 value: ["requests"]
587 value: ["requests"]
587 },
588 },
588 names: {
589 names: {
589 requests: 'Requests/s'
590 requests: 'Requests/s'
590 }
591 }
591 };
592 };
592 }
593 }
593 vm.loading.series = false;
594 vm.loading.series = false;
594 }, function(){
595 }, function(){
595 vm.loading.series = false;
596 vm.loading.series = false;
596 });
597 });
597 }
598 }
598
599
599 vm.fetchSlowCalls = function () {
600 vm.fetchSlowCalls = function () {
600 vm.loading.slowCalls = true;
601 vm.loading.slowCalls = true;
601 applicationsPropertyResource.query({
602 applicationsPropertyResource.query({
602 'resourceId': vm.resource,
603 'resourceId': vm.resource,
603 "start_date": timeSpanToStartDate(vm.timeSpan.key),
604 "start_date": timeSpanToStartDate(vm.timeSpan.key),
604 'key': 'slow_calls'
605 'key': 'slow_calls'
605 }, function (data) {
606 }, function (data) {
606 vm.slowCalls = data;
607 vm.slowCalls = data;
607 vm.loading.slowCalls = false;
608 vm.loading.slowCalls = false;
608 }, function () {
609 }, function () {
609 vm.loading.slowCalls = false;
610 vm.loading.slowCalls = false;
610 });
611 });
611 }
612 }
612
613
613 vm.fetchRequestsBreakdown = function () {
614 vm.fetchRequestsBreakdown = function () {
614 vm.loading.requestsBreakdown = true;
615 vm.loading.requestsBreakdown = true;
615 applicationsPropertyResource.query({
616 applicationsPropertyResource.query({
616 'resourceId': vm.resource,
617 'resourceId': vm.resource,
617 "start_date": timeSpanToStartDate(vm.timeSpan.key),
618 "start_date": timeSpanToStartDate(vm.timeSpan.key),
618 'key': 'requests_breakdown'
619 'key': 'requests_breakdown'
619 }, function (data) {
620 }, function (data) {
620 vm.requestsBreakdown = data;
621 vm.requestsBreakdown = data;
621 vm.loading.requestsBreakdown = false;
622 vm.loading.requestsBreakdown = false;
622 }, function () {
623 }, function () {
623 vm.loading.requestsBreakdown = false;
624 vm.loading.requestsBreakdown = false;
624 });
625 });
625 }
626 }
626
627
627 vm.fetchTrendingReports = function () {
628 vm.fetchTrendingReports = function () {
628
629
629 if (vm.graphType.selected == 'slow_report_graphs') {
630 if (vm.graphType.selected == 'slow_report_graphs') {
630 var report_type = 'slow';
631 var report_type = 'slow';
631 }
632 }
632 else {
633 else {
633 var report_type = 'error';
634 var report_type = 'error';
634 }
635 }
635
636
636 vm.loading.reports = true;
637 vm.loading.reports = true;
637 vm.trendingReports = applicationsPropertyResource.query({
638 vm.trendingReports = applicationsPropertyResource.query({
638 'key': 'trending_reports',
639 'key': 'trending_reports',
639 'resourceId': vm.resource,
640 'resourceId': vm.resource,
640 "start_date": timeSpanToStartDate(vm.timeSpan.key),
641 "start_date": timeSpanToStartDate(vm.timeSpan.key),
641 "report_type": report_type
642 "report_type": report_type
642 },
643 },
643 function () {
644 function () {
644 vm.loading.reports = false;
645 vm.loading.reports = false;
645 },
646 },
646 function () {
647 function () {
647 vm.loading.reports = false;
648 vm.loading.reports = false;
648 }
649 }
649 )
650 );
650 ;
651 };
651 }
652
652
653 if (stateHolder.AeUser.applications.length){
653 if (stateHolder.AeUser.applications.length){
654 vm.show_dashboard = true;
654 vm.show_dashboard = true;
655 vm.determineStartState();
655 vm.determineStartState();
656 vm.refreshData();
656 vm.refreshData();
657 }
657 }
658
658
659 $scope.$on('$locationChangeSuccess', function () {
659 $scope.$on('$locationChangeSuccess', function () {
660 console.log('$locationChangeSuccess IndexDashboardController');
660 console.log('$locationChangeSuccess IndexDashboardController');
661 if (vm.loading.series === false) {
661 if (vm.loading.series === false) {
662 vm.determineStartState();
662 vm.determineStartState();
663 vm.refreshData();
663 vm.refreshData();
664 }
664 }
665 });
665 });
666
666
667
668 }
667 }
@@ -1,352 +1,354 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController);
20 angular.module('appenlight.controllers').controller('ReportsViewController', ReportsViewController);
21 ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal',
21 ReportsViewController.$inject = ['$window', '$location', '$state', '$uibModal',
22 '$cookies', 'reportGroupPropertyResource', 'reportGroupResource',
22 '$cookies', 'reportGroupPropertyResource', 'reportGroupResource',
23 'logsNoIdResource', 'stateHolder'];
23 'logsNoIdResource', 'stateHolder'];
24
24
25 function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) {
25 function ReportsViewController($window, $location, $state, $uibModal, $cookies, reportGroupPropertyResource, reportGroupResource, logsNoIdResource, stateHolder) {
26 var vm = this;
26 var vm = this;
27 vm.window = $window;
27 vm.window = $window;
28 vm.stateHolder = stateHolder;
29 vm.$state = $state;
28 vm.reportHistoryConfig = {
30 vm.reportHistoryConfig = {
29 data: {
31 data: {
30 json: [],
32 json: [],
31 xFormat: '%Y-%m-%dT%H:%M:%S'
33 xFormat: '%Y-%m-%dT%H:%M:%S'
32 },
34 },
33 color: {
35 color: {
34 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
36 pattern: ['#6baed6', '#e6550d', '#74c476', '#fdd0a2', '#8c564b']
35 },
37 },
36 axis: {
38 axis: {
37 x: {
39 x: {
38 type: 'timeseries',
40 type: 'timeseries',
39 tick: {
41 tick: {
40 format: '%Y-%m-%d'
42 format: '%Y-%m-%d'
41 }
43 }
42 },
44 },
43 y: {
45 y: {
44 tick: {
46 tick: {
45 count: 5,
47 count: 5,
46 format: d3.format('.2s')
48 format: d3.format('.2s')
47 }
49 }
48 }
50 }
49 },
51 },
50 subchart: {
52 subchart: {
51 show: true,
53 show: true,
52 size: {
54 size: {
53 height: 20
55 height: 20
54 }
56 }
55 },
57 },
56 size: {
58 size: {
57 height: 250
59 height: 250
58 },
60 },
59 zoom: {
61 zoom: {
60 rescale: true
62 rescale: true
61 },
63 },
62 grid: {
64 grid: {
63 x: {
65 x: {
64 show: true
66 show: true
65 },
67 },
66 y: {
68 y: {
67 show: true
69 show: true
68 }
70 }
69 },
71 },
70 tooltip: {
72 tooltip: {
71 format: {
73 format: {
72 title: function (d) {
74 title: function (d) {
73 return '' + d;
75 return '' + d;
74 },
76 },
75 value: function (v) {
77 value: function (v) {
76 return v
78 return v
77 }
79 }
78 }
80 }
79 }
81 }
80 };
82 };
81 vm.mentionedPeople = [];
83 vm.mentionedPeople = [];
82 vm.reportHistoryData = {};
84 vm.reportHistoryData = {};
83 vm.textTraceback = true;
85 vm.textTraceback = true;
84 vm.rawTraceback = '';
86 vm.rawTraceback = '';
85 vm.traceback = '';
87 vm.traceback = '';
86 vm.reportType = 'report';
88 vm.reportType = 'report';
87 vm.report = null;
89 vm.report = null;
88 vm.showLong = false;
90 vm.showLong = false;
89 vm.reportLogs = null;
91 vm.reportLogs = null;
90 vm.requestStats = null;
92 vm.requestStats = null;
91 vm.comment = null;
93 vm.comment = null;
92 vm.is_loading = {
94 vm.is_loading = {
93 report: true,
95 report: true,
94 logs: true,
96 logs: true,
95 history: true
97 history: true
96 };
98 };
97
99
98 vm.searchMentionedPeople = function(term){
100 vm.searchMentionedPeople = function(term){
99 //vm.mentionedPeople = [];
101 //vm.mentionedPeople = [];
100 var term = term.toLowerCase();
102 var term = term.toLowerCase();
101 reportGroupPropertyResource.get({
103 reportGroupPropertyResource.get({
102 groupId: vm.report.group_id,
104 groupId: vm.report.group_id,
103 key: 'assigned_users'
105 key: 'assigned_users'
104 }, null,
106 }, null,
105 function (data) {
107 function (data) {
106 var users = [];
108 var users = [];
107 _.each(data.assigned, function(u){
109 _.each(data.assigned, function(u){
108 users.push({label: u.user_name});
110 users.push({label: u.user_name});
109 });
111 });
110 _.each(data.unassigned, function(u){
112 _.each(data.unassigned, function(u){
111 users.push({label: u.user_name});
113 users.push({label: u.user_name});
112 });
114 });
113
115
114 var result = _.filter(users, function(u){
116 var result = _.filter(users, function(u){
115 return u.label.toLowerCase().indexOf(term) !== -1;
117 return u.label.toLowerCase().indexOf(term) !== -1;
116 });
118 });
117 vm.mentionedPeople = result;
119 vm.mentionedPeople = result;
118 });
120 });
119 };
121 };
120
122
121 vm.searchTag = function (tag, value) {
123 vm.searchTag = function (tag, value) {
122 console.log(tag, value);
124 console.log(tag, value);
123 if (vm.report.report_type === 3) {
125 if (vm.report.report_type === 3) {
124 $location.url($state.href('report.list_slow'));
126 $location.url($state.href('report.list_slow'));
125 }
127 }
126 else {
128 else {
127 $location.url($state.href('report.list'));
129 $location.url($state.href('report.list'));
128 }
130 }
129 $location.search(tag, value);
131 $location.search(tag, value);
130 };
132 };
131
133
132 vm.tabs = {
134 vm.tabs = {
133 slow_calls:false,
135 slow_calls:false,
134 request_details:false,
136 request_details:false,
135 logs:false,
137 logs:false,
136 comments:false,
138 comments:false,
137 affected_users:false
139 affected_users:false
138 };
140 };
139 if ($cookies.selectedReportTab) {
141 if ($cookies.selectedReportTab) {
140 vm.tabs[$cookies.selectedReportTab] = true;
142 vm.tabs[$cookies.selectedReportTab] = true;
141 }
143 }
142 else{
144 else{
143 $cookies.selectedReportTab = 'request_details';
145 $cookies.selectedReportTab = 'request_details';
144 vm.tabs.request_details = true;
146 vm.tabs.request_details = true;
145 }
147 }
146
148
147 vm.fetchLogs = function () {
149 vm.fetchLogs = function () {
148 if (!vm.report.request_id){
150 if (!vm.report.request_id){
149 return
151 return
150 }
152 }
151 vm.is_loading.logs = true;
153 vm.is_loading.logs = true;
152 logsNoIdResource.query({request_id: vm.report.request_id},
154 logsNoIdResource.query({request_id: vm.report.request_id},
153 function (data) {
155 function (data) {
154 vm.is_loading.logs = false;
156 vm.is_loading.logs = false;
155 vm.reportLogs = data;
157 vm.reportLogs = data;
156 }, function () {
158 }, function () {
157 vm.is_loading.logs = false;
159 vm.is_loading.logs = false;
158 });
160 });
159 };
161 };
160 vm.addComment = function () {
162 vm.addComment = function () {
161 reportGroupPropertyResource.save({
163 reportGroupPropertyResource.save({
162 groupId: vm.report.group_id,
164 groupId: vm.report.group_id,
163 key: 'comments'
165 key: 'comments'
164 }, {body: vm.comment},
166 }, {body: vm.comment},
165 function (data) {
167 function (data) {
166 vm.report.comments.push(data);
168 vm.report.comments.push(data);
167 });
169 });
168 vm.comment = '';
170 vm.comment = '';
169 };
171 };
170
172
171 vm.fetchReport = function () {
173 vm.fetchReport = function () {
172 vm.is_loading.report = true;
174 vm.is_loading.report = true;
173 reportGroupResource.get($state.params, function (data) {
175 reportGroupResource.get($state.params, function (data) {
174 vm.is_loading.report = false;
176 vm.is_loading.report = false;
175 if (data.request) {
177 if (data.request) {
176 try {
178 try {
177 var to_sort = _.pairs(data.request);
179 var to_sort = _.pairs(data.request);
178 data.request = _.object(_.sortBy(to_sort, function (i) {
180 data.request = _.object(_.sortBy(to_sort, function (i) {
179 return i[0]
181 return i[0]
180 }));
182 }));
181 }
183 }
182 catch (err) {
184 catch (err) {
183 }
185 }
184 }
186 }
185 vm.report = data;
187 vm.report = data;
186 if (vm.report.req_stats) {
188 if (vm.report.req_stats) {
187 vm.requestStats = [];
189 vm.requestStats = [];
188 _.each(_.pairs(vm.report.req_stats['percentages']), function (p) {
190 _.each(_.pairs(vm.report.req_stats['percentages']), function (p) {
189 vm.requestStats.push({
191 vm.requestStats.push({
190 name: p[0],
192 name: p[0],
191 value: vm.report.req_stats[p[0]].toFixed(3),
193 value: vm.report.req_stats[p[0]].toFixed(3),
192 percent: p[1],
194 percent: p[1],
193 calls: vm.report.req_stats[p[0] + '_calls']
195 calls: vm.report.req_stats[p[0] + '_calls']
194 })
196 })
195 });
197 });
196 }
198 }
197 vm.traceback = data.traceback;
199 vm.traceback = data.traceback;
198 _.each(vm.traceback, function (frame) {
200 _.each(vm.traceback, function (frame) {
199 if (frame.line) {
201 if (frame.line) {
200 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
202 vm.rawTraceback += 'File ' + frame.file + ' line ' + frame.line + ' in ' + frame.fn + ": \r\n";
201 }
203 }
202 vm.rawTraceback += ' ' + frame.cline + "\r\n";
204 vm.rawTraceback += ' ' + frame.cline + "\r\n";
203 });
205 });
204
206
205 if (stateHolder.AeUser.id){
207 if (stateHolder.AeUser.id){
206 vm.fetchHistory();
208 vm.fetchHistory();
207 }
209 }
208
210
209 vm.selectedTab($cookies.selectedReportTab);
211 vm.selectedTab($cookies.selectedReportTab);
210
212
211 }, function (response) {
213 }, function (response) {
212 console.log(response);
214 console.log(response);
213 if (response.status == 403) {
215 if (response.status == 403) {
214 var uid = response.headers('x-appenlight-uid');
216 var uid = response.headers('x-appenlight-uid');
215 if (!uid) {
217 if (!uid) {
216 window.location = '/register?came_from=' + encodeURIComponent(window.location);
218 window.location = '/register?came_from=' + encodeURIComponent(window.location);
217 }
219 }
218 }
220 }
219 vm.is_loading.report = false;
221 vm.is_loading.report = false;
220 });
222 });
221 };
223 };
222
224
223 vm.selectedTab = function(tab_name){
225 vm.selectedTab = function(tab_name){
224 $cookies.selectedReportTab = tab_name;
226 $cookies.selectedReportTab = tab_name;
225 if (tab_name == 'logs' && vm.reportLogs === null) {
227 if (tab_name == 'logs' && vm.reportLogs === null) {
226 vm.fetchLogs();
228 vm.fetchLogs();
227 }
229 }
228 };
230 };
229
231
230 vm.markFixed = function () {
232 vm.markFixed = function () {
231 reportGroupResource.update({
233 reportGroupResource.update({
232 groupId: vm.report.group_id
234 groupId: vm.report.group_id
233 }, {fixed: !vm.report.group.fixed},
235 }, {fixed: !vm.report.group.fixed},
234 function (data) {
236 function (data) {
235 vm.report.group.fixed = data.fixed;
237 vm.report.group.fixed = data.fixed;
236 });
238 });
237 };
239 };
238
240
239 vm.markPublic = function () {
241 vm.markPublic = function () {
240 reportGroupResource.update({
242 reportGroupResource.update({
241 groupId: vm.report.group_id
243 groupId: vm.report.group_id
242 }, {public: !vm.report.group.public},
244 }, {public: !vm.report.group.public},
243 function (data) {
245 function (data) {
244 vm.report.group.public = data.public;
246 vm.report.group.public = data.public;
245 });
247 });
246 };
248 };
247
249
248 vm.delete = function () {
250 vm.delete = function () {
249 reportGroupResource.delete({'groupId': vm.report.group_id},
251 reportGroupResource.delete({'groupId': vm.report.group_id},
250 function (data) {
252 function (data) {
251 $state.go('report.list');
253 $state.go('report.list');
252 })
254 })
253 };
255 };
254
256
255 vm.assignUsersModal = function (index) {
257 vm.assignUsersModal = function (index) {
256 vm.opts = {
258 vm.opts = {
257 backdrop: 'static',
259 backdrop: 'static',
258 templateUrl: 'AssignReportCtrl.html',
260 templateUrl: 'AssignReportCtrl.html',
259 controller: 'AssignReportCtrl as ctrl',
261 controller: 'AssignReportCtrl as ctrl',
260 resolve: {
262 resolve: {
261 report: function () {
263 report: function () {
262 return vm.report;
264 return vm.report;
263 }
265 }
264 }
266 }
265 };
267 };
266 var modalInstance = $uibModal.open(vm.opts);
268 var modalInstance = $uibModal.open(vm.opts);
267 modalInstance.result.then(function (report) {
269 modalInstance.result.then(function (report) {
268
270
269 }, function () {
271 }, function () {
270 console.info('Modal dismissed at: ' + new Date());
272 console.info('Modal dismissed at: ' + new Date());
271 });
273 });
272
274
273 };
275 };
274
276
275 vm.fetchHistory = function () {
277 vm.fetchHistory = function () {
276 reportGroupPropertyResource.query({
278 reportGroupPropertyResource.query({
277 groupId: vm.report.group_id,
279 groupId: vm.report.group_id,
278 key: 'history'
280 key: 'history'
279 }, function (data) {
281 }, function (data) {
280 vm.reportHistoryData = {
282 vm.reportHistoryData = {
281 json: data,
283 json: data,
282 keys: {
284 keys: {
283 x: 'x',
285 x: 'x',
284 value: ["reports"]
286 value: ["reports"]
285 },
287 },
286 names: {
288 names: {
287 reports: 'Reports history'
289 reports: 'Reports history'
288 },
290 },
289 type: 'bar'
291 type: 'bar'
290 };
292 };
291 vm.is_loading.history = false;
293 vm.is_loading.history = false;
292 });
294 });
293 };
295 };
294
296
295 vm.nextDetail = function () {
297 vm.nextDetail = function () {
296 $state.go('report.view_detail', {
298 $state.go('report.view_detail', {
297 groupId: vm.report.group_id,
299 groupId: vm.report.group_id,
298 reportId: vm.report.group.next_report
300 reportId: vm.report.group.next_report
299 });
301 });
300 };
302 };
301 vm.previousDetail = function () {
303 vm.previousDetail = function () {
302 $state.go('report.view_detail', {
304 $state.go('report.view_detail', {
303 groupId: vm.report.group_id,
305 groupId: vm.report.group_id,
304 reportId: vm.report.group.previous_report
306 reportId: vm.report.group.previous_report
305 });
307 });
306 };
308 };
307
309
308 vm.runIntegration = function (integration_name) {
310 vm.runIntegration = function (integration_name) {
309 console.log(integration_name);
311 console.log(integration_name);
310 if (integration_name == 'bitbucket') {
312 if (integration_name == 'bitbucket') {
311 var controller = 'BitbucketIntegrationCtrl as ctrl';
313 var controller = 'BitbucketIntegrationCtrl as ctrl';
312 var template_url = 'templates/integrations/bitbucket.html';
314 var template_url = 'templates/integrations/bitbucket.html';
313 }
315 }
314 else if (integration_name == 'github') {
316 else if (integration_name == 'github') {
315 var controller = 'GithubIntegrationCtrl as ctrl';
317 var controller = 'GithubIntegrationCtrl as ctrl';
316 var template_url = 'templates/integrations/github.html';
318 var template_url = 'templates/integrations/github.html';
317 }
319 }
318 else if (integration_name == 'jira') {
320 else if (integration_name == 'jira') {
319 var controller = 'JiraIntegrationCtrl as ctrl';
321 var controller = 'JiraIntegrationCtrl as ctrl';
320 var template_url = 'templates/integrations/jira.html';
322 var template_url = 'templates/integrations/jira.html';
321 }
323 }
322 else {
324 else {
323 return false;
325 return false;
324 }
326 }
325
327
326 vm.opts = {
328 vm.opts = {
327 backdrop: 'static',
329 backdrop: 'static',
328 templateUrl: template_url,
330 templateUrl: template_url,
329 controller: controller,
331 controller: controller,
330 resolve: {
332 resolve: {
331 integrationName: function () {
333 integrationName: function () {
332 return integration_name
334 return integration_name
333 },
335 },
334 report: function () {
336 report: function () {
335 return vm.report;
337 return vm.report;
336 }
338 }
337 }
339 }
338 };
340 };
339 var modalInstance = $uibModal.open(vm.opts);
341 var modalInstance = $uibModal.open(vm.opts);
340 modalInstance.result.then(function (report) {
342 modalInstance.result.then(function (report) {
341
343
342 }, function () {
344 }, function () {
343 console.info('Modal dismissed at: ' + new Date());
345 console.info('Modal dismissed at: ' + new Date());
344 });
346 });
345
347
346 };
348 };
347
349
348 // load report
350 // load report
349 vm.fetchReport();
351 vm.fetchReport();
350
352
351
353
352 }
354 }
@@ -1,160 +1,161 b''
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
1 // # Copyright (C) 2010-2016 RhodeCode GmbH
2 // #
2 // #
3 // # This program is free software: you can redistribute it and/or modify
3 // # This program is free software: you can redistribute it and/or modify
4 // # it under the terms of the GNU Affero General Public License, version 3
4 // # it under the terms of the GNU Affero General Public License, version 3
5 // # (only), as published by the Free Software Foundation.
5 // # (only), as published by the Free Software Foundation.
6 // #
6 // #
7 // # This program is distributed in the hope that it will be useful,
7 // # This program is distributed in the hope that it will be useful,
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 // # but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 // # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 // # GNU General Public License for more details.
10 // # GNU General Public License for more details.
11 // #
11 // #
12 // # You should have received a copy of the GNU Affero General Public License
12 // # You should have received a copy of the GNU Affero General Public License
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
13 // # along with this program. If not, see <http://www.gnu.org/licenses/>.
14 // #
14 // #
15 // # This program is dual-licensed. If you wish to learn more about the
15 // # This program is dual-licensed. If you wish to learn more about the
16 // # AppEnlight Enterprise Edition, including its added features, Support
16 // # AppEnlight Enterprise Edition, including its added features, Support
17 // # services, and proprietary license terms, please see
17 // # services, and proprietary license terms, please see
18 // # https://rhodecode.com/licenses/
18 // # https://rhodecode.com/licenses/
19
19
20 angular.module('appenlight.services.stateHolder', []).factory('stateHolder',
20 angular.module('appenlight.services.stateHolder', []).factory('stateHolder',
21 ['$timeout', 'AeConfig', function ($timeout, AeConfig) {
21 ['$timeout', 'AeConfig', function ($timeout, AeConfig) {
22
22
23 var AeUser = {"user_name": null, "id": null};
23 var AeUser = {"user_name": null, "id": null};
24 AeUser.update = function (jsonData) {
24 AeUser.update = function (jsonData) {
25 jsonData = jsonData || {};
25 jsonData = jsonData || {};
26 this.applications_map = {};
26 this.applications_map = {};
27 this.dashboards_map = {};
27 this.dashboards_map = {};
28 this.user_name = jsonData.user_name || null;
28 this.user_name = jsonData.user_name || null;
29 this.id = jsonData.id;
29 this.id = jsonData.id;
30 this.assigned_reports = jsonData.assigned_reports || null;
30 this.assigned_reports = jsonData.assigned_reports || null;
31 this.latest_events = jsonData.latest_events || null;
31 this.latest_events = jsonData.latest_events || null;
32 this.permissions = jsonData.permissions || null;
32 this.permissions = jsonData.permissions || null;
33 this.groups = jsonData.groups || null;
33 this.groups = jsonData.groups || null;
34 this.applications = [];
34 this.applications = [];
35 this.dashboards = [];
35 this.dashboards = [];
36 _.each(jsonData.applications, function (item) {
36 _.each(jsonData.applications, function (item) {
37 this.addApplication(item);
37 this.addApplication(item);
38 }.bind(this));
38 }.bind(this));
39 _.each(jsonData.dashboards, function (item) {
39 _.each(jsonData.dashboards, function (item) {
40 this.addDashboard(item);
40 this.addDashboard(item);
41 }.bind(this));
41 }.bind(this));
42 };
42 };
43 AeUser.addApplication = function (item) {
43 AeUser.addApplication = function (item) {
44 this.applications.push(item);
44 this.applications.push(item);
45 this.applications_map[item.resource_id] = item;
45 this.applications_map[item.resource_id] = item;
46 };
46 };
47 AeUser.addDashboard = function (item) {
47 AeUser.addDashboard = function (item) {
48 this.dashboards.push(item);
48 this.dashboards.push(item);
49 this.dashboards_map[item.resource_id] = item;
49 this.dashboards_map[item.resource_id] = item;
50 };
50 };
51
51
52 AeUser.removeApplicationById = function (applicationId) {
52 AeUser.removeApplicationById = function (applicationId) {
53 this.applications = _.filter(this.applications, function (item) {
53 this.applications = _.filter(this.applications, function (item) {
54 return item.resource_id != applicationId;
54 return item.resource_id != applicationId;
55 });
55 });
56 delete this.applications_map[applicationId];
56 delete this.applications_map[applicationId];
57 };
57 };
58 AeUser.removeDashboardById = function (dashboardId) {
58 AeUser.removeDashboardById = function (dashboardId) {
59 this.dashboards = _.filter(this.dashboards, function (item) {
59 this.dashboards = _.filter(this.dashboards, function (item) {
60 return item.resource_id != dashboardId;
60 return item.resource_id != dashboardId;
61 });
61 });
62 delete this.dashboards_map[dashboardId];
62 delete this.dashboards_map[dashboardId];
63 };
63 };
64
64
65 AeUser.hasAppPermission = function (perm_name) {
65 AeUser.hasAppPermission = function (perm_name) {
66 if (this.permissions.indexOf('root_administration') !== -1) {
66 if (this.permissions.indexOf('root_administration') !== -1) {
67 return true
67 return true
68 }
68 }
69 return this.permissions.indexOf(perm_name) !== -1;
69 return this.permissions.indexOf(perm_name) !== -1;
70 };
70 };
71
71
72 AeUser.hasContextPermission = function (permName, ACLList) {
72 AeUser.hasContextPermission = function (permName, ACLList) {
73 var hasPerm = false;
73 var hasPerm = false;
74 _.each(ACLList, function (ACL) {
74 _.each(ACLList, function (ACL) {
75 // is this the right perm?
75 // is this the right perm?
76 if (ACL.perm_name == permName ||
76 if (ACL.perm_name == permName ||
77 ACL.perm_name == '__all_permissions__') {
77 ACL.perm_name == '__all_permissions__') {
78 // perm for this user or a group user belongs to
78 // perm for this user or a group user belongs to
79 if (ACL.user_name === this.user_name ||
79 if (ACL.user_name === this.user_name ||
80 this.groups.indexOf(ACL.group_name) !== -1) {
80 this.groups.indexOf(ACL.group_name) !== -1) {
81 hasPerm = true
81 hasPerm = true
82 }
82 }
83 }
83 }
84 }.bind(this));
84 }.bind(this));
85 console.log('AeUser.hasContextPermission', permName, hasPerm);
85 console.log('AeUser.hasContextPermission', permName, hasPerm);
86 return hasPerm;
86 return hasPerm;
87 };
87 };
88
88
89 /**
89 /**
90 * Holds some common stuff like flash messages, but important part is
90 * Holds some common stuff like flash messages, but important part is
91 * plugins property that is a registry that holds all information about
91 * plugins property that is a registry that holds all information about
92 * loaded plugins, its mutated via .run() functions on inclusion
92 * loaded plugins, its mutated via .run() functions on inclusion
93 * @type {{list: Array, timeout: null, extend: flashMessages.extend, pop: flashMessages.pop, cancelTimeout: flashMessages.cancelTimeout, removeMessages: flashMessages.removeMessages}}
93 * @type {{list: Array, timeout: null, extend: flashMessages.extend, pop: flashMessages.pop, cancelTimeout: flashMessages.cancelTimeout, removeMessages: flashMessages.removeMessages}}
94 */
94 */
95 var flashMessages = {
95 var flashMessages = {
96 list: [],
96 list: [],
97 timeout: null,
97 timeout: null,
98 extend: function (values) {
98 extend: function (values) {
99 console.log('pushing flash', this);
99 console.log('pushing flash', this);
100 if (this.list.length > 2) {
100 if (this.list.length > 2) {
101 this.list.splice(0, this.list.length - 2);
101 this.list.splice(0, this.list.length - 2);
102 }
102 }
103 this.list.push.apply(this.list, values);
103 this.list.push.apply(this.list, values);
104 this.cancelTimeout();
104 this.cancelTimeout();
105 this.removeMessages();
105 this.removeMessages();
106 },
106 },
107 pop: function () {
107 pop: function () {
108 console.log('popping flash');
108 console.log('popping flash');
109 this.list.pop();
109 this.list.pop();
110 },
110 },
111 cancelTimeout: function () {
111 cancelTimeout: function () {
112 if (this.timeout) {
112 if (this.timeout) {
113 $timeout.cancel(this.timeout);
113 $timeout.cancel(this.timeout);
114 }
114 }
115 },
115 },
116 removeMessages: function () {
116 removeMessages: function () {
117 var self = this;
117 var self = this;
118 this.timeout = $timeout(function () {
118 this.timeout = $timeout(function () {
119 while (self.list.length > 0) {
119 while (self.list.length > 0) {
120 self.list.pop();
120 self.list.pop();
121 }
121 }
122 }, 10000);
122 }, 10000);
123 }
123 }
124 };
124 };
125 flashMessages.closeAlert = angular.bind(flashMessages, function (index) {
125 flashMessages.closeAlert = angular.bind(flashMessages, function (index) {
126 this.list.splice(index, 1);
126 this.list.splice(index, 1);
127 this.cancelTimeout();
127 this.cancelTimeout();
128 });
128 });
129 /* add flash messages from template generated on non-xhr request level */
129 /* add flash messages from template generated on non-xhr request level */
130 try {
130 try {
131 if (AeConfig.flashMessages.length > 0) {
131 if (AeConfig.flashMessages.length > 0) {
132 flashMessages.list = AeConfig.flashMessages;
132 flashMessages.list = AeConfig.flashMessages;
133 }
133 }
134 }
134 }
135 catch (exc) {
135 catch (exc) {
136
136
137 }
137 }
138
138
139 var Plugins = {
139 var Plugins = {
140 enabled: [],
140 enabled: [],
141 configs: {},
141 configs: {},
142 inclusions: {},
142 inclusions: {},
143 addInclusion: function (name, inclusion) {
143 addInclusion: function (name, inclusion) {
144 var self = this;
144 var self = this;
145 if (self.inclusions.hasOwnProperty(name) === false) {
145 if (self.inclusions.hasOwnProperty(name) === false) {
146 self.inclusions[name] = [];
146 self.inclusions[name] = [];
147 }
147 }
148 self.inclusions[name].push(inclusion);
148 self.inclusions[name].push(inclusion);
149 }
149 }
150 };
150 };
151
151
152 var stateHolder = {
152 var stateHolder = {
153 section: 'settings',
153 section: 'settings',
154 resource: null,
154 resource: null,
155 plugins: Plugins,
155 plugins: Plugins,
156 flashMessages: flashMessages,
156 flashMessages: flashMessages,
157 AeUser: AeUser
157 AeUser: AeUser,
158 AeConfig: AeConfig
158 };
159 };
159 return stateHolder;
160 return stateHolder;
160 }]);
161 }]);
@@ -1,349 +1,348 b''
1 <style type="text/css">
1 <style type="text/css">
2 #metrics_chart .c3-line {
2 #metrics_chart .c3-line {
3 stroke-width: 0px;
3 stroke-width: 0px;
4 }
4 }
5
5
6 #metrics_chart .c3-area {
6 #metrics_chart .c3-area {
7 stroke-width: 0;
7 stroke-width: 0;
8 opacity: 0.75;
8 opacity: 0.75;
9 }
9 }
10
10
11
11
12 </style>
12 </style>
13
13
14 <div class="row">
14 <div class="row">
15 <div class="col-sm-12 dashboard" id="content">
15 <div class="col-sm-12 dashboard" id="content">
16
16 <div ng-if="!index.stateHolder.AeUser.applications.length">
17 <div ng-if="!stateHolder.AeUser.applications.length">
18
17
19 <div ng-include="'templates/quickstart.html'"></div>
18 <div ng-include="'templates/quickstart.html'"></div>
20
19
21 </div>
20 </div>
22
21
23 <div ng-if="stateHolder.AeUser.applications.length">
22 <div ng-if="index.stateHolder.AeUser.applications.length">
24
23
25 <div class="row">
24 <div class="row">
26 <div class="col-sm-6">
25 <div class="col-sm-6">
27 <div class="panel panel-default">
26 <div class="panel panel-default">
28 <div class="panel-body">
27 <div class="panel-body">
29 <form class="graph-type form-inline">
28 <form class="graph-type form-inline">
30 <select ng-model="index.resource" ng-options="r.resource_id as r.resource_name for r in stateHolder.AeUser.applications" ng-change="index.updateSearchParams()"
29 <select ng-model="index.resource" ng-options="r.resource_id as r.resource_name for r in index.stateHolder.AeUser.applications" ng-change="index.updateSearchParams()"
31 class="SelectField form-control input-sm slim-input"></select>
30 class="SelectField form-control input-sm slim-input"></select>
32
31
33 <select class="SelectField form-control input-sm slim-input" ng-model="index.timeSpan"
32 <select class="SelectField form-control input-sm slim-input" ng-model="index.timeSpan"
34 ng-options="i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'" ng-change="index.updateSearchParams()"
33 ng-options="i as i.label for i in index.timeOptions | objectToOrderedArray:'minutes'" ng-change="index.updateSearchParams()"
35 class="SelectField"></select>
34 class="SelectField"></select>
36
35
37
36
38 <div class="btn-group">
37 <div class="btn-group">
39 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
38 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
40 uib-btn-radio="'requests_graphs'" data-uib-tooltip="Requests per second">
39 uib-btn-radio="'requests_graphs'" data-uib-tooltip="Requests per second">
41 <span class="fa fa-line-chart"></span>
40 <span class="fa fa-line-chart"></span>
42 </button>
41 </button>
43 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
42 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
44 uib-btn-radio="'response_graphs'" data-uib-tooltip="Average response time">
43 uib-btn-radio="'response_graphs'" data-uib-tooltip="Average response time">
45 <span class="fa fa-random"></span>
44 <span class="fa fa-random"></span>
46 </button>
45 </button>
47 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
46 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
48 uib-btn-radio="'metrics_graphs'" data-uib-tooltip="Time spent per request">
47 uib-btn-radio="'metrics_graphs'" data-uib-tooltip="Time spent per request">
49 <span class="fa fa-bar-chart-o"></span>
48 <span class="fa fa-bar-chart-o"></span>
50 </button>
49 </button>
51 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
50 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
52 uib-btn-radio="'report_graphs'" data-uib-tooltip="Errors">
51 uib-btn-radio="'report_graphs'" data-uib-tooltip="Errors">
53 <span class="fa fa-exclamation-triangle"></span>
52 <span class="fa fa-exclamation-triangle"></span>
54 </button>
53 </button>
55 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
54 <button type="button" class="btn btn-primary btn-sm" ng-model="index.graphType.selected" ng-change="index.updateSearchParams()"
56 uib-btn-radio="'slow_report_graphs'" data-uib-tooltip="Slow reports">
55 uib-btn-radio="'slow_report_graphs'" data-uib-tooltip="Slow reports">
57 <span class="fa fa-clock-o"></span>
56 <span class="fa fa-clock-o"></span>
58 </button>
57 </button>
59 </div>
58 </div>
60 </form>
59 </form>
61 <div class="clearfix"></div>
60 <div class="clearfix"></div>
62
61
63 <p ng-if="index.loading.series != false" class="text-center">
62 <p ng-if="index.loading.series != false" class="text-center">
64 <span class="fa fa-cog fa-spin fa-5x loader"></span>
63 <span class="fa fa-cog fa-spin fa-5x loader"></span>
65 </p>
64 </p>
66
65
67 <div ng-if="index.loading.series == false">
66 <div ng-if="index.loading.series == false">
68 <div ng-if="index.graphType.selected == 'requests_graphs'">
67 <div ng-if="index.graphType.selected == 'requests_graphs'">
69 <c3chart data-domid="reponse_chart" data-data="index.requestsChartData" data-config="index.requestsChartConfig" update="true">
68 <c3chart data-domid="reponse_chart" data-data="index.requestsChartData" data-config="index.requestsChartConfig" update="true">
70 </c3chart>
69 </c3chart>
71 </div>
70 </div>
72
71
73 <div ng-if="index.graphType.selected == 'response_graphs'">
72 <div ng-if="index.graphType.selected == 'response_graphs'">
74 <c3chart data-domid="reponse_chart" data-data="index.responseChartData" data-config="index.responseChartConfig" update="true">
73 <c3chart data-domid="reponse_chart" data-data="index.responseChartData" data-config="index.responseChartConfig" update="true">
75 </c3chart>
74 </c3chart>
76 </div>
75 </div>
77
76
78 <div ng-if="index.graphType.selected == 'metrics_graphs'">
77 <div ng-if="index.graphType.selected == 'metrics_graphs'">
79 <c3chart data-domid="metrics_chart" data-data="index.metricsChartData" data-config="index.metricsChartConfig" update="true">
78 <c3chart data-domid="metrics_chart" data-data="index.metricsChartData" data-config="index.metricsChartConfig" update="true">
80 </c3chart>
79 </c3chart>
81 </div>
80 </div>
82 <div ng-if="index.graphType.selected == 'report_graphs'">
81 <div ng-if="index.graphType.selected == 'report_graphs'">
83 <c3chart data-domid="reports_chart" data-data="index.reportChartData" data-config="index.reportChartConfig" update="true">
82 <c3chart data-domid="reports_chart" data-data="index.reportChartData" data-config="index.reportChartConfig" update="true">
84 </c3chart>
83 </c3chart>
85 </div>
84 </div>
86
85
87 <div ng-if="index.graphType.selected == 'slow_report_graphs'">
86 <div ng-if="index.graphType.selected == 'slow_report_graphs'">
88 <c3chart data-domid="slow_reports_chart" data-data="index.reportSlowChartData" data-config="index.reportSlowChartConfig" update="true">
87 <c3chart data-domid="slow_reports_chart" data-data="index.reportSlowChartData" data-config="index.reportSlowChartConfig" update="true">
89 </c3chart>
88 </c3chart>
90 </div>
89 </div>
91
90
92 <p ng-if="index.graphType.selected == 'requests_graphs'" class="text-center">
91 <p ng-if="index.graphType.selected == 'requests_graphs'" class="text-center">
93 <small>Average requests per second from all servers</small>
92 <small>Average requests per second from all servers</small>
94 </p>
93 </p>
95
94
96 <p ng-if="index.graphType.selected == 'response_graphs'" class="text-center">
95 <p ng-if="index.graphType.selected == 'response_graphs'" class="text-center">
97 <small>Average response time from all servers</small>
96 <small>Average response time from all servers</small>
98 </p>
97 </p>
99
98
100 <p ng-if="index.graphType.selected == 'metrics_graphs'" class="text-center">
99 <p ng-if="index.graphType.selected == 'metrics_graphs'" class="text-center">
101 <small>Aggregated average time spent per request - broken to layers</small>
100 <small>Aggregated average time spent per request - broken to layers</small>
102 </p>
101 </p>
103
102
104 <p ng-if="index.graphType.selected == 'report_graphs'" class="text-center">
103 <p ng-if="index.graphType.selected == 'report_graphs'" class="text-center">
105 <small>Aggregated reports sent by your application</small>
104 <small>Aggregated reports sent by your application</small>
106 </p>
105 </p>
107
106
108 <p ng-if="index.graphType.selected == 'slow_report_graphs'" class="text-center">
107 <p ng-if="index.graphType.selected == 'slow_report_graphs'" class="text-center">
109 <small>Aggregated slow reports sent by your application</small>
108 <small>Aggregated slow reports sent by your application</small>
110 </p>
109 </p>
111 </div>
110 </div>
112 </div>
111 </div>
113 </div>
112 </div>
114 </div>
113 </div>
115
114
116
115
117 <div class="col-sm-6">
116 <div class="col-sm-6">
118
117
119 <div id="server-container">
118 <div id="server-container">
120
119
121 <div ng-if="index.loading.apdex==false" class="text-center m-b-1">
120 <div ng-if="index.loading.apdex==false" class="text-center m-b-1">
122
121
123 <a data-ui-sref="report.list({resource:index.resource, start_date:index.startDateFilter})" class="combined-stat text-center" id="error-rate">
122 <a data-ui-sref="report.list({resource:index.resource, start_date:index.startDateFilter})" class="combined-stat text-center" id="error-rate">
124 <small>Exceptions</small>
123 <small>Exceptions</small>
125 <br/>
124 <br/>
126 <strong>{{ index.exceptions|numberToThousands}}</strong>
125 <strong>{{ index.exceptions|numberToThousands}}</strong>
127 <span class="fa fa-chevron-right"></span>
126 <span class="fa fa-chevron-right"></span>
128 </a><!--
127 </a><!--
129
128
130 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="frustrating-requests" data-uib-tooltip="Requests over 4s">
129 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="frustrating-requests" data-uib-tooltip="Requests over 4s">
131 <small>Frustrating req.</small>
130 <small>Frustrating req.</small>
132 <br/>
131 <br/>
133 <strong>{{index.frustratingRequests|numberToThousands}}</strong>
132 <strong>{{index.frustratingRequests|numberToThousands}}</strong>
134 <span class="fa fa-chevron-right"></span>
133 <span class="fa fa-chevron-right"></span>
135 </a><!--
134 </a><!--
136
135
137 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="tolerated-requests"
136 --><a data-ui-sref="report.list_slow({resource:index.resource, min_duration:1, max_duration:4, start_date:index.startDateFilter})" class="combined-stat text-center" id="tolerated-requests"
138 data-uib-tooltip="Requests under 4s">
137 data-uib-tooltip="Requests under 4s">
139 <small>Tolerated req.</small>
138 <small>Tolerated req.</small>
140 <br/>
139 <br/>
141 <strong>{{index.toleratedRequests|numberToThousands}}</strong>
140 <strong>{{index.toleratedRequests|numberToThousands}}</strong>
142 <span class="fa fa-chevron-right"></span>
141 <span class="fa fa-chevron-right"></span>
143 </a><!--
142 </a><!--
144
143
145 --><a class="combined-stat text-center" id="satisfying-requests" data-uib-tooltip="Requests under 1s">
144 --><a class="combined-stat text-center" id="satisfying-requests" data-uib-tooltip="Requests under 1s">
146 <small>Satisfying req.</small>
145 <small>Satisfying req.</small>
147 <br/>
146 <br/>
148 <strong>{{index.satisfyingRequests|numberToThousands}}</strong>
147 <strong>{{index.satisfyingRequests|numberToThousands}}</strong>
149 </a><!--
148 </a><!--
150
149
151 --><a data-ui-sref="uptime({resource:index.resource})" class="combined-stat text-center" id="uptime-stats" data-uib-tooltip="Uptime">
150 --><a data-ui-sref="uptime({resource:index.resource})" class="combined-stat text-center" id="uptime-stats" data-uib-tooltip="Uptime">
152 <small>Uptime</small>
151 <small>Uptime</small>
153 <br/>
152 <br/>
154 <strong>{{index.uptimeStats}}%</strong>
153 <strong>{{index.uptimeStats}}%</strong>
155 <span class="fa fa-chevron-right"></span>
154 <span class="fa fa-chevron-right"></span>
156 </a>
155 </a>
157
156
158 <div class="clearfix"></div>
157 <div class="clearfix"></div>
159 </div>
158 </div>
160
159
161 <div id="apdex-rate" class="m-b-1 panel panel-default">
160 <div id="apdex-rate" class="m-b-1 panel panel-default">
162 <table class="servers table table-striped">
161 <table class="servers table table-striped">
163 <thead>
162 <thead>
164 <tr>
163 <tr>
165 <th></th>
164 <th></th>
166 <th>Server</th>
165 <th>Server</th>
167 <th>Apdex
166 <th>Apdex
168 <span class="fa fa-question-circle"
167 <span class="fa fa-question-circle"
169 data-uib-tooltip="Application Performance Index - measures viewer satisfaction based on response times and error rates"></span>
168 data-uib-tooltip="Application Performance Index - measures viewer satisfaction based on response times and error rates"></span>
170 </th>
169 </th>
171 <th>rpm</th>
170 <th>rpm</th>
172 <th>avg. response</th>
171 <th>avg. response</th>
173 </tr>
172 </tr>
174 </thead>
173 </thead>
175 <tbody>
174 <tbody>
176 <tr ng-if="index.loading.apdex!=false" class="text-center">
175 <tr ng-if="index.loading.apdex!=false" class="text-center">
177 <td colspan="5"><span class="fa fa-cog fa-spin fa-5x loader"></span></td>
176 <td colspan="5"><span class="fa fa-cog fa-spin fa-5x loader"></span></td>
178 </tr>
177 </tr>
179 <tr ng-repeat="server in index.apdexStats" class="{{ server | apdexValue }}"
178 <tr ng-repeat="server in index.apdexStats" class="{{ server | apdexValue }}"
180 ng-if="index.loading.apdex==false">
179 ng-if="index.loading.apdex==false">
181 <td><span class="fa fa-hdd-o"></span></td>
180 <td><span class="fa fa-hdd-o"></span></td>
182 <td>
181 <td>
183 <small><strong>{{ server.name }}</strong></small>
182 <small><strong>{{ server.name }}</strong></small>
184 </td>
183 </td>
185 <td class="apdex">
184 <td class="apdex">
186 <small><strong>{{ server.apdex }} %</strong></small>
185 <small><strong>{{ server.apdex }} %</strong></small>
187 </td>
186 </td>
188 <td>
187 <td>
189 <small><strong>{{ server.rpm }}rpm</strong></small>
188 <small><strong>{{ server.rpm }}rpm</strong></small>
190 </td>
189 </td>
191 <td>
190 <td>
192 <small><strong>{{ server.avg_response_time }}s</strong></small>
191 <small><strong>{{ server.avg_response_time }}s</strong></small>
193 </td>
192 </td>
194 </tr>
193 </tr>
195 </tbody>
194 </tbody>
196 </table>
195 </table>
197
196
198 </div>
197 </div>
199 </div>
198 </div>
200
199
201 </div>
200 </div>
202
201
203
202
204 </div>
203 </div>
205
204
206 <div class="row">
205 <div class="row">
207 <div class="col-sm-6">
206 <div class="col-sm-6">
208
207
209 <div class="panel panel-default">
208 <div class="panel panel-default">
210 <div class="panel-heading position-relative">
209 <div class="panel-heading position-relative">
211 <h3 class="panel-title"><span class="fa fa-exclamation-triangle"></span> Newest errors (real-time)
210 <h3 class="panel-title"><span class="fa fa-exclamation-triangle"></span> Newest errors (real-time)
212 </h3>
211 </h3>
213 <a tooltip-append-to-body="true" data-uib-tooltip="Play/Pause stream" class="btn btn-primary btn-sm pause_stream" ng-model="index.stream.paused" uib-btn-checkbox>
212 <a tooltip-append-to-body="true" data-uib-tooltip="Play/Pause stream" class="btn btn-primary btn-sm pause_stream" ng-model="index.stream.paused" uib-btn-checkbox>
214 <span class="fa {{stream.paused ? 'fa-play' : 'fa-pause'}}"></span>
213 <span class="fa {{stream.paused ? 'fa-play' : 'fa-pause'}}"></span>
215 </a>
214 </a>
216 <a tooltip-append-to-body="true" data-uib-tooltip="Limit reports to current application" class="btn btn-primary btn-sm limit_stream" ng-model="index.stream.filtered" uib-btn-checkbox>
215 <a tooltip-append-to-body="true" data-uib-tooltip="Limit reports to current application" class="btn btn-primary btn-sm limit_stream" ng-model="index.stream.filtered" uib-btn-checkbox>
217 <span class="fa fa-lock"></span>
216 <span class="fa fa-lock"></span>
218 </a>
217 </a>
219
218
220
219
221 </div>
220 </div>
222 <div class="panel-body">
221 <div class="panel-body">
223
222
224 <p ng-if="index.stream.reports.length === 0">No new reports</p>
223 <p ng-if="index.stream.reports.length === 0">No new reports</p>
225
224
226 <div small-report-list reports="index.stream.reports" applications="index.applications"></div>
225 <div small-report-list reports="index.stream.reports" applications="index.applications"></div>
227 </div>
226 </div>
228 </div>
227 </div>
229 </div>
228 </div>
230
229
231 <div class="col-sm-6">
230 <div class="col-sm-6">
232
231
233 <div class="panel panel-default">
232 <div class="panel panel-default">
234 <div class="panel-heading">
233 <div class="panel-heading">
235 <h3 class="panel-title"><span class="fa fa-sort-amount-desc"></span> Request breakdown over {{ index.timeSpan.label }}</h3>
234 <h3 class="panel-title"><span class="fa fa-sort-amount-desc"></span> Request breakdown over {{ index.timeSpan.label }}</h3>
236 </div>
235 </div>
237 <div class="panel-body" id="view-breakdown-container">
236 <div class="panel-body" id="view-breakdown-container">
238 <p ng-if="index.loading.requestsBreakdown!=false" class="text-center">
237 <p ng-if="index.loading.requestsBreakdown!=false" class="text-center">
239 <span class="fa fa-cog fa-spin fa-5x loader"></span>
238 <span class="fa fa-cog fa-spin fa-5x loader"></span>
240 </p>
239 </p>
241
240
242 <div class="report-list">
241 <div class="report-list">
243 <div ng-if="index.loading.requestsBreakdown==false" ng-repeat="view in index.requestsBreakdown">
242 <div ng-if="index.loading.requestsBreakdown==false" ng-repeat="view in index.requestsBreakdown">
244 <div class="view-info">
243 <div class="view-info">
245 <div class="view-name">
244 <div class="view-name">
246 <div class="bar" style="width: {{view.percentage}}%">
245 <div class="bar" style="width: {{view.percentage}}%">
247 </div>
246 </div>
248 </div>
247 </div>
249 <strong ng-if="view.latest_details.length">
248 <strong ng-if="view.latest_details.length">
250 <a data-ui-sref="report.list_slow({view_name:view.view_name})">{{view.view_name}}</a></strong>
249 <a data-ui-sref="report.list_slow({view_name:view.view_name})">{{view.view_name}}</a></strong>
251 <strong ng-if="!view.latest_details.length">{{view.view_name}}</strong>
250 <strong ng-if="!view.latest_details.length">{{view.view_name}}</strong>
252
251
253 <div class="stats">
252 <div class="stats">
254 <small>
253 <small>
255 avg. response <strong>{{view.avg_response}}s</strong> in
254 avg. response <strong>{{view.avg_response}}s</strong> in
256 <span class="requests"
255 <span class="requests"
257 data-uib-tooltip="Requests"><strong>{{view.requests|numberToThousands}}</strong> requests</span>
256 data-uib-tooltip="Requests"><strong>{{view.requests|numberToThousands}}</strong> requests</span>
258
257
259 <span ng-if="view.latest_details">
258 <span ng-if="view.latest_details">
260 &nbsp;&nbsp; Latest reports:
259 &nbsp;&nbsp; Latest reports:
261 <a ng-repeat="d in view.latest_details" target="_blank" ui-sref="report.view_detail({groupId:d.group_id, reportId:d.report_id})"> <strong>{{$index+1}}</strong></a>
260 <a ng-repeat="d in view.latest_details" target="_blank" ui-sref="report.view_detail({groupId:d.group_id, reportId:d.report_id})"> <strong>{{$index+1}}</strong></a>
262 </span>
261 </span>
263 </small>
262 </small>
264 </div>
263 </div>
265
264
266 </div>
265 </div>
267
266
268 </div>
267 </div>
269 </div>
268 </div>
270
269
271
270
272 </div>
271 </div>
273 </div>
272 </div>
274
273
275 </div>
274 </div>
276
275
277 </div>
276 </div>
278
277
279 <div class="row">
278 <div class="row">
280 <div class="col-sm-6">
279 <div class="col-sm-6">
281
280
282 <div class="panel panel-default">
281 <div class="panel panel-default">
283 <div class="panel-heading">
282 <div class="panel-heading">
284 <h3 class="panel-title">
283 <h3 class="panel-title">
285 <span class="fa fa-exclamation-triangle"></span> Report groups trending over {{ index.timeSpan.label }}
284 <span class="fa fa-exclamation-triangle"></span> Report groups trending over {{ index.timeSpan.label }}
286 </h3>
285 </h3>
287 </div>
286 </div>
288 <div class="panel-body">
287 <div class="panel-body">
289 <p ng-if="index.loading.reports != false" class="text-center">
288 <p ng-if="index.loading.reports != false" class="text-center">
290 <span class="fa fa-cog fa-spin fa-5x loader"></span>
289 <span class="fa fa-cog fa-spin fa-5x loader"></span>
291 </p>
290 </p>
292
291
293 <p ng-if="index.trendingReports.length == 0 && index.loading.reports == false">
292 <p ng-if="index.trendingReports.length == 0 && index.loading.reports == false">
294 No reports found
293 No reports found
295 </p>
294 </p>
296
295
297 <div small-report-group-list groups="index.trendingReports" applications="index.applications" ng-if="index.loading.reports==false"></div>
296 <div small-report-group-list groups="index.trendingReports" applications="index.applications" ng-if="index.loading.reports==false"></div>
298 </div>
297 </div>
299 </div>
298 </div>
300
299
301 </div>
300 </div>
302
301
303 <div class="col-sm-6">
302 <div class="col-sm-6">
304
303
305
304
306 <div class="panel panel-default">
305 <div class="panel panel-default">
307 <div class="panel-heading">
306 <div class="panel-heading">
308 <h3 class="panel-title">
307 <h3 class="panel-title">
309 Most common slow calls over {{ index.timeSpan.label }}
308 Most common slow calls over {{ index.timeSpan.label }}
310 </h3>
309 </h3>
311 </div>
310 </div>
312 <div class="panel-body">
311 <div class="panel-body">
313
312
314 <div ng-if="index.loading.slowCalls!=false" class="text-center">
313 <div ng-if="index.loading.slowCalls!=false" class="text-center">
315 <span class="fa fa-cog fa-spin fa-5x loader"></span>
314 <span class="fa fa-cog fa-spin fa-5x loader"></span>
316 </div>
315 </div>
317
316
318 <table id="slow-statements" ng-if="index.loading.slowCalls==false">
317 <table id="slow-statements" ng-if="index.loading.slowCalls==false">
319 <tbody>
318 <tbody>
320 <tr ng-repeat="call in index.slowCalls">
319 <tr ng-repeat="call in index.slowCalls">
321 <td class="occurences">
320 <td class="occurences">
322 <span class="occurences" data-uib-tooltip="Occurences">{{call.occurences|numberToThousands}}</span>
321 <span class="occurences" data-uib-tooltip="Occurences">{{call.occurences|numberToThousands}}</span>
323 </td>
322 </td>
324 <td class="ellipsis">
323 <td class="ellipsis">
325 <small title="{{call.statement}}" class="statement">{{call.statement}}</small>
324 <small title="{{call.statement}}" class="statement">{{call.statement}}</small>
326 <br/>
325 <br/>
327 <span class="type">{{call.statement_type}}</span>
326 <span class="type">{{call.statement_type}}</span>
328 <span class="subtype">{{call.statement_subtype}}</span>
327 <span class="subtype">{{call.statement_subtype}}</span>
329 <span class="duration" data-uib-tooltip="Average duration">{{call.total_duration/call.occurences|round:2}}s</span>
328 <span class="duration" data-uib-tooltip="Average duration">{{call.total_duration/call.occurences|round:2}}s</span>
330 <span class="report-list">
329 <span class="report-list">
331 Latest reports:
330 Latest reports:
332 <a ng-repeat="d in call.latest_details" target="_blank" ui-sref="report.view_detail({groupId:d.group_id, reportId:d.report_id})"> <strong>{{$index+1}}</strong> </a>
331 <a ng-repeat="d in call.latest_details" target="_blank" ui-sref="report.view_detail({groupId:d.group_id, reportId:d.report_id})"> <strong>{{$index+1}}</strong> </a>
333 </span>
332 </span>
334 </td>
333 </td>
335 </tr>
334 </tr>
336 </tbody>
335 </tbody>
337 </table>
336 </table>
338
337
339
338
340 </div>
339 </div>
341 </div>
340 </div>
342
341
343
342
344 </div>
343 </div>
345
344
346 </div>
345 </div>
347 </div>
346 </div>
348 </div>
347 </div>
349 </div>
348 </div>
@@ -1,482 +1,482 b''
1 <script type="text/ng-template" id="slow_call.html">
1 <script type="text/ng-template" id="slow_call.html">
2 <table class="report-table">
2 <table class="report-table">
3 <tr>
3 <tr>
4 <td class="table-label">Type</td>
4 <td class="table-label">Type</td>
5 <td class="data"><strong>{{call.type}}
5 <td class="data"><strong>{{call.type}}
6 ({{call.subtype}})
6 ({{call.subtype}})
7 </strong></td>
7 </strong></td>
8 </tr>
8 </tr>
9 <tr>
9 <tr>
10 <td class="table-label">Duration</td>
10 <td class="table-label">Duration</td>
11 <td class="data"><strong class="textColor_1">{{call.duration}}</strong></td>
11 <td class="data"><strong class="textColor_1">{{call.duration}}</strong></td>
12 </tr>
12 </tr>
13 <tr>
13 <tr>
14 <td class="table-label">Start Time</td>
14 <td class="table-label">Start Time</td>
15 <td class="data">{{call.timestamp}}</td>
15 <td class="data">{{call.timestamp}}</td>
16 </tr>
16 </tr>
17 <tr>
17 <tr>
18 <td class="table-label">Statement</td>
18 <td class="table-label">Statement</td>
19 <td class="data">
19 <td class="data">
20 <pre class="word-wrap">{{call.statement}}</pre>
20 <pre class="word-wrap">{{call.statement}}</pre>
21 </td>
21 </td>
22 </tr>
22 </tr>
23 <tr ng-if="call.location">
23 <tr ng-if="call.location">
24 <td class="table-label">Location</td>
24 <td class="table-label">Location</td>
25 <td class="data">{{call.location}}</td>
25 <td class="data">{{call.location}}</td>
26 </tr>
26 </tr>
27 <tr>
27 <tr>
28 <td class="table-label">Parameters</td>
28 <td class="table-label">Parameters</td>
29 <td class="">
29 <td class="">
30 <div class="var-listing" human-format vars="call.parameters"></div>
30 <div class="var-listing" human-format vars="call.parameters"></div>
31 </td>
31 </td>
32 </tr>
32 </tr>
33 </table>
33 </table>
34
34
35 <div ng-if="call.children.length > 0" class="subcalls p-l-8">
35 <div ng-if="call.children.length > 0" class="subcalls p-l-8">
36
36
37 <p><strong>
37 <p><strong>
38 <small>Sub-calls</small>
38 <small>Sub-calls</small>
39 </strong></p>
39 </strong></p>
40
40
41 <div class="panel panel-default">
41 <div class="panel panel-default">
42 <div ng-repeat="call in call.children" ng-include="'slow_call.html'" class="panel-body"/>
42 <div ng-repeat="call in call.children" ng-include="'slow_call.html'" class="panel-body"/>
43 </div>
43 </div>
44 </div>
44 </div>
45 </div>
45 </div>
46
46
47 </script>
47 </script>
48
48
49 <script type="text/ng-template" id="AssignReportCtrl.html">
49 <script type="text/ng-template" id="AssignReportCtrl.html">
50
50
51 <div class="modal-header">
51 <div class="modal-header">
52 <h3>Assign users to report</h3>
52 <h3>Assign users to report</h3>
53 </div>
53 </div>
54 <div class="modal-body">
54 <div class="modal-body">
55
55
56 <ng-include src="'templates/loader.html'" ng-if="ctrl.loading"></ng-include>
56 <ng-include src="'templates/loader.html'" ng-if="ctrl.loading"></ng-include>
57
57
58 <div class="row" ng-if="!ctrl.loading">
58 <div class="row" ng-if="!ctrl.loading">
59 <div class="col-sm-6">
59 <div class="col-sm-6">
60 <strong>Unassigned</strong>
60 <strong>Unassigned</strong>
61
61
62 <div class="user-assignment" ng-repeat="user in ctrl.unAssignedUsers"
62 <div class="user-assignment" ng-repeat="user in ctrl.unAssignedUsers"
63 ng-click="ctrl.reassignUser(user)">
63 ng-click="ctrl.reassignUser(user)">
64 <img ng-src="{{user.gravatar_url}}"/>
64 <img ng-src="{{user.gravatar_url}}"/>
65 <strong>{{user.user_name}}</strong><br/>
65 <strong>{{user.user_name}}</strong><br/>
66 {{user.name}}
66 {{user.name}}
67 <div class="clear"></div>
67 <div class="clear"></div>
68 </div>
68 </div>
69 </div>
69 </div>
70
70
71 <div class="col-sm-6">
71 <div class="col-sm-6">
72 <strong>Assigned</strong>
72 <strong>Assigned</strong>
73
73
74 <div class="user-assignment" ng-repeat="user in ctrl.assignedUsers" ng-click="ctrl.reassignUser(user)">
74 <div class="user-assignment" ng-repeat="user in ctrl.assignedUsers" ng-click="ctrl.reassignUser(user)">
75 <img ng-src="{{user.gravatar_url}}"/>
75 <img ng-src="{{user.gravatar_url}}"/>
76 {{user.user_name}}<br/>
76 {{user.user_name}}<br/>
77 {{user.name}}
77 {{user.name}}
78 <div class="clear"></div>
78 <div class="clear"></div>
79 </div>
79 </div>
80 </div>
80 </div>
81 </div>
81 </div>
82 </div>
82 </div>
83 <div class="modal-footer">
83 <div class="modal-footer">
84 <button class="btn btn-primary" ng-click="ctrl.ok()">OK</button>
84 <button class="btn btn-primary" ng-click="ctrl.ok()">OK</button>
85 <button class="btn btn-warning" ng-click="ctrl.cancel()">Cancel</button>
85 <button class="btn btn-warning" ng-click="ctrl.cancel()">Cancel</button>
86 </div>
86 </div>
87 </script>
87 </script>
88
88
89 <ng-include src="'templates/loader.html'" ng-if="report.is_loading.report"></ng-include>
89 <ng-include src="'templates/loader.html'" ng-if="report.is_loading.report"></ng-include>
90
90
91 <div ng-if="!report.is_loading.report && report.report === null">
91 <div ng-if="!report.is_loading.report && report.report === null">
92 <strong>OOPS something went wrong :(</strong>
92 <strong>OOPS something went wrong :(</strong>
93 </div>
93 </div>
94
94
95 <div ng-if="report.report !== null && !report.is_loading.report">
95 <div ng-if="report.report !== null && !report.is_loading.report">
96
96
97 <div ng-if="stateHolder.AeUser.id" class="row">
97 <div ng-if="report.stateHolder.AeUser.id" class="row">
98 <div class="col-lg-12">
98 <div class="col-lg-12">
99 <a onclick="window.history.back()" class="btn btn-default" ng-if="report.window.history.length > 2"><span class="fa fa-arrow-circle-o-left"></span>
99 <a onclick="window.history.back()" class="btn btn-default" ng-if="report.window.history.length > 2"><span class="fa fa-arrow-circle-o-left"></span>
100 Go back</a>
100 Go back</a>
101 <a class="btn btn-default" ng-click="report.assignUsersModal()" ng-if="report.reportType == 'report'"><span
101 <a class="btn btn-default" ng-click="report.assignUsersModal()" ng-if="report.reportType == 'report'"><span
102 class="fa fa-flag"></span> Assign report
102 class="fa fa-flag"></span> Assign report
103 to user</a>
103 to user</a>
104
104
105 <a class="btn {{ report.report.group.fixed ? 'btn-success' : 'btn-default'}}" ng-click="report.markFixed()"
105 <a class="btn {{ report.report.group.fixed ? 'btn-success' : 'btn-default'}}" ng-click="report.markFixed()"
106 ng-if="report.reportType == 'report'">
106 ng-if="report.reportType == 'report'">
107 <span class="fa fa-check"></span> Mark fixed</a>
107 <span class="fa fa-check"></span> Mark fixed</a>
108
108
109 <span class="dropdown" ng-if="report.report.application.integrations.length" data-uib-dropdown on-toggle="toggled(open)">
109 <span class="dropdown" ng-if="report.report.application.integrations.length" data-uib-dropdown on-toggle="toggled(open)">
110 <a class="dropdown-toggle btn btn-default" data-uib-dropdown-toggle>
110 <a class="dropdown-toggle btn btn-default" data-uib-dropdown-toggle>
111 <span class="fa fa-send"></span> Integrations
111 <span class="fa fa-send"></span> Integrations
112 </a>
112 </a>
113 <ul class="dropdown-menu">
113 <ul class="dropdown-menu">
114 <li ng-repeat="choice in report.report.application.integrations">
114 <li ng-repeat="choice in report.report.application.integrations">
115 <a ng-click="report.runIntegration(choice.name)">{{choice.action}}</a>
115 <a ng-click="report.runIntegration(choice.name)">{{choice.action}}</a>
116 </li>
116 </li>
117 </ul>
117 </ul>
118 </span>
118 </span>
119
119
120 <a class="btn btn-default" ng-click="report.markPublic()">Make {{report.group.public ? 'private' : 'public'}}</a>
120 <a class="btn btn-default" ng-click="report.markPublic()">Make {{report.group.public ? 'private' : 'public'}}</a>
121
121
122 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
122 <span class="dropdown" data-uib-dropdown on-toggle="toggled(open)">
123 <a class="btn btn-danger" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span> Delete</a>
123 <a class="btn btn-danger" data-uib-dropdown-toggle><span class="fa fa-trash-o"></span> Delete</a>
124 <ul class="dropdown-menu">
124 <ul class="dropdown-menu">
125 <li><a>No</a></li>
125 <li><a>No</a></li>
126 <li><a ng-click="report.delete()">Yes</a></li>
126 <li><a ng-click="report.delete()">Yes</a></li>
127 </ul>
127 </ul>
128 </span>
128 </span>
129 </div>
129 </div>
130 </div>
130 </div>
131
131
132 <div class="row">
132 <div class="row">
133 <div class="col-lg-4">
133 <div class="col-lg-4">
134
134
135 <div class="panel panel-default m-t-1">
135 <div class="panel panel-default m-t-1">
136 <div class="panel-body">
136 <div class="panel-body">
137
137
138 <h3 class="m-t-0">Report Information</h3>
138 <h3 class="m-t-0">Report Information</h3>
139
139
140 <table class="report-table with-ellipsis">
140 <table class="report-table with-ellipsis">
141 <tr>
141 <tr>
142 <td class="table-label">Occurences</td>
142 <td class="table-label">Occurences</td>
143 <td class="data">{{report.report.group.occurences}}</td>
143 <td class="data">{{report.report.group.occurences}}</td>
144 </tr>
144 </tr>
145 <tr ng-if="report.report.http_status">
145 <tr ng-if="report.report.http_status">
146 <td class="table-label">HTTP status</td>
146 <td class="table-label">HTTP status</td>
147 <td class="data">{{report.report.http_status}}</td>
147 <td class="data">{{report.report.http_status}}</td>
148 </tr>
148 </tr>
149 <tr ng-if="report.report.group.priority">
149 <tr ng-if="report.report.group.priority">
150 <td class="table-label">Priority</td>
150 <td class="table-label">Priority</td>
151 <td class="data">{{report.report.group.priority}}</td>
151 <td class="data">{{report.report.group.priority}}</td>
152 </tr>
152 </tr>
153 <tr ng-if="report.report.group.public">
153 <tr ng-if="report.report.group.public">
154 <td class="table-label">Public URL</td>
154 <td class="table-label">Public URL</td>
155 <td class="data">
155 <td class="data">
156 <form>
156 <form>
157 <textarea class="TextAreaField form-control" id="public-url" onclick="this.select()">{{$state.href($state.current.name, $state.params, {absolute: true})}}</textarea>
157 <textarea class="TextAreaField form-control" id="public-url" onclick="this.select()">{{report.$state.href(report.$state.current.name, report.$state.params, {absolute: true})}}</textarea>
158 </form>
158 </form>
159 </td>
159 </td>
160 </tr>
160 </tr>
161 <tr data-uib-tooltip="{{report.report.url}}">
161 <tr data-uib-tooltip="{{report.report.url}}">
162 <td class="table-label">URL</td>
162 <td class="table-label">URL</td>
163 <td class="data ellipsis"><a href="{{report.report.url}}">{{report.report.url}}</a></td>
163 <td class="data ellipsis"><a href="{{report.report.url}}">{{report.report.url}}</a></td>
164 </tr>
164 </tr>
165
165
166 <tr ng-if="report.report.ip">
166 <tr ng-if="report.report.ip">
167 <td class="table-label">Remote IP</td>
167 <td class="table-label">Remote IP</td>
168 <td class="data">{{report.report.ip}}</td>
168 <td class="data">{{report.report.ip}}</td>
169 </tr>
169 </tr>
170 <tr ng-if="report.report.user_agent" data-uib-tooltip="{{report.report.user_agent}}">
170 <tr ng-if="report.report.user_agent" data-uib-tooltip="{{report.report.user_agent}}">
171 <td class="table-label">User Agent</td>
171 <td class="table-label">User Agent</td>
172 <td class="data ellipsis">{{report.report.user_agent}}</td>
172 <td class="data ellipsis">{{report.report.user_agent}}</td>
173 </tr>
173 </tr>
174 <tr ng-if="report.report.message">
174 <tr ng-if="report.report.message">
175 <td class="table-label">Message</td>
175 <td class="table-label">Message</td>
176 <td class="data">{{report.report.message}}</td>
176 <td class="data">{{report.report.message}}</td>
177 </tr>
177 </tr>
178 <tr ng-if="report.report.duration > 0">
178 <tr ng-if="report.report.duration > 0">
179 <td class="table-label">Duration</td>
179 <td class="table-label">Duration</td>
180 <td class="data">
180 <td class="data">
181 <span>{{report.report.duration}}s</span>
181 <span>{{report.report.duration}}s</span>
182 </td>
182 </td>
183 </tr>
183 </tr>
184 <tr>
184 <tr>
185 <td class="table-label">First occured</td>
185 <td class="table-label">First occured</td>
186 <td class="data">
186 <td class="data">
187 <span uib-tooltip="{{report.report.group.first_timestamp}}"><iso-to-relative-time
187 <span uib-tooltip="{{report.report.group.first_timestamp}}"><iso-to-relative-time
188 time="{{report.report.group.first_timestamp}}"/></span>
188 time="{{report.report.group.first_timestamp}}"/></span>
189 </td>
189 </td>
190 </tr>
190 </tr>
191 <tr>
191 <tr>
192 <td class="table-label">Last occured</td>
192 <td class="table-label">Last occured</td>
193 <td class="data">
193 <td class="data">
194 <span uib-tooltip="{{report.report.group.last_timestamp}}"><iso-to-relative-time
194 <span uib-tooltip="{{report.report.group.last_timestamp}}"><iso-to-relative-time
195 time="{{report.report.group.last_timestamp}}"/></span>
195 time="{{report.report.group.last_timestamp}}"/></span>
196 </td>
196 </td>
197 </tr>
197 </tr>
198 </table>
198 </table>
199
199
200 <div ng-if="report.requestStats">
200 <div ng-if="report.requestStats">
201 <h3>Performance stats</h3>
201 <h3>Performance stats</h3>
202
202
203 <div class="perf_stats">
203 <div class="perf_stats">
204 <span class="stat" ng-repeat="stat in report.requestStats"
204 <span class="stat" ng-repeat="stat in report.requestStats"
205 ng-if="stat.calls > 0 || stat.value > 0"><strong>
205 ng-if="stat.calls > 0 || stat.value > 0"><strong>
206 <span class="{{stat.name}} bar" style="width:10px"></span> {{stat.calls}}
206 <span class="{{stat.name}} bar" style="width:10px"></span> {{stat.calls}}
207 <span ng-if="stat.name!='main'"><small>{{stat.name}} calls</small></span>
207 <span ng-if="stat.name!='main'"><small>{{stat.name}} calls</small></span>
208 <span ng-if="stat.name=='main'">
208 <span ng-if="stat.name=='main'">
209 <span class="fa fa-question-circle"
209 <span class="fa fa-question-circle"
210 data-uib-tooltip="Execution time that didnt get assigned to other layers"></span> Other</span>
210 data-uib-tooltip="Execution time that didnt get assigned to other layers"></span> Other</span>
211 </strong>
211 </strong>
212 </span>
212 </span>
213
213
214 <div style="width: 100%; overflow:hidden">
214 <div style="width: 100%; overflow:hidden">
215 <div class="{{stat.name}} bar" style="width:{{stat.percent}}%; height: 25px"
215 <div class="{{stat.name}} bar" style="width:{{stat.percent}}%; height: 25px"
216 ng-repeat="stat in report.requestStats"
216 ng-repeat="stat in report.requestStats"
217 data-uib-tooltip="{{stat.value}}s - Cumulative time spent in this request on all {{ stat.name }} calls"></div>
217 data-uib-tooltip="{{stat.value}}s - Cumulative time spent in this request on all {{ stat.name }} calls"></div>
218 <div class="row">
218 <div class="row">
219 <div class="col-xs-6 text-left">
219 <div class="col-xs-6 text-left">
220 <small>0s</small>
220 <small>0s</small>
221 </div>
221 </div>
222 <div class="col-xs-6 text-right">
222 <div class="col-xs-6 text-right">
223 <small>{{report.report.duration.toFixed(3)}}s</small>
223 <small>{{report.report.duration.toFixed(3)}}s</small>
224 </div>
224 </div>
225 </div>
225 </div>
226 </div>
226 </div>
227 </div>
227 </div>
228 </div>
228 </div>
229
229
230 <h3>Tags</h3>
230 <h3>Tags</h3>
231
231
232 <table class="report-table with-tags">
232 <table class="report-table with-tags">
233 <tr ng-repeat="(tag, value) in report.report.tags">
233 <tr ng-repeat="(tag, value) in report.report.tags">
234 <td class="table-label" ng-switch="tag"><!--
234 <td class="table-label" ng-switch="tag"><!--
235 --><span ng-switch-when="user_name">Username/UID</span><!--
235 --><span ng-switch-when="user_name">Username/UID</span><!--
236 --><span ng-switch-when="view_name">View Name</span><!--
236 --><span ng-switch-when="view_name">View Name</span><!--
237 --><span ng-switch-when="server_name">Server Name</span><!--
237 --><span ng-switch-when="server_name">Server Name</span><!--
238 --><span ng-switch-default>{{ tag }}</span>
238 --><span ng-switch-default>{{ tag }}</span>
239 </td>
239 </td>
240 <td class="data"><a ng-click="report.searchTag(tag, value)">{{ value }}</td>
240 <td class="data"><a ng-click="report.searchTag(tag, value)">{{ value }}</td>
241 </tr>
241 </tr>
242 </table>
242 </table>
243
243
244 </div>
244 </div>
245 </div>
245 </div>
246
246
247
247
248 </div>
248 </div>
249 <div class="col-lg-8">
249 <div class="col-lg-8">
250 <div class="frames">
250 <div class="frames">
251 <p class="text-center">Report history</p>
251 <p class="text-center">Report history</p>
252
252
253 <div class="panel" ng-if="!report.is_loading.history">
253 <div class="panel" ng-if="!report.is_loading.history">
254 <div class="panel-body">
254 <div class="panel-body">
255 <c3chart data-domid="report_history_chart" data-data="report.reportHistoryData" data-config="report.reportHistoryConfig">
255 <c3chart data-domid="report_history_chart" data-data="report.reportHistoryData" data-config="report.reportHistoryConfig">
256 </c3chart>
256 </c3chart>
257 </div>
257 </div>
258 </div>
258 </div>
259
259
260 <div class="row m-b-1">
260 <div class="row m-b-1">
261 <div class="col-sm-2 text-left">
261 <div class="col-sm-2 text-left">
262 <a class="switch_detail btn btn-sm btn-default {{report.report.group.previous_report ? '' : 'disabled'}}"
262 <a class="switch_detail btn btn-sm btn-default {{report.report.group.previous_report ? '' : 'disabled'}}"
263 ng-click="report.previousDetail()">
263 ng-click="report.previousDetail()">
264 <span class="fa fa-arrow-left"></span>
264 <span class="fa fa-arrow-left"></span>
265 Prev. detail</a>
265 Prev. detail</a>
266
266
267 </div>
267 </div>
268 <div class="col-sm-8 text-center">
268 <div class="col-sm-8 text-center">
269 <small>
269 <small>
270 <span uib-tooltip="{{report.report.start_time|isoToRelativeTime}}" class="m-r-1">
270 <span uib-tooltip="{{report.report.start_time|isoToRelativeTime}}" class="m-r-1">
271 {{report.report.start_time.replace('T', ' ')}} UTC</span>
271 {{report.report.start_time.replace('T', ' ')}} UTC</span>
272 <span class="text-muted">ID: {{report.report.request_id}}</span>
272 <span class="text-muted">ID: {{report.report.request_id}}</span>
273 </small>
273 </small>
274 </div>
274 </div>
275 <div class="col-sm-2 text-right">
275 <div class="col-sm-2 text-right">
276 <a class="switch_detail btn btn-sm btn-default {{report.report.group.next_report ? '' : 'disabled'}}"
276 <a class="switch_detail btn btn-sm btn-default {{report.report.group.next_report ? '' : 'disabled'}}"
277 ng-click="report.nextDetail()">
277 ng-click="report.nextDetail()">
278 Next detail <span class="fa fa-arrow-right"></span></a>
278 Next detail <span class="fa fa-arrow-right"></span></a>
279 </div>
279 </div>
280 </div>
280 </div>
281
281
282 <h3 class="word-wrap">{{report.report.error}}</h3>
282 <h3 class="word-wrap">{{report.report.error}}</h3>
283
283
284 <div ng-if="report.report.traceback">
284 <div ng-if="report.report.traceback">
285
285
286 <h3><strong>Traceback</strong></h3>
286 <h3><strong>Traceback</strong></h3>
287
287
288 <div class="btn-group">
288 <div class="btn-group">
289 <a ng-if="report.traceback.length-10 > 0 " ng-click="report.showLong = !report.showLong"
289 <a ng-if="report.traceback.length-10 > 0 " ng-click="report.showLong = !report.showLong"
290 class="btn btn-default {{report.showLong ? 'active' : ''}}">
290 class="btn btn-default {{report.showLong ? 'active' : ''}}">
291 <span class="fa fa-align-left"></span>
291 <span class="fa fa-align-left"></span>
292 <small>Show {{report.traceback.length-10}} remaining frames</small>
292 <small>Show {{report.traceback.length-10}} remaining frames</small>
293 </a>
293 </a>
294
294
295 <a class="btn btn-default {{report.showRaw ? 'active' : ''}}" ng-click="report.showRaw = !report.showRaw">
295 <a class="btn btn-default {{report.showRaw ? 'active' : ''}}" ng-click="report.showRaw = !report.showRaw">
296 <span class="fa fa-list"></span>
296 <span class="fa fa-list"></span>
297 <small>Raw version</small>
297 <small>Raw version</small>
298 </a>
298 </a>
299 </div>
299 </div>
300
300
301 <div ng-if="report.showRaw" class="m-t-1">
301 <div ng-if="report.showRaw" class="m-t-1">
302 <pre>{{report.rawTraceback}}</pre>
302 <pre>{{report.rawTraceback}}</pre>
303 </div>
303 </div>
304 <div ng-if="!report.showRaw" class="m-t-1">
304 <div ng-if="!report.showRaw" class="m-t-1">
305
305
306 <div ng-repeat="frame in report.traceback" class="frame {{$odd ? 'odd' : 'even'}}"
306 <div ng-repeat="frame in report.traceback" class="frame {{$odd ? 'odd' : 'even'}}"
307 ng-if="$index >= report.traceback.length-10 || report.traceback.length <= 10 || report.showLong">
307 ng-if="$index >= report.traceback.length-10 || report.traceback.length <= 10 || report.showLong">
308 <div class="frameline" ng-if="frame.line">
308 <div class="frameline" ng-if="frame.line">
309 <a class="inspect_vars" ng-click="frame.showVars = !frame.showVars" ng-if="frame.vars">
309 <a class="inspect_vars" ng-click="frame.showVars = !frame.showVars" ng-if="frame.vars">
310 <span class="fa fa-search dim btn btn-default"
310 <span class="fa fa-search dim btn btn-default"
311 uib-tooltip="Show local vars"> </span>
311 uib-tooltip="Show local vars"> </span>
312 </a>
312 </a>
313
313
314 <span class="no-vars" ng-if="frame.vars.length == 0"></span>
314 <span class="no-vars" ng-if="frame.vars.length == 0"></span>
315
315
316 <span ng-if="frame.file">
316 <span ng-if="frame.file">
317 <span class="mono">File</span> <span class="file mono">{{frame.file || 'Unknown file'}}</span>,
317 <span class="mono">File</span> <span class="file mono">{{frame.file || 'Unknown file'}}</span>,
318 </span>
318 </span>
319 <span ng-if="frame.module && !frame.file">
319 <span ng-if="frame.module && !frame.file">
320 <span class="mono">Module</span> <span class="file mono">{{frame.module || 'Unknown module'}}</span>,
320 <span class="mono">Module</span> <span class="file mono">{{frame.module || 'Unknown module'}}</span>,
321 </span>
321 </span>
322 <span class="mono">line</span> <span class="line mono">{{frame.line || 'Unknown line'}}</span>
322 <span class="mono">line</span> <span class="line mono">{{frame.line || 'Unknown line'}}</span>
323
323
324 <span ng-if="frame.fn"><span class="mono">in</span> <strong
324 <span ng-if="frame.fn"><span class="mono">in</span> <strong
325 class="fn mono">{{frame.fn || 'Unknown function'}}</strong></span>
325 class="fn mono">{{frame.fn || 'Unknown function'}}</strong></span>
326
326
327 </div>
327 </div>
328 <div class="cline mono" ng-if="frame.cline">{{frame.cline || 'Unknown context'}}</div>
328 <div class="cline mono" ng-if="frame.cline">{{frame.cline || 'Unknown context'}}</div>
329
329
330 <div class="vars" ng-if="frame.showVars">
330 <div class="vars" ng-if="frame.showVars">
331 <table class="var-listing small">
331 <table class="var-listing small">
332 <tr ng-repeat="fvar in frame.vars track by $index" class="frame {{$odd ? 'odd' : 'even'}}">
332 <tr ng-repeat="fvar in frame.vars track by $index" class="frame {{$odd ? 'odd' : 'even'}}">
333 <td class="var-label">{{ fvar[0] }}</td>
333 <td class="var-label">{{ fvar[0] }}</td>
334 <td>
334 <td>
335 <span human-format vars="fvar[1]"></span>
335 <span human-format vars="fvar[1]"></span>
336 </td>
336 </td>
337 </tr>
337 </tr>
338 </table>
338 </table>
339
339
340 </div>
340 </div>
341 </div>
341 </div>
342 </div>
342 </div>
343
343
344
344
345 </div>
345 </div>
346
346
347
347
348 <uib-tabset>
348 <uib-tabset>
349 <uib-tab select="report.selectedTab('slow_calls')" active="report.tabs.slow_calls">
349 <uib-tab select="report.selectedTab('slow_calls')" active="report.tabs.slow_calls">
350 <uib-tab-heading>
350 <uib-tab-heading>
351 Slow Calls
351 Slow Calls
352 </uib-tab-heading>
352 </uib-tab-heading>
353
353
354 <h3><strong>Slow Calls</strong></h3>
354 <h3><strong>Slow Calls</strong></h3>
355
355
356 <div ng-if="report.report.slow_calls.length > 0">
356 <div ng-if="report.report.slow_calls.length > 0">
357 <div ng-repeat="call in report.report.slow_calls" ng-include="'slow_call.html'"></div>
357 <div ng-repeat="call in report.report.slow_calls" ng-include="'slow_call.html'"></div>
358 </div>
358 </div>
359
359
360 <div ng-if="report.report.slow_calls.length == 0">
360 <div ng-if="report.report.slow_calls.length == 0">
361 No slow calls reported
361 No slow calls reported
362 </div>
362 </div>
363
363
364 </uib-tab>
364 </uib-tab>
365
365
366
366
367 <uib-tab select="report.selectedTab('request_details')" active="report.tabs.request_details">
367 <uib-tab select="report.selectedTab('request_details')" active="report.tabs.request_details">
368 <uib-tab-heading>
368 <uib-tab-heading>
369 Request details
369 Request details
370 </uib-tab-heading>
370 </uib-tab-heading>
371
371
372 <h3><strong>Extra</strong></h3>
372 <h3><strong>Extra</strong></h3>
373 <div class="var-listing" human-format vars="report.report.extra"></div>
373 <div class="var-listing" human-format vars="report.report.extra"></div>
374 <h3><strong>Request details</strong></h3>
374 <h3><strong>Request details</strong></h3>
375 <div class="var-listing" human-format vars="report.report.request"></div>
375 <div class="var-listing" human-format vars="report.report.request"></div>
376
376
377 </uib-tab>
377 </uib-tab>
378
378
379 <uib-tab select="report.selectedTab('logs')" active="report.tabs.logs">
379 <uib-tab select="report.selectedTab('logs')" active="report.tabs.logs">
380 <uib-tab-heading>
380 <uib-tab-heading>
381 Logs
381 Logs
382 </uib-tab-heading>
382 </uib-tab-heading>
383
383
384 <div ng-if="report.is_loading.logs!=false" class="text-center">
384 <div ng-if="report.is_loading.logs!=false" class="text-center">
385 <span class="fa fa-cog fa-spin fa-3x loader"></span>
385 <span class="fa fa-cog fa-spin fa-3x loader"></span>
386 </div>
386 </div>
387 <p ng-if="report.reportLogs.length == 0"> No logs found</p>
387 <p ng-if="report.reportLogs.length == 0"> No logs found</p>
388
388
389 <table class="table table-striped log-list" ng-if="report.reportLogs.length > 0">
389 <table class="table table-striped log-list" ng-if="report.reportLogs.length > 0">
390
390
391 <caption>Logs</caption>
391 <caption>Logs</caption>
392 <thead>
392 <thead>
393 <tr>
393 <tr>
394 <th class="message">Message</th>
394 <th class="message">Message</th>
395 <th class="when">When</th>
395 <th class="when">When</th>
396 </tr>
396 </tr>
397 </thead>
397 </thead>
398 <tbody>
398 <tbody>
399 <tr ng-repeat="log in report.reportLogs track by log.log_id">
399 <tr ng-repeat="log in report.reportLogs track by log.log_id">
400 <td>
400 <td>
401 <a class="tag {{log.log_level|lowercase}}">
401 <a class="tag {{log.log_level|lowercase}}">
402 <span class="name">level:</span> {{log.log_level}}</a>
402 <span class="name">level:</span> {{log.log_level}}</a>
403 <a class="tag">
403 <a class="tag">
404 <span class="name">namespace:</span> {{log.namespace}}</a>
404 <span class="name">namespace:</span> {{log.namespace}}</a>
405 <a ng-repeat="(tag, value) in log.tags" class="tag">
405 <a ng-repeat="(tag, value) in log.tags" class="tag">
406 <span class="name">{{tag}}:</span> {{value}}</a>
406 <span class="name">{{tag}}:</span> {{value}}</a>
407 <div class="log">
407 <div class="log">
408 {{log.message}}
408 {{log.message}}
409 </div>
409 </div>
410 </td>
410 </td>
411 <td class="when">
411 <td class="when">
412 <a data-uib-tooltip="{{log.timestamp}}">
412 <a data-uib-tooltip="{{log.timestamp}}">
413 <iso-to-relative-time time="{{log.timestamp}}"/>
413 <iso-to-relative-time time="{{log.timestamp}}"/>
414 </a>
414 </a>
415 </td>
415 </td>
416 </tr>
416 </tr>
417
417
418 </tbody>
418 </tbody>
419 </table>
419 </table>
420
420
421 </uib-tab>
421 </uib-tab>
422
422
423
423
424 <uib-tab select="report.selectedTab('comments')" active="report.tabs.comments">
424 <uib-tab select="report.selectedTab('comments')" active="report.tabs.comments">
425 <uib-tab-heading>
425 <uib-tab-heading>
426 Comments
426 Comments
427 <span class="label label-info">{{report.report.comments.length}}</span>
427 <span class="label label-info">{{report.report.comments.length}}</span>
428
428
429 </uib-tab-heading>
429 </uib-tab-heading>
430
430
431 <h3><strong>Comments</strong></h3>
431 <h3><strong>Comments</strong></h3>
432
432
433 <p ng-if="report.report.comments.length == 0">No comments yet - be first to add one!</p>
433 <p ng-if="report.report.comments.length == 0">No comments yet - be first to add one!</p>
434
434
435 <div class="comment" ng-repeat="comment in report.report.comments">
435 <div class="comment" ng-repeat="comment in report.report.comments">
436 <p name="comment-{{comment.comment_id}}"><span class="fa fa-comment"></span>
436 <p name="comment-{{comment.comment_id}}"><span class="fa fa-comment"></span>
437 <strong>{{comment.user_name}}</strong>
437 <strong>{{comment.user_name}}</strong>
438 <iso-to-relative-time time="{{comment.created_timestamp}}"/>
438 <iso-to-relative-time time="{{comment.created_timestamp}}"/>
439 </p>
439 </p>
440 <p class="well">{{comment.body}}</p>
440 <p class="well">{{comment.body}}</p>
441 </div>
441 </div>
442
442
443 <form name="commentForm" ng-submit="report.addComment()">
443 <form name="commentForm" ng-submit="report.addComment()">
444 <div class="form-group">
444 <div class="form-group">
445 <textarea type="text" class="form-control" id="report.commentForm" ng-model="report.comment" required
445 <textarea type="text" class="form-control" id="report.commentForm" ng-model="report.comment" required
446 mentio mentio-search="report.searchMentionedPeople(term)" mentio-items="report.mentionedPeople| filter:label:typedTerm" class="form-control"></textarea>
446 mentio mentio-search="report.searchMentionedPeople(term)" mentio-items="report.mentionedPeople| filter:label:typedTerm" class="form-control"></textarea>
447
447
448 </div>
448 </div>
449 <div class="form-group">
449 <div class="form-group">
450 <button class="btn btn-info" ng-disabled="report.commentForm.$invalid">Comment</button>
450 <button class="btn btn-info" ng-disabled="report.commentForm.$invalid">Comment</button>
451 </div>
451 </div>
452 </form>
452 </form>
453
453
454 <div ng-repeat="comment in report.report.comments" class="{{$odd ? 'odd' : 'even'}}" class="repeat-animate">
454 <div ng-repeat="comment in report.report.comments" class="{{$odd ? 'odd' : 'even'}}" class="repeat-animate">
455 </div>
455 </div>
456
456
457 </uib-tab>
457 </uib-tab>
458
458
459 <uib-tab select="report.selectedTab('affected_users')" active="report.tabs.affected_users">
459 <uib-tab select="report.selectedTab('affected_users')" active="report.tabs.affected_users">
460 <uib-tab-heading>
460 <uib-tab-heading>
461 Affected users
461 Affected users
462 <span class="label label-warning">{{report.report.affected_users_count}}</span>
462 <span class="label label-warning">{{report.report.affected_users_count}}</span>
463
463
464 </uib-tab-heading>
464 </uib-tab-heading>
465
465
466 <h3><strong>50 most affected users ID's by this issue:</strong></h3>
466 <h3><strong>50 most affected users ID's by this issue:</strong></h3>
467 <ul class="affected-user-list">
467 <ul class="affected-user-list">
468 <li ng-repeat="user in report.report.top_affected_users">
468 <li ng-repeat="user in report.report.top_affected_users">
469 <strong>{{user.username}}</strong> <span class="badge" uib-tooltip="occurences">{{user.count}}</span>
469 <strong>{{user.username}}</strong> <span class="badge" uib-tooltip="occurences">{{user.count}}</span>
470 </li>
470 </li>
471 </ul>
471 </ul>
472
472
473 </uib-tab>
473 </uib-tab>
474
474
475 </uib-tabset>
475 </uib-tabset>
476
476
477
477
478 </div>
478 </div>
479
479
480 </div>
480 </div>
481 </div>
481 </div>
482 </div>
482 </div>
@@ -1,13 +0,0 b''
1 {% extends "/layout.jinja2" %}
2
3 {% block ng_view %}ui-view{% endblock %}
4
5 {% block page_title %}
6 <h1 class="page-title">{{ _('Dashboard') }}</h1>
7 {% endblock %}
8
9 {% block content%}
10 <div class="text-center">
11 <span class="fa fa-cog fa-spin fa-5x m-a-4"></span>
12 </div>
13 {% endblock %}
General Comments 0
You need to be logged in to leave comments. Login now