diff --git a/xos/core/xoslib/ui_src/contentProvider/.bowerrc b/xos/core/xoslib/ui_src/contentProvider/.bowerrc
new file mode 100644
index 0000000..9d3c09f
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/.bowerrc
@@ -0,0 +1,6 @@
+{
+  "directory": "src/vendor/",
+  "scripts": {
+    "postinstall": "wiredep -s path/to/src.html"
+  }
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/bower.json b/xos/core/xoslib/ui_src/contentProvider/bower.json
new file mode 100644
index 0000000..0b29e91
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/bower.json
@@ -0,0 +1,24 @@
+{
+  "name": "xoslib",
+  "version": "0.0.0",
+  "homepage": "https://github.com/teone/xos",
+  "authors": [
+    "Matteo Scandolo <matteo.scandolo@link-me.it>"
+  ],
+  "license": "MIT",
+  "ignore": [
+    "**/.*",
+    "node_modules",
+    "bower_components",
+    "static/js/vendor/",
+    "test",
+    "tests"
+  ],
+  "dependencies": {
+    "angular-cookies": "~1.4.7",
+    "angular-resource": "~1.4.7",
+    "angular-route": "~1.4.7",
+    "angular": "~1.4.7",
+    "ng-lodash": "~0.3.0"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/package.json b/xos/core/xoslib/ui_src/contentProvider/package.json
new file mode 100644
index 0000000..5a61466
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/package.json
@@ -0,0 +1,23 @@
+{
+  "name": "xos-content-provider",
+  "version": "1.0.0",
+  "description": "Content Provider View",
+  "main": "index.html",
+  "scripts": {
+    "test": "karma start",
+    "start": "bower install; npm run wiredep; parallelshell \"npm run babel\" \"npm run browser\"",
+    "wiredep": "wiredep -s 'src/index.html'",
+    "babel": "babel 'src/js' -w -d 'src/.tmp'",
+    "browser": "browser-sync start --files 'src/.tmp/**/*.js,src/**/*.html,src/**/*.css' --server './src' --reload-delay 1000",
+    "watch": "npm-watch"
+  },
+  "author": "Matteo Scandolo",
+  "license": "ISC",
+  "devDependencies": {
+    "babel": "^5.8.29",
+    "browser-sync": "^2.9.11",
+    "npm-watch": "0.0.1",
+    "parallelshell": "^2.0.0",
+    "wiredep": "^3.0.0-beta"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/.tmp/xosContentProvider.js b/xos/core/xoslib/ui_src/contentProvider/src/.tmp/xosContentProvider.js
new file mode 100644
index 0000000..6c45eef
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/.tmp/xosContentProvider.js
@@ -0,0 +1,329 @@
+/* global angular */
+/* eslint-disable dot-location*/
+
+// TODO
+// - Add Cache
+// - Refactor routing with ui.router and child views (share the navigation and header)
+// - Add Eslint
+// - Add Es6 (Babel) and a build script
+// - Autogenerate ngResource from swagger definition json
+
+'use strict';
+
+console.log('test ' + (1 + 2));
+
+angular.module('xos.contentProviderApp', ['ngResource', 'ngRoute', 'ngCookies', 'ngLodash']).config(function ($interpolateProvider, $routeProvider, $resourceProvider) {
+  $interpolateProvider.startSymbol('{$');
+  $interpolateProvider.endSymbol('$}');
+
+  // NOTE http://www.masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html
+  $resourceProvider.defaults.stripTrailingSlashes = false;
+
+  $routeProvider.when('/', {
+    template: '<content-provider-list></content-provider-list>'
+  }).when('/contentProvider/:id?', {
+    template: '<content-provider-detail></content-provider-detail>'
+  }).when('/contentProvider/:id/cdn_prefix', {
+    template: '<content-provider-cdn></content-provider-cdn>'
+  }).when('/contentProvider/:id/origin_server', {
+    template: '<content-provider-server></content-provider-server>'
+  }).when('/contentProvider/:id/users', {
+    template: '<content-provider-users></content-provider-users>'
+  }).otherwise('/');
+}).config(function ($httpProvider) {
+
+  // add X-CSRFToken header for update, create, delete (!GET)
+  $httpProvider.interceptors.push('SetCSRFToken');
+}).factory('SetCSRFToken', function ($cookies) {
+  return {
+    request: function request(_request) {
+      if (_request.method !== 'GET') {
+        _request.headers['X-CSRFToken'] = $cookies.get('csrftoken');
+      }
+      return _request;
+    }
+  };
+}).constant('apiBaseUrl', 'http://localhost:9000').service('ContentProvider', function ($resource, apiBaseUrl) {
+  return $resource(apiBaseUrl, '/hpcapi/contentproviders/:id/', { id: '@id' }, {
+    'update': { method: 'PUT' }
+  });
+}).service('ServiceProvider', function ($resource) {
+  return $resource('/hpcapi/serviceproviders/:id/', { id: '@id' });
+}).service('CdnPrefix', function ($resource) {
+  return $resource('/hpcapi/cdnprefixs/:id/', { id: '@id' });
+}).service('OriginServer', function ($resource) {
+  return $resource('/hpcapi/originservers/:id/', { id: '@id' });
+}).service('User', function ($resource) {
+  return $resource('/xos/users/:id/', { id: '@id' });
+}).directive('cpActions', function (ContentProvider, $location) {
+  return {
+    restrict: 'E',
+    scope: {
+      id: '=id'
+    },
+    bindToController: true,
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_actions.html',
+    controller: function controller() {
+      this.deleteCp = function (id) {
+        ContentProvider['delete']({ id: id }).$promise.then(function () {
+          $location.url('/');
+        });
+      };
+    }
+  };
+}).directive('contentProviderList', function (ContentProvider, lodash) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    scope: {},
+    templateUrl: 'templates/cp_list.html',
+    controller: function controller() {
+      var _this = this;
+
+      ContentProvider.query().$promise.then(function (cp) {
+        _this.contentProviderList = cp;
+      })['catch'](function (e) {
+        throw new Error(e);
+      });
+
+      this.deleteCp = function (id) {
+        ContentProvider['delete']({ id: id }).$promise.then(function () {
+          lodash.remove(_this.contentProviderList, { id: id });
+        });
+      };
+    }
+  };
+}).directive('contentProviderDetail', function (ContentProvider, ServiceProvider, $routeParams, $location) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    scope: {},
+    templateUrl: 'templates/cp_detail.html',
+    controller: function controller() {
+      this.pageName = 'detail';
+      var _this = this;
+
+      if ($routeParams.id) {
+        ContentProvider.get({ id: $routeParams.id }).$promise.then(function (cp) {
+          _this.cp = cp;
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      ServiceProvider.query().$promise.then(function (sp) {
+        _this.sp = sp;
+      });
+
+      // check if the list id match with item url
+      this.activeServiceProvide = function (id, SPurl) {
+        if (SPurl && SPurl.length > 0) {
+          // take the last 2 char and remove trailing /
+          return parseInt(SPurl.substr(SPurl.length - 2).replace('/', '')) === id;
+        }
+        return false;
+      };
+
+      this.saveContentProvider = function (cp) {
+        var p,
+            isNew = false;
+
+        if (cp.id) {
+          p = cp.$update();
+        } else {
+          isNew = true;
+          cp.name = cp.humanReadableName;
+          p = new ContentProvider(cp).$save();
+        }
+
+        p.then(function (res) {
+          console.log('save done', res);
+          _this.result = {
+            status: 1,
+            msg: 'Content Provider Saved'
+          };
+          if (isNew) {
+            $location.url('contentProvider/' + res.id + '/');
+          }
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+}).directive('contentProviderCdn', function ($routeParams, CdnPrefix, ContentProvider, lodash) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_cdn_prefix.html',
+    controller: function controller() {
+      var _this = this;
+
+      this.pageName = 'cdn';
+
+      if ($routeParams.id) {
+        ContentProvider.get({ id: $routeParams.id }).$promise.then(function (cp) {
+          _this.cp = cp;
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      // TODO filter on client
+      CdnPrefix.query({ contentProvider: $routeParams.id }).$promise.then(function (cp_prf) {
+        _this.cp_prf = cp_prf;
+      })['catch'](function (e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      CdnPrefix.query().$promise.then(function (prf) {
+        _this.prf = prf;
+      })['catch'](function (e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      this.addPrefix = function (prf) {
+        prf.contentProvider = '/hpcapi/contentproviders/' + $routeParams.id + '/';
+
+        var item = new CdnPrefix(prf);
+
+        item.$save().then(function (res) {
+          _this.cp_prf.push(res);
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+
+      this.removePrefix = function (item) {
+        item.$delete().then(function () {
+          lodash.remove(_this.cp_prf, item);
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+}).directive('contentProviderServer', function ($routeParams, OriginServer, ContentProvider, lodash) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_origin_server.html',
+    controller: function controller() {
+      this.pageName = 'server';
+      this.protocols = ['HTTP', 'RTMP', 'RTP', 'SHOUTcast'];
+
+      var _this = this;
+
+      if ($routeParams.id) {
+        ContentProvider.get({ id: $routeParams.id }).$promise.then(function (cp) {
+          _this.cp = cp;
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      // TODO filter on client
+      OriginServer.query({ contentProvider: $routeParams.id }).$promise.then(function (cp_os) {
+        _this.cp_os = cp_os;
+      })['catch'](function (e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      // TODO everytime protocall error, ask Scott
+      this.addOrigin = function (os) {
+        os.contentProvider = '/hpcapi/contentproviders/' + $routeParams.id + '/';
+
+        var item = new OriginServer(os);
+
+        item.$save().then(function (res) {
+          _this.cp_os.push(res);
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+
+      this.removeOrigin = function (item) {
+        item.$delete().then(function () {
+          lodash.remove(_this.cp_os, item);
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+}).directive('contentProviderUsers', function ($routeParams, ContentProvider, User, lodash) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_user.html',
+    controller: function controller() {
+      var _this = this;
+
+      this.pageName = 'user';
+
+      this.cp_users = [];
+
+      if ($routeParams.id) {
+        ContentProvider.get({ id: $routeParams.id }).$promise.then(function (cp) {
+          _this.cp = cp;
+        })['catch'](function (e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      User.query().$promise.then(function (users) {
+        _this.users = users;
+      })['catch'](function (e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      this.addUserToCp = function (user) {
+        _this.cp_users.push(user);
+      };
+
+      this.removeUserFromCp = function (user) {
+        lodash.remove(_this.cp_users, user);
+      };
+    }
+  };
+});
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/index.html b/xos/core/xoslib/ui_src/contentProvider/src/index.html
new file mode 100644
index 0000000..b0ff8a7
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/index.html
@@ -0,0 +1,20 @@
+<html>
+<head>
+  <!-- bower:css -->
+  <!-- endbower -->
+</head>
+<body>
+  <div ng-app="xos.contentProviderApp">
+    <ng-view></ng-view>
+  </div>
+  <!-- bower:js -->
+  <script src="vendor/angular/angular.js"></script>
+  <script src="vendor/angular-cookies/angular-cookies.js"></script>
+  <script src="vendor/angular-resource/angular-resource.js"></script>
+  <script src="vendor/angular-route/angular-route.js"></script>
+  <script src="vendor/ng-lodash/build/ng-lodash.js"></script>
+  <!-- endbower -->
+
+  <script src=".tmp/xosContentProvider.js"></script>
+</body>
+</html>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/js/xosContentProvider.js b/xos/core/xoslib/ui_src/contentProvider/src/js/xosContentProvider.js
new file mode 100644
index 0000000..04b6a15
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/js/xosContentProvider.js
@@ -0,0 +1,375 @@
+/* global angular */
+/* eslint-disable dot-location*/
+
+// TODO
+// - Add Cache
+// - Refactor routing with ui.router and child views (share the navigation and header)
+// - Add Eslint
+// - Add Es6 (Babel) and a build script
+// - Autogenerate ngResource from swagger definition json
+
+console.log(`test ${1 + 2}`);
+
+angular.module('xos.contentProviderApp', [
+  'ngResource',
+  'ngRoute',
+  'ngCookies',
+  'ngLodash'
+])
+.config(function($interpolateProvider, $routeProvider, $resourceProvider) {
+  $interpolateProvider.startSymbol('{$');
+  $interpolateProvider.endSymbol('$}');
+
+  // NOTE http://www.masnun.com/2013/09/18/django-rest-framework-angularjs-resource-trailing-slash-problem.html
+  $resourceProvider.defaults.stripTrailingSlashes = false;
+
+  $routeProvider
+  .when('/', {
+    template: '<content-provider-list></content-provider-list>',
+  })
+  .when('/contentProvider/:id?', {
+    template: '<content-provider-detail></content-provider-detail>'
+  })
+  .when('/contentProvider/:id/cdn_prefix', {
+    template: '<content-provider-cdn></content-provider-cdn>'
+  })
+  .when('/contentProvider/:id/origin_server', {
+    template: '<content-provider-server></content-provider-server>'
+  })
+  .when('/contentProvider/:id/users', {
+    template: '<content-provider-users></content-provider-users>'
+  })
+  .otherwise('/');
+})
+.config(function($httpProvider) {
+
+  // add X-CSRFToken header for update, create, delete (!GET)
+  $httpProvider.interceptors.push('SetCSRFToken');
+})
+.factory('SetCSRFToken', function($cookies) {
+  return {
+    request: function(request) {
+      if(request.method !== 'GET') {
+        request.headers['X-CSRFToken'] = $cookies.get('csrftoken');
+      }
+      return request;
+    }
+  };
+})
+.constant('apiBaseUrl', 'http://localhost:9000')
+.service('ContentProvider', function($resource, apiBaseUrl) {
+  return $resource(apiBaseUrl, '/hpcapi/contentproviders/:id/', {id: '@id'}, {
+    'update': {method: 'PUT'}
+  });
+})
+.service('ServiceProvider', function($resource) {
+  return $resource('/hpcapi/serviceproviders/:id/', {id: '@id'});
+})
+.service('CdnPrefix', function($resource) {
+  return $resource('/hpcapi/cdnprefixs/:id/', {id: '@id'});
+})
+.service('OriginServer', function($resource) {
+  return $resource('/hpcapi/originservers/:id/', {id: '@id'});
+})
+.service('User', function($resource) {
+  return $resource('/xos/users/:id/', {id: '@id'});
+})
+.directive('cpActions', function(ContentProvider, $location) {
+  return {
+    restrict: 'E',
+    scope: {
+      id: '=id',
+    },
+    bindToController: true,
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_actions.html',
+    controller: function() {
+      this.deleteCp = function(id) {
+        ContentProvider.delete({id: id}).$promise
+        .then(function() {
+          $location.url('/');
+        });
+      };
+    }
+  };
+})
+.directive('contentProviderList', function(ContentProvider, lodash) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    scope: {},
+    templateUrl: 'templates/cp_list.html',
+    controller: function() {
+      var _this = this;
+
+      ContentProvider.query().$promise
+      .then(function(cp) {
+        _this.contentProviderList = cp;
+      })
+      .catch(function(e) {
+        throw new Error(e);
+      });
+
+      this.deleteCp = function(id) {
+        ContentProvider.delete({id: id}).$promise
+        .then(function() {
+          lodash.remove(_this.contentProviderList, {id: id});
+        });
+      };
+    }
+  };
+})
+.directive('contentProviderDetail', function(ContentProvider, ServiceProvider, $routeParams, $location) {
+  return {
+    restrict: 'E',
+    controllerAs: 'vm',
+    scope: {},
+    templateUrl: 'templates/cp_detail.html',
+    controller: function() {
+      this.pageName = 'detail';
+      var _this = this;
+
+      if($routeParams.id) {
+        ContentProvider.get({id: $routeParams.id}).$promise
+        .then(function(cp) {
+          _this.cp = cp;
+        }).catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      ServiceProvider.query().$promise
+      .then(function(sp) {
+        _this.sp = sp;
+      });
+
+      // check if the list id match with item url
+      this.activeServiceProvide = function(id, SPurl) {
+        if(SPurl && SPurl.length > 0) {
+          // take the last 2 char and remove trailing /
+          return parseInt(SPurl.substr(SPurl.length - 2).replace('/','')) === id;
+        }
+        return false;
+      };
+
+      this.saveContentProvider = function(cp) {
+        var p, isNew = false;
+
+        if(cp.id) {
+          p = cp.$update();
+        }
+        else {
+          isNew = true;
+          cp.name = cp.humanReadableName;
+          p = new ContentProvider(cp).$save();
+        }
+
+        p.then(function(res) {
+          console.log('save done', res);
+          _this.result = {
+            status: 1,
+            msg: 'Content Provider Saved'
+          };
+          if(isNew) {
+            $location.url('contentProvider/' + res.id + '/');
+          }
+        })
+        .catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+})
+.directive('contentProviderCdn', function($routeParams, CdnPrefix, ContentProvider, lodash) {
+  return{
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_cdn_prefix.html',
+    controller: function() {
+      var _this = this;
+
+      this.pageName = 'cdn';
+
+      if($routeParams.id) {
+        ContentProvider.get({id: $routeParams.id}).$promise
+        .then(function(cp) {
+          _this.cp = cp;
+        }).catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      // TODO filter on client
+      CdnPrefix.query({contentProvider: $routeParams.id}).$promise
+      .then(function(cp_prf) {
+        _this.cp_prf = cp_prf;
+      }).catch(function(e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      CdnPrefix.query().$promise
+      .then(function(prf) {
+        _this.prf = prf;
+      }).catch(function(e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      this.addPrefix = function(prf) {
+        prf.contentProvider = '/hpcapi/contentproviders/' + $routeParams.id + '/';
+
+        var item = new CdnPrefix(prf);
+
+        item.$save()
+        .then(function(res) {
+          _this.cp_prf.push(res);
+        })
+        .catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+
+      this.removePrefix = function(item) {
+        item.$delete()
+        .then(function() {
+          lodash.remove(_this.cp_prf, item);
+        })
+        .catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+})
+.directive('contentProviderServer', function($routeParams, OriginServer, ContentProvider, lodash) {
+  return{
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_origin_server.html',
+    controller: function() {
+      this.pageName = 'server';
+      this.protocols = ['HTTP', 'RTMP', 'RTP', 'SHOUTcast'];
+
+      var _this = this;
+
+      if($routeParams.id) {
+        ContentProvider.get({id: $routeParams.id}).$promise
+        .then(function(cp) {
+          _this.cp = cp;
+        }).catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      // TODO filter on client
+      OriginServer.query({contentProvider: $routeParams.id}).$promise
+      .then(function(cp_os) {
+        _this.cp_os = cp_os;
+      }).catch(function(e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      // TODO everytime protocall error, ask Scott
+      this.addOrigin = function(os) {
+        os.contentProvider = '/hpcapi/contentproviders/' + $routeParams.id + '/';
+
+        var item = new OriginServer(os);
+
+        item.$save()
+        .then(function(res) {
+          _this.cp_os.push(res);
+        })
+        .catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+
+      this.removeOrigin = function(item) {
+        item.$delete()
+        .then(function() {
+          lodash.remove(_this.cp_os, item);
+        })
+        .catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      };
+    }
+  };
+})
+.directive('contentProviderUsers', function($routeParams, ContentProvider, User, lodash) {
+  return{
+    restrict: 'E',
+    controllerAs: 'vm',
+    templateUrl: 'templates/cp_user.html',
+    controller: function() {
+      var _this = this;
+
+      this.pageName = 'user';
+
+      this.cp_users = [];
+
+      if($routeParams.id) {
+        ContentProvider.get({id: $routeParams.id}).$promise
+        .then(function(cp) {
+          _this.cp = cp;
+        }).catch(function(e) {
+          _this.result = {
+            status: 0,
+            msg: e.data.detail
+          };
+        });
+      }
+
+      User.query().$promise
+      .then(function(users) {
+        _this.users = users;
+      }).catch(function(e) {
+        _this.result = {
+          status: 0,
+          msg: e.data.detail
+        };
+      });
+
+      this.addUserToCp = function(user) {
+        _this.cp_users.push(user);
+      };
+
+      this.removeUserFromCp = function(user) {
+        lodash.remove(_this.cp_users, user);
+      };
+    }
+  };
+});
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_actions.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_actions.html
new file mode 100644
index 0000000..8c6ae97
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_actions.html
@@ -0,0 +1,9 @@
+<a href="#/" class="btn btn-default">
+  <i class="icon icon-arrow-left"></i>Back
+</a>
+<a href="#/contentProvider/" class="btn btn-success">
+  <i class="icon icon-plus"></i>Create
+</a>
+<a ng-click="vm.deleteCp(vm.id)" class="btn btn-danger">
+  <i class="icon icon-remove"></i>Remove
+</a>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_cdn_prefix.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_cdn_prefix.html
new file mode 100644
index 0000000..d989f90
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_cdn_prefix.html
@@ -0,0 +1,55 @@
+<div class="row-fluid">
+  <div class="span6">
+    <h1>{$ vm.cp.humanReadableName $}</h1>
+  </div>
+  <div class="span6 text-right">
+    <cp-actions id="vm.cp.id"></cp-actions>
+  </div>
+</div>
+<hr>
+<div class="row-fluid">
+  <div class="span2">
+    <div ng-include="'../../static/templates/contentProvider/cp_side_nav.html'"></div>
+  </div>
+  <div class="span10">
+    <div ng-repeat="item in vm.cp_prf" class="well">
+      <div class="row-fluid">
+        <div class="span4">
+          {{item.humanReadableName}}
+        </div>
+        <div class="span6">
+          <!-- TODO shoe the name instead that url -->
+          {{item.defaultOriginServer}}
+        </div>
+        <div class="span2">
+          <a ng-click="vm.removePrefix(item)" class="btn btn-danger pull-right">
+            <i class="icon icon-remove"></i>
+          </a>
+        </div>
+      </div>
+    </div>
+    <hr>
+    <form ng-submit="vm.addPrefix(vm.new_prf)">
+      <div class="row-fluid">
+        <div class="span4">
+          <label>Prefix</label>
+          <input type="text" ng-model="vm.new_prf.prefix" required style="max-width: 90%">
+        </div>
+        <div class="span6">
+          <label>Default Origin Server</label>
+          <select ng-model="vm.new_prf.defaultOriginServer" style="max-width: 100%">
+            <option ng-repeat="prf in vm.prf" ng-value="'/hpcapi/originservers/' + prf.id + '/'">{$ prf.humanReadableName $}</option>
+          </select>
+        </div>
+        <div class="span2">
+          <button class="btn btn-success pull-right">
+            <i class="icon icon-plus"></i>
+          </button>
+        </div>
+      </div>
+    </form>
+    <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+      {$ vm.result.msg $}
+    </div>
+  </div>
+</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_detail.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_detail.html
new file mode 100644
index 0000000..7fab7f2
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_detail.html
@@ -0,0 +1,57 @@
+<div class="row-fluid">
+  <div class="span6">
+    <h1>{$ vm.cp.humanReadableName $}</h1>
+  </div>
+  <div class="span6 text-right">
+    <cp-actions id="vm.cp.id"></cp-actions>
+  </div>
+</div>
+<hr>
+<div class="row-fluid">
+  <div ng-show="vm.cp.id" class="span2">
+    <div ng-include="'../../static/templates/contentProvider/cp_side_nav.html'"></div>
+  </div>
+  <div ng-class="{span10: vm.cp.id, span12: !vm.cp.id}">
+  <!-- TODO hide form on not found -->
+    <form ng-submit="vm.saveContentProvider(vm.cp)">
+      <fieldset>
+        <div class="row-fluid">
+          <div class="span6">
+            <label>Name:</label>
+            <input type="text" ng-model="vm.cp.humanReadableName" required/>
+          </div>
+          <div class="span6">
+            <label class="checkbox">
+              <input type="checkbox" ng-model="vm.cp.enabled" /> Enabled
+            </label>
+          </div>
+        </div>
+        <div class="row-fluid">
+          <div class="span12">
+            <label>Description</label>
+            <textarea style="width: 100%" ng-model="vm.cp.description"></textarea>
+          </div>
+        </div>
+        <div class="row-fluid">
+          <div class="span12">
+            <label>Service provider</label>
+            <select ng-model="vm.cp.serviceProvider" required>
+              <option ng-repeat="sp in vm.sp" ng-value="'/hpcapi/serviceproviders/' + sp.id + '/'" ng-selected="vm.activeServiceProvide(sp.id, vm.cp.serviceProvider)">{$ sp.humanReadableName $}</option>
+            </select>
+          </div>
+        </div>
+        <div class="row-fluid">
+          <div class="span12">
+            <button class="btn btn-success">
+              <span ng-show="vm.cp.id">Save</span>
+              <span ng-show="!vm.cp.id">Create</span>
+            </button>
+          </div>
+        </div>
+      </fieldset>
+    </form>
+    <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+      {$ vm.result.msg $}
+    </div>
+  </div>
+</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_list.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_list.html
new file mode 100644
index 0000000..ddb0aa7
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_list.html
@@ -0,0 +1,34 @@
+<table class="table table-striped" ng-show="vm.contentProviderList.length > 0">
+  <thead>
+    <tr>
+      <th>
+        Name
+      </th>
+      <th>Description</th>
+      <th>Status</th>
+      <th></th>
+    </tr>
+  </thead>
+  <tr ng-repeat="item in vm.contentProviderList">
+    <td>
+      <a href="#/contentProvider/{$ item.id $}">{$ item.humanReadableName $}</a>
+    </td>
+    <td>
+      {$ item.description $}
+    </td>
+    <td>
+      {$ item.enabled $}
+    </td>
+    <td>
+      <a ng-click="vm.deleteCp(item.id)" class="btn btn-danger"><i class="icon icon-remove"></i></a></td>
+  </tr>
+</table>
+<div class="alert alert-error" ng-show="vm.contentProviderList.length == 0">
+  No Content Provider defined
+</div>
+
+<div class="row">
+  <div class="span12 text-right">
+    <a class="btn btn-success"href="#/contentProvider/">Create</a>
+  </div>
+</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_origin_server.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_origin_server.html
new file mode 100644
index 0000000..b2e1881
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_origin_server.html
@@ -0,0 +1,53 @@
+<div class="row-fluid">
+  <div class="span6">
+    <h1>{$ vm.cp.humanReadableName $}</h1>
+  </div>
+  <div class="span6 text-right">
+    <cp-actions id="vm.cp.id"></cp-actions>
+  </div>
+</div>
+<hr>
+<div class="row-fluid">
+  <div class="span2">
+    <div ng-include="'../../static/templates/contentProvider/cp_side_nav.html'"></div>
+  </div>
+  <div class="span10">
+    <div ng-repeat="item in vm.cp_os" class="well">
+      <div class="row-fluid">
+        <div class="span4">
+          {{item.humanReadableName}}
+        </div>
+        <div class="span6">
+          <!-- TODO shoe the name instead that url -->
+          {{item.defaultOriginServer}}
+        </div>
+        <div class="span2">
+          <a ng-click="vm.removeOrigin(item)" class="btn btn-danger pull-right">
+            <i class="icon icon-remove"></i>
+          </a>
+        </div>
+      </div>
+    </div>
+    <hr>
+    <form ng-submit="vm.addOrigin(vm.new_os)">
+      <div class="row-fluid">
+        <div class="span4">
+          <label>Protocol</label>
+          <select ng-model="vm.new_os.protocol" ng-options="p for p in vm.protocols" style="max-width: 100%;"></select>
+        </div>
+        <div class="span6">
+          <label>Url</label>
+          <input type="text" ng-model="vm.new_os.url" required>
+        </div>
+        <div class="span2">
+          <button class="btn btn-success pull-right">
+            <i class="icon icon-plus"></i>
+          </button>
+        </div>
+      </div>
+    </form>
+    <div class="alert" ng-show="vm.result" ng-class="{'alert-success': vm.result.status === 1,'alert-error': vm.result.status === 0}">
+      {$ vm.result.msg $}
+    </div>
+  </div>
+</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_side_nav.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_side_nav.html
new file mode 100644
index 0000000..a2c8633
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_side_nav.html
@@ -0,0 +1,14 @@
+<ul class="nav nav-list">
+  <li>
+    <a class="btn" ng-class="{'btn-primary': vm.pageName == 'detail'}" href="#/contentProvider/{$ vm.cp.id $}">Details</a>
+  </li>
+  <li>
+    <a class="btn" ng-class="{'btn-primary': vm.pageName == 'cdn'}" href="#/contentProvider/{$ vm.cp.id $}/cdn_prefix">Cdn Prexix</a>
+  </li>
+  <li>
+    <a class="btn" ng-class="{'btn-primary': vm.pageName == 'server'}" href="#/contentProvider/{$ vm.cp.id $}/origin_server">Origin Server</a>
+  </li>
+  <li>
+    <a class="btn" ng-class="{'btn-primary': vm.pageName == 'user'}" href="#/contentProvider/{$ vm.cp.id $}/users">Users</a>
+  </li>
+</ul>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_user.html b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_user.html
new file mode 100644
index 0000000..435e656
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/templates/cp_user.html
@@ -0,0 +1,38 @@
+<div class="row-fluid">
+  <div class="span6">
+    <h1>{$ vm.cp.humanReadableName $}</h1>
+  </div>
+  <div class="span6 text-right">
+    <cp-actions id="vm.cp.id"></cp-actions>
+  </div>
+</div>
+<hr>
+<div class="row-fluid">
+  <div class="span2">
+    <div ng-include="'../../static/templates/contentProvider/cp_side_nav.html'"></div>
+  </div>
+  <div class="span10">
+    <div ng-repeat="item in vm.cp_users" class="well">
+      <div class="row-fluid">
+        <div class="span3">
+          {{item.firstname}}
+        </div>
+        <div class="span3">
+          {{item.lastname}}
+        </div>
+        <div class="span4">
+          {{item.email}}
+        </div>
+        <div class="span2">
+          <a ng-click="vm.removeUserFromCp(item)" class="btn btn-danger pull-right">
+            <i class="icon icon-remove"></i>
+          </a>
+        </div>
+      </div>
+    </div>
+    <hr>
+    <form>
+      <select ng-model="vm.user" ng-options="u as u.username for u in vm.users" ng-change="vm.addUserToCp(vm.user)"></select>
+    </form>
+  </div>
+</div>
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/.bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/.bower.json
new file mode 100644
index 0000000..ef1a1c0
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/.bower.json
@@ -0,0 +1,19 @@
+{
+  "name": "angular-cookies",
+  "version": "1.4.7",
+  "main": "./angular-cookies.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  },
+  "homepage": "https://github.com/angular/bower-angular-cookies",
+  "_release": "1.4.7",
+  "_resolution": {
+    "type": "version",
+    "tag": "v1.4.7",
+    "commit": "083c164d49ab007e7725b77b9f46095679db010f"
+  },
+  "_source": "git://github.com/angular/bower-angular-cookies.git",
+  "_target": "~1.4.7",
+  "_originalSource": "angular-cookies"
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/README.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/README.md
new file mode 100644
index 0000000..7b190d3
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/README.md
@@ -0,0 +1,68 @@
+# packaged angular-cookies
+
+This repo is for distribution on `npm` and `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngCookies).
+Please file issues and pull requests against that repo.
+
+## Install
+
+You can install this package either with `npm` or with `bower`.
+
+### npm
+
+```shell
+npm install angular-cookies
+```
+
+Then add `ngCookies` as a dependency for your app:
+
+```javascript
+angular.module('myApp', [require('angular-cookies')]);
+```
+
+### bower
+
+```shell
+bower install angular-cookies
+```
+
+Add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular-cookies/angular-cookies.js"></script>
+```
+
+Then add `ngCookies` as a dependency for your app:
+
+```javascript
+angular.module('myApp', ['ngCookies']);
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/api/ngCookies).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
+
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+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.
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.js
new file mode 100644
index 0000000..3eabd43
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.js
@@ -0,0 +1,321 @@
+/**
+ * @license AngularJS v1.4.7
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+(function(window, angular, undefined) {'use strict';
+
+/**
+ * @ngdoc module
+ * @name ngCookies
+ * @description
+ *
+ * # ngCookies
+ *
+ * The `ngCookies` module provides a convenient wrapper for reading and writing browser cookies.
+ *
+ *
+ * <div doc-module-components="ngCookies"></div>
+ *
+ * See {@link ngCookies.$cookies `$cookies`} for usage.
+ */
+
+
+angular.module('ngCookies', ['ng']).
+  /**
+   * @ngdoc provider
+   * @name $cookiesProvider
+   * @description
+   * Use `$cookiesProvider` to change the default behavior of the {@link ngCookies.$cookies $cookies} service.
+   * */
+   provider('$cookies', [function $CookiesProvider() {
+    /**
+     * @ngdoc property
+     * @name $cookiesProvider#defaults
+     * @description
+     *
+     * Object containing default options to pass when setting cookies.
+     *
+     * The object may have following properties:
+     *
+     * - **path** - `{string}` - The cookie will be available only for this path and its
+     *   sub-paths. By default, this would be the URL that appears in your base tag.
+     * - **domain** - `{string}` - The cookie will be available only for this domain and
+     *   its sub-domains. For obvious security reasons the user agent will not accept the
+     *   cookie if the current domain is not a sub domain or equals to the requested domain.
+     * - **expires** - `{string|Date}` - String of the form "Wdy, DD Mon YYYY HH:MM:SS GMT"
+     *   or a Date object indicating the exact date/time this cookie will expire.
+     * - **secure** - `{boolean}` - The cookie will be available only in secured connection.
+     *
+     * Note: by default the address that appears in your `<base>` tag will be used as path.
+     * This is important so that cookies will be visible for all routes in case html5mode is enabled
+     *
+     **/
+    var defaults = this.defaults = {};
+
+    function calcOptions(options) {
+      return options ? angular.extend({}, defaults, options) : defaults;
+    }
+
+    /**
+     * @ngdoc service
+     * @name $cookies
+     *
+     * @description
+     * Provides read/write access to browser's cookies.
+     *
+     * <div class="alert alert-info">
+     * Up until Angular 1.3, `$cookies` exposed properties that represented the
+     * current browser cookie values. In version 1.4, this behavior has changed, and
+     * `$cookies` now provides a standard api of getters, setters etc.
+     * </div>
+     *
+     * Requires the {@link ngCookies `ngCookies`} module to be installed.
+     *
+     * @example
+     *
+     * ```js
+     * angular.module('cookiesExample', ['ngCookies'])
+     *   .controller('ExampleController', ['$cookies', function($cookies) {
+     *     // Retrieving a cookie
+     *     var favoriteCookie = $cookies.get('myFavorite');
+     *     // Setting a cookie
+     *     $cookies.put('myFavorite', 'oatmeal');
+     *   }]);
+     * ```
+     */
+    this.$get = ['$$cookieReader', '$$cookieWriter', function($$cookieReader, $$cookieWriter) {
+      return {
+        /**
+         * @ngdoc method
+         * @name $cookies#get
+         *
+         * @description
+         * Returns the value of given cookie key
+         *
+         * @param {string} key Id to use for lookup.
+         * @returns {string} Raw cookie value.
+         */
+        get: function(key) {
+          return $$cookieReader()[key];
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cookies#getObject
+         *
+         * @description
+         * Returns the deserialized value of given cookie key
+         *
+         * @param {string} key Id to use for lookup.
+         * @returns {Object} Deserialized cookie value.
+         */
+        getObject: function(key) {
+          var value = this.get(key);
+          return value ? angular.fromJson(value) : value;
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cookies#getAll
+         *
+         * @description
+         * Returns a key value object with all the cookies
+         *
+         * @returns {Object} All cookies
+         */
+        getAll: function() {
+          return $$cookieReader();
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cookies#put
+         *
+         * @description
+         * Sets a value for given cookie key
+         *
+         * @param {string} key Id for the `value`.
+         * @param {string} value Raw value to be stored.
+         * @param {Object=} options Options object.
+         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
+         */
+        put: function(key, value, options) {
+          $$cookieWriter(key, value, calcOptions(options));
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cookies#putObject
+         *
+         * @description
+         * Serializes and sets a value for given cookie key
+         *
+         * @param {string} key Id for the `value`.
+         * @param {Object} value Value to be stored.
+         * @param {Object=} options Options object.
+         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
+         */
+        putObject: function(key, value, options) {
+          this.put(key, angular.toJson(value), options);
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cookies#remove
+         *
+         * @description
+         * Remove given cookie
+         *
+         * @param {string} key Id of the key-value pair to delete.
+         * @param {Object=} options Options object.
+         *    See {@link ngCookies.$cookiesProvider#defaults $cookiesProvider.defaults}
+         */
+        remove: function(key, options) {
+          $$cookieWriter(key, undefined, calcOptions(options));
+        }
+      };
+    }];
+  }]);
+
+angular.module('ngCookies').
+/**
+ * @ngdoc service
+ * @name $cookieStore
+ * @deprecated
+ * @requires $cookies
+ *
+ * @description
+ * Provides a key-value (string-object) storage, that is backed by session cookies.
+ * Objects put or retrieved from this storage are automatically serialized or
+ * deserialized by angular's toJson/fromJson.
+ *
+ * Requires the {@link ngCookies `ngCookies`} module to be installed.
+ *
+ * <div class="alert alert-danger">
+ * **Note:** The $cookieStore service is **deprecated**.
+ * Please use the {@link ngCookies.$cookies `$cookies`} service instead.
+ * </div>
+ *
+ * @example
+ *
+ * ```js
+ * angular.module('cookieStoreExample', ['ngCookies'])
+ *   .controller('ExampleController', ['$cookieStore', function($cookieStore) {
+ *     // Put cookie
+ *     $cookieStore.put('myFavorite','oatmeal');
+ *     // Get cookie
+ *     var favoriteCookie = $cookieStore.get('myFavorite');
+ *     // Removing a cookie
+ *     $cookieStore.remove('myFavorite');
+ *   }]);
+ * ```
+ */
+ factory('$cookieStore', ['$cookies', function($cookies) {
+
+    return {
+      /**
+       * @ngdoc method
+       * @name $cookieStore#get
+       *
+       * @description
+       * Returns the value of given cookie key
+       *
+       * @param {string} key Id to use for lookup.
+       * @returns {Object} Deserialized cookie value, undefined if the cookie does not exist.
+       */
+      get: function(key) {
+        return $cookies.getObject(key);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $cookieStore#put
+       *
+       * @description
+       * Sets a value for given cookie key
+       *
+       * @param {string} key Id for the `value`.
+       * @param {Object} value Value to be stored.
+       */
+      put: function(key, value) {
+        $cookies.putObject(key, value);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $cookieStore#remove
+       *
+       * @description
+       * Remove given cookie
+       *
+       * @param {string} key Id of the key-value pair to delete.
+       */
+      remove: function(key) {
+        $cookies.remove(key);
+      }
+    };
+
+  }]);
+
+/**
+ * @name $$cookieWriter
+ * @requires $document
+ *
+ * @description
+ * This is a private service for writing cookies
+ *
+ * @param {string} name Cookie name
+ * @param {string=} value Cookie value (if undefined, cookie will be deleted)
+ * @param {Object=} options Object with options that need to be stored for the cookie.
+ */
+function $$CookieWriter($document, $log, $browser) {
+  var cookiePath = $browser.baseHref();
+  var rawDocument = $document[0];
+
+  function buildCookieString(name, value, options) {
+    var path, expires;
+    options = options || {};
+    expires = options.expires;
+    path = angular.isDefined(options.path) ? options.path : cookiePath;
+    if (angular.isUndefined(value)) {
+      expires = 'Thu, 01 Jan 1970 00:00:00 GMT';
+      value = '';
+    }
+    if (angular.isString(expires)) {
+      expires = new Date(expires);
+    }
+
+    var str = encodeURIComponent(name) + '=' + encodeURIComponent(value);
+    str += path ? ';path=' + path : '';
+    str += options.domain ? ';domain=' + options.domain : '';
+    str += expires ? ';expires=' + expires.toUTCString() : '';
+    str += options.secure ? ';secure' : '';
+
+    // per http://www.ietf.org/rfc/rfc2109.txt browser must allow at minimum:
+    // - 300 cookies
+    // - 20 cookies per unique domain
+    // - 4096 bytes per cookie
+    var cookieLength = str.length + 1;
+    if (cookieLength > 4096) {
+      $log.warn("Cookie '" + name +
+        "' possibly not set or overflowed because it was too large (" +
+        cookieLength + " > 4096 bytes)!");
+    }
+
+    return str;
+  }
+
+  return function(name, value, options) {
+    rawDocument.cookie = buildCookieString(name, value, options);
+  };
+}
+
+$$CookieWriter.$inject = ['$document', '$log', '$browser'];
+
+angular.module('ngCookies').provider('$$cookieWriter', function $$CookieWriterProvider() {
+  this.$get = $$CookieWriter;
+});
+
+
+})(window, window.angular);
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js
new file mode 100644
index 0000000..d68e3ef
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js
@@ -0,0 +1,9 @@
+/*
+ AngularJS v1.4.7
+ (c) 2010-2015 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(p,c,n){'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 ("+
+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,n,k?c.extend({},b,k):b)}}}]}]);c.module("ngCookies").factory("$cookieStore",
+["$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);
+//# sourceMappingURL=angular-cookies.min.js.map
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js.map b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js.map
new file mode 100644
index 0000000..d269e1f
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/angular-cookies.min.js.map
@@ -0,0 +1,8 @@
+{
+"version":3,
+"file":"angular-cookies.min.js",
+"lineCount":8,
+"mappings":"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",
+"sources":["angular-cookies.js"],
+"names":["window","angular","undefined","$$CookieWriter","$document","$log","$browser","cookiePath","baseHref","rawDocument","name","value","options","path","expires","isDefined","isUndefined","isString","Date","str","encodeURIComponent","domain","toUTCString","secure","cookieLength","length","warn","cookie","module","provider","$CookiesProvider","defaults","$get","$$cookieReader","$$cookieWriter","get","key","getObject","fromJson","getAll","put","extend","putObject","toJson","remove","factory","$cookies","$inject","$$CookieWriterProvider"]
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/bower.json
new file mode 100644
index 0000000..a5f4f63
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/bower.json
@@ -0,0 +1,9 @@
+{
+  "name": "angular-cookies",
+  "version": "1.4.7",
+  "main": "./angular-cookies.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/index.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/index.js
new file mode 100644
index 0000000..6576675
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/index.js
@@ -0,0 +1,2 @@
+require('./angular-cookies');
+module.exports = 'ngCookies';
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/package.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/package.json
new file mode 100644
index 0000000..7eddecd
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-cookies/package.json
@@ -0,0 +1,26 @@
+{
+  "name": "angular-cookies",
+  "version": "1.4.7",
+  "description": "AngularJS module for cookies",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/angular/angular.js.git"
+  },
+  "keywords": [
+    "angular",
+    "framework",
+    "browser",
+    "cookies",
+    "client-side"
+  ],
+  "author": "Angular Core Team <angular-core+npm@google.com>",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/angular/angular.js/issues"
+  },
+  "homepage": "http://angularjs.org"
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/.bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/.bower.json
new file mode 100644
index 0000000..e88b107
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/.bower.json
@@ -0,0 +1,19 @@
+{
+  "name": "angular-resource",
+  "version": "1.4.7",
+  "main": "./angular-resource.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  },
+  "homepage": "https://github.com/angular/bower-angular-resource",
+  "_release": "1.4.7",
+  "_resolution": {
+    "type": "version",
+    "tag": "v1.4.7",
+    "commit": "c97a21f0e610d48045863da9518d8c13b2c1ed9d"
+  },
+  "_source": "git://github.com/angular/bower-angular-resource.git",
+  "_target": "~1.4.7",
+  "_originalSource": "angular-resource"
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/README.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/README.md
new file mode 100644
index 0000000..f3bd119
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/README.md
@@ -0,0 +1,68 @@
+# packaged angular-resource
+
+This repo is for distribution on `npm` and `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngResource).
+Please file issues and pull requests against that repo.
+
+## Install
+
+You can install this package either with `npm` or with `bower`.
+
+### npm
+
+```shell
+npm install angular-resource
+```
+
+Then add `ngResource` as a dependency for your app:
+
+```javascript
+angular.module('myApp', [require('angular-resource')]);
+```
+
+### bower
+
+```shell
+bower install angular-resource
+```
+
+Add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular-resource/angular-resource.js"></script>
+```
+
+Then add `ngResource` as a dependency for your app:
+
+```javascript
+angular.module('myApp', ['ngResource']);
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/api/ngResource).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
+
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+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.
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.js
new file mode 100644
index 0000000..39b370e
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.js
@@ -0,0 +1,675 @@
+/**
+ * @license AngularJS v1.4.7
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+(function(window, angular, undefined) {'use strict';
+
+var $resourceMinErr = angular.$$minErr('$resource');
+
+// Helper functions and regex to lookup a dotted path on an object
+// stopping at undefined/null.  The path must be composed of ASCII
+// identifiers (just like $parse)
+var MEMBER_NAME_REGEX = /^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;
+
+function isValidDottedPath(path) {
+  return (path != null && path !== '' && path !== 'hasOwnProperty' &&
+      MEMBER_NAME_REGEX.test('.' + path));
+}
+
+function lookupDottedPath(obj, path) {
+  if (!isValidDottedPath(path)) {
+    throw $resourceMinErr('badmember', 'Dotted member path "@{0}" is invalid.', path);
+  }
+  var keys = path.split('.');
+  for (var i = 0, ii = keys.length; i < ii && angular.isDefined(obj); i++) {
+    var key = keys[i];
+    obj = (obj !== null) ? obj[key] : undefined;
+  }
+  return obj;
+}
+
+/**
+ * Create a shallow copy of an object and clear other fields from the destination
+ */
+function shallowClearAndCopy(src, dst) {
+  dst = dst || {};
+
+  angular.forEach(dst, function(value, key) {
+    delete dst[key];
+  });
+
+  for (var key in src) {
+    if (src.hasOwnProperty(key) && !(key.charAt(0) === '$' && key.charAt(1) === '$')) {
+      dst[key] = src[key];
+    }
+  }
+
+  return dst;
+}
+
+/**
+ * @ngdoc module
+ * @name ngResource
+ * @description
+ *
+ * # ngResource
+ *
+ * The `ngResource` module provides interaction support with RESTful services
+ * via the $resource service.
+ *
+ *
+ * <div doc-module-components="ngResource"></div>
+ *
+ * See {@link ngResource.$resource `$resource`} for usage.
+ */
+
+/**
+ * @ngdoc service
+ * @name $resource
+ * @requires $http
+ *
+ * @description
+ * A factory which creates a resource object that lets you interact with
+ * [RESTful](http://en.wikipedia.org/wiki/Representational_State_Transfer) server-side data sources.
+ *
+ * The returned resource object has action methods which provide high-level behaviors without
+ * the need to interact with the low level {@link ng.$http $http} service.
+ *
+ * Requires the {@link ngResource `ngResource`} module to be installed.
+ *
+ * By default, trailing slashes will be stripped from the calculated URLs,
+ * which can pose problems with server backends that do not expect that
+ * behavior.  This can be disabled by configuring the `$resourceProvider` like
+ * this:
+ *
+ * ```js
+     app.config(['$resourceProvider', function($resourceProvider) {
+       // Don't strip trailing slashes from calculated URLs
+       $resourceProvider.defaults.stripTrailingSlashes = false;
+     }]);
+ * ```
+ *
+ * @param {string} url A parameterized URL template with parameters prefixed by `:` as in
+ *   `/user/:username`. If you are using a URL with a port number (e.g.
+ *   `http://example.com:8080/api`), it will be respected.
+ *
+ *   If you are using a url with a suffix, just add the suffix, like this:
+ *   `$resource('http://example.com/resource.json')` or `$resource('http://example.com/:id.json')`
+ *   or even `$resource('http://example.com/resource/:resource_id.:format')`
+ *   If the parameter before the suffix is empty, :resource_id in this case, then the `/.` will be
+ *   collapsed down to a single `.`.  If you need this sequence to appear and not collapse then you
+ *   can escape it with `/\.`.
+ *
+ * @param {Object=} paramDefaults Default values for `url` parameters. These can be overridden in
+ *   `actions` methods. If any of the parameter value is a function, it will be executed every time
+ *   when a param value needs to be obtained for a request (unless the param was overridden).
+ *
+ *   Each key value in the parameter object is first bound to url template if present and then any
+ *   excess keys are appended to the url search query after the `?`.
+ *
+ *   Given a template `/path/:verb` and parameter `{verb:'greet', salutation:'Hello'}` results in
+ *   URL `/path/greet?salutation=Hello`.
+ *
+ *   If the parameter value is prefixed with `@` then the value for that parameter will be extracted
+ *   from the corresponding property on the `data` object (provided when calling an action method).  For
+ *   example, if the `defaultParam` object is `{someParam: '@someProp'}` then the value of `someParam`
+ *   will be `data.someProp`.
+ *
+ * @param {Object.<Object>=} actions Hash with declaration of custom actions that should extend
+ *   the default set of resource actions. The declaration should be created in the format of {@link
+ *   ng.$http#usage $http.config}:
+ *
+ *       {action1: {method:?, params:?, isArray:?, headers:?, ...},
+ *        action2: {method:?, params:?, isArray:?, headers:?, ...},
+ *        ...}
+ *
+ *   Where:
+ *
+ *   - **`action`** – {string} – The name of action. This name becomes the name of the method on
+ *     your resource object.
+ *   - **`method`** – {string} – Case insensitive HTTP method (e.g. `GET`, `POST`, `PUT`,
+ *     `DELETE`, `JSONP`, etc).
+ *   - **`params`** – {Object=} – Optional set of pre-bound parameters for this action. If any of
+ *     the parameter value is a function, it will be executed every time when a param value needs to
+ *     be obtained for a request (unless the param was overridden).
+ *   - **`url`** – {string} – action specific `url` override. The url templating is supported just
+ *     like for the resource-level urls.
+ *   - **`isArray`** – {boolean=} – If true then the returned object for this action is an array,
+ *     see `returns` section.
+ *   - **`transformRequest`** –
+ *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
+ *     transform function or an array of such functions. The transform function takes the http
+ *     request body and headers and returns its transformed (typically serialized) version.
+ *     By default, transformRequest will contain one function that checks if the request data is
+ *     an object and serializes to using `angular.toJson`. To prevent this behavior, set
+ *     `transformRequest` to an empty array: `transformRequest: []`
+ *   - **`transformResponse`** –
+ *     `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
+ *     transform function or an array of such functions. The transform function takes the http
+ *     response body and headers and returns its transformed (typically deserialized) version.
+ *     By default, transformResponse will contain one function that checks if the response looks like
+ *     a JSON string and deserializes it using `angular.fromJson`. To prevent this behavior, set
+ *     `transformResponse` to an empty array: `transformResponse: []`
+ *   - **`cache`** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
+ *     GET request, otherwise if a cache instance built with
+ *     {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
+ *     caching.
+ *   - **`timeout`** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise} that
+ *     should abort the request when resolved.
+ *   - **`withCredentials`** - `{boolean}` - whether to set the `withCredentials` flag on the
+ *     XHR object. See
+ *     [requests with credentials](https://developer.mozilla.org/en/http_access_control#section_5)
+ *     for more information.
+ *   - **`responseType`** - `{string}` - see
+ *     [requestType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType).
+ *   - **`interceptor`** - `{Object=}` - The interceptor object has two optional methods -
+ *     `response` and `responseError`. Both `response` and `responseError` interceptors get called
+ *     with `http response` object. See {@link ng.$http $http interceptors}.
+ *
+ * @param {Object} options Hash with custom settings that should extend the
+ *   default `$resourceProvider` behavior.  The only supported option is
+ *
+ *   Where:
+ *
+ *   - **`stripTrailingSlashes`** – {boolean} – If true then the trailing
+ *   slashes from any calculated URL will be stripped. (Defaults to true.)
+ *
+ * @returns {Object} A resource "class" object with methods for the default set of resource actions
+ *   optionally extended with custom `actions`. The default set contains these actions:
+ *   ```js
+ *   { 'get':    {method:'GET'},
+ *     'save':   {method:'POST'},
+ *     'query':  {method:'GET', isArray:true},
+ *     'remove': {method:'DELETE'},
+ *     'delete': {method:'DELETE'} };
+ *   ```
+ *
+ *   Calling these methods invoke an {@link ng.$http} with the specified http method,
+ *   destination and parameters. When the data is returned from the server then the object is an
+ *   instance of the resource class. The actions `save`, `remove` and `delete` are available on it
+ *   as  methods with the `$` prefix. This allows you to easily perform CRUD operations (create,
+ *   read, update, delete) on server-side data like this:
+ *   ```js
+ *   var User = $resource('/user/:userId', {userId:'@id'});
+ *   var user = User.get({userId:123}, function() {
+ *     user.abc = true;
+ *     user.$save();
+ *   });
+ *   ```
+ *
+ *   It is important to realize that invoking a $resource object method immediately returns an
+ *   empty reference (object or array depending on `isArray`). Once the data is returned from the
+ *   server the existing reference is populated with the actual data. This is a useful trick since
+ *   usually the resource is assigned to a model which is then rendered by the view. Having an empty
+ *   object results in no rendering, once the data arrives from the server then the object is
+ *   populated with the data and the view automatically re-renders itself showing the new data. This
+ *   means that in most cases one never has to write a callback function for the action methods.
+ *
+ *   The action methods on the class object or instance object can be invoked with the following
+ *   parameters:
+ *
+ *   - HTTP GET "class" actions: `Resource.action([parameters], [success], [error])`
+ *   - non-GET "class" actions: `Resource.action([parameters], postData, [success], [error])`
+ *   - non-GET instance actions:  `instance.$action([parameters], [success], [error])`
+ *
+ *
+ *   Success callback is called with (value, responseHeaders) arguments, where the value is
+ *   the populated resource instance or collection object. The error callback is called
+ *   with (httpResponse) argument.
+ *
+ *   Class actions return empty instance (with additional properties below).
+ *   Instance actions return promise of the action.
+ *
+ *   The Resource instances and collection have these additional properties:
+ *
+ *   - `$promise`: the {@link ng.$q promise} of the original server interaction that created this
+ *     instance or collection.
+ *
+ *     On success, the promise is resolved with the same resource instance or collection object,
+ *     updated with data from server. This makes it easy to use in
+ *     {@link ngRoute.$routeProvider resolve section of $routeProvider.when()} to defer view
+ *     rendering until the resource(s) are loaded.
+ *
+ *     On failure, the promise is resolved with the {@link ng.$http http response} object, without
+ *     the `resource` property.
+ *
+ *     If an interceptor object was provided, the promise will instead be resolved with the value
+ *     returned by the interceptor.
+ *
+ *   - `$resolved`: `true` after first server interaction is completed (either with success or
+ *      rejection), `false` before that. Knowing if the Resource has been resolved is useful in
+ *      data-binding.
+ *
+ * @example
+ *
+ * # Credit card resource
+ *
+ * ```js
+     // Define CreditCard class
+     var CreditCard = $resource('/user/:userId/card/:cardId',
+      {userId:123, cardId:'@id'}, {
+       charge: {method:'POST', params:{charge:true}}
+      });
+
+     // We can retrieve a collection from the server
+     var cards = CreditCard.query(function() {
+       // GET: /user/123/card
+       // server returns: [ {id:456, number:'1234', name:'Smith'} ];
+
+       var card = cards[0];
+       // each item is an instance of CreditCard
+       expect(card instanceof CreditCard).toEqual(true);
+       card.name = "J. Smith";
+       // non GET methods are mapped onto the instances
+       card.$save();
+       // POST: /user/123/card/456 {id:456, number:'1234', name:'J. Smith'}
+       // server returns: {id:456, number:'1234', name: 'J. Smith'};
+
+       // our custom method is mapped as well.
+       card.$charge({amount:9.99});
+       // POST: /user/123/card/456?amount=9.99&charge=true {id:456, number:'1234', name:'J. Smith'}
+     });
+
+     // we can create an instance as well
+     var newCard = new CreditCard({number:'0123'});
+     newCard.name = "Mike Smith";
+     newCard.$save();
+     // POST: /user/123/card {number:'0123', name:'Mike Smith'}
+     // server returns: {id:789, number:'0123', name: 'Mike Smith'};
+     expect(newCard.id).toEqual(789);
+ * ```
+ *
+ * The object returned from this function execution is a resource "class" which has "static" method
+ * for each action in the definition.
+ *
+ * Calling these methods invoke `$http` on the `url` template with the given `method`, `params` and
+ * `headers`.
+ * When the data is returned from the server then the object is an instance of the resource type and
+ * all of the non-GET methods are available with `$` prefix. This allows you to easily support CRUD
+ * operations (create, read, update, delete) on server-side data.
+
+   ```js
+     var User = $resource('/user/:userId', {userId:'@id'});
+     User.get({userId:123}, function(user) {
+       user.abc = true;
+       user.$save();
+     });
+   ```
+ *
+ * It's worth noting that the success callback for `get`, `query` and other methods gets passed
+ * in the response that came from the server as well as $http header getter function, so one
+ * could rewrite the above example and get access to http headers as:
+ *
+   ```js
+     var User = $resource('/user/:userId', {userId:'@id'});
+     User.get({userId:123}, function(u, getResponseHeaders){
+       u.abc = true;
+       u.$save(function(u, putResponseHeaders) {
+         //u => saved user object
+         //putResponseHeaders => $http header getter
+       });
+     });
+   ```
+ *
+ * You can also access the raw `$http` promise via the `$promise` property on the object returned
+ *
+   ```
+     var User = $resource('/user/:userId', {userId:'@id'});
+     User.get({userId:123})
+         .$promise.then(function(user) {
+           $scope.user = user;
+         });
+   ```
+
+ * # Creating a custom 'PUT' request
+ * In this example we create a custom method on our resource to make a PUT request
+ * ```js
+ *    var app = angular.module('app', ['ngResource', 'ngRoute']);
+ *
+ *    // Some APIs expect a PUT request in the format URL/object/ID
+ *    // Here we are creating an 'update' method
+ *    app.factory('Notes', ['$resource', function($resource) {
+ *    return $resource('/notes/:id', null,
+ *        {
+ *            'update': { method:'PUT' }
+ *        });
+ *    }]);
+ *
+ *    // In our controller we get the ID from the URL using ngRoute and $routeParams
+ *    // We pass in $routeParams and our Notes factory along with $scope
+ *    app.controller('NotesCtrl', ['$scope', '$routeParams', 'Notes',
+                                      function($scope, $routeParams, Notes) {
+ *    // First get a note object from the factory
+ *    var note = Notes.get({ id:$routeParams.id });
+ *    $id = note.id;
+ *
+ *    // Now call update passing in the ID first then the object you are updating
+ *    Notes.update({ id:$id }, note);
+ *
+ *    // This will PUT /notes/ID with the note object in the request payload
+ *    }]);
+ * ```
+ */
+angular.module('ngResource', ['ng']).
+  provider('$resource', function() {
+    var PROTOCOL_AND_DOMAIN_REGEX = /^https?:\/\/[^\/]*/;
+    var provider = this;
+
+    this.defaults = {
+      // Strip slashes by default
+      stripTrailingSlashes: true,
+
+      // Default actions configuration
+      actions: {
+        'get': {method: 'GET'},
+        'save': {method: 'POST'},
+        'query': {method: 'GET', isArray: true},
+        'remove': {method: 'DELETE'},
+        'delete': {method: 'DELETE'}
+      }
+    };
+
+    this.$get = ['$http', '$q', function($http, $q) {
+
+      var noop = angular.noop,
+        forEach = angular.forEach,
+        extend = angular.extend,
+        copy = angular.copy,
+        isFunction = angular.isFunction;
+
+      /**
+       * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
+       * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set
+       * (pchar) allowed in path segments:
+       *    segment       = *pchar
+       *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
+       *    pct-encoded   = "%" HEXDIG HEXDIG
+       *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
+       *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
+       *                     / "*" / "+" / "," / ";" / "="
+       */
+      function encodeUriSegment(val) {
+        return encodeUriQuery(val, true).
+          replace(/%26/gi, '&').
+          replace(/%3D/gi, '=').
+          replace(/%2B/gi, '+');
+      }
+
+
+      /**
+       * This method is intended for encoding *key* or *value* parts of query component. We need a
+       * custom method because encodeURIComponent is too aggressive and encodes stuff that doesn't
+       * have to be encoded per http://tools.ietf.org/html/rfc3986:
+       *    query       = *( pchar / "/" / "?" )
+       *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
+       *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
+       *    pct-encoded   = "%" HEXDIG HEXDIG
+       *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
+       *                     / "*" / "+" / "," / ";" / "="
+       */
+      function encodeUriQuery(val, pctEncodeSpaces) {
+        return encodeURIComponent(val).
+          replace(/%40/gi, '@').
+          replace(/%3A/gi, ':').
+          replace(/%24/g, '$').
+          replace(/%2C/gi, ',').
+          replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
+      }
+
+      function Route(template, defaults) {
+        this.template = template;
+        this.defaults = extend({}, provider.defaults, defaults);
+        this.urlParams = {};
+      }
+
+      Route.prototype = {
+        setUrlParams: function(config, params, actionUrl) {
+          var self = this,
+            url = actionUrl || self.template,
+            val,
+            encodedVal,
+            protocolAndDomain = '';
+
+          var urlParams = self.urlParams = {};
+          forEach(url.split(/\W/), function(param) {
+            if (param === 'hasOwnProperty') {
+              throw $resourceMinErr('badname', "hasOwnProperty is not a valid parameter name.");
+            }
+            if (!(new RegExp("^\\d+$").test(param)) && param &&
+              (new RegExp("(^|[^\\\\]):" + param + "(\\W|$)").test(url))) {
+              urlParams[param] = true;
+            }
+          });
+          url = url.replace(/\\:/g, ':');
+          url = url.replace(PROTOCOL_AND_DOMAIN_REGEX, function(match) {
+            protocolAndDomain = match;
+            return '';
+          });
+
+          params = params || {};
+          forEach(self.urlParams, function(_, urlParam) {
+            val = params.hasOwnProperty(urlParam) ? params[urlParam] : self.defaults[urlParam];
+            if (angular.isDefined(val) && val !== null) {
+              encodedVal = encodeUriSegment(val);
+              url = url.replace(new RegExp(":" + urlParam + "(\\W|$)", "g"), function(match, p1) {
+                return encodedVal + p1;
+              });
+            } else {
+              url = url.replace(new RegExp("(\/?):" + urlParam + "(\\W|$)", "g"), function(match,
+                  leadingSlashes, tail) {
+                if (tail.charAt(0) == '/') {
+                  return tail;
+                } else {
+                  return leadingSlashes + tail;
+                }
+              });
+            }
+          });
+
+          // strip trailing slashes and set the url (unless this behavior is specifically disabled)
+          if (self.defaults.stripTrailingSlashes) {
+            url = url.replace(/\/+$/, '') || '/';
+          }
+
+          // then replace collapse `/.` if found in the last URL path segment before the query
+          // E.g. `http://url.com/id./format?q=x` becomes `http://url.com/id.format?q=x`
+          url = url.replace(/\/\.(?=\w+($|\?))/, '.');
+          // replace escaped `/\.` with `/.`
+          config.url = protocolAndDomain + url.replace(/\/\\\./, '/.');
+
+
+          // set params - delegate param encoding to $http
+          forEach(params, function(value, key) {
+            if (!self.urlParams[key]) {
+              config.params = config.params || {};
+              config.params[key] = value;
+            }
+          });
+        }
+      };
+
+
+      function resourceFactory(url, paramDefaults, actions, options) {
+        var route = new Route(url, options);
+
+        actions = extend({}, provider.defaults.actions, actions);
+
+        function extractParams(data, actionParams) {
+          var ids = {};
+          actionParams = extend({}, paramDefaults, actionParams);
+          forEach(actionParams, function(value, key) {
+            if (isFunction(value)) { value = value(); }
+            ids[key] = value && value.charAt && value.charAt(0) == '@' ?
+              lookupDottedPath(data, value.substr(1)) : value;
+          });
+          return ids;
+        }
+
+        function defaultResponseInterceptor(response) {
+          return response.resource;
+        }
+
+        function Resource(value) {
+          shallowClearAndCopy(value || {}, this);
+        }
+
+        Resource.prototype.toJSON = function() {
+          var data = extend({}, this);
+          delete data.$promise;
+          delete data.$resolved;
+          return data;
+        };
+
+        forEach(actions, function(action, name) {
+          var hasBody = /^(POST|PUT|PATCH)$/i.test(action.method);
+
+          Resource[name] = function(a1, a2, a3, a4) {
+            var params = {}, data, success, error;
+
+            /* jshint -W086 */ /* (purposefully fall through case statements) */
+            switch (arguments.length) {
+              case 4:
+                error = a4;
+                success = a3;
+              //fallthrough
+              case 3:
+              case 2:
+                if (isFunction(a2)) {
+                  if (isFunction(a1)) {
+                    success = a1;
+                    error = a2;
+                    break;
+                  }
+
+                  success = a2;
+                  error = a3;
+                  //fallthrough
+                } else {
+                  params = a1;
+                  data = a2;
+                  success = a3;
+                  break;
+                }
+              case 1:
+                if (isFunction(a1)) success = a1;
+                else if (hasBody) data = a1;
+                else params = a1;
+                break;
+              case 0: break;
+              default:
+                throw $resourceMinErr('badargs',
+                  "Expected up to 4 arguments [params, data, success, error], got {0} arguments",
+                  arguments.length);
+            }
+            /* jshint +W086 */ /* (purposefully fall through case statements) */
+
+            var isInstanceCall = this instanceof Resource;
+            var value = isInstanceCall ? data : (action.isArray ? [] : new Resource(data));
+            var httpConfig = {};
+            var responseInterceptor = action.interceptor && action.interceptor.response ||
+              defaultResponseInterceptor;
+            var responseErrorInterceptor = action.interceptor && action.interceptor.responseError ||
+              undefined;
+
+            forEach(action, function(value, key) {
+              if (key != 'params' && key != 'isArray' && key != 'interceptor') {
+                httpConfig[key] = copy(value);
+              }
+            });
+
+            if (hasBody) httpConfig.data = data;
+            route.setUrlParams(httpConfig,
+              extend({}, extractParams(data, action.params || {}), params),
+              action.url);
+
+            var promise = $http(httpConfig).then(function(response) {
+              var data = response.data,
+                promise = value.$promise;
+
+              if (data) {
+                // Need to convert action.isArray to boolean in case it is undefined
+                // jshint -W018
+                if (angular.isArray(data) !== (!!action.isArray)) {
+                  throw $resourceMinErr('badcfg',
+                      'Error in resource configuration for action `{0}`. Expected response to ' +
+                      'contain an {1} but got an {2} (Request: {3} {4})', name, action.isArray ? 'array' : 'object',
+                    angular.isArray(data) ? 'array' : 'object', httpConfig.method, httpConfig.url);
+                }
+                // jshint +W018
+                if (action.isArray) {
+                  value.length = 0;
+                  forEach(data, function(item) {
+                    if (typeof item === "object") {
+                      value.push(new Resource(item));
+                    } else {
+                      // Valid JSON values may be string literals, and these should not be converted
+                      // into objects. These items will not have access to the Resource prototype
+                      // methods, but unfortunately there
+                      value.push(item);
+                    }
+                  });
+                } else {
+                  shallowClearAndCopy(data, value);
+                  value.$promise = promise;
+                }
+              }
+
+              value.$resolved = true;
+
+              response.resource = value;
+
+              return response;
+            }, function(response) {
+              value.$resolved = true;
+
+              (error || noop)(response);
+
+              return $q.reject(response);
+            });
+
+            promise = promise.then(
+              function(response) {
+                var value = responseInterceptor(response);
+                (success || noop)(value, response.headers);
+                return value;
+              },
+              responseErrorInterceptor);
+
+            if (!isInstanceCall) {
+              // we are creating instance / collection
+              // - set the initial promise
+              // - return the instance / collection
+              value.$promise = promise;
+              value.$resolved = false;
+
+              return value;
+            }
+
+            // instance call
+            return promise;
+          };
+
+
+          Resource.prototype['$' + name] = function(params, success, error) {
+            if (isFunction(params)) {
+              error = success; success = params; params = {};
+            }
+            var result = Resource[name].call(this, params, this, success, error);
+            return result.$promise || result;
+          };
+        });
+
+        Resource.bind = function(additionalParamDefaults) {
+          return resourceFactory(url, extend({}, paramDefaults, additionalParamDefaults), actions);
+        };
+
+        return Resource;
+      }
+
+      return resourceFactory;
+    }];
+  });
+
+
+})(window, window.angular);
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js
new file mode 100644
index 0000000..0d22c37
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js
@@ -0,0 +1,13 @@
+/*
+ AngularJS v1.4.7
+ (c) 2010-2015 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(I,f,C){'use strict';function D(t,e){e=e||{};f.forEach(e,function(f,k){delete e[k]});for(var k in t)!t.hasOwnProperty(k)||"$"===k.charAt(0)&&"$"===k.charAt(1)||(e[k]=t[k]);return e}var y=f.$$minErr("$resource"),B=/^(\.[a-zA-Z_$@][0-9a-zA-Z_$@]*)+$/;f.module("ngResource",["ng"]).provider("$resource",function(){var t=/^https?:\/\/[^\/]*/,e=this;this.defaults={stripTrailingSlashes:!0,actions:{get:{method:"GET"},save:{method:"POST"},query:{method:"GET",isArray:!0},remove:{method:"DELETE"},"delete":{method:"DELETE"}}};
+this.$get=["$http","$q",function(k,F){function w(f,g){this.template=f;this.defaults=r({},e.defaults,g);this.urlParams={}}function z(l,g,s,h){function c(b,q){var c={};q=r({},g,q);u(q,function(a,q){x(a)&&(a=a());var m;if(a&&a.charAt&&"@"==a.charAt(0)){m=b;var d=a.substr(1);if(null==d||""===d||"hasOwnProperty"===d||!B.test("."+d))throw y("badmember",d);for(var d=d.split("."),n=0,g=d.length;n<g&&f.isDefined(m);n++){var e=d[n];m=null!==m?m[e]:C}}else m=a;c[q]=m});return c}function G(b){return b.resource}
+function d(b){D(b||{},this)}var t=new w(l,h);s=r({},e.defaults.actions,s);d.prototype.toJSON=function(){var b=r({},this);delete b.$promise;delete b.$resolved;return b};u(s,function(b,q){var g=/^(POST|PUT|PATCH)$/i.test(b.method);d[q]=function(a,A,m,e){var n={},h,l,s;switch(arguments.length){case 4:s=e,l=m;case 3:case 2:if(x(A)){if(x(a)){l=a;s=A;break}l=A;s=m}else{n=a;h=A;l=m;break}case 1:x(a)?l=a:g?h=a:n=a;break;case 0:break;default:throw y("badargs",arguments.length);}var w=this instanceof d,p=w?
+h:b.isArray?[]:new d(h),v={},z=b.interceptor&&b.interceptor.response||G,B=b.interceptor&&b.interceptor.responseError||C;u(b,function(b,a){"params"!=a&&"isArray"!=a&&"interceptor"!=a&&(v[a]=H(b))});g&&(v.data=h);t.setUrlParams(v,r({},c(h,b.params||{}),n),b.url);n=k(v).then(function(a){var c=a.data,m=p.$promise;if(c){if(f.isArray(c)!==!!b.isArray)throw y("badcfg",q,b.isArray?"array":"object",f.isArray(c)?"array":"object",v.method,v.url);b.isArray?(p.length=0,u(c,function(a){"object"===typeof a?p.push(new d(a)):
+p.push(a)})):(D(c,p),p.$promise=m)}p.$resolved=!0;a.resource=p;return a},function(a){p.$resolved=!0;(s||E)(a);return F.reject(a)});n=n.then(function(a){var b=z(a);(l||E)(b,a.headers);return b},B);return w?n:(p.$promise=n,p.$resolved=!1,p)};d.prototype["$"+q]=function(a,b,c){x(a)&&(c=b,b=a,a={});a=d[q].call(this,a,this,b,c);return a.$promise||a}});d.bind=function(b){return z(l,r({},g,b),s)};return d}var E=f.noop,u=f.forEach,r=f.extend,H=f.copy,x=f.isFunction;w.prototype={setUrlParams:function(l,g,
+e){var h=this,c=e||h.template,k,d,r="",b=h.urlParams={};u(c.split(/\W/),function(d){if("hasOwnProperty"===d)throw y("badname");!/^\d+$/.test(d)&&d&&(new RegExp("(^|[^\\\\]):"+d+"(\\W|$)")).test(c)&&(b[d]=!0)});c=c.replace(/\\:/g,":");c=c.replace(t,function(b){r=b;return""});g=g||{};u(h.urlParams,function(b,e){k=g.hasOwnProperty(e)?g[e]:h.defaults[e];f.isDefined(k)&&null!==k?(d=encodeURIComponent(k).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"%20").replace(/%26/gi,
+"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+"),c=c.replace(new RegExp(":"+e+"(\\W|$)","g"),function(a,b){return d+b})):c=c.replace(new RegExp("(/?):"+e+"(\\W|$)","g"),function(a,b,c){return"/"==c.charAt(0)?c:b+c})});h.defaults.stripTrailingSlashes&&(c=c.replace(/\/+$/,"")||"/");c=c.replace(/\/\.(?=\w+($|\?))/,".");l.url=r+c.replace(/\/\\\./,"/.");u(g,function(b,c){h.urlParams[c]||(l.params=l.params||{},l.params[c]=b)})}};return z}]})})(window,window.angular);
+//# sourceMappingURL=angular-resource.min.js.map
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js.map b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js.map
new file mode 100644
index 0000000..2d23594
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/angular-resource.min.js.map
@@ -0,0 +1,8 @@
+{
+"version":3,
+"file":"angular-resource.min.js",
+"lineCount":12,
+"mappings":"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",
+"sources":["angular-resource.js"],
+"names":["window","angular","undefined","shallowClearAndCopy","src","dst","forEach","value","key","hasOwnProperty","charAt","$resourceMinErr","$$minErr","MEMBER_NAME_REGEX","module","provider","PROTOCOL_AND_DOMAIN_REGEX","defaults","stripTrailingSlashes","actions","method","isArray","$get","$http","$q","Route","template","extend","urlParams","resourceFactory","url","paramDefaults","options","extractParams","data","actionParams","ids","isFunction","path","test","keys","split","i","ii","length","isDefined","obj","defaultResponseInterceptor","response","resource","Resource","route","prototype","toJSON","Resource.prototype.toJSON","$promise","$resolved","action","name","hasBody","a1","a2","a3","a4","params","success","error","arguments","isInstanceCall","httpConfig","responseInterceptor","interceptor","responseErrorInterceptor","responseError","copy","setUrlParams","promise","then","item","push","noop","reject","headers","result","call","bind","Resource.bind","additionalParamDefaults","config","actionUrl","self","val","encodedVal","protocolAndDomain","param","RegExp","replace","match","_","urlParam","encodeURIComponent","p1","leadingSlashes","tail"]
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/bower.json
new file mode 100644
index 0000000..f466b55
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/bower.json
@@ -0,0 +1,9 @@
+{
+  "name": "angular-resource",
+  "version": "1.4.7",
+  "main": "./angular-resource.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/index.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/index.js
new file mode 100644
index 0000000..fc40152
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/index.js
@@ -0,0 +1,2 @@
+require('./angular-resource');
+module.exports = 'ngResource';
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/package.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/package.json
new file mode 100644
index 0000000..3fa675b
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-resource/package.json
@@ -0,0 +1,26 @@
+{
+  "name": "angular-resource",
+  "version": "1.4.7",
+  "description": "AngularJS module for interacting with RESTful server-side data sources",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/angular/angular.js.git"
+  },
+  "keywords": [
+    "angular",
+    "framework",
+    "browser",
+    "rest",
+    "client-side"
+  ],
+  "author": "Angular Core Team <angular-core+npm@google.com>",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/angular/angular.js/issues"
+  },
+  "homepage": "http://angularjs.org"
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/.bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/.bower.json
new file mode 100644
index 0000000..ae26323
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/.bower.json
@@ -0,0 +1,19 @@
+{
+  "name": "angular-route",
+  "version": "1.4.7",
+  "main": "./angular-route.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  },
+  "homepage": "https://github.com/angular/bower-angular-route",
+  "_release": "1.4.7",
+  "_resolution": {
+    "type": "version",
+    "tag": "v1.4.7",
+    "commit": "f6f9c6760d15a993776afd5d2fafb456ee1e09d9"
+  },
+  "_source": "git://github.com/angular/bower-angular-route.git",
+  "_target": "~1.4.7",
+  "_originalSource": "angular-route"
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/README.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/README.md
new file mode 100644
index 0000000..2cd4f90
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/README.md
@@ -0,0 +1,68 @@
+# packaged angular-route
+
+This repo is for distribution on `npm` and `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js/tree/master/src/ngRoute).
+Please file issues and pull requests against that repo.
+
+## Install
+
+You can install this package either with `npm` or with `bower`.
+
+### npm
+
+```shell
+npm install angular-route
+```
+
+Then add `ngRoute` as a dependency for your app:
+
+```javascript
+angular.module('myApp', [require('angular-route')]);
+```
+
+### bower
+
+```shell
+bower install angular-route
+```
+
+Add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular-route/angular-route.js"></script>
+```
+
+Then add `ngRoute` as a dependency for your app:
+
+```javascript
+angular.module('myApp', ['ngRoute']);
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/api/ngRoute).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
+
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+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.
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.js
new file mode 100644
index 0000000..f212064
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.js
@@ -0,0 +1,991 @@
+/**
+ * @license AngularJS v1.4.7
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+(function(window, angular, undefined) {'use strict';
+
+/**
+ * @ngdoc module
+ * @name ngRoute
+ * @description
+ *
+ * # ngRoute
+ *
+ * The `ngRoute` module provides routing and deeplinking services and directives for angular apps.
+ *
+ * ## Example
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
+ *
+ *
+ * <div doc-module-components="ngRoute"></div>
+ */
+ /* global -ngRouteModule */
+var ngRouteModule = angular.module('ngRoute', ['ng']).
+                        provider('$route', $RouteProvider),
+    $routeMinErr = angular.$$minErr('ngRoute');
+
+/**
+ * @ngdoc provider
+ * @name $routeProvider
+ *
+ * @description
+ *
+ * Used for configuring routes.
+ *
+ * ## Example
+ * See {@link ngRoute.$route#example $route} for an example of configuring and using `ngRoute`.
+ *
+ * ## Dependencies
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
+ */
+function $RouteProvider() {
+  function inherit(parent, extra) {
+    return angular.extend(Object.create(parent), extra);
+  }
+
+  var routes = {};
+
+  /**
+   * @ngdoc method
+   * @name $routeProvider#when
+   *
+   * @param {string} path Route path (matched against `$location.path`). If `$location.path`
+   *    contains redundant trailing slash or is missing one, the route will still match and the
+   *    `$location.path` will be updated to add or drop the trailing slash to exactly match the
+   *    route definition.
+   *
+   *    * `path` can contain named groups starting with a colon: e.g. `:name`. All characters up
+   *        to the next slash are matched and stored in `$routeParams` under the given `name`
+   *        when the route matches.
+   *    * `path` can contain named groups starting with a colon and ending with a star:
+   *        e.g.`:name*`. All characters are eagerly stored in `$routeParams` under the given `name`
+   *        when the route matches.
+   *    * `path` can contain optional named groups with a question mark: e.g.`:name?`.
+   *
+   *    For example, routes like `/color/:color/largecode/:largecode*\/edit` will match
+   *    `/color/brown/largecode/code/with/slashes/edit` and extract:
+   *
+   *    * `color: brown`
+   *    * `largecode: code/with/slashes`.
+   *
+   *
+   * @param {Object} route Mapping information to be assigned to `$route.current` on route
+   *    match.
+   *
+   *    Object properties:
+   *
+   *    - `controller` – `{(string|function()=}` – Controller fn that should be associated with
+   *      newly created scope or the name of a {@link angular.Module#controller registered
+   *      controller} if passed as a string.
+   *    - `controllerAs` – `{string=}` – An identifier name for a reference to the controller.
+   *      If present, the controller will be published to scope under the `controllerAs` name.
+   *    - `template` – `{string=|function()=}` – html template as a string or a function that
+   *      returns an html template as a string which should be used by {@link
+   *      ngRoute.directive:ngView ngView} or {@link ng.directive:ngInclude ngInclude} directives.
+   *      This property takes precedence over `templateUrl`.
+   *
+   *      If `template` is a function, it will be called with the following parameters:
+   *
+   *      - `{Array.<Object>}` - route parameters extracted from the current
+   *        `$location.path()` by applying the current route
+   *
+   *    - `templateUrl` – `{string=|function()=}` – path or function that returns a path to an html
+   *      template that should be used by {@link ngRoute.directive:ngView ngView}.
+   *
+   *      If `templateUrl` is a function, it will be called with the following parameters:
+   *
+   *      - `{Array.<Object>}` - route parameters extracted from the current
+   *        `$location.path()` by applying the current route
+   *
+   *    - `resolve` - `{Object.<string, function>=}` - An optional map of dependencies which should
+   *      be injected into the controller. If any of these dependencies are promises, the router
+   *      will wait for them all to be resolved or one to be rejected before the controller is
+   *      instantiated.
+   *      If all the promises are resolved successfully, the values of the resolved promises are
+   *      injected and {@link ngRoute.$route#$routeChangeSuccess $routeChangeSuccess} event is
+   *      fired. If any of the promises are rejected the
+   *      {@link ngRoute.$route#$routeChangeError $routeChangeError} event is fired. The map object
+   *      is:
+   *
+   *      - `key` – `{string}`: a name of a dependency to be injected into the controller.
+   *      - `factory` - `{string|function}`: If `string` then it is an alias for a service.
+   *        Otherwise if function, then it is {@link auto.$injector#invoke injected}
+   *        and the return value is treated as the dependency. If the result is a promise, it is
+   *        resolved before its value is injected into the controller. Be aware that
+   *        `ngRoute.$routeParams` will still refer to the previous route within these resolve
+   *        functions.  Use `$route.current.params` to access the new route parameters, instead.
+   *
+   *    - `redirectTo` – {(string|function())=} – value to update
+   *      {@link ng.$location $location} path with and trigger route redirection.
+   *
+   *      If `redirectTo` is a function, it will be called with the following parameters:
+   *
+   *      - `{Object.<string>}` - route parameters extracted from the current
+   *        `$location.path()` by applying the current route templateUrl.
+   *      - `{string}` - current `$location.path()`
+   *      - `{Object}` - current `$location.search()`
+   *
+   *      The custom `redirectTo` function is expected to return a string which will be used
+   *      to update `$location.path()` and `$location.search()`.
+   *
+   *    - `[reloadOnSearch=true]` - {boolean=} - reload route when only `$location.search()`
+   *      or `$location.hash()` changes.
+   *
+   *      If the option is set to `false` and url in the browser changes, then
+   *      `$routeUpdate` event is broadcasted on the root scope.
+   *
+   *    - `[caseInsensitiveMatch=false]` - {boolean=} - match routes without being case sensitive
+   *
+   *      If the option is set to `true`, then the particular route can be matched without being
+   *      case sensitive
+   *
+   * @returns {Object} self
+   *
+   * @description
+   * Adds a new route definition to the `$route` service.
+   */
+  this.when = function(path, route) {
+    //copy original route object to preserve params inherited from proto chain
+    var routeCopy = angular.copy(route);
+    if (angular.isUndefined(routeCopy.reloadOnSearch)) {
+      routeCopy.reloadOnSearch = true;
+    }
+    if (angular.isUndefined(routeCopy.caseInsensitiveMatch)) {
+      routeCopy.caseInsensitiveMatch = this.caseInsensitiveMatch;
+    }
+    routes[path] = angular.extend(
+      routeCopy,
+      path && pathRegExp(path, routeCopy)
+    );
+
+    // create redirection for trailing slashes
+    if (path) {
+      var redirectPath = (path[path.length - 1] == '/')
+            ? path.substr(0, path.length - 1)
+            : path + '/';
+
+      routes[redirectPath] = angular.extend(
+        {redirectTo: path},
+        pathRegExp(redirectPath, routeCopy)
+      );
+    }
+
+    return this;
+  };
+
+  /**
+   * @ngdoc property
+   * @name $routeProvider#caseInsensitiveMatch
+   * @description
+   *
+   * A boolean property indicating if routes defined
+   * using this provider should be matched using a case insensitive
+   * algorithm. Defaults to `false`.
+   */
+  this.caseInsensitiveMatch = false;
+
+   /**
+    * @param path {string} path
+    * @param opts {Object} options
+    * @return {?Object}
+    *
+    * @description
+    * Normalizes the given path, returning a regular expression
+    * and the original path.
+    *
+    * Inspired by pathRexp in visionmedia/express/lib/utils.js.
+    */
+  function pathRegExp(path, opts) {
+    var insensitive = opts.caseInsensitiveMatch,
+        ret = {
+          originalPath: path,
+          regexp: path
+        },
+        keys = ret.keys = [];
+
+    path = path
+      .replace(/([().])/g, '\\$1')
+      .replace(/(\/)?:(\w+)([\?\*])?/g, function(_, slash, key, option) {
+        var optional = option === '?' ? option : null;
+        var star = option === '*' ? option : null;
+        keys.push({ name: key, optional: !!optional });
+        slash = slash || '';
+        return ''
+          + (optional ? '' : slash)
+          + '(?:'
+          + (optional ? slash : '')
+          + (star && '(.+?)' || '([^/]+)')
+          + (optional || '')
+          + ')'
+          + (optional || '');
+      })
+      .replace(/([\/$\*])/g, '\\$1');
+
+    ret.regexp = new RegExp('^' + path + '$', insensitive ? 'i' : '');
+    return ret;
+  }
+
+  /**
+   * @ngdoc method
+   * @name $routeProvider#otherwise
+   *
+   * @description
+   * Sets route definition that will be used on route change when no other route definition
+   * is matched.
+   *
+   * @param {Object|string} params Mapping information to be assigned to `$route.current`.
+   * If called with a string, the value maps to `redirectTo`.
+   * @returns {Object} self
+   */
+  this.otherwise = function(params) {
+    if (typeof params === 'string') {
+      params = {redirectTo: params};
+    }
+    this.when(null, params);
+    return this;
+  };
+
+
+  this.$get = ['$rootScope',
+               '$location',
+               '$routeParams',
+               '$q',
+               '$injector',
+               '$templateRequest',
+               '$sce',
+      function($rootScope, $location, $routeParams, $q, $injector, $templateRequest, $sce) {
+
+    /**
+     * @ngdoc service
+     * @name $route
+     * @requires $location
+     * @requires $routeParams
+     *
+     * @property {Object} current Reference to the current route definition.
+     * The route definition contains:
+     *
+     *   - `controller`: The controller constructor as define in route definition.
+     *   - `locals`: A map of locals which is used by {@link ng.$controller $controller} service for
+     *     controller instantiation. The `locals` contain
+     *     the resolved values of the `resolve` map. Additionally the `locals` also contain:
+     *
+     *     - `$scope` - The current route scope.
+     *     - `$template` - The current route template HTML.
+     *
+     * @property {Object} routes Object with all route configuration Objects as its properties.
+     *
+     * @description
+     * `$route` is used for deep-linking URLs to controllers and views (HTML partials).
+     * It watches `$location.url()` and tries to map the path to an existing route definition.
+     *
+     * Requires the {@link ngRoute `ngRoute`} module to be installed.
+     *
+     * You can define routes through {@link ngRoute.$routeProvider $routeProvider}'s API.
+     *
+     * The `$route` service is typically used in conjunction with the
+     * {@link ngRoute.directive:ngView `ngView`} directive and the
+     * {@link ngRoute.$routeParams `$routeParams`} service.
+     *
+     * @example
+     * This example shows how changing the URL hash causes the `$route` to match a route against the
+     * URL, and the `ngView` pulls in the partial.
+     *
+     * <example name="$route-service" module="ngRouteExample"
+     *          deps="angular-route.js" fixBase="true">
+     *   <file name="index.html">
+     *     <div ng-controller="MainController">
+     *       Choose:
+     *       <a href="Book/Moby">Moby</a> |
+     *       <a href="Book/Moby/ch/1">Moby: Ch1</a> |
+     *       <a href="Book/Gatsby">Gatsby</a> |
+     *       <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
+     *       <a href="Book/Scarlet">Scarlet Letter</a><br/>
+     *
+     *       <div ng-view></div>
+     *
+     *       <hr />
+     *
+     *       <pre>$location.path() = {{$location.path()}}</pre>
+     *       <pre>$route.current.templateUrl = {{$route.current.templateUrl}}</pre>
+     *       <pre>$route.current.params = {{$route.current.params}}</pre>
+     *       <pre>$route.current.scope.name = {{$route.current.scope.name}}</pre>
+     *       <pre>$routeParams = {{$routeParams}}</pre>
+     *     </div>
+     *   </file>
+     *
+     *   <file name="book.html">
+     *     controller: {{name}}<br />
+     *     Book Id: {{params.bookId}}<br />
+     *   </file>
+     *
+     *   <file name="chapter.html">
+     *     controller: {{name}}<br />
+     *     Book Id: {{params.bookId}}<br />
+     *     Chapter Id: {{params.chapterId}}
+     *   </file>
+     *
+     *   <file name="script.js">
+     *     angular.module('ngRouteExample', ['ngRoute'])
+     *
+     *      .controller('MainController', function($scope, $route, $routeParams, $location) {
+     *          $scope.$route = $route;
+     *          $scope.$location = $location;
+     *          $scope.$routeParams = $routeParams;
+     *      })
+     *
+     *      .controller('BookController', function($scope, $routeParams) {
+     *          $scope.name = "BookController";
+     *          $scope.params = $routeParams;
+     *      })
+     *
+     *      .controller('ChapterController', function($scope, $routeParams) {
+     *          $scope.name = "ChapterController";
+     *          $scope.params = $routeParams;
+     *      })
+     *
+     *     .config(function($routeProvider, $locationProvider) {
+     *       $routeProvider
+     *        .when('/Book/:bookId', {
+     *         templateUrl: 'book.html',
+     *         controller: 'BookController',
+     *         resolve: {
+     *           // I will cause a 1 second delay
+     *           delay: function($q, $timeout) {
+     *             var delay = $q.defer();
+     *             $timeout(delay.resolve, 1000);
+     *             return delay.promise;
+     *           }
+     *         }
+     *       })
+     *       .when('/Book/:bookId/ch/:chapterId', {
+     *         templateUrl: 'chapter.html',
+     *         controller: 'ChapterController'
+     *       });
+     *
+     *       // configure html5 to get links working on jsfiddle
+     *       $locationProvider.html5Mode(true);
+     *     });
+     *
+     *   </file>
+     *
+     *   <file name="protractor.js" type="protractor">
+     *     it('should load and compile correct template', function() {
+     *       element(by.linkText('Moby: Ch1')).click();
+     *       var content = element(by.css('[ng-view]')).getText();
+     *       expect(content).toMatch(/controller\: ChapterController/);
+     *       expect(content).toMatch(/Book Id\: Moby/);
+     *       expect(content).toMatch(/Chapter Id\: 1/);
+     *
+     *       element(by.partialLinkText('Scarlet')).click();
+     *
+     *       content = element(by.css('[ng-view]')).getText();
+     *       expect(content).toMatch(/controller\: BookController/);
+     *       expect(content).toMatch(/Book Id\: Scarlet/);
+     *     });
+     *   </file>
+     * </example>
+     */
+
+    /**
+     * @ngdoc event
+     * @name $route#$routeChangeStart
+     * @eventType broadcast on root scope
+     * @description
+     * Broadcasted before a route change. At this  point the route services starts
+     * resolving all of the dependencies needed for the route change to occur.
+     * Typically this involves fetching the view template as well as any dependencies
+     * defined in `resolve` route property. Once  all of the dependencies are resolved
+     * `$routeChangeSuccess` is fired.
+     *
+     * The route change (and the `$location` change that triggered it) can be prevented
+     * by calling `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on}
+     * for more details about event object.
+     *
+     * @param {Object} angularEvent Synthetic event object.
+     * @param {Route} next Future route information.
+     * @param {Route} current Current route information.
+     */
+
+    /**
+     * @ngdoc event
+     * @name $route#$routeChangeSuccess
+     * @eventType broadcast on root scope
+     * @description
+     * Broadcasted after a route change has happened successfully.
+     * The `resolve` dependencies are now available in the `current.locals` property.
+     *
+     * {@link ngRoute.directive:ngView ngView} listens for the directive
+     * to instantiate the controller and render the view.
+     *
+     * @param {Object} angularEvent Synthetic event object.
+     * @param {Route} current Current route information.
+     * @param {Route|Undefined} previous Previous route information, or undefined if current is
+     * first route entered.
+     */
+
+    /**
+     * @ngdoc event
+     * @name $route#$routeChangeError
+     * @eventType broadcast on root scope
+     * @description
+     * Broadcasted if any of the resolve promises are rejected.
+     *
+     * @param {Object} angularEvent Synthetic event object
+     * @param {Route} current Current route information.
+     * @param {Route} previous Previous route information.
+     * @param {Route} rejection Rejection of the promise. Usually the error of the failed promise.
+     */
+
+    /**
+     * @ngdoc event
+     * @name $route#$routeUpdate
+     * @eventType broadcast on root scope
+     * @description
+     * The `reloadOnSearch` property has been set to false, and we are reusing the same
+     * instance of the Controller.
+     *
+     * @param {Object} angularEvent Synthetic event object
+     * @param {Route} current Current/previous route information.
+     */
+
+    var forceReload = false,
+        preparedRoute,
+        preparedRouteIsUpdateOnly,
+        $route = {
+          routes: routes,
+
+          /**
+           * @ngdoc method
+           * @name $route#reload
+           *
+           * @description
+           * Causes `$route` service to reload the current route even if
+           * {@link ng.$location $location} hasn't changed.
+           *
+           * As a result of that, {@link ngRoute.directive:ngView ngView}
+           * creates new scope and reinstantiates the controller.
+           */
+          reload: function() {
+            forceReload = true;
+            $rootScope.$evalAsync(function() {
+              // Don't support cancellation of a reload for now...
+              prepareRoute();
+              commitRoute();
+            });
+          },
+
+          /**
+           * @ngdoc method
+           * @name $route#updateParams
+           *
+           * @description
+           * Causes `$route` service to update the current URL, replacing
+           * current route parameters with those specified in `newParams`.
+           * Provided property names that match the route's path segment
+           * definitions will be interpolated into the location's path, while
+           * remaining properties will be treated as query params.
+           *
+           * @param {!Object<string, string>} newParams mapping of URL parameter names to values
+           */
+          updateParams: function(newParams) {
+            if (this.current && this.current.$$route) {
+              newParams = angular.extend({}, this.current.params, newParams);
+              $location.path(interpolate(this.current.$$route.originalPath, newParams));
+              // interpolate modifies newParams, only query params are left
+              $location.search(newParams);
+            } else {
+              throw $routeMinErr('norout', 'Tried updating route when with no current route');
+            }
+          }
+        };
+
+    $rootScope.$on('$locationChangeStart', prepareRoute);
+    $rootScope.$on('$locationChangeSuccess', commitRoute);
+
+    return $route;
+
+    /////////////////////////////////////////////////////
+
+    /**
+     * @param on {string} current url
+     * @param route {Object} route regexp to match the url against
+     * @return {?Object}
+     *
+     * @description
+     * Check if the route matches the current url.
+     *
+     * Inspired by match in
+     * visionmedia/express/lib/router/router.js.
+     */
+    function switchRouteMatcher(on, route) {
+      var keys = route.keys,
+          params = {};
+
+      if (!route.regexp) return null;
+
+      var m = route.regexp.exec(on);
+      if (!m) return null;
+
+      for (var i = 1, len = m.length; i < len; ++i) {
+        var key = keys[i - 1];
+
+        var val = m[i];
+
+        if (key && val) {
+          params[key.name] = val;
+        }
+      }
+      return params;
+    }
+
+    function prepareRoute($locationEvent) {
+      var lastRoute = $route.current;
+
+      preparedRoute = parseRoute();
+      preparedRouteIsUpdateOnly = preparedRoute && lastRoute && preparedRoute.$$route === lastRoute.$$route
+          && angular.equals(preparedRoute.pathParams, lastRoute.pathParams)
+          && !preparedRoute.reloadOnSearch && !forceReload;
+
+      if (!preparedRouteIsUpdateOnly && (lastRoute || preparedRoute)) {
+        if ($rootScope.$broadcast('$routeChangeStart', preparedRoute, lastRoute).defaultPrevented) {
+          if ($locationEvent) {
+            $locationEvent.preventDefault();
+          }
+        }
+      }
+    }
+
+    function commitRoute() {
+      var lastRoute = $route.current;
+      var nextRoute = preparedRoute;
+
+      if (preparedRouteIsUpdateOnly) {
+        lastRoute.params = nextRoute.params;
+        angular.copy(lastRoute.params, $routeParams);
+        $rootScope.$broadcast('$routeUpdate', lastRoute);
+      } else if (nextRoute || lastRoute) {
+        forceReload = false;
+        $route.current = nextRoute;
+        if (nextRoute) {
+          if (nextRoute.redirectTo) {
+            if (angular.isString(nextRoute.redirectTo)) {
+              $location.path(interpolate(nextRoute.redirectTo, nextRoute.params)).search(nextRoute.params)
+                       .replace();
+            } else {
+              $location.url(nextRoute.redirectTo(nextRoute.pathParams, $location.path(), $location.search()))
+                       .replace();
+            }
+          }
+        }
+
+        $q.when(nextRoute).
+          then(function() {
+            if (nextRoute) {
+              var locals = angular.extend({}, nextRoute.resolve),
+                  template, templateUrl;
+
+              angular.forEach(locals, function(value, key) {
+                locals[key] = angular.isString(value) ?
+                    $injector.get(value) : $injector.invoke(value, null, null, key);
+              });
+
+              if (angular.isDefined(template = nextRoute.template)) {
+                if (angular.isFunction(template)) {
+                  template = template(nextRoute.params);
+                }
+              } else if (angular.isDefined(templateUrl = nextRoute.templateUrl)) {
+                if (angular.isFunction(templateUrl)) {
+                  templateUrl = templateUrl(nextRoute.params);
+                }
+                if (angular.isDefined(templateUrl)) {
+                  nextRoute.loadedTemplateUrl = $sce.valueOf(templateUrl);
+                  template = $templateRequest(templateUrl);
+                }
+              }
+              if (angular.isDefined(template)) {
+                locals['$template'] = template;
+              }
+              return $q.all(locals);
+            }
+          }).
+          then(function(locals) {
+            // after route change
+            if (nextRoute == $route.current) {
+              if (nextRoute) {
+                nextRoute.locals = locals;
+                angular.copy(nextRoute.params, $routeParams);
+              }
+              $rootScope.$broadcast('$routeChangeSuccess', nextRoute, lastRoute);
+            }
+          }, function(error) {
+            if (nextRoute == $route.current) {
+              $rootScope.$broadcast('$routeChangeError', nextRoute, lastRoute, error);
+            }
+          });
+      }
+    }
+
+
+    /**
+     * @returns {Object} the current active route, by matching it against the URL
+     */
+    function parseRoute() {
+      // Match a route
+      var params, match;
+      angular.forEach(routes, function(route, path) {
+        if (!match && (params = switchRouteMatcher($location.path(), route))) {
+          match = inherit(route, {
+            params: angular.extend({}, $location.search(), params),
+            pathParams: params});
+          match.$$route = route;
+        }
+      });
+      // No route matched; fallback to "otherwise" route
+      return match || routes[null] && inherit(routes[null], {params: {}, pathParams:{}});
+    }
+
+    /**
+     * @returns {string} interpolation of the redirect path with the parameters
+     */
+    function interpolate(string, params) {
+      var result = [];
+      angular.forEach((string || '').split(':'), function(segment, i) {
+        if (i === 0) {
+          result.push(segment);
+        } else {
+          var segmentMatch = segment.match(/(\w+)(?:[?*])?(.*)/);
+          var key = segmentMatch[1];
+          result.push(params[key]);
+          result.push(segmentMatch[2] || '');
+          delete params[key];
+        }
+      });
+      return result.join('');
+    }
+  }];
+}
+
+ngRouteModule.provider('$routeParams', $RouteParamsProvider);
+
+
+/**
+ * @ngdoc service
+ * @name $routeParams
+ * @requires $route
+ *
+ * @description
+ * The `$routeParams` service allows you to retrieve the current set of route parameters.
+ *
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
+ *
+ * The route parameters are a combination of {@link ng.$location `$location`}'s
+ * {@link ng.$location#search `search()`} and {@link ng.$location#path `path()`}.
+ * The `path` parameters are extracted when the {@link ngRoute.$route `$route`} path is matched.
+ *
+ * In case of parameter name collision, `path` params take precedence over `search` params.
+ *
+ * The service guarantees that the identity of the `$routeParams` object will remain unchanged
+ * (but its properties will likely change) even when a route change occurs.
+ *
+ * Note that the `$routeParams` are only updated *after* a route change completes successfully.
+ * This means that you cannot rely on `$routeParams` being correct in route resolve functions.
+ * Instead you can use `$route.current.params` to access the new route's parameters.
+ *
+ * @example
+ * ```js
+ *  // Given:
+ *  // URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
+ *  // Route: /Chapter/:chapterId/Section/:sectionId
+ *  //
+ *  // Then
+ *  $routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}
+ * ```
+ */
+function $RouteParamsProvider() {
+  this.$get = function() { return {}; };
+}
+
+ngRouteModule.directive('ngView', ngViewFactory);
+ngRouteModule.directive('ngView', ngViewFillContentFactory);
+
+
+/**
+ * @ngdoc directive
+ * @name ngView
+ * @restrict ECA
+ *
+ * @description
+ * # Overview
+ * `ngView` is a directive that complements the {@link ngRoute.$route $route} service by
+ * including the rendered template of the current route into the main layout (`index.html`) file.
+ * Every time the current route changes, the included view changes with it according to the
+ * configuration of the `$route` service.
+ *
+ * Requires the {@link ngRoute `ngRoute`} module to be installed.
+ *
+ * @animations
+ * enter - animation is used to bring new content into the browser.
+ * leave - animation is used to animate existing content away.
+ *
+ * The enter and leave animation occur concurrently.
+ *
+ * @scope
+ * @priority 400
+ * @param {string=} onload Expression to evaluate whenever the view updates.
+ *
+ * @param {string=} autoscroll Whether `ngView` should call {@link ng.$anchorScroll
+ *                  $anchorScroll} to scroll the viewport after the view is updated.
+ *
+ *                  - If the attribute is not set, disable scrolling.
+ *                  - If the attribute is set without value, enable scrolling.
+ *                  - Otherwise enable scrolling only if the `autoscroll` attribute value evaluated
+ *                    as an expression yields a truthy value.
+ * @example
+    <example name="ngView-directive" module="ngViewExample"
+             deps="angular-route.js;angular-animate.js"
+             animations="true" fixBase="true">
+      <file name="index.html">
+        <div ng-controller="MainCtrl as main">
+          Choose:
+          <a href="Book/Moby">Moby</a> |
+          <a href="Book/Moby/ch/1">Moby: Ch1</a> |
+          <a href="Book/Gatsby">Gatsby</a> |
+          <a href="Book/Gatsby/ch/4?key=value">Gatsby: Ch4</a> |
+          <a href="Book/Scarlet">Scarlet Letter</a><br/>
+
+          <div class="view-animate-container">
+            <div ng-view class="view-animate"></div>
+          </div>
+          <hr />
+
+          <pre>$location.path() = {{main.$location.path()}}</pre>
+          <pre>$route.current.templateUrl = {{main.$route.current.templateUrl}}</pre>
+          <pre>$route.current.params = {{main.$route.current.params}}</pre>
+          <pre>$routeParams = {{main.$routeParams}}</pre>
+        </div>
+      </file>
+
+      <file name="book.html">
+        <div>
+          controller: {{book.name}}<br />
+          Book Id: {{book.params.bookId}}<br />
+        </div>
+      </file>
+
+      <file name="chapter.html">
+        <div>
+          controller: {{chapter.name}}<br />
+          Book Id: {{chapter.params.bookId}}<br />
+          Chapter Id: {{chapter.params.chapterId}}
+        </div>
+      </file>
+
+      <file name="animations.css">
+        .view-animate-container {
+          position:relative;
+          height:100px!important;
+          background:white;
+          border:1px solid black;
+          height:40px;
+          overflow:hidden;
+        }
+
+        .view-animate {
+          padding:10px;
+        }
+
+        .view-animate.ng-enter, .view-animate.ng-leave {
+          transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 1.5s;
+
+          display:block;
+          width:100%;
+          border-left:1px solid black;
+
+          position:absolute;
+          top:0;
+          left:0;
+          right:0;
+          bottom:0;
+          padding:10px;
+        }
+
+        .view-animate.ng-enter {
+          left:100%;
+        }
+        .view-animate.ng-enter.ng-enter-active {
+          left:0;
+        }
+        .view-animate.ng-leave.ng-leave-active {
+          left:-100%;
+        }
+      </file>
+
+      <file name="script.js">
+        angular.module('ngViewExample', ['ngRoute', 'ngAnimate'])
+          .config(['$routeProvider', '$locationProvider',
+            function($routeProvider, $locationProvider) {
+              $routeProvider
+                .when('/Book/:bookId', {
+                  templateUrl: 'book.html',
+                  controller: 'BookCtrl',
+                  controllerAs: 'book'
+                })
+                .when('/Book/:bookId/ch/:chapterId', {
+                  templateUrl: 'chapter.html',
+                  controller: 'ChapterCtrl',
+                  controllerAs: 'chapter'
+                });
+
+              $locationProvider.html5Mode(true);
+          }])
+          .controller('MainCtrl', ['$route', '$routeParams', '$location',
+            function($route, $routeParams, $location) {
+              this.$route = $route;
+              this.$location = $location;
+              this.$routeParams = $routeParams;
+          }])
+          .controller('BookCtrl', ['$routeParams', function($routeParams) {
+            this.name = "BookCtrl";
+            this.params = $routeParams;
+          }])
+          .controller('ChapterCtrl', ['$routeParams', function($routeParams) {
+            this.name = "ChapterCtrl";
+            this.params = $routeParams;
+          }]);
+
+      </file>
+
+      <file name="protractor.js" type="protractor">
+        it('should load and compile correct template', function() {
+          element(by.linkText('Moby: Ch1')).click();
+          var content = element(by.css('[ng-view]')).getText();
+          expect(content).toMatch(/controller\: ChapterCtrl/);
+          expect(content).toMatch(/Book Id\: Moby/);
+          expect(content).toMatch(/Chapter Id\: 1/);
+
+          element(by.partialLinkText('Scarlet')).click();
+
+          content = element(by.css('[ng-view]')).getText();
+          expect(content).toMatch(/controller\: BookCtrl/);
+          expect(content).toMatch(/Book Id\: Scarlet/);
+        });
+      </file>
+    </example>
+ */
+
+
+/**
+ * @ngdoc event
+ * @name ngView#$viewContentLoaded
+ * @eventType emit on the current ngView scope
+ * @description
+ * Emitted every time the ngView content is reloaded.
+ */
+ngViewFactory.$inject = ['$route', '$anchorScroll', '$animate'];
+function ngViewFactory($route, $anchorScroll, $animate) {
+  return {
+    restrict: 'ECA',
+    terminal: true,
+    priority: 400,
+    transclude: 'element',
+    link: function(scope, $element, attr, ctrl, $transclude) {
+        var currentScope,
+            currentElement,
+            previousLeaveAnimation,
+            autoScrollExp = attr.autoscroll,
+            onloadExp = attr.onload || '';
+
+        scope.$on('$routeChangeSuccess', update);
+        update();
+
+        function cleanupLastView() {
+          if (previousLeaveAnimation) {
+            $animate.cancel(previousLeaveAnimation);
+            previousLeaveAnimation = null;
+          }
+
+          if (currentScope) {
+            currentScope.$destroy();
+            currentScope = null;
+          }
+          if (currentElement) {
+            previousLeaveAnimation = $animate.leave(currentElement);
+            previousLeaveAnimation.then(function() {
+              previousLeaveAnimation = null;
+            });
+            currentElement = null;
+          }
+        }
+
+        function update() {
+          var locals = $route.current && $route.current.locals,
+              template = locals && locals.$template;
+
+          if (angular.isDefined(template)) {
+            var newScope = scope.$new();
+            var current = $route.current;
+
+            // Note: This will also link all children of ng-view that were contained in the original
+            // html. If that content contains controllers, ... they could pollute/change the scope.
+            // However, using ng-view on an element with additional content does not make sense...
+            // Note: We can't remove them in the cloneAttchFn of $transclude as that
+            // function is called before linking the content, which would apply child
+            // directives to non existing elements.
+            var clone = $transclude(newScope, function(clone) {
+              $animate.enter(clone, null, currentElement || $element).then(function onNgViewEnter() {
+                if (angular.isDefined(autoScrollExp)
+                  && (!autoScrollExp || scope.$eval(autoScrollExp))) {
+                  $anchorScroll();
+                }
+              });
+              cleanupLastView();
+            });
+
+            currentElement = clone;
+            currentScope = current.scope = newScope;
+            currentScope.$emit('$viewContentLoaded');
+            currentScope.$eval(onloadExp);
+          } else {
+            cleanupLastView();
+          }
+        }
+    }
+  };
+}
+
+// This directive is called during the $transclude call of the first `ngView` directive.
+// It will replace and compile the content of the element with the loaded template.
+// We need this directive so that the element content is already filled when
+// the link function of another directive on the same element as ngView
+// is called.
+ngViewFillContentFactory.$inject = ['$compile', '$controller', '$route'];
+function ngViewFillContentFactory($compile, $controller, $route) {
+  return {
+    restrict: 'ECA',
+    priority: -400,
+    link: function(scope, $element) {
+      var current = $route.current,
+          locals = current.locals;
+
+      $element.html(locals.$template);
+
+      var link = $compile($element.contents());
+
+      if (current.controller) {
+        locals.$scope = scope;
+        var controller = $controller(current.controller, locals);
+        if (current.controllerAs) {
+          scope[current.controllerAs] = controller;
+        }
+        $element.data('$ngControllerController', controller);
+        $element.children().data('$ngControllerController', controller);
+      }
+
+      link(scope);
+    }
+  };
+}
+
+
+})(window, window.angular);
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js
new file mode 100644
index 0000000..4fe8359
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js
@@ -0,0 +1,15 @@
+/*
+ AngularJS v1.4.7
+ (c) 2010-2015 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(p,c,C){'use strict';function v(r,h,g){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,f,b,d,y){function z(){k&&(g.cancel(k),k=null);l&&(l.$destroy(),l=null);m&&(k=g.leave(m),k.then(function(){k=null}),m=null)}function x(){var b=r.current&&r.current.locals;if(c.isDefined(b&&b.$template)){var b=a.$new(),d=r.current;m=y(b,function(b){g.enter(b,null,m||f).then(function(){!c.isDefined(t)||t&&!a.$eval(t)||h()});z()});l=d.scope=b;l.$emit("$viewContentLoaded");
+l.$eval(w)}else z()}var l,m,k,t=b.autoscroll,w=b.onload||"";a.$on("$routeChangeSuccess",x);x()}}}function A(c,h,g){return{restrict:"ECA",priority:-400,link:function(a,f){var b=g.current,d=b.locals;f.html(d.$template);var y=c(f.contents());b.controller&&(d.$scope=a,d=h(b.controller,d),b.controllerAs&&(a[b.controllerAs]=d),f.data("$ngControllerController",d),f.children().data("$ngControllerController",d));y(a)}}}p=c.module("ngRoute",["ng"]).provider("$route",function(){function r(a,f){return c.extend(Object.create(a),
+f)}function h(a,c){var b=c.caseInsensitiveMatch,d={originalPath:a,regexp:a},g=d.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,c,b,d){a="?"===d?d:null;d="*"===d?d:null;g.push({name:b,optional:!!a});c=c||"";return""+(a?"":c)+"(?:"+(a?c:"")+(d&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");d.regexp=new RegExp("^"+a+"$",b?"i":"");return d}var g={};this.when=function(a,f){var b=c.copy(f);c.isUndefined(b.reloadOnSearch)&&(b.reloadOnSearch=!0);
+c.isUndefined(b.caseInsensitiveMatch)&&(b.caseInsensitiveMatch=this.caseInsensitiveMatch);g[a]=c.extend(b,a&&h(a,b));if(a){var d="/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";g[d]=c.extend({redirectTo:a},h(d,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","$sce",function(a,f,b,d,h,p,x){function l(b){var e=s.current;
+(v=(n=k())&&e&&n.$$route===e.$$route&&c.equals(n.pathParams,e.pathParams)&&!n.reloadOnSearch&&!w)||!e&&!n||a.$broadcast("$routeChangeStart",n,e).defaultPrevented&&b&&b.preventDefault()}function m(){var u=s.current,e=n;if(v)u.params=e.params,c.copy(u.params,b),a.$broadcast("$routeUpdate",u);else if(e||u)w=!1,(s.current=e)&&e.redirectTo&&(c.isString(e.redirectTo)?f.path(t(e.redirectTo,e.params)).search(e.params).replace():f.url(e.redirectTo(e.pathParams,f.path(),f.search())).replace()),d.when(e).then(function(){if(e){var a=
+c.extend({},e.resolve),b,f;c.forEach(a,function(b,e){a[e]=c.isString(b)?h.get(b):h.invoke(b,null,null,e)});c.isDefined(b=e.template)?c.isFunction(b)&&(b=b(e.params)):c.isDefined(f=e.templateUrl)&&(c.isFunction(f)&&(f=f(e.params)),c.isDefined(f)&&(e.loadedTemplateUrl=x.valueOf(f),b=p(f)));c.isDefined(b)&&(a.$template=b);return d.all(a)}}).then(function(f){e==s.current&&(e&&(e.locals=f,c.copy(e.params,b)),a.$broadcast("$routeChangeSuccess",e,u))},function(b){e==s.current&&a.$broadcast("$routeChangeError",
+e,u,b)})}function k(){var a,b;c.forEach(g,function(d,g){var q;if(q=!b){var h=f.path();q=d.keys;var l={};if(d.regexp)if(h=d.regexp.exec(h)){for(var k=1,m=h.length;k<m;++k){var n=q[k-1],p=h[k];n&&p&&(l[n.name]=p)}q=l}else q=null;else q=null;q=a=q}q&&(b=r(d,{params:c.extend({},f.search(),a),pathParams:a}),b.$$route=d)});return b||g[null]&&r(g[null],{params:{},pathParams:{}})}function t(a,b){var d=[];c.forEach((a||"").split(":"),function(a,c){if(0===c)d.push(a);else{var f=a.match(/(\w+)(?:[?*])?(.*)/),
+g=f[1];d.push(b[g]);d.push(f[2]||"");delete b[g]}});return d.join("")}var w=!1,n,v,s={routes:g,reload:function(){w=!0;a.$evalAsync(function(){l();m()})},updateParams:function(a){if(this.current&&this.current.$$route)a=c.extend({},this.current.params,a),f.path(t(this.current.$$route.originalPath,a)),f.search(a);else throw B("norout");}};a.$on("$locationChangeStart",l);a.$on("$locationChangeSuccess",m);return s}]});var B=c.$$minErr("ngRoute");p.provider("$routeParams",function(){this.$get=function(){return{}}});
+p.directive("ngView",v);p.directive("ngView",A);v.$inject=["$route","$anchorScroll","$animate"];A.$inject=["$compile","$controller","$route"]})(window,window.angular);
+//# sourceMappingURL=angular-route.min.js.map
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js.map b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js.map
new file mode 100644
index 0000000..c0b2f5c
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/angular-route.min.js.map
@@ -0,0 +1,8 @@
+{
+"version":3,
+"file":"angular-route.min.js",
+"lineCount":14,
+"mappings":"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",
+"sources":["angular-route.js"],
+"names":["window","angular","undefined","ngViewFactory","$route","$anchorScroll","$animate","restrict","terminal","priority","transclude","link","scope","$element","attr","ctrl","$transclude","cleanupLastView","previousLeaveAnimation","cancel","currentScope","$destroy","currentElement","leave","then","update","locals","current","isDefined","$template","newScope","$new","clone","enter","onNgViewEnter","autoScrollExp","$eval","$emit","onloadExp","autoscroll","onload","$on","ngViewFillContentFactory","$compile","$controller","html","contents","controller","$scope","controllerAs","data","children","ngRouteModule","module","provider","$RouteProvider","inherit","parent","extra","extend","Object","create","pathRegExp","path","opts","insensitive","caseInsensitiveMatch","ret","originalPath","regexp","keys","replace","_","slash","key","option","optional","star","push","name","RegExp","routes","when","this.when","route","routeCopy","copy","isUndefined","reloadOnSearch","redirectPath","length","substr","redirectTo","otherwise","this.otherwise","params","$get","$rootScope","$location","$routeParams","$q","$injector","$templateRequest","$sce","prepareRoute","$locationEvent","lastRoute","preparedRouteIsUpdateOnly","preparedRoute","parseRoute","$$route","equals","pathParams","forceReload","$broadcast","defaultPrevented","preventDefault","commitRoute","nextRoute","isString","interpolate","search","url","resolve","template","templateUrl","forEach","value","get","invoke","isFunction","loadedTemplateUrl","valueOf","all","error","match","m","exec","on","i","len","val","string","result","split","segment","segmentMatch","join","reload","$evalAsync","updateParams","newParams","$routeMinErr","$$minErr","$RouteParamsProvider","this.$get","directive","$inject"]
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/bower.json
new file mode 100644
index 0000000..08e2c44
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/bower.json
@@ -0,0 +1,9 @@
+{
+  "name": "angular-route",
+  "version": "1.4.7",
+  "main": "./angular-route.js",
+  "ignore": [],
+  "dependencies": {
+    "angular": "1.4.7"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/index.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/index.js
new file mode 100644
index 0000000..9ed2645
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/index.js
@@ -0,0 +1,2 @@
+require('./angular-route');
+module.exports = 'ngRoute';
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/package.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/package.json
new file mode 100644
index 0000000..425a6c1
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular-route/package.json
@@ -0,0 +1,26 @@
+{
+  "name": "angular-route",
+  "version": "1.4.7",
+  "description": "AngularJS router module",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/angular/angular.js.git"
+  },
+  "keywords": [
+    "angular",
+    "framework",
+    "browser",
+    "router",
+    "client-side"
+  ],
+  "author": "Angular Core Team <angular-core+npm@google.com>",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/angular/angular.js/issues"
+  },
+  "homepage": "http://angularjs.org"
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/.bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/.bower.json
new file mode 100644
index 0000000..b346dac
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/.bower.json
@@ -0,0 +1,17 @@
+{
+  "name": "angular",
+  "version": "1.4.7",
+  "main": "./angular.js",
+  "ignore": [],
+  "dependencies": {},
+  "homepage": "https://github.com/angular/bower-angular",
+  "_release": "1.4.7",
+  "_resolution": {
+    "type": "version",
+    "tag": "v1.4.7",
+    "commit": "6bdc6b4855b416bf029105324080ca7d6aca0e9f"
+  },
+  "_source": "git://github.com/angular/bower-angular.git",
+  "_target": ">=1.2",
+  "_originalSource": "angular"
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/README.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/README.md
new file mode 100644
index 0000000..d1bc0ed
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/README.md
@@ -0,0 +1,64 @@
+# packaged angular
+
+This repo is for distribution on `npm` and `bower`. The source for this module is in the
+[main AngularJS repo](https://github.com/angular/angular.js).
+Please file issues and pull requests against that repo.
+
+## Install
+
+You can install this package either with `npm` or with `bower`.
+
+### npm
+
+```shell
+npm install angular
+```
+
+Then add a `<script>` to your `index.html`:
+
+```html
+<script src="/node_modules/angular/angular.js"></script>
+```
+
+Or `require('angular')` from your code.
+
+### bower
+
+```shell
+bower install angular
+```
+
+Then add a `<script>` to your `index.html`:
+
+```html
+<script src="/bower_components/angular/angular.js"></script>
+```
+
+## Documentation
+
+Documentation is available on the
+[AngularJS docs site](http://docs.angularjs.org/).
+
+## License
+
+The MIT License
+
+Copyright (c) 2010-2015 Google, Inc. http://angularjs.org
+
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+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.
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular-csp.css b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular-csp.css
new file mode 100644
index 0000000..f3cd926
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular-csp.css
@@ -0,0 +1,21 @@
+/* Include this file in your html if you are using the CSP mode. */
+
+@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;
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.js
new file mode 100644
index 0000000..34a93c1
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.js
@@ -0,0 +1,28904 @@
+/**
+ * @license AngularJS v1.4.7
+ * (c) 2010-2015 Google, Inc. http://angularjs.org
+ * License: MIT
+ */
+(function(window, document, undefined) {'use strict';
+
+/**
+ * @description
+ *
+ * This object provides a utility for producing rich Error messages within
+ * Angular. It can be called as follows:
+ *
+ * var exampleMinErr = minErr('example');
+ * throw exampleMinErr('one', 'This {0} is {1}', foo, bar);
+ *
+ * The above creates an instance of minErr in the example namespace. The
+ * resulting error will have a namespaced error code of example.one.  The
+ * resulting error will replace {0} with the value of foo, and {1} with the
+ * value of bar. The object is not restricted in the number of arguments it can
+ * take.
+ *
+ * If fewer arguments are specified than necessary for interpolation, the extra
+ * interpolation markers will be preserved in the final string.
+ *
+ * Since data will be parsed statically during a build step, some restrictions
+ * are applied with respect to how minErr instances are created and called.
+ * Instances should have names of the form namespaceMinErr for a minErr created
+ * using minErr('namespace') . Error codes, namespaces and template strings
+ * should all be static strings, not variables or general expressions.
+ *
+ * @param {string} module The namespace to use for the new minErr instance.
+ * @param {function} ErrorConstructor Custom error constructor to be instantiated when returning
+ *   error from returned function, for cases when a particular type of error is useful.
+ * @returns {function(code:string, template:string, ...templateArgs): Error} minErr instance
+ */
+
+function minErr(module, ErrorConstructor) {
+  ErrorConstructor = ErrorConstructor || Error;
+  return function() {
+    var SKIP_INDEXES = 2;
+
+    var templateArgs = arguments,
+      code = templateArgs[0],
+      message = '[' + (module ? module + ':' : '') + code + '] ',
+      template = templateArgs[1],
+      paramPrefix, i;
+
+    message += template.replace(/\{\d+\}/g, function(match) {
+      var index = +match.slice(1, -1),
+        shiftedIndex = index + SKIP_INDEXES;
+
+      if (shiftedIndex < templateArgs.length) {
+        return toDebugString(templateArgs[shiftedIndex]);
+      }
+
+      return match;
+    });
+
+    message += '\nhttp://errors.angularjs.org/1.4.7/' +
+      (module ? module + '/' : '') + code;
+
+    for (i = SKIP_INDEXES, paramPrefix = '?'; i < templateArgs.length; i++, paramPrefix = '&') {
+      message += paramPrefix + 'p' + (i - SKIP_INDEXES) + '=' +
+        encodeURIComponent(toDebugString(templateArgs[i]));
+    }
+
+    return new ErrorConstructor(message);
+  };
+}
+
+/* We need to tell jshint what variables are being exported */
+/* global angular: true,
+  msie: true,
+  jqLite: true,
+  jQuery: true,
+  slice: true,
+  splice: true,
+  push: true,
+  toString: true,
+  ngMinErr: true,
+  angularModule: true,
+  uid: true,
+  REGEX_STRING_REGEXP: true,
+  VALIDITY_STATE_PROPERTY: true,
+
+  lowercase: true,
+  uppercase: true,
+  manualLowercase: true,
+  manualUppercase: true,
+  nodeName_: true,
+  isArrayLike: true,
+  forEach: true,
+  forEachSorted: true,
+  reverseParams: true,
+  nextUid: true,
+  setHashKey: true,
+  extend: true,
+  toInt: true,
+  inherit: true,
+  merge: true,
+  noop: true,
+  identity: true,
+  valueFn: true,
+  isUndefined: true,
+  isDefined: true,
+  isObject: true,
+  isBlankObject: true,
+  isString: true,
+  isNumber: true,
+  isDate: true,
+  isArray: true,
+  isFunction: true,
+  isRegExp: true,
+  isWindow: true,
+  isScope: true,
+  isFile: true,
+  isFormData: true,
+  isBlob: true,
+  isBoolean: true,
+  isPromiseLike: true,
+  trim: true,
+  escapeForRegexp: true,
+  isElement: true,
+  makeMap: true,
+  includes: true,
+  arrayRemove: true,
+  copy: true,
+  shallowCopy: true,
+  equals: true,
+  csp: true,
+  jq: true,
+  concat: true,
+  sliceArgs: true,
+  bind: true,
+  toJsonReplacer: true,
+  toJson: true,
+  fromJson: true,
+  convertTimezoneToLocal: true,
+  timezoneToOffset: true,
+  startingTag: true,
+  tryDecodeURIComponent: true,
+  parseKeyValue: true,
+  toKeyValue: true,
+  encodeUriSegment: true,
+  encodeUriQuery: true,
+  angularInit: true,
+  bootstrap: true,
+  getTestability: true,
+  snake_case: true,
+  bindJQuery: true,
+  assertArg: true,
+  assertArgFn: true,
+  assertNotHasOwnProperty: true,
+  getter: true,
+  getBlockNodes: true,
+  hasOwnProperty: true,
+  createMap: true,
+
+  NODE_TYPE_ELEMENT: true,
+  NODE_TYPE_ATTRIBUTE: true,
+  NODE_TYPE_TEXT: true,
+  NODE_TYPE_COMMENT: true,
+  NODE_TYPE_DOCUMENT: true,
+  NODE_TYPE_DOCUMENT_FRAGMENT: true,
+*/
+
+////////////////////////////////////
+
+/**
+ * @ngdoc module
+ * @name ng
+ * @module ng
+ * @description
+ *
+ * # ng (core module)
+ * The ng module is loaded by default when an AngularJS application is started. The module itself
+ * contains the essential components for an AngularJS application to function. The table below
+ * lists a high level breakdown of each of the services/factories, filters, directives and testing
+ * components available within this core module.
+ *
+ * <div doc-module-components="ng"></div>
+ */
+
+var REGEX_STRING_REGEXP = /^\/(.+)\/([a-z]*)$/;
+
+// The name of a form control's ValidityState property.
+// This is used so that it's possible for internal tests to create mock ValidityStates.
+var VALIDITY_STATE_PROPERTY = 'validity';
+
+/**
+ * @ngdoc function
+ * @name angular.lowercase
+ * @module ng
+ * @kind function
+ *
+ * @description Converts the specified string to lowercase.
+ * @param {string} string String to be converted to lowercase.
+ * @returns {string} Lowercased string.
+ */
+var lowercase = function(string) {return isString(string) ? string.toLowerCase() : string;};
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+
+/**
+ * @ngdoc function
+ * @name angular.uppercase
+ * @module ng
+ * @kind function
+ *
+ * @description Converts the specified string to uppercase.
+ * @param {string} string String to be converted to uppercase.
+ * @returns {string} Uppercased string.
+ */
+var uppercase = function(string) {return isString(string) ? string.toUpperCase() : string;};
+
+
+var manualLowercase = function(s) {
+  /* jshint bitwise: false */
+  return isString(s)
+      ? s.replace(/[A-Z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) | 32);})
+      : s;
+};
+var manualUppercase = function(s) {
+  /* jshint bitwise: false */
+  return isString(s)
+      ? s.replace(/[a-z]/g, function(ch) {return String.fromCharCode(ch.charCodeAt(0) & ~32);})
+      : s;
+};
+
+
+// String#toLowerCase and String#toUpperCase don't produce correct results in browsers with Turkish
+// locale, for this reason we need to detect this case and redefine lowercase/uppercase methods
+// with correct but slower alternatives.
+if ('i' !== 'I'.toLowerCase()) {
+  lowercase = manualLowercase;
+  uppercase = manualUppercase;
+}
+
+
+var
+    msie,             // holds major version number for IE, or NaN if UA is not IE.
+    jqLite,           // delay binding since jQuery could be loaded after us.
+    jQuery,           // delay binding
+    slice             = [].slice,
+    splice            = [].splice,
+    push              = [].push,
+    toString          = Object.prototype.toString,
+    getPrototypeOf    = Object.getPrototypeOf,
+    ngMinErr          = minErr('ng'),
+
+    /** @name angular */
+    angular           = window.angular || (window.angular = {}),
+    angularModule,
+    uid               = 0;
+
+/**
+ * documentMode is an IE-only property
+ * http://msdn.microsoft.com/en-us/library/ie/cc196988(v=vs.85).aspx
+ */
+msie = document.documentMode;
+
+
+/**
+ * @private
+ * @param {*} obj
+ * @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
+ *                   String ...)
+ */
+function isArrayLike(obj) {
+  if (obj == null || isWindow(obj)) {
+    return false;
+  }
+
+  // Support: iOS 8.2 (not reproducible in simulator)
+  // "length" in obj used to prevent JIT error (gh-11508)
+  var length = "length" in Object(obj) && obj.length;
+
+  if (obj.nodeType === NODE_TYPE_ELEMENT && length) {
+    return true;
+  }
+
+  return isString(obj) || isArray(obj) || length === 0 ||
+         typeof length === 'number' && length > 0 && (length - 1) in obj;
+}
+
+/**
+ * @ngdoc function
+ * @name angular.forEach
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Invokes the `iterator` function once for each item in `obj` collection, which can be either an
+ * object or an array. The `iterator` function is invoked with `iterator(value, key, obj)`, where `value`
+ * is the value of an object property or an array element, `key` is the object property key or
+ * array element index and obj is the `obj` itself. Specifying a `context` for the function is optional.
+ *
+ * It is worth noting that `.forEach` does not iterate over inherited properties because it filters
+ * using the `hasOwnProperty` method.
+ *
+ * Unlike ES262's
+ * [Array.prototype.forEach](http://www.ecma-international.org/ecma-262/5.1/#sec-15.4.4.18),
+ * Providing 'undefined' or 'null' values for `obj` will not throw a TypeError, but rather just
+ * return the value provided.
+ *
+   ```js
+     var values = {name: 'misko', gender: 'male'};
+     var log = [];
+     angular.forEach(values, function(value, key) {
+       this.push(key + ': ' + value);
+     }, log);
+     expect(log).toEqual(['name: misko', 'gender: male']);
+   ```
+ *
+ * @param {Object|Array} obj Object to iterate over.
+ * @param {Function} iterator Iterator function.
+ * @param {Object=} context Object to become context (`this`) for the iterator function.
+ * @returns {Object|Array} Reference to `obj`.
+ */
+
+function forEach(obj, iterator, context) {
+  var key, length;
+  if (obj) {
+    if (isFunction(obj)) {
+      for (key in obj) {
+        // Need to check if hasOwnProperty exists,
+        // as on IE8 the result of querySelectorAll is an object without a hasOwnProperty function
+        if (key != 'prototype' && key != 'length' && key != 'name' && (!obj.hasOwnProperty || obj.hasOwnProperty(key))) {
+          iterator.call(context, obj[key], key, obj);
+        }
+      }
+    } else if (isArray(obj) || isArrayLike(obj)) {
+      var isPrimitive = typeof obj !== 'object';
+      for (key = 0, length = obj.length; key < length; key++) {
+        if (isPrimitive || key in obj) {
+          iterator.call(context, obj[key], key, obj);
+        }
+      }
+    } else if (obj.forEach && obj.forEach !== forEach) {
+        obj.forEach(iterator, context, obj);
+    } else if (isBlankObject(obj)) {
+      // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
+      for (key in obj) {
+        iterator.call(context, obj[key], key, obj);
+      }
+    } else if (typeof obj.hasOwnProperty === 'function') {
+      // Slow path for objects inheriting Object.prototype, hasOwnProperty check needed
+      for (key in obj) {
+        if (obj.hasOwnProperty(key)) {
+          iterator.call(context, obj[key], key, obj);
+        }
+      }
+    } else {
+      // Slow path for objects which do not have a method `hasOwnProperty`
+      for (key in obj) {
+        if (hasOwnProperty.call(obj, key)) {
+          iterator.call(context, obj[key], key, obj);
+        }
+      }
+    }
+  }
+  return obj;
+}
+
+function forEachSorted(obj, iterator, context) {
+  var keys = Object.keys(obj).sort();
+  for (var i = 0; i < keys.length; i++) {
+    iterator.call(context, obj[keys[i]], keys[i]);
+  }
+  return keys;
+}
+
+
+/**
+ * when using forEach the params are value, key, but it is often useful to have key, value.
+ * @param {function(string, *)} iteratorFn
+ * @returns {function(*, string)}
+ */
+function reverseParams(iteratorFn) {
+  return function(value, key) { iteratorFn(key, value); };
+}
+
+/**
+ * A consistent way of creating unique IDs in angular.
+ *
+ * Using simple numbers allows us to generate 28.6 million unique ids per second for 10 years before
+ * we hit number precision issues in JavaScript.
+ *
+ * Math.pow(2,53) / 60 / 60 / 24 / 365 / 10 = 28.6M
+ *
+ * @returns {number} an unique alpha-numeric string
+ */
+function nextUid() {
+  return ++uid;
+}
+
+
+/**
+ * Set or clear the hashkey for an object.
+ * @param obj object
+ * @param h the hashkey (!truthy to delete the hashkey)
+ */
+function setHashKey(obj, h) {
+  if (h) {
+    obj.$$hashKey = h;
+  } else {
+    delete obj.$$hashKey;
+  }
+}
+
+
+function baseExtend(dst, objs, deep) {
+  var h = dst.$$hashKey;
+
+  for (var i = 0, ii = objs.length; i < ii; ++i) {
+    var obj = objs[i];
+    if (!isObject(obj) && !isFunction(obj)) continue;
+    var keys = Object.keys(obj);
+    for (var j = 0, jj = keys.length; j < jj; j++) {
+      var key = keys[j];
+      var src = obj[key];
+
+      if (deep && isObject(src)) {
+        if (isDate(src)) {
+          dst[key] = new Date(src.valueOf());
+        } else if (isRegExp(src)) {
+          dst[key] = new RegExp(src);
+        } else {
+          if (!isObject(dst[key])) dst[key] = isArray(src) ? [] : {};
+          baseExtend(dst[key], [src], true);
+        }
+      } else {
+        dst[key] = src;
+      }
+    }
+  }
+
+  setHashKey(dst, h);
+  return dst;
+}
+
+/**
+ * @ngdoc function
+ * @name angular.extend
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
+ * to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
+ * by passing an empty object as the target: `var object = angular.extend({}, object1, object2)`.
+ *
+ * **Note:** Keep in mind that `angular.extend` does not support recursive merge (deep copy). Use
+ * {@link angular.merge} for this.
+ *
+ * @param {Object} dst Destination object.
+ * @param {...Object} src Source object(s).
+ * @returns {Object} Reference to `dst`.
+ */
+function extend(dst) {
+  return baseExtend(dst, slice.call(arguments, 1), false);
+}
+
+
+/**
+* @ngdoc function
+* @name angular.merge
+* @module ng
+* @kind function
+*
+* @description
+* Deeply extends the destination object `dst` by copying own enumerable properties from the `src` object(s)
+* to `dst`. You can specify multiple `src` objects. If you want to preserve original objects, you can do so
+* by passing an empty object as the target: `var object = angular.merge({}, object1, object2)`.
+*
+* Unlike {@link angular.extend extend()}, `merge()` recursively descends into object properties of source
+* objects, performing a deep copy.
+*
+* @param {Object} dst Destination object.
+* @param {...Object} src Source object(s).
+* @returns {Object} Reference to `dst`.
+*/
+function merge(dst) {
+  return baseExtend(dst, slice.call(arguments, 1), true);
+}
+
+
+
+function toInt(str) {
+  return parseInt(str, 10);
+}
+
+
+function inherit(parent, extra) {
+  return extend(Object.create(parent), extra);
+}
+
+/**
+ * @ngdoc function
+ * @name angular.noop
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * A function that performs no operations. This function can be useful when writing code in the
+ * functional style.
+   ```js
+     function foo(callback) {
+       var result = calculateResult();
+       (callback || angular.noop)(result);
+     }
+   ```
+ */
+function noop() {}
+noop.$inject = [];
+
+
+/**
+ * @ngdoc function
+ * @name angular.identity
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * A function that returns its first argument. This function is useful when writing code in the
+ * functional style.
+ *
+   ```js
+     function transformer(transformationFn, value) {
+       return (transformationFn || angular.identity)(value);
+     };
+   ```
+  * @param {*} value to be returned.
+  * @returns {*} the value passed in.
+ */
+function identity($) {return $;}
+identity.$inject = [];
+
+
+function valueFn(value) {return function() {return value;};}
+
+function hasCustomToString(obj) {
+  return isFunction(obj.toString) && obj.toString !== Object.prototype.toString;
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isUndefined
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is undefined.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is undefined.
+ */
+function isUndefined(value) {return typeof value === 'undefined';}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isDefined
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is defined.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is defined.
+ */
+function isDefined(value) {return typeof value !== 'undefined';}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isObject
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
+ * considered to be objects. Note that JavaScript arrays are objects.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is an `Object` but not `null`.
+ */
+function isObject(value) {
+  // http://jsperf.com/isobject4
+  return value !== null && typeof value === 'object';
+}
+
+
+/**
+ * Determine if a value is an object with a null prototype
+ *
+ * @returns {boolean} True if `value` is an `Object` with a null prototype
+ */
+function isBlankObject(value) {
+  return value !== null && typeof value === 'object' && !getPrototypeOf(value);
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isString
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is a `String`.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a `String`.
+ */
+function isString(value) {return typeof value === 'string';}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isNumber
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is a `Number`.
+ *
+ * This includes the "special" numbers `NaN`, `+Infinity` and `-Infinity`.
+ *
+ * If you wish to exclude these then you can use the native
+ * [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)
+ * method.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a `Number`.
+ */
+function isNumber(value) {return typeof value === 'number';}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isDate
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a value is a date.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a `Date`.
+ */
+function isDate(value) {
+  return toString.call(value) === '[object Date]';
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.isArray
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is an `Array`.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is an `Array`.
+ */
+var isArray = Array.isArray;
+
+/**
+ * @ngdoc function
+ * @name angular.isFunction
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is a `Function`.
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a `Function`.
+ */
+function isFunction(value) {return typeof value === 'function';}
+
+
+/**
+ * Determines if a value is a regular expression object.
+ *
+ * @private
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a `RegExp`.
+ */
+function isRegExp(value) {
+  return toString.call(value) === '[object RegExp]';
+}
+
+
+/**
+ * Checks if `obj` is a window object.
+ *
+ * @private
+ * @param {*} obj Object to check
+ * @returns {boolean} True if `obj` is a window obj.
+ */
+function isWindow(obj) {
+  return obj && obj.window === obj;
+}
+
+
+function isScope(obj) {
+  return obj && obj.$evalAsync && obj.$watch;
+}
+
+
+function isFile(obj) {
+  return toString.call(obj) === '[object File]';
+}
+
+
+function isFormData(obj) {
+  return toString.call(obj) === '[object FormData]';
+}
+
+
+function isBlob(obj) {
+  return toString.call(obj) === '[object Blob]';
+}
+
+
+function isBoolean(value) {
+  return typeof value === 'boolean';
+}
+
+
+function isPromiseLike(obj) {
+  return obj && isFunction(obj.then);
+}
+
+
+var TYPED_ARRAY_REGEXP = /^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/;
+function isTypedArray(value) {
+  return TYPED_ARRAY_REGEXP.test(toString.call(value));
+}
+
+
+var trim = function(value) {
+  return isString(value) ? value.trim() : value;
+};
+
+// Copied from:
+// http://docs.closure-library.googlecode.com/git/local_closure_goog_string_string.js.source.html#line1021
+// Prereq: s is a string.
+var escapeForRegexp = function(s) {
+  return s.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g, '\\$1').
+           replace(/\x08/g, '\\x08');
+};
+
+
+/**
+ * @ngdoc function
+ * @name angular.isElement
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if a reference is a DOM element (or wrapped jQuery element).
+ *
+ * @param {*} value Reference to check.
+ * @returns {boolean} True if `value` is a DOM element (or wrapped jQuery element).
+ */
+function isElement(node) {
+  return !!(node &&
+    (node.nodeName  // we are a direct element
+    || (node.prop && node.attr && node.find)));  // we have an on and find method part of jQuery API
+}
+
+/**
+ * @param str 'key1,key2,...'
+ * @returns {object} in the form of {key1:true, key2:true, ...}
+ */
+function makeMap(str) {
+  var obj = {}, items = str.split(","), i;
+  for (i = 0; i < items.length; i++) {
+    obj[items[i]] = true;
+  }
+  return obj;
+}
+
+
+function nodeName_(element) {
+  return lowercase(element.nodeName || (element[0] && element[0].nodeName));
+}
+
+function includes(array, obj) {
+  return Array.prototype.indexOf.call(array, obj) != -1;
+}
+
+function arrayRemove(array, value) {
+  var index = array.indexOf(value);
+  if (index >= 0) {
+    array.splice(index, 1);
+  }
+  return index;
+}
+
+/**
+ * @ngdoc function
+ * @name angular.copy
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Creates a deep copy of `source`, which should be an object or an array.
+ *
+ * * If no destination is supplied, a copy of the object or array is created.
+ * * If a destination is provided, all of its elements (for arrays) or properties (for objects)
+ *   are deleted and then all elements/properties from the source are copied to it.
+ * * If `source` is not an object or array (inc. `null` and `undefined`), `source` is returned.
+ * * If `source` is identical to 'destination' an exception will be thrown.
+ *
+ * @param {*} source The source that will be used to make a copy.
+ *                   Can be any type, including primitives, `null`, and `undefined`.
+ * @param {(Object|Array)=} destination Destination into which the source is copied. If
+ *     provided, must be of the same type as `source`.
+ * @returns {*} The copy or updated `destination`, if `destination` was specified.
+ *
+ * @example
+ <example module="copyExample">
+ <file name="index.html">
+ <div ng-controller="ExampleController">
+ <form novalidate class="simple-form">
+ Name: <input type="text" ng-model="user.name" /><br />
+ E-mail: <input type="email" ng-model="user.email" /><br />
+ Gender: <input type="radio" ng-model="user.gender" value="male" />male
+ <input type="radio" ng-model="user.gender" value="female" />female<br />
+ <button ng-click="reset()">RESET</button>
+ <button ng-click="update(user)">SAVE</button>
+ </form>
+ <pre>form = {{user | json}}</pre>
+ <pre>master = {{master | json}}</pre>
+ </div>
+
+ <script>
+  angular.module('copyExample', [])
+    .controller('ExampleController', ['$scope', function($scope) {
+      $scope.master= {};
+
+      $scope.update = function(user) {
+        // Example with 1 argument
+        $scope.master= angular.copy(user);
+      };
+
+      $scope.reset = function() {
+        // Example with 2 arguments
+        angular.copy($scope.master, $scope.user);
+      };
+
+      $scope.reset();
+    }]);
+ </script>
+ </file>
+ </example>
+ */
+function copy(source, destination, stackSource, stackDest) {
+  if (isWindow(source) || isScope(source)) {
+    throw ngMinErr('cpws',
+      "Can't copy! Making copies of Window or Scope instances is not supported.");
+  }
+  if (isTypedArray(destination)) {
+    throw ngMinErr('cpta',
+      "Can't copy! TypedArray destination cannot be mutated.");
+  }
+
+  if (!destination) {
+    destination = source;
+    if (isObject(source)) {
+      var index;
+      if (stackSource && (index = stackSource.indexOf(source)) !== -1) {
+        return stackDest[index];
+      }
+
+      // TypedArray, Date and RegExp have specific copy functionality and must be
+      // pushed onto the stack before returning.
+      // Array and other objects create the base object and recurse to copy child
+      // objects. The array/object will be pushed onto the stack when recursed.
+      if (isArray(source)) {
+        return copy(source, [], stackSource, stackDest);
+      } else if (isTypedArray(source)) {
+        destination = new source.constructor(source);
+      } else if (isDate(source)) {
+        destination = new Date(source.getTime());
+      } else if (isRegExp(source)) {
+        destination = new RegExp(source.source, source.toString().match(/[^\/]*$/)[0]);
+        destination.lastIndex = source.lastIndex;
+      } else if (isFunction(source.cloneNode)) {
+          destination = source.cloneNode(true);
+      } else {
+        var emptyObject = Object.create(getPrototypeOf(source));
+        return copy(source, emptyObject, stackSource, stackDest);
+      }
+
+      if (stackDest) {
+        stackSource.push(source);
+        stackDest.push(destination);
+      }
+    }
+  } else {
+    if (source === destination) throw ngMinErr('cpi',
+      "Can't copy! Source and destination are identical.");
+
+    stackSource = stackSource || [];
+    stackDest = stackDest || [];
+
+    if (isObject(source)) {
+      stackSource.push(source);
+      stackDest.push(destination);
+    }
+
+    var result, key;
+    if (isArray(source)) {
+      destination.length = 0;
+      for (var i = 0; i < source.length; i++) {
+        destination.push(copy(source[i], null, stackSource, stackDest));
+      }
+    } else {
+      var h = destination.$$hashKey;
+      if (isArray(destination)) {
+        destination.length = 0;
+      } else {
+        forEach(destination, function(value, key) {
+          delete destination[key];
+        });
+      }
+      if (isBlankObject(source)) {
+        // createMap() fast path --- Safe to avoid hasOwnProperty check because prototype chain is empty
+        for (key in source) {
+          destination[key] = copy(source[key], null, stackSource, stackDest);
+        }
+      } else if (source && typeof source.hasOwnProperty === 'function') {
+        // Slow path, which must rely on hasOwnProperty
+        for (key in source) {
+          if (source.hasOwnProperty(key)) {
+            destination[key] = copy(source[key], null, stackSource, stackDest);
+          }
+        }
+      } else {
+        // Slowest path --- hasOwnProperty can't be called as a method
+        for (key in source) {
+          if (hasOwnProperty.call(source, key)) {
+            destination[key] = copy(source[key], null, stackSource, stackDest);
+          }
+        }
+      }
+      setHashKey(destination,h);
+    }
+  }
+  return destination;
+}
+
+/**
+ * Creates a shallow copy of an object, an array or a primitive.
+ *
+ * Assumes that there are no proto properties for objects.
+ */
+function shallowCopy(src, dst) {
+  if (isArray(src)) {
+    dst = dst || [];
+
+    for (var i = 0, ii = src.length; i < ii; i++) {
+      dst[i] = src[i];
+    }
+  } else if (isObject(src)) {
+    dst = dst || {};
+
+    for (var key in src) {
+      if (!(key.charAt(0) === '$' && key.charAt(1) === '$')) {
+        dst[key] = src[key];
+      }
+    }
+  }
+
+  return dst || src;
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.equals
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Determines if two objects or two values are equivalent. Supports value types, regular
+ * expressions, arrays and objects.
+ *
+ * Two objects or values are considered equivalent if at least one of the following is true:
+ *
+ * * Both objects or values pass `===` comparison.
+ * * Both objects or values are of the same type and all of their properties are equal by
+ *   comparing them with `angular.equals`.
+ * * Both values are NaN. (In JavaScript, NaN == NaN => false. But we consider two NaN as equal)
+ * * Both values represent the same regular expression (In JavaScript,
+ *   /abc/ == /abc/ => false. But we consider two regular expressions as equal when their textual
+ *   representation matches).
+ *
+ * During a property comparison, properties of `function` type and properties with names
+ * that begin with `$` are ignored.
+ *
+ * Scope and DOMWindow objects are being compared only by identify (`===`).
+ *
+ * @param {*} o1 Object or value to compare.
+ * @param {*} o2 Object or value to compare.
+ * @returns {boolean} True if arguments are equal.
+ */
+function equals(o1, o2) {
+  if (o1 === o2) return true;
+  if (o1 === null || o2 === null) return false;
+  if (o1 !== o1 && o2 !== o2) return true; // NaN === NaN
+  var t1 = typeof o1, t2 = typeof o2, length, key, keySet;
+  if (t1 == t2) {
+    if (t1 == 'object') {
+      if (isArray(o1)) {
+        if (!isArray(o2)) return false;
+        if ((length = o1.length) == o2.length) {
+          for (key = 0; key < length; key++) {
+            if (!equals(o1[key], o2[key])) return false;
+          }
+          return true;
+        }
+      } else if (isDate(o1)) {
+        if (!isDate(o2)) return false;
+        return equals(o1.getTime(), o2.getTime());
+      } else if (isRegExp(o1)) {
+        return isRegExp(o2) ? o1.toString() == o2.toString() : false;
+      } else {
+        if (isScope(o1) || isScope(o2) || isWindow(o1) || isWindow(o2) ||
+          isArray(o2) || isDate(o2) || isRegExp(o2)) return false;
+        keySet = createMap();
+        for (key in o1) {
+          if (key.charAt(0) === '$' || isFunction(o1[key])) continue;
+          if (!equals(o1[key], o2[key])) return false;
+          keySet[key] = true;
+        }
+        for (key in o2) {
+          if (!(key in keySet) &&
+              key.charAt(0) !== '$' &&
+              isDefined(o2[key]) &&
+              !isFunction(o2[key])) return false;
+        }
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+var csp = function() {
+  if (!isDefined(csp.rules)) {
+
+
+    var ngCspElement = (document.querySelector('[ng-csp]') ||
+                    document.querySelector('[data-ng-csp]'));
+
+    if (ngCspElement) {
+      var ngCspAttribute = ngCspElement.getAttribute('ng-csp') ||
+                    ngCspElement.getAttribute('data-ng-csp');
+      csp.rules = {
+        noUnsafeEval: !ngCspAttribute || (ngCspAttribute.indexOf('no-unsafe-eval') !== -1),
+        noInlineStyle: !ngCspAttribute || (ngCspAttribute.indexOf('no-inline-style') !== -1)
+      };
+    } else {
+      csp.rules = {
+        noUnsafeEval: noUnsafeEval(),
+        noInlineStyle: false
+      };
+    }
+  }
+
+  return csp.rules;
+
+  function noUnsafeEval() {
+    try {
+      /* jshint -W031, -W054 */
+      new Function('');
+      /* jshint +W031, +W054 */
+      return false;
+    } catch (e) {
+      return true;
+    }
+  }
+};
+
+/**
+ * @ngdoc directive
+ * @module ng
+ * @name ngJq
+ *
+ * @element ANY
+ * @param {string=} ngJq the name of the library available under `window`
+ * to be used for angular.element
+ * @description
+ * Use this directive to force the angular.element library.  This should be
+ * used to force either jqLite by leaving ng-jq blank or setting the name of
+ * the jquery variable under window (eg. jQuery).
+ *
+ * Since angular looks for this directive when it is loaded (doesn't wait for the
+ * DOMContentLoaded event), it must be placed on an element that comes before the script
+ * which loads angular. Also, only the first instance of `ng-jq` will be used and all
+ * others ignored.
+ *
+ * @example
+ * This example shows how to force jqLite using the `ngJq` directive to the `html` tag.
+ ```html
+ <!doctype html>
+ <html ng-app ng-jq>
+ ...
+ ...
+ </html>
+ ```
+ * @example
+ * This example shows how to use a jQuery based library of a different name.
+ * The library name must be available at the top most 'window'.
+ ```html
+ <!doctype html>
+ <html ng-app ng-jq="jQueryLib">
+ ...
+ ...
+ </html>
+ ```
+ */
+var jq = function() {
+  if (isDefined(jq.name_)) return jq.name_;
+  var el;
+  var i, ii = ngAttrPrefixes.length, prefix, name;
+  for (i = 0; i < ii; ++i) {
+    prefix = ngAttrPrefixes[i];
+    if (el = document.querySelector('[' + prefix.replace(':', '\\:') + 'jq]')) {
+      name = el.getAttribute(prefix + 'jq');
+      break;
+    }
+  }
+
+  return (jq.name_ = name);
+};
+
+function concat(array1, array2, index) {
+  return array1.concat(slice.call(array2, index));
+}
+
+function sliceArgs(args, startIndex) {
+  return slice.call(args, startIndex || 0);
+}
+
+
+/* jshint -W101 */
+/**
+ * @ngdoc function
+ * @name angular.bind
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
+ * `fn`). You can supply optional `args` that are prebound to the function. This feature is also
+ * known as [partial application](http://en.wikipedia.org/wiki/Partial_application), as
+ * distinguished from [function currying](http://en.wikipedia.org/wiki/Currying#Contrast_with_partial_function_application).
+ *
+ * @param {Object} self Context which `fn` should be evaluated in.
+ * @param {function()} fn Function to be bound.
+ * @param {...*} args Optional arguments to be prebound to the `fn` function call.
+ * @returns {function()} Function that wraps the `fn` with all the specified bindings.
+ */
+/* jshint +W101 */
+function bind(self, fn) {
+  var curryArgs = arguments.length > 2 ? sliceArgs(arguments, 2) : [];
+  if (isFunction(fn) && !(fn instanceof RegExp)) {
+    return curryArgs.length
+      ? function() {
+          return arguments.length
+            ? fn.apply(self, concat(curryArgs, arguments, 0))
+            : fn.apply(self, curryArgs);
+        }
+      : function() {
+          return arguments.length
+            ? fn.apply(self, arguments)
+            : fn.call(self);
+        };
+  } else {
+    // in IE, native methods are not functions so they cannot be bound (note: they don't need to be)
+    return fn;
+  }
+}
+
+
+function toJsonReplacer(key, value) {
+  var val = value;
+
+  if (typeof key === 'string' && key.charAt(0) === '$' && key.charAt(1) === '$') {
+    val = undefined;
+  } else if (isWindow(value)) {
+    val = '$WINDOW';
+  } else if (value &&  document === value) {
+    val = '$DOCUMENT';
+  } else if (isScope(value)) {
+    val = '$SCOPE';
+  }
+
+  return val;
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.toJson
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
+ * stripped since angular uses this notation internally.
+ *
+ * @param {Object|Array|Date|string|number} obj Input to be serialized into JSON.
+ * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.
+ *    If set to an integer, the JSON output will contain that many spaces per indentation.
+ * @returns {string|undefined} JSON-ified string representing `obj`.
+ */
+function toJson(obj, pretty) {
+  if (typeof obj === 'undefined') return undefined;
+  if (!isNumber(pretty)) {
+    pretty = pretty ? 2 : null;
+  }
+  return JSON.stringify(obj, toJsonReplacer, pretty);
+}
+
+
+/**
+ * @ngdoc function
+ * @name angular.fromJson
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Deserializes a JSON string.
+ *
+ * @param {string} json JSON string to deserialize.
+ * @returns {Object|Array|string|number} Deserialized JSON string.
+ */
+function fromJson(json) {
+  return isString(json)
+      ? JSON.parse(json)
+      : json;
+}
+
+
+function timezoneToOffset(timezone, fallback) {
+  var requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
+  return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
+}
+
+
+function addDateMinutes(date, minutes) {
+  date = new Date(date.getTime());
+  date.setMinutes(date.getMinutes() + minutes);
+  return date;
+}
+
+
+function convertTimezoneToLocal(date, timezone, reverse) {
+  reverse = reverse ? -1 : 1;
+  var timezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
+  return addDateMinutes(date, reverse * (timezoneOffset - date.getTimezoneOffset()));
+}
+
+
+/**
+ * @returns {string} Returns the string representation of the element.
+ */
+function startingTag(element) {
+  element = jqLite(element).clone();
+  try {
+    // turns out IE does not let you set .html() on elements which
+    // are not allowed to have children. So we just ignore it.
+    element.empty();
+  } catch (e) {}
+  var elemHtml = jqLite('<div>').append(element).html();
+  try {
+    return element[0].nodeType === NODE_TYPE_TEXT ? lowercase(elemHtml) :
+        elemHtml.
+          match(/^(<[^>]+>)/)[1].
+          replace(/^<([\w\-]+)/, function(match, nodeName) { return '<' + lowercase(nodeName); });
+  } catch (e) {
+    return lowercase(elemHtml);
+  }
+
+}
+
+
+/////////////////////////////////////////////////
+
+/**
+ * Tries to decode the URI component without throwing an exception.
+ *
+ * @private
+ * @param str value potential URI component to check.
+ * @returns {boolean} True if `value` can be decoded
+ * with the decodeURIComponent function.
+ */
+function tryDecodeURIComponent(value) {
+  try {
+    return decodeURIComponent(value);
+  } catch (e) {
+    // Ignore any invalid uri component
+  }
+}
+
+
+/**
+ * Parses an escaped url query string into key-value pairs.
+ * @returns {Object.<string,boolean|Array>}
+ */
+function parseKeyValue(/**string*/keyValue) {
+  var obj = {};
+  forEach((keyValue || "").split('&'), function(keyValue) {
+    var splitPoint, key, val;
+    if (keyValue) {
+      key = keyValue = keyValue.replace(/\+/g,'%20');
+      splitPoint = keyValue.indexOf('=');
+      if (splitPoint !== -1) {
+        key = keyValue.substring(0, splitPoint);
+        val = keyValue.substring(splitPoint + 1);
+      }
+      key = tryDecodeURIComponent(key);
+      if (isDefined(key)) {
+        val = isDefined(val) ? tryDecodeURIComponent(val) : true;
+        if (!hasOwnProperty.call(obj, key)) {
+          obj[key] = val;
+        } else if (isArray(obj[key])) {
+          obj[key].push(val);
+        } else {
+          obj[key] = [obj[key],val];
+        }
+      }
+    }
+  });
+  return obj;
+}
+
+function toKeyValue(obj) {
+  var parts = [];
+  forEach(obj, function(value, key) {
+    if (isArray(value)) {
+      forEach(value, function(arrayValue) {
+        parts.push(encodeUriQuery(key, true) +
+                   (arrayValue === true ? '' : '=' + encodeUriQuery(arrayValue, true)));
+      });
+    } else {
+    parts.push(encodeUriQuery(key, true) +
+               (value === true ? '' : '=' + encodeUriQuery(value, true)));
+    }
+  });
+  return parts.length ? parts.join('&') : '';
+}
+
+
+/**
+ * We need our custom method because encodeURIComponent is too aggressive and doesn't follow
+ * http://www.ietf.org/rfc/rfc3986.txt with regards to the character set (pchar) allowed in path
+ * segments:
+ *    segment       = *pchar
+ *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
+ *    pct-encoded   = "%" HEXDIG HEXDIG
+ *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
+ *                     / "*" / "+" / "," / ";" / "="
+ */
+function encodeUriSegment(val) {
+  return encodeUriQuery(val, true).
+             replace(/%26/gi, '&').
+             replace(/%3D/gi, '=').
+             replace(/%2B/gi, '+');
+}
+
+
+/**
+ * This method is intended for encoding *key* or *value* parts of query component. We need a custom
+ * method because encodeURIComponent is too aggressive and encodes stuff that doesn't have to be
+ * encoded per http://tools.ietf.org/html/rfc3986:
+ *    query       = *( pchar / "/" / "?" )
+ *    pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
+ *    unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
+ *    pct-encoded   = "%" HEXDIG HEXDIG
+ *    sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
+ *                     / "*" / "+" / "," / ";" / "="
+ */
+function encodeUriQuery(val, pctEncodeSpaces) {
+  return encodeURIComponent(val).
+             replace(/%40/gi, '@').
+             replace(/%3A/gi, ':').
+             replace(/%24/g, '$').
+             replace(/%2C/gi, ',').
+             replace(/%3B/gi, ';').
+             replace(/%20/g, (pctEncodeSpaces ? '%20' : '+'));
+}
+
+var ngAttrPrefixes = ['ng-', 'data-ng-', 'ng:', 'x-ng-'];
+
+function getNgAttribute(element, ngAttr) {
+  var attr, i, ii = ngAttrPrefixes.length;
+  for (i = 0; i < ii; ++i) {
+    attr = ngAttrPrefixes[i] + ngAttr;
+    if (isString(attr = element.getAttribute(attr))) {
+      return attr;
+    }
+  }
+  return null;
+}
+
+/**
+ * @ngdoc directive
+ * @name ngApp
+ * @module ng
+ *
+ * @element ANY
+ * @param {angular.Module} ngApp an optional application
+ *   {@link angular.module module} name to load.
+ * @param {boolean=} ngStrictDi if this attribute is present on the app element, the injector will be
+ *   created in "strict-di" mode. This means that the application will fail to invoke functions which
+ *   do not use explicit function annotation (and are thus unsuitable for minification), as described
+ *   in {@link guide/di the Dependency Injection guide}, and useful debugging info will assist in
+ *   tracking down the root of these bugs.
+ *
+ * @description
+ *
+ * Use this directive to **auto-bootstrap** an AngularJS application. The `ngApp` directive
+ * designates the **root element** of the application and is typically placed near the root element
+ * of the page - e.g. on the `<body>` or `<html>` tags.
+ *
+ * Only one AngularJS application can be auto-bootstrapped per HTML document. The first `ngApp`
+ * found in the document will be used to define the root element to auto-bootstrap as an
+ * application. To run multiple applications in an HTML document you must manually bootstrap them using
+ * {@link angular.bootstrap} instead. AngularJS applications cannot be nested within each other.
+ *
+ * You can specify an **AngularJS module** to be used as the root module for the application.  This
+ * module will be loaded into the {@link auto.$injector} when the application is bootstrapped. It
+ * should contain the application code needed or have dependencies on other modules that will
+ * contain the code. See {@link angular.module} for more information.
+ *
+ * In the example below if the `ngApp` directive were not placed on the `html` element then the
+ * document would not be compiled, the `AppController` would not be instantiated and the `{{ a+b }}`
+ * would not be resolved to `3`.
+ *
+ * `ngApp` is the easiest, and most common way to bootstrap an application.
+ *
+ <example module="ngAppDemo">
+   <file name="index.html">
+   <div ng-controller="ngAppDemoController">
+     I can add: {{a}} + {{b}} =  {{ a+b }}
+   </div>
+   </file>
+   <file name="script.js">
+   angular.module('ngAppDemo', []).controller('ngAppDemoController', function($scope) {
+     $scope.a = 1;
+     $scope.b = 2;
+   });
+   </file>
+ </example>
+ *
+ * Using `ngStrictDi`, you would see something like this:
+ *
+ <example ng-app-included="true">
+   <file name="index.html">
+   <div ng-app="ngAppStrictDemo" ng-strict-di>
+       <div ng-controller="GoodController1">
+           I can add: {{a}} + {{b}} =  {{ a+b }}
+
+           <p>This renders because the controller does not fail to
+              instantiate, by using explicit annotation style (see
+              script.js for details)
+           </p>
+       </div>
+
+       <div ng-controller="GoodController2">
+           Name: <input ng-model="name"><br />
+           Hello, {{name}}!
+
+           <p>This renders because the controller does not fail to
+              instantiate, by using explicit annotation style
+              (see script.js for details)
+           </p>
+       </div>
+
+       <div ng-controller="BadController">
+           I can add: {{a}} + {{b}} =  {{ a+b }}
+
+           <p>The controller could not be instantiated, due to relying
+              on automatic function annotations (which are disabled in
+              strict mode). As such, the content of this section is not
+              interpolated, and there should be an error in your web console.
+           </p>
+       </div>
+   </div>
+   </file>
+   <file name="script.js">
+   angular.module('ngAppStrictDemo', [])
+     // BadController will fail to instantiate, due to relying on automatic function annotation,
+     // rather than an explicit annotation
+     .controller('BadController', function($scope) {
+       $scope.a = 1;
+       $scope.b = 2;
+     })
+     // Unlike BadController, GoodController1 and GoodController2 will not fail to be instantiated,
+     // due to using explicit annotations using the array style and $inject property, respectively.
+     .controller('GoodController1', ['$scope', function($scope) {
+       $scope.a = 1;
+       $scope.b = 2;
+     }])
+     .controller('GoodController2', GoodController2);
+     function GoodController2($scope) {
+       $scope.name = "World";
+     }
+     GoodController2.$inject = ['$scope'];
+   </file>
+   <file name="style.css">
+   div[ng-controller] {
+       margin-bottom: 1em;
+       -webkit-border-radius: 4px;
+       border-radius: 4px;
+       border: 1px solid;
+       padding: .5em;
+   }
+   div[ng-controller^=Good] {
+       border-color: #d6e9c6;
+       background-color: #dff0d8;
+       color: #3c763d;
+   }
+   div[ng-controller^=Bad] {
+       border-color: #ebccd1;
+       background-color: #f2dede;
+       color: #a94442;
+       margin-bottom: 0;
+   }
+   </file>
+ </example>
+ */
+function angularInit(element, bootstrap) {
+  var appElement,
+      module,
+      config = {};
+
+  // The element `element` has priority over any other element
+  forEach(ngAttrPrefixes, function(prefix) {
+    var name = prefix + 'app';
+
+    if (!appElement && element.hasAttribute && element.hasAttribute(name)) {
+      appElement = element;
+      module = element.getAttribute(name);
+    }
+  });
+  forEach(ngAttrPrefixes, function(prefix) {
+    var name = prefix + 'app';
+    var candidate;
+
+    if (!appElement && (candidate = element.querySelector('[' + name.replace(':', '\\:') + ']'))) {
+      appElement = candidate;
+      module = candidate.getAttribute(name);
+    }
+  });
+  if (appElement) {
+    config.strictDi = getNgAttribute(appElement, "strict-di") !== null;
+    bootstrap(appElement, module ? [module] : [], config);
+  }
+}
+
+/**
+ * @ngdoc function
+ * @name angular.bootstrap
+ * @module ng
+ * @description
+ * Use this function to manually start up angular application.
+ *
+ * See: {@link guide/bootstrap Bootstrap}
+ *
+ * Note that Protractor based end-to-end tests cannot use this function to bootstrap manually.
+ * They must use {@link ng.directive:ngApp ngApp}.
+ *
+ * Angular will detect if it has been loaded into the browser more than once and only allow the
+ * first loaded script to be bootstrapped and will report a warning to the browser console for
+ * each of the subsequent scripts. This prevents strange results in applications, where otherwise
+ * multiple instances of Angular try to work on the DOM.
+ *
+ * ```html
+ * <!doctype html>
+ * <html>
+ * <body>
+ * <div ng-controller="WelcomeController">
+ *   {{greeting}}
+ * </div>
+ *
+ * <script src="angular.js"></script>
+ * <script>
+ *   var app = angular.module('demo', [])
+ *   .controller('WelcomeController', function($scope) {
+ *       $scope.greeting = 'Welcome!';
+ *   });
+ *   angular.bootstrap(document, ['demo']);
+ * </script>
+ * </body>
+ * </html>
+ * ```
+ *
+ * @param {DOMElement} element DOM element which is the root of angular application.
+ * @param {Array<String|Function|Array>=} modules an array of modules to load into the application.
+ *     Each item in the array should be the name of a predefined module or a (DI annotated)
+ *     function that will be invoked by the injector as a `config` block.
+ *     See: {@link angular.module modules}
+ * @param {Object=} config an object for defining configuration options for the application. The
+ *     following keys are supported:
+ *
+ * * `strictDi` - disable automatic function annotation for the application. This is meant to
+ *   assist in finding bugs which break minified code. Defaults to `false`.
+ *
+ * @returns {auto.$injector} Returns the newly created injector for this app.
+ */
+function bootstrap(element, modules, config) {
+  if (!isObject(config)) config = {};
+  var defaultConfig = {
+    strictDi: false
+  };
+  config = extend(defaultConfig, config);
+  var doBootstrap = function() {
+    element = jqLite(element);
+
+    if (element.injector()) {
+      var tag = (element[0] === document) ? 'document' : startingTag(element);
+      //Encode angle brackets to prevent input from being sanitized to empty string #8683
+      throw ngMinErr(
+          'btstrpd',
+          "App Already Bootstrapped with this Element '{0}'",
+          tag.replace(/</,'&lt;').replace(/>/,'&gt;'));
+    }
+
+    modules = modules || [];
+    modules.unshift(['$provide', function($provide) {
+      $provide.value('$rootElement', element);
+    }]);
+
+    if (config.debugInfoEnabled) {
+      // Pushing so that this overrides `debugInfoEnabled` setting defined in user's `modules`.
+      modules.push(['$compileProvider', function($compileProvider) {
+        $compileProvider.debugInfoEnabled(true);
+      }]);
+    }
+
+    modules.unshift('ng');
+    var injector = createInjector(modules, config.strictDi);
+    injector.invoke(['$rootScope', '$rootElement', '$compile', '$injector',
+       function bootstrapApply(scope, element, compile, injector) {
+        scope.$apply(function() {
+          element.data('$injector', injector);
+          compile(element)(scope);
+        });
+      }]
+    );
+    return injector;
+  };
+
+  var NG_ENABLE_DEBUG_INFO = /^NG_ENABLE_DEBUG_INFO!/;
+  var NG_DEFER_BOOTSTRAP = /^NG_DEFER_BOOTSTRAP!/;
+
+  if (window && NG_ENABLE_DEBUG_INFO.test(window.name)) {
+    config.debugInfoEnabled = true;
+    window.name = window.name.replace(NG_ENABLE_DEBUG_INFO, '');
+  }
+
+  if (window && !NG_DEFER_BOOTSTRAP.test(window.name)) {
+    return doBootstrap();
+  }
+
+  window.name = window.name.replace(NG_DEFER_BOOTSTRAP, '');
+  angular.resumeBootstrap = function(extraModules) {
+    forEach(extraModules, function(module) {
+      modules.push(module);
+    });
+    return doBootstrap();
+  };
+
+  if (isFunction(angular.resumeDeferredBootstrap)) {
+    angular.resumeDeferredBootstrap();
+  }
+}
+
+/**
+ * @ngdoc function
+ * @name angular.reloadWithDebugInfo
+ * @module ng
+ * @description
+ * Use this function to reload the current application with debug information turned on.
+ * This takes precedence over a call to `$compileProvider.debugInfoEnabled(false)`.
+ *
+ * See {@link ng.$compileProvider#debugInfoEnabled} for more.
+ */
+function reloadWithDebugInfo() {
+  window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;
+  window.location.reload();
+}
+
+/**
+ * @name angular.getTestability
+ * @module ng
+ * @description
+ * Get the testability service for the instance of Angular on the given
+ * element.
+ * @param {DOMElement} element DOM element which is the root of angular application.
+ */
+function getTestability(rootElement) {
+  var injector = angular.element(rootElement).injector();
+  if (!injector) {
+    throw ngMinErr('test',
+      'no injector found for element argument to getTestability');
+  }
+  return injector.get('$$testability');
+}
+
+var SNAKE_CASE_REGEXP = /[A-Z]/g;
+function snake_case(name, separator) {
+  separator = separator || '_';
+  return name.replace(SNAKE_CASE_REGEXP, function(letter, pos) {
+    return (pos ? separator : '') + letter.toLowerCase();
+  });
+}
+
+var bindJQueryFired = false;
+var skipDestroyOnNextJQueryCleanData;
+function bindJQuery() {
+  var originalCleanData;
+
+  if (bindJQueryFired) {
+    return;
+  }
+
+  // bind to jQuery if present;
+  var jqName = jq();
+  jQuery = isUndefined(jqName) ? window.jQuery :   // use jQuery (if present)
+           !jqName             ? undefined     :   // use jqLite
+                                 window[jqName];   // use jQuery specified by `ngJq`
+
+  // Use jQuery if it exists with proper functionality, otherwise default to us.
+  // Angular 1.2+ requires jQuery 1.7+ for on()/off() support.
+  // Angular 1.3+ technically requires at least jQuery 2.1+ but it may work with older
+  // versions. It will not work for sure with jQuery <1.7, though.
+  if (jQuery && jQuery.fn.on) {
+    jqLite = jQuery;
+    extend(jQuery.fn, {
+      scope: JQLitePrototype.scope,
+      isolateScope: JQLitePrototype.isolateScope,
+      controller: JQLitePrototype.controller,
+      injector: JQLitePrototype.injector,
+      inheritedData: JQLitePrototype.inheritedData
+    });
+
+    // All nodes removed from the DOM via various jQuery APIs like .remove()
+    // are passed through jQuery.cleanData. Monkey-patch this method to fire
+    // the $destroy event on all removed nodes.
+    originalCleanData = jQuery.cleanData;
+    jQuery.cleanData = function(elems) {
+      var events;
+      if (!skipDestroyOnNextJQueryCleanData) {
+        for (var i = 0, elem; (elem = elems[i]) != null; i++) {
+          events = jQuery._data(elem, "events");
+          if (events && events.$destroy) {
+            jQuery(elem).triggerHandler('$destroy');
+          }
+        }
+      } else {
+        skipDestroyOnNextJQueryCleanData = false;
+      }
+      originalCleanData(elems);
+    };
+  } else {
+    jqLite = JQLite;
+  }
+
+  angular.element = jqLite;
+
+  // Prevent double-proxying.
+  bindJQueryFired = true;
+}
+
+/**
+ * throw error if the argument is falsy.
+ */
+function assertArg(arg, name, reason) {
+  if (!arg) {
+    throw ngMinErr('areq', "Argument '{0}' is {1}", (name || '?'), (reason || "required"));
+  }
+  return arg;
+}
+
+function assertArgFn(arg, name, acceptArrayAnnotation) {
+  if (acceptArrayAnnotation && isArray(arg)) {
+      arg = arg[arg.length - 1];
+  }
+
+  assertArg(isFunction(arg), name, 'not a function, got ' +
+      (arg && typeof arg === 'object' ? arg.constructor.name || 'Object' : typeof arg));
+  return arg;
+}
+
+/**
+ * throw error if the name given is hasOwnProperty
+ * @param  {String} name    the name to test
+ * @param  {String} context the context in which the name is used, such as module or directive
+ */
+function assertNotHasOwnProperty(name, context) {
+  if (name === 'hasOwnProperty') {
+    throw ngMinErr('badname', "hasOwnProperty is not a valid {0} name", context);
+  }
+}
+
+/**
+ * Return the value accessible from the object by path. Any undefined traversals are ignored
+ * @param {Object} obj starting object
+ * @param {String} path path to traverse
+ * @param {boolean} [bindFnToScope=true]
+ * @returns {Object} value as accessible by path
+ */
+//TODO(misko): this function needs to be removed
+function getter(obj, path, bindFnToScope) {
+  if (!path) return obj;
+  var keys = path.split('.');
+  var key;
+  var lastInstance = obj;
+  var len = keys.length;
+
+  for (var i = 0; i < len; i++) {
+    key = keys[i];
+    if (obj) {
+      obj = (lastInstance = obj)[key];
+    }
+  }
+  if (!bindFnToScope && isFunction(obj)) {
+    return bind(lastInstance, obj);
+  }
+  return obj;
+}
+
+/**
+ * Return the DOM siblings between the first and last node in the given array.
+ * @param {Array} array like object
+ * @returns {Array} the inputted object or a jqLite collection containing the nodes
+ */
+function getBlockNodes(nodes) {
+  // TODO(perf): update `nodes` instead of creating a new object?
+  var node = nodes[0];
+  var endNode = nodes[nodes.length - 1];
+  var blockNodes;
+
+  for (var i = 1; node !== endNode && (node = node.nextSibling); i++) {
+    if (blockNodes || nodes[i] !== node) {
+      if (!blockNodes) {
+        blockNodes = jqLite(slice.call(nodes, 0, i));
+      }
+      blockNodes.push(node);
+    }
+  }
+
+  return blockNodes || nodes;
+}
+
+
+/**
+ * Creates a new object without a prototype. This object is useful for lookup without having to
+ * guard against prototypically inherited properties via hasOwnProperty.
+ *
+ * Related micro-benchmarks:
+ * - http://jsperf.com/object-create2
+ * - http://jsperf.com/proto-map-lookup/2
+ * - http://jsperf.com/for-in-vs-object-keys2
+ *
+ * @returns {Object}
+ */
+function createMap() {
+  return Object.create(null);
+}
+
+var NODE_TYPE_ELEMENT = 1;
+var NODE_TYPE_ATTRIBUTE = 2;
+var NODE_TYPE_TEXT = 3;
+var NODE_TYPE_COMMENT = 8;
+var NODE_TYPE_DOCUMENT = 9;
+var NODE_TYPE_DOCUMENT_FRAGMENT = 11;
+
+/**
+ * @ngdoc type
+ * @name angular.Module
+ * @module ng
+ * @description
+ *
+ * Interface for configuring angular {@link angular.module modules}.
+ */
+
+function setupModuleLoader(window) {
+
+  var $injectorMinErr = minErr('$injector');
+  var ngMinErr = minErr('ng');
+
+  function ensure(obj, name, factory) {
+    return obj[name] || (obj[name] = factory());
+  }
+
+  var angular = ensure(window, 'angular', Object);
+
+  // We need to expose `angular.$$minErr` to modules such as `ngResource` that reference it during bootstrap
+  angular.$$minErr = angular.$$minErr || minErr;
+
+  return ensure(angular, 'module', function() {
+    /** @type {Object.<string, angular.Module>} */
+    var modules = {};
+
+    /**
+     * @ngdoc function
+     * @name angular.module
+     * @module ng
+     * @description
+     *
+     * The `angular.module` is a global place for creating, registering and retrieving Angular
+     * modules.
+     * All modules (angular core or 3rd party) that should be available to an application must be
+     * registered using this mechanism.
+     *
+     * Passing one argument retrieves an existing {@link angular.Module},
+     * whereas passing more than one argument creates a new {@link angular.Module}
+     *
+     *
+     * # Module
+     *
+     * A module is a collection of services, directives, controllers, filters, and configuration information.
+     * `angular.module` is used to configure the {@link auto.$injector $injector}.
+     *
+     * ```js
+     * // Create a new module
+     * var myModule = angular.module('myModule', []);
+     *
+     * // register a new service
+     * myModule.value('appName', 'MyCoolApp');
+     *
+     * // configure existing services inside initialization blocks.
+     * myModule.config(['$locationProvider', function($locationProvider) {
+     *   // Configure existing providers
+     *   $locationProvider.hashPrefix('!');
+     * }]);
+     * ```
+     *
+     * Then you can create an injector and load your modules like this:
+     *
+     * ```js
+     * var injector = angular.injector(['ng', 'myModule'])
+     * ```
+     *
+     * However it's more likely that you'll just use
+     * {@link ng.directive:ngApp ngApp} or
+     * {@link angular.bootstrap} to simplify this process for you.
+     *
+     * @param {!string} name The name of the module to create or retrieve.
+     * @param {!Array.<string>=} requires If specified then new module is being created. If
+     *        unspecified then the module is being retrieved for further configuration.
+     * @param {Function=} configFn Optional configuration function for the module. Same as
+     *        {@link angular.Module#config Module#config()}.
+     * @returns {module} new module with the {@link angular.Module} api.
+     */
+    return function module(name, requires, configFn) {
+      var assertNotHasOwnProperty = function(name, context) {
+        if (name === 'hasOwnProperty') {
+          throw ngMinErr('badname', 'hasOwnProperty is not a valid {0} name', context);
+        }
+      };
+
+      assertNotHasOwnProperty(name, 'module');
+      if (requires && modules.hasOwnProperty(name)) {
+        modules[name] = null;
+      }
+      return ensure(modules, name, function() {
+        if (!requires) {
+          throw $injectorMinErr('nomod', "Module '{0}' is not available! You either misspelled " +
+             "the module name or forgot to load it. If registering a module ensure that you " +
+             "specify the dependencies as the second argument.", name);
+        }
+
+        /** @type {!Array.<Array.<*>>} */
+        var invokeQueue = [];
+
+        /** @type {!Array.<Function>} */
+        var configBlocks = [];
+
+        /** @type {!Array.<Function>} */
+        var runBlocks = [];
+
+        var config = invokeLater('$injector', 'invoke', 'push', configBlocks);
+
+        /** @type {angular.Module} */
+        var moduleInstance = {
+          // Private state
+          _invokeQueue: invokeQueue,
+          _configBlocks: configBlocks,
+          _runBlocks: runBlocks,
+
+          /**
+           * @ngdoc property
+           * @name angular.Module#requires
+           * @module ng
+           *
+           * @description
+           * Holds the list of modules which the injector will load before the current module is
+           * loaded.
+           */
+          requires: requires,
+
+          /**
+           * @ngdoc property
+           * @name angular.Module#name
+           * @module ng
+           *
+           * @description
+           * Name of the module.
+           */
+          name: name,
+
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#provider
+           * @module ng
+           * @param {string} name service name
+           * @param {Function} providerType Construction function for creating new instance of the
+           *                                service.
+           * @description
+           * See {@link auto.$provide#provider $provide.provider()}.
+           */
+          provider: invokeLaterAndSetModuleName('$provide', 'provider'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#factory
+           * @module ng
+           * @param {string} name service name
+           * @param {Function} providerFunction Function for creating new instance of the service.
+           * @description
+           * See {@link auto.$provide#factory $provide.factory()}.
+           */
+          factory: invokeLaterAndSetModuleName('$provide', 'factory'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#service
+           * @module ng
+           * @param {string} name service name
+           * @param {Function} constructor A constructor function that will be instantiated.
+           * @description
+           * See {@link auto.$provide#service $provide.service()}.
+           */
+          service: invokeLaterAndSetModuleName('$provide', 'service'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#value
+           * @module ng
+           * @param {string} name service name
+           * @param {*} object Service instance object.
+           * @description
+           * See {@link auto.$provide#value $provide.value()}.
+           */
+          value: invokeLater('$provide', 'value'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#constant
+           * @module ng
+           * @param {string} name constant name
+           * @param {*} object Constant value.
+           * @description
+           * Because the constant are fixed, they get applied before other provide methods.
+           * See {@link auto.$provide#constant $provide.constant()}.
+           */
+          constant: invokeLater('$provide', 'constant', 'unshift'),
+
+           /**
+           * @ngdoc method
+           * @name angular.Module#decorator
+           * @module ng
+           * @param {string} The name of the service to decorate.
+           * @param {Function} This function will be invoked when the service needs to be
+           *                                    instantiated and should return the decorated service instance.
+           * @description
+           * See {@link auto.$provide#decorator $provide.decorator()}.
+           */
+          decorator: invokeLaterAndSetModuleName('$provide', 'decorator'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#animation
+           * @module ng
+           * @param {string} name animation name
+           * @param {Function} animationFactory Factory function for creating new instance of an
+           *                                    animation.
+           * @description
+           *
+           * **NOTE**: animations take effect only if the **ngAnimate** module is loaded.
+           *
+           *
+           * Defines an animation hook that can be later used with
+           * {@link $animate $animate} service and directives that use this service.
+           *
+           * ```js
+           * module.animation('.animation-name', function($inject1, $inject2) {
+           *   return {
+           *     eventName : function(element, done) {
+           *       //code to run the animation
+           *       //once complete, then run done()
+           *       return function cancellationFunction(element) {
+           *         //code to cancel the animation
+           *       }
+           *     }
+           *   }
+           * })
+           * ```
+           *
+           * See {@link ng.$animateProvider#register $animateProvider.register()} and
+           * {@link ngAnimate ngAnimate module} for more information.
+           */
+          animation: invokeLaterAndSetModuleName('$animateProvider', 'register'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#filter
+           * @module ng
+           * @param {string} name Filter name - this must be a valid angular expression identifier
+           * @param {Function} filterFactory Factory function for creating new instance of filter.
+           * @description
+           * See {@link ng.$filterProvider#register $filterProvider.register()}.
+           *
+           * <div class="alert alert-warning">
+           * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
+           * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
+           * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
+           * (`myapp_subsection_filterx`).
+           * </div>
+           */
+          filter: invokeLaterAndSetModuleName('$filterProvider', 'register'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#controller
+           * @module ng
+           * @param {string|Object} name Controller name, or an object map of controllers where the
+           *    keys are the names and the values are the constructors.
+           * @param {Function} constructor Controller constructor function.
+           * @description
+           * See {@link ng.$controllerProvider#register $controllerProvider.register()}.
+           */
+          controller: invokeLaterAndSetModuleName('$controllerProvider', 'register'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#directive
+           * @module ng
+           * @param {string|Object} name Directive name, or an object map of directives where the
+           *    keys are the names and the values are the factories.
+           * @param {Function} directiveFactory Factory function for creating new instance of
+           * directives.
+           * @description
+           * See {@link ng.$compileProvider#directive $compileProvider.directive()}.
+           */
+          directive: invokeLaterAndSetModuleName('$compileProvider', 'directive'),
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#config
+           * @module ng
+           * @param {Function} configFn Execute this function on module load. Useful for service
+           *    configuration.
+           * @description
+           * Use this method to register work which needs to be performed on module loading.
+           * For more about how to configure services, see
+           * {@link providers#provider-recipe Provider Recipe}.
+           */
+          config: config,
+
+          /**
+           * @ngdoc method
+           * @name angular.Module#run
+           * @module ng
+           * @param {Function} initializationFn Execute this function after injector creation.
+           *    Useful for application initialization.
+           * @description
+           * Use this method to register work which should be performed when the injector is done
+           * loading all modules.
+           */
+          run: function(block) {
+            runBlocks.push(block);
+            return this;
+          }
+        };
+
+        if (configFn) {
+          config(configFn);
+        }
+
+        return moduleInstance;
+
+        /**
+         * @param {string} provider
+         * @param {string} method
+         * @param {String=} insertMethod
+         * @returns {angular.Module}
+         */
+        function invokeLater(provider, method, insertMethod, queue) {
+          if (!queue) queue = invokeQueue;
+          return function() {
+            queue[insertMethod || 'push']([provider, method, arguments]);
+            return moduleInstance;
+          };
+        }
+
+        /**
+         * @param {string} provider
+         * @param {string} method
+         * @returns {angular.Module}
+         */
+        function invokeLaterAndSetModuleName(provider, method) {
+          return function(recipeName, factoryFunction) {
+            if (factoryFunction && isFunction(factoryFunction)) factoryFunction.$$moduleName = name;
+            invokeQueue.push([provider, method, arguments]);
+            return moduleInstance;
+          };
+        }
+      });
+    };
+  });
+
+}
+
+/* global: toDebugString: true */
+
+function serializeObject(obj) {
+  var seen = [];
+
+  return JSON.stringify(obj, function(key, val) {
+    val = toJsonReplacer(key, val);
+    if (isObject(val)) {
+
+      if (seen.indexOf(val) >= 0) return '...';
+
+      seen.push(val);
+    }
+    return val;
+  });
+}
+
+function toDebugString(obj) {
+  if (typeof obj === 'function') {
+    return obj.toString().replace(/ \{[\s\S]*$/, '');
+  } else if (isUndefined(obj)) {
+    return 'undefined';
+  } else if (typeof obj !== 'string') {
+    return serializeObject(obj);
+  }
+  return obj;
+}
+
+/* global angularModule: true,
+  version: true,
+
+  $CompileProvider,
+
+  htmlAnchorDirective,
+  inputDirective,
+  inputDirective,
+  formDirective,
+  scriptDirective,
+  selectDirective,
+  styleDirective,
+  optionDirective,
+  ngBindDirective,
+  ngBindHtmlDirective,
+  ngBindTemplateDirective,
+  ngClassDirective,
+  ngClassEvenDirective,
+  ngClassOddDirective,
+  ngCloakDirective,
+  ngControllerDirective,
+  ngFormDirective,
+  ngHideDirective,
+  ngIfDirective,
+  ngIncludeDirective,
+  ngIncludeFillContentDirective,
+  ngInitDirective,
+  ngNonBindableDirective,
+  ngPluralizeDirective,
+  ngRepeatDirective,
+  ngShowDirective,
+  ngStyleDirective,
+  ngSwitchDirective,
+  ngSwitchWhenDirective,
+  ngSwitchDefaultDirective,
+  ngOptionsDirective,
+  ngTranscludeDirective,
+  ngModelDirective,
+  ngListDirective,
+  ngChangeDirective,
+  patternDirective,
+  patternDirective,
+  requiredDirective,
+  requiredDirective,
+  minlengthDirective,
+  minlengthDirective,
+  maxlengthDirective,
+  maxlengthDirective,
+  ngValueDirective,
+  ngModelOptionsDirective,
+  ngAttributeAliasDirectives,
+  ngEventDirectives,
+
+  $AnchorScrollProvider,
+  $AnimateProvider,
+  $CoreAnimateCssProvider,
+  $$CoreAnimateQueueProvider,
+  $$CoreAnimateRunnerProvider,
+  $BrowserProvider,
+  $CacheFactoryProvider,
+  $ControllerProvider,
+  $DocumentProvider,
+  $ExceptionHandlerProvider,
+  $FilterProvider,
+  $$ForceReflowProvider,
+  $InterpolateProvider,
+  $IntervalProvider,
+  $$HashMapProvider,
+  $HttpProvider,
+  $HttpParamSerializerProvider,
+  $HttpParamSerializerJQLikeProvider,
+  $HttpBackendProvider,
+  $xhrFactoryProvider,
+  $LocationProvider,
+  $LogProvider,
+  $ParseProvider,
+  $RootScopeProvider,
+  $QProvider,
+  $$QProvider,
+  $$SanitizeUriProvider,
+  $SceProvider,
+  $SceDelegateProvider,
+  $SnifferProvider,
+  $TemplateCacheProvider,
+  $TemplateRequestProvider,
+  $$TestabilityProvider,
+  $TimeoutProvider,
+  $$RAFProvider,
+  $WindowProvider,
+  $$jqLiteProvider,
+  $$CookieReaderProvider
+*/
+
+
+/**
+ * @ngdoc object
+ * @name angular.version
+ * @module ng
+ * @description
+ * An object that contains information about the current AngularJS version.
+ *
+ * This object has the following properties:
+ *
+ * - `full` – `{string}` – Full version string, such as "0.9.18".
+ * - `major` – `{number}` – Major version number, such as "0".
+ * - `minor` – `{number}` – Minor version number, such as "9".
+ * - `dot` – `{number}` – Dot version number, such as "18".
+ * - `codeName` – `{string}` – Code name of the release, such as "jiggling-armfat".
+ */
+var version = {
+  full: '1.4.7',    // all of these placeholder strings will be replaced by grunt's
+  major: 1,    // package task
+  minor: 4,
+  dot: 7,
+  codeName: 'dark-luminescence'
+};
+
+
+function publishExternalAPI(angular) {
+  extend(angular, {
+    'bootstrap': bootstrap,
+    'copy': copy,
+    'extend': extend,
+    'merge': merge,
+    'equals': equals,
+    'element': jqLite,
+    'forEach': forEach,
+    'injector': createInjector,
+    'noop': noop,
+    'bind': bind,
+    'toJson': toJson,
+    'fromJson': fromJson,
+    'identity': identity,
+    'isUndefined': isUndefined,
+    'isDefined': isDefined,
+    'isString': isString,
+    'isFunction': isFunction,
+    'isObject': isObject,
+    'isNumber': isNumber,
+    'isElement': isElement,
+    'isArray': isArray,
+    'version': version,
+    'isDate': isDate,
+    'lowercase': lowercase,
+    'uppercase': uppercase,
+    'callbacks': {counter: 0},
+    'getTestability': getTestability,
+    '$$minErr': minErr,
+    '$$csp': csp,
+    'reloadWithDebugInfo': reloadWithDebugInfo
+  });
+
+  angularModule = setupModuleLoader(window);
+
+  angularModule('ng', ['ngLocale'], ['$provide',
+    function ngModule($provide) {
+      // $$sanitizeUriProvider needs to be before $compileProvider as it is used by it.
+      $provide.provider({
+        $$sanitizeUri: $$SanitizeUriProvider
+      });
+      $provide.provider('$compile', $CompileProvider).
+        directive({
+            a: htmlAnchorDirective,
+            input: inputDirective,
+            textarea: inputDirective,
+            form: formDirective,
+            script: scriptDirective,
+            select: selectDirective,
+            style: styleDirective,
+            option: optionDirective,
+            ngBind: ngBindDirective,
+            ngBindHtml: ngBindHtmlDirective,
+            ngBindTemplate: ngBindTemplateDirective,
+            ngClass: ngClassDirective,
+            ngClassEven: ngClassEvenDirective,
+            ngClassOdd: ngClassOddDirective,
+            ngCloak: ngCloakDirective,
+            ngController: ngControllerDirective,
+            ngForm: ngFormDirective,
+            ngHide: ngHideDirective,
+            ngIf: ngIfDirective,
+            ngInclude: ngIncludeDirective,
+            ngInit: ngInitDirective,
+            ngNonBindable: ngNonBindableDirective,
+            ngPluralize: ngPluralizeDirective,
+            ngRepeat: ngRepeatDirective,
+            ngShow: ngShowDirective,
+            ngStyle: ngStyleDirective,
+            ngSwitch: ngSwitchDirective,
+            ngSwitchWhen: ngSwitchWhenDirective,
+            ngSwitchDefault: ngSwitchDefaultDirective,
+            ngOptions: ngOptionsDirective,
+            ngTransclude: ngTranscludeDirective,
+            ngModel: ngModelDirective,
+            ngList: ngListDirective,
+            ngChange: ngChangeDirective,
+            pattern: patternDirective,
+            ngPattern: patternDirective,
+            required: requiredDirective,
+            ngRequired: requiredDirective,
+            minlength: minlengthDirective,
+            ngMinlength: minlengthDirective,
+            maxlength: maxlengthDirective,
+            ngMaxlength: maxlengthDirective,
+            ngValue: ngValueDirective,
+            ngModelOptions: ngModelOptionsDirective
+        }).
+        directive({
+          ngInclude: ngIncludeFillContentDirective
+        }).
+        directive(ngAttributeAliasDirectives).
+        directive(ngEventDirectives);
+      $provide.provider({
+        $anchorScroll: $AnchorScrollProvider,
+        $animate: $AnimateProvider,
+        $animateCss: $CoreAnimateCssProvider,
+        $$animateQueue: $$CoreAnimateQueueProvider,
+        $$AnimateRunner: $$CoreAnimateRunnerProvider,
+        $browser: $BrowserProvider,
+        $cacheFactory: $CacheFactoryProvider,
+        $controller: $ControllerProvider,
+        $document: $DocumentProvider,
+        $exceptionHandler: $ExceptionHandlerProvider,
+        $filter: $FilterProvider,
+        $$forceReflow: $$ForceReflowProvider,
+        $interpolate: $InterpolateProvider,
+        $interval: $IntervalProvider,
+        $http: $HttpProvider,
+        $httpParamSerializer: $HttpParamSerializerProvider,
+        $httpParamSerializerJQLike: $HttpParamSerializerJQLikeProvider,
+        $httpBackend: $HttpBackendProvider,
+        $xhrFactory: $xhrFactoryProvider,
+        $location: $LocationProvider,
+        $log: $LogProvider,
+        $parse: $ParseProvider,
+        $rootScope: $RootScopeProvider,
+        $q: $QProvider,
+        $$q: $$QProvider,
+        $sce: $SceProvider,
+        $sceDelegate: $SceDelegateProvider,
+        $sniffer: $SnifferProvider,
+        $templateCache: $TemplateCacheProvider,
+        $templateRequest: $TemplateRequestProvider,
+        $$testability: $$TestabilityProvider,
+        $timeout: $TimeoutProvider,
+        $window: $WindowProvider,
+        $$rAF: $$RAFProvider,
+        $$jqLite: $$jqLiteProvider,
+        $$HashMap: $$HashMapProvider,
+        $$cookieReader: $$CookieReaderProvider
+      });
+    }
+  ]);
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *     Any commits to this file should be reviewed with security in mind.  *
+ *   Changes to this file can potentially create security vulnerabilities. *
+ *          An approval from 2 Core members with history of modifying      *
+ *                         this file is required.                          *
+ *                                                                         *
+ *  Does the change somehow allow for arbitrary javascript to be executed? *
+ *    Or allows for someone to change the prototype of built-in objects?   *
+ *     Or gives undesired access to variables likes document or window?    *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* global JQLitePrototype: true,
+  addEventListenerFn: true,
+  removeEventListenerFn: true,
+  BOOLEAN_ATTR: true,
+  ALIASED_ATTR: true,
+*/
+
+//////////////////////////////////
+//JQLite
+//////////////////////////////////
+
+/**
+ * @ngdoc function
+ * @name angular.element
+ * @module ng
+ * @kind function
+ *
+ * @description
+ * Wraps a raw DOM element or HTML string as a [jQuery](http://jquery.com) element.
+ *
+ * If jQuery is available, `angular.element` is an alias for the
+ * [jQuery](http://api.jquery.com/jQuery/) function. If jQuery is not available, `angular.element`
+ * delegates to Angular's built-in subset of jQuery, called "jQuery lite" or "jqLite."
+ *
+ * <div class="alert alert-success">jqLite is a tiny, API-compatible subset of jQuery that allows
+ * Angular to manipulate the DOM in a cross-browser compatible way. **jqLite** implements only the most
+ * commonly needed functionality with the goal of having a very small footprint.</div>
+ *
+ * To use `jQuery`, simply ensure it is loaded before the `angular.js` file.
+ *
+ * <div class="alert">**Note:** all element references in Angular are always wrapped with jQuery or
+ * jqLite; they are never raw DOM references.</div>
+ *
+ * ## Angular's jqLite
+ * jqLite provides only the following jQuery methods:
+ *
+ * - [`addClass()`](http://api.jquery.com/addClass/)
+ * - [`after()`](http://api.jquery.com/after/)
+ * - [`append()`](http://api.jquery.com/append/)
+ * - [`attr()`](http://api.jquery.com/attr/) - Does not support functions as parameters
+ * - [`bind()`](http://api.jquery.com/bind/) - Does not support namespaces, selectors or eventData
+ * - [`children()`](http://api.jquery.com/children/) - Does not support selectors
+ * - [`clone()`](http://api.jquery.com/clone/)
+ * - [`contents()`](http://api.jquery.com/contents/)
+ * - [`css()`](http://api.jquery.com/css/) - Only retrieves inline-styles, does not call `getComputedStyle()`. As a setter, does not convert numbers to strings or append 'px'.
+ * - [`data()`](http://api.jquery.com/data/)
+ * - [`detach()`](http://api.jquery.com/detach/)
+ * - [`empty()`](http://api.jquery.com/empty/)
+ * - [`eq()`](http://api.jquery.com/eq/)
+ * - [`find()`](http://api.jquery.com/find/) - Limited to lookups by tag name
+ * - [`hasClass()`](http://api.jquery.com/hasClass/)
+ * - [`html()`](http://api.jquery.com/html/)
+ * - [`next()`](http://api.jquery.com/next/) - Does not support selectors
+ * - [`on()`](http://api.jquery.com/on/) - Does not support namespaces, selectors or eventData
+ * - [`off()`](http://api.jquery.com/off/) - Does not support namespaces, selectors or event object as parameter
+ * - [`one()`](http://api.jquery.com/one/) - Does not support namespaces or selectors
+ * - [`parent()`](http://api.jquery.com/parent/) - Does not support selectors
+ * - [`prepend()`](http://api.jquery.com/prepend/)
+ * - [`prop()`](http://api.jquery.com/prop/)
+ * - [`ready()`](http://api.jquery.com/ready/)
+ * - [`remove()`](http://api.jquery.com/remove/)
+ * - [`removeAttr()`](http://api.jquery.com/removeAttr/)
+ * - [`removeClass()`](http://api.jquery.com/removeClass/)
+ * - [`removeData()`](http://api.jquery.com/removeData/)
+ * - [`replaceWith()`](http://api.jquery.com/replaceWith/)
+ * - [`text()`](http://api.jquery.com/text/)
+ * - [`toggleClass()`](http://api.jquery.com/toggleClass/)
+ * - [`triggerHandler()`](http://api.jquery.com/triggerHandler/) - Passes a dummy event object to handlers.
+ * - [`unbind()`](http://api.jquery.com/unbind/) - Does not support namespaces or event object as parameter
+ * - [`val()`](http://api.jquery.com/val/)
+ * - [`wrap()`](http://api.jquery.com/wrap/)
+ *
+ * ## jQuery/jqLite Extras
+ * Angular also provides the following additional methods and events to both jQuery and jqLite:
+ *
+ * ### Events
+ * - `$destroy` - AngularJS intercepts all jqLite/jQuery's DOM destruction apis and fires this event
+ *    on all DOM nodes being removed.  This can be used to clean up any 3rd party bindings to the DOM
+ *    element before it is removed.
+ *
+ * ### Methods
+ * - `controller(name)` - retrieves the controller of the current element or its parent. By default
+ *   retrieves controller associated with the `ngController` directive. If `name` is provided as
+ *   camelCase directive name, then the controller for this directive will be retrieved (e.g.
+ *   `'ngModel'`).
+ * - `injector()` - retrieves the injector of the current element or its parent.
+ * - `scope()` - retrieves the {@link ng.$rootScope.Scope scope} of the current
+ *   element or its parent. Requires {@link guide/production#disabling-debug-data Debug Data} to
+ *   be enabled.
+ * - `isolateScope()` - retrieves an isolate {@link ng.$rootScope.Scope scope} if one is attached directly to the
+ *   current element. This getter should be used only on elements that contain a directive which starts a new isolate
+ *   scope. Calling `scope()` on this element always returns the original non-isolate scope.
+ *   Requires {@link guide/production#disabling-debug-data Debug Data} to be enabled.
+ * - `inheritedData()` - same as `data()`, but walks up the DOM until a value is found or the top
+ *   parent element is reached.
+ *
+ * @param {string|DOMElement} element HTML string or DOMElement to be wrapped into jQuery.
+ * @returns {Object} jQuery object.
+ */
+
+JQLite.expando = 'ng339';
+
+var jqCache = JQLite.cache = {},
+    jqId = 1,
+    addEventListenerFn = function(element, type, fn) {
+      element.addEventListener(type, fn, false);
+    },
+    removeEventListenerFn = function(element, type, fn) {
+      element.removeEventListener(type, fn, false);
+    };
+
+/*
+ * !!! This is an undocumented "private" function !!!
+ */
+JQLite._data = function(node) {
+  //jQuery always returns an object on cache miss
+  return this.cache[node[this.expando]] || {};
+};
+
+function jqNextId() { return ++jqId; }
+
+
+var SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
+var MOZ_HACK_REGEXP = /^moz([A-Z])/;
+var MOUSE_EVENT_MAP= { mouseleave: "mouseout", mouseenter: "mouseover"};
+var jqLiteMinErr = minErr('jqLite');
+
+/**
+ * Converts snake_case to camelCase.
+ * Also there is special case for Moz prefix starting with upper case letter.
+ * @param name Name to normalize
+ */
+function camelCase(name) {
+  return name.
+    replace(SPECIAL_CHARS_REGEXP, function(_, separator, letter, offset) {
+      return offset ? letter.toUpperCase() : letter;
+    }).
+    replace(MOZ_HACK_REGEXP, 'Moz$1');
+}
+
+var SINGLE_TAG_REGEXP = /^<([\w-]+)\s*\/?>(?:<\/\1>|)$/;
+var HTML_REGEXP = /<|&#?\w+;/;
+var TAG_NAME_REGEXP = /<([\w:-]+)/;
+var XHTML_TAG_REGEXP = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi;
+
+var wrapMap = {
+  '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, "", ""]
+};
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+
+function jqLiteIsTextNode(html) {
+  return !HTML_REGEXP.test(html);
+}
+
+function jqLiteAcceptsData(node) {
+  // The window object can accept data but has no nodeType
+  // Otherwise we are only interested in elements (1) and documents (9)
+  var nodeType = node.nodeType;
+  return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;
+}
+
+function jqLiteHasData(node) {
+  for (var key in jqCache[node.ng339]) {
+    return true;
+  }
+  return false;
+}
+
+function jqLiteBuildFragment(html, context) {
+  var tmp, tag, wrap,
+      fragment = context.createDocumentFragment(),
+      nodes = [], i;
+
+  if (jqLiteIsTextNode(html)) {
+    // Convert non-html into a text node
+    nodes.push(context.createTextNode(html));
+  } else {
+    // Convert html into DOM nodes
+    tmp = tmp || fragment.appendChild(context.createElement("div"));
+    tag = (TAG_NAME_REGEXP.exec(html) || ["", ""])[1].toLowerCase();
+    wrap = wrapMap[tag] || wrapMap._default;
+    tmp.innerHTML = wrap[1] + html.replace(XHTML_TAG_REGEXP, "<$1></$2>") + wrap[2];
+
+    // Descend through wrappers to the right content
+    i = wrap[0];
+    while (i--) {
+      tmp = tmp.lastChild;
+    }
+
+    nodes = concat(nodes, tmp.childNodes);
+
+    tmp = fragment.firstChild;
+    tmp.textContent = "";
+  }
+
+  // Remove wrapper from fragment
+  fragment.textContent = "";
+  fragment.innerHTML = ""; // Clear inner HTML
+  forEach(nodes, function(node) {
+    fragment.appendChild(node);
+  });
+
+  return fragment;
+}
+
+function jqLiteParseHTML(html, context) {
+  context = context || document;
+  var parsed;
+
+  if ((parsed = SINGLE_TAG_REGEXP.exec(html))) {
+    return [context.createElement(parsed[1])];
+  }
+
+  if ((parsed = jqLiteBuildFragment(html, context))) {
+    return parsed.childNodes;
+  }
+
+  return [];
+}
+
+/////////////////////////////////////////////
+function JQLite(element) {
+  if (element instanceof JQLite) {
+    return element;
+  }
+
+  var argIsString;
+
+  if (isString(element)) {
+    element = trim(element);
+    argIsString = true;
+  }
+  if (!(this instanceof JQLite)) {
+    if (argIsString && element.charAt(0) != '<') {
+      throw jqLiteMinErr('nosel', 'Looking up elements via selectors is not supported by jqLite! See: http://docs.angularjs.org/api/angular.element');
+    }
+    return new JQLite(element);
+  }
+
+  if (argIsString) {
+    jqLiteAddNodes(this, jqLiteParseHTML(element));
+  } else {
+    jqLiteAddNodes(this, element);
+  }
+}
+
+function jqLiteClone(element) {
+  return element.cloneNode(true);
+}
+
+function jqLiteDealoc(element, onlyDescendants) {
+  if (!onlyDescendants) jqLiteRemoveData(element);
+
+  if (element.querySelectorAll) {
+    var descendants = element.querySelectorAll('*');
+    for (var i = 0, l = descendants.length; i < l; i++) {
+      jqLiteRemoveData(descendants[i]);
+    }
+  }
+}
+
+function jqLiteOff(element, type, fn, unsupported) {
+  if (isDefined(unsupported)) throw jqLiteMinErr('offargs', 'jqLite#off() does not support the `selector` argument');
+
+  var expandoStore = jqLiteExpandoStore(element);
+  var events = expandoStore && expandoStore.events;
+  var handle = expandoStore && expandoStore.handle;
+
+  if (!handle) return; //no listeners registered
+
+  if (!type) {
+    for (type in events) {
+      if (type !== '$destroy') {
+        removeEventListenerFn(element, type, handle);
+      }
+      delete events[type];
+    }
+  } else {
+    forEach(type.split(' '), function(type) {
+      if (isDefined(fn)) {
+        var listenerFns = events[type];
+        arrayRemove(listenerFns || [], fn);
+        if (listenerFns && listenerFns.length > 0) {
+          return;
+        }
+      }
+
+      removeEventListenerFn(element, type, handle);
+      delete events[type];
+    });
+  }
+}
+
+function jqLiteRemoveData(element, name) {
+  var expandoId = element.ng339;
+  var expandoStore = expandoId && jqCache[expandoId];
+
+  if (expandoStore) {
+    if (name) {
+      delete expandoStore.data[name];
+      return;
+    }
+
+    if (expandoStore.handle) {
+      if (expandoStore.events.$destroy) {
+        expandoStore.handle({}, '$destroy');
+      }
+      jqLiteOff(element);
+    }
+    delete jqCache[expandoId];
+    element.ng339 = undefined; // don't delete DOM expandos. IE and Chrome don't like it
+  }
+}
+
+
+function jqLiteExpandoStore(element, createIfNecessary) {
+  var expandoId = element.ng339,
+      expandoStore = expandoId && jqCache[expandoId];
+
+  if (createIfNecessary && !expandoStore) {
+    element.ng339 = expandoId = jqNextId();
+    expandoStore = jqCache[expandoId] = {events: {}, data: {}, handle: undefined};
+  }
+
+  return expandoStore;
+}
+
+
+function jqLiteData(element, key, value) {
+  if (jqLiteAcceptsData(element)) {
+
+    var isSimpleSetter = isDefined(value);
+    var isSimpleGetter = !isSimpleSetter && key && !isObject(key);
+    var massGetter = !key;
+    var expandoStore = jqLiteExpandoStore(element, !isSimpleGetter);
+    var data = expandoStore && expandoStore.data;
+
+    if (isSimpleSetter) { // data('key', value)
+      data[key] = value;
+    } else {
+      if (massGetter) {  // data()
+        return data;
+      } else {
+        if (isSimpleGetter) { // data('key')
+          // don't force creation of expandoStore if it doesn't exist yet
+          return data && data[key];
+        } else { // mass-setter: data({key1: val1, key2: val2})
+          extend(data, key);
+        }
+      }
+    }
+  }
+}
+
+function jqLiteHasClass(element, selector) {
+  if (!element.getAttribute) return false;
+  return ((" " + (element.getAttribute('class') || '') + " ").replace(/[\n\t]/g, " ").
+      indexOf(" " + selector + " ") > -1);
+}
+
+function jqLiteRemoveClass(element, cssClasses) {
+  if (cssClasses && element.setAttribute) {
+    forEach(cssClasses.split(' '), function(cssClass) {
+      element.setAttribute('class', trim(
+          (" " + (element.getAttribute('class') || '') + " ")
+          .replace(/[\n\t]/g, " ")
+          .replace(" " + trim(cssClass) + " ", " "))
+      );
+    });
+  }
+}
+
+function jqLiteAddClass(element, cssClasses) {
+  if (cssClasses && element.setAttribute) {
+    var existingClasses = (' ' + (element.getAttribute('class') || '') + ' ')
+                            .replace(/[\n\t]/g, " ");
+
+    forEach(cssClasses.split(' '), function(cssClass) {
+      cssClass = trim(cssClass);
+      if (existingClasses.indexOf(' ' + cssClass + ' ') === -1) {
+        existingClasses += cssClass + ' ';
+      }
+    });
+
+    element.setAttribute('class', trim(existingClasses));
+  }
+}
+
+
+function jqLiteAddNodes(root, elements) {
+  // THIS CODE IS VERY HOT. Don't make changes without benchmarking.
+
+  if (elements) {
+
+    // if a Node (the most common case)
+    if (elements.nodeType) {
+      root[root.length++] = elements;
+    } else {
+      var length = elements.length;
+
+      // if an Array or NodeList and not a Window
+      if (typeof length === 'number' && elements.window !== elements) {
+        if (length) {
+          for (var i = 0; i < length; i++) {
+            root[root.length++] = elements[i];
+          }
+        }
+      } else {
+        root[root.length++] = elements;
+      }
+    }
+  }
+}
+
+
+function jqLiteController(element, name) {
+  return jqLiteInheritedData(element, '$' + (name || 'ngController') + 'Controller');
+}
+
+function jqLiteInheritedData(element, name, value) {
+  // if element is the document object work with the html element instead
+  // this makes $(document).scope() possible
+  if (element.nodeType == NODE_TYPE_DOCUMENT) {
+    element = element.documentElement;
+  }
+  var names = isArray(name) ? name : [name];
+
+  while (element) {
+    for (var i = 0, ii = names.length; i < ii; i++) {
+      if (isDefined(value = jqLite.data(element, names[i]))) return value;
+    }
+
+    // If dealing with a document fragment node with a host element, and no parent, use the host
+    // element as the parent. This enables directives within a Shadow DOM or polyfilled Shadow DOM
+    // to lookup parent controllers.
+    element = element.parentNode || (element.nodeType === NODE_TYPE_DOCUMENT_FRAGMENT && element.host);
+  }
+}
+
+function jqLiteEmpty(element) {
+  jqLiteDealoc(element, true);
+  while (element.firstChild) {
+    element.removeChild(element.firstChild);
+  }
+}
+
+function jqLiteRemove(element, keepData) {
+  if (!keepData) jqLiteDealoc(element);
+  var parent = element.parentNode;
+  if (parent) parent.removeChild(element);
+}
+
+
+function jqLiteDocumentLoaded(action, win) {
+  win = win || window;
+  if (win.document.readyState === 'complete') {
+    // Force the action to be run async for consistent behaviour
+    // from the action's point of view
+    // i.e. it will definitely not be in a $apply
+    win.setTimeout(action);
+  } else {
+    // No need to unbind this handler as load is only ever called once
+    jqLite(win).on('load', action);
+  }
+}
+
+//////////////////////////////////////////
+// Functions which are declared directly.
+//////////////////////////////////////////
+var JQLitePrototype = JQLite.prototype = {
+  ready: function(fn) {
+    var fired = false;
+
+    function trigger() {
+      if (fired) return;
+      fired = true;
+      fn();
+    }
+
+    // check if document is already loaded
+    if (document.readyState === 'complete') {
+      setTimeout(trigger);
+    } else {
+      this.on('DOMContentLoaded', trigger); // works for modern browsers and IE9
+      // we can not use jqLite since we are not done loading and jQuery could be loaded later.
+      // jshint -W064
+      JQLite(window).on('load', trigger); // fallback to window.onload for others
+      // jshint +W064
+    }
+  },
+  toString: function() {
+    var value = [];
+    forEach(this, function(e) { value.push('' + e);});
+    return '[' + value.join(', ') + ']';
+  },
+
+  eq: function(index) {
+      return (index >= 0) ? jqLite(this[index]) : jqLite(this[this.length + index]);
+  },
+
+  length: 0,
+  push: push,
+  sort: [].sort,
+  splice: [].splice
+};
+
+//////////////////////////////////////////
+// Functions iterating getter/setters.
+// these functions return self on setter and
+// value on get.
+//////////////////////////////////////////
+var BOOLEAN_ATTR = {};
+forEach('multiple,selected,checked,disabled,readOnly,required,open'.split(','), function(value) {
+  BOOLEAN_ATTR[lowercase(value)] = value;
+});
+var BOOLEAN_ELEMENTS = {};
+forEach('input,select,option,textarea,button,form,details'.split(','), function(value) {
+  BOOLEAN_ELEMENTS[value] = true;
+});
+var ALIASED_ATTR = {
+  'ngMinlength': 'minlength',
+  'ngMaxlength': 'maxlength',
+  'ngMin': 'min',
+  'ngMax': 'max',
+  'ngPattern': 'pattern'
+};
+
+function getBooleanAttrName(element, name) {
+  // check dom last since we will most likely fail on name
+  var booleanAttr = BOOLEAN_ATTR[name.toLowerCase()];
+
+  // booleanAttr is here twice to minimize DOM access
+  return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;
+}
+
+function getAliasedAttrName(name) {
+  return ALIASED_ATTR[name];
+}
+
+forEach({
+  data: jqLiteData,
+  removeData: jqLiteRemoveData,
+  hasData: jqLiteHasData
+}, function(fn, name) {
+  JQLite[name] = fn;
+});
+
+forEach({
+  data: jqLiteData,
+  inheritedData: jqLiteInheritedData,
+
+  scope: function(element) {
+    // Can't use jqLiteData here directly so we stay compatible with jQuery!
+    return jqLite.data(element, '$scope') || jqLiteInheritedData(element.parentNode || element, ['$isolateScope', '$scope']);
+  },
+
+  isolateScope: function(element) {
+    // Can't use jqLiteData here directly so we stay compatible with jQuery!
+    return jqLite.data(element, '$isolateScope') || jqLite.data(element, '$isolateScopeNoTemplate');
+  },
+
+  controller: jqLiteController,
+
+  injector: function(element) {
+    return jqLiteInheritedData(element, '$injector');
+  },
+
+  removeAttr: function(element, name) {
+    element.removeAttribute(name);
+  },
+
+  hasClass: jqLiteHasClass,
+
+  css: function(element, name, value) {
+    name = camelCase(name);
+
+    if (isDefined(value)) {
+      element.style[name] = value;
+    } else {
+      return element.style[name];
+    }
+  },
+
+  attr: function(element, name, value) {
+    var nodeType = element.nodeType;
+    if (nodeType === NODE_TYPE_TEXT || nodeType === NODE_TYPE_ATTRIBUTE || nodeType === NODE_TYPE_COMMENT) {
+      return;
+    }
+    var lowercasedName = lowercase(name);
+    if (BOOLEAN_ATTR[lowercasedName]) {
+      if (isDefined(value)) {
+        if (!!value) {
+          element[name] = true;
+          element.setAttribute(name, lowercasedName);
+        } else {
+          element[name] = false;
+          element.removeAttribute(lowercasedName);
+        }
+      } else {
+        return (element[name] ||
+                 (element.attributes.getNamedItem(name) || noop).specified)
+               ? lowercasedName
+               : undefined;
+      }
+    } else if (isDefined(value)) {
+      element.setAttribute(name, value);
+    } else if (element.getAttribute) {
+      // the extra argument "2" is to get the right thing for a.href in IE, see jQuery code
+      // some elements (e.g. Document) don't have get attribute, so return undefined
+      var ret = element.getAttribute(name, 2);
+      // normalize non-existing attributes to undefined (as jQuery)
+      return ret === null ? undefined : ret;
+    }
+  },
+
+  prop: function(element, name, value) {
+    if (isDefined(value)) {
+      element[name] = value;
+    } else {
+      return element[name];
+    }
+  },
+
+  text: (function() {
+    getText.$dv = '';
+    return getText;
+
+    function getText(element, value) {
+      if (isUndefined(value)) {
+        var nodeType = element.nodeType;
+        return (nodeType === NODE_TYPE_ELEMENT || nodeType === NODE_TYPE_TEXT) ? element.textContent : '';
+      }
+      element.textContent = value;
+    }
+  })(),
+
+  val: function(element, value) {
+    if (isUndefined(value)) {
+      if (element.multiple && nodeName_(element) === 'select') {
+        var result = [];
+        forEach(element.options, function(option) {
+          if (option.selected) {
+            result.push(option.value || option.text);
+          }
+        });
+        return result.length === 0 ? null : result;
+      }
+      return element.value;
+    }
+    element.value = value;
+  },
+
+  html: function(element, value) {
+    if (isUndefined(value)) {
+      return element.innerHTML;
+    }
+    jqLiteDealoc(element, true);
+    element.innerHTML = value;
+  },
+
+  empty: jqLiteEmpty
+}, function(fn, name) {
+  /**
+   * Properties: writes return selection, reads return first value
+   */
+  JQLite.prototype[name] = function(arg1, arg2) {
+    var i, key;
+    var nodeCount = this.length;
+
+    // jqLiteHasClass has only two arguments, but is a getter-only fn, so we need to special-case it
+    // in a way that survives minification.
+    // jqLiteEmpty takes no arguments but is a setter.
+    if (fn !== jqLiteEmpty &&
+        (isUndefined((fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)) ? arg1 : arg2))) {
+      if (isObject(arg1)) {
+
+        // we are a write, but the object properties are the key/values
+        for (i = 0; i < nodeCount; i++) {
+          if (fn === jqLiteData) {
+            // data() takes the whole object in jQuery
+            fn(this[i], arg1);
+          } else {
+            for (key in arg1) {
+              fn(this[i], key, arg1[key]);
+            }
+          }
+        }
+        // return self for chaining
+        return this;
+      } else {
+        // we are a read, so read the first child.
+        // TODO: do we still need this?
+        var value = fn.$dv;
+        // Only if we have $dv do we iterate over all, otherwise it is just the first element.
+        var jj = (isUndefined(value)) ? Math.min(nodeCount, 1) : nodeCount;
+        for (var j = 0; j < jj; j++) {
+          var nodeValue = fn(this[j], arg1, arg2);
+          value = value ? value + nodeValue : nodeValue;
+        }
+        return value;
+      }
+    } else {
+      // we are a write, so apply to all children
+      for (i = 0; i < nodeCount; i++) {
+        fn(this[i], arg1, arg2);
+      }
+      // return self for chaining
+      return this;
+    }
+  };
+});
+
+function createEventHandler(element, events) {
+  var eventHandler = function(event, type) {
+    // jQuery specific api
+    event.isDefaultPrevented = function() {
+      return event.defaultPrevented;
+    };
+
+    var eventFns = events[type || event.type];
+    var eventFnsLength = eventFns ? eventFns.length : 0;
+
+    if (!eventFnsLength) return;
+
+    if (isUndefined(event.immediatePropagationStopped)) {
+      var originalStopImmediatePropagation = event.stopImmediatePropagation;
+      event.stopImmediatePropagation = function() {
+        event.immediatePropagationStopped = true;
+
+        if (event.stopPropagation) {
+          event.stopPropagation();
+        }
+
+        if (originalStopImmediatePropagation) {
+          originalStopImmediatePropagation.call(event);
+        }
+      };
+    }
+
+    event.isImmediatePropagationStopped = function() {
+      return event.immediatePropagationStopped === true;
+    };
+
+    // Copy event handlers in case event handlers array is modified during execution.
+    if ((eventFnsLength > 1)) {
+      eventFns = shallowCopy(eventFns);
+    }
+
+    for (var i = 0; i < eventFnsLength; i++) {
+      if (!event.isImmediatePropagationStopped()) {
+        eventFns[i].call(element, event);
+      }
+    }
+  };
+
+  // TODO: this is a hack for angularMocks/clearDataCache that makes it possible to deregister all
+  //       events on `element`
+  eventHandler.elem = element;
+  return eventHandler;
+}
+
+//////////////////////////////////////////
+// Functions iterating traversal.
+// These functions chain results into a single
+// selector.
+//////////////////////////////////////////
+forEach({
+  removeData: jqLiteRemoveData,
+
+  on: function jqLiteOn(element, type, fn, unsupported) {
+    if (isDefined(unsupported)) throw jqLiteMinErr('onargs', 'jqLite#on() does not support the `selector` or `eventData` parameters');
+
+    // Do not add event handlers to non-elements because they will not be cleaned up.
+    if (!jqLiteAcceptsData(element)) {
+      return;
+    }
+
+    var expandoStore = jqLiteExpandoStore(element, true);
+    var events = expandoStore.events;
+    var handle = expandoStore.handle;
+
+    if (!handle) {
+      handle = expandoStore.handle = createEventHandler(element, events);
+    }
+
+    // http://jsperf.com/string-indexof-vs-split
+    var types = type.indexOf(' ') >= 0 ? type.split(' ') : [type];
+    var i = types.length;
+
+    while (i--) {
+      type = types[i];
+      var eventFns = events[type];
+
+      if (!eventFns) {
+        events[type] = [];
+
+        if (type === 'mouseenter' || type === 'mouseleave') {
+          // Refer to jQuery's implementation of mouseenter & mouseleave
+          // Read about mouseenter and mouseleave:
+          // http://www.quirksmode.org/js/events_mouse.html#link8
+
+          jqLiteOn(element, MOUSE_EVENT_MAP[type], function(event) {
+            var target = this, related = event.relatedTarget;
+            // For mousenter/leave call the handler if related is outside the target.
+            // NB: No relatedTarget if the mouse left/entered the browser window
+            if (!related || (related !== target && !target.contains(related))) {
+              handle(event, type);
+            }
+          });
+
+        } else {
+          if (type !== '$destroy') {
+            addEventListenerFn(element, type, handle);
+          }
+        }
+        eventFns = events[type];
+      }
+      eventFns.push(fn);
+    }
+  },
+
+  off: jqLiteOff,
+
+  one: function(element, type, fn) {
+    element = jqLite(element);
+
+    //add the listener twice so that when it is called
+    //you can remove the original function and still be
+    //able to call element.off(ev, fn) normally
+    element.on(type, function onFn() {
+      element.off(type, fn);
+      element.off(type, onFn);
+    });
+    element.on(type, fn);
+  },
+
+  replaceWith: function(element, replaceNode) {
+    var index, parent = element.parentNode;
+    jqLiteDealoc(element);
+    forEach(new JQLite(replaceNode), function(node) {
+      if (index) {
+        parent.insertBefore(node, index.nextSibling);
+      } else {
+        parent.replaceChild(node, element);
+      }
+      index = node;
+    });
+  },
+
+  children: function(element) {
+    var children = [];
+    forEach(element.childNodes, function(element) {
+      if (element.nodeType === NODE_TYPE_ELEMENT) {
+        children.push(element);
+      }
+    });
+    return children;
+  },
+
+  contents: function(element) {
+    return element.contentDocument || element.childNodes || [];
+  },
+
+  append: function(element, node) {
+    var nodeType = element.nodeType;
+    if (nodeType !== NODE_TYPE_ELEMENT && nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT) return;
+
+    node = new JQLite(node);
+
+    for (var i = 0, ii = node.length; i < ii; i++) {
+      var child = node[i];
+      element.appendChild(child);
+    }
+  },
+
+  prepend: function(element, node) {
+    if (element.nodeType === NODE_TYPE_ELEMENT) {
+      var index = element.firstChild;
+      forEach(new JQLite(node), function(child) {
+        element.insertBefore(child, index);
+      });
+    }
+  },
+
+  wrap: function(element, wrapNode) {
+    wrapNode = jqLite(wrapNode).eq(0).clone()[0];
+    var parent = element.parentNode;
+    if (parent) {
+      parent.replaceChild(wrapNode, element);
+    }
+    wrapNode.appendChild(element);
+  },
+
+  remove: jqLiteRemove,
+
+  detach: function(element) {
+    jqLiteRemove(element, true);
+  },
+
+  after: function(element, newElement) {
+    var index = element, parent = element.parentNode;
+    newElement = new JQLite(newElement);
+
+    for (var i = 0, ii = newElement.length; i < ii; i++) {
+      var node = newElement[i];
+      parent.insertBefore(node, index.nextSibling);
+      index = node;
+    }
+  },
+
+  addClass: jqLiteAddClass,
+  removeClass: jqLiteRemoveClass,
+
+  toggleClass: function(element, selector, condition) {
+    if (selector) {
+      forEach(selector.split(' '), function(className) {
+        var classCondition = condition;
+        if (isUndefined(classCondition)) {
+          classCondition = !jqLiteHasClass(element, className);
+        }
+        (classCondition ? jqLiteAddClass : jqLiteRemoveClass)(element, className);
+      });
+    }
+  },
+
+  parent: function(element) {
+    var parent = element.parentNode;
+    return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT ? parent : null;
+  },
+
+  next: function(element) {
+    return element.nextElementSibling;
+  },
+
+  find: function(element, selector) {
+    if (element.getElementsByTagName) {
+      return element.getElementsByTagName(selector);
+    } else {
+      return [];
+    }
+  },
+
+  clone: jqLiteClone,
+
+  triggerHandler: function(element, event, extraParameters) {
+
+    var dummyEvent, eventFnsCopy, handlerArgs;
+    var eventName = event.type || event;
+    var expandoStore = jqLiteExpandoStore(element);
+    var events = expandoStore && expandoStore.events;
+    var eventFns = events && events[eventName];
+
+    if (eventFns) {
+      // Create a dummy event to pass to the handlers
+      dummyEvent = {
+        preventDefault: function() { this.defaultPrevented = true; },
+        isDefaultPrevented: function() { return this.defaultPrevented === true; },
+        stopImmediatePropagation: function() { this.immediatePropagationStopped = true; },
+        isImmediatePropagationStopped: function() { return this.immediatePropagationStopped === true; },
+        stopPropagation: noop,
+        type: eventName,
+        target: element
+      };
+
+      // If a custom event was provided then extend our dummy event with it
+      if (event.type) {
+        dummyEvent = extend(dummyEvent, event);
+      }
+
+      // Copy event handlers in case event handlers array is modified during execution.
+      eventFnsCopy = shallowCopy(eventFns);
+      handlerArgs = extraParameters ? [dummyEvent].concat(extraParameters) : [dummyEvent];
+
+      forEach(eventFnsCopy, function(fn) {
+        if (!dummyEvent.isImmediatePropagationStopped()) {
+          fn.apply(element, handlerArgs);
+        }
+      });
+    }
+  }
+}, function(fn, name) {
+  /**
+   * chaining functions
+   */
+  JQLite.prototype[name] = function(arg1, arg2, arg3) {
+    var value;
+
+    for (var i = 0, ii = this.length; i < ii; i++) {
+      if (isUndefined(value)) {
+        value = fn(this[i], arg1, arg2, arg3);
+        if (isDefined(value)) {
+          // any function which returns a value needs to be wrapped
+          value = jqLite(value);
+        }
+      } else {
+        jqLiteAddNodes(value, fn(this[i], arg1, arg2, arg3));
+      }
+    }
+    return isDefined(value) ? value : this;
+  };
+
+  // bind legacy bind/unbind to on/off
+  JQLite.prototype.bind = JQLite.prototype.on;
+  JQLite.prototype.unbind = JQLite.prototype.off;
+});
+
+
+// Provider for private $$jqLite service
+function $$jqLiteProvider() {
+  this.$get = function $$jqLite() {
+    return extend(JQLite, {
+      hasClass: function(node, classes) {
+        if (node.attr) node = node[0];
+        return jqLiteHasClass(node, classes);
+      },
+      addClass: function(node, classes) {
+        if (node.attr) node = node[0];
+        return jqLiteAddClass(node, classes);
+      },
+      removeClass: function(node, classes) {
+        if (node.attr) node = node[0];
+        return jqLiteRemoveClass(node, classes);
+      }
+    });
+  };
+}
+
+/**
+ * Computes a hash of an 'obj'.
+ * Hash of a:
+ *  string is string
+ *  number is number as string
+ *  object is either result of calling $$hashKey function on the object or uniquely generated id,
+ *         that is also assigned to the $$hashKey property of the object.
+ *
+ * @param obj
+ * @returns {string} hash string such that the same input will have the same hash string.
+ *         The resulting string key is in 'type:hashKey' format.
+ */
+function hashKey(obj, nextUidFn) {
+  var key = obj && obj.$$hashKey;
+
+  if (key) {
+    if (typeof key === 'function') {
+      key = obj.$$hashKey();
+    }
+    return key;
+  }
+
+  var objType = typeof obj;
+  if (objType == 'function' || (objType == 'object' && obj !== null)) {
+    key = obj.$$hashKey = objType + ':' + (nextUidFn || nextUid)();
+  } else {
+    key = objType + ':' + obj;
+  }
+
+  return key;
+}
+
+/**
+ * HashMap which can use objects as keys
+ */
+function HashMap(array, isolatedUid) {
+  if (isolatedUid) {
+    var uid = 0;
+    this.nextUid = function() {
+      return ++uid;
+    };
+  }
+  forEach(array, this.put, this);
+}
+HashMap.prototype = {
+  /**
+   * Store key value pair
+   * @param key key to store can be any type
+   * @param value value to store can be any type
+   */
+  put: function(key, value) {
+    this[hashKey(key, this.nextUid)] = value;
+  },
+
+  /**
+   * @param key
+   * @returns {Object} the value for the key
+   */
+  get: function(key) {
+    return this[hashKey(key, this.nextUid)];
+  },
+
+  /**
+   * Remove the key/value pair
+   * @param key
+   */
+  remove: function(key) {
+    var value = this[key = hashKey(key, this.nextUid)];
+    delete this[key];
+    return value;
+  }
+};
+
+var $$HashMapProvider = [function() {
+  this.$get = [function() {
+    return HashMap;
+  }];
+}];
+
+/**
+ * @ngdoc function
+ * @module ng
+ * @name angular.injector
+ * @kind function
+ *
+ * @description
+ * Creates an injector object that can be used for retrieving services as well as for
+ * dependency injection (see {@link guide/di dependency injection}).
+ *
+ * @param {Array.<string|Function>} modules A list of module functions or their aliases. See
+ *     {@link angular.module}. The `ng` module must be explicitly added.
+ * @param {boolean=} [strictDi=false] Whether the injector should be in strict mode, which
+ *     disallows argument name annotation inference.
+ * @returns {injector} Injector object. See {@link auto.$injector $injector}.
+ *
+ * @example
+ * Typical usage
+ * ```js
+ *   // create an injector
+ *   var $injector = angular.injector(['ng']);
+ *
+ *   // use the injector to kick off your application
+ *   // use the type inference to auto inject arguments, or use implicit injection
+ *   $injector.invoke(function($rootScope, $compile, $document) {
+ *     $compile($document)($rootScope);
+ *     $rootScope.$digest();
+ *   });
+ * ```
+ *
+ * Sometimes you want to get access to the injector of a currently running Angular app
+ * from outside Angular. Perhaps, you want to inject and compile some markup after the
+ * application has been bootstrapped. You can do this using the extra `injector()` added
+ * to JQuery/jqLite elements. See {@link angular.element}.
+ *
+ * *This is fairly rare but could be the case if a third party library is injecting the
+ * markup.*
+ *
+ * In the following example a new block of HTML containing a `ng-controller`
+ * directive is added to the end of the document body by JQuery. We then compile and link
+ * it into the current AngularJS scope.
+ *
+ * ```js
+ * var $div = $('<div ng-controller="MyCtrl">{{content.label}}</div>');
+ * $(document.body).append($div);
+ *
+ * angular.element(document).injector().invoke(function($compile) {
+ *   var scope = angular.element($div).scope();
+ *   $compile($div)(scope);
+ * });
+ * ```
+ */
+
+
+/**
+ * @ngdoc module
+ * @name auto
+ * @description
+ *
+ * Implicit module which gets automatically added to each {@link auto.$injector $injector}.
+ */
+
+var FN_ARGS = /^[^\(]*\(\s*([^\)]*)\)/m;
+var FN_ARG_SPLIT = /,/;
+var FN_ARG = /^\s*(_?)(\S+?)\1\s*$/;
+var STRIP_COMMENTS = /((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg;
+var $injectorMinErr = minErr('$injector');
+
+function anonFn(fn) {
+  // For anonymous functions, showing at the very least the function signature can help in
+  // debugging.
+  var fnText = fn.toString().replace(STRIP_COMMENTS, ''),
+      args = fnText.match(FN_ARGS);
+  if (args) {
+    return 'function(' + (args[1] || '').replace(/[\s\r\n]+/, ' ') + ')';
+  }
+  return 'fn';
+}
+
+function annotate(fn, strictDi, name) {
+  var $inject,
+      fnText,
+      argDecl,
+      last;
+
+  if (typeof fn === 'function') {
+    if (!($inject = fn.$inject)) {
+      $inject = [];
+      if (fn.length) {
+        if (strictDi) {
+          if (!isString(name) || !name) {
+            name = fn.name || anonFn(fn);
+          }
+          throw $injectorMinErr('strictdi',
+            '{0} is not using explicit annotation and cannot be invoked in strict mode', name);
+        }
+        fnText = fn.toString().replace(STRIP_COMMENTS, '');
+        argDecl = fnText.match(FN_ARGS);
+        forEach(argDecl[1].split(FN_ARG_SPLIT), function(arg) {
+          arg.replace(FN_ARG, function(all, underscore, name) {
+            $inject.push(name);
+          });
+        });
+      }
+      fn.$inject = $inject;
+    }
+  } else if (isArray(fn)) {
+    last = fn.length - 1;
+    assertArgFn(fn[last], 'fn');
+    $inject = fn.slice(0, last);
+  } else {
+    assertArgFn(fn, 'fn', true);
+  }
+  return $inject;
+}
+
+///////////////////////////////////////
+
+/**
+ * @ngdoc service
+ * @name $injector
+ *
+ * @description
+ *
+ * `$injector` is used to retrieve object instances as defined by
+ * {@link auto.$provide provider}, instantiate types, invoke methods,
+ * and load modules.
+ *
+ * The following always holds true:
+ *
+ * ```js
+ *   var $injector = angular.injector();
+ *   expect($injector.get('$injector')).toBe($injector);
+ *   expect($injector.invoke(function($injector) {
+ *     return $injector;
+ *   })).toBe($injector);
+ * ```
+ *
+ * # Injection Function Annotation
+ *
+ * JavaScript does not have annotations, and annotations are needed for dependency injection. The
+ * following are all valid ways of annotating function with injection arguments and are equivalent.
+ *
+ * ```js
+ *   // inferred (only works if code not minified/obfuscated)
+ *   $injector.invoke(function(serviceA){});
+ *
+ *   // annotated
+ *   function explicit(serviceA) {};
+ *   explicit.$inject = ['serviceA'];
+ *   $injector.invoke(explicit);
+ *
+ *   // inline
+ *   $injector.invoke(['serviceA', function(serviceA){}]);
+ * ```
+ *
+ * ## Inference
+ *
+ * In JavaScript calling `toString()` on a function returns the function definition. The definition
+ * can then be parsed and the function arguments can be extracted. This method of discovering
+ * annotations is disallowed when the injector is in strict mode.
+ * *NOTE:* This does not work with minification, and obfuscation tools since these tools change the
+ * argument names.
+ *
+ * ## `$inject` Annotation
+ * By adding an `$inject` property onto a function the injection parameters can be specified.
+ *
+ * ## Inline
+ * As an array of injection names, where the last item in the array is the function to call.
+ */
+
+/**
+ * @ngdoc method
+ * @name $injector#get
+ *
+ * @description
+ * Return an instance of the service.
+ *
+ * @param {string} name The name of the instance to retrieve.
+ * @param {string=} caller An optional string to provide the origin of the function call for error messages.
+ * @return {*} The instance.
+ */
+
+/**
+ * @ngdoc method
+ * @name $injector#invoke
+ *
+ * @description
+ * Invoke the method and supply the method arguments from the `$injector`.
+ *
+ * @param {Function|Array.<string|Function>} fn The injectable function to invoke. Function parameters are
+ *   injected according to the {@link guide/di $inject Annotation} rules.
+ * @param {Object=} self The `this` for the invoked method.
+ * @param {Object=} locals Optional object. If preset then any argument names are read from this
+ *                         object first, before the `$injector` is consulted.
+ * @returns {*} the value returned by the invoked `fn` function.
+ */
+
+/**
+ * @ngdoc method
+ * @name $injector#has
+ *
+ * @description
+ * Allows the user to query if the particular service exists.
+ *
+ * @param {string} name Name of the service to query.
+ * @returns {boolean} `true` if injector has given service.
+ */
+
+/**
+ * @ngdoc method
+ * @name $injector#instantiate
+ * @description
+ * Create a new instance of JS type. The method takes a constructor function, invokes the new
+ * operator, and supplies all of the arguments to the constructor function as specified by the
+ * constructor annotation.
+ *
+ * @param {Function} Type Annotated constructor function.
+ * @param {Object=} locals Optional object. If preset then any argument names are read from this
+ * object first, before the `$injector` is consulted.
+ * @returns {Object} new instance of `Type`.
+ */
+
+/**
+ * @ngdoc method
+ * @name $injector#annotate
+ *
+ * @description
+ * Returns an array of service names which the function is requesting for injection. This API is
+ * used by the injector to determine which services need to be injected into the function when the
+ * function is invoked. There are three ways in which the function can be annotated with the needed
+ * dependencies.
+ *
+ * # Argument names
+ *
+ * The simplest form is to extract the dependencies from the arguments of the function. This is done
+ * by converting the function into a string using `toString()` method and extracting the argument
+ * names.
+ * ```js
+ *   // Given
+ *   function MyController($scope, $route) {
+ *     // ...
+ *   }
+ *
+ *   // Then
+ *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
+ * ```
+ *
+ * You can disallow this method by using strict injection mode.
+ *
+ * This method does not work with code minification / obfuscation. For this reason the following
+ * annotation strategies are supported.
+ *
+ * # The `$inject` property
+ *
+ * If a function has an `$inject` property and its value is an array of strings, then the strings
+ * represent names of services to be injected into the function.
+ * ```js
+ *   // Given
+ *   var MyController = function(obfuscatedScope, obfuscatedRoute) {
+ *     // ...
+ *   }
+ *   // Define function dependencies
+ *   MyController['$inject'] = ['$scope', '$route'];
+ *
+ *   // Then
+ *   expect(injector.annotate(MyController)).toEqual(['$scope', '$route']);
+ * ```
+ *
+ * # The array notation
+ *
+ * It is often desirable to inline Injected functions and that's when setting the `$inject` property
+ * is very inconvenient. In these situations using the array notation to specify the dependencies in
+ * a way that survives minification is a better choice:
+ *
+ * ```js
+ *   // We wish to write this (not minification / obfuscation safe)
+ *   injector.invoke(function($compile, $rootScope) {
+ *     // ...
+ *   });
+ *
+ *   // We are forced to write break inlining
+ *   var tmpFn = function(obfuscatedCompile, obfuscatedRootScope) {
+ *     // ...
+ *   };
+ *   tmpFn.$inject = ['$compile', '$rootScope'];
+ *   injector.invoke(tmpFn);
+ *
+ *   // To better support inline function the inline annotation is supported
+ *   injector.invoke(['$compile', '$rootScope', function(obfCompile, obfRootScope) {
+ *     // ...
+ *   }]);
+ *
+ *   // Therefore
+ *   expect(injector.annotate(
+ *      ['$compile', '$rootScope', function(obfus_$compile, obfus_$rootScope) {}])
+ *    ).toEqual(['$compile', '$rootScope']);
+ * ```
+ *
+ * @param {Function|Array.<string|Function>} fn Function for which dependent service names need to
+ * be retrieved as described above.
+ *
+ * @param {boolean=} [strictDi=false] Disallow argument name annotation inference.
+ *
+ * @returns {Array.<string>} The names of the services which the function requires.
+ */
+
+
+
+
+/**
+ * @ngdoc service
+ * @name $provide
+ *
+ * @description
+ *
+ * The {@link auto.$provide $provide} service has a number of methods for registering components
+ * with the {@link auto.$injector $injector}. Many of these functions are also exposed on
+ * {@link angular.Module}.
+ *
+ * An Angular **service** is a singleton object created by a **service factory**.  These **service
+ * factories** are functions which, in turn, are created by a **service provider**.
+ * The **service providers** are constructor functions. When instantiated they must contain a
+ * property called `$get`, which holds the **service factory** function.
+ *
+ * When you request a service, the {@link auto.$injector $injector} is responsible for finding the
+ * correct **service provider**, instantiating it and then calling its `$get` **service factory**
+ * function to get the instance of the **service**.
+ *
+ * Often services have no configuration options and there is no need to add methods to the service
+ * provider.  The provider will be no more than a constructor function with a `$get` property. For
+ * these cases the {@link auto.$provide $provide} service has additional helper methods to register
+ * services without specifying a provider.
+ *
+ * * {@link auto.$provide#provider provider(provider)} - registers a **service provider** with the
+ *     {@link auto.$injector $injector}
+ * * {@link auto.$provide#constant constant(obj)} - registers a value/object that can be accessed by
+ *     providers and services.
+ * * {@link auto.$provide#value value(obj)} - registers a value/object that can only be accessed by
+ *     services, not providers.
+ * * {@link auto.$provide#factory factory(fn)} - registers a service **factory function**, `fn`,
+ *     that will be wrapped in a **service provider** object, whose `$get` property will contain the
+ *     given factory function.
+ * * {@link auto.$provide#service service(class)} - registers a **constructor function**, `class`
+ *     that will be wrapped in a **service provider** object, whose `$get` property will instantiate
+ *      a new object using the given constructor function.
+ *
+ * See the individual methods for more information and examples.
+ */
+
+/**
+ * @ngdoc method
+ * @name $provide#provider
+ * @description
+ *
+ * Register a **provider function** with the {@link auto.$injector $injector}. Provider functions
+ * are constructor functions, whose instances are responsible for "providing" a factory for a
+ * service.
+ *
+ * Service provider names start with the name of the service they provide followed by `Provider`.
+ * For example, the {@link ng.$log $log} service has a provider called
+ * {@link ng.$logProvider $logProvider}.
+ *
+ * Service provider objects can have additional methods which allow configuration of the provider
+ * and its service. Importantly, you can configure what kind of service is created by the `$get`
+ * method, or how that service will act. For example, the {@link ng.$logProvider $logProvider} has a
+ * method {@link ng.$logProvider#debugEnabled debugEnabled}
+ * which lets you specify whether the {@link ng.$log $log} service will log debug messages to the
+ * console or not.
+ *
+ * @param {string} name The name of the instance. NOTE: the provider will be available under `name +
+                        'Provider'` key.
+ * @param {(Object|function())} provider If the provider is:
+ *
+ *   - `Object`: then it should have a `$get` method. The `$get` method will be invoked using
+ *     {@link auto.$injector#invoke $injector.invoke()} when an instance needs to be created.
+ *   - `Constructor`: a new instance of the provider will be created using
+ *     {@link auto.$injector#instantiate $injector.instantiate()}, then treated as `object`.
+ *
+ * @returns {Object} registered provider instance
+
+ * @example
+ *
+ * The following example shows how to create a simple event tracking service and register it using
+ * {@link auto.$provide#provider $provide.provider()}.
+ *
+ * ```js
+ *  // Define the eventTracker provider
+ *  function EventTrackerProvider() {
+ *    var trackingUrl = '/track';
+ *
+ *    // A provider method for configuring where the tracked events should been saved
+ *    this.setTrackingUrl = function(url) {
+ *      trackingUrl = url;
+ *    };
+ *
+ *    // The service factory function
+ *    this.$get = ['$http', function($http) {
+ *      var trackedEvents = {};
+ *      return {
+ *        // Call this to track an event
+ *        event: function(event) {
+ *          var count = trackedEvents[event] || 0;
+ *          count += 1;
+ *          trackedEvents[event] = count;
+ *          return count;
+ *        },
+ *        // Call this to save the tracked events to the trackingUrl
+ *        save: function() {
+ *          $http.post(trackingUrl, trackedEvents);
+ *        }
+ *      };
+ *    }];
+ *  }
+ *
+ *  describe('eventTracker', function() {
+ *    var postSpy;
+ *
+ *    beforeEach(module(function($provide) {
+ *      // Register the eventTracker provider
+ *      $provide.provider('eventTracker', EventTrackerProvider);
+ *    }));
+ *
+ *    beforeEach(module(function(eventTrackerProvider) {
+ *      // Configure eventTracker provider
+ *      eventTrackerProvider.setTrackingUrl('/custom-track');
+ *    }));
+ *
+ *    it('tracks events', inject(function(eventTracker) {
+ *      expect(eventTracker.event('login')).toEqual(1);
+ *      expect(eventTracker.event('login')).toEqual(2);
+ *    }));
+ *
+ *    it('saves to the tracking url', inject(function(eventTracker, $http) {
+ *      postSpy = spyOn($http, 'post');
+ *      eventTracker.event('login');
+ *      eventTracker.save();
+ *      expect(postSpy).toHaveBeenCalled();
+ *      expect(postSpy.mostRecentCall.args[0]).not.toEqual('/track');
+ *      expect(postSpy.mostRecentCall.args[0]).toEqual('/custom-track');
+ *      expect(postSpy.mostRecentCall.args[1]).toEqual({ 'login': 1 });
+ *    }));
+ *  });
+ * ```
+ */
+
+/**
+ * @ngdoc method
+ * @name $provide#factory
+ * @description
+ *
+ * Register a **service factory**, which will be called to return the service instance.
+ * This is short for registering a service where its provider consists of only a `$get` property,
+ * which is the given service factory function.
+ * You should use {@link auto.$provide#factory $provide.factory(getFn)} if you do not need to
+ * configure your service in a provider.
+ *
+ * @param {string} name The name of the instance.
+ * @param {Function|Array.<string|Function>} $getFn The injectable $getFn for the instance creation.
+ *                      Internally this is a short hand for `$provide.provider(name, {$get: $getFn})`.
+ * @returns {Object} registered provider instance
+ *
+ * @example
+ * Here is an example of registering a service
+ * ```js
+ *   $provide.factory('ping', ['$http', function($http) {
+ *     return function ping() {
+ *       return $http.send('/ping');
+ *     };
+ *   }]);
+ * ```
+ * You would then inject and use this service like this:
+ * ```js
+ *   someModule.controller('Ctrl', ['ping', function(ping) {
+ *     ping();
+ *   }]);
+ * ```
+ */
+
+
+/**
+ * @ngdoc method
+ * @name $provide#service
+ * @description
+ *
+ * Register a **service constructor**, which will be invoked with `new` to create the service
+ * instance.
+ * This is short for registering a service where its provider's `$get` property is the service
+ * constructor function that will be used to instantiate the service instance.
+ *
+ * You should use {@link auto.$provide#service $provide.service(class)} if you define your service
+ * as a type/class.
+ *
+ * @param {string} name The name of the instance.
+ * @param {Function|Array.<string|Function>} constructor An injectable class (constructor function)
+ *     that will be instantiated.
+ * @returns {Object} registered provider instance
+ *
+ * @example
+ * Here is an example of registering a service using
+ * {@link auto.$provide#service $provide.service(class)}.
+ * ```js
+ *   var Ping = function($http) {
+ *     this.$http = $http;
+ *   };
+ *
+ *   Ping.$inject = ['$http'];
+ *
+ *   Ping.prototype.send = function() {
+ *     return this.$http.get('/ping');
+ *   };
+ *   $provide.service('ping', Ping);
+ * ```
+ * You would then inject and use this service like this:
+ * ```js
+ *   someModule.controller('Ctrl', ['ping', function(ping) {
+ *     ping.send();
+ *   }]);
+ * ```
+ */
+
+
+/**
+ * @ngdoc method
+ * @name $provide#value
+ * @description
+ *
+ * Register a **value service** with the {@link auto.$injector $injector}, such as a string, a
+ * number, an array, an object or a function.  This is short for registering a service where its
+ * provider's `$get` property is a factory function that takes no arguments and returns the **value
+ * service**.
+ *
+ * Value services are similar to constant services, except that they cannot be injected into a
+ * module configuration function (see {@link angular.Module#config}) but they can be overridden by
+ * an Angular
+ * {@link auto.$provide#decorator decorator}.
+ *
+ * @param {string} name The name of the instance.
+ * @param {*} value The value.
+ * @returns {Object} registered provider instance
+ *
+ * @example
+ * Here are some examples of creating value services.
+ * ```js
+ *   $provide.value('ADMIN_USER', 'admin');
+ *
+ *   $provide.value('RoleLookup', { admin: 0, writer: 1, reader: 2 });
+ *
+ *   $provide.value('halfOf', function(value) {
+ *     return value / 2;
+ *   });
+ * ```
+ */
+
+
+/**
+ * @ngdoc method
+ * @name $provide#constant
+ * @description
+ *
+ * Register a **constant service**, such as a string, a number, an array, an object or a function,
+ * with the {@link auto.$injector $injector}. Unlike {@link auto.$provide#value value} it can be
+ * injected into a module configuration function (see {@link angular.Module#config}) and it cannot
+ * be overridden by an Angular {@link auto.$provide#decorator decorator}.
+ *
+ * @param {string} name The name of the constant.
+ * @param {*} value The constant value.
+ * @returns {Object} registered instance
+ *
+ * @example
+ * Here a some examples of creating constants:
+ * ```js
+ *   $provide.constant('SHARD_HEIGHT', 306);
+ *
+ *   $provide.constant('MY_COLOURS', ['red', 'blue', 'grey']);
+ *
+ *   $provide.constant('double', function(value) {
+ *     return value * 2;
+ *   });
+ * ```
+ */
+
+
+/**
+ * @ngdoc method
+ * @name $provide#decorator
+ * @description
+ *
+ * Register a **service decorator** with the {@link auto.$injector $injector}. A service decorator
+ * intercepts the creation of a service, allowing it to override or modify the behaviour of the
+ * service. The object returned by the decorator may be the original service, or a new service
+ * object which replaces or wraps and delegates to the original service.
+ *
+ * @param {string} name The name of the service to decorate.
+ * @param {Function|Array.<string|Function>} decorator This function will be invoked when the service needs to be
+ *    instantiated and should return the decorated service instance. The function is called using
+ *    the {@link auto.$injector#invoke injector.invoke} method and is therefore fully injectable.
+ *    Local injection arguments:
+ *
+ *    * `$delegate` - The original service instance, which can be monkey patched, configured,
+ *      decorated or delegated to.
+ *
+ * @example
+ * Here we decorate the {@link ng.$log $log} service to convert warnings to errors by intercepting
+ * calls to {@link ng.$log#error $log.warn()}.
+ * ```js
+ *   $provide.decorator('$log', ['$delegate', function($delegate) {
+ *     $delegate.warn = $delegate.error;
+ *     return $delegate;
+ *   }]);
+ * ```
+ */
+
+
+function createInjector(modulesToLoad, strictDi) {
+  strictDi = (strictDi === true);
+  var INSTANTIATING = {},
+      providerSuffix = 'Provider',
+      path = [],
+      loadedModules = new HashMap([], true),
+      providerCache = {
+        $provide: {
+            provider: supportObject(provider),
+            factory: supportObject(factory),
+            service: supportObject(service),
+            value: supportObject(value),
+            constant: supportObject(constant),
+            decorator: decorator
+          }
+      },
+      providerInjector = (providerCache.$injector =
+          createInternalInjector(providerCache, function(serviceName, caller) {
+            if (angular.isString(caller)) {
+              path.push(caller);
+            }
+            throw $injectorMinErr('unpr', "Unknown provider: {0}", path.join(' <- '));
+          })),
+      instanceCache = {},
+      instanceInjector = (instanceCache.$injector =
+          createInternalInjector(instanceCache, function(serviceName, caller) {
+            var provider = providerInjector.get(serviceName + providerSuffix, caller);
+            return instanceInjector.invoke(provider.$get, provider, undefined, serviceName);
+          }));
+
+
+  forEach(loadModules(modulesToLoad), function(fn) { if (fn) instanceInjector.invoke(fn); });
+
+  return instanceInjector;
+
+  ////////////////////////////////////
+  // $provider
+  ////////////////////////////////////
+
+  function supportObject(delegate) {
+    return function(key, value) {
+      if (isObject(key)) {
+        forEach(key, reverseParams(delegate));
+      } else {
+        return delegate(key, value);
+      }
+    };
+  }
+
+  function provider(name, provider_) {
+    assertNotHasOwnProperty(name, 'service');
+    if (isFunction(provider_) || isArray(provider_)) {
+      provider_ = providerInjector.instantiate(provider_);
+    }
+    if (!provider_.$get) {
+      throw $injectorMinErr('pget', "Provider '{0}' must define $get factory method.", name);
+    }
+    return providerCache[name + providerSuffix] = provider_;
+  }
+
+  function enforceReturnValue(name, factory) {
+    return function enforcedReturnValue() {
+      var result = instanceInjector.invoke(factory, this);
+      if (isUndefined(result)) {
+        throw $injectorMinErr('undef', "Provider '{0}' must return a value from $get factory method.", name);
+      }
+      return result;
+    };
+  }
+
+  function factory(name, factoryFn, enforce) {
+    return provider(name, {
+      $get: enforce !== false ? enforceReturnValue(name, factoryFn) : factoryFn
+    });
+  }
+
+  function service(name, constructor) {
+    return factory(name, ['$injector', function($injector) {
+      return $injector.instantiate(constructor);
+    }]);
+  }
+
+  function value(name, val) { return factory(name, valueFn(val), false); }
+
+  function constant(name, value) {
+    assertNotHasOwnProperty(name, 'constant');
+    providerCache[name] = value;
+    instanceCache[name] = value;
+  }
+
+  function decorator(serviceName, decorFn) {
+    var origProvider = providerInjector.get(serviceName + providerSuffix),
+        orig$get = origProvider.$get;
+
+    origProvider.$get = function() {
+      var origInstance = instanceInjector.invoke(orig$get, origProvider);
+      return instanceInjector.invoke(decorFn, null, {$delegate: origInstance});
+    };
+  }
+
+  ////////////////////////////////////
+  // Module Loading
+  ////////////////////////////////////
+  function loadModules(modulesToLoad) {
+    assertArg(isUndefined(modulesToLoad) || isArray(modulesToLoad), 'modulesToLoad', 'not an array');
+    var runBlocks = [], moduleFn;
+    forEach(modulesToLoad, function(module) {
+      if (loadedModules.get(module)) return;
+      loadedModules.put(module, true);
+
+      function runInvokeQueue(queue) {
+        var i, ii;
+        for (i = 0, ii = queue.length; i < ii; i++) {
+          var invokeArgs = queue[i],
+              provider = providerInjector.get(invokeArgs[0]);
+
+          provider[invokeArgs[1]].apply(provider, invokeArgs[2]);
+        }
+      }
+
+      try {
+        if (isString(module)) {
+          moduleFn = angularModule(module);
+          runBlocks = runBlocks.concat(loadModules(moduleFn.requires)).concat(moduleFn._runBlocks);
+          runInvokeQueue(moduleFn._invokeQueue);
+          runInvokeQueue(moduleFn._configBlocks);
+        } else if (isFunction(module)) {
+            runBlocks.push(providerInjector.invoke(module));
+        } else if (isArray(module)) {
+            runBlocks.push(providerInjector.invoke(module));
+        } else {
+          assertArgFn(module, 'module');
+        }
+      } catch (e) {
+        if (isArray(module)) {
+          module = module[module.length - 1];
+        }
+        if (e.message && e.stack && e.stack.indexOf(e.message) == -1) {
+          // Safari & FF's stack traces don't contain error.message content
+          // unlike those of Chrome and IE
+          // So if stack doesn't contain message, we create a new string that contains both.
+          // Since error.stack is read-only in Safari, I'm overriding e and not e.stack here.
+          /* jshint -W022 */
+          e = e.message + '\n' + e.stack;
+        }
+        throw $injectorMinErr('modulerr', "Failed to instantiate module {0} due to:\n{1}",
+                  module, e.stack || e.message || e);
+      }
+    });
+    return runBlocks;
+  }
+
+  ////////////////////////////////////
+  // internal Injector
+  ////////////////////////////////////
+
+  function createInternalInjector(cache, factory) {
+
+    function getService(serviceName, caller) {
+      if (cache.hasOwnProperty(serviceName)) {
+        if (cache[serviceName] === INSTANTIATING) {
+          throw $injectorMinErr('cdep', 'Circular dependency found: {0}',
+                    serviceName + ' <- ' + path.join(' <- '));
+        }
+        return cache[serviceName];
+      } else {
+        try {
+          path.unshift(serviceName);
+          cache[serviceName] = INSTANTIATING;
+          return cache[serviceName] = factory(serviceName, caller);
+        } catch (err) {
+          if (cache[serviceName] === INSTANTIATING) {
+            delete cache[serviceName];
+          }
+          throw err;
+        } finally {
+          path.shift();
+        }
+      }
+    }
+
+    function invoke(fn, self, locals, serviceName) {
+      if (typeof locals === 'string') {
+        serviceName = locals;
+        locals = null;
+      }
+
+      var args = [],
+          $inject = createInjector.$$annotate(fn, strictDi, serviceName),
+          length, i,
+          key;
+
+      for (i = 0, length = $inject.length; i < length; i++) {
+        key = $inject[i];
+        if (typeof key !== 'string') {
+          throw $injectorMinErr('itkn',
+                  'Incorrect injection token! Expected service name as string, got {0}', key);
+        }
+        args.push(
+          locals && locals.hasOwnProperty(key)
+          ? locals[key]
+          : getService(key, serviceName)
+        );
+      }
+      if (isArray(fn)) {
+        fn = fn[length];
+      }
+
+      // http://jsperf.com/angularjs-invoke-apply-vs-switch
+      // #5388
+      return fn.apply(self, args);
+    }
+
+    function instantiate(Type, locals, serviceName) {
+      // Check if Type is annotated and use just the given function at n-1 as parameter
+      // e.g. someModule.factory('greeter', ['$window', function(renamed$window) {}]);
+      // Object creation: http://jsperf.com/create-constructor/2
+      var instance = Object.create((isArray(Type) ? Type[Type.length - 1] : Type).prototype || null);
+      var returnedValue = invoke(Type, instance, locals, serviceName);
+
+      return isObject(returnedValue) || isFunction(returnedValue) ? returnedValue : instance;
+    }
+
+    return {
+      invoke: invoke,
+      instantiate: instantiate,
+      get: getService,
+      annotate: createInjector.$$annotate,
+      has: function(name) {
+        return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);
+      }
+    };
+  }
+}
+
+createInjector.$$annotate = annotate;
+
+/**
+ * @ngdoc provider
+ * @name $anchorScrollProvider
+ *
+ * @description
+ * Use `$anchorScrollProvider` to disable automatic scrolling whenever
+ * {@link ng.$location#hash $location.hash()} changes.
+ */
+function $AnchorScrollProvider() {
+
+  var autoScrollingEnabled = true;
+
+  /**
+   * @ngdoc method
+   * @name $anchorScrollProvider#disableAutoScrolling
+   *
+   * @description
+   * By default, {@link ng.$anchorScroll $anchorScroll()} will automatically detect changes to
+   * {@link ng.$location#hash $location.hash()} and scroll to the element matching the new hash.<br />
+   * Use this method to disable automatic scrolling.
+   *
+   * If automatic scrolling is disabled, one must explicitly call
+   * {@link ng.$anchorScroll $anchorScroll()} in order to scroll to the element related to the
+   * current hash.
+   */
+  this.disableAutoScrolling = function() {
+    autoScrollingEnabled = false;
+  };
+
+  /**
+   * @ngdoc service
+   * @name $anchorScroll
+   * @kind function
+   * @requires $window
+   * @requires $location
+   * @requires $rootScope
+   *
+   * @description
+   * When called, it scrolls to the element related to the specified `hash` or (if omitted) to the
+   * current value of {@link ng.$location#hash $location.hash()}, according to the rules specified
+   * in the
+   * [HTML5 spec](http://dev.w3.org/html5/spec/Overview.html#the-indicated-part-of-the-document).
+   *
+   * It also watches the {@link ng.$location#hash $location.hash()} and automatically scrolls to
+   * match any anchor whenever it changes. This can be disabled by calling
+   * {@link ng.$anchorScrollProvider#disableAutoScrolling $anchorScrollProvider.disableAutoScrolling()}.
+   *
+   * Additionally, you can use its {@link ng.$anchorScroll#yOffset yOffset} property to specify a
+   * vertical scroll-offset (either fixed or dynamic).
+   *
+   * @param {string=} hash The hash specifying the element to scroll to. If omitted, the value of
+   *                       {@link ng.$location#hash $location.hash()} will be used.
+   *
+   * @property {(number|function|jqLite)} yOffset
+   * If set, specifies a vertical scroll-offset. This is often useful when there are fixed
+   * positioned elements at the top of the page, such as navbars, headers etc.
+   *
+   * `yOffset` can be specified in various ways:
+   * - **number**: A fixed number of pixels to be used as offset.<br /><br />
+   * - **function**: A getter function called everytime `$anchorScroll()` is executed. Must return
+   *   a number representing the offset (in pixels).<br /><br />
+   * - **jqLite**: A jqLite/jQuery element to be used for specifying the offset. The distance from
+   *   the top of the page to the element's bottom will be used as offset.<br />
+   *   **Note**: The element will be taken into account only as long as its `position` is set to
+   *   `fixed`. This option is useful, when dealing with responsive navbars/headers that adjust
+   *   their height and/or positioning according to the viewport's size.
+   *
+   * <br />
+   * <div class="alert alert-warning">
+   * In order for `yOffset` to work properly, scrolling should take place on the document's root and
+   * not some child element.
+   * </div>
+   *
+   * @example
+     <example module="anchorScrollExample">
+       <file name="index.html">
+         <div id="scrollArea" ng-controller="ScrollController">
+           <a ng-click="gotoBottom()">Go to bottom</a>
+           <a id="bottom"></a> You're at the bottom!
+         </div>
+       </file>
+       <file name="script.js">
+         angular.module('anchorScrollExample', [])
+           .controller('ScrollController', ['$scope', '$location', '$anchorScroll',
+             function ($scope, $location, $anchorScroll) {
+               $scope.gotoBottom = function() {
+                 // set the location.hash to the id of
+                 // the element you wish to scroll to.
+                 $location.hash('bottom');
+
+                 // call $anchorScroll()
+                 $anchorScroll();
+               };
+             }]);
+       </file>
+       <file name="style.css">
+         #scrollArea {
+           height: 280px;
+           overflow: auto;
+         }
+
+         #bottom {
+           display: block;
+           margin-top: 2000px;
+         }
+       </file>
+     </example>
+   *
+   * <hr />
+   * The example below illustrates the use of a vertical scroll-offset (specified as a fixed value).
+   * See {@link ng.$anchorScroll#yOffset $anchorScroll.yOffset} for more details.
+   *
+   * @example
+     <example module="anchorScrollOffsetExample">
+       <file name="index.html">
+         <div class="fixed-header" ng-controller="headerCtrl">
+           <a href="" ng-click="gotoAnchor(x)" ng-repeat="x in [1,2,3,4,5]">
+             Go to anchor {{x}}
+           </a>
+         </div>
+         <div id="anchor{{x}}" class="anchor" ng-repeat="x in [1,2,3,4,5]">
+           Anchor {{x}} of 5
+         </div>
+       </file>
+       <file name="script.js">
+         angular.module('anchorScrollOffsetExample', [])
+           .run(['$anchorScroll', function($anchorScroll) {
+             $anchorScroll.yOffset = 50;   // always scroll by 50 extra pixels
+           }])
+           .controller('headerCtrl', ['$anchorScroll', '$location', '$scope',
+             function ($anchorScroll, $location, $scope) {
+               $scope.gotoAnchor = function(x) {
+                 var newHash = 'anchor' + x;
+                 if ($location.hash() !== newHash) {
+                   // set the $location.hash to `newHash` and
+                   // $anchorScroll will automatically scroll to it
+                   $location.hash('anchor' + x);
+                 } else {
+                   // call $anchorScroll() explicitly,
+                   // since $location.hash hasn't changed
+                   $anchorScroll();
+                 }
+               };
+             }
+           ]);
+       </file>
+       <file name="style.css">
+         body {
+           padding-top: 50px;
+         }
+
+         .anchor {
+           border: 2px dashed DarkOrchid;
+           padding: 10px 10px 200px 10px;
+         }
+
+         .fixed-header {
+           background-color: rgba(0, 0, 0, 0.2);
+           height: 50px;
+           position: fixed;
+           top: 0; left: 0; right: 0;
+         }
+
+         .fixed-header > a {
+           display: inline-block;
+           margin: 5px 15px;
+         }
+       </file>
+     </example>
+   */
+  this.$get = ['$window', '$location', '$rootScope', function($window, $location, $rootScope) {
+    var document = $window.document;
+
+    // Helper function to get first anchor from a NodeList
+    // (using `Array#some()` instead of `angular#forEach()` since it's more performant
+    //  and working in all supported browsers.)
+    function getFirstAnchor(list) {
+      var result = null;
+      Array.prototype.some.call(list, function(element) {
+        if (nodeName_(element) === 'a') {
+          result = element;
+          return true;
+        }
+      });
+      return result;
+    }
+
+    function getYOffset() {
+
+      var offset = scroll.yOffset;
+
+      if (isFunction(offset)) {
+        offset = offset();
+      } else if (isElement(offset)) {
+        var elem = offset[0];
+        var style = $window.getComputedStyle(elem);
+        if (style.position !== 'fixed') {
+          offset = 0;
+        } else {
+          offset = elem.getBoundingClientRect().bottom;
+        }
+      } else if (!isNumber(offset)) {
+        offset = 0;
+      }
+
+      return offset;
+    }
+
+    function scrollTo(elem) {
+      if (elem) {
+        elem.scrollIntoView();
+
+        var offset = getYOffset();
+
+        if (offset) {
+          // `offset` is the number of pixels we should scroll UP in order to align `elem` properly.
+          // This is true ONLY if the call to `elem.scrollIntoView()` initially aligns `elem` at the
+          // top of the viewport.
+          //
+          // IF the number of pixels from the top of `elem` to the end of the page's content is less
+          // than the height of the viewport, then `elem.scrollIntoView()` will align the `elem` some
+          // way down the page.
+          //
+          // This is often the case for elements near the bottom of the page.
+          //
+          // In such cases we do not need to scroll the whole `offset` up, just the difference between
+          // the top of the element and the offset, which is enough to align the top of `elem` at the
+          // desired position.
+          var elemTop = elem.getBoundingClientRect().top;
+          $window.scrollBy(0, elemTop - offset);
+        }
+      } else {
+        $window.scrollTo(0, 0);
+      }
+    }
+
+    function scroll(hash) {
+      hash = isString(hash) ? hash : $location.hash();
+      var elm;
+
+      // empty hash, scroll to the top of the page
+      if (!hash) scrollTo(null);
+
+      // element with given id
+      else if ((elm = document.getElementById(hash))) scrollTo(elm);
+
+      // first anchor with given name :-D
+      else if ((elm = getFirstAnchor(document.getElementsByName(hash)))) scrollTo(elm);
+
+      // no element and hash == 'top', scroll to the top of the page
+      else if (hash === 'top') scrollTo(null);
+    }
+
+    // does not scroll when user clicks on anchor link that is currently on
+    // (no url change, no $location.hash() change), browser native does scroll
+    if (autoScrollingEnabled) {
+      $rootScope.$watch(function autoScrollWatch() {return $location.hash();},
+        function autoScrollWatchAction(newVal, oldVal) {
+          // skip the initial scroll if $location.hash is empty
+          if (newVal === oldVal && newVal === '') return;
+
+          jqLiteDocumentLoaded(function() {
+            $rootScope.$evalAsync(scroll);
+          });
+        });
+    }
+
+    return scroll;
+  }];
+}
+
+var $animateMinErr = minErr('$animate');
+var ELEMENT_NODE = 1;
+var NG_ANIMATE_CLASSNAME = 'ng-animate';
+
+function mergeClasses(a,b) {
+  if (!a && !b) return '';
+  if (!a) return b;
+  if (!b) return a;
+  if (isArray(a)) a = a.join(' ');
+  if (isArray(b)) b = b.join(' ');
+  return a + ' ' + b;
+}
+
+function extractElementNode(element) {
+  for (var i = 0; i < element.length; i++) {
+    var elm = element[i];
+    if (elm.nodeType === ELEMENT_NODE) {
+      return elm;
+    }
+  }
+}
+
+function splitClasses(classes) {
+  if (isString(classes)) {
+    classes = classes.split(' ');
+  }
+
+  // Use createMap() to prevent class assumptions involving property names in
+  // Object.prototype
+  var obj = createMap();
+  forEach(classes, function(klass) {
+    // sometimes the split leaves empty string values
+    // incase extra spaces were applied to the options
+    if (klass.length) {
+      obj[klass] = true;
+    }
+  });
+  return obj;
+}
+
+// if any other type of options value besides an Object value is
+// passed into the $animate.method() animation then this helper code
+// will be run which will ignore it. While this patch is not the
+// greatest solution to this, a lot of existing plugins depend on
+// $animate to either call the callback (< 1.2) or return a promise
+// that can be changed. This helper function ensures that the options
+// are wiped clean incase a callback function is provided.
+function prepareAnimateOptions(options) {
+  return isObject(options)
+      ? options
+      : {};
+}
+
+var $$CoreAnimateRunnerProvider = function() {
+  this.$get = ['$q', '$$rAF', function($q, $$rAF) {
+    function AnimateRunner() {}
+    AnimateRunner.all = noop;
+    AnimateRunner.chain = noop;
+    AnimateRunner.prototype = {
+      end: noop,
+      cancel: noop,
+      resume: noop,
+      pause: noop,
+      complete: noop,
+      then: function(pass, fail) {
+        return $q(function(resolve) {
+          $$rAF(function() {
+            resolve();
+          });
+        }).then(pass, fail);
+      }
+    };
+    return AnimateRunner;
+  }];
+};
+
+// this is prefixed with Core since it conflicts with
+// the animateQueueProvider defined in ngAnimate/animateQueue.js
+var $$CoreAnimateQueueProvider = function() {
+  var postDigestQueue = new HashMap();
+  var postDigestElements = [];
+
+  this.$get = ['$$AnimateRunner', '$rootScope',
+       function($$AnimateRunner,   $rootScope) {
+    return {
+      enabled: noop,
+      on: noop,
+      off: noop,
+      pin: noop,
+
+      push: function(element, event, options, domOperation) {
+        domOperation        && domOperation();
+
+        options = options || {};
+        options.from        && element.css(options.from);
+        options.to          && element.css(options.to);
+
+        if (options.addClass || options.removeClass) {
+          addRemoveClassesPostDigest(element, options.addClass, options.removeClass);
+        }
+
+        return new $$AnimateRunner(); // jshint ignore:line
+      }
+    };
+
+
+    function updateData(data, classes, value) {
+      var changed = false;
+      if (classes) {
+        classes = isString(classes) ? classes.split(' ') :
+                  isArray(classes) ? classes : [];
+        forEach(classes, function(className) {
+          if (className) {
+            changed = true;
+            data[className] = value;
+          }
+        });
+      }
+      return changed;
+    }
+
+    function handleCSSClassChanges() {
+      forEach(postDigestElements, function(element) {
+        var data = postDigestQueue.get(element);
+        if (data) {
+          var existing = splitClasses(element.attr('class'));
+          var toAdd = '';
+          var toRemove = '';
+          forEach(data, function(status, className) {
+            var hasClass = !!existing[className];
+            if (status !== hasClass) {
+              if (status) {
+                toAdd += (toAdd.length ? ' ' : '') + className;
+              } else {
+                toRemove += (toRemove.length ? ' ' : '') + className;
+              }
+            }
+          });
+
+          forEach(element, function(elm) {
+            toAdd    && jqLiteAddClass(elm, toAdd);
+            toRemove && jqLiteRemoveClass(elm, toRemove);
+          });
+          postDigestQueue.remove(element);
+        }
+      });
+      postDigestElements.length = 0;
+    }
+
+
+    function addRemoveClassesPostDigest(element, add, remove) {
+      var data = postDigestQueue.get(element) || {};
+
+      var classesAdded = updateData(data, add, true);
+      var classesRemoved = updateData(data, remove, false);
+
+      if (classesAdded || classesRemoved) {
+
+        postDigestQueue.put(element, data);
+        postDigestElements.push(element);
+
+        if (postDigestElements.length === 1) {
+          $rootScope.$$postDigest(handleCSSClassChanges);
+        }
+      }
+    }
+  }];
+};
+
+/**
+ * @ngdoc provider
+ * @name $animateProvider
+ *
+ * @description
+ * Default implementation of $animate that doesn't perform any animations, instead just
+ * synchronously performs DOM updates and resolves the returned runner promise.
+ *
+ * In order to enable animations the `ngAnimate` module has to be loaded.
+ *
+ * To see the functional implementation check out `src/ngAnimate/animate.js`.
+ */
+var $AnimateProvider = ['$provide', function($provide) {
+  var provider = this;
+
+  this.$$registeredAnimations = Object.create(null);
+
+   /**
+   * @ngdoc method
+   * @name $animateProvider#register
+   *
+   * @description
+   * Registers a new injectable animation factory function. The factory function produces the
+   * animation object which contains callback functions for each event that is expected to be
+   * animated.
+   *
+   *   * `eventFn`: `function(element, ... , doneFunction, options)`
+   *   The element to animate, the `doneFunction` and the options fed into the animation. Depending
+   *   on the type of animation additional arguments will be injected into the animation function. The
+   *   list below explains the function signatures for the different animation methods:
+   *
+   *   - setClass: function(element, addedClasses, removedClasses, doneFunction, options)
+   *   - addClass: function(element, addedClasses, doneFunction, options)
+   *   - removeClass: function(element, removedClasses, doneFunction, options)
+   *   - enter, leave, move: function(element, doneFunction, options)
+   *   - animate: function(element, fromStyles, toStyles, doneFunction, options)
+   *
+   *   Make sure to trigger the `doneFunction` once the animation is fully complete.
+   *
+   * ```js
+   *   return {
+   *     //enter, leave, move signature
+   *     eventFn : function(element, done, options) {
+   *       //code to run the animation
+   *       //once complete, then run done()
+   *       return function endFunction(wasCancelled) {
+   *         //code to cancel the animation
+   *       }
+   *     }
+   *   }
+   * ```
+   *
+   * @param {string} name The name of the animation (this is what the class-based CSS value will be compared to).
+   * @param {Function} factory The factory function that will be executed to return the animation
+   *                           object.
+   */
+  this.register = function(name, factory) {
+    if (name && name.charAt(0) !== '.') {
+      throw $animateMinErr('notcsel', "Expecting class selector starting with '.' got '{0}'.", name);
+    }
+
+    var key = name + '-animation';
+    provider.$$registeredAnimations[name.substr(1)] = key;
+    $provide.factory(key, factory);
+  };
+
+  /**
+   * @ngdoc method
+   * @name $animateProvider#classNameFilter
+   *
+   * @description
+   * Sets and/or returns the CSS class regular expression that is checked when performing
+   * an animation. Upon bootstrap the classNameFilter value is not set at all and will
+   * therefore enable $animate to attempt to perform an animation on any element that is triggered.
+   * When setting the `classNameFilter` value, animations will only be performed on elements
+   * that successfully match the filter expression. This in turn can boost performance
+   * for low-powered devices as well as applications containing a lot of structural operations.
+   * @param {RegExp=} expression The className expression which will be checked against all animations
+   * @return {RegExp} The current CSS className expression value. If null then there is no expression value
+   */
+  this.classNameFilter = function(expression) {
+    if (arguments.length === 1) {
+      this.$$classNameFilter = (expression instanceof RegExp) ? expression : null;
+      if (this.$$classNameFilter) {
+        var reservedRegex = new RegExp("(\\s+|\\/)" + NG_ANIMATE_CLASSNAME + "(\\s+|\\/)");
+        if (reservedRegex.test(this.$$classNameFilter.toString())) {
+          throw $animateMinErr('nongcls','$animateProvider.classNameFilter(regex) prohibits accepting a regex value which matches/contains the "{0}" CSS class.', NG_ANIMATE_CLASSNAME);
+
+        }
+      }
+    }
+    return this.$$classNameFilter;
+  };
+
+  this.$get = ['$$animateQueue', function($$animateQueue) {
+    function domInsert(element, parentElement, afterElement) {
+      // if for some reason the previous element was removed
+      // from the dom sometime before this code runs then let's
+      // just stick to using the parent element as the anchor
+      if (afterElement) {
+        var afterNode = extractElementNode(afterElement);
+        if (afterNode && !afterNode.parentNode && !afterNode.previousElementSibling) {
+          afterElement = null;
+        }
+      }
+      afterElement ? afterElement.after(element) : parentElement.prepend(element);
+    }
+
+    /**
+     * @ngdoc service
+     * @name $animate
+     * @description The $animate service exposes a series of DOM utility methods that provide support
+     * for animation hooks. The default behavior is the application of DOM operations, however,
+     * when an animation is detected (and animations are enabled), $animate will do the heavy lifting
+     * to ensure that animation runs with the triggered DOM operation.
+     *
+     * By default $animate doesn't trigger an animations. This is because the `ngAnimate` module isn't
+     * included and only when it is active then the animation hooks that `$animate` triggers will be
+     * functional. Once active then all structural `ng-` directives will trigger animations as they perform
+     * their DOM-related operations (enter, leave and move). Other directives such as `ngClass`,
+     * `ngShow`, `ngHide` and `ngMessages` also provide support for animations.
+     *
+     * It is recommended that the`$animate` service is always used when executing DOM-related procedures within directives.
+     *
+     * To learn more about enabling animation support, click here to visit the
+     * {@link ngAnimate ngAnimate module page}.
+     */
+    return {
+      // we don't call it directly since non-existant arguments may
+      // be interpreted as null within the sub enabled function
+
+      /**
+       *
+       * @ngdoc method
+       * @name $animate#on
+       * @kind function
+       * @description Sets up an event listener to fire whenever the animation event (enter, leave, move, etc...)
+       *    has fired on the given element or among any of its children. Once the listener is fired, the provided callback
+       *    is fired with the following params:
+       *
+       * ```js
+       * $animate.on('enter', container,
+       *    function callback(element, phase) {
+       *      // cool we detected an enter animation within the container
+       *    }
+       * );
+       * ```
+       *
+       * @param {string} event the animation event that will be captured (e.g. enter, leave, move, addClass, removeClass, etc...)
+       * @param {DOMElement} container the container element that will capture each of the animation events that are fired on itself
+       *     as well as among its children
+       * @param {Function} callback the callback function that will be fired when the listener is triggered
+       *
+       * The arguments present in the callback function are:
+       * * `element` - The captured DOM element that the animation was fired on.
+       * * `phase` - The phase of the animation. The two possible phases are **start** (when the animation starts) and **close** (when it ends).
+       */
+      on: $$animateQueue.on,
+
+      /**
+       *
+       * @ngdoc method
+       * @name $animate#off
+       * @kind function
+       * @description Deregisters an event listener based on the event which has been associated with the provided element. This method
+       * can be used in three different ways depending on the arguments:
+       *
+       * ```js
+       * // remove all the animation event listeners listening for `enter`
+       * $animate.off('enter');
+       *
+       * // remove all the animation event listeners listening for `enter` on the given element and its children
+       * $animate.off('enter', container);
+       *
+       * // remove the event listener function provided by `listenerFn` that is set
+       * // to listen for `enter` on the given `element` as well as its children
+       * $animate.off('enter', container, callback);
+       * ```
+       *
+       * @param {string} event the animation event (e.g. enter, leave, move, addClass, removeClass, etc...)
+       * @param {DOMElement=} container the container element the event listener was placed on
+       * @param {Function=} callback the callback function that was registered as the listener
+       */
+      off: $$animateQueue.off,
+
+      /**
+       * @ngdoc method
+       * @name $animate#pin
+       * @kind function
+       * @description Associates the provided element with a host parent element to allow the element to be animated even if it exists
+       *    outside of the DOM structure of the Angular application. By doing so, any animation triggered via `$animate` can be issued on the
+       *    element despite being outside the realm of the application or within another application. Say for example if the application
+       *    was bootstrapped on an element that is somewhere inside of the `<body>` tag, but we wanted to allow for an element to be situated
+       *    as a direct child of `document.body`, then this can be achieved by pinning the element via `$animate.pin(element)`. Keep in mind
+       *    that calling `$animate.pin(element, parentElement)` will not actually insert into the DOM anywhere; it will just create the association.
+       *
+       *    Note that this feature is only active when the `ngAnimate` module is used.
+       *
+       * @param {DOMElement} element the external element that will be pinned
+       * @param {DOMElement} parentElement the host parent element that will be associated with the external element
+       */
+      pin: $$animateQueue.pin,
+
+      /**
+       *
+       * @ngdoc method
+       * @name $animate#enabled
+       * @kind function
+       * @description Used to get and set whether animations are enabled or not on the entire application or on an element and its children. This
+       * function can be called in four ways:
+       *
+       * ```js
+       * // returns true or false
+       * $animate.enabled();
+       *
+       * // changes the enabled state for all animations
+       * $animate.enabled(false);
+       * $animate.enabled(true);
+       *
+       * // returns true or false if animations are enabled for an element
+       * $animate.enabled(element);
+       *
+       * // changes the enabled state for an element and its children
+       * $animate.enabled(element, true);
+       * $animate.enabled(element, false);
+       * ```
+       *
+       * @param {DOMElement=} element the element that will be considered for checking/setting the enabled state
+       * @param {boolean=} enabled whether or not the animations will be enabled for the element
+       *
+       * @return {boolean} whether or not animations are enabled
+       */
+      enabled: $$animateQueue.enabled,
+
+      /**
+       * @ngdoc method
+       * @name $animate#cancel
+       * @kind function
+       * @description Cancels the provided animation.
+       *
+       * @param {Promise} animationPromise The animation promise that is returned when an animation is started.
+       */
+      cancel: function(runner) {
+        runner.end && runner.end();
+      },
+
+      /**
+       *
+       * @ngdoc method
+       * @name $animate#enter
+       * @kind function
+       * @description Inserts the element into the DOM either after the `after` element (if provided) or
+       *   as the first child within the `parent` element and then triggers an animation.
+       *   A promise is returned that will be resolved during the next digest once the animation
+       *   has completed.
+       *
+       * @param {DOMElement} element the element which will be inserted into the DOM
+       * @param {DOMElement} parent the parent element which will append the element as
+       *   a child (so long as the after element is not present)
+       * @param {DOMElement=} after the sibling element after which the element will be appended
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      enter: function(element, parent, after, options) {
+        parent = parent && jqLite(parent);
+        after = after && jqLite(after);
+        parent = parent || after.parent();
+        domInsert(element, parent, after);
+        return $$animateQueue.push(element, 'enter', prepareAnimateOptions(options));
+      },
+
+      /**
+       *
+       * @ngdoc method
+       * @name $animate#move
+       * @kind function
+       * @description Inserts (moves) the element into its new position in the DOM either after
+       *   the `after` element (if provided) or as the first child within the `parent` element
+       *   and then triggers an animation. A promise is returned that will be resolved
+       *   during the next digest once the animation has completed.
+       *
+       * @param {DOMElement} element the element which will be moved into the new DOM position
+       * @param {DOMElement} parent the parent element which will append the element as
+       *   a child (so long as the after element is not present)
+       * @param {DOMElement=} after the sibling element after which the element will be appended
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      move: function(element, parent, after, options) {
+        parent = parent && jqLite(parent);
+        after = after && jqLite(after);
+        parent = parent || after.parent();
+        domInsert(element, parent, after);
+        return $$animateQueue.push(element, 'move', prepareAnimateOptions(options));
+      },
+
+      /**
+       * @ngdoc method
+       * @name $animate#leave
+       * @kind function
+       * @description Triggers an animation and then removes the element from the DOM.
+       * When the function is called a promise is returned that will be resolved during the next
+       * digest once the animation has completed.
+       *
+       * @param {DOMElement} element the element which will be removed from the DOM
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      leave: function(element, options) {
+        return $$animateQueue.push(element, 'leave', prepareAnimateOptions(options), function() {
+          element.remove();
+        });
+      },
+
+      /**
+       * @ngdoc method
+       * @name $animate#addClass
+       * @kind function
+       *
+       * @description Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
+       *   execution, the addClass operation will only be handled after the next digest and it will not trigger an
+       *   animation if element already contains the CSS class or if the class is removed at a later step.
+       *   Note that class-based animations are treated differently compared to structural animations
+       *   (like enter, move and leave) since the CSS classes may be added/removed at different points
+       *   depending if CSS or JavaScript animations are used.
+       *
+       * @param {DOMElement} element the element which the CSS classes will be applied to
+       * @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      addClass: function(element, className, options) {
+        options = prepareAnimateOptions(options);
+        options.addClass = mergeClasses(options.addclass, className);
+        return $$animateQueue.push(element, 'addClass', options);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $animate#removeClass
+       * @kind function
+       *
+       * @description Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
+       *   execution, the removeClass operation will only be handled after the next digest and it will not trigger an
+       *   animation if element does not contain the CSS class or if the class is added at a later step.
+       *   Note that class-based animations are treated differently compared to structural animations
+       *   (like enter, move and leave) since the CSS classes may be added/removed at different points
+       *   depending if CSS or JavaScript animations are used.
+       *
+       * @param {DOMElement} element the element which the CSS classes will be applied to
+       * @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      removeClass: function(element, className, options) {
+        options = prepareAnimateOptions(options);
+        options.removeClass = mergeClasses(options.removeClass, className);
+        return $$animateQueue.push(element, 'removeClass', options);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $animate#setClass
+       * @kind function
+       *
+       * @description Performs both the addition and removal of a CSS classes on an element and (during the process)
+       *    triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
+       *    `$animate.removeClass`, `setClass` will only evaluate the classes being added/removed once a digest has
+       *    passed. Note that class-based animations are treated differently compared to structural animations
+       *    (like enter, move and leave) since the CSS classes may be added/removed at different points
+       *    depending if CSS or JavaScript animations are used.
+       *
+       * @param {DOMElement} element the element which the CSS classes will be applied to
+       * @param {string} add the CSS class(es) that will be added (multiple classes are separated via spaces)
+       * @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      setClass: function(element, add, remove, options) {
+        options = prepareAnimateOptions(options);
+        options.addClass = mergeClasses(options.addClass, add);
+        options.removeClass = mergeClasses(options.removeClass, remove);
+        return $$animateQueue.push(element, 'setClass', options);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $animate#animate
+       * @kind function
+       *
+       * @description Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
+       * If any detected CSS transition, keyframe or JavaScript matches the provided className value then the animation will take
+       * on the provided styles. For example, if a transition animation is set for the given className then the provided from and
+       * to styles will be applied alongside the given transition. If a JavaScript animation is detected then the provided styles
+       * will be given in as function paramters into the `animate` method (or as apart of the `options` parameter).
+       *
+       * @param {DOMElement} element the element which the CSS styles will be applied to
+       * @param {object} from the from (starting) CSS styles that will be applied to the element and across the animation.
+       * @param {object} to the to (destination) CSS styles that will be applied to the element and across the animation.
+       * @param {string=} className an optional CSS class that will be applied to the element for the duration of the animation. If
+       *    this value is left as empty then a CSS class of `ng-inline-animate` will be applied to the element.
+       *    (Note that if no animation is detected then this value will not be appplied to the element.)
+       * @param {object=} options an optional collection of options/styles that will be applied to the element
+       *
+       * @return {Promise} the animation callback promise
+       */
+      animate: function(element, from, to, className, options) {
+        options = prepareAnimateOptions(options);
+        options.from = options.from ? extend(options.from, from) : from;
+        options.to   = options.to   ? extend(options.to, to)     : to;
+
+        className = className || 'ng-inline-animate';
+        options.tempClasses = mergeClasses(options.tempClasses, className);
+        return $$animateQueue.push(element, 'animate', options);
+      }
+    };
+  }];
+}];
+
+/**
+ * @ngdoc service
+ * @name $animateCss
+ * @kind object
+ *
+ * @description
+ * This is the core version of `$animateCss`. By default, only when the `ngAnimate` is included,
+ * then the `$animateCss` service will actually perform animations.
+ *
+ * Click here {@link ngAnimate.$animateCss to read the documentation for $animateCss}.
+ */
+var $CoreAnimateCssProvider = function() {
+  this.$get = ['$$rAF', '$q', function($$rAF, $q) {
+
+    var RAFPromise = function() {};
+    RAFPromise.prototype = {
+      done: function(cancel) {
+        this.defer && this.defer[cancel === true ? 'reject' : 'resolve']();
+      },
+      end: function() {
+        this.done();
+      },
+      cancel: function() {
+        this.done(true);
+      },
+      getPromise: function() {
+        if (!this.defer) {
+          this.defer = $q.defer();
+        }
+        return this.defer.promise;
+      },
+      then: function(f1,f2) {
+        return this.getPromise().then(f1,f2);
+      },
+      'catch': function(f1) {
+        return this.getPromise()['catch'](f1);
+      },
+      'finally': function(f1) {
+        return this.getPromise()['finally'](f1);
+      }
+    };
+
+    return function(element, options) {
+      // there is no point in applying the styles since
+      // there is no animation that goes on at all in
+      // this version of $animateCss.
+      if (options.cleanupStyles) {
+        options.from = options.to = null;
+      }
+
+      if (options.from) {
+        element.css(options.from);
+        options.from = null;
+      }
+
+      var closed, runner = new RAFPromise();
+      return {
+        start: run,
+        end: run
+      };
+
+      function run() {
+        $$rAF(function() {
+          close();
+          if (!closed) {
+            runner.done();
+          }
+          closed = true;
+        });
+        return runner;
+      }
+
+      function close() {
+        if (options.addClass) {
+          element.addClass(options.addClass);
+          options.addClass = null;
+        }
+        if (options.removeClass) {
+          element.removeClass(options.removeClass);
+          options.removeClass = null;
+        }
+        if (options.to) {
+          element.css(options.to);
+          options.to = null;
+        }
+      }
+    };
+  }];
+};
+
+/* global stripHash: true */
+
+/**
+ * ! This is a private undocumented service !
+ *
+ * @name $browser
+ * @requires $log
+ * @description
+ * This object has two goals:
+ *
+ * - hide all the global state in the browser caused by the window object
+ * - abstract away all the browser specific features and inconsistencies
+ *
+ * For tests we provide {@link ngMock.$browser mock implementation} of the `$browser`
+ * service, which can be used for convenient testing of the application without the interaction with
+ * the real browser apis.
+ */
+/**
+ * @param {object} window The global window object.
+ * @param {object} document jQuery wrapped document.
+ * @param {object} $log window.console or an object with the same interface.
+ * @param {object} $sniffer $sniffer service
+ */
+function Browser(window, document, $log, $sniffer) {
+  var self = this,
+      rawDocument = document[0],
+      location = window.location,
+      history = window.history,
+      setTimeout = window.setTimeout,
+      clearTimeout = window.clearTimeout,
+      pendingDeferIds = {};
+
+  self.isMock = false;
+
+  var outstandingRequestCount = 0;
+  var outstandingRequestCallbacks = [];
+
+  // TODO(vojta): remove this temporary api
+  self.$$completeOutstandingRequest = completeOutstandingRequest;
+  self.$$incOutstandingRequestCount = function() { outstandingRequestCount++; };
+
+  /**
+   * Executes the `fn` function(supports currying) and decrements the `outstandingRequestCallbacks`
+   * counter. If the counter reaches 0, all the `outstandingRequestCallbacks` are executed.
+   */
+  function completeOutstandingRequest(fn) {
+    try {
+      fn.apply(null, sliceArgs(arguments, 1));
+    } finally {
+      outstandingRequestCount--;
+      if (outstandingRequestCount === 0) {
+        while (outstandingRequestCallbacks.length) {
+          try {
+            outstandingRequestCallbacks.pop()();
+          } catch (e) {
+            $log.error(e);
+          }
+        }
+      }
+    }
+  }
+
+  function getHash(url) {
+    var index = url.indexOf('#');
+    return index === -1 ? '' : url.substr(index);
+  }
+
+  /**
+   * @private
+   * Note: this method is used only by scenario runner
+   * TODO(vojta): prefix this method with $$ ?
+   * @param {function()} callback Function that will be called when no outstanding request
+   */
+  self.notifyWhenNoOutstandingRequests = function(callback) {
+    if (outstandingRequestCount === 0) {
+      callback();
+    } else {
+      outstandingRequestCallbacks.push(callback);
+    }
+  };
+
+  //////////////////////////////////////////////////////////////
+  // URL API
+  //////////////////////////////////////////////////////////////
+
+  var cachedState, lastHistoryState,
+      lastBrowserUrl = location.href,
+      baseElement = document.find('base'),
+      pendingLocation = null;
+
+  cacheState();
+  lastHistoryState = cachedState;
+
+  /**
+   * @name $browser#url
+   *
+   * @description
+   * GETTER:
+   * Without any argument, this method just returns current value of location.href.
+   *
+   * SETTER:
+   * With at least one argument, this method sets url to new value.
+   * If html5 history api supported, pushState/replaceState is used, otherwise
+   * location.href/location.replace is used.
+   * Returns its own instance to allow chaining
+   *
+   * NOTE: this api is intended for use only by the $location service. Please use the
+   * {@link ng.$location $location service} to change url.
+   *
+   * @param {string} url New url (when used as setter)
+   * @param {boolean=} replace Should new url replace current history record?
+   * @param {object=} state object to use with pushState/replaceState
+   */
+  self.url = function(url, replace, state) {
+    // In modern browsers `history.state` is `null` by default; treating it separately
+    // from `undefined` would cause `$browser.url('/foo')` to change `history.state`
+    // to undefined via `pushState`. Instead, let's change `undefined` to `null` here.
+    if (isUndefined(state)) {
+      state = null;
+    }
+
+    // Android Browser BFCache causes location, history reference to become stale.
+    if (location !== window.location) location = window.location;
+    if (history !== window.history) history = window.history;
+
+    // setter
+    if (url) {
+      var sameState = lastHistoryState === state;
+
+      // Don't change anything if previous and current URLs and states match. This also prevents
+      // IE<10 from getting into redirect loop when in LocationHashbangInHtml5Url mode.
+      // See https://github.com/angular/angular.js/commit/ffb2701
+      if (lastBrowserUrl === url && (!$sniffer.history || sameState)) {
+        return self;
+      }
+      var sameBase = lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);
+      lastBrowserUrl = url;
+      lastHistoryState = state;
+      // Don't use history API if only the hash changed
+      // due to a bug in IE10/IE11 which leads
+      // to not firing a `hashchange` nor `popstate` event
+      // in some cases (see #9143).
+      if ($sniffer.history && (!sameBase || !sameState)) {
+        history[replace ? 'replaceState' : 'pushState'](state, '', url);
+        cacheState();
+        // Do the assignment again so that those two variables are referentially identical.
+        lastHistoryState = cachedState;
+      } else {
+        if (!sameBase || pendingLocation) {
+          pendingLocation = url;
+        }
+        if (replace) {
+          location.replace(url);
+        } else if (!sameBase) {
+          location.href = url;
+        } else {
+          location.hash = getHash(url);
+        }
+        if (location.href !== url) {
+          pendingLocation = url;
+        }
+      }
+      return self;
+    // getter
+    } else {
+      // - pendingLocation is needed as browsers don't allow to read out
+      //   the new location.href if a reload happened or if there is a bug like in iOS 9 (see
+      //   https://openradar.appspot.com/22186109).
+      // - the replacement is a workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=407172
+      return pendingLocation || location.href.replace(/%27/g,"'");
+    }
+  };
+
+  /**
+   * @name $browser#state
+   *
+   * @description
+   * This method is a getter.
+   *
+   * Return history.state or null if history.state is undefined.
+   *
+   * @returns {object} state
+   */
+  self.state = function() {
+    return cachedState;
+  };
+
+  var urlChangeListeners = [],
+      urlChangeInit = false;
+
+  function cacheStateAndFireUrlChange() {
+    pendingLocation = null;
+    cacheState();
+    fireUrlChange();
+  }
+
+  function getCurrentState() {
+    try {
+      return history.state;
+    } catch (e) {
+      // MSIE can reportedly throw when there is no state (UNCONFIRMED).
+    }
+  }
+
+  // This variable should be used *only* inside the cacheState function.
+  var lastCachedState = null;
+  function cacheState() {
+    // This should be the only place in $browser where `history.state` is read.
+    cachedState = getCurrentState();
+    cachedState = isUndefined(cachedState) ? null : cachedState;
+
+    // Prevent callbacks fo fire twice if both hashchange & popstate were fired.
+    if (equals(cachedState, lastCachedState)) {
+      cachedState = lastCachedState;
+    }
+    lastCachedState = cachedState;
+  }
+
+  function fireUrlChange() {
+    if (lastBrowserUrl === self.url() && lastHistoryState === cachedState) {
+      return;
+    }
+
+    lastBrowserUrl = self.url();
+    lastHistoryState = cachedState;
+    forEach(urlChangeListeners, function(listener) {
+      listener(self.url(), cachedState);
+    });
+  }
+
+  /**
+   * @name $browser#onUrlChange
+   *
+   * @description
+   * Register callback function that will be called, when url changes.
+   *
+   * It's only called when the url is changed from outside of angular:
+   * - user types different url into address bar
+   * - user clicks on history (forward/back) button
+   * - user clicks on a link
+   *
+   * It's not called when url is changed by $browser.url() method
+   *
+   * The listener gets called with new url as parameter.
+   *
+   * NOTE: this api is intended for use only by the $location service. Please use the
+   * {@link ng.$location $location service} to monitor url changes in angular apps.
+   *
+   * @param {function(string)} listener Listener function to be called when url changes.
+   * @return {function(string)} Returns the registered listener fn - handy if the fn is anonymous.
+   */
+  self.onUrlChange = function(callback) {
+    // TODO(vojta): refactor to use node's syntax for events
+    if (!urlChangeInit) {
+      // We listen on both (hashchange/popstate) when available, as some browsers (e.g. Opera)
+      // don't fire popstate when user change the address bar and don't fire hashchange when url
+      // changed by push/replaceState
+
+      // html5 history api - popstate event
+      if ($sniffer.history) jqLite(window).on('popstate', cacheStateAndFireUrlChange);
+      // hashchange event
+      jqLite(window).on('hashchange', cacheStateAndFireUrlChange);
+
+      urlChangeInit = true;
+    }
+
+    urlChangeListeners.push(callback);
+    return callback;
+  };
+
+  /**
+   * @private
+   * Remove popstate and hashchange handler from window.
+   *
+   * NOTE: this api is intended for use only by $rootScope.
+   */
+  self.$$applicationDestroyed = function() {
+    jqLite(window).off('hashchange popstate', cacheStateAndFireUrlChange);
+  };
+
+  /**
+   * Checks whether the url has changed outside of Angular.
+   * Needs to be exported to be able to check for changes that have been done in sync,
+   * as hashchange/popstate events fire in async.
+   */
+  self.$$checkUrlChange = fireUrlChange;
+
+  //////////////////////////////////////////////////////////////
+  // Misc API
+  //////////////////////////////////////////////////////////////
+
+  /**
+   * @name $browser#baseHref
+   *
+   * @description
+   * Returns current <base href>
+   * (always relative - without domain)
+   *
+   * @returns {string} The current base href
+   */
+  self.baseHref = function() {
+    var href = baseElement.attr('href');
+    return href ? href.replace(/^(https?\:)?\/\/[^\/]*/, '') : '';
+  };
+
+  /**
+   * @name $browser#defer
+   * @param {function()} fn A function, who's execution should be deferred.
+   * @param {number=} [delay=0] of milliseconds to defer the function execution.
+   * @returns {*} DeferId that can be used to cancel the task via `$browser.defer.cancel()`.
+   *
+   * @description
+   * Executes a fn asynchronously via `setTimeout(fn, delay)`.
+   *
+   * Unlike when calling `setTimeout` directly, in test this function is mocked and instead of using
+   * `setTimeout` in tests, the fns are queued in an array, which can be programmatically flushed
+   * via `$browser.defer.flush()`.
+   *
+   */
+  self.defer = function(fn, delay) {
+    var timeoutId;
+    outstandingRequestCount++;
+    timeoutId = setTimeout(function() {
+      delete pendingDeferIds[timeoutId];
+      completeOutstandingRequest(fn);
+    }, delay || 0);
+    pendingDeferIds[timeoutId] = true;
+    return timeoutId;
+  };
+
+
+  /**
+   * @name $browser#defer.cancel
+   *
+   * @description
+   * Cancels a deferred task identified with `deferId`.
+   *
+   * @param {*} deferId Token returned by the `$browser.defer` function.
+   * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
+   *                    canceled.
+   */
+  self.defer.cancel = function(deferId) {
+    if (pendingDeferIds[deferId]) {
+      delete pendingDeferIds[deferId];
+      clearTimeout(deferId);
+      completeOutstandingRequest(noop);
+      return true;
+    }
+    return false;
+  };
+
+}
+
+function $BrowserProvider() {
+  this.$get = ['$window', '$log', '$sniffer', '$document',
+      function($window, $log, $sniffer, $document) {
+        return new Browser($window, $document, $log, $sniffer);
+      }];
+}
+
+/**
+ * @ngdoc service
+ * @name $cacheFactory
+ *
+ * @description
+ * Factory that constructs {@link $cacheFactory.Cache Cache} objects and gives access to
+ * them.
+ *
+ * ```js
+ *
+ *  var cache = $cacheFactory('cacheId');
+ *  expect($cacheFactory.get('cacheId')).toBe(cache);
+ *  expect($cacheFactory.get('noSuchCacheId')).not.toBeDefined();
+ *
+ *  cache.put("key", "value");
+ *  cache.put("another key", "another value");
+ *
+ *  // We've specified no options on creation
+ *  expect(cache.info()).toEqual({id: 'cacheId', size: 2});
+ *
+ * ```
+ *
+ *
+ * @param {string} cacheId Name or id of the newly created cache.
+ * @param {object=} options Options object that specifies the cache behavior. Properties:
+ *
+ *   - `{number=}` `capacity` — turns the cache into LRU cache.
+ *
+ * @returns {object} Newly created cache object with the following set of methods:
+ *
+ * - `{object}` `info()` — Returns id, size, and options of cache.
+ * - `{{*}}` `put({string} key, {*} value)` — Puts a new key-value pair into the cache and returns
+ *   it.
+ * - `{{*}}` `get({string} key)` — Returns cached value for `key` or undefined for cache miss.
+ * - `{void}` `remove({string} key)` — Removes a key-value pair from the cache.
+ * - `{void}` `removeAll()` — Removes all cached values.
+ * - `{void}` `destroy()` — Removes references to this cache from $cacheFactory.
+ *
+ * @example
+   <example module="cacheExampleApp">
+     <file name="index.html">
+       <div ng-controller="CacheController">
+         <input ng-model="newCacheKey" placeholder="Key">
+         <input ng-model="newCacheValue" placeholder="Value">
+         <button ng-click="put(newCacheKey, newCacheValue)">Cache</button>
+
+         <p ng-if="keys.length">Cached Values</p>
+         <div ng-repeat="key in keys">
+           <span ng-bind="key"></span>
+           <span>: </span>
+           <b ng-bind="cache.get(key)"></b>
+         </div>
+
+         <p>Cache Info</p>
+         <div ng-repeat="(key, value) in cache.info()">
+           <span ng-bind="key"></span>
+           <span>: </span>
+           <b ng-bind="value"></b>
+         </div>
+       </div>
+     </file>
+     <file name="script.js">
+       angular.module('cacheExampleApp', []).
+         controller('CacheController', ['$scope', '$cacheFactory', function($scope, $cacheFactory) {
+           $scope.keys = [];
+           $scope.cache = $cacheFactory('cacheId');
+           $scope.put = function(key, value) {
+             if (angular.isUndefined($scope.cache.get(key))) {
+               $scope.keys.push(key);
+             }
+             $scope.cache.put(key, angular.isUndefined(value) ? null : value);
+           };
+         }]);
+     </file>
+     <file name="style.css">
+       p {
+         margin: 10px 0 3px;
+       }
+     </file>
+   </example>
+ */
+function $CacheFactoryProvider() {
+
+  this.$get = function() {
+    var caches = {};
+
+    function cacheFactory(cacheId, options) {
+      if (cacheId in caches) {
+        throw minErr('$cacheFactory')('iid', "CacheId '{0}' is already taken!", cacheId);
+      }
+
+      var size = 0,
+          stats = extend({}, options, {id: cacheId}),
+          data = {},
+          capacity = (options && options.capacity) || Number.MAX_VALUE,
+          lruHash = {},
+          freshEnd = null,
+          staleEnd = null;
+
+      /**
+       * @ngdoc type
+       * @name $cacheFactory.Cache
+       *
+       * @description
+       * A cache object used to store and retrieve data, primarily used by
+       * {@link $http $http} and the {@link ng.directive:script script} directive to cache
+       * templates and other data.
+       *
+       * ```js
+       *  angular.module('superCache')
+       *    .factory('superCache', ['$cacheFactory', function($cacheFactory) {
+       *      return $cacheFactory('super-cache');
+       *    }]);
+       * ```
+       *
+       * Example test:
+       *
+       * ```js
+       *  it('should behave like a cache', inject(function(superCache) {
+       *    superCache.put('key', 'value');
+       *    superCache.put('another key', 'another value');
+       *
+       *    expect(superCache.info()).toEqual({
+       *      id: 'super-cache',
+       *      size: 2
+       *    });
+       *
+       *    superCache.remove('another key');
+       *    expect(superCache.get('another key')).toBeUndefined();
+       *
+       *    superCache.removeAll();
+       *    expect(superCache.info()).toEqual({
+       *      id: 'super-cache',
+       *      size: 0
+       *    });
+       *  }));
+       * ```
+       */
+      return caches[cacheId] = {
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#put
+         * @kind function
+         *
+         * @description
+         * Inserts a named entry into the {@link $cacheFactory.Cache Cache} object to be
+         * retrieved later, and incrementing the size of the cache if the key was not already
+         * present in the cache. If behaving like an LRU cache, it will also remove stale
+         * entries from the set.
+         *
+         * It will not insert undefined values into the cache.
+         *
+         * @param {string} key the key under which the cached data is stored.
+         * @param {*} value the value to store alongside the key. If it is undefined, the key
+         *    will not be stored.
+         * @returns {*} the value stored.
+         */
+        put: function(key, value) {
+          if (isUndefined(value)) return;
+          if (capacity < Number.MAX_VALUE) {
+            var lruEntry = lruHash[key] || (lruHash[key] = {key: key});
+
+            refresh(lruEntry);
+          }
+
+          if (!(key in data)) size++;
+          data[key] = value;
+
+          if (size > capacity) {
+            this.remove(staleEnd.key);
+          }
+
+          return value;
+        },
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#get
+         * @kind function
+         *
+         * @description
+         * Retrieves named data stored in the {@link $cacheFactory.Cache Cache} object.
+         *
+         * @param {string} key the key of the data to be retrieved
+         * @returns {*} the value stored.
+         */
+        get: function(key) {
+          if (capacity < Number.MAX_VALUE) {
+            var lruEntry = lruHash[key];
+
+            if (!lruEntry) return;
+
+            refresh(lruEntry);
+          }
+
+          return data[key];
+        },
+
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#remove
+         * @kind function
+         *
+         * @description
+         * Removes an entry from the {@link $cacheFactory.Cache Cache} object.
+         *
+         * @param {string} key the key of the entry to be removed
+         */
+        remove: function(key) {
+          if (capacity < Number.MAX_VALUE) {
+            var lruEntry = lruHash[key];
+
+            if (!lruEntry) return;
+
+            if (lruEntry == freshEnd) freshEnd = lruEntry.p;
+            if (lruEntry == staleEnd) staleEnd = lruEntry.n;
+            link(lruEntry.n,lruEntry.p);
+
+            delete lruHash[key];
+          }
+
+          delete data[key];
+          size--;
+        },
+
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#removeAll
+         * @kind function
+         *
+         * @description
+         * Clears the cache object of any entries.
+         */
+        removeAll: function() {
+          data = {};
+          size = 0;
+          lruHash = {};
+          freshEnd = staleEnd = null;
+        },
+
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#destroy
+         * @kind function
+         *
+         * @description
+         * Destroys the {@link $cacheFactory.Cache Cache} object entirely,
+         * removing it from the {@link $cacheFactory $cacheFactory} set.
+         */
+        destroy: function() {
+          data = null;
+          stats = null;
+          lruHash = null;
+          delete caches[cacheId];
+        },
+
+
+        /**
+         * @ngdoc method
+         * @name $cacheFactory.Cache#info
+         * @kind function
+         *
+         * @description
+         * Retrieve information regarding a particular {@link $cacheFactory.Cache Cache}.
+         *
+         * @returns {object} an object with the following properties:
+         *   <ul>
+         *     <li>**id**: the id of the cache instance</li>
+         *     <li>**size**: the number of entries kept in the cache instance</li>
+         *     <li>**...**: any additional properties from the options object when creating the
+         *       cache.</li>
+         *   </ul>
+         */
+        info: function() {
+          return extend({}, stats, {size: size});
+        }
+      };
+
+
+      /**
+       * makes the `entry` the freshEnd of the LRU linked list
+       */
+      function refresh(entry) {
+        if (entry != freshEnd) {
+          if (!staleEnd) {
+            staleEnd = entry;
+          } else if (staleEnd == entry) {
+            staleEnd = entry.n;
+          }
+
+          link(entry.n, entry.p);
+          link(entry, freshEnd);
+          freshEnd = entry;
+          freshEnd.n = null;
+        }
+      }
+
+
+      /**
+       * bidirectionally links two entries of the LRU linked list
+       */
+      function link(nextEntry, prevEntry) {
+        if (nextEntry != prevEntry) {
+          if (nextEntry) nextEntry.p = prevEntry; //p stands for previous, 'prev' didn't minify
+          if (prevEntry) prevEntry.n = nextEntry; //n stands for next, 'next' didn't minify
+        }
+      }
+    }
+
+
+  /**
+   * @ngdoc method
+   * @name $cacheFactory#info
+   *
+   * @description
+   * Get information about all the caches that have been created
+   *
+   * @returns {Object} - key-value map of `cacheId` to the result of calling `cache#info`
+   */
+    cacheFactory.info = function() {
+      var info = {};
+      forEach(caches, function(cache, cacheId) {
+        info[cacheId] = cache.info();
+      });
+      return info;
+    };
+
+
+  /**
+   * @ngdoc method
+   * @name $cacheFactory#get
+   *
+   * @description
+   * Get access to a cache object by the `cacheId` used when it was created.
+   *
+   * @param {string} cacheId Name or id of a cache to access.
+   * @returns {object} Cache object identified by the cacheId or undefined if no such cache.
+   */
+    cacheFactory.get = function(cacheId) {
+      return caches[cacheId];
+    };
+
+
+    return cacheFactory;
+  };
+}
+
+/**
+ * @ngdoc service
+ * @name $templateCache
+ *
+ * @description
+ * The first time a template is used, it is loaded in the template cache for quick retrieval. You
+ * can load templates directly into the cache in a `script` tag, or by consuming the
+ * `$templateCache` service directly.
+ *
+ * Adding via the `script` tag:
+ *
+ * ```html
+ *   <script type="text/ng-template" id="templateId.html">
+ *     <p>This is the content of the template</p>
+ *   </script>
+ * ```
+ *
+ * **Note:** the `script` tag containing the template does not need to be included in the `head` of
+ * the document, but it must be a descendent of the {@link ng.$rootElement $rootElement} (IE,
+ * element with ng-app attribute), otherwise the template will be ignored.
+ *
+ * Adding via the `$templateCache` service:
+ *
+ * ```js
+ * var myApp = angular.module('myApp', []);
+ * myApp.run(function($templateCache) {
+ *   $templateCache.put('templateId.html', 'This is the content of the template');
+ * });
+ * ```
+ *
+ * To retrieve the template later, simply use it in your HTML:
+ * ```html
+ * <div ng-include=" 'templateId.html' "></div>
+ * ```
+ *
+ * or get it via Javascript:
+ * ```js
+ * $templateCache.get('templateId.html')
+ * ```
+ *
+ * See {@link ng.$cacheFactory $cacheFactory}.
+ *
+ */
+function $TemplateCacheProvider() {
+  this.$get = ['$cacheFactory', function($cacheFactory) {
+    return $cacheFactory('templates');
+  }];
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *     Any commits to this file should be reviewed with security in mind.  *
+ *   Changes to this file can potentially create security vulnerabilities. *
+ *          An approval from 2 Core members with history of modifying      *
+ *                         this file is required.                          *
+ *                                                                         *
+ *  Does the change somehow allow for arbitrary javascript to be executed? *
+ *    Or allows for someone to change the prototype of built-in objects?   *
+ *     Or gives undesired access to variables likes document or window?    *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* ! VARIABLE/FUNCTION NAMING CONVENTIONS THAT APPLY TO THIS FILE!
+ *
+ * DOM-related variables:
+ *
+ * - "node" - DOM Node
+ * - "element" - DOM Element or Node
+ * - "$node" or "$element" - jqLite-wrapped node or element
+ *
+ *
+ * Compiler related stuff:
+ *
+ * - "linkFn" - linking fn of a single directive
+ * - "nodeLinkFn" - function that aggregates all linking fns for a particular node
+ * - "childLinkFn" -  function that aggregates all linking fns for child nodes of a particular node
+ * - "compositeLinkFn" - function that aggregates all linking fns for a compilation root (nodeList)
+ */
+
+
+/**
+ * @ngdoc service
+ * @name $compile
+ * @kind function
+ *
+ * @description
+ * Compiles an HTML string or DOM into a template and produces a template function, which
+ * can then be used to link {@link ng.$rootScope.Scope `scope`} and the template together.
+ *
+ * The compilation is a process of walking the DOM tree and matching DOM elements to
+ * {@link ng.$compileProvider#directive directives}.
+ *
+ * <div class="alert alert-warning">
+ * **Note:** This document is an in-depth reference of all directive options.
+ * For a gentle introduction to directives with examples of common use cases,
+ * see the {@link guide/directive directive guide}.
+ * </div>
+ *
+ * ## Comprehensive Directive API
+ *
+ * There are many different options for a directive.
+ *
+ * The difference resides in the return value of the factory function.
+ * You can either return a "Directive Definition Object" (see below) that defines the directive properties,
+ * or just the `postLink` function (all other properties will have the default values).
+ *
+ * <div class="alert alert-success">
+ * **Best Practice:** It's recommended to use the "directive definition object" form.
+ * </div>
+ *
+ * Here's an example directive declared with a Directive Definition Object:
+ *
+ * ```js
+ *   var myModule = angular.module(...);
+ *
+ *   myModule.directive('directiveName', function factory(injectables) {
+ *     var directiveDefinitionObject = {
+ *       priority: 0,
+ *       template: '<div></div>', // or // function(tElement, tAttrs) { ... },
+ *       // or
+ *       // templateUrl: 'directive.html', // or // function(tElement, tAttrs) { ... },
+ *       transclude: false,
+ *       restrict: 'A',
+ *       templateNamespace: 'html',
+ *       scope: false,
+ *       controller: function($scope, $element, $attrs, $transclude, otherInjectables) { ... },
+ *       controllerAs: 'stringIdentifier',
+ *       bindToController: false,
+ *       require: 'siblingDirectiveName', // or // ['^parentDirectiveName', '?optionalDirectiveName', '?^optionalParent'],
+ *       compile: function compile(tElement, tAttrs, transclude) {
+ *         return {
+ *           pre: function preLink(scope, iElement, iAttrs, controller) { ... },
+ *           post: function postLink(scope, iElement, iAttrs, controller) { ... }
+ *         }
+ *         // or
+ *         // return function postLink( ... ) { ... }
+ *       },
+ *       // or
+ *       // link: {
+ *       //  pre: function preLink(scope, iElement, iAttrs, controller) { ... },
+ *       //  post: function postLink(scope, iElement, iAttrs, controller) { ... }
+ *       // }
+ *       // or
+ *       // link: function postLink( ... ) { ... }
+ *     };
+ *     return directiveDefinitionObject;
+ *   });
+ * ```
+ *
+ * <div class="alert alert-warning">
+ * **Note:** Any unspecified options will use the default value. You can see the default values below.
+ * </div>
+ *
+ * Therefore the above can be simplified as:
+ *
+ * ```js
+ *   var myModule = angular.module(...);
+ *
+ *   myModule.directive('directiveName', function factory(injectables) {
+ *     var directiveDefinitionObject = {
+ *       link: function postLink(scope, iElement, iAttrs) { ... }
+ *     };
+ *     return directiveDefinitionObject;
+ *     // or
+ *     // return function postLink(scope, iElement, iAttrs) { ... }
+ *   });
+ * ```
+ *
+ *
+ *
+ * ### Directive Definition Object
+ *
+ * The directive definition object provides instructions to the {@link ng.$compile
+ * compiler}. The attributes are:
+ *
+ * #### `multiElement`
+ * When this property is set to true, the HTML compiler will collect DOM nodes between
+ * nodes with the attributes `directive-name-start` and `directive-name-end`, and group them
+ * together as the directive elements. It is recommended that this feature be used on directives
+ * which are not strictly behavioural (such as {@link ngClick}), and which
+ * do not manipulate or replace child nodes (such as {@link ngInclude}).
+ *
+ * #### `priority`
+ * When there are multiple directives defined on a single DOM element, sometimes it
+ * is necessary to specify the order in which the directives are applied. The `priority` is used
+ * to sort the directives before their `compile` functions get called. Priority is defined as a
+ * number. Directives with greater numerical `priority` are compiled first. Pre-link functions
+ * are also run in priority order, but post-link functions are run in reverse order. The order
+ * of directives with the same priority is undefined. The default priority is `0`.
+ *
+ * #### `terminal`
+ * If set to true then the current `priority` will be the last set of directives
+ * which will execute (any directives at the current priority will still execute
+ * as the order of execution on same `priority` is undefined). Note that expressions
+ * and other directives used in the directive's template will also be excluded from execution.
+ *
+ * #### `scope`
+ * The scope property can be `true`, an object or a falsy value:
+ *
+ * * **falsy:** No scope will be created for the directive. The directive will use its parent's scope.
+ *
+ * * **`true`:** A new child scope that prototypically inherits from its parent will be created for
+ * the directive's element. If multiple directives on the same element request a new scope,
+ * only one new scope is created. The new scope rule does not apply for the root of the template
+ * since the root of the template always gets a new scope.
+ *
+ * * **`{...}` (an object hash):** A new "isolate" scope is created for the directive's element. The
+ * 'isolate' scope differs from normal scope in that it does not prototypically inherit from its parent
+ * scope. This is useful when creating reusable components, which should not accidentally read or modify
+ * data in the parent scope.
+ *
+ * The 'isolate' scope object hash defines a set of local scope properties derived from attributes on the
+ * directive's element. These local properties are useful for aliasing values for templates. The keys in
+ * the object hash map to the name of the property on the isolate scope; the values define how the property
+ * is bound to the parent scope, via matching attributes on the directive's element:
+ *
+ * * `@` or `@attr` - bind a local scope property to the value of DOM attribute. The result is
+ *   always a string since DOM attributes are strings. If no `attr` name is specified  then the
+ *   attribute name is assumed to be the same as the local name.
+ *   Given `<widget my-attr="hello {{name}}">` and widget definition
+ *   of `scope: { localName:'@myAttr' }`, then widget scope property `localName` will reflect
+ *   the interpolated value of `hello {{name}}`. As the `name` attribute changes so will the
+ *   `localName` property on the widget scope. The `name` is read from the parent scope (not
+ *   component scope).
+ *
+ * * `=` or `=attr` - set up bi-directional binding between a local scope property and the
+ *   parent scope property of name defined via the value of the `attr` attribute. If no `attr`
+ *   name is specified then the attribute name is assumed to be the same as the local name.
+ *   Given `<widget my-attr="parentModel">` and widget definition of
+ *   `scope: { localModel:'=myAttr' }`, then widget scope property `localModel` will reflect the
+ *   value of `parentModel` on the parent scope. Any changes to `parentModel` will be reflected
+ *   in `localModel` and any changes in `localModel` will reflect in `parentModel`. If the parent
+ *   scope property doesn't exist, it will throw a NON_ASSIGNABLE_MODEL_EXPRESSION exception. You
+ *   can avoid this behavior using `=?` or `=?attr` in order to flag the property as optional. If
+ *   you want to shallow watch for changes (i.e. $watchCollection instead of $watch) you can use
+ *   `=*` or `=*attr` (`=*?` or `=*?attr` if the property is optional).
+ *
+ * * `&` or `&attr` - provides a way to execute an expression in the context of the parent scope.
+ *   If no `attr` name is specified then the attribute name is assumed to be the same as the
+ *   local name. Given `<widget my-attr="count = count + value">` and widget definition of
+ *   `scope: { localFn:'&myAttr' }`, then isolate scope property `localFn` will point to
+ *   a function wrapper for the `count = count + value` expression. Often it's desirable to
+ *   pass data from the isolated scope via an expression to the parent scope, this can be
+ *   done by passing a map of local variable names and values into the expression wrapper fn.
+ *   For example, if the expression is `increment(amount)` then we can specify the amount value
+ *   by calling the `localFn` as `localFn({amount: 22})`.
+ *
+ * In general it's possible to apply more than one directive to one element, but there might be limitations
+ * depending on the type of scope required by the directives. The following points will help explain these limitations.
+ * For simplicity only two directives are taken into account, but it is also applicable for several directives:
+ *
+ * * **no scope** + **no scope** => Two directives which don't require their own scope will use their parent's scope
+ * * **child scope** + **no scope** =>  Both directives will share one single child scope
+ * * **child scope** + **child scope** =>  Both directives will share one single child scope
+ * * **isolated scope** + **no scope** =>  The isolated directive will use it's own created isolated scope. The other directive will use
+ * its parent's scope
+ * * **isolated scope** + **child scope** =>  **Won't work!** Only one scope can be related to one element. Therefore these directives cannot
+ * be applied to the same element.
+ * * **isolated scope** + **isolated scope**  =>  **Won't work!** Only one scope can be related to one element. Therefore these directives
+ * cannot be applied to the same element.
+ *
+ *
+ * #### `bindToController`
+ * When an isolate scope is used for a component (see above), and `controllerAs` is used, `bindToController: true` will
+ * allow a component to have its properties bound to the controller, rather than to scope. When the controller
+ * is instantiated, the initial values of the isolate scope bindings are already available.
+ *
+ * #### `controller`
+ * Controller constructor function. The controller is instantiated before the
+ * pre-linking phase and can be accessed by other directives (see
+ * `require` attribute). This allows the directives to communicate with each other and augment
+ * each other's behavior. The controller is injectable (and supports bracket notation) with the following locals:
+ *
+ * * `$scope` - Current scope associated with the element
+ * * `$element` - Current element
+ * * `$attrs` - Current attributes object for the element
+ * * `$transclude` - A transclude linking function pre-bound to the correct transclusion scope:
+ *   `function([scope], cloneLinkingFn, futureParentElement)`.
+ *    * `scope`: optional argument to override the scope.
+ *    * `cloneLinkingFn`: optional argument to create clones of the original transcluded content.
+ *    * `futureParentElement`:
+ *        * defines the parent to which the `cloneLinkingFn` will add the cloned elements.
+ *        * default: `$element.parent()` resp. `$element` for `transclude:'element'` resp. `transclude:true`.
+ *        * only needed for transcludes that are allowed to contain non html elements (e.g. SVG elements)
+ *          and when the `cloneLinkinFn` is passed,
+ *          as those elements need to created and cloned in a special way when they are defined outside their
+ *          usual containers (e.g. like `<svg>`).
+ *        * See also the `directive.templateNamespace` property.
+ *
+ *
+ * #### `require`
+ * Require another directive and inject its controller as the fourth argument to the linking function. The
+ * `require` takes a string name (or array of strings) of the directive(s) to pass in. If an array is used, the
+ * injected argument will be an array in corresponding order. If no such directive can be
+ * found, or if the directive does not have a controller, then an error is raised (unless no link function
+ * is specified, in which case error checking is skipped). The name can be prefixed with:
+ *
+ * * (no prefix) - Locate the required controller on the current element. Throw an error if not found.
+ * * `?` - Attempt to locate the required controller or pass `null` to the `link` fn if not found.
+ * * `^` - Locate the required controller by searching the element and its parents. Throw an error if not found.
+ * * `^^` - Locate the required controller by searching the element's parents. Throw an error if not found.
+ * * `?^` - Attempt to locate the required controller by searching the element and its parents or pass
+ *   `null` to the `link` fn if not found.
+ * * `?^^` - Attempt to locate the required controller by searching the element's parents, or pass
+ *   `null` to the `link` fn if not found.
+ *
+ *
+ * #### `controllerAs`
+ * Identifier name for a reference to the controller in the directive's scope.
+ * This allows the controller to be referenced from the directive template. This is especially
+ * useful when a directive is used as component, i.e. with an `isolate` scope. It's also possible
+ * to use it in a directive without an `isolate` / `new` scope, but you need to be aware that the
+ * `controllerAs` reference might overwrite a property that already exists on the parent scope.
+ *
+ *
+ * #### `restrict`
+ * String of subset of `EACM` which restricts the directive to a specific directive
+ * declaration style. If omitted, the defaults (elements and attributes) are used.
+ *
+ * * `E` - Element name (default): `<my-directive></my-directive>`
+ * * `A` - Attribute (default): `<div my-directive="exp"></div>`
+ * * `C` - Class: `<div class="my-directive: exp;"></div>`
+ * * `M` - Comment: `<!-- directive: my-directive exp -->`
+ *
+ *
+ * #### `templateNamespace`
+ * String representing the document type used by the markup in the template.
+ * AngularJS needs this information as those elements need to be created and cloned
+ * in a special way when they are defined outside their usual containers like `<svg>` and `<math>`.
+ *
+ * * `html` - All root nodes in the template are HTML. Root nodes may also be
+ *   top-level elements such as `<svg>` or `<math>`.
+ * * `svg` - The root nodes in the template are SVG elements (excluding `<math>`).
+ * * `math` - The root nodes in the template are MathML elements (excluding `<svg>`).
+ *
+ * If no `templateNamespace` is specified, then the namespace is considered to be `html`.
+ *
+ * #### `template`
+ * HTML markup that may:
+ * * Replace the contents of the directive's element (default).
+ * * Replace the directive's element itself (if `replace` is true - DEPRECATED).
+ * * Wrap the contents of the directive's element (if `transclude` is true).
+ *
+ * Value may be:
+ *
+ * * A string. For example `<div red-on-hover>{{delete_str}}</div>`.
+ * * A function which takes two arguments `tElement` and `tAttrs` (described in the `compile`
+ *   function api below) and returns a string value.
+ *
+ *
+ * #### `templateUrl`
+ * This is similar to `template` but the template is loaded from the specified URL, asynchronously.
+ *
+ * Because template loading is asynchronous the compiler will suspend compilation of directives on that element
+ * for later when the template has been resolved.  In the meantime it will continue to compile and link
+ * sibling and parent elements as though this element had not contained any directives.
+ *
+ * The compiler does not suspend the entire compilation to wait for templates to be loaded because this
+ * would result in the whole app "stalling" until all templates are loaded asynchronously - even in the
+ * case when only one deeply nested directive has `templateUrl`.
+ *
+ * Template loading is asynchronous even if the template has been preloaded into the {@link $templateCache}
+ *
+ * You can specify `templateUrl` as a string representing the URL or as a function which takes two
+ * arguments `tElement` and `tAttrs` (described in the `compile` function api below) and returns
+ * a string value representing the url.  In either case, the template URL is passed through {@link
+ * $sce#getTrustedResourceUrl $sce.getTrustedResourceUrl}.
+ *
+ *
+ * #### `replace` ([*DEPRECATED*!], will be removed in next major release - i.e. v2.0)
+ * specify what the template should replace. Defaults to `false`.
+ *
+ * * `true` - the template will replace the directive's element.
+ * * `false` - the template will replace the contents of the directive's element.
+ *
+ * The replacement process migrates all of the attributes / classes from the old element to the new
+ * one. See the {@link guide/directive#template-expanding-directive
+ * Directives Guide} for an example.
+ *
+ * There are very few scenarios where element replacement is required for the application function,
+ * the main one being reusable custom components that are used within SVG contexts
+ * (because SVG doesn't work with custom elements in the DOM tree).
+ *
+ * #### `transclude`
+ * Extract the contents of the element where the directive appears and make it available to the directive.
+ * The contents are compiled and provided to the directive as a **transclusion function**. See the
+ * {@link $compile#transclusion Transclusion} section below.
+ *
+ * There are two kinds of transclusion depending upon whether you want to transclude just the contents of the
+ * directive's element or the entire element:
+ *
+ * * `true` - transclude the content (i.e. the child nodes) of the directive's element.
+ * * `'element'` - transclude the whole of the directive's element including any directives on this
+ *   element that defined at a lower priority than this directive. When used, the `template`
+ *   property is ignored.
+ *
+ *
+ * #### `compile`
+ *
+ * ```js
+ *   function compile(tElement, tAttrs, transclude) { ... }
+ * ```
+ *
+ * The compile function deals with transforming the template DOM. Since most directives do not do
+ * template transformation, it is not used often. The compile function takes the following arguments:
+ *
+ *   * `tElement` - template element - The element where the directive has been declared. It is
+ *     safe to do template transformation on the element and child elements only.
+ *
+ *   * `tAttrs` - template attributes - Normalized list of attributes declared on this element shared
+ *     between all directive compile functions.
+ *
+ *   * `transclude` -  [*DEPRECATED*!] A transclude linking function: `function(scope, cloneLinkingFn)`
+ *
+ * <div class="alert alert-warning">
+ * **Note:** The template instance and the link instance may be different objects if the template has
+ * been cloned. For this reason it is **not** safe to do anything other than DOM transformations that
+ * apply to all cloned DOM nodes within the compile function. Specifically, DOM listener registration
+ * should be done in a linking function rather than in a compile function.
+ * </div>
+
+ * <div class="alert alert-warning">
+ * **Note:** The compile function cannot handle directives that recursively use themselves in their
+ * own templates or compile functions. Compiling these directives results in an infinite loop and a
+ * stack overflow errors.
+ *
+ * This can be avoided by manually using $compile in the postLink function to imperatively compile
+ * a directive's template instead of relying on automatic template compilation via `template` or
+ * `templateUrl` declaration or manual compilation inside the compile function.
+ * </div>
+ *
+ * <div class="alert alert-danger">
+ * **Note:** The `transclude` function that is passed to the compile function is deprecated, as it
+ *   e.g. does not know about the right outer scope. Please use the transclude function that is passed
+ *   to the link function instead.
+ * </div>
+
+ * A compile function can have a return value which can be either a function or an object.
+ *
+ * * returning a (post-link) function - is equivalent to registering the linking function via the
+ *   `link` property of the config object when the compile function is empty.
+ *
+ * * returning an object with function(s) registered via `pre` and `post` properties - allows you to
+ *   control when a linking function should be called during the linking phase. See info about
+ *   pre-linking and post-linking functions below.
+ *
+ *
+ * #### `link`
+ * This property is used only if the `compile` property is not defined.
+ *
+ * ```js
+ *   function link(scope, iElement, iAttrs, controller, transcludeFn) { ... }
+ * ```
+ *
+ * The link function is responsible for registering DOM listeners as well as updating the DOM. It is
+ * executed after the template has been cloned. This is where most of the directive logic will be
+ * put.
+ *
+ *   * `scope` - {@link ng.$rootScope.Scope Scope} - The scope to be used by the
+ *     directive for registering {@link ng.$rootScope.Scope#$watch watches}.
+ *
+ *   * `iElement` - instance element - The element where the directive is to be used. It is safe to
+ *     manipulate the children of the element only in `postLink` function since the children have
+ *     already been linked.
+ *
+ *   * `iAttrs` - instance attributes - Normalized list of attributes declared on this element shared
+ *     between all directive linking functions.
+ *
+ *   * `controller` - the directive's required controller instance(s) - Instances are shared
+ *     among all directives, which allows the directives to use the controllers as a communication
+ *     channel. The exact value depends on the directive's `require` property:
+ *       * no controller(s) required: the directive's own controller, or `undefined` if it doesn't have one
+ *       * `string`: the controller instance
+ *       * `array`: array of controller instances
+ *
+ *     If a required controller cannot be found, and it is optional, the instance is `null`,
+ *     otherwise the {@link error:$compile:ctreq Missing Required Controller} error is thrown.
+ *
+ *     Note that you can also require the directive's own controller - it will be made available like
+ *     any other controller.
+ *
+ *   * `transcludeFn` - A transclude linking function pre-bound to the correct transclusion scope.
+ *     This is the same as the `$transclude`
+ *     parameter of directive controllers, see there for details.
+ *     `function([scope], cloneLinkingFn, futureParentElement)`.
+ *
+ * #### Pre-linking function
+ *
+ * Executed before the child elements are linked. Not safe to do DOM transformation since the
+ * compiler linking function will fail to locate the correct elements for linking.
+ *
+ * #### Post-linking function
+ *
+ * Executed after the child elements are linked.
+ *
+ * Note that child elements that contain `templateUrl` directives will not have been compiled
+ * and linked since they are waiting for their template to load asynchronously and their own
+ * compilation and linking has been suspended until that occurs.
+ *
+ * It is safe to do DOM transformation in the post-linking function on elements that are not waiting
+ * for their async templates to be resolved.
+ *
+ *
+ * ### Transclusion
+ *
+ * Transclusion is the process of extracting a collection of DOM elements from one part of the DOM and
+ * copying them to another part of the DOM, while maintaining their connection to the original AngularJS
+ * scope from where they were taken.
+ *
+ * Transclusion is used (often with {@link ngTransclude}) to insert the
+ * original contents of a directive's element into a specified place in the template of the directive.
+ * The benefit of transclusion, over simply moving the DOM elements manually, is that the transcluded
+ * content has access to the properties on the scope from which it was taken, even if the directive
+ * has isolated scope.
+ * See the {@link guide/directive#creating-a-directive-that-wraps-other-elements Directives Guide}.
+ *
+ * This makes it possible for the widget to have private state for its template, while the transcluded
+ * content has access to its originating scope.
+ *
+ * <div class="alert alert-warning">
+ * **Note:** When testing an element transclude directive you must not place the directive at the root of the
+ * DOM fragment that is being compiled. See {@link guide/unit-testing#testing-transclusion-directives
+ * Testing Transclusion Directives}.
+ * </div>
+ *
+ * #### Transclusion Functions
+ *
+ * When a directive requests transclusion, the compiler extracts its contents and provides a **transclusion
+ * function** to the directive's `link` function and `controller`. This transclusion function is a special
+ * **linking function** that will return the compiled contents linked to a new transclusion scope.
+ *
+ * <div class="alert alert-info">
+ * If you are just using {@link ngTransclude} then you don't need to worry about this function, since
+ * ngTransclude will deal with it for us.
+ * </div>
+ *
+ * If you want to manually control the insertion and removal of the transcluded content in your directive
+ * then you must use this transclude function. When you call a transclude function it returns a a jqLite/JQuery
+ * object that contains the compiled DOM, which is linked to the correct transclusion scope.
+ *
+ * When you call a transclusion function you can pass in a **clone attach function**. This function accepts
+ * two parameters, `function(clone, scope) { ... }`, where the `clone` is a fresh compiled copy of your transcluded
+ * content and the `scope` is the newly created transclusion scope, to which the clone is bound.
+ *
+ * <div class="alert alert-info">
+ * **Best Practice**: Always provide a `cloneFn` (clone attach function) when you call a translude function
+ * since you then get a fresh clone of the original DOM and also have access to the new transclusion scope.
+ * </div>
+ *
+ * It is normal practice to attach your transcluded content (`clone`) to the DOM inside your **clone
+ * attach function**:
+ *
+ * ```js
+ * var transcludedContent, transclusionScope;
+ *
+ * $transclude(function(clone, scope) {
+ *   element.append(clone);
+ *   transcludedContent = clone;
+ *   transclusionScope = scope;
+ * });
+ * ```
+ *
+ * Later, if you want to remove the transcluded content from your DOM then you should also destroy the
+ * associated transclusion scope:
+ *
+ * ```js
+ * transcludedContent.remove();
+ * transclusionScope.$destroy();
+ * ```
+ *
+ * <div class="alert alert-info">
+ * **Best Practice**: if you intend to add and remove transcluded content manually in your directive
+ * (by calling the transclude function to get the DOM and calling `element.remove()` to remove it),
+ * then you are also responsible for calling `$destroy` on the transclusion scope.
+ * </div>
+ *
+ * The built-in DOM manipulation directives, such as {@link ngIf}, {@link ngSwitch} and {@link ngRepeat}
+ * automatically destroy their transluded clones as necessary so you do not need to worry about this if
+ * you are simply using {@link ngTransclude} to inject the transclusion into your directive.
+ *
+ *
+ * #### Transclusion Scopes
+ *
+ * When you call a transclude function it returns a DOM fragment that is pre-bound to a **transclusion
+ * scope**. This scope is special, in that it is a child of the directive's scope (and so gets destroyed
+ * when the directive's scope gets destroyed) but it inherits the properties of the scope from which it
+ * was taken.
+ *
+ * For example consider a directive that uses transclusion and isolated scope. The DOM hierarchy might look
+ * like this:
+ *
+ * ```html
+ * <div ng-app>
+ *   <div isolate>
+ *     <div transclusion>
+ *     </div>
+ *   </div>
+ * </div>
+ * ```
+ *
+ * The `$parent` scope hierarchy will look like this:
+ *
+ * ```
+ * - $rootScope
+ *   - isolate
+ *     - transclusion
+ * ```
+ *
+ * but the scopes will inherit prototypically from different scopes to their `$parent`.
+ *
+ * ```
+ * - $rootScope
+ *   - transclusion
+ * - isolate
+ * ```
+ *
+ *
+ * ### Attributes
+ *
+ * The {@link ng.$compile.directive.Attributes Attributes} object - passed as a parameter in the
+ * `link()` or `compile()` functions. It has a variety of uses.
+ *
+ * accessing *Normalized attribute names:*
+ * Directives like 'ngBind' can be expressed in many ways: 'ng:bind', `data-ng-bind`, or 'x-ng-bind'.
+ * the attributes object allows for normalized access to
+ *   the attributes.
+ *
+ * * *Directive inter-communication:* All directives share the same instance of the attributes
+ *   object which allows the directives to use the attributes object as inter directive
+ *   communication.
+ *
+ * * *Supports interpolation:* Interpolation attributes are assigned to the attribute object
+ *   allowing other directives to read the interpolated value.
+ *
+ * * *Observing interpolated attributes:* Use `$observe` to observe the value changes of attributes
+ *   that contain interpolation (e.g. `src="{{bar}}"`). Not only is this very efficient but it's also
+ *   the only way to easily get the actual value because during the linking phase the interpolation
+ *   hasn't been evaluated yet and so the value is at this time set to `undefined`.
+ *
+ * ```js
+ * function linkingFn(scope, elm, attrs, ctrl) {
+ *   // get the attribute value
+ *   console.log(attrs.ngModel);
+ *
+ *   // change the attribute
+ *   attrs.$set('ngModel', 'new value');
+ *
+ *   // observe changes to interpolated attribute
+ *   attrs.$observe('ngModel', function(value) {
+ *     console.log('ngModel has changed value to ' + value);
+ *   });
+ * }
+ * ```
+ *
+ * ## Example
+ *
+ * <div class="alert alert-warning">
+ * **Note**: Typically directives are registered with `module.directive`. The example below is
+ * to illustrate how `$compile` works.
+ * </div>
+ *
+ <example module="compileExample">
+   <file name="index.html">
+    <script>
+      angular.module('compileExample', [], function($compileProvider) {
+        // configure new 'compile' directive by passing a directive
+        // factory function. The factory function injects the '$compile'
+        $compileProvider.directive('compile', function($compile) {
+          // directive factory creates a link function
+          return function(scope, element, attrs) {
+            scope.$watch(
+              function(scope) {
+                 // watch the 'compile' expression for changes
+                return scope.$eval(attrs.compile);
+              },
+              function(value) {
+                // when the 'compile' expression changes
+                // assign it into the current DOM
+                element.html(value);
+
+                // compile the new DOM and link it to the current
+                // scope.
+                // NOTE: we only compile .childNodes so that
+                // we don't get into infinite loop compiling ourselves
+                $compile(element.contents())(scope);
+              }
+            );
+          };
+        });
+      })
+      .controller('GreeterController', ['$scope', function($scope) {
+        $scope.name = 'Angular';
+        $scope.html = 'Hello {{name}}';
+      }]);
+    </script>
+    <div ng-controller="GreeterController">
+      <input ng-model="name"> <br/>
+      <textarea ng-model="html"></textarea> <br/>
+      <div compile="html"></div>
+    </div>
+   </file>
+   <file name="protractor.js" type="protractor">
+     it('should auto compile', function() {
+       var textarea = $('textarea');
+       var output = $('div[compile]');
+       // The initial state reads 'Hello Angular'.
+       expect(output.getText()).toBe('Hello Angular');
+       textarea.clear();
+       textarea.sendKeys('{{name}}!');
+       expect(output.getText()).toBe('Angular!');
+     });
+   </file>
+ </example>
+
+ *
+ *
+ * @param {string|DOMElement} element Element or HTML string to compile into a template function.
+ * @param {function(angular.Scope, cloneAttachFn=)} transclude function available to directives - DEPRECATED.
+ *
+ * <div class="alert alert-danger">
+ * **Note:** Passing a `transclude` function to the $compile function is deprecated, as it
+ *   e.g. will not use the right outer scope. Please pass the transclude function as a
+ *   `parentBoundTranscludeFn` to the link function instead.
+ * </div>
+ *
+ * @param {number} maxPriority only apply directives lower than given priority (Only effects the
+ *                 root element(s), not their children)
+ * @returns {function(scope, cloneAttachFn=, options=)} a link function which is used to bind template
+ * (a DOM element/tree) to a scope. Where:
+ *
+ *  * `scope` - A {@link ng.$rootScope.Scope Scope} to bind to.
+ *  * `cloneAttachFn` - If `cloneAttachFn` is provided, then the link function will clone the
+ *  `template` and call the `cloneAttachFn` function allowing the caller to attach the
+ *  cloned elements to the DOM document at the appropriate place. The `cloneAttachFn` is
+ *  called as: <br/> `cloneAttachFn(clonedElement, scope)` where:
+ *
+ *      * `clonedElement` - is a clone of the original `element` passed into the compiler.
+ *      * `scope` - is the current scope with which the linking function is working with.
+ *
+ *  * `options` - An optional object hash with linking options. If `options` is provided, then the following
+ *  keys may be used to control linking behavior:
+ *
+ *      * `parentBoundTranscludeFn` - the transclude function made available to
+ *        directives; if given, it will be passed through to the link functions of
+ *        directives found in `element` during compilation.
+ *      * `transcludeControllers` - an object hash with keys that map controller names
+ *        to controller instances; if given, it will make the controllers
+ *        available to directives.
+ *      * `futureParentElement` - defines the parent to which the `cloneAttachFn` will add
+ *        the cloned elements; only needed for transcludes that are allowed to contain non html
+ *        elements (e.g. SVG elements). See also the directive.controller property.
+ *
+ * Calling the linking function returns the element of the template. It is either the original
+ * element passed in, or the clone of the element if the `cloneAttachFn` is provided.
+ *
+ * After linking the view is not updated until after a call to $digest which typically is done by
+ * Angular automatically.
+ *
+ * If you need access to the bound view, there are two ways to do it:
+ *
+ * - If you are not asking the linking function to clone the template, create the DOM element(s)
+ *   before you send them to the compiler and keep this reference around.
+ *   ```js
+ *     var element = $compile('<p>{{total}}</p>')(scope);
+ *   ```
+ *
+ * - if on the other hand, you need the element to be cloned, the view reference from the original
+ *   example would not point to the clone, but rather to the original template that was cloned. In
+ *   this case, you can access the clone via the cloneAttachFn:
+ *   ```js
+ *     var templateElement = angular.element('<p>{{total}}</p>'),
+ *         scope = ....;
+ *
+ *     var clonedElement = $compile(templateElement)(scope, function(clonedElement, scope) {
+ *       //attach the clone to DOM document at the right place
+ *     });
+ *
+ *     //now we have reference to the cloned DOM via `clonedElement`
+ *   ```
+ *
+ *
+ * For information on how the compiler works, see the
+ * {@link guide/compiler Angular HTML Compiler} section of the Developer Guide.
+ */
+
+var $compileMinErr = minErr('$compile');
+
+/**
+ * @ngdoc provider
+ * @name $compileProvider
+ *
+ * @description
+ */
+$CompileProvider.$inject = ['$provide', '$$sanitizeUriProvider'];
+function $CompileProvider($provide, $$sanitizeUriProvider) {
+  var hasDirectives = {},
+      Suffix = 'Directive',
+      COMMENT_DIRECTIVE_REGEXP = /^\s*directive\:\s*([\w\-]+)\s+(.*)$/,
+      CLASS_DIRECTIVE_REGEXP = /(([\w\-]+)(?:\:([^;]+))?;?)/,
+      ALL_OR_NOTHING_ATTRS = makeMap('ngSrc,ngSrcset,src,srcset'),
+      REQUIRE_PREFIX_REGEXP = /^(?:(\^\^?)?(\?)?(\^\^?)?)?/;
+
+  // Ref: http://developers.whatwg.org/webappapis.html#event-handler-idl-attributes
+  // The assumption is that future DOM event attribute names will begin with
+  // 'on' and be composed of only English letters.
+  var EVENT_HANDLER_ATTR_REGEXP = /^(on[a-z]+|formaction)$/;
+
+  function parseIsolateBindings(scope, directiveName, isController) {
+    var LOCAL_REGEXP = /^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/;
+
+    var bindings = {};
+
+    forEach(scope, function(definition, scopeName) {
+      var match = definition.match(LOCAL_REGEXP);
+
+      if (!match) {
+        throw $compileMinErr('iscp',
+            "Invalid {3} for directive '{0}'." +
+            " Definition: {... {1}: '{2}' ...}",
+            directiveName, scopeName, definition,
+            (isController ? "controller bindings definition" :
+            "isolate scope definition"));
+      }
+
+      bindings[scopeName] = {
+        mode: match[1][0],
+        collection: match[2] === '*',
+        optional: match[3] === '?',
+        attrName: match[4] || scopeName
+      };
+    });
+
+    return bindings;
+  }
+
+  function parseDirectiveBindings(directive, directiveName) {
+    var bindings = {
+      isolateScope: null,
+      bindToController: null
+    };
+    if (isObject(directive.scope)) {
+      if (directive.bindToController === true) {
+        bindings.bindToController = parseIsolateBindings(directive.scope,
+                                                         directiveName, true);
+        bindings.isolateScope = {};
+      } else {
+        bindings.isolateScope = parseIsolateBindings(directive.scope,
+                                                     directiveName, false);
+      }
+    }
+    if (isObject(directive.bindToController)) {
+      bindings.bindToController =
+          parseIsolateBindings(directive.bindToController, directiveName, true);
+    }
+    if (isObject(bindings.bindToController)) {
+      var controller = directive.controller;
+      var controllerAs = directive.controllerAs;
+      if (!controller) {
+        // There is no controller, there may or may not be a controllerAs property
+        throw $compileMinErr('noctrl',
+              "Cannot bind to controller without directive '{0}'s controller.",
+              directiveName);
+      } else if (!identifierForController(controller, controllerAs)) {
+        // There is a controller, but no identifier or controllerAs property
+        throw $compileMinErr('noident',
+              "Cannot bind to controller without identifier for directive '{0}'.",
+              directiveName);
+      }
+    }
+    return bindings;
+  }
+
+  function assertValidDirectiveName(name) {
+    var letter = name.charAt(0);
+    if (!letter || letter !== lowercase(letter)) {
+      throw $compileMinErr('baddir', "Directive name '{0}' is invalid. The first character must be a lowercase letter", name);
+    }
+    if (name !== name.trim()) {
+      throw $compileMinErr('baddir',
+            "Directive name '{0}' is invalid. The name should not contain leading or trailing whitespaces",
+            name);
+    }
+  }
+
+  /**
+   * @ngdoc method
+   * @name $compileProvider#directive
+   * @kind function
+   *
+   * @description
+   * Register a new directive with the compiler.
+   *
+   * @param {string|Object} name Name of the directive in camel-case (i.e. <code>ngBind</code> which
+   *    will match as <code>ng-bind</code>), or an object map of directives where the keys are the
+   *    names and the values are the factories.
+   * @param {Function|Array} directiveFactory An injectable directive factory function. See
+   *    {@link guide/directive} for more info.
+   * @returns {ng.$compileProvider} Self for chaining.
+   */
+   this.directive = function registerDirective(name, directiveFactory) {
+    assertNotHasOwnProperty(name, 'directive');
+    if (isString(name)) {
+      assertValidDirectiveName(name);
+      assertArg(directiveFactory, 'directiveFactory');
+      if (!hasDirectives.hasOwnProperty(name)) {
+        hasDirectives[name] = [];
+        $provide.factory(name + Suffix, ['$injector', '$exceptionHandler',
+          function($injector, $exceptionHandler) {
+            var directives = [];
+            forEach(hasDirectives[name], function(directiveFactory, index) {
+              try {
+                var directive = $injector.invoke(directiveFactory);
+                if (isFunction(directive)) {
+                  directive = { compile: valueFn(directive) };
+                } else if (!directive.compile && directive.link) {
+                  directive.compile = valueFn(directive.link);
+                }
+                directive.priority = directive.priority || 0;
+                directive.index = index;
+                directive.name = directive.name || name;
+                directive.require = directive.require || (directive.controller && directive.name);
+                directive.restrict = directive.restrict || 'EA';
+                var bindings = directive.$$bindings =
+                    parseDirectiveBindings(directive, directive.name);
+                if (isObject(bindings.isolateScope)) {
+                  directive.$$isolateBindings = bindings.isolateScope;
+                }
+                directive.$$moduleName = directiveFactory.$$moduleName;
+                directives.push(directive);
+              } catch (e) {
+                $exceptionHandler(e);
+              }
+            });
+            return directives;
+          }]);
+      }
+      hasDirectives[name].push(directiveFactory);
+    } else {
+      forEach(name, reverseParams(registerDirective));
+    }
+    return this;
+  };
+
+
+  /**
+   * @ngdoc method
+   * @name $compileProvider#aHrefSanitizationWhitelist
+   * @kind function
+   *
+   * @description
+   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+   * urls during a[href] sanitization.
+   *
+   * The sanitization is a security measure aimed at preventing XSS attacks via html links.
+   *
+   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
+   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
+   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
+   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
+   *
+   * @param {RegExp=} regexp New regexp to whitelist urls with.
+   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
+   *    chaining otherwise.
+   */
+  this.aHrefSanitizationWhitelist = function(regexp) {
+    if (isDefined(regexp)) {
+      $$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);
+      return this;
+    } else {
+      return $$sanitizeUriProvider.aHrefSanitizationWhitelist();
+    }
+  };
+
+
+  /**
+   * @ngdoc method
+   * @name $compileProvider#imgSrcSanitizationWhitelist
+   * @kind function
+   *
+   * @description
+   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+   * urls during img[src] sanitization.
+   *
+   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
+   *
+   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
+   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
+   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
+   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
+   *
+   * @param {RegExp=} regexp New regexp to whitelist urls with.
+   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
+   *    chaining otherwise.
+   */
+  this.imgSrcSanitizationWhitelist = function(regexp) {
+    if (isDefined(regexp)) {
+      $$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);
+      return this;
+    } else {
+      return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name  $compileProvider#debugInfoEnabled
+   *
+   * @param {boolean=} enabled update the debugInfoEnabled state if provided, otherwise just return the
+   * current debugInfoEnabled state
+   * @returns {*} current value if used as getter or itself (chaining) if used as setter
+   *
+   * @kind function
+   *
+   * @description
+   * Call this method to enable/disable various debug runtime information in the compiler such as adding
+   * binding information and a reference to the current scope on to DOM elements.
+   * If enabled, the compiler will add the following to DOM elements that have been bound to the scope
+   * * `ng-binding` CSS class
+   * * `$binding` data property containing an array of the binding expressions
+   *
+   * You may want to disable this in production for a significant performance boost. See
+   * {@link guide/production#disabling-debug-data Disabling Debug Data} for more.
+   *
+   * The default value is true.
+   */
+  var debugInfoEnabled = true;
+  this.debugInfoEnabled = function(enabled) {
+    if (isDefined(enabled)) {
+      debugInfoEnabled = enabled;
+      return this;
+    }
+    return debugInfoEnabled;
+  };
+
+  this.$get = [
+            '$injector', '$interpolate', '$exceptionHandler', '$templateRequest', '$parse',
+            '$controller', '$rootScope', '$document', '$sce', '$animate', '$$sanitizeUri',
+    function($injector,   $interpolate,   $exceptionHandler,   $templateRequest,   $parse,
+             $controller,   $rootScope,   $document,   $sce,   $animate,   $$sanitizeUri) {
+
+    var Attributes = function(element, attributesToCopy) {
+      if (attributesToCopy) {
+        var keys = Object.keys(attributesToCopy);
+        var i, l, key;
+
+        for (i = 0, l = keys.length; i < l; i++) {
+          key = keys[i];
+          this[key] = attributesToCopy[key];
+        }
+      } else {
+        this.$attr = {};
+      }
+
+      this.$$element = element;
+    };
+
+    Attributes.prototype = {
+      /**
+       * @ngdoc method
+       * @name $compile.directive.Attributes#$normalize
+       * @kind function
+       *
+       * @description
+       * Converts an attribute name (e.g. dash/colon/underscore-delimited string, optionally prefixed with `x-` or
+       * `data-`) to its normalized, camelCase form.
+       *
+       * Also there is special case for Moz prefix starting with upper case letter.
+       *
+       * For further information check out the guide on {@link guide/directive#matching-directives Matching Directives}
+       *
+       * @param {string} name Name to normalize
+       */
+      $normalize: directiveNormalize,
+
+
+      /**
+       * @ngdoc method
+       * @name $compile.directive.Attributes#$addClass
+       * @kind function
+       *
+       * @description
+       * Adds the CSS class value specified by the classVal parameter to the element. If animations
+       * are enabled then an animation will be triggered for the class addition.
+       *
+       * @param {string} classVal The className value that will be added to the element
+       */
+      $addClass: function(classVal) {
+        if (classVal && classVal.length > 0) {
+          $animate.addClass(this.$$element, classVal);
+        }
+      },
+
+      /**
+       * @ngdoc method
+       * @name $compile.directive.Attributes#$removeClass
+       * @kind function
+       *
+       * @description
+       * Removes the CSS class value specified by the classVal parameter from the element. If
+       * animations are enabled then an animation will be triggered for the class removal.
+       *
+       * @param {string} classVal The className value that will be removed from the element
+       */
+      $removeClass: function(classVal) {
+        if (classVal && classVal.length > 0) {
+          $animate.removeClass(this.$$element, classVal);
+        }
+      },
+
+      /**
+       * @ngdoc method
+       * @name $compile.directive.Attributes#$updateClass
+       * @kind function
+       *
+       * @description
+       * Adds and removes the appropriate CSS class values to the element based on the difference
+       * between the new and old CSS class values (specified as newClasses and oldClasses).
+       *
+       * @param {string} newClasses The current CSS className value
+       * @param {string} oldClasses The former CSS className value
+       */
+      $updateClass: function(newClasses, oldClasses) {
+        var toAdd = tokenDifference(newClasses, oldClasses);
+        if (toAdd && toAdd.length) {
+          $animate.addClass(this.$$element, toAdd);
+        }
+
+        var toRemove = tokenDifference(oldClasses, newClasses);
+        if (toRemove && toRemove.length) {
+          $animate.removeClass(this.$$element, toRemove);
+        }
+      },
+
+      /**
+       * Set a normalized attribute on the element in a way such that all directives
+       * can share the attribute. This function properly handles boolean attributes.
+       * @param {string} key Normalized key. (ie ngAttribute)
+       * @param {string|boolean} value The value to set. If `null` attribute will be deleted.
+       * @param {boolean=} writeAttr If false, does not write the value to DOM element attribute.
+       *     Defaults to true.
+       * @param {string=} attrName Optional none normalized name. Defaults to key.
+       */
+      $set: function(key, value, writeAttr, attrName) {
+        // TODO: decide whether or not to throw an error if "class"
+        //is set through this function since it may cause $updateClass to
+        //become unstable.
+
+        var node = this.$$element[0],
+            booleanKey = getBooleanAttrName(node, key),
+            aliasedKey = getAliasedAttrName(key),
+            observer = key,
+            nodeName;
+
+        if (booleanKey) {
+          this.$$element.prop(key, value);
+          attrName = booleanKey;
+        } else if (aliasedKey) {
+          this[aliasedKey] = value;
+          observer = aliasedKey;
+        }
+
+        this[key] = value;
+
+        // translate normalized key to actual key
+        if (attrName) {
+          this.$attr[key] = attrName;
+        } else {
+          attrName = this.$attr[key];
+          if (!attrName) {
+            this.$attr[key] = attrName = snake_case(key, '-');
+          }
+        }
+
+        nodeName = nodeName_(this.$$element);
+
+        if ((nodeName === 'a' && key === 'href') ||
+            (nodeName === 'img' && key === 'src')) {
+          // sanitize a[href] and img[src] values
+          this[key] = value = $$sanitizeUri(value, key === 'src');
+        } else if (nodeName === 'img' && key === 'srcset') {
+          // sanitize img[srcset] values
+          var result = "";
+
+          // first check if there are spaces because it's not the same pattern
+          var trimmedSrcset = trim(value);
+          //                (   999x   ,|   999w   ,|   ,|,   )
+          var srcPattern = /(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;
+          var pattern = /\s/.test(trimmedSrcset) ? srcPattern : /(,)/;
+
+          // split srcset into tuple of uri and descriptor except for the last item
+          var rawUris = trimmedSrcset.split(pattern);
+
+          // for each tuples
+          var nbrUrisWith2parts = Math.floor(rawUris.length / 2);
+          for (var i = 0; i < nbrUrisWith2parts; i++) {
+            var innerIdx = i * 2;
+            // sanitize the uri
+            result += $$sanitizeUri(trim(rawUris[innerIdx]), true);
+            // add the descriptor
+            result += (" " + trim(rawUris[innerIdx + 1]));
+          }
+
+          // split the last item into uri and descriptor
+          var lastTuple = trim(rawUris[i * 2]).split(/\s/);
+
+          // sanitize the last uri
+          result += $$sanitizeUri(trim(lastTuple[0]), true);
+
+          // and add the last descriptor if any
+          if (lastTuple.length === 2) {
+            result += (" " + trim(lastTuple[1]));
+          }
+          this[key] = value = result;
+        }
+
+        if (writeAttr !== false) {
+          if (value === null || isUndefined(value)) {
+            this.$$element.removeAttr(attrName);
+          } else {
+            this.$$element.attr(attrName, value);
+          }
+        }
+
+        // fire observers
+        var $$observers = this.$$observers;
+        $$observers && forEach($$observers[observer], function(fn) {
+          try {
+            fn(value);
+          } catch (e) {
+            $exceptionHandler(e);
+          }
+        });
+      },
+
+
+      /**
+       * @ngdoc method
+       * @name $compile.directive.Attributes#$observe
+       * @kind function
+       *
+       * @description
+       * Observes an interpolated attribute.
+       *
+       * The observer function will be invoked once during the next `$digest` following
+       * compilation. The observer is then invoked whenever the interpolated value
+       * changes.
+       *
+       * @param {string} key Normalized key. (ie ngAttribute) .
+       * @param {function(interpolatedValue)} fn Function that will be called whenever
+                the interpolated value of the attribute changes.
+       *        See the {@link guide/directive#text-and-attribute-bindings Directives} guide for more info.
+       * @returns {function()} Returns a deregistration function for this observer.
+       */
+      $observe: function(key, fn) {
+        var attrs = this,
+            $$observers = (attrs.$$observers || (attrs.$$observers = createMap())),
+            listeners = ($$observers[key] || ($$observers[key] = []));
+
+        listeners.push(fn);
+        $rootScope.$evalAsync(function() {
+          if (!listeners.$$inter && attrs.hasOwnProperty(key) && !isUndefined(attrs[key])) {
+            // no one registered attribute interpolation function, so lets call it manually
+            fn(attrs[key]);
+          }
+        });
+
+        return function() {
+          arrayRemove(listeners, fn);
+        };
+      }
+    };
+
+
+    function safeAddClass($element, className) {
+      try {
+        $element.addClass(className);
+      } catch (e) {
+        // ignore, since it means that we are trying to set class on
+        // SVG element, where class name is read-only.
+      }
+    }
+
+
+    var startSymbol = $interpolate.startSymbol(),
+        endSymbol = $interpolate.endSymbol(),
+        denormalizeTemplate = (startSymbol == '{{' || endSymbol  == '}}')
+            ? identity
+            : function denormalizeTemplate(template) {
+              return template.replace(/\{\{/g, startSymbol).replace(/}}/g, endSymbol);
+        },
+        NG_ATTR_BINDING = /^ngAttr[A-Z]/;
+
+    compile.$$addBindingInfo = debugInfoEnabled ? function $$addBindingInfo($element, binding) {
+      var bindings = $element.data('$binding') || [];
+
+      if (isArray(binding)) {
+        bindings = bindings.concat(binding);
+      } else {
+        bindings.push(binding);
+      }
+
+      $element.data('$binding', bindings);
+    } : noop;
+
+    compile.$$addBindingClass = debugInfoEnabled ? function $$addBindingClass($element) {
+      safeAddClass($element, 'ng-binding');
+    } : noop;
+
+    compile.$$addScopeInfo = debugInfoEnabled ? function $$addScopeInfo($element, scope, isolated, noTemplate) {
+      var dataName = isolated ? (noTemplate ? '$isolateScopeNoTemplate' : '$isolateScope') : '$scope';
+      $element.data(dataName, scope);
+    } : noop;
+
+    compile.$$addScopeClass = debugInfoEnabled ? function $$addScopeClass($element, isolated) {
+      safeAddClass($element, isolated ? 'ng-isolate-scope' : 'ng-scope');
+    } : noop;
+
+    return compile;
+
+    //================================
+
+    function compile($compileNodes, transcludeFn, maxPriority, ignoreDirective,
+                        previousCompileContext) {
+      if (!($compileNodes instanceof jqLite)) {
+        // jquery always rewraps, whereas we need to preserve the original selector so that we can
+        // modify it.
+        $compileNodes = jqLite($compileNodes);
+      }
+      // We can not compile top level text elements since text nodes can be merged and we will
+      // not be able to attach scope data to them, so we will wrap them in <span>
+      forEach($compileNodes, function(node, index) {
+        if (node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/) /* non-empty */ ) {
+          $compileNodes[index] = jqLite(node).wrap('<span></span>').parent()[0];
+        }
+      });
+      var compositeLinkFn =
+              compileNodes($compileNodes, transcludeFn, $compileNodes,
+                           maxPriority, ignoreDirective, previousCompileContext);
+      compile.$$addScopeClass($compileNodes);
+      var namespace = null;
+      return function publicLinkFn(scope, cloneConnectFn, options) {
+        assertArg(scope, 'scope');
+
+        options = options || {};
+        var parentBoundTranscludeFn = options.parentBoundTranscludeFn,
+          transcludeControllers = options.transcludeControllers,
+          futureParentElement = options.futureParentElement;
+
+        // When `parentBoundTranscludeFn` is passed, it is a
+        // `controllersBoundTransclude` function (it was previously passed
+        // as `transclude` to directive.link) so we must unwrap it to get
+        // its `boundTranscludeFn`
+        if (parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude) {
+          parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;
+        }
+
+        if (!namespace) {
+          namespace = detectNamespaceForChildElements(futureParentElement);
+        }
+        var $linkNode;
+        if (namespace !== 'html') {
+          // When using a directive with replace:true and templateUrl the $compileNodes
+          // (or a child element inside of them)
+          // might change, so we need to recreate the namespace adapted compileNodes
+          // for call to the link function.
+          // Note: This will already clone the nodes...
+          $linkNode = jqLite(
+            wrapTemplate(namespace, jqLite('<div>').append($compileNodes).html())
+          );
+        } else if (cloneConnectFn) {
+          // important!!: we must call our jqLite.clone() since the jQuery one is trying to be smart
+          // and sometimes changes the structure of the DOM.
+          $linkNode = JQLitePrototype.clone.call($compileNodes);
+        } else {
+          $linkNode = $compileNodes;
+        }
+
+        if (transcludeControllers) {
+          for (var controllerName in transcludeControllers) {
+            $linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName].instance);
+          }
+        }
+
+        compile.$$addScopeInfo($linkNode, scope);
+
+        if (cloneConnectFn) cloneConnectFn($linkNode, scope);
+        if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
+        return $linkNode;
+      };
+    }
+
+    function detectNamespaceForChildElements(parentElement) {
+      // TODO: Make this detect MathML as well...
+      var node = parentElement && parentElement[0];
+      if (!node) {
+        return 'html';
+      } else {
+        return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/) ? 'svg' : 'html';
+      }
+    }
+
+    /**
+     * Compile function matches each node in nodeList against the directives. Once all directives
+     * for a particular node are collected their compile functions are executed. The compile
+     * functions return values - the linking functions - are combined into a composite linking
+     * function, which is the a linking function for the node.
+     *
+     * @param {NodeList} nodeList an array of nodes or NodeList to compile
+     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
+     *        scope argument is auto-generated to the new child of the transcluded parent scope.
+     * @param {DOMElement=} $rootElement If the nodeList is the root of the compilation tree then
+     *        the rootElement must be set the jqLite collection of the compile root. This is
+     *        needed so that the jqLite collection items can be replaced with widgets.
+     * @param {number=} maxPriority Max directive priority.
+     * @returns {Function} A composite linking function of all of the matched directives or null.
+     */
+    function compileNodes(nodeList, transcludeFn, $rootElement, maxPriority, ignoreDirective,
+                            previousCompileContext) {
+      var linkFns = [],
+          attrs, directives, nodeLinkFn, childNodes, childLinkFn, linkFnFound, nodeLinkFnFound;
+
+      for (var i = 0; i < nodeList.length; i++) {
+        attrs = new Attributes();
+
+        // we must always refer to nodeList[i] since the nodes can be replaced underneath us.
+        directives = collectDirectives(nodeList[i], [], attrs, i === 0 ? maxPriority : undefined,
+                                        ignoreDirective);
+
+        nodeLinkFn = (directives.length)
+            ? applyDirectivesToNode(directives, nodeList[i], attrs, transcludeFn, $rootElement,
+                                      null, [], [], previousCompileContext)
+            : null;
+
+        if (nodeLinkFn && nodeLinkFn.scope) {
+          compile.$$addScopeClass(attrs.$$element);
+        }
+
+        childLinkFn = (nodeLinkFn && nodeLinkFn.terminal ||
+                      !(childNodes = nodeList[i].childNodes) ||
+                      !childNodes.length)
+            ? null
+            : compileNodes(childNodes,
+                 nodeLinkFn ? (
+                  (nodeLinkFn.transcludeOnThisElement || !nodeLinkFn.templateOnThisElement)
+                     && nodeLinkFn.transclude) : transcludeFn);
+
+        if (nodeLinkFn || childLinkFn) {
+          linkFns.push(i, nodeLinkFn, childLinkFn);
+          linkFnFound = true;
+          nodeLinkFnFound = nodeLinkFnFound || nodeLinkFn;
+        }
+
+        //use the previous context only for the first element in the virtual group
+        previousCompileContext = null;
+      }
+
+      // return a linking function if we have found anything, null otherwise
+      return linkFnFound ? compositeLinkFn : null;
+
+      function compositeLinkFn(scope, nodeList, $rootElement, parentBoundTranscludeFn) {
+        var nodeLinkFn, childLinkFn, node, childScope, i, ii, idx, childBoundTranscludeFn;
+        var stableNodeList;
+
+
+        if (nodeLinkFnFound) {
+          // copy nodeList so that if a nodeLinkFn removes or adds an element at this DOM level our
+          // offsets don't get screwed up
+          var nodeListLength = nodeList.length;
+          stableNodeList = new Array(nodeListLength);
+
+          // create a sparse array by only copying the elements which have a linkFn
+          for (i = 0; i < linkFns.length; i+=3) {
+            idx = linkFns[i];
+            stableNodeList[idx] = nodeList[idx];
+          }
+        } else {
+          stableNodeList = nodeList;
+        }
+
+        for (i = 0, ii = linkFns.length; i < ii;) {
+          node = stableNodeList[linkFns[i++]];
+          nodeLinkFn = linkFns[i++];
+          childLinkFn = linkFns[i++];
+
+          if (nodeLinkFn) {
+            if (nodeLinkFn.scope) {
+              childScope = scope.$new();
+              compile.$$addScopeInfo(jqLite(node), childScope);
+              var destroyBindings = nodeLinkFn.$$destroyBindings;
+              if (destroyBindings) {
+                nodeLinkFn.$$destroyBindings = null;
+                childScope.$on('$destroyed', destroyBindings);
+              }
+            } else {
+              childScope = scope;
+            }
+
+            if (nodeLinkFn.transcludeOnThisElement) {
+              childBoundTranscludeFn = createBoundTranscludeFn(
+                  scope, nodeLinkFn.transclude, parentBoundTranscludeFn);
+
+            } else if (!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn) {
+              childBoundTranscludeFn = parentBoundTranscludeFn;
+
+            } else if (!parentBoundTranscludeFn && transcludeFn) {
+              childBoundTranscludeFn = createBoundTranscludeFn(scope, transcludeFn);
+
+            } else {
+              childBoundTranscludeFn = null;
+            }
+
+            nodeLinkFn(childLinkFn, childScope, node, $rootElement, childBoundTranscludeFn,
+                       nodeLinkFn);
+
+          } else if (childLinkFn) {
+            childLinkFn(scope, node.childNodes, undefined, parentBoundTranscludeFn);
+          }
+        }
+      }
+    }
+
+    function createBoundTranscludeFn(scope, transcludeFn, previousBoundTranscludeFn) {
+
+      var boundTranscludeFn = function(transcludedScope, cloneFn, controllers, futureParentElement, containingScope) {
+
+        if (!transcludedScope) {
+          transcludedScope = scope.$new(false, containingScope);
+          transcludedScope.$$transcluded = true;
+        }
+
+        return transcludeFn(transcludedScope, cloneFn, {
+          parentBoundTranscludeFn: previousBoundTranscludeFn,
+          transcludeControllers: controllers,
+          futureParentElement: futureParentElement
+        });
+      };
+
+      return boundTranscludeFn;
+    }
+
+    /**
+     * Looks for directives on the given node and adds them to the directive collection which is
+     * sorted.
+     *
+     * @param node Node to search.
+     * @param directives An array to which the directives are added to. This array is sorted before
+     *        the function returns.
+     * @param attrs The shared attrs object which is used to populate the normalized attributes.
+     * @param {number=} maxPriority Max directive priority.
+     */
+    function collectDirectives(node, directives, attrs, maxPriority, ignoreDirective) {
+      var nodeType = node.nodeType,
+          attrsMap = attrs.$attr,
+          match,
+          className;
+
+      switch (nodeType) {
+        case NODE_TYPE_ELEMENT: /* Element */
+          // use the node name: <directive>
+          addDirective(directives,
+              directiveNormalize(nodeName_(node)), 'E', maxPriority, ignoreDirective);
+
+          // iterate over the attributes
+          for (var attr, name, nName, ngAttrName, value, isNgAttr, nAttrs = node.attributes,
+                   j = 0, jj = nAttrs && nAttrs.length; j < jj; j++) {
+            var attrStartName = false;
+            var attrEndName = false;
+
+            attr = nAttrs[j];
+            name = attr.name;
+            value = trim(attr.value);
+
+            // support ngAttr attribute binding
+            ngAttrName = directiveNormalize(name);
+            if (isNgAttr = NG_ATTR_BINDING.test(ngAttrName)) {
+              name = name.replace(PREFIX_REGEXP, '')
+                .substr(8).replace(/_(.)/g, function(match, letter) {
+                  return letter.toUpperCase();
+                });
+            }
+
+            var directiveNName = ngAttrName.replace(/(Start|End)$/, '');
+            if (directiveIsMultiElement(directiveNName)) {
+              if (ngAttrName === directiveNName + 'Start') {
+                attrStartName = name;
+                attrEndName = name.substr(0, name.length - 5) + 'end';
+                name = name.substr(0, name.length - 6);
+              }
+            }
+
+            nName = directiveNormalize(name.toLowerCase());
+            attrsMap[nName] = name;
+            if (isNgAttr || !attrs.hasOwnProperty(nName)) {
+                attrs[nName] = value;
+                if (getBooleanAttrName(node, nName)) {
+                  attrs[nName] = true; // presence means true
+                }
+            }
+            addAttrInterpolateDirective(node, directives, value, nName, isNgAttr);
+            addDirective(directives, nName, 'A', maxPriority, ignoreDirective, attrStartName,
+                          attrEndName);
+          }
+
+          // use class as directive
+          className = node.className;
+          if (isObject(className)) {
+              // Maybe SVGAnimatedString
+              className = className.animVal;
+          }
+          if (isString(className) && className !== '') {
+            while (match = CLASS_DIRECTIVE_REGEXP.exec(className)) {
+              nName = directiveNormalize(match[2]);
+              if (addDirective(directives, nName, 'C', maxPriority, ignoreDirective)) {
+                attrs[nName] = trim(match[3]);
+              }
+              className = className.substr(match.index + match[0].length);
+            }
+          }
+          break;
+        case NODE_TYPE_TEXT: /* Text Node */
+          if (msie === 11) {
+            // Workaround for #11781
+            while (node.parentNode && node.nextSibling && node.nextSibling.nodeType === NODE_TYPE_TEXT) {
+              node.nodeValue = node.nodeValue + node.nextSibling.nodeValue;
+              node.parentNode.removeChild(node.nextSibling);
+            }
+          }
+          addTextInterpolateDirective(directives, node.nodeValue);
+          break;
+        case NODE_TYPE_COMMENT: /* Comment */
+          try {
+            match = COMMENT_DIRECTIVE_REGEXP.exec(node.nodeValue);
+            if (match) {
+              nName = directiveNormalize(match[1]);
+              if (addDirective(directives, nName, 'M', maxPriority, ignoreDirective)) {
+                attrs[nName] = trim(match[2]);
+              }
+            }
+          } catch (e) {
+            // turns out that under some circumstances IE9 throws errors when one attempts to read
+            // comment's node value.
+            // Just ignore it and continue. (Can't seem to reproduce in test case.)
+          }
+          break;
+      }
+
+      directives.sort(byPriority);
+      return directives;
+    }
+
+    /**
+     * Given a node with an directive-start it collects all of the siblings until it finds
+     * directive-end.
+     * @param node
+     * @param attrStart
+     * @param attrEnd
+     * @returns {*}
+     */
+    function groupScan(node, attrStart, attrEnd) {
+      var nodes = [];
+      var depth = 0;
+      if (attrStart && node.hasAttribute && node.hasAttribute(attrStart)) {
+        do {
+          if (!node) {
+            throw $compileMinErr('uterdir',
+                      "Unterminated attribute, found '{0}' but no matching '{1}' found.",
+                      attrStart, attrEnd);
+          }
+          if (node.nodeType == NODE_TYPE_ELEMENT) {
+            if (node.hasAttribute(attrStart)) depth++;
+            if (node.hasAttribute(attrEnd)) depth--;
+          }
+          nodes.push(node);
+          node = node.nextSibling;
+        } while (depth > 0);
+      } else {
+        nodes.push(node);
+      }
+
+      return jqLite(nodes);
+    }
+
+    /**
+     * Wrapper for linking function which converts normal linking function into a grouped
+     * linking function.
+     * @param linkFn
+     * @param attrStart
+     * @param attrEnd
+     * @returns {Function}
+     */
+    function groupElementsLinkFnWrapper(linkFn, attrStart, attrEnd) {
+      return function(scope, element, attrs, controllers, transcludeFn) {
+        element = groupScan(element[0], attrStart, attrEnd);
+        return linkFn(scope, element, attrs, controllers, transcludeFn);
+      };
+    }
+
+    /**
+     * Once the directives have been collected, their compile functions are executed. This method
+     * is responsible for inlining directive templates as well as terminating the application
+     * of the directives if the terminal directive has been reached.
+     *
+     * @param {Array} directives Array of collected directives to execute their compile function.
+     *        this needs to be pre-sorted by priority order.
+     * @param {Node} compileNode The raw DOM node to apply the compile functions to
+     * @param {Object} templateAttrs The shared attribute function
+     * @param {function(angular.Scope, cloneAttachFn=)} transcludeFn A linking function, where the
+     *                                                  scope argument is auto-generated to the new
+     *                                                  child of the transcluded parent scope.
+     * @param {JQLite} jqCollection If we are working on the root of the compile tree then this
+     *                              argument has the root jqLite array so that we can replace nodes
+     *                              on it.
+     * @param {Object=} originalReplaceDirective An optional directive that will be ignored when
+     *                                           compiling the transclusion.
+     * @param {Array.<Function>} preLinkFns
+     * @param {Array.<Function>} postLinkFns
+     * @param {Object} previousCompileContext Context used for previous compilation of the current
+     *                                        node
+     * @returns {Function} linkFn
+     */
+    function applyDirectivesToNode(directives, compileNode, templateAttrs, transcludeFn,
+                                   jqCollection, originalReplaceDirective, preLinkFns, postLinkFns,
+                                   previousCompileContext) {
+      previousCompileContext = previousCompileContext || {};
+
+      var terminalPriority = -Number.MAX_VALUE,
+          newScopeDirective = previousCompileContext.newScopeDirective,
+          controllerDirectives = previousCompileContext.controllerDirectives,
+          newIsolateScopeDirective = previousCompileContext.newIsolateScopeDirective,
+          templateDirective = previousCompileContext.templateDirective,
+          nonTlbTranscludeDirective = previousCompileContext.nonTlbTranscludeDirective,
+          hasTranscludeDirective = false,
+          hasTemplate = false,
+          hasElementTranscludeDirective = previousCompileContext.hasElementTranscludeDirective,
+          $compileNode = templateAttrs.$$element = jqLite(compileNode),
+          directive,
+          directiveName,
+          $template,
+          replaceDirective = originalReplaceDirective,
+          childTranscludeFn = transcludeFn,
+          linkFn,
+          directiveValue;
+
+      // executes all directives on the current element
+      for (var i = 0, ii = directives.length; i < ii; i++) {
+        directive = directives[i];
+        var attrStart = directive.$$start;
+        var attrEnd = directive.$$end;
+
+        // collect multiblock sections
+        if (attrStart) {
+          $compileNode = groupScan(compileNode, attrStart, attrEnd);
+        }
+        $template = undefined;
+
+        if (terminalPriority > directive.priority) {
+          break; // prevent further processing of directives
+        }
+
+        if (directiveValue = directive.scope) {
+
+          // skip the check for directives with async templates, we'll check the derived sync
+          // directive when the template arrives
+          if (!directive.templateUrl) {
+            if (isObject(directiveValue)) {
+              // This directive is trying to add an isolated scope.
+              // Check that there is no scope of any kind already
+              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective || newScopeDirective,
+                                directive, $compileNode);
+              newIsolateScopeDirective = directive;
+            } else {
+              // This directive is trying to add a child scope.
+              // Check that there is no isolated scope already
+              assertNoDuplicate('new/isolated scope', newIsolateScopeDirective, directive,
+                                $compileNode);
+            }
+          }
+
+          newScopeDirective = newScopeDirective || directive;
+        }
+
+        directiveName = directive.name;
+
+        if (!directive.templateUrl && directive.controller) {
+          directiveValue = directive.controller;
+          controllerDirectives = controllerDirectives || createMap();
+          assertNoDuplicate("'" + directiveName + "' controller",
+              controllerDirectives[directiveName], directive, $compileNode);
+          controllerDirectives[directiveName] = directive;
+        }
+
+        if (directiveValue = directive.transclude) {
+          hasTranscludeDirective = true;
+
+          // Special case ngIf and ngRepeat so that we don't complain about duplicate transclusion.
+          // This option should only be used by directives that know how to safely handle element transclusion,
+          // where the transcluded nodes are added or replaced after linking.
+          if (!directive.$$tlb) {
+            assertNoDuplicate('transclusion', nonTlbTranscludeDirective, directive, $compileNode);
+            nonTlbTranscludeDirective = directive;
+          }
+
+          if (directiveValue == 'element') {
+            hasElementTranscludeDirective = true;
+            terminalPriority = directive.priority;
+            $template = $compileNode;
+            $compileNode = templateAttrs.$$element =
+                jqLite(document.createComment(' ' + directiveName + ': ' +
+                                              templateAttrs[directiveName] + ' '));
+            compileNode = $compileNode[0];
+            replaceWith(jqCollection, sliceArgs($template), compileNode);
+
+            childTranscludeFn = compile($template, transcludeFn, terminalPriority,
+                                        replaceDirective && replaceDirective.name, {
+                                          // Don't pass in:
+                                          // - controllerDirectives - otherwise we'll create duplicates controllers
+                                          // - newIsolateScopeDirective or templateDirective - combining templates with
+                                          //   element transclusion doesn't make sense.
+                                          //
+                                          // We need only nonTlbTranscludeDirective so that we prevent putting transclusion
+                                          // on the same element more than once.
+                                          nonTlbTranscludeDirective: nonTlbTranscludeDirective
+                                        });
+          } else {
+            $template = jqLite(jqLiteClone(compileNode)).contents();
+            $compileNode.empty(); // clear contents
+            childTranscludeFn = compile($template, transcludeFn);
+          }
+        }
+
+        if (directive.template) {
+          hasTemplate = true;
+          assertNoDuplicate('template', templateDirective, directive, $compileNode);
+          templateDirective = directive;
+
+          directiveValue = (isFunction(directive.template))
+              ? directive.template($compileNode, templateAttrs)
+              : directive.template;
+
+          directiveValue = denormalizeTemplate(directiveValue);
+
+          if (directive.replace) {
+            replaceDirective = directive;
+            if (jqLiteIsTextNode(directiveValue)) {
+              $template = [];
+            } else {
+              $template = removeComments(wrapTemplate(directive.templateNamespace, trim(directiveValue)));
+            }
+            compileNode = $template[0];
+
+            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
+              throw $compileMinErr('tplrt',
+                  "Template for directive '{0}' must have exactly one root element. {1}",
+                  directiveName, '');
+            }
+
+            replaceWith(jqCollection, $compileNode, compileNode);
+
+            var newTemplateAttrs = {$attr: {}};
+
+            // combine directives from the original node and from the template:
+            // - take the array of directives for this element
+            // - split it into two parts, those that already applied (processed) and those that weren't (unprocessed)
+            // - collect directives from the template and sort them by priority
+            // - combine directives as: processed + template + unprocessed
+            var templateDirectives = collectDirectives(compileNode, [], newTemplateAttrs);
+            var unprocessedDirectives = directives.splice(i + 1, directives.length - (i + 1));
+
+            if (newIsolateScopeDirective) {
+              markDirectivesAsIsolate(templateDirectives);
+            }
+            directives = directives.concat(templateDirectives).concat(unprocessedDirectives);
+            mergeTemplateAttributes(templateAttrs, newTemplateAttrs);
+
+            ii = directives.length;
+          } else {
+            $compileNode.html(directiveValue);
+          }
+        }
+
+        if (directive.templateUrl) {
+          hasTemplate = true;
+          assertNoDuplicate('template', templateDirective, directive, $compileNode);
+          templateDirective = directive;
+
+          if (directive.replace) {
+            replaceDirective = directive;
+          }
+
+          nodeLinkFn = compileTemplateUrl(directives.splice(i, directives.length - i), $compileNode,
+              templateAttrs, jqCollection, hasTranscludeDirective && childTranscludeFn, preLinkFns, postLinkFns, {
+                controllerDirectives: controllerDirectives,
+                newScopeDirective: (newScopeDirective !== directive) && newScopeDirective,
+                newIsolateScopeDirective: newIsolateScopeDirective,
+                templateDirective: templateDirective,
+                nonTlbTranscludeDirective: nonTlbTranscludeDirective
+              });
+          ii = directives.length;
+        } else if (directive.compile) {
+          try {
+            linkFn = directive.compile($compileNode, templateAttrs, childTranscludeFn);
+            if (isFunction(linkFn)) {
+              addLinkFns(null, linkFn, attrStart, attrEnd);
+            } else if (linkFn) {
+              addLinkFns(linkFn.pre, linkFn.post, attrStart, attrEnd);
+            }
+          } catch (e) {
+            $exceptionHandler(e, startingTag($compileNode));
+          }
+        }
+
+        if (directive.terminal) {
+          nodeLinkFn.terminal = true;
+          terminalPriority = Math.max(terminalPriority, directive.priority);
+        }
+
+      }
+
+      nodeLinkFn.scope = newScopeDirective && newScopeDirective.scope === true;
+      nodeLinkFn.transcludeOnThisElement = hasTranscludeDirective;
+      nodeLinkFn.templateOnThisElement = hasTemplate;
+      nodeLinkFn.transclude = childTranscludeFn;
+
+      previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;
+
+      // might be normal or delayed nodeLinkFn depending on if templateUrl is present
+      return nodeLinkFn;
+
+      ////////////////////
+
+      function addLinkFns(pre, post, attrStart, attrEnd) {
+        if (pre) {
+          if (attrStart) pre = groupElementsLinkFnWrapper(pre, attrStart, attrEnd);
+          pre.require = directive.require;
+          pre.directiveName = directiveName;
+          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
+            pre = cloneAndAnnotateFn(pre, {isolateScope: true});
+          }
+          preLinkFns.push(pre);
+        }
+        if (post) {
+          if (attrStart) post = groupElementsLinkFnWrapper(post, attrStart, attrEnd);
+          post.require = directive.require;
+          post.directiveName = directiveName;
+          if (newIsolateScopeDirective === directive || directive.$$isolateScope) {
+            post = cloneAndAnnotateFn(post, {isolateScope: true});
+          }
+          postLinkFns.push(post);
+        }
+      }
+
+
+      function getControllers(directiveName, require, $element, elementControllers) {
+        var value;
+
+        if (isString(require)) {
+          var match = require.match(REQUIRE_PREFIX_REGEXP);
+          var name = require.substring(match[0].length);
+          var inheritType = match[1] || match[3];
+          var optional = match[2] === '?';
+
+          //If only parents then start at the parent element
+          if (inheritType === '^^') {
+            $element = $element.parent();
+          //Otherwise attempt getting the controller from elementControllers in case
+          //the element is transcluded (and has no data) and to avoid .data if possible
+          } else {
+            value = elementControllers && elementControllers[name];
+            value = value && value.instance;
+          }
+
+          if (!value) {
+            var dataName = '$' + name + 'Controller';
+            value = inheritType ? $element.inheritedData(dataName) : $element.data(dataName);
+          }
+
+          if (!value && !optional) {
+            throw $compileMinErr('ctreq',
+                "Controller '{0}', required by directive '{1}', can't be found!",
+                name, directiveName);
+          }
+        } else if (isArray(require)) {
+          value = [];
+          for (var i = 0, ii = require.length; i < ii; i++) {
+            value[i] = getControllers(directiveName, require[i], $element, elementControllers);
+          }
+        }
+
+        return value || null;
+      }
+
+      function setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope) {
+        var elementControllers = createMap();
+        for (var controllerKey in controllerDirectives) {
+          var directive = controllerDirectives[controllerKey];
+          var locals = {
+            $scope: directive === newIsolateScopeDirective || directive.$$isolateScope ? isolateScope : scope,
+            $element: $element,
+            $attrs: attrs,
+            $transclude: transcludeFn
+          };
+
+          var controller = directive.controller;
+          if (controller == '@') {
+            controller = attrs[directive.name];
+          }
+
+          var controllerInstance = $controller(controller, locals, true, directive.controllerAs);
+
+          // For directives with element transclusion the element is a comment,
+          // but jQuery .data doesn't support attaching data to comment nodes as it's hard to
+          // clean up (http://bugs.jquery.com/ticket/8335).
+          // Instead, we save the controllers for the element in a local hash and attach to .data
+          // later, once we have the actual element.
+          elementControllers[directive.name] = controllerInstance;
+          if (!hasElementTranscludeDirective) {
+            $element.data('$' + directive.name + 'Controller', controllerInstance.instance);
+          }
+        }
+        return elementControllers;
+      }
+
+      function nodeLinkFn(childLinkFn, scope, linkNode, $rootElement, boundTranscludeFn,
+                          thisLinkFn) {
+        var i, ii, linkFn, controller, isolateScope, elementControllers, transcludeFn, $element,
+            attrs;
+
+        if (compileNode === linkNode) {
+          attrs = templateAttrs;
+          $element = templateAttrs.$$element;
+        } else {
+          $element = jqLite(linkNode);
+          attrs = new Attributes($element, templateAttrs);
+        }
+
+        if (newIsolateScopeDirective) {
+          isolateScope = scope.$new(true);
+        }
+
+        if (boundTranscludeFn) {
+          // track `boundTranscludeFn` so it can be unwrapped if `transcludeFn`
+          // is later passed as `parentBoundTranscludeFn` to `publicLinkFn`
+          transcludeFn = controllersBoundTransclude;
+          transcludeFn.$$boundTransclude = boundTranscludeFn;
+        }
+
+        if (controllerDirectives) {
+          elementControllers = setupControllers($element, attrs, transcludeFn, controllerDirectives, isolateScope, scope);
+        }
+
+        if (newIsolateScopeDirective) {
+          // Initialize isolate scope bindings for new isolate scope directive.
+          compile.$$addScopeInfo($element, isolateScope, true, !(templateDirective && (templateDirective === newIsolateScopeDirective ||
+              templateDirective === newIsolateScopeDirective.$$originalDirective)));
+          compile.$$addScopeClass($element, true);
+          isolateScope.$$isolateBindings =
+              newIsolateScopeDirective.$$isolateBindings;
+          initializeDirectiveBindings(scope, attrs, isolateScope,
+                                      isolateScope.$$isolateBindings,
+                                      newIsolateScopeDirective, isolateScope);
+        }
+        if (elementControllers) {
+          // Initialize bindToController bindings for new/isolate scopes
+          var scopeDirective = newIsolateScopeDirective || newScopeDirective;
+          var bindings;
+          var controllerForBindings;
+          if (scopeDirective && elementControllers[scopeDirective.name]) {
+            bindings = scopeDirective.$$bindings.bindToController;
+            controller = elementControllers[scopeDirective.name];
+
+            if (controller && controller.identifier && bindings) {
+              controllerForBindings = controller;
+              thisLinkFn.$$destroyBindings =
+                  initializeDirectiveBindings(scope, attrs, controller.instance,
+                                              bindings, scopeDirective);
+            }
+          }
+          for (i in elementControllers) {
+            controller = elementControllers[i];
+            var controllerResult = controller();
+
+            if (controllerResult !== controller.instance) {
+              // If the controller constructor has a return value, overwrite the instance
+              // from setupControllers and update the element data
+              controller.instance = controllerResult;
+              $element.data('$' + i + 'Controller', controllerResult);
+              if (controller === controllerForBindings) {
+                // Remove and re-install bindToController bindings
+                thisLinkFn.$$destroyBindings();
+                thisLinkFn.$$destroyBindings =
+                  initializeDirectiveBindings(scope, attrs, controllerResult, bindings, scopeDirective);
+              }
+            }
+          }
+        }
+
+        // PRELINKING
+        for (i = 0, ii = preLinkFns.length; i < ii; i++) {
+          linkFn = preLinkFns[i];
+          invokeLinkFn(linkFn,
+              linkFn.isolateScope ? isolateScope : scope,
+              $element,
+              attrs,
+              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
+              transcludeFn
+          );
+        }
+
+        // RECURSION
+        // We only pass the isolate scope, if the isolate directive has a template,
+        // otherwise the child elements do not belong to the isolate directive.
+        var scopeToChild = scope;
+        if (newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)) {
+          scopeToChild = isolateScope;
+        }
+        childLinkFn && childLinkFn(scopeToChild, linkNode.childNodes, undefined, boundTranscludeFn);
+
+        // POSTLINKING
+        for (i = postLinkFns.length - 1; i >= 0; i--) {
+          linkFn = postLinkFns[i];
+          invokeLinkFn(linkFn,
+              linkFn.isolateScope ? isolateScope : scope,
+              $element,
+              attrs,
+              linkFn.require && getControllers(linkFn.directiveName, linkFn.require, $element, elementControllers),
+              transcludeFn
+          );
+        }
+
+        // This is the function that is injected as `$transclude`.
+        // Note: all arguments are optional!
+        function controllersBoundTransclude(scope, cloneAttachFn, futureParentElement) {
+          var transcludeControllers;
+
+          // No scope passed in:
+          if (!isScope(scope)) {
+            futureParentElement = cloneAttachFn;
+            cloneAttachFn = scope;
+            scope = undefined;
+          }
+
+          if (hasElementTranscludeDirective) {
+            transcludeControllers = elementControllers;
+          }
+          if (!futureParentElement) {
+            futureParentElement = hasElementTranscludeDirective ? $element.parent() : $element;
+          }
+          return boundTranscludeFn(scope, cloneAttachFn, transcludeControllers, futureParentElement, scopeToChild);
+        }
+      }
+    }
+
+    function markDirectivesAsIsolate(directives) {
+      // mark all directives as needing isolate scope.
+      for (var j = 0, jj = directives.length; j < jj; j++) {
+        directives[j] = inherit(directives[j], {$$isolateScope: true});
+      }
+    }
+
+    /**
+     * looks up the directive and decorates it with exception handling and proper parameters. We
+     * call this the boundDirective.
+     *
+     * @param {string} name name of the directive to look up.
+     * @param {string} location The directive must be found in specific format.
+     *   String containing any of theses characters:
+     *
+     *   * `E`: element name
+     *   * `A': attribute
+     *   * `C`: class
+     *   * `M`: comment
+     * @returns {boolean} true if directive was added.
+     */
+    function addDirective(tDirectives, name, location, maxPriority, ignoreDirective, startAttrName,
+                          endAttrName) {
+      if (name === ignoreDirective) return null;
+      var match = null;
+      if (hasDirectives.hasOwnProperty(name)) {
+        for (var directive, directives = $injector.get(name + Suffix),
+            i = 0, ii = directives.length; i < ii; i++) {
+          try {
+            directive = directives[i];
+            if ((isUndefined(maxPriority) || maxPriority > directive.priority) &&
+                 directive.restrict.indexOf(location) != -1) {
+              if (startAttrName) {
+                directive = inherit(directive, {$$start: startAttrName, $$end: endAttrName});
+              }
+              tDirectives.push(directive);
+              match = directive;
+            }
+          } catch (e) { $exceptionHandler(e); }
+        }
+      }
+      return match;
+    }
+
+
+    /**
+     * looks up the directive and returns true if it is a multi-element directive,
+     * and therefore requires DOM nodes between -start and -end markers to be grouped
+     * together.
+     *
+     * @param {string} name name of the directive to look up.
+     * @returns true if directive was registered as multi-element.
+     */
+    function directiveIsMultiElement(name) {
+      if (hasDirectives.hasOwnProperty(name)) {
+        for (var directive, directives = $injector.get(name + Suffix),
+            i = 0, ii = directives.length; i < ii; i++) {
+          directive = directives[i];
+          if (directive.multiElement) {
+            return true;
+          }
+        }
+      }
+      return false;
+    }
+
+    /**
+     * When the element is replaced with HTML template then the new attributes
+     * on the template need to be merged with the existing attributes in the DOM.
+     * The desired effect is to have both of the attributes present.
+     *
+     * @param {object} dst destination attributes (original DOM)
+     * @param {object} src source attributes (from the directive template)
+     */
+    function mergeTemplateAttributes(dst, src) {
+      var srcAttr = src.$attr,
+          dstAttr = dst.$attr,
+          $element = dst.$$element;
+
+      // reapply the old attributes to the new element
+      forEach(dst, function(value, key) {
+        if (key.charAt(0) != '$') {
+          if (src[key] && src[key] !== value) {
+            value += (key === 'style' ? ';' : ' ') + src[key];
+          }
+          dst.$set(key, value, true, srcAttr[key]);
+        }
+      });
+
+      // copy the new attributes on the old attrs object
+      forEach(src, function(value, key) {
+        if (key == 'class') {
+          safeAddClass($element, value);
+          dst['class'] = (dst['class'] ? dst['class'] + ' ' : '') + value;
+        } else if (key == 'style') {
+          $element.attr('style', $element.attr('style') + ';' + value);
+          dst['style'] = (dst['style'] ? dst['style'] + ';' : '') + value;
+          // `dst` will never contain hasOwnProperty as DOM parser won't let it.
+          // You will get an "InvalidCharacterError: DOM Exception 5" error if you
+          // have an attribute like "has-own-property" or "data-has-own-property", etc.
+        } else if (key.charAt(0) != '$' && !dst.hasOwnProperty(key)) {
+          dst[key] = value;
+          dstAttr[key] = srcAttr[key];
+        }
+      });
+    }
+
+
+    function compileTemplateUrl(directives, $compileNode, tAttrs,
+        $rootElement, childTranscludeFn, preLinkFns, postLinkFns, previousCompileContext) {
+      var linkQueue = [],
+          afterTemplateNodeLinkFn,
+          afterTemplateChildLinkFn,
+          beforeTemplateCompileNode = $compileNode[0],
+          origAsyncDirective = directives.shift(),
+          derivedSyncDirective = inherit(origAsyncDirective, {
+            templateUrl: null, transclude: null, replace: null, $$originalDirective: origAsyncDirective
+          }),
+          templateUrl = (isFunction(origAsyncDirective.templateUrl))
+              ? origAsyncDirective.templateUrl($compileNode, tAttrs)
+              : origAsyncDirective.templateUrl,
+          templateNamespace = origAsyncDirective.templateNamespace;
+
+      $compileNode.empty();
+
+      $templateRequest(templateUrl)
+        .then(function(content) {
+          var compileNode, tempTemplateAttrs, $template, childBoundTranscludeFn;
+
+          content = denormalizeTemplate(content);
+
+          if (origAsyncDirective.replace) {
+            if (jqLiteIsTextNode(content)) {
+              $template = [];
+            } else {
+              $template = removeComments(wrapTemplate(templateNamespace, trim(content)));
+            }
+            compileNode = $template[0];
+
+            if ($template.length != 1 || compileNode.nodeType !== NODE_TYPE_ELEMENT) {
+              throw $compileMinErr('tplrt',
+                  "Template for directive '{0}' must have exactly one root element. {1}",
+                  origAsyncDirective.name, templateUrl);
+            }
+
+            tempTemplateAttrs = {$attr: {}};
+            replaceWith($rootElement, $compileNode, compileNode);
+            var templateDirectives = collectDirectives(compileNode, [], tempTemplateAttrs);
+
+            if (isObject(origAsyncDirective.scope)) {
+              markDirectivesAsIsolate(templateDirectives);
+            }
+            directives = templateDirectives.concat(directives);
+            mergeTemplateAttributes(tAttrs, tempTemplateAttrs);
+          } else {
+            compileNode = beforeTemplateCompileNode;
+            $compileNode.html(content);
+          }
+
+          directives.unshift(derivedSyncDirective);
+
+          afterTemplateNodeLinkFn = applyDirectivesToNode(directives, compileNode, tAttrs,
+              childTranscludeFn, $compileNode, origAsyncDirective, preLinkFns, postLinkFns,
+              previousCompileContext);
+          forEach($rootElement, function(node, i) {
+            if (node == compileNode) {
+              $rootElement[i] = $compileNode[0];
+            }
+          });
+          afterTemplateChildLinkFn = compileNodes($compileNode[0].childNodes, childTranscludeFn);
+
+          while (linkQueue.length) {
+            var scope = linkQueue.shift(),
+                beforeTemplateLinkNode = linkQueue.shift(),
+                linkRootElement = linkQueue.shift(),
+                boundTranscludeFn = linkQueue.shift(),
+                linkNode = $compileNode[0];
+
+            if (scope.$$destroyed) continue;
+
+            if (beforeTemplateLinkNode !== beforeTemplateCompileNode) {
+              var oldClasses = beforeTemplateLinkNode.className;
+
+              if (!(previousCompileContext.hasElementTranscludeDirective &&
+                  origAsyncDirective.replace)) {
+                // it was cloned therefore we have to clone as well.
+                linkNode = jqLiteClone(compileNode);
+              }
+              replaceWith(linkRootElement, jqLite(beforeTemplateLinkNode), linkNode);
+
+              // Copy in CSS classes from original node
+              safeAddClass(jqLite(linkNode), oldClasses);
+            }
+            if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
+              childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
+            } else {
+              childBoundTranscludeFn = boundTranscludeFn;
+            }
+            afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, linkNode, $rootElement,
+              childBoundTranscludeFn, afterTemplateNodeLinkFn);
+          }
+          linkQueue = null;
+        });
+
+      return function delayedNodeLinkFn(ignoreChildLinkFn, scope, node, rootElement, boundTranscludeFn) {
+        var childBoundTranscludeFn = boundTranscludeFn;
+        if (scope.$$destroyed) return;
+        if (linkQueue) {
+          linkQueue.push(scope,
+                         node,
+                         rootElement,
+                         childBoundTranscludeFn);
+        } else {
+          if (afterTemplateNodeLinkFn.transcludeOnThisElement) {
+            childBoundTranscludeFn = createBoundTranscludeFn(scope, afterTemplateNodeLinkFn.transclude, boundTranscludeFn);
+          }
+          afterTemplateNodeLinkFn(afterTemplateChildLinkFn, scope, node, rootElement, childBoundTranscludeFn,
+                                  afterTemplateNodeLinkFn);
+        }
+      };
+    }
+
+
+    /**
+     * Sorting function for bound directives.
+     */
+    function byPriority(a, b) {
+      var diff = b.priority - a.priority;
+      if (diff !== 0) return diff;
+      if (a.name !== b.name) return (a.name < b.name) ? -1 : 1;
+      return a.index - b.index;
+    }
+
+    function assertNoDuplicate(what, previousDirective, directive, element) {
+
+      function wrapModuleNameIfDefined(moduleName) {
+        return moduleName ?
+          (' (module: ' + moduleName + ')') :
+          '';
+      }
+
+      if (previousDirective) {
+        throw $compileMinErr('multidir', 'Multiple directives [{0}{1}, {2}{3}] asking for {4} on: {5}',
+            previousDirective.name, wrapModuleNameIfDefined(previousDirective.$$moduleName),
+            directive.name, wrapModuleNameIfDefined(directive.$$moduleName), what, startingTag(element));
+      }
+    }
+
+
+    function addTextInterpolateDirective(directives, text) {
+      var interpolateFn = $interpolate(text, true);
+      if (interpolateFn) {
+        directives.push({
+          priority: 0,
+          compile: function textInterpolateCompileFn(templateNode) {
+            var templateNodeParent = templateNode.parent(),
+                hasCompileParent = !!templateNodeParent.length;
+
+            // When transcluding a template that has bindings in the root
+            // we don't have a parent and thus need to add the class during linking fn.
+            if (hasCompileParent) compile.$$addBindingClass(templateNodeParent);
+
+            return function textInterpolateLinkFn(scope, node) {
+              var parent = node.parent();
+              if (!hasCompileParent) compile.$$addBindingClass(parent);
+              compile.$$addBindingInfo(parent, interpolateFn.expressions);
+              scope.$watch(interpolateFn, function interpolateFnWatchAction(value) {
+                node[0].nodeValue = value;
+              });
+            };
+          }
+        });
+      }
+    }
+
+
+    function wrapTemplate(type, template) {
+      type = lowercase(type || 'html');
+      switch (type) {
+      case 'svg':
+      case 'math':
+        var wrapper = document.createElement('div');
+        wrapper.innerHTML = '<' + type + '>' + template + '</' + type + '>';
+        return wrapper.childNodes[0].childNodes;
+      default:
+        return template;
+      }
+    }
+
+
+    function getTrustedContext(node, attrNormalizedName) {
+      if (attrNormalizedName == "srcdoc") {
+        return $sce.HTML;
+      }
+      var tag = nodeName_(node);
+      // maction[xlink:href] can source SVG.  It's not limited to <maction>.
+      if (attrNormalizedName == "xlinkHref" ||
+          (tag == "form" && attrNormalizedName == "action") ||
+          (tag != "img" && (attrNormalizedName == "src" ||
+                            attrNormalizedName == "ngSrc"))) {
+        return $sce.RESOURCE_URL;
+      }
+    }
+
+
+    function addAttrInterpolateDirective(node, directives, value, name, allOrNothing) {
+      var trustedContext = getTrustedContext(node, name);
+      allOrNothing = ALL_OR_NOTHING_ATTRS[name] || allOrNothing;
+
+      var interpolateFn = $interpolate(value, true, trustedContext, allOrNothing);
+
+      // no interpolation found -> ignore
+      if (!interpolateFn) return;
+
+
+      if (name === "multiple" && nodeName_(node) === "select") {
+        throw $compileMinErr("selmulti",
+            "Binding to the 'multiple' attribute is not supported. Element: {0}",
+            startingTag(node));
+      }
+
+      directives.push({
+        priority: 100,
+        compile: function() {
+            return {
+              pre: function attrInterpolatePreLinkFn(scope, element, attr) {
+                var $$observers = (attr.$$observers || (attr.$$observers = createMap()));
+
+                if (EVENT_HANDLER_ATTR_REGEXP.test(name)) {
+                  throw $compileMinErr('nodomevents',
+                      "Interpolations for HTML DOM event attributes are disallowed.  Please use the " +
+                          "ng- versions (such as ng-click instead of onclick) instead.");
+                }
+
+                // If the attribute has changed since last $interpolate()ed
+                var newValue = attr[name];
+                if (newValue !== value) {
+                  // we need to interpolate again since the attribute value has been updated
+                  // (e.g. by another directive's compile function)
+                  // ensure unset/empty values make interpolateFn falsy
+                  interpolateFn = newValue && $interpolate(newValue, true, trustedContext, allOrNothing);
+                  value = newValue;
+                }
+
+                // if attribute was updated so that there is no interpolation going on we don't want to
+                // register any observers
+                if (!interpolateFn) return;
+
+                // initialize attr object so that it's ready in case we need the value for isolate
+                // scope initialization, otherwise the value would not be available from isolate
+                // directive's linking fn during linking phase
+                attr[name] = interpolateFn(scope);
+
+                ($$observers[name] || ($$observers[name] = [])).$$inter = true;
+                (attr.$$observers && attr.$$observers[name].$$scope || scope).
+                  $watch(interpolateFn, function interpolateFnWatchAction(newValue, oldValue) {
+                    //special case for class attribute addition + removal
+                    //so that class changes can tap into the animation
+                    //hooks provided by the $animate service. Be sure to
+                    //skip animations when the first digest occurs (when
+                    //both the new and the old values are the same) since
+                    //the CSS classes are the non-interpolated values
+                    if (name === 'class' && newValue != oldValue) {
+                      attr.$updateClass(newValue, oldValue);
+                    } else {
+                      attr.$set(name, newValue);
+                    }
+                  });
+              }
+            };
+          }
+      });
+    }
+
+
+    /**
+     * This is a special jqLite.replaceWith, which can replace items which
+     * have no parents, provided that the containing jqLite collection is provided.
+     *
+     * @param {JqLite=} $rootElement The root of the compile tree. Used so that we can replace nodes
+     *                               in the root of the tree.
+     * @param {JqLite} elementsToRemove The jqLite element which we are going to replace. We keep
+     *                                  the shell, but replace its DOM node reference.
+     * @param {Node} newNode The new DOM node.
+     */
+    function replaceWith($rootElement, elementsToRemove, newNode) {
+      var firstElementToRemove = elementsToRemove[0],
+          removeCount = elementsToRemove.length,
+          parent = firstElementToRemove.parentNode,
+          i, ii;
+
+      if ($rootElement) {
+        for (i = 0, ii = $rootElement.length; i < ii; i++) {
+          if ($rootElement[i] == firstElementToRemove) {
+            $rootElement[i++] = newNode;
+            for (var j = i, j2 = j + removeCount - 1,
+                     jj = $rootElement.length;
+                 j < jj; j++, j2++) {
+              if (j2 < jj) {
+                $rootElement[j] = $rootElement[j2];
+              } else {
+                delete $rootElement[j];
+              }
+            }
+            $rootElement.length -= removeCount - 1;
+
+            // If the replaced element is also the jQuery .context then replace it
+            // .context is a deprecated jQuery api, so we should set it only when jQuery set it
+            // http://api.jquery.com/context/
+            if ($rootElement.context === firstElementToRemove) {
+              $rootElement.context = newNode;
+            }
+            break;
+          }
+        }
+      }
+
+      if (parent) {
+        parent.replaceChild(newNode, firstElementToRemove);
+      }
+
+      // TODO(perf): what's this document fragment for? is it needed? can we at least reuse it?
+      var fragment = document.createDocumentFragment();
+      fragment.appendChild(firstElementToRemove);
+
+      if (jqLite.hasData(firstElementToRemove)) {
+        // Copy over user data (that includes Angular's $scope etc.). Don't copy private
+        // data here because there's no public interface in jQuery to do that and copying over
+        // event listeners (which is the main use of private data) wouldn't work anyway.
+        jqLite(newNode).data(jqLite(firstElementToRemove).data());
+
+        // Remove data of the replaced element. We cannot just call .remove()
+        // on the element it since that would deallocate scope that is needed
+        // for the new node. Instead, remove the data "manually".
+        if (!jQuery) {
+          delete jqLite.cache[firstElementToRemove[jqLite.expando]];
+        } else {
+          // jQuery 2.x doesn't expose the data storage. Use jQuery.cleanData to clean up after
+          // the replaced element. The cleanData version monkey-patched by Angular would cause
+          // the scope to be trashed and we do need the very same scope to work with the new
+          // element. However, we cannot just cache the non-patched version and use it here as
+          // that would break if another library patches the method after Angular does (one
+          // example is jQuery UI). Instead, set a flag indicating scope destroying should be
+          // skipped this one time.
+          skipDestroyOnNextJQueryCleanData = true;
+          jQuery.cleanData([firstElementToRemove]);
+        }
+      }
+
+      for (var k = 1, kk = elementsToRemove.length; k < kk; k++) {
+        var element = elementsToRemove[k];
+        jqLite(element).remove(); // must do this way to clean up expando
+        fragment.appendChild(element);
+        delete elementsToRemove[k];
+      }
+
+      elementsToRemove[0] = newNode;
+      elementsToRemove.length = 1;
+    }
+
+
+    function cloneAndAnnotateFn(fn, annotation) {
+      return extend(function() { return fn.apply(null, arguments); }, fn, annotation);
+    }
+
+
+    function invokeLinkFn(linkFn, scope, $element, attrs, controllers, transcludeFn) {
+      try {
+        linkFn(scope, $element, attrs, controllers, transcludeFn);
+      } catch (e) {
+        $exceptionHandler(e, startingTag($element));
+      }
+    }
+
+
+    // Set up $watches for isolate scope and controller bindings. This process
+    // only occurs for isolate scopes and new scopes with controllerAs.
+    function initializeDirectiveBindings(scope, attrs, destination, bindings,
+                                         directive, newScope) {
+      var onNewScopeDestroyed;
+      forEach(bindings, function(definition, scopeName) {
+        var attrName = definition.attrName,
+        optional = definition.optional,
+        mode = definition.mode, // @, =, or &
+        lastValue,
+        parentGet, parentSet, compare;
+
+        switch (mode) {
+
+          case '@':
+            if (!optional && !hasOwnProperty.call(attrs, attrName)) {
+              destination[scopeName] = attrs[attrName] = void 0;
+            }
+            attrs.$observe(attrName, function(value) {
+              if (isString(value)) {
+                destination[scopeName] = value;
+              }
+            });
+            attrs.$$observers[attrName].$$scope = scope;
+            if (isString(attrs[attrName])) {
+              // If the attribute has been provided then we trigger an interpolation to ensure
+              // the value is there for use in the link fn
+              destination[scopeName] = $interpolate(attrs[attrName])(scope);
+            }
+            break;
+
+          case '=':
+            if (!hasOwnProperty.call(attrs, attrName)) {
+              if (optional) break;
+              attrs[attrName] = void 0;
+            }
+            if (optional && !attrs[attrName]) break;
+
+            parentGet = $parse(attrs[attrName]);
+            if (parentGet.literal) {
+              compare = equals;
+            } else {
+              compare = function(a, b) { return a === b || (a !== a && b !== b); };
+            }
+            parentSet = parentGet.assign || function() {
+              // reset the change, or we will throw this exception on every $digest
+              lastValue = destination[scopeName] = parentGet(scope);
+              throw $compileMinErr('nonassign',
+                  "Expression '{0}' used with directive '{1}' is non-assignable!",
+                  attrs[attrName], directive.name);
+            };
+            lastValue = destination[scopeName] = parentGet(scope);
+            var parentValueWatch = function parentValueWatch(parentValue) {
+              if (!compare(parentValue, destination[scopeName])) {
+                // we are out of sync and need to copy
+                if (!compare(parentValue, lastValue)) {
+                  // parent changed and it has precedence
+                  destination[scopeName] = parentValue;
+                } else {
+                  // if the parent can be assigned then do so
+                  parentSet(scope, parentValue = destination[scopeName]);
+                }
+              }
+              return lastValue = parentValue;
+            };
+            parentValueWatch.$stateful = true;
+            var unwatch;
+            if (definition.collection) {
+              unwatch = scope.$watchCollection(attrs[attrName], parentValueWatch);
+            } else {
+              unwatch = scope.$watch($parse(attrs[attrName], parentValueWatch), null, parentGet.literal);
+            }
+            onNewScopeDestroyed = (onNewScopeDestroyed || []);
+            onNewScopeDestroyed.push(unwatch);
+            break;
+
+          case '&':
+            // Don't assign Object.prototype method to scope
+            parentGet = attrs.hasOwnProperty(attrName) ? $parse(attrs[attrName]) : noop;
+
+            // Don't assign noop to destination if expression is not valid
+            if (parentGet === noop && optional) break;
+
+            destination[scopeName] = function(locals) {
+              return parentGet(scope, locals);
+            };
+            break;
+        }
+      });
+      var destroyBindings = onNewScopeDestroyed ? function destroyBindings() {
+        for (var i = 0, ii = onNewScopeDestroyed.length; i < ii; ++i) {
+          onNewScopeDestroyed[i]();
+        }
+      } : noop;
+      if (newScope && destroyBindings !== noop) {
+        newScope.$on('$destroy', destroyBindings);
+        return noop;
+      }
+      return destroyBindings;
+    }
+  }];
+}
+
+var PREFIX_REGEXP = /^((?:x|data)[\:\-_])/i;
+/**
+ * Converts all accepted directives format into proper directive name.
+ * @param name Name to normalize
+ */
+function directiveNormalize(name) {
+  return camelCase(name.replace(PREFIX_REGEXP, ''));
+}
+
+/**
+ * @ngdoc type
+ * @name $compile.directive.Attributes
+ *
+ * @description
+ * A shared object between directive compile / linking functions which contains normalized DOM
+ * element attributes. The values reflect current binding state `{{ }}`. The normalization is
+ * needed since all of these are treated as equivalent in Angular:
+ *
+ * ```
+ *    <span ng:bind="a" ng-bind="a" data-ng-bind="a" x-ng-bind="a">
+ * ```
+ */
+
+/**
+ * @ngdoc property
+ * @name $compile.directive.Attributes#$attr
+ *
+ * @description
+ * A map of DOM element attribute names to the normalized name. This is
+ * needed to do reverse lookup from normalized name back to actual name.
+ */
+
+
+/**
+ * @ngdoc method
+ * @name $compile.directive.Attributes#$set
+ * @kind function
+ *
+ * @description
+ * Set DOM element attribute value.
+ *
+ *
+ * @param {string} name Normalized element attribute name of the property to modify. The name is
+ *          reverse-translated using the {@link ng.$compile.directive.Attributes#$attr $attr}
+ *          property to the original name.
+ * @param {string} value Value to set the attribute to. The value can be an interpolated string.
+ */
+
+
+
+/**
+ * Closure compiler type information
+ */
+
+function nodesetLinkingFn(
+  /* angular.Scope */ scope,
+  /* NodeList */ nodeList,
+  /* Element */ rootElement,
+  /* function(Function) */ boundTranscludeFn
+) {}
+
+function directiveLinkingFn(
+  /* nodesetLinkingFn */ nodesetLinkingFn,
+  /* angular.Scope */ scope,
+  /* Node */ node,
+  /* Element */ rootElement,
+  /* function(Function) */ boundTranscludeFn
+) {}
+
+function tokenDifference(str1, str2) {
+  var values = '',
+      tokens1 = str1.split(/\s+/),
+      tokens2 = str2.split(/\s+/);
+
+  outer:
+  for (var i = 0; i < tokens1.length; i++) {
+    var token = tokens1[i];
+    for (var j = 0; j < tokens2.length; j++) {
+      if (token == tokens2[j]) continue outer;
+    }
+    values += (values.length > 0 ? ' ' : '') + token;
+  }
+  return values;
+}
+
+function removeComments(jqNodes) {
+  jqNodes = jqLite(jqNodes);
+  var i = jqNodes.length;
+
+  if (i <= 1) {
+    return jqNodes;
+  }
+
+  while (i--) {
+    var node = jqNodes[i];
+    if (node.nodeType === NODE_TYPE_COMMENT) {
+      splice.call(jqNodes, i, 1);
+    }
+  }
+  return jqNodes;
+}
+
+var $controllerMinErr = minErr('$controller');
+
+
+var CNTRL_REG = /^(\S+)(\s+as\s+(\w+))?$/;
+function identifierForController(controller, ident) {
+  if (ident && isString(ident)) return ident;
+  if (isString(controller)) {
+    var match = CNTRL_REG.exec(controller);
+    if (match) return match[3];
+  }
+}
+
+
+/**
+ * @ngdoc provider
+ * @name $controllerProvider
+ * @description
+ * The {@link ng.$controller $controller service} is used by Angular to create new
+ * controllers.
+ *
+ * This provider allows controller registration via the
+ * {@link ng.$controllerProvider#register register} method.
+ */
+function $ControllerProvider() {
+  var controllers = {},
+      globals = false;
+
+  /**
+   * @ngdoc method
+   * @name $controllerProvider#register
+   * @param {string|Object} name Controller name, or an object map of controllers where the keys are
+   *    the names and the values are the constructors.
+   * @param {Function|Array} constructor Controller constructor fn (optionally decorated with DI
+   *    annotations in the array notation).
+   */
+  this.register = function(name, constructor) {
+    assertNotHasOwnProperty(name, 'controller');
+    if (isObject(name)) {
+      extend(controllers, name);
+    } else {
+      controllers[name] = constructor;
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name $controllerProvider#allowGlobals
+   * @description If called, allows `$controller` to find controller constructors on `window`
+   */
+  this.allowGlobals = function() {
+    globals = true;
+  };
+
+
+  this.$get = ['$injector', '$window', function($injector, $window) {
+
+    /**
+     * @ngdoc service
+     * @name $controller
+     * @requires $injector
+     *
+     * @param {Function|string} constructor If called with a function then it's considered to be the
+     *    controller constructor function. Otherwise it's considered to be a string which is used
+     *    to retrieve the controller constructor using the following steps:
+     *
+     *    * check if a controller with given name is registered via `$controllerProvider`
+     *    * check if evaluating the string on the current scope returns a constructor
+     *    * if $controllerProvider#allowGlobals, check `window[constructor]` on the global
+     *      `window` object (not recommended)
+     *
+     *    The string can use the `controller as property` syntax, where the controller instance is published
+     *    as the specified property on the `scope`; the `scope` must be injected into `locals` param for this
+     *    to work correctly.
+     *
+     * @param {Object} locals Injection locals for Controller.
+     * @return {Object} Instance of given controller.
+     *
+     * @description
+     * `$controller` service is responsible for instantiating controllers.
+     *
+     * It's just a simple call to {@link auto.$injector $injector}, but extracted into
+     * a service, so that one can override this service with [BC version](https://gist.github.com/1649788).
+     */
+    return function(expression, locals, later, ident) {
+      // PRIVATE API:
+      //   param `later` --- indicates that the controller's constructor is invoked at a later time.
+      //                     If true, $controller will allocate the object with the correct
+      //                     prototype chain, but will not invoke the controller until a returned
+      //                     callback is invoked.
+      //   param `ident` --- An optional label which overrides the label parsed from the controller
+      //                     expression, if any.
+      var instance, match, constructor, identifier;
+      later = later === true;
+      if (ident && isString(ident)) {
+        identifier = ident;
+      }
+
+      if (isString(expression)) {
+        match = expression.match(CNTRL_REG);
+        if (!match) {
+          throw $controllerMinErr('ctrlfmt',
+            "Badly formed controller string '{0}'. " +
+            "Must match `__name__ as __id__` or `__name__`.", expression);
+        }
+        constructor = match[1],
+        identifier = identifier || match[3];
+        expression = controllers.hasOwnProperty(constructor)
+            ? controllers[constructor]
+            : getter(locals.$scope, constructor, true) ||
+                (globals ? getter($window, constructor, true) : undefined);
+
+        assertArgFn(expression, constructor, true);
+      }
+
+      if (later) {
+        // Instantiate controller later:
+        // This machinery is used to create an instance of the object before calling the
+        // controller's constructor itself.
+        //
+        // This allows properties to be added to the controller before the constructor is
+        // invoked. Primarily, this is used for isolate scope bindings in $compile.
+        //
+        // This feature is not intended for use by applications, and is thus not documented
+        // publicly.
+        // Object creation: http://jsperf.com/create-constructor/2
+        var controllerPrototype = (isArray(expression) ?
+          expression[expression.length - 1] : expression).prototype;
+        instance = Object.create(controllerPrototype || null);
+
+        if (identifier) {
+          addIdentifier(locals, identifier, instance, constructor || expression.name);
+        }
+
+        var instantiate;
+        return instantiate = extend(function() {
+          var result = $injector.invoke(expression, instance, locals, constructor);
+          if (result !== instance && (isObject(result) || isFunction(result))) {
+            instance = result;
+            if (identifier) {
+              // If result changed, re-assign controllerAs value to scope.
+              addIdentifier(locals, identifier, instance, constructor || expression.name);
+            }
+          }
+          return instance;
+        }, {
+          instance: instance,
+          identifier: identifier
+        });
+      }
+
+      instance = $injector.instantiate(expression, locals, constructor);
+
+      if (identifier) {
+        addIdentifier(locals, identifier, instance, constructor || expression.name);
+      }
+
+      return instance;
+    };
+
+    function addIdentifier(locals, identifier, instance, name) {
+      if (!(locals && isObject(locals.$scope))) {
+        throw minErr('$controller')('noscp',
+          "Cannot export controller '{0}' as '{1}'! No $scope object provided via `locals`.",
+          name, identifier);
+      }
+
+      locals.$scope[identifier] = instance;
+    }
+  }];
+}
+
+/**
+ * @ngdoc service
+ * @name $document
+ * @requires $window
+ *
+ * @description
+ * A {@link angular.element jQuery or jqLite} wrapper for the browser's `window.document` object.
+ *
+ * @example
+   <example module="documentExample">
+     <file name="index.html">
+       <div ng-controller="ExampleController">
+         <p>$document title: <b ng-bind="title"></b></p>
+         <p>window.document title: <b ng-bind="windowTitle"></b></p>
+       </div>
+     </file>
+     <file name="script.js">
+       angular.module('documentExample', [])
+         .controller('ExampleController', ['$scope', '$document', function($scope, $document) {
+           $scope.title = $document[0].title;
+           $scope.windowTitle = angular.element(window.document)[0].title;
+         }]);
+     </file>
+   </example>
+ */
+function $DocumentProvider() {
+  this.$get = ['$window', function(window) {
+    return jqLite(window.document);
+  }];
+}
+
+/**
+ * @ngdoc service
+ * @name $exceptionHandler
+ * @requires ng.$log
+ *
+ * @description
+ * Any uncaught exception in angular expressions is delegated to this service.
+ * The default implementation simply delegates to `$log.error` which logs it into
+ * the browser console.
+ *
+ * In unit tests, if `angular-mocks.js` is loaded, this service is overridden by
+ * {@link ngMock.$exceptionHandler mock $exceptionHandler} which aids in testing.
+ *
+ * ## Example:
+ *
+ * ```js
+ *   angular.module('exceptionOverride', []).factory('$exceptionHandler', function() {
+ *     return function(exception, cause) {
+ *       exception.message += ' (caused by "' + cause + '")';
+ *       throw exception;
+ *     };
+ *   });
+ * ```
+ *
+ * This example will override the normal action of `$exceptionHandler`, to make angular
+ * exceptions fail hard when they happen, instead of just logging to the console.
+ *
+ * <hr />
+ * Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
+ * methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
+ * (unless executed during a digest).
+ *
+ * If you wish, you can manually delegate exceptions, e.g.
+ * `try { ... } catch(e) { $exceptionHandler(e); }`
+ *
+ * @param {Error} exception Exception associated with the error.
+ * @param {string=} cause optional information about the context in which
+ *       the error was thrown.
+ *
+ */
+function $ExceptionHandlerProvider() {
+  this.$get = ['$log', function($log) {
+    return function(exception, cause) {
+      $log.error.apply($log, arguments);
+    };
+  }];
+}
+
+var $$ForceReflowProvider = function() {
+  this.$get = ['$document', function($document) {
+    return function(domNode) {
+      //the line below will force the browser to perform a repaint so
+      //that all the animated elements within the animation frame will
+      //be properly updated and drawn on screen. This is required to
+      //ensure that the preparation animation is properly flushed so that
+      //the active state picks up from there. DO NOT REMOVE THIS LINE.
+      //DO NOT OPTIMIZE THIS LINE. THE MINIFIER WILL REMOVE IT OTHERWISE WHICH
+      //WILL RESULT IN AN UNPREDICTABLE BUG THAT IS VERY HARD TO TRACK DOWN AND
+      //WILL TAKE YEARS AWAY FROM YOUR LIFE.
+      if (domNode) {
+        if (!domNode.nodeType && domNode instanceof jqLite) {
+          domNode = domNode[0];
+        }
+      } else {
+        domNode = $document[0].body;
+      }
+      return domNode.offsetWidth + 1;
+    };
+  }];
+};
+
+var APPLICATION_JSON = 'application/json';
+var CONTENT_TYPE_APPLICATION_JSON = {'Content-Type': APPLICATION_JSON + ';charset=utf-8'};
+var JSON_START = /^\[|^\{(?!\{)/;
+var JSON_ENDS = {
+  '[': /]$/,
+  '{': /}$/
+};
+var JSON_PROTECTION_PREFIX = /^\)\]\}',?\n/;
+var $httpMinErr = minErr('$http');
+var $httpMinErrLegacyFn = function(method) {
+  return function() {
+    throw $httpMinErr('legacy', 'The method `{0}` on the promise returned from `$http` has been disabled.', method);
+  };
+};
+
+function serializeValue(v) {
+  if (isObject(v)) {
+    return isDate(v) ? v.toISOString() : toJson(v);
+  }
+  return v;
+}
+
+
+function $HttpParamSerializerProvider() {
+  /**
+   * @ngdoc service
+   * @name $httpParamSerializer
+   * @description
+   *
+   * Default {@link $http `$http`} params serializer that converts objects to strings
+   * according to the following rules:
+   *
+   * * `{'foo': 'bar'}` results in `foo=bar`
+   * * `{'foo': Date.now()}` results in `foo=2015-04-01T09%3A50%3A49.262Z` (`toISOString()` and encoded representation of a Date object)
+   * * `{'foo': ['bar', 'baz']}` results in `foo=bar&foo=baz` (repeated key for each array element)
+   * * `{'foo': {'bar':'baz'}}` results in `foo=%7B%22bar%22%3A%22baz%22%7D"` (stringified and encoded representation of an object)
+   *
+   * Note that serializer will sort the request parameters alphabetically.
+   * */
+
+  this.$get = function() {
+    return function ngParamSerializer(params) {
+      if (!params) return '';
+      var parts = [];
+      forEachSorted(params, function(value, key) {
+        if (value === null || isUndefined(value)) return;
+        if (isArray(value)) {
+          forEach(value, function(v, k) {
+            parts.push(encodeUriQuery(key)  + '=' + encodeUriQuery(serializeValue(v)));
+          });
+        } else {
+          parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(serializeValue(value)));
+        }
+      });
+
+      return parts.join('&');
+    };
+  };
+}
+
+function $HttpParamSerializerJQLikeProvider() {
+  /**
+   * @ngdoc service
+   * @name $httpParamSerializerJQLike
+   * @description
+   *
+   * Alternative {@link $http `$http`} params serializer that follows
+   * jQuery's [`param()`](http://api.jquery.com/jquery.param/) method logic.
+   * The serializer will also sort the params alphabetically.
+   *
+   * To use it for serializing `$http` request parameters, set it as the `paramSerializer` property:
+   *
+   * ```js
+   * $http({
+   *   url: myUrl,
+   *   method: 'GET',
+   *   params: myParams,
+   *   paramSerializer: '$httpParamSerializerJQLike'
+   * });
+   * ```
+   *
+   * It is also possible to set it as the default `paramSerializer` in the
+   * {@link $httpProvider#defaults `$httpProvider`}.
+   *
+   * Additionally, you can inject the serializer and use it explicitly, for example to serialize
+   * form data for submission:
+   *
+   * ```js
+   * .controller(function($http, $httpParamSerializerJQLike) {
+   *   //...
+   *
+   *   $http({
+   *     url: myUrl,
+   *     method: 'POST',
+   *     data: $httpParamSerializerJQLike(myData),
+   *     headers: {
+   *       'Content-Type': 'application/x-www-form-urlencoded'
+   *     }
+   *   });
+   *
+   * });
+   * ```
+   *
+   * */
+  this.$get = function() {
+    return function jQueryLikeParamSerializer(params) {
+      if (!params) return '';
+      var parts = [];
+      serialize(params, '', true);
+      return parts.join('&');
+
+      function serialize(toSerialize, prefix, topLevel) {
+        if (toSerialize === null || isUndefined(toSerialize)) return;
+        if (isArray(toSerialize)) {
+          forEach(toSerialize, function(value, index) {
+            serialize(value, prefix + '[' + (isObject(value) ? index : '') + ']');
+          });
+        } else if (isObject(toSerialize) && !isDate(toSerialize)) {
+          forEachSorted(toSerialize, function(value, key) {
+            serialize(value, prefix +
+                (topLevel ? '' : '[') +
+                key +
+                (topLevel ? '' : ']'));
+          });
+        } else {
+          parts.push(encodeUriQuery(prefix) + '=' + encodeUriQuery(serializeValue(toSerialize)));
+        }
+      }
+    };
+  };
+}
+
+function defaultHttpResponseTransform(data, headers) {
+  if (isString(data)) {
+    // Strip json vulnerability protection prefix and trim whitespace
+    var tempData = data.replace(JSON_PROTECTION_PREFIX, '').trim();
+
+    if (tempData) {
+      var contentType = headers('Content-Type');
+      if ((contentType && (contentType.indexOf(APPLICATION_JSON) === 0)) || isJsonLike(tempData)) {
+        data = fromJson(tempData);
+      }
+    }
+  }
+
+  return data;
+}
+
+function isJsonLike(str) {
+    var jsonStart = str.match(JSON_START);
+    return jsonStart && JSON_ENDS[jsonStart[0]].test(str);
+}
+
+/**
+ * Parse headers into key value object
+ *
+ * @param {string} headers Raw headers as a string
+ * @returns {Object} Parsed headers as key value object
+ */
+function parseHeaders(headers) {
+  var parsed = createMap(), i;
+
+  function fillInParsed(key, val) {
+    if (key) {
+      parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;
+    }
+  }
+
+  if (isString(headers)) {
+    forEach(headers.split('\n'), function(line) {
+      i = line.indexOf(':');
+      fillInParsed(lowercase(trim(line.substr(0, i))), trim(line.substr(i + 1)));
+    });
+  } else if (isObject(headers)) {
+    forEach(headers, function(headerVal, headerKey) {
+      fillInParsed(lowercase(headerKey), trim(headerVal));
+    });
+  }
+
+  return parsed;
+}
+
+
+/**
+ * Returns a function that provides access to parsed headers.
+ *
+ * Headers are lazy parsed when first requested.
+ * @see parseHeaders
+ *
+ * @param {(string|Object)} headers Headers to provide access to.
+ * @returns {function(string=)} Returns a getter function which if called with:
+ *
+ *   - if called with single an argument returns a single header value or null
+ *   - if called with no arguments returns an object containing all headers.
+ */
+function headersGetter(headers) {
+  var headersObj;
+
+  return function(name) {
+    if (!headersObj) headersObj =  parseHeaders(headers);
+
+    if (name) {
+      var value = headersObj[lowercase(name)];
+      if (value === void 0) {
+        value = null;
+      }
+      return value;
+    }
+
+    return headersObj;
+  };
+}
+
+
+/**
+ * Chain all given functions
+ *
+ * This function is used for both request and response transforming
+ *
+ * @param {*} data Data to transform.
+ * @param {function(string=)} headers HTTP headers getter fn.
+ * @param {number} status HTTP status code of the response.
+ * @param {(Function|Array.<Function>)} fns Function or an array of functions.
+ * @returns {*} Transformed data.
+ */
+function transformData(data, headers, status, fns) {
+  if (isFunction(fns)) {
+    return fns(data, headers, status);
+  }
+
+  forEach(fns, function(fn) {
+    data = fn(data, headers, status);
+  });
+
+  return data;
+}
+
+
+function isSuccess(status) {
+  return 200 <= status && status < 300;
+}
+
+
+/**
+ * @ngdoc provider
+ * @name $httpProvider
+ * @description
+ * Use `$httpProvider` to change the default behavior of the {@link ng.$http $http} service.
+ * */
+function $HttpProvider() {
+  /**
+   * @ngdoc property
+   * @name $httpProvider#defaults
+   * @description
+   *
+   * Object containing default values for all {@link ng.$http $http} requests.
+   *
+   * - **`defaults.cache`** - {Object} - an object built with {@link ng.$cacheFactory `$cacheFactory`}
+   * that will provide the cache for all requests who set their `cache` property to `true`.
+   * If you set the `defaults.cache = false` then only requests that specify their own custom
+   * cache object will be cached. See {@link $http#caching $http Caching} for more information.
+   *
+   * - **`defaults.xsrfCookieName`** - {string} - Name of cookie containing the XSRF token.
+   * Defaults value is `'XSRF-TOKEN'`.
+   *
+   * - **`defaults.xsrfHeaderName`** - {string} - Name of HTTP header to populate with the
+   * XSRF token. Defaults value is `'X-XSRF-TOKEN'`.
+   *
+   * - **`defaults.headers`** - {Object} - Default headers for all $http requests.
+   * Refer to {@link ng.$http#setting-http-headers $http} for documentation on
+   * setting default headers.
+   *     - **`defaults.headers.common`**
+   *     - **`defaults.headers.post`**
+   *     - **`defaults.headers.put`**
+   *     - **`defaults.headers.patch`**
+   *
+   *
+   * - **`defaults.paramSerializer`** - `{string|function(Object<string,string>):string}` - A function
+   *  used to the prepare string representation of request parameters (specified as an object).
+   *  If specified as string, it is interpreted as a function registered with the {@link auto.$injector $injector}.
+   *  Defaults to {@link ng.$httpParamSerializer $httpParamSerializer}.
+   *
+   **/
+  var defaults = this.defaults = {
+    // transform incoming response data
+    transformResponse: [defaultHttpResponseTransform],
+
+    // transform outgoing request data
+    transformRequest: [function(d) {
+      return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d) ? toJson(d) : d;
+    }],
+
+    // default headers
+    headers: {
+      common: {
+        'Accept': 'application/json, text/plain, */*'
+      },
+      post:   shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
+      put:    shallowCopy(CONTENT_TYPE_APPLICATION_JSON),
+      patch:  shallowCopy(CONTENT_TYPE_APPLICATION_JSON)
+    },
+
+    xsrfCookieName: 'XSRF-TOKEN',
+    xsrfHeaderName: 'X-XSRF-TOKEN',
+
+    paramSerializer: '$httpParamSerializer'
+  };
+
+  var useApplyAsync = false;
+  /**
+   * @ngdoc method
+   * @name $httpProvider#useApplyAsync
+   * @description
+   *
+   * Configure $http service to combine processing of multiple http responses received at around
+   * the same time via {@link ng.$rootScope.Scope#$applyAsync $rootScope.$applyAsync}. This can result in
+   * significant performance improvement for bigger applications that make many HTTP requests
+   * concurrently (common during application bootstrap).
+   *
+   * Defaults to false. If no value is specified, returns the current configured value.
+   *
+   * @param {boolean=} value If true, when requests are loaded, they will schedule a deferred
+   *    "apply" on the next tick, giving time for subsequent requests in a roughly ~10ms window
+   *    to load and share the same digest cycle.
+   *
+   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
+   *    otherwise, returns the current configured value.
+   **/
+  this.useApplyAsync = function(value) {
+    if (isDefined(value)) {
+      useApplyAsync = !!value;
+      return this;
+    }
+    return useApplyAsync;
+  };
+
+  var useLegacyPromise = true;
+  /**
+   * @ngdoc method
+   * @name $httpProvider#useLegacyPromiseExtensions
+   * @description
+   *
+   * Configure `$http` service to return promises without the shorthand methods `success` and `error`.
+   * This should be used to make sure that applications work without these methods.
+   *
+   * Defaults to false. If no value is specified, returns the current configured value.
+   *
+   * @param {boolean=} value If true, `$http` will return a normal promise without the `success` and `error` methods.
+   *
+   * @returns {boolean|Object} If a value is specified, returns the $httpProvider for chaining.
+   *    otherwise, returns the current configured value.
+   **/
+  this.useLegacyPromiseExtensions = function(value) {
+    if (isDefined(value)) {
+      useLegacyPromise = !!value;
+      return this;
+    }
+    return useLegacyPromise;
+  };
+
+  /**
+   * @ngdoc property
+   * @name $httpProvider#interceptors
+   * @description
+   *
+   * Array containing service factories for all synchronous or asynchronous {@link ng.$http $http}
+   * pre-processing of request or postprocessing of responses.
+   *
+   * These service factories are ordered by request, i.e. they are applied in the same order as the
+   * array, on request, but reverse order, on response.
+   *
+   * {@link ng.$http#interceptors Interceptors detailed info}
+   **/
+  var interceptorFactories = this.interceptors = [];
+
+  this.$get = ['$httpBackend', '$$cookieReader', '$cacheFactory', '$rootScope', '$q', '$injector',
+      function($httpBackend, $$cookieReader, $cacheFactory, $rootScope, $q, $injector) {
+
+    var defaultCache = $cacheFactory('$http');
+
+    /**
+     * Make sure that default param serializer is exposed as a function
+     */
+    defaults.paramSerializer = isString(defaults.paramSerializer) ?
+      $injector.get(defaults.paramSerializer) : defaults.paramSerializer;
+
+    /**
+     * Interceptors stored in reverse order. Inner interceptors before outer interceptors.
+     * The reversal is needed so that we can build up the interception chain around the
+     * server request.
+     */
+    var reversedInterceptors = [];
+
+    forEach(interceptorFactories, function(interceptorFactory) {
+      reversedInterceptors.unshift(isString(interceptorFactory)
+          ? $injector.get(interceptorFactory) : $injector.invoke(interceptorFactory));
+    });
+
+    /**
+     * @ngdoc service
+     * @kind function
+     * @name $http
+     * @requires ng.$httpBackend
+     * @requires $cacheFactory
+     * @requires $rootScope
+     * @requires $q
+     * @requires $injector
+     *
+     * @description
+     * The `$http` service is a core Angular service that facilitates communication with the remote
+     * HTTP servers via the browser's [XMLHttpRequest](https://developer.mozilla.org/en/xmlhttprequest)
+     * object or via [JSONP](http://en.wikipedia.org/wiki/JSONP).
+     *
+     * For unit testing applications that use `$http` service, see
+     * {@link ngMock.$httpBackend $httpBackend mock}.
+     *
+     * For a higher level of abstraction, please check out the {@link ngResource.$resource
+     * $resource} service.
+     *
+     * The $http API is based on the {@link ng.$q deferred/promise APIs} exposed by
+     * the $q service. While for simple usage patterns this doesn't matter much, for advanced usage
+     * it is important to familiarize yourself with these APIs and the guarantees they provide.
+     *
+     *
+     * ## General usage
+     * The `$http` service is a function which takes a single argument — a {@link $http#usage configuration object} —
+     * that is used to generate an HTTP request and returns  a {@link ng.$q promise}.
+     *
+     * ```js
+     *   // Simple GET request example:
+     *   $http({
+     *     method: 'GET',
+     *     url: '/someUrl'
+     *   }).then(function successCallback(response) {
+     *       // this callback will be called asynchronously
+     *       // when the response is available
+     *     }, function errorCallback(response) {
+     *       // called asynchronously if an error occurs
+     *       // or server returns response with an error status.
+     *     });
+     * ```
+     *
+     * The response object has these properties:
+     *
+     *   - **data** – `{string|Object}` – The response body transformed with the transform
+     *     functions.
+     *   - **status** – `{number}` – HTTP status code of the response.
+     *   - **headers** – `{function([headerName])}` – Header getter function.
+     *   - **config** – `{Object}` – The configuration object that was used to generate the request.
+     *   - **statusText** – `{string}` – HTTP status text of the response.
+     *
+     * A response status code between 200 and 299 is considered a success status and
+     * will result in the success callback being called. Note that if the response is a redirect,
+     * XMLHttpRequest will transparently follow it, meaning that the error callback will not be
+     * called for such responses.
+     *
+     *
+     * ## Shortcut methods
+     *
+     * Shortcut methods are also available. All shortcut methods require passing in the URL, and
+     * request data must be passed in for POST/PUT requests. An optional config can be passed as the
+     * last argument.
+     *
+     * ```js
+     *   $http.get('/someUrl', config).then(successCallback, errorCallback);
+     *   $http.post('/someUrl', data, config).then(successCallback, errorCallback);
+     * ```
+     *
+     * Complete list of shortcut methods:
+     *
+     * - {@link ng.$http#get $http.get}
+     * - {@link ng.$http#head $http.head}
+     * - {@link ng.$http#post $http.post}
+     * - {@link ng.$http#put $http.put}
+     * - {@link ng.$http#delete $http.delete}
+     * - {@link ng.$http#jsonp $http.jsonp}
+     * - {@link ng.$http#patch $http.patch}
+     *
+     *
+     * ## Writing Unit Tests that use $http
+     * When unit testing (using {@link ngMock ngMock}), it is necessary to call
+     * {@link ngMock.$httpBackend#flush $httpBackend.flush()} to flush each pending
+     * request using trained responses.
+     *
+     * ```
+     * $httpBackend.expectGET(...);
+     * $http.get(...);
+     * $httpBackend.flush();
+     * ```
+     *
+     * ## Deprecation Notice
+     * <div class="alert alert-danger">
+     *   The `$http` legacy promise methods `success` and `error` have been deprecated.
+     *   Use the standard `then` method instead.
+     *   If {@link $httpProvider#useLegacyPromiseExtensions `$httpProvider.useLegacyPromiseExtensions`} is set to
+     *   `false` then these methods will throw {@link $http:legacy `$http/legacy`} error.
+     * </div>
+     *
+     * ## Setting HTTP Headers
+     *
+     * The $http service will automatically add certain HTTP headers to all requests. These defaults
+     * can be fully configured by accessing the `$httpProvider.defaults.headers` configuration
+     * object, which currently contains this default configuration:
+     *
+     * - `$httpProvider.defaults.headers.common` (headers that are common for all requests):
+     *   - `Accept: application/json, text/plain, * / *`
+     * - `$httpProvider.defaults.headers.post`: (header defaults for POST requests)
+     *   - `Content-Type: application/json`
+     * - `$httpProvider.defaults.headers.put` (header defaults for PUT requests)
+     *   - `Content-Type: application/json`
+     *
+     * To add or overwrite these defaults, simply add or remove a property from these configuration
+     * objects. To add headers for an HTTP method other than POST or PUT, simply add a new object
+     * with the lowercased HTTP method name as the key, e.g.
+     * `$httpProvider.defaults.headers.get = { 'My-Header' : 'value' }`.
+     *
+     * The defaults can also be set at runtime via the `$http.defaults` object in the same
+     * fashion. For example:
+     *
+     * ```
+     * module.run(function($http) {
+     *   $http.defaults.headers.common.Authorization = 'Basic YmVlcDpib29w'
+     * });
+     * ```
+     *
+     * In addition, you can supply a `headers` property in the config object passed when
+     * calling `$http(config)`, which overrides the defaults without changing them globally.
+     *
+     * To explicitly remove a header automatically added via $httpProvider.defaults.headers on a per request basis,
+     * Use the `headers` property, setting the desired header to `undefined`. For example:
+     *
+     * ```js
+     * var req = {
+     *  method: 'POST',
+     *  url: 'http://example.com',
+     *  headers: {
+     *    'Content-Type': undefined
+     *  },
+     *  data: { test: 'test' }
+     * }
+     *
+     * $http(req).then(function(){...}, function(){...});
+     * ```
+     *
+     * ## Transforming Requests and Responses
+     *
+     * Both requests and responses can be transformed using transformation functions: `transformRequest`
+     * and `transformResponse`. These properties can be a single function that returns
+     * the transformed value (`function(data, headersGetter, status)`) or an array of such transformation functions,
+     * which allows you to `push` or `unshift` a new transformation function into the transformation chain.
+     *
+     * ### Default Transformations
+     *
+     * The `$httpProvider` provider and `$http` service expose `defaults.transformRequest` and
+     * `defaults.transformResponse` properties. If a request does not provide its own transformations
+     * then these will be applied.
+     *
+     * You can augment or replace the default transformations by modifying these properties by adding to or
+     * replacing the array.
+     *
+     * Angular provides the following default transformations:
+     *
+     * Request transformations (`$httpProvider.defaults.transformRequest` and `$http.defaults.transformRequest`):
+     *
+     * - If the `data` property of the request configuration object contains an object, serialize it
+     *   into JSON format.
+     *
+     * Response transformations (`$httpProvider.defaults.transformResponse` and `$http.defaults.transformResponse`):
+     *
+     *  - If XSRF prefix is detected, strip it (see Security Considerations section below).
+     *  - If JSON response is detected, deserialize it using a JSON parser.
+     *
+     *
+     * ### Overriding the Default Transformations Per Request
+     *
+     * If you wish override the request/response transformations only for a single request then provide
+     * `transformRequest` and/or `transformResponse` properties on the configuration object passed
+     * into `$http`.
+     *
+     * Note that if you provide these properties on the config object the default transformations will be
+     * overwritten. If you wish to augment the default transformations then you must include them in your
+     * local transformation array.
+     *
+     * The following code demonstrates adding a new response transformation to be run after the default response
+     * transformations have been run.
+     *
+     * ```js
+     * function appendTransform(defaults, transform) {
+     *
+     *   // We can't guarantee that the default transformation is an array
+     *   defaults = angular.isArray(defaults) ? defaults : [defaults];
+     *
+     *   // Append the new transformation to the defaults
+     *   return defaults.concat(transform);
+     * }
+     *
+     * $http({
+     *   url: '...',
+     *   method: 'GET',
+     *   transformResponse: appendTransform($http.defaults.transformResponse, function(value) {
+     *     return doTransform(value);
+     *   })
+     * });
+     * ```
+     *
+     *
+     * ## Caching
+     *
+     * To enable caching, set the request configuration `cache` property to `true` (to use default
+     * cache) or to a custom cache object (built with {@link ng.$cacheFactory `$cacheFactory`}).
+     * When the cache is enabled, `$http` stores the response from the server in the specified
+     * cache. The next time the same request is made, the response is served from the cache without
+     * sending a request to the server.
+     *
+     * Note that even if the response is served from cache, delivery of the data is asynchronous in
+     * the same way that real requests are.
+     *
+     * If there are multiple GET requests for the same URL that should be cached using the same
+     * cache, but the cache is not populated yet, only one request to the server will be made and
+     * the remaining requests will be fulfilled using the response from the first request.
+     *
+     * You can change the default cache to a new object (built with
+     * {@link ng.$cacheFactory `$cacheFactory`}) by updating the
+     * {@link ng.$http#defaults `$http.defaults.cache`} property. All requests who set
+     * their `cache` property to `true` will now use this cache object.
+     *
+     * If you set the default cache to `false` then only requests that specify their own custom
+     * cache object will be cached.
+     *
+     * ## Interceptors
+     *
+     * Before you start creating interceptors, be sure to understand the
+     * {@link ng.$q $q and deferred/promise APIs}.
+     *
+     * For purposes of global error handling, authentication, or any kind of synchronous or
+     * asynchronous pre-processing of request or postprocessing of responses, it is desirable to be
+     * able to intercept requests before they are handed to the server and
+     * responses before they are handed over to the application code that
+     * initiated these requests. The interceptors leverage the {@link ng.$q
+     * promise APIs} to fulfill this need for both synchronous and asynchronous pre-processing.
+     *
+     * The interceptors are service factories that are registered with the `$httpProvider` by
+     * adding them to the `$httpProvider.interceptors` array. The factory is called and
+     * injected with dependencies (if specified) and returns the interceptor.
+     *
+     * There are two kinds of interceptors (and two kinds of rejection interceptors):
+     *
+     *   * `request`: interceptors get called with a http {@link $http#usage config} object. The function is free to
+     *     modify the `config` object or create a new one. The function needs to return the `config`
+     *     object directly, or a promise containing the `config` or a new `config` object.
+     *   * `requestError`: interceptor gets called when a previous interceptor threw an error or
+     *     resolved with a rejection.
+     *   * `response`: interceptors get called with http `response` object. The function is free to
+     *     modify the `response` object or create a new one. The function needs to return the `response`
+     *     object directly, or as a promise containing the `response` or a new `response` object.
+     *   * `responseError`: interceptor gets called when a previous interceptor threw an error or
+     *     resolved with a rejection.
+     *
+     *
+     * ```js
+     *   // register the interceptor as a service
+     *   $provide.factory('myHttpInterceptor', function($q, dependency1, dependency2) {
+     *     return {
+     *       // optional method
+     *       'request': function(config) {
+     *         // do something on success
+     *         return config;
+     *       },
+     *
+     *       // optional method
+     *      'requestError': function(rejection) {
+     *         // do something on error
+     *         if (canRecover(rejection)) {
+     *           return responseOrNewPromise
+     *         }
+     *         return $q.reject(rejection);
+     *       },
+     *
+     *
+     *
+     *       // optional method
+     *       'response': function(response) {
+     *         // do something on success
+     *         return response;
+     *       },
+     *
+     *       // optional method
+     *      'responseError': function(rejection) {
+     *         // do something on error
+     *         if (canRecover(rejection)) {
+     *           return responseOrNewPromise
+     *         }
+     *         return $q.reject(rejection);
+     *       }
+     *     };
+     *   });
+     *
+     *   $httpProvider.interceptors.push('myHttpInterceptor');
+     *
+     *
+     *   // alternatively, register the interceptor via an anonymous factory
+     *   $httpProvider.interceptors.push(function($q, dependency1, dependency2) {
+     *     return {
+     *      'request': function(config) {
+     *          // same as above
+     *       },
+     *
+     *       'response': function(response) {
+     *          // same as above
+     *       }
+     *     };
+     *   });
+     * ```
+     *
+     * ## Security Considerations
+     *
+     * When designing web applications, consider security threats from:
+     *
+     * - [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
+     * - [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery)
+     *
+     * Both server and the client must cooperate in order to eliminate these threats. Angular comes
+     * pre-configured with strategies that address these issues, but for this to work backend server
+     * cooperation is required.
+     *
+     * ### JSON Vulnerability Protection
+     *
+     * A [JSON vulnerability](http://haacked.com/archive/2008/11/20/anatomy-of-a-subtle-json-vulnerability.aspx)
+     * allows third party website to turn your JSON resource URL into
+     * [JSONP](http://en.wikipedia.org/wiki/JSONP) request under some conditions. To
+     * counter this your server can prefix all JSON requests with following string `")]}',\n"`.
+     * Angular will automatically strip the prefix before processing it as JSON.
+     *
+     * For example if your server needs to return:
+     * ```js
+     * ['one','two']
+     * ```
+     *
+     * which is vulnerable to attack, your server can return:
+     * ```js
+     * )]}',
+     * ['one','two']
+     * ```
+     *
+     * Angular will strip the prefix, before processing the JSON.
+     *
+     *
+     * ### Cross Site Request Forgery (XSRF) Protection
+     *
+     * [XSRF](http://en.wikipedia.org/wiki/Cross-site_request_forgery) is a technique by which
+     * an unauthorized site can gain your user's private data. Angular provides a mechanism
+     * to counter XSRF. When performing XHR requests, the $http service reads a token from a cookie
+     * (by default, `XSRF-TOKEN`) and sets it as an HTTP header (`X-XSRF-TOKEN`). Since only
+     * JavaScript that runs on your domain could read the cookie, your server can be assured that
+     * the XHR came from JavaScript running on your domain. The header will not be set for
+     * cross-domain requests.
+     *
+     * To take advantage of this, your server needs to set a token in a JavaScript readable session
+     * cookie called `XSRF-TOKEN` on the first HTTP GET request. On subsequent XHR requests the
+     * server can verify that the cookie matches `X-XSRF-TOKEN` HTTP header, and therefore be sure
+     * that only JavaScript running on your domain could have sent the request. The token must be
+     * unique for each user and must be verifiable by the server (to prevent the JavaScript from
+     * making up its own tokens). We recommend that the token is a digest of your site's
+     * authentication cookie with a [salt](https://en.wikipedia.org/wiki/Salt_(cryptography&#41;)
+     * for added security.
+     *
+     * The name of the headers can be specified using the xsrfHeaderName and xsrfCookieName
+     * properties of either $httpProvider.defaults at config-time, $http.defaults at run-time,
+     * or the per-request config object.
+     *
+     * In order to prevent collisions in environments where multiple Angular apps share the
+     * same domain or subdomain, we recommend that each application uses unique cookie name.
+     *
+     * @param {object} config Object describing the request to be made and how it should be
+     *    processed. The object has following properties:
+     *
+     *    - **method** – `{string}` – HTTP method (e.g. 'GET', 'POST', etc)
+     *    - **url** – `{string}` – Absolute or relative URL of the resource that is being requested.
+     *    - **params** – `{Object.<string|Object>}` – Map of strings or objects which will be serialized
+     *      with the `paramSerializer` and appended as GET parameters.
+     *    - **data** – `{string|Object}` – Data to be sent as the request message data.
+     *    - **headers** – `{Object}` – Map of strings or functions which return strings representing
+     *      HTTP headers to send to the server. If the return value of a function is null, the
+     *      header will not be sent. Functions accept a config object as an argument.
+     *    - **xsrfHeaderName** – `{string}` – Name of HTTP header to populate with the XSRF token.
+     *    - **xsrfCookieName** – `{string}` – Name of cookie containing the XSRF token.
+     *    - **transformRequest** –
+     *      `{function(data, headersGetter)|Array.<function(data, headersGetter)>}` –
+     *      transform function or an array of such functions. The transform function takes the http
+     *      request body and headers and returns its transformed (typically serialized) version.
+     *      See {@link ng.$http#overriding-the-default-transformations-per-request
+     *      Overriding the Default Transformations}
+     *    - **transformResponse** –
+     *      `{function(data, headersGetter, status)|Array.<function(data, headersGetter, status)>}` –
+     *      transform function or an array of such functions. The transform function takes the http
+     *      response body, headers and status and returns its transformed (typically deserialized) version.
+     *      See {@link ng.$http#overriding-the-default-transformations-per-request
+     *      Overriding the Default TransformationjqLiks}
+     *    - **paramSerializer** - `{string|function(Object<string,string>):string}` - A function used to
+     *      prepare the string representation of request parameters (specified as an object).
+     *      If specified as string, it is interpreted as function registered with the
+     *      {@link $injector $injector}, which means you can create your own serializer
+     *      by registering it as a {@link auto.$provide#service service}.
+     *      The default serializer is the {@link $httpParamSerializer $httpParamSerializer};
+     *      alternatively, you can use the {@link $httpParamSerializerJQLike $httpParamSerializerJQLike}
+     *    - **cache** – `{boolean|Cache}` – If true, a default $http cache will be used to cache the
+     *      GET request, otherwise if a cache instance built with
+     *      {@link ng.$cacheFactory $cacheFactory}, this cache will be used for
+     *      caching.
+     *    - **timeout** – `{number|Promise}` – timeout in milliseconds, or {@link ng.$q promise}
+     *      that should abort the request when resolved.
+     *    - **withCredentials** - `{boolean}` - whether to set the `withCredentials` flag on the
+     *      XHR object. See [requests with credentials](https://developer.mozilla.org/docs/Web/HTTP/Access_control_CORS#Requests_with_credentials)
+     *      for more information.
+     *    - **responseType** - `{string}` - see
+     *      [XMLHttpRequest.responseType](https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest#xmlhttprequest-responsetype).
+     *
+     * @returns {HttpPromise} Returns a {@link ng.$q `Promise}` that will be resolved to a response object
+     *                        when the request succeeds or fails.
+     *
+     *
+     * @property {Array.<Object>} pendingRequests Array of config objects for currently pending
+     *   requests. This is primarily meant to be used for debugging purposes.
+     *
+     *
+     * @example
+<example module="httpExample">
+<file name="index.html">
+  <div ng-controller="FetchController">
+    <select ng-model="method" aria-label="Request method">
+      <option>GET</option>
+      <option>JSONP</option>
+    </select>
+    <input type="text" ng-model="url" size="80" aria-label="URL" />
+    <button id="fetchbtn" ng-click="fetch()">fetch</button><br>
+    <button id="samplegetbtn" ng-click="updateModel('GET', 'http-hello.html')">Sample GET</button>
+    <button id="samplejsonpbtn"
+      ng-click="updateModel('JSONP',
+                    'https://angularjs.org/greet.php?callback=JSON_CALLBACK&name=Super%20Hero')">
+      Sample JSONP
+    </button>
+    <button id="invalidjsonpbtn"
+      ng-click="updateModel('JSONP', 'https://angularjs.org/doesntexist&callback=JSON_CALLBACK')">
+        Invalid JSONP
+      </button>
+    <pre>http status code: {{status}}</pre>
+    <pre>http response data: {{data}}</pre>
+  </div>
+</file>
+<file name="script.js">
+  angular.module('httpExample', [])
+    .controller('FetchController', ['$scope', '$http', '$templateCache',
+      function($scope, $http, $templateCache) {
+        $scope.method = 'GET';
+        $scope.url = 'http-hello.html';
+
+        $scope.fetch = function() {
+          $scope.code = null;
+          $scope.response = null;
+
+          $http({method: $scope.method, url: $scope.url, cache: $templateCache}).
+            then(function(response) {
+              $scope.status = response.status;
+              $scope.data = response.data;
+            }, function(response) {
+              $scope.data = response.data || "Request failed";
+              $scope.status = response.status;
+          });
+        };
+
+        $scope.updateModel = function(method, url) {
+          $scope.method = method;
+          $scope.url = url;
+        };
+      }]);
+</file>
+<file name="http-hello.html">
+  Hello, $http!
+</file>
+<file name="protractor.js" type="protractor">
+  var status = element(by.binding('status'));
+  var data = element(by.binding('data'));
+  var fetchBtn = element(by.id('fetchbtn'));
+  var sampleGetBtn = element(by.id('samplegetbtn'));
+  var sampleJsonpBtn = element(by.id('samplejsonpbtn'));
+  var invalidJsonpBtn = element(by.id('invalidjsonpbtn'));
+
+  it('should make an xhr GET request', function() {
+    sampleGetBtn.click();
+    fetchBtn.click();
+    expect(status.getText()).toMatch('200');
+    expect(data.getText()).toMatch(/Hello, \$http!/);
+  });
+
+// Commented out due to flakes. See https://github.com/angular/angular.js/issues/9185
+// it('should make a JSONP request to angularjs.org', function() {
+//   sampleJsonpBtn.click();
+//   fetchBtn.click();
+//   expect(status.getText()).toMatch('200');
+//   expect(data.getText()).toMatch(/Super Hero!/);
+// });
+
+  it('should make JSONP request to invalid URL and invoke the error handler',
+      function() {
+    invalidJsonpBtn.click();
+    fetchBtn.click();
+    expect(status.getText()).toMatch('0');
+    expect(data.getText()).toMatch('Request failed');
+  });
+</file>
+</example>
+     */
+    function $http(requestConfig) {
+
+      if (!angular.isObject(requestConfig)) {
+        throw minErr('$http')('badreq', 'Http request configuration must be an object.  Received: {0}', requestConfig);
+      }
+
+      var config = extend({
+        method: 'get',
+        transformRequest: defaults.transformRequest,
+        transformResponse: defaults.transformResponse,
+        paramSerializer: defaults.paramSerializer
+      }, requestConfig);
+
+      config.headers = mergeHeaders(requestConfig);
+      config.method = uppercase(config.method);
+      config.paramSerializer = isString(config.paramSerializer) ?
+        $injector.get(config.paramSerializer) : config.paramSerializer;
+
+      var serverRequest = function(config) {
+        var headers = config.headers;
+        var reqData = transformData(config.data, headersGetter(headers), undefined, config.transformRequest);
+
+        // strip content-type if data is undefined
+        if (isUndefined(reqData)) {
+          forEach(headers, function(value, header) {
+            if (lowercase(header) === 'content-type') {
+                delete headers[header];
+            }
+          });
+        }
+
+        if (isUndefined(config.withCredentials) && !isUndefined(defaults.withCredentials)) {
+          config.withCredentials = defaults.withCredentials;
+        }
+
+        // send request
+        return sendReq(config, reqData).then(transformResponse, transformResponse);
+      };
+
+      var chain = [serverRequest, undefined];
+      var promise = $q.when(config);
+
+      // apply interceptors
+      forEach(reversedInterceptors, function(interceptor) {
+        if (interceptor.request || interceptor.requestError) {
+          chain.unshift(interceptor.request, interceptor.requestError);
+        }
+        if (interceptor.response || interceptor.responseError) {
+          chain.push(interceptor.response, interceptor.responseError);
+        }
+      });
+
+      while (chain.length) {
+        var thenFn = chain.shift();
+        var rejectFn = chain.shift();
+
+        promise = promise.then(thenFn, rejectFn);
+      }
+
+      if (useLegacyPromise) {
+        promise.success = function(fn) {
+          assertArgFn(fn, 'fn');
+
+          promise.then(function(response) {
+            fn(response.data, response.status, response.headers, config);
+          });
+          return promise;
+        };
+
+        promise.error = function(fn) {
+          assertArgFn(fn, 'fn');
+
+          promise.then(null, function(response) {
+            fn(response.data, response.status, response.headers, config);
+          });
+          return promise;
+        };
+      } else {
+        promise.success = $httpMinErrLegacyFn('success');
+        promise.error = $httpMinErrLegacyFn('error');
+      }
+
+      return promise;
+
+      function transformResponse(response) {
+        // make a copy since the response must be cacheable
+        var resp = extend({}, response);
+        if (!response.data) {
+          resp.data = response.data;
+        } else {
+          resp.data = transformData(response.data, response.headers, response.status, config.transformResponse);
+        }
+        return (isSuccess(response.status))
+          ? resp
+          : $q.reject(resp);
+      }
+
+      function executeHeaderFns(headers, config) {
+        var headerContent, processedHeaders = {};
+
+        forEach(headers, function(headerFn, header) {
+          if (isFunction(headerFn)) {
+            headerContent = headerFn(config);
+            if (headerContent != null) {
+              processedHeaders[header] = headerContent;
+            }
+          } else {
+            processedHeaders[header] = headerFn;
+          }
+        });
+
+        return processedHeaders;
+      }
+
+      function mergeHeaders(config) {
+        var defHeaders = defaults.headers,
+            reqHeaders = extend({}, config.headers),
+            defHeaderName, lowercaseDefHeaderName, reqHeaderName;
+
+        defHeaders = extend({}, defHeaders.common, defHeaders[lowercase(config.method)]);
+
+        // using for-in instead of forEach to avoid unecessary iteration after header has been found
+        defaultHeadersIteration:
+        for (defHeaderName in defHeaders) {
+          lowercaseDefHeaderName = lowercase(defHeaderName);
+
+          for (reqHeaderName in reqHeaders) {
+            if (lowercase(reqHeaderName) === lowercaseDefHeaderName) {
+              continue defaultHeadersIteration;
+            }
+          }
+
+          reqHeaders[defHeaderName] = defHeaders[defHeaderName];
+        }
+
+        // execute if header value is a function for merged headers
+        return executeHeaderFns(reqHeaders, shallowCopy(config));
+      }
+    }
+
+    $http.pendingRequests = [];
+
+    /**
+     * @ngdoc method
+     * @name $http#get
+     *
+     * @description
+     * Shortcut method to perform `GET` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+
+    /**
+     * @ngdoc method
+     * @name $http#delete
+     *
+     * @description
+     * Shortcut method to perform `DELETE` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+
+    /**
+     * @ngdoc method
+     * @name $http#head
+     *
+     * @description
+     * Shortcut method to perform `HEAD` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+
+    /**
+     * @ngdoc method
+     * @name $http#jsonp
+     *
+     * @description
+     * Shortcut method to perform `JSONP` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request.
+     *                     The name of the callback should be the string `JSON_CALLBACK`.
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+    createShortMethods('get', 'delete', 'head', 'jsonp');
+
+    /**
+     * @ngdoc method
+     * @name $http#post
+     *
+     * @description
+     * Shortcut method to perform `POST` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request
+     * @param {*} data Request content
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+
+    /**
+     * @ngdoc method
+     * @name $http#put
+     *
+     * @description
+     * Shortcut method to perform `PUT` request.
+     *
+     * @param {string} url Relative or absolute URL specifying the destination of the request
+     * @param {*} data Request content
+     * @param {Object=} config Optional configuration object
+     * @returns {HttpPromise} Future object
+     */
+
+     /**
+      * @ngdoc method
+      * @name $http#patch
+      *
+      * @description
+      * Shortcut method to perform `PATCH` request.
+      *
+      * @param {string} url Relative or absolute URL specifying the destination of the request
+      * @param {*} data Request content
+      * @param {Object=} config Optional configuration object
+      * @returns {HttpPromise} Future object
+      */
+    createShortMethodsWithData('post', 'put', 'patch');
+
+        /**
+         * @ngdoc property
+         * @name $http#defaults
+         *
+         * @description
+         * Runtime equivalent of the `$httpProvider.defaults` property. Allows configuration of
+         * default headers, withCredentials as well as request and response transformations.
+         *
+         * See "Setting HTTP Headers" and "Transforming Requests and Responses" sections above.
+         */
+    $http.defaults = defaults;
+
+
+    return $http;
+
+
+    function createShortMethods(names) {
+      forEach(arguments, function(name) {
+        $http[name] = function(url, config) {
+          return $http(extend({}, config || {}, {
+            method: name,
+            url: url
+          }));
+        };
+      });
+    }
+
+
+    function createShortMethodsWithData(name) {
+      forEach(arguments, function(name) {
+        $http[name] = function(url, data, config) {
+          return $http(extend({}, config || {}, {
+            method: name,
+            url: url,
+            data: data
+          }));
+        };
+      });
+    }
+
+
+    /**
+     * Makes the request.
+     *
+     * !!! ACCESSES CLOSURE VARS:
+     * $httpBackend, defaults, $log, $rootScope, defaultCache, $http.pendingRequests
+     */
+    function sendReq(config, reqData) {
+      var deferred = $q.defer(),
+          promise = deferred.promise,
+          cache,
+          cachedResp,
+          reqHeaders = config.headers,
+          url = buildUrl(config.url, config.paramSerializer(config.params));
+
+      $http.pendingRequests.push(config);
+      promise.then(removePendingReq, removePendingReq);
+
+
+      if ((config.cache || defaults.cache) && config.cache !== false &&
+          (config.method === 'GET' || config.method === 'JSONP')) {
+        cache = isObject(config.cache) ? config.cache
+              : isObject(defaults.cache) ? defaults.cache
+              : defaultCache;
+      }
+
+      if (cache) {
+        cachedResp = cache.get(url);
+        if (isDefined(cachedResp)) {
+          if (isPromiseLike(cachedResp)) {
+            // cached request has already been sent, but there is no response yet
+            cachedResp.then(resolvePromiseWithResult, resolvePromiseWithResult);
+          } else {
+            // serving from cache
+            if (isArray(cachedResp)) {
+              resolvePromise(cachedResp[1], cachedResp[0], shallowCopy(cachedResp[2]), cachedResp[3]);
+            } else {
+              resolvePromise(cachedResp, 200, {}, 'OK');
+            }
+          }
+        } else {
+          // put the promise for the non-transformed response into cache as a placeholder
+          cache.put(url, promise);
+        }
+      }
+
+
+      // if we won't have the response in cache, set the xsrf headers and
+      // send the request to the backend
+      if (isUndefined(cachedResp)) {
+        var xsrfValue = urlIsSameOrigin(config.url)
+            ? $$cookieReader()[config.xsrfCookieName || defaults.xsrfCookieName]
+            : undefined;
+        if (xsrfValue) {
+          reqHeaders[(config.xsrfHeaderName || defaults.xsrfHeaderName)] = xsrfValue;
+        }
+
+        $httpBackend(config.method, url, reqData, done, reqHeaders, config.timeout,
+            config.withCredentials, config.responseType);
+      }
+
+      return promise;
+
+
+      /**
+       * Callback registered to $httpBackend():
+       *  - caches the response if desired
+       *  - resolves the raw $http promise
+       *  - calls $apply
+       */
+      function done(status, response, headersString, statusText) {
+        if (cache) {
+          if (isSuccess(status)) {
+            cache.put(url, [status, response, parseHeaders(headersString), statusText]);
+          } else {
+            // remove promise from the cache
+            cache.remove(url);
+          }
+        }
+
+        function resolveHttpPromise() {
+          resolvePromise(response, status, headersString, statusText);
+        }
+
+        if (useApplyAsync) {
+          $rootScope.$applyAsync(resolveHttpPromise);
+        } else {
+          resolveHttpPromise();
+          if (!$rootScope.$$phase) $rootScope.$apply();
+        }
+      }
+
+
+      /**
+       * Resolves the raw $http promise.
+       */
+      function resolvePromise(response, status, headers, statusText) {
+        //status: HTTP response status code, 0, -1 (aborted by timeout / promise)
+        status = status >= -1 ? status : 0;
+
+        (isSuccess(status) ? deferred.resolve : deferred.reject)({
+          data: response,
+          status: status,
+          headers: headersGetter(headers),
+          config: config,
+          statusText: statusText
+        });
+      }
+
+      function resolvePromiseWithResult(result) {
+        resolvePromise(result.data, result.status, shallowCopy(result.headers()), result.statusText);
+      }
+
+      function removePendingReq() {
+        var idx = $http.pendingRequests.indexOf(config);
+        if (idx !== -1) $http.pendingRequests.splice(idx, 1);
+      }
+    }
+
+
+    function buildUrl(url, serializedParams) {
+      if (serializedParams.length > 0) {
+        url += ((url.indexOf('?') == -1) ? '?' : '&') + serializedParams;
+      }
+      return url;
+    }
+  }];
+}
+
+/**
+ * @ngdoc service
+ * @name $xhrFactory
+ *
+ * @description
+ * Factory function used to create XMLHttpRequest objects.
+ *
+ * Replace or decorate this service to create your own custom XMLHttpRequest objects.
+ *
+ * ```
+ * angular.module('myApp', [])
+ * .factory('$xhrFactory', function() {
+ *   return function createXhr(method, url) {
+ *     return new window.XMLHttpRequest({mozSystem: true});
+ *   };
+ * });
+ * ```
+ *
+ * @param {string} method HTTP method of the request (GET, POST, PUT, ..)
+ * @param {string} url URL of the request.
+ */
+function $xhrFactoryProvider() {
+  this.$get = function() {
+    return function createXhr() {
+      return new window.XMLHttpRequest();
+    };
+  };
+}
+
+/**
+ * @ngdoc service
+ * @name $httpBackend
+ * @requires $window
+ * @requires $document
+ * @requires $xhrFactory
+ *
+ * @description
+ * HTTP backend used by the {@link ng.$http service} that delegates to
+ * XMLHttpRequest object or JSONP and deals with browser incompatibilities.
+ *
+ * You should never need to use this service directly, instead use the higher-level abstractions:
+ * {@link ng.$http $http} or {@link ngResource.$resource $resource}.
+ *
+ * During testing this implementation is swapped with {@link ngMock.$httpBackend mock
+ * $httpBackend} which can be trained with responses.
+ */
+function $HttpBackendProvider() {
+  this.$get = ['$browser', '$window', '$document', '$xhrFactory', function($browser, $window, $document, $xhrFactory) {
+    return createHttpBackend($browser, $xhrFactory, $browser.defer, $window.angular.callbacks, $document[0]);
+  }];
+}
+
+function createHttpBackend($browser, createXhr, $browserDefer, callbacks, rawDocument) {
+  // TODO(vojta): fix the signature
+  return function(method, url, post, callback, headers, timeout, withCredentials, responseType) {
+    $browser.$$incOutstandingRequestCount();
+    url = url || $browser.url();
+
+    if (lowercase(method) == 'jsonp') {
+      var callbackId = '_' + (callbacks.counter++).toString(36);
+      callbacks[callbackId] = function(data) {
+        callbacks[callbackId].data = data;
+        callbacks[callbackId].called = true;
+      };
+
+      var jsonpDone = jsonpReq(url.replace('JSON_CALLBACK', 'angular.callbacks.' + callbackId),
+          callbackId, function(status, text) {
+        completeRequest(callback, status, callbacks[callbackId].data, "", text);
+        callbacks[callbackId] = noop;
+      });
+    } else {
+
+      var xhr = createXhr(method, url);
+
+      xhr.open(method, url, true);
+      forEach(headers, function(value, key) {
+        if (isDefined(value)) {
+            xhr.setRequestHeader(key, value);
+        }
+      });
+
+      xhr.onload = function requestLoaded() {
+        var statusText = xhr.statusText || '';
+
+        // responseText is the old-school way of retrieving response (supported by IE9)
+        // response/responseType properties were introduced in XHR Level2 spec (supported by IE10)
+        var response = ('response' in xhr) ? xhr.response : xhr.responseText;
+
+        // normalize IE9 bug (http://bugs.jquery.com/ticket/1450)
+        var status = xhr.status === 1223 ? 204 : xhr.status;
+
+        // fix status code when it is 0 (0 status is undocumented).
+        // Occurs when accessing file resources or on Android 4.1 stock browser
+        // while retrieving files from application cache.
+        if (status === 0) {
+          status = response ? 200 : urlResolve(url).protocol == 'file' ? 404 : 0;
+        }
+
+        completeRequest(callback,
+            status,
+            response,
+            xhr.getAllResponseHeaders(),
+            statusText);
+      };
+
+      var requestError = function() {
+        // The response is always empty
+        // See https://xhr.spec.whatwg.org/#request-error-steps and https://fetch.spec.whatwg.org/#concept-network-error
+        completeRequest(callback, -1, null, null, '');
+      };
+
+      xhr.onerror = requestError;
+      xhr.onabort = requestError;
+
+      if (withCredentials) {
+        xhr.withCredentials = true;
+      }
+
+      if (responseType) {
+        try {
+          xhr.responseType = responseType;
+        } catch (e) {
+          // WebKit added support for the json responseType value on 09/03/2013
+          // https://bugs.webkit.org/show_bug.cgi?id=73648. Versions of Safari prior to 7 are
+          // known to throw when setting the value "json" as the response type. Other older
+          // browsers implementing the responseType
+          //
+          // The json response type can be ignored if not supported, because JSON payloads are
+          // parsed on the client-side regardless.
+          if (responseType !== 'json') {
+            throw e;
+          }
+        }
+      }
+
+      xhr.send(isUndefined(post) ? null : post);
+    }
+
+    if (timeout > 0) {
+      var timeoutId = $browserDefer(timeoutRequest, timeout);
+    } else if (isPromiseLike(timeout)) {
+      timeout.then(timeoutRequest);
+    }
+
+
+    function timeoutRequest() {
+      jsonpDone && jsonpDone();
+      xhr && xhr.abort();
+    }
+
+    function completeRequest(callback, status, response, headersString, statusText) {
+      // cancel timeout and subsequent timeout promise resolution
+      if (isDefined(timeoutId)) {
+        $browserDefer.cancel(timeoutId);
+      }
+      jsonpDone = xhr = null;
+
+      callback(status, response, headersString, statusText);
+      $browser.$$completeOutstandingRequest(noop);
+    }
+  };
+
+  function jsonpReq(url, callbackId, done) {
+    // we can't use jQuery/jqLite here because jQuery does crazy stuff with script elements, e.g.:
+    // - fetches local scripts via XHR and evals them
+    // - adds and immediately removes script elements from the document
+    var script = rawDocument.createElement('script'), callback = null;
+    script.type = "text/javascript";
+    script.src = url;
+    script.async = true;
+
+    callback = function(event) {
+      removeEventListenerFn(script, "load", callback);
+      removeEventListenerFn(script, "error", callback);
+      rawDocument.body.removeChild(script);
+      script = null;
+      var status = -1;
+      var text = "unknown";
+
+      if (event) {
+        if (event.type === "load" && !callbacks[callbackId].called) {
+          event = { type: "error" };
+        }
+        text = event.type;
+        status = event.type === "error" ? 404 : 200;
+      }
+
+      if (done) {
+        done(status, text);
+      }
+    };
+
+    addEventListenerFn(script, "load", callback);
+    addEventListenerFn(script, "error", callback);
+    rawDocument.body.appendChild(script);
+    return callback;
+  }
+}
+
+var $interpolateMinErr = angular.$interpolateMinErr = minErr('$interpolate');
+$interpolateMinErr.throwNoconcat = function(text) {
+  throw $interpolateMinErr('noconcat',
+      "Error while interpolating: {0}\nStrict Contextual Escaping disallows " +
+      "interpolations that concatenate multiple expressions when a trusted value is " +
+      "required.  See http://docs.angularjs.org/api/ng.$sce", text);
+};
+
+$interpolateMinErr.interr = function(text, err) {
+  return $interpolateMinErr('interr', "Can't interpolate: {0}\n{1}", text, err.toString());
+};
+
+/**
+ * @ngdoc provider
+ * @name $interpolateProvider
+ *
+ * @description
+ *
+ * Used for configuring the interpolation markup. Defaults to `{{` and `}}`.
+ *
+ * @example
+<example module="customInterpolationApp">
+<file name="index.html">
+<script>
+  var customInterpolationApp = angular.module('customInterpolationApp', []);
+
+  customInterpolationApp.config(function($interpolateProvider) {
+    $interpolateProvider.startSymbol('//');
+    $interpolateProvider.endSymbol('//');
+  });
+
+
+  customInterpolationApp.controller('DemoController', function() {
+      this.label = "This binding is brought you by // interpolation symbols.";
+  });
+</script>
+<div ng-app="App" ng-controller="DemoController as demo">
+    //demo.label//
+</div>
+</file>
+<file name="protractor.js" type="protractor">
+  it('should interpolate binding with custom symbols', function() {
+    expect(element(by.binding('demo.label')).getText()).toBe('This binding is brought you by // interpolation symbols.');
+  });
+</file>
+</example>
+ */
+function $InterpolateProvider() {
+  var startSymbol = '{{';
+  var endSymbol = '}}';
+
+  /**
+   * @ngdoc method
+   * @name $interpolateProvider#startSymbol
+   * @description
+   * Symbol to denote start of expression in the interpolated string. Defaults to `{{`.
+   *
+   * @param {string=} value new value to set the starting symbol to.
+   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
+   */
+  this.startSymbol = function(value) {
+    if (value) {
+      startSymbol = value;
+      return this;
+    } else {
+      return startSymbol;
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name $interpolateProvider#endSymbol
+   * @description
+   * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
+   *
+   * @param {string=} value new value to set the ending symbol to.
+   * @returns {string|self} Returns the symbol when used as getter and self if used as setter.
+   */
+  this.endSymbol = function(value) {
+    if (value) {
+      endSymbol = value;
+      return this;
+    } else {
+      return endSymbol;
+    }
+  };
+
+
+  this.$get = ['$parse', '$exceptionHandler', '$sce', function($parse, $exceptionHandler, $sce) {
+    var startSymbolLength = startSymbol.length,
+        endSymbolLength = endSymbol.length,
+        escapedStartRegexp = new RegExp(startSymbol.replace(/./g, escape), 'g'),
+        escapedEndRegexp = new RegExp(endSymbol.replace(/./g, escape), 'g');
+
+    function escape(ch) {
+      return '\\\\\\' + ch;
+    }
+
+    function unescapeText(text) {
+      return text.replace(escapedStartRegexp, startSymbol).
+        replace(escapedEndRegexp, endSymbol);
+    }
+
+    function stringify(value) {
+      if (value == null) { // null || undefined
+        return '';
+      }
+      switch (typeof value) {
+        case 'string':
+          break;
+        case 'number':
+          value = '' + value;
+          break;
+        default:
+          value = toJson(value);
+      }
+
+      return value;
+    }
+
+    /**
+     * @ngdoc service
+     * @name $interpolate
+     * @kind function
+     *
+     * @requires $parse
+     * @requires $sce
+     *
+     * @description
+     *
+     * Compiles a string with markup into an interpolation function. This service is used by the
+     * HTML {@link ng.$compile $compile} service for data binding. See
+     * {@link ng.$interpolateProvider $interpolateProvider} for configuring the
+     * interpolation markup.
+     *
+     *
+     * ```js
+     *   var $interpolate = ...; // injected
+     *   var exp = $interpolate('Hello {{name | uppercase}}!');
+     *   expect(exp({name:'Angular'})).toEqual('Hello ANGULAR!');
+     * ```
+     *
+     * `$interpolate` takes an optional fourth argument, `allOrNothing`. If `allOrNothing` is
+     * `true`, the interpolation function will return `undefined` unless all embedded expressions
+     * evaluate to a value other than `undefined`.
+     *
+     * ```js
+     *   var $interpolate = ...; // injected
+     *   var context = {greeting: 'Hello', name: undefined };
+     *
+     *   // default "forgiving" mode
+     *   var exp = $interpolate('{{greeting}} {{name}}!');
+     *   expect(exp(context)).toEqual('Hello !');
+     *
+     *   // "allOrNothing" mode
+     *   exp = $interpolate('{{greeting}} {{name}}!', false, null, true);
+     *   expect(exp(context)).toBeUndefined();
+     *   context.name = 'Angular';
+     *   expect(exp(context)).toEqual('Hello Angular!');
+     * ```
+     *
+     * `allOrNothing` is useful for interpolating URLs. `ngSrc` and `ngSrcset` use this behavior.
+     *
+     * ####Escaped Interpolation
+     * $interpolate provides a mechanism for escaping interpolation markers. Start and end markers
+     * can be escaped by preceding each of their characters with a REVERSE SOLIDUS U+005C (backslash).
+     * It will be rendered as a regular start/end marker, and will not be interpreted as an expression
+     * or binding.
+     *
+     * This enables web-servers to prevent script injection attacks and defacing attacks, to some
+     * degree, while also enabling code examples to work without relying on the
+     * {@link ng.directive:ngNonBindable ngNonBindable} directive.
+     *
+     * **For security purposes, it is strongly encouraged that web servers escape user-supplied data,
+     * replacing angle brackets (&lt;, &gt;) with &amp;lt; and &amp;gt; respectively, and replacing all
+     * interpolation start/end markers with their escaped counterparts.**
+     *
+     * Escaped interpolation markers are only replaced with the actual interpolation markers in rendered
+     * output when the $interpolate service processes the text. So, for HTML elements interpolated
+     * by {@link ng.$compile $compile}, or otherwise interpolated with the `mustHaveExpression` parameter
+     * set to `true`, the interpolated text must contain an unescaped interpolation expression. As such,
+     * this is typically useful only when user-data is used in rendering a template from the server, or
+     * when otherwise untrusted data is used by a directive.
+     *
+     * <example>
+     *  <file name="index.html">
+     *    <div ng-init="username='A user'">
+     *      <p ng-init="apptitle='Escaping demo'">{{apptitle}}: \{\{ username = "defaced value"; \}\}
+     *        </p>
+     *      <p><strong>{{username}}</strong> attempts to inject code which will deface the
+     *        application, but fails to accomplish their task, because the server has correctly
+     *        escaped the interpolation start/end markers with REVERSE SOLIDUS U+005C (backslash)
+     *        characters.</p>
+     *      <p>Instead, the result of the attempted script injection is visible, and can be removed
+     *        from the database by an administrator.</p>
+     *    </div>
+     *  </file>
+     * </example>
+     *
+     * @param {string} text The text with markup to interpolate.
+     * @param {boolean=} mustHaveExpression if set to true then the interpolation string must have
+     *    embedded expression in order to return an interpolation function. Strings with no
+     *    embedded expression will return null for the interpolation function.
+     * @param {string=} trustedContext when provided, the returned function passes the interpolated
+     *    result through {@link ng.$sce#getTrusted $sce.getTrusted(interpolatedResult,
+     *    trustedContext)} before returning it.  Refer to the {@link ng.$sce $sce} service that
+     *    provides Strict Contextual Escaping for details.
+     * @param {boolean=} allOrNothing if `true`, then the returned function returns undefined
+     *    unless all embedded expressions evaluate to a value other than `undefined`.
+     * @returns {function(context)} an interpolation function which is used to compute the
+     *    interpolated string. The function has these parameters:
+     *
+     * - `context`: evaluation context for all expressions embedded in the interpolated text
+     */
+    function $interpolate(text, mustHaveExpression, trustedContext, allOrNothing) {
+      allOrNothing = !!allOrNothing;
+      var startIndex,
+          endIndex,
+          index = 0,
+          expressions = [],
+          parseFns = [],
+          textLength = text.length,
+          exp,
+          concat = [],
+          expressionPositions = [];
+
+      while (index < textLength) {
+        if (((startIndex = text.indexOf(startSymbol, index)) != -1) &&
+             ((endIndex = text.indexOf(endSymbol, startIndex + startSymbolLength)) != -1)) {
+          if (index !== startIndex) {
+            concat.push(unescapeText(text.substring(index, startIndex)));
+          }
+          exp = text.substring(startIndex + startSymbolLength, endIndex);
+          expressions.push(exp);
+          parseFns.push($parse(exp, parseStringifyInterceptor));
+          index = endIndex + endSymbolLength;
+          expressionPositions.push(concat.length);
+          concat.push('');
+        } else {
+          // we did not find an interpolation, so we have to add the remainder to the separators array
+          if (index !== textLength) {
+            concat.push(unescapeText(text.substring(index)));
+          }
+          break;
+        }
+      }
+
+      // Concatenating expressions makes it hard to reason about whether some combination of
+      // concatenated values are unsafe to use and could easily lead to XSS.  By requiring that a
+      // single expression be used for iframe[src], object[src], etc., we ensure that the value
+      // that's used is assigned or constructed by some JS code somewhere that is more testable or
+      // make it obvious that you bound the value to some user controlled value.  This helps reduce
+      // the load when auditing for XSS issues.
+      if (trustedContext && concat.length > 1) {
+          $interpolateMinErr.throwNoconcat(text);
+      }
+
+      if (!mustHaveExpression || expressions.length) {
+        var compute = function(values) {
+          for (var i = 0, ii = expressions.length; i < ii; i++) {
+            if (allOrNothing && isUndefined(values[i])) return;
+            concat[expressionPositions[i]] = values[i];
+          }
+          return concat.join('');
+        };
+
+        var getValue = function(value) {
+          return trustedContext ?
+            $sce.getTrusted(trustedContext, value) :
+            $sce.valueOf(value);
+        };
+
+        return extend(function interpolationFn(context) {
+            var i = 0;
+            var ii = expressions.length;
+            var values = new Array(ii);
+
+            try {
+              for (; i < ii; i++) {
+                values[i] = parseFns[i](context);
+              }
+
+              return compute(values);
+            } catch (err) {
+              $exceptionHandler($interpolateMinErr.interr(text, err));
+            }
+
+          }, {
+          // all of these properties are undocumented for now
+          exp: text, //just for compatibility with regular watchers created via $watch
+          expressions: expressions,
+          $$watchDelegate: function(scope, listener) {
+            var lastValue;
+            return scope.$watchGroup(parseFns, function interpolateFnWatcher(values, oldValues) {
+              var currValue = compute(values);
+              if (isFunction(listener)) {
+                listener.call(this, currValue, values !== oldValues ? lastValue : currValue, scope);
+              }
+              lastValue = currValue;
+            });
+          }
+        });
+      }
+
+      function parseStringifyInterceptor(value) {
+        try {
+          value = getValue(value);
+          return allOrNothing && !isDefined(value) ? value : stringify(value);
+        } catch (err) {
+          $exceptionHandler($interpolateMinErr.interr(text, err));
+        }
+      }
+    }
+
+
+    /**
+     * @ngdoc method
+     * @name $interpolate#startSymbol
+     * @description
+     * Symbol to denote the start of expression in the interpolated string. Defaults to `{{`.
+     *
+     * Use {@link ng.$interpolateProvider#startSymbol `$interpolateProvider.startSymbol`} to change
+     * the symbol.
+     *
+     * @returns {string} start symbol.
+     */
+    $interpolate.startSymbol = function() {
+      return startSymbol;
+    };
+
+
+    /**
+     * @ngdoc method
+     * @name $interpolate#endSymbol
+     * @description
+     * Symbol to denote the end of expression in the interpolated string. Defaults to `}}`.
+     *
+     * Use {@link ng.$interpolateProvider#endSymbol `$interpolateProvider.endSymbol`} to change
+     * the symbol.
+     *
+     * @returns {string} end symbol.
+     */
+    $interpolate.endSymbol = function() {
+      return endSymbol;
+    };
+
+    return $interpolate;
+  }];
+}
+
+function $IntervalProvider() {
+  this.$get = ['$rootScope', '$window', '$q', '$$q',
+       function($rootScope,   $window,   $q,   $$q) {
+    var intervals = {};
+
+
+     /**
+      * @ngdoc service
+      * @name $interval
+      *
+      * @description
+      * Angular's wrapper for `window.setInterval`. The `fn` function is executed every `delay`
+      * milliseconds.
+      *
+      * The return value of registering an interval function is a promise. This promise will be
+      * notified upon each tick of the interval, and will be resolved after `count` iterations, or
+      * run indefinitely if `count` is not defined. The value of the notification will be the
+      * number of iterations that have run.
+      * To cancel an interval, call `$interval.cancel(promise)`.
+      *
+      * In tests you can use {@link ngMock.$interval#flush `$interval.flush(millis)`} to
+      * move forward by `millis` milliseconds and trigger any functions scheduled to run in that
+      * time.
+      *
+      * <div class="alert alert-warning">
+      * **Note**: Intervals created by this service must be explicitly destroyed when you are finished
+      * with them.  In particular they are not automatically destroyed when a controller's scope or a
+      * directive's element are destroyed.
+      * You should take this into consideration and make sure to always cancel the interval at the
+      * appropriate moment.  See the example below for more details on how and when to do this.
+      * </div>
+      *
+      * @param {function()} fn A function that should be called repeatedly.
+      * @param {number} delay Number of milliseconds between each function call.
+      * @param {number=} [count=0] Number of times to repeat. If not set, or 0, will repeat
+      *   indefinitely.
+      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
+      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
+      * @param {...*=} Pass additional parameters to the executed function.
+      * @returns {promise} A promise which will be notified on each iteration.
+      *
+      * @example
+      * <example module="intervalExample">
+      * <file name="index.html">
+      *   <script>
+      *     angular.module('intervalExample', [])
+      *       .controller('ExampleController', ['$scope', '$interval',
+      *         function($scope, $interval) {
+      *           $scope.format = 'M/d/yy h:mm:ss a';
+      *           $scope.blood_1 = 100;
+      *           $scope.blood_2 = 120;
+      *
+      *           var stop;
+      *           $scope.fight = function() {
+      *             // Don't start a new fight if we are already fighting
+      *             if ( angular.isDefined(stop) ) return;
+      *
+      *             stop = $interval(function() {
+      *               if ($scope.blood_1 > 0 && $scope.blood_2 > 0) {
+      *                 $scope.blood_1 = $scope.blood_1 - 3;
+      *                 $scope.blood_2 = $scope.blood_2 - 4;
+      *               } else {
+      *                 $scope.stopFight();
+      *               }
+      *             }, 100);
+      *           };
+      *
+      *           $scope.stopFight = function() {
+      *             if (angular.isDefined(stop)) {
+      *               $interval.cancel(stop);
+      *               stop = undefined;
+      *             }
+      *           };
+      *
+      *           $scope.resetFight = function() {
+      *             $scope.blood_1 = 100;
+      *             $scope.blood_2 = 120;
+      *           };
+      *
+      *           $scope.$on('$destroy', function() {
+      *             // Make sure that the interval is destroyed too
+      *             $scope.stopFight();
+      *           });
+      *         }])
+      *       // Register the 'myCurrentTime' directive factory method.
+      *       // We inject $interval and dateFilter service since the factory method is DI.
+      *       .directive('myCurrentTime', ['$interval', 'dateFilter',
+      *         function($interval, dateFilter) {
+      *           // return the directive link function. (compile function not needed)
+      *           return function(scope, element, attrs) {
+      *             var format,  // date format
+      *                 stopTime; // so that we can cancel the time updates
+      *
+      *             // used to update the UI
+      *             function updateTime() {
+      *               element.text(dateFilter(new Date(), format));
+      *             }
+      *
+      *             // watch the expression, and update the UI on change.
+      *             scope.$watch(attrs.myCurrentTime, function(value) {
+      *               format = value;
+      *               updateTime();
+      *             });
+      *
+      *             stopTime = $interval(updateTime, 1000);
+      *
+      *             // listen on DOM destroy (removal) event, and cancel the next UI update
+      *             // to prevent updating time after the DOM element was removed.
+      *             element.on('$destroy', function() {
+      *               $interval.cancel(stopTime);
+      *             });
+      *           }
+      *         }]);
+      *   </script>
+      *
+      *   <div>
+      *     <div ng-controller="ExampleController">
+      *       <label>Date format: <input ng-model="format"></label> <hr/>
+      *       Current time is: <span my-current-time="format"></span>
+      *       <hr/>
+      *       Blood 1 : <font color='red'>{{blood_1}}</font>
+      *       Blood 2 : <font color='red'>{{blood_2}}</font>
+      *       <button type="button" data-ng-click="fight()">Fight</button>
+      *       <button type="button" data-ng-click="stopFight()">StopFight</button>
+      *       <button type="button" data-ng-click="resetFight()">resetFight</button>
+      *     </div>
+      *   </div>
+      *
+      * </file>
+      * </example>
+      */
+    function interval(fn, delay, count, invokeApply) {
+      var hasParams = arguments.length > 4,
+          args = hasParams ? sliceArgs(arguments, 4) : [],
+          setInterval = $window.setInterval,
+          clearInterval = $window.clearInterval,
+          iteration = 0,
+          skipApply = (isDefined(invokeApply) && !invokeApply),
+          deferred = (skipApply ? $$q : $q).defer(),
+          promise = deferred.promise;
+
+      count = isDefined(count) ? count : 0;
+
+      promise.then(null, null, (!hasParams) ? fn : function() {
+        fn.apply(null, args);
+      });
+
+      promise.$$intervalId = setInterval(function tick() {
+        deferred.notify(iteration++);
+
+        if (count > 0 && iteration >= count) {
+          deferred.resolve(iteration);
+          clearInterval(promise.$$intervalId);
+          delete intervals[promise.$$intervalId];
+        }
+
+        if (!skipApply) $rootScope.$apply();
+
+      }, delay);
+
+      intervals[promise.$$intervalId] = deferred;
+
+      return promise;
+    }
+
+
+     /**
+      * @ngdoc method
+      * @name $interval#cancel
+      *
+      * @description
+      * Cancels a task associated with the `promise`.
+      *
+      * @param {Promise=} promise returned by the `$interval` function.
+      * @returns {boolean} Returns `true` if the task was successfully canceled.
+      */
+    interval.cancel = function(promise) {
+      if (promise && promise.$$intervalId in intervals) {
+        intervals[promise.$$intervalId].reject('canceled');
+        $window.clearInterval(promise.$$intervalId);
+        delete intervals[promise.$$intervalId];
+        return true;
+      }
+      return false;
+    };
+
+    return interval;
+  }];
+}
+
+/**
+ * @ngdoc service
+ * @name $locale
+ *
+ * @description
+ * $locale service provides localization rules for various Angular components. As of right now the
+ * only public api is:
+ *
+ * * `id` – `{string}` – locale id formatted as `languageId-countryId` (e.g. `en-us`)
+ */
+
+var PATH_MATCH = /^([^\?#]*)(\?([^#]*))?(#(.*))?$/,
+    DEFAULT_PORTS = {'http': 80, 'https': 443, 'ftp': 21};
+var $locationMinErr = minErr('$location');
+
+
+/**
+ * Encode path using encodeUriSegment, ignoring forward slashes
+ *
+ * @param {string} path Path to encode
+ * @returns {string}
+ */
+function encodePath(path) {
+  var segments = path.split('/'),
+      i = segments.length;
+
+  while (i--) {
+    segments[i] = encodeUriSegment(segments[i]);
+  }
+
+  return segments.join('/');
+}
+
+function parseAbsoluteUrl(absoluteUrl, locationObj) {
+  var parsedUrl = urlResolve(absoluteUrl);
+
+  locationObj.$$protocol = parsedUrl.protocol;
+  locationObj.$$host = parsedUrl.hostname;
+  locationObj.$$port = toInt(parsedUrl.port) || DEFAULT_PORTS[parsedUrl.protocol] || null;
+}
+
+
+function parseAppUrl(relativeUrl, locationObj) {
+  var prefixed = (relativeUrl.charAt(0) !== '/');
+  if (prefixed) {
+    relativeUrl = '/' + relativeUrl;
+  }
+  var match = urlResolve(relativeUrl);
+  locationObj.$$path = decodeURIComponent(prefixed && match.pathname.charAt(0) === '/' ?
+      match.pathname.substring(1) : match.pathname);
+  locationObj.$$search = parseKeyValue(match.search);
+  locationObj.$$hash = decodeURIComponent(match.hash);
+
+  // make sure path starts with '/';
+  if (locationObj.$$path && locationObj.$$path.charAt(0) != '/') {
+    locationObj.$$path = '/' + locationObj.$$path;
+  }
+}
+
+
+/**
+ *
+ * @param {string} begin
+ * @param {string} whole
+ * @returns {string} returns text from whole after begin or undefined if it does not begin with
+ *                   expected string.
+ */
+function beginsWith(begin, whole) {
+  if (whole.indexOf(begin) === 0) {
+    return whole.substr(begin.length);
+  }
+}
+
+
+function stripHash(url) {
+  var index = url.indexOf('#');
+  return index == -1 ? url : url.substr(0, index);
+}
+
+function trimEmptyHash(url) {
+  return url.replace(/(#.+)|#$/, '$1');
+}
+
+
+function stripFile(url) {
+  return url.substr(0, stripHash(url).lastIndexOf('/') + 1);
+}
+
+/* return the server only (scheme://host:port) */
+function serverBase(url) {
+  return url.substring(0, url.indexOf('/', url.indexOf('//') + 2));
+}
+
+
+/**
+ * LocationHtml5Url represents an url
+ * This object is exposed as $location service when HTML5 mode is enabled and supported
+ *
+ * @constructor
+ * @param {string} appBase application base URL
+ * @param {string} appBaseNoFile application base URL stripped of any filename
+ * @param {string} basePrefix url path prefix
+ */
+function LocationHtml5Url(appBase, appBaseNoFile, basePrefix) {
+  this.$$html5 = true;
+  basePrefix = basePrefix || '';
+  parseAbsoluteUrl(appBase, this);
+
+
+  /**
+   * Parse given html5 (regular) url string into properties
+   * @param {string} url HTML5 url
+   * @private
+   */
+  this.$$parse = function(url) {
+    var pathUrl = beginsWith(appBaseNoFile, url);
+    if (!isString(pathUrl)) {
+      throw $locationMinErr('ipthprfx', 'Invalid url "{0}", missing path prefix "{1}".', url,
+          appBaseNoFile);
+    }
+
+    parseAppUrl(pathUrl, this);
+
+    if (!this.$$path) {
+      this.$$path = '/';
+    }
+
+    this.$$compose();
+  };
+
+  /**
+   * Compose url and update `absUrl` property
+   * @private
+   */
+  this.$$compose = function() {
+    var search = toKeyValue(this.$$search),
+        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
+
+    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
+    this.$$absUrl = appBaseNoFile + this.$$url.substr(1); // first char is always '/'
+  };
+
+  this.$$parseLinkUrl = function(url, relHref) {
+    if (relHref && relHref[0] === '#') {
+      // special case for links to hash fragments:
+      // keep the old url and only replace the hash fragment
+      this.hash(relHref.slice(1));
+      return true;
+    }
+    var appUrl, prevAppUrl;
+    var rewrittenUrl;
+
+    if (isDefined(appUrl = beginsWith(appBase, url))) {
+      prevAppUrl = appUrl;
+      if (isDefined(appUrl = beginsWith(basePrefix, appUrl))) {
+        rewrittenUrl = appBaseNoFile + (beginsWith('/', appUrl) || appUrl);
+      } else {
+        rewrittenUrl = appBase + prevAppUrl;
+      }
+    } else if (isDefined(appUrl = beginsWith(appBaseNoFile, url))) {
+      rewrittenUrl = appBaseNoFile + appUrl;
+    } else if (appBaseNoFile == url + '/') {
+      rewrittenUrl = appBaseNoFile;
+    }
+    if (rewrittenUrl) {
+      this.$$parse(rewrittenUrl);
+    }
+    return !!rewrittenUrl;
+  };
+}
+
+
+/**
+ * LocationHashbangUrl represents url
+ * This object is exposed as $location service when developer doesn't opt into html5 mode.
+ * It also serves as the base class for html5 mode fallback on legacy browsers.
+ *
+ * @constructor
+ * @param {string} appBase application base URL
+ * @param {string} appBaseNoFile application base URL stripped of any filename
+ * @param {string} hashPrefix hashbang prefix
+ */
+function LocationHashbangUrl(appBase, appBaseNoFile, hashPrefix) {
+
+  parseAbsoluteUrl(appBase, this);
+
+
+  /**
+   * Parse given hashbang url into properties
+   * @param {string} url Hashbang url
+   * @private
+   */
+  this.$$parse = function(url) {
+    var withoutBaseUrl = beginsWith(appBase, url) || beginsWith(appBaseNoFile, url);
+    var withoutHashUrl;
+
+    if (!isUndefined(withoutBaseUrl) && withoutBaseUrl.charAt(0) === '#') {
+
+      // The rest of the url starts with a hash so we have
+      // got either a hashbang path or a plain hash fragment
+      withoutHashUrl = beginsWith(hashPrefix, withoutBaseUrl);
+      if (isUndefined(withoutHashUrl)) {
+        // There was no hashbang prefix so we just have a hash fragment
+        withoutHashUrl = withoutBaseUrl;
+      }
+
+    } else {
+      // There was no hashbang path nor hash fragment:
+      // If we are in HTML5 mode we use what is left as the path;
+      // Otherwise we ignore what is left
+      if (this.$$html5) {
+        withoutHashUrl = withoutBaseUrl;
+      } else {
+        withoutHashUrl = '';
+        if (isUndefined(withoutBaseUrl)) {
+          appBase = url;
+          this.replace();
+        }
+      }
+    }
+
+    parseAppUrl(withoutHashUrl, this);
+
+    this.$$path = removeWindowsDriveName(this.$$path, withoutHashUrl, appBase);
+
+    this.$$compose();
+
+    /*
+     * In Windows, on an anchor node on documents loaded from
+     * the filesystem, the browser will return a pathname
+     * prefixed with the drive name ('/C:/path') when a
+     * pathname without a drive is set:
+     *  * a.setAttribute('href', '/foo')
+     *   * a.pathname === '/C:/foo' //true
+     *
+     * Inside of Angular, we're always using pathnames that
+     * do not include drive names for routing.
+     */
+    function removeWindowsDriveName(path, url, base) {
+      /*
+      Matches paths for file protocol on windows,
+      such as /C:/foo/bar, and captures only /foo/bar.
+      */
+      var windowsFilePathExp = /^\/[A-Z]:(\/.*)/;
+
+      var firstPathSegmentMatch;
+
+      //Get the relative path from the input URL.
+      if (url.indexOf(base) === 0) {
+        url = url.replace(base, '');
+      }
+
+      // The input URL intentionally contains a first path segment that ends with a colon.
+      if (windowsFilePathExp.exec(url)) {
+        return path;
+      }
+
+      firstPathSegmentMatch = windowsFilePathExp.exec(path);
+      return firstPathSegmentMatch ? firstPathSegmentMatch[1] : path;
+    }
+  };
+
+  /**
+   * Compose hashbang url and update `absUrl` property
+   * @private
+   */
+  this.$$compose = function() {
+    var search = toKeyValue(this.$$search),
+        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
+
+    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
+    this.$$absUrl = appBase + (this.$$url ? hashPrefix + this.$$url : '');
+  };
+
+  this.$$parseLinkUrl = function(url, relHref) {
+    if (stripHash(appBase) == stripHash(url)) {
+      this.$$parse(url);
+      return true;
+    }
+    return false;
+  };
+}
+
+
+/**
+ * LocationHashbangUrl represents url
+ * This object is exposed as $location service when html5 history api is enabled but the browser
+ * does not support it.
+ *
+ * @constructor
+ * @param {string} appBase application base URL
+ * @param {string} appBaseNoFile application base URL stripped of any filename
+ * @param {string} hashPrefix hashbang prefix
+ */
+function LocationHashbangInHtml5Url(appBase, appBaseNoFile, hashPrefix) {
+  this.$$html5 = true;
+  LocationHashbangUrl.apply(this, arguments);
+
+  this.$$parseLinkUrl = function(url, relHref) {
+    if (relHref && relHref[0] === '#') {
+      // special case for links to hash fragments:
+      // keep the old url and only replace the hash fragment
+      this.hash(relHref.slice(1));
+      return true;
+    }
+
+    var rewrittenUrl;
+    var appUrl;
+
+    if (appBase == stripHash(url)) {
+      rewrittenUrl = url;
+    } else if ((appUrl = beginsWith(appBaseNoFile, url))) {
+      rewrittenUrl = appBase + hashPrefix + appUrl;
+    } else if (appBaseNoFile === url + '/') {
+      rewrittenUrl = appBaseNoFile;
+    }
+    if (rewrittenUrl) {
+      this.$$parse(rewrittenUrl);
+    }
+    return !!rewrittenUrl;
+  };
+
+  this.$$compose = function() {
+    var search = toKeyValue(this.$$search),
+        hash = this.$$hash ? '#' + encodeUriSegment(this.$$hash) : '';
+
+    this.$$url = encodePath(this.$$path) + (search ? '?' + search : '') + hash;
+    // include hashPrefix in $$absUrl when $$url is empty so IE9 does not reload page because of removal of '#'
+    this.$$absUrl = appBase + hashPrefix + this.$$url;
+  };
+
+}
+
+
+var locationPrototype = {
+
+  /**
+   * Are we in html5 mode?
+   * @private
+   */
+  $$html5: false,
+
+  /**
+   * Has any change been replacing?
+   * @private
+   */
+  $$replace: false,
+
+  /**
+   * @ngdoc method
+   * @name $location#absUrl
+   *
+   * @description
+   * This method is getter only.
+   *
+   * Return full url representation with all segments encoded according to rules specified in
+   * [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt).
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var absUrl = $location.absUrl();
+   * // => "http://example.com/#/some/path?foo=bar&baz=xoxo"
+   * ```
+   *
+   * @return {string} full url
+   */
+  absUrl: locationGetter('$$absUrl'),
+
+  /**
+   * @ngdoc method
+   * @name $location#url
+   *
+   * @description
+   * This method is getter / setter.
+   *
+   * Return url (e.g. `/path?a=b#hash`) when called without any parameter.
+   *
+   * Change path, search and hash, when called with parameter and return `$location`.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var url = $location.url();
+   * // => "/some/path?foo=bar&baz=xoxo"
+   * ```
+   *
+   * @param {string=} url New url without base prefix (e.g. `/path?a=b#hash`)
+   * @return {string} url
+   */
+  url: function(url) {
+    if (isUndefined(url)) {
+      return this.$$url;
+    }
+
+    var match = PATH_MATCH.exec(url);
+    if (match[1] || url === '') this.path(decodeURIComponent(match[1]));
+    if (match[2] || match[1] || url === '') this.search(match[3] || '');
+    this.hash(match[5] || '');
+
+    return this;
+  },
+
+  /**
+   * @ngdoc method
+   * @name $location#protocol
+   *
+   * @description
+   * This method is getter only.
+   *
+   * Return protocol of current url.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var protocol = $location.protocol();
+   * // => "http"
+   * ```
+   *
+   * @return {string} protocol of current url
+   */
+  protocol: locationGetter('$$protocol'),
+
+  /**
+   * @ngdoc method
+   * @name $location#host
+   *
+   * @description
+   * This method is getter only.
+   *
+   * Return host of current url.
+   *
+   * Note: compared to the non-angular version `location.host` which returns `hostname:port`, this returns the `hostname` portion only.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var host = $location.host();
+   * // => "example.com"
+   *
+   * // given url http://user:password@example.com:8080/#/some/path?foo=bar&baz=xoxo
+   * host = $location.host();
+   * // => "example.com"
+   * host = location.host;
+   * // => "example.com:8080"
+   * ```
+   *
+   * @return {string} host of current url.
+   */
+  host: locationGetter('$$host'),
+
+  /**
+   * @ngdoc method
+   * @name $location#port
+   *
+   * @description
+   * This method is getter only.
+   *
+   * Return port of current url.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var port = $location.port();
+   * // => 80
+   * ```
+   *
+   * @return {Number} port
+   */
+  port: locationGetter('$$port'),
+
+  /**
+   * @ngdoc method
+   * @name $location#path
+   *
+   * @description
+   * This method is getter / setter.
+   *
+   * Return path of current url when called without any parameter.
+   *
+   * Change path when called with parameter and return `$location`.
+   *
+   * Note: Path should always begin with forward slash (/), this method will add the forward slash
+   * if it is missing.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var path = $location.path();
+   * // => "/some/path"
+   * ```
+   *
+   * @param {(string|number)=} path New path
+   * @return {string} path
+   */
+  path: locationGetterSetter('$$path', function(path) {
+    path = path !== null ? path.toString() : '';
+    return path.charAt(0) == '/' ? path : '/' + path;
+  }),
+
+  /**
+   * @ngdoc method
+   * @name $location#search
+   *
+   * @description
+   * This method is getter / setter.
+   *
+   * Return search part (as object) of current url when called without any parameter.
+   *
+   * Change search part when called with parameter and return `$location`.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo
+   * var searchObject = $location.search();
+   * // => {foo: 'bar', baz: 'xoxo'}
+   *
+   * // set foo to 'yipee'
+   * $location.search('foo', 'yipee');
+   * // $location.search() => {foo: 'yipee', baz: 'xoxo'}
+   * ```
+   *
+   * @param {string|Object.<string>|Object.<Array.<string>>} search New search params - string or
+   * hash object.
+   *
+   * When called with a single argument the method acts as a setter, setting the `search` component
+   * of `$location` to the specified value.
+   *
+   * If the argument is a hash object containing an array of values, these values will be encoded
+   * as duplicate search parameters in the url.
+   *
+   * @param {(string|Number|Array<string>|boolean)=} paramValue If `search` is a string or number, then `paramValue`
+   * will override only a single search property.
+   *
+   * If `paramValue` is an array, it will override the property of the `search` component of
+   * `$location` specified via the first argument.
+   *
+   * If `paramValue` is `null`, the property specified via the first argument will be deleted.
+   *
+   * If `paramValue` is `true`, the property specified via the first argument will be added with no
+   * value nor trailing equal sign.
+   *
+   * @return {Object} If called with no arguments returns the parsed `search` object. If called with
+   * one or more arguments returns `$location` object itself.
+   */
+  search: function(search, paramValue) {
+    switch (arguments.length) {
+      case 0:
+        return this.$$search;
+      case 1:
+        if (isString(search) || isNumber(search)) {
+          search = search.toString();
+          this.$$search = parseKeyValue(search);
+        } else if (isObject(search)) {
+          search = copy(search, {});
+          // remove object undefined or null properties
+          forEach(search, function(value, key) {
+            if (value == null) delete search[key];
+          });
+
+          this.$$search = search;
+        } else {
+          throw $locationMinErr('isrcharg',
+              'The first argument of the `$location#search()` call must be a string or an object.');
+        }
+        break;
+      default:
+        if (isUndefined(paramValue) || paramValue === null) {
+          delete this.$$search[search];
+        } else {
+          this.$$search[search] = paramValue;
+        }
+    }
+
+    this.$$compose();
+    return this;
+  },
+
+  /**
+   * @ngdoc method
+   * @name $location#hash
+   *
+   * @description
+   * This method is getter / setter.
+   *
+   * Return hash fragment when called without any parameter.
+   *
+   * Change hash fragment when called with parameter and return `$location`.
+   *
+   *
+   * ```js
+   * // given url http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
+   * var hash = $location.hash();
+   * // => "hashValue"
+   * ```
+   *
+   * @param {(string|number)=} hash New hash fragment
+   * @return {string} hash
+   */
+  hash: locationGetterSetter('$$hash', function(hash) {
+    return hash !== null ? hash.toString() : '';
+  }),
+
+  /**
+   * @ngdoc method
+   * @name $location#replace
+   *
+   * @description
+   * If called, all changes to $location during current `$digest` will be replacing current history
+   * record, instead of adding new one.
+   */
+  replace: function() {
+    this.$$replace = true;
+    return this;
+  }
+};
+
+forEach([LocationHashbangInHtml5Url, LocationHashbangUrl, LocationHtml5Url], function(Location) {
+  Location.prototype = Object.create(locationPrototype);
+
+  /**
+   * @ngdoc method
+   * @name $location#state
+   *
+   * @description
+   * This method is getter / setter.
+   *
+   * Return the history state object when called without any parameter.
+   *
+   * Change the history state object when called with one parameter and return `$location`.
+   * The state object is later passed to `pushState` or `replaceState`.
+   *
+   * NOTE: This method is supported only in HTML5 mode and only in browsers supporting
+   * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support
+   * older browsers (like IE9 or Android < 4.0), don't use this method.
+   *
+   * @param {object=} state State object for pushState or replaceState
+   * @return {object} state
+   */
+  Location.prototype.state = function(state) {
+    if (!arguments.length) {
+      return this.$$state;
+    }
+
+    if (Location !== LocationHtml5Url || !this.$$html5) {
+      throw $locationMinErr('nostate', 'History API state support is available only ' +
+        'in HTML5 mode and only in browsers supporting HTML5 History API');
+    }
+    // The user might modify `stateObject` after invoking `$location.state(stateObject)`
+    // but we're changing the $$state reference to $browser.state() during the $digest
+    // so the modification window is narrow.
+    this.$$state = isUndefined(state) ? null : state;
+
+    return this;
+  };
+});
+
+
+function locationGetter(property) {
+  return function() {
+    return this[property];
+  };
+}
+
+
+function locationGetterSetter(property, preprocess) {
+  return function(value) {
+    if (isUndefined(value)) {
+      return this[property];
+    }
+
+    this[property] = preprocess(value);
+    this.$$compose();
+
+    return this;
+  };
+}
+
+
+/**
+ * @ngdoc service
+ * @name $location
+ *
+ * @requires $rootElement
+ *
+ * @description
+ * The $location service parses the URL in the browser address bar (based on the
+ * [window.location](https://developer.mozilla.org/en/window.location)) and makes the URL
+ * available to your application. Changes to the URL in the address bar are reflected into
+ * $location service and changes to $location are reflected into the browser address bar.
+ *
+ * **The $location service:**
+ *
+ * - Exposes the current URL in the browser address bar, so you can
+ *   - Watch and observe the URL.
+ *   - Change the URL.
+ * - Synchronizes the URL with the browser when the user
+ *   - Changes the address bar.
+ *   - Clicks the back or forward button (or clicks a History link).
+ *   - Clicks on a link.
+ * - Represents the URL object as a set of methods (protocol, host, port, path, search, hash).
+ *
+ * For more information see {@link guide/$location Developer Guide: Using $location}
+ */
+
+/**
+ * @ngdoc provider
+ * @name $locationProvider
+ * @description
+ * Use the `$locationProvider` to configure how the application deep linking paths are stored.
+ */
+function $LocationProvider() {
+  var hashPrefix = '',
+      html5Mode = {
+        enabled: false,
+        requireBase: true,
+        rewriteLinks: true
+      };
+
+  /**
+   * @ngdoc method
+   * @name $locationProvider#hashPrefix
+   * @description
+   * @param {string=} prefix Prefix for hash part (containing path and search)
+   * @returns {*} current value if used as getter or itself (chaining) if used as setter
+   */
+  this.hashPrefix = function(prefix) {
+    if (isDefined(prefix)) {
+      hashPrefix = prefix;
+      return this;
+    } else {
+      return hashPrefix;
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name $locationProvider#html5Mode
+   * @description
+   * @param {(boolean|Object)=} mode If boolean, sets `html5Mode.enabled` to value.
+   *   If object, sets `enabled`, `requireBase` and `rewriteLinks` to respective values. Supported
+   *   properties:
+   *   - **enabled** – `{boolean}` – (default: false) If true, will rely on `history.pushState` to
+   *     change urls where supported. Will fall back to hash-prefixed paths in browsers that do not
+   *     support `pushState`.
+   *   - **requireBase** - `{boolean}` - (default: `true`) When html5Mode is enabled, specifies
+   *     whether or not a <base> tag is required to be present. If `enabled` and `requireBase` are
+   *     true, and a base tag is not present, an error will be thrown when `$location` is injected.
+   *     See the {@link guide/$location $location guide for more information}
+   *   - **rewriteLinks** - `{boolean}` - (default: `true`) When html5Mode is enabled,
+   *     enables/disables url rewriting for relative links.
+   *
+   * @returns {Object} html5Mode object if used as getter or itself (chaining) if used as setter
+   */
+  this.html5Mode = function(mode) {
+    if (isBoolean(mode)) {
+      html5Mode.enabled = mode;
+      return this;
+    } else if (isObject(mode)) {
+
+      if (isBoolean(mode.enabled)) {
+        html5Mode.enabled = mode.enabled;
+      }
+
+      if (isBoolean(mode.requireBase)) {
+        html5Mode.requireBase = mode.requireBase;
+      }
+
+      if (isBoolean(mode.rewriteLinks)) {
+        html5Mode.rewriteLinks = mode.rewriteLinks;
+      }
+
+      return this;
+    } else {
+      return html5Mode;
+    }
+  };
+
+  /**
+   * @ngdoc event
+   * @name $location#$locationChangeStart
+   * @eventType broadcast on root scope
+   * @description
+   * Broadcasted before a URL will change.
+   *
+   * This change can be prevented by calling
+   * `preventDefault` method of the event. See {@link ng.$rootScope.Scope#$on} for more
+   * details about event object. Upon successful change
+   * {@link ng.$location#$locationChangeSuccess $locationChangeSuccess} is fired.
+   *
+   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
+   * the browser supports the HTML5 History API.
+   *
+   * @param {Object} angularEvent Synthetic event object.
+   * @param {string} newUrl New URL
+   * @param {string=} oldUrl URL that was before it was changed.
+   * @param {string=} newState New history state object
+   * @param {string=} oldState History state object that was before it was changed.
+   */
+
+  /**
+   * @ngdoc event
+   * @name $location#$locationChangeSuccess
+   * @eventType broadcast on root scope
+   * @description
+   * Broadcasted after a URL was changed.
+   *
+   * The `newState` and `oldState` parameters may be defined only in HTML5 mode and when
+   * the browser supports the HTML5 History API.
+   *
+   * @param {Object} angularEvent Synthetic event object.
+   * @param {string} newUrl New URL
+   * @param {string=} oldUrl URL that was before it was changed.
+   * @param {string=} newState New history state object
+   * @param {string=} oldState History state object that was before it was changed.
+   */
+
+  this.$get = ['$rootScope', '$browser', '$sniffer', '$rootElement', '$window',
+      function($rootScope, $browser, $sniffer, $rootElement, $window) {
+    var $location,
+        LocationMode,
+        baseHref = $browser.baseHref(), // if base[href] is undefined, it defaults to ''
+        initialUrl = $browser.url(),
+        appBase;
+
+    if (html5Mode.enabled) {
+      if (!baseHref && html5Mode.requireBase) {
+        throw $locationMinErr('nobase',
+          "$location in HTML5 mode requires a <base> tag to be present!");
+      }
+      appBase = serverBase(initialUrl) + (baseHref || '/');
+      LocationMode = $sniffer.history ? LocationHtml5Url : LocationHashbangInHtml5Url;
+    } else {
+      appBase = stripHash(initialUrl);
+      LocationMode = LocationHashbangUrl;
+    }
+    var appBaseNoFile = stripFile(appBase);
+
+    $location = new LocationMode(appBase, appBaseNoFile, '#' + hashPrefix);
+    $location.$$parseLinkUrl(initialUrl, initialUrl);
+
+    $location.$$state = $browser.state();
+
+    var IGNORE_URI_REGEXP = /^\s*(javascript|mailto):/i;
+
+    function setBrowserUrlWithFallback(url, replace, state) {
+      var oldUrl = $location.url();
+      var oldState = $location.$$state;
+      try {
+        $browser.url(url, replace, state);
+
+        // Make sure $location.state() returns referentially identical (not just deeply equal)
+        // state object; this makes possible quick checking if the state changed in the digest
+        // loop. Checking deep equality would be too expensive.
+        $location.$$state = $browser.state();
+      } catch (e) {
+        // Restore old values if pushState fails
+        $location.url(oldUrl);
+        $location.$$state = oldState;
+
+        throw e;
+      }
+    }
+
+    $rootElement.on('click', function(event) {
+      // TODO(vojta): rewrite link when opening in new tab/window (in legacy browser)
+      // currently we open nice url link and redirect then
+
+      if (!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2) return;
+
+      var elm = jqLite(event.target);
+
+      // traverse the DOM up to find first A tag
+      while (nodeName_(elm[0]) !== 'a') {
+        // ignore rewriting if no A tag (reached root element, or no parent - removed from document)
+        if (elm[0] === $rootElement[0] || !(elm = elm.parent())[0]) return;
+      }
+
+      var absHref = elm.prop('href');
+      // get the actual href attribute - see
+      // http://msdn.microsoft.com/en-us/library/ie/dd347148(v=vs.85).aspx
+      var relHref = elm.attr('href') || elm.attr('xlink:href');
+
+      if (isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]') {
+        // SVGAnimatedString.animVal should be identical to SVGAnimatedString.baseVal, unless during
+        // an animation.
+        absHref = urlResolve(absHref.animVal).href;
+      }
+
+      // Ignore when url is started with javascript: or mailto:
+      if (IGNORE_URI_REGEXP.test(absHref)) return;
+
+      if (absHref && !elm.attr('target') && !event.isDefaultPrevented()) {
+        if ($location.$$parseLinkUrl(absHref, relHref)) {
+          // We do a preventDefault for all urls that are part of the angular application,
+          // in html5mode and also without, so that we are able to abort navigation without
+          // getting double entries in the location history.
+          event.preventDefault();
+          // update location manually
+          if ($location.absUrl() != $browser.url()) {
+            $rootScope.$apply();
+            // hack to work around FF6 bug 684208 when scenario runner clicks on links
+            $window.angular['ff-684208-preventDefault'] = true;
+          }
+        }
+      }
+    });
+
+
+    // rewrite hashbang url <> html5 url
+    if (trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)) {
+      $browser.url($location.absUrl(), true);
+    }
+
+    var initializing = true;
+
+    // update $location when $browser url changes
+    $browser.onUrlChange(function(newUrl, newState) {
+
+      if (isUndefined(beginsWith(appBaseNoFile, newUrl))) {
+        // If we are navigating outside of the app then force a reload
+        $window.location.href = newUrl;
+        return;
+      }
+
+      $rootScope.$evalAsync(function() {
+        var oldUrl = $location.absUrl();
+        var oldState = $location.$$state;
+        var defaultPrevented;
+
+        $location.$$parse(newUrl);
+        $location.$$state = newState;
+
+        defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
+            newState, oldState).defaultPrevented;
+
+        // if the location was changed by a `$locationChangeStart` handler then stop
+        // processing this location change
+        if ($location.absUrl() !== newUrl) return;
+
+        if (defaultPrevented) {
+          $location.$$parse(oldUrl);
+          $location.$$state = oldState;
+          setBrowserUrlWithFallback(oldUrl, false, oldState);
+        } else {
+          initializing = false;
+          afterLocationChange(oldUrl, oldState);
+        }
+      });
+      if (!$rootScope.$$phase) $rootScope.$digest();
+    });
+
+    // update browser
+    $rootScope.$watch(function $locationWatch() {
+      var oldUrl = trimEmptyHash($browser.url());
+      var newUrl = trimEmptyHash($location.absUrl());
+      var oldState = $browser.state();
+      var currentReplace = $location.$$replace;
+      var urlOrStateChanged = oldUrl !== newUrl ||
+        ($location.$$html5 && $sniffer.history && oldState !== $location.$$state);
+
+      if (initializing || urlOrStateChanged) {
+        initializing = false;
+
+        $rootScope.$evalAsync(function() {
+          var newUrl = $location.absUrl();
+          var defaultPrevented = $rootScope.$broadcast('$locationChangeStart', newUrl, oldUrl,
+              $location.$$state, oldState).defaultPrevented;
+
+          // if the location was changed by a `$locationChangeStart` handler then stop
+          // processing this location change
+          if ($location.absUrl() !== newUrl) return;
+
+          if (defaultPrevented) {
+            $location.$$parse(oldUrl);
+            $location.$$state = oldState;
+          } else {
+            if (urlOrStateChanged) {
+              setBrowserUrlWithFallback(newUrl, currentReplace,
+                                        oldState === $location.$$state ? null : $location.$$state);
+            }
+            afterLocationChange(oldUrl, oldState);
+          }
+        });
+      }
+
+      $location.$$replace = false;
+
+      // we don't need to return anything because $evalAsync will make the digest loop dirty when
+      // there is a change
+    });
+
+    return $location;
+
+    function afterLocationChange(oldUrl, oldState) {
+      $rootScope.$broadcast('$locationChangeSuccess', $location.absUrl(), oldUrl,
+        $location.$$state, oldState);
+    }
+}];
+}
+
+/**
+ * @ngdoc service
+ * @name $log
+ * @requires $window
+ *
+ * @description
+ * Simple service for logging. Default implementation safely writes the message
+ * into the browser's console (if present).
+ *
+ * The main purpose of this service is to simplify debugging and troubleshooting.
+ *
+ * The default is to log `debug` messages. You can use
+ * {@link ng.$logProvider ng.$logProvider#debugEnabled} to change this.
+ *
+ * @example
+   <example module="logExample">
+     <file name="script.js">
+       angular.module('logExample', [])
+         .controller('LogController', ['$scope', '$log', function($scope, $log) {
+           $scope.$log = $log;
+           $scope.message = 'Hello World!';
+         }]);
+     </file>
+     <file name="index.html">
+       <div ng-controller="LogController">
+         <p>Reload this page with open console, enter text and hit the log button...</p>
+         <label>Message:
+         <input type="text" ng-model="message" /></label>
+         <button ng-click="$log.log(message)">log</button>
+         <button ng-click="$log.warn(message)">warn</button>
+         <button ng-click="$log.info(message)">info</button>
+         <button ng-click="$log.error(message)">error</button>
+         <button ng-click="$log.debug(message)">debug</button>
+       </div>
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc provider
+ * @name $logProvider
+ * @description
+ * Use the `$logProvider` to configure how the application logs messages
+ */
+function $LogProvider() {
+  var debug = true,
+      self = this;
+
+  /**
+   * @ngdoc method
+   * @name $logProvider#debugEnabled
+   * @description
+   * @param {boolean=} flag enable or disable debug level messages
+   * @returns {*} current value if used as getter or itself (chaining) if used as setter
+   */
+  this.debugEnabled = function(flag) {
+    if (isDefined(flag)) {
+      debug = flag;
+    return this;
+    } else {
+      return debug;
+    }
+  };
+
+  this.$get = ['$window', function($window) {
+    return {
+      /**
+       * @ngdoc method
+       * @name $log#log
+       *
+       * @description
+       * Write a log message
+       */
+      log: consoleLog('log'),
+
+      /**
+       * @ngdoc method
+       * @name $log#info
+       *
+       * @description
+       * Write an information message
+       */
+      info: consoleLog('info'),
+
+      /**
+       * @ngdoc method
+       * @name $log#warn
+       *
+       * @description
+       * Write a warning message
+       */
+      warn: consoleLog('warn'),
+
+      /**
+       * @ngdoc method
+       * @name $log#error
+       *
+       * @description
+       * Write an error message
+       */
+      error: consoleLog('error'),
+
+      /**
+       * @ngdoc method
+       * @name $log#debug
+       *
+       * @description
+       * Write a debug message
+       */
+      debug: (function() {
+        var fn = consoleLog('debug');
+
+        return function() {
+          if (debug) {
+            fn.apply(self, arguments);
+          }
+        };
+      }())
+    };
+
+    function formatError(arg) {
+      if (arg instanceof Error) {
+        if (arg.stack) {
+          arg = (arg.message && arg.stack.indexOf(arg.message) === -1)
+              ? 'Error: ' + arg.message + '\n' + arg.stack
+              : arg.stack;
+        } else if (arg.sourceURL) {
+          arg = arg.message + '\n' + arg.sourceURL + ':' + arg.line;
+        }
+      }
+      return arg;
+    }
+
+    function consoleLog(type) {
+      var console = $window.console || {},
+          logFn = console[type] || console.log || noop,
+          hasApply = false;
+
+      // Note: reading logFn.apply throws an error in IE11 in IE8 document mode.
+      // The reason behind this is that console.log has type "object" in IE8...
+      try {
+        hasApply = !!logFn.apply;
+      } catch (e) {}
+
+      if (hasApply) {
+        return function() {
+          var args = [];
+          forEach(arguments, function(arg) {
+            args.push(formatError(arg));
+          });
+          return logFn.apply(console, args);
+        };
+      }
+
+      // we are IE which either doesn't have window.console => this is noop and we do nothing,
+      // or we are IE where console.log doesn't have apply so we log at least first 2 args
+      return function(arg1, arg2) {
+        logFn(arg1, arg2 == null ? '' : arg2);
+      };
+    }
+  }];
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *     Any commits to this file should be reviewed with security in mind.  *
+ *   Changes to this file can potentially create security vulnerabilities. *
+ *          An approval from 2 Core members with history of modifying      *
+ *                         this file is required.                          *
+ *                                                                         *
+ *  Does the change somehow allow for arbitrary javascript to be executed? *
+ *    Or allows for someone to change the prototype of built-in objects?   *
+ *     Or gives undesired access to variables likes document or window?    *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+var $parseMinErr = minErr('$parse');
+
+// Sandboxing Angular Expressions
+// ------------------------------
+// Angular expressions are generally considered safe because these expressions only have direct
+// access to `$scope` and locals. However, one can obtain the ability to execute arbitrary JS code by
+// obtaining a reference to native JS functions such as the Function constructor.
+//
+// As an example, consider the following Angular expression:
+//
+//   {}.toString.constructor('alert("evil JS code")')
+//
+// This sandboxing technique is not perfect and doesn't aim to be. The goal is to prevent exploits
+// against the expression language, but not to prevent exploits that were enabled by exposing
+// sensitive JavaScript or browser APIs on Scope. Exposing such objects on a Scope is never a good
+// practice and therefore we are not even trying to protect against interaction with an object
+// explicitly exposed in this way.
+//
+// In general, it is not possible to access a Window object from an angular expression unless a
+// window or some DOM object that has a reference to window is published onto a Scope.
+// Similarly we prevent invocations of function known to be dangerous, as well as assignments to
+// native objects.
+//
+// See https://docs.angularjs.org/guide/security
+
+
+function ensureSafeMemberName(name, fullExpression) {
+  if (name === "__defineGetter__" || name === "__defineSetter__"
+      || name === "__lookupGetter__" || name === "__lookupSetter__"
+      || name === "__proto__") {
+    throw $parseMinErr('isecfld',
+        'Attempting to access a disallowed field in Angular expressions! '
+        + 'Expression: {0}', fullExpression);
+  }
+  return name;
+}
+
+function getStringValue(name, fullExpression) {
+  // From the JavaScript docs:
+  // Property names must be strings. This means that non-string objects cannot be used
+  // as keys in an object. Any non-string object, including a number, is typecasted
+  // into a string via the toString method.
+  //
+  // So, to ensure that we are checking the same `name` that JavaScript would use,
+  // we cast it to a string, if possible.
+  // Doing `name + ''` can cause a repl error if the result to `toString` is not a string,
+  // this is, this will handle objects that misbehave.
+  name = name + '';
+  if (!isString(name)) {
+    throw $parseMinErr('iseccst',
+        'Cannot convert object to primitive value! '
+        + 'Expression: {0}', fullExpression);
+  }
+  return name;
+}
+
+function ensureSafeObject(obj, fullExpression) {
+  // nifty check if obj is Function that is fast and works across iframes and other contexts
+  if (obj) {
+    if (obj.constructor === obj) {
+      throw $parseMinErr('isecfn',
+          'Referencing Function in Angular expressions is disallowed! Expression: {0}',
+          fullExpression);
+    } else if (// isWindow(obj)
+        obj.window === obj) {
+      throw $parseMinErr('isecwindow',
+          'Referencing the Window in Angular expressions is disallowed! Expression: {0}',
+          fullExpression);
+    } else if (// isElement(obj)
+        obj.children && (obj.nodeName || (obj.prop && obj.attr && obj.find))) {
+      throw $parseMinErr('isecdom',
+          'Referencing DOM nodes in Angular expressions is disallowed! Expression: {0}',
+          fullExpression);
+    } else if (// block Object so that we can't get hold of dangerous Object.* methods
+        obj === Object) {
+      throw $parseMinErr('isecobj',
+          'Referencing Object in Angular expressions is disallowed! Expression: {0}',
+          fullExpression);
+    }
+  }
+  return obj;
+}
+
+var CALL = Function.prototype.call;
+var APPLY = Function.prototype.apply;
+var BIND = Function.prototype.bind;
+
+function ensureSafeFunction(obj, fullExpression) {
+  if (obj) {
+    if (obj.constructor === obj) {
+      throw $parseMinErr('isecfn',
+        'Referencing Function in Angular expressions is disallowed! Expression: {0}',
+        fullExpression);
+    } else if (obj === CALL || obj === APPLY || obj === BIND) {
+      throw $parseMinErr('isecff',
+        'Referencing call, apply or bind in Angular expressions is disallowed! Expression: {0}',
+        fullExpression);
+    }
+  }
+}
+
+function ensureSafeAssignContext(obj, fullExpression) {
+  if (obj) {
+    if (obj === (0).constructor || obj === (false).constructor || obj === ''.constructor ||
+        obj === {}.constructor || obj === [].constructor || obj === Function.constructor) {
+      throw $parseMinErr('isecaf',
+        'Assigning to a constructor is disallowed! Expression: {0}', fullExpression);
+    }
+  }
+}
+
+var OPERATORS = createMap();
+forEach('+ - * / % === !== == != < > <= >= && || ! = |'.split(' '), function(operator) { OPERATORS[operator] = true; });
+var ESCAPE = {"n":"\n", "f":"\f", "r":"\r", "t":"\t", "v":"\v", "'":"'", '"':'"'};
+
+
+/////////////////////////////////////////
+
+
+/**
+ * @constructor
+ */
+var Lexer = function(options) {
+  this.options = options;
+};
+
+Lexer.prototype = {
+  constructor: Lexer,
+
+  lex: function(text) {
+    this.text = text;
+    this.index = 0;
+    this.tokens = [];
+
+    while (this.index < this.text.length) {
+      var ch = this.text.charAt(this.index);
+      if (ch === '"' || ch === "'") {
+        this.readString(ch);
+      } else if (this.isNumber(ch) || ch === '.' && this.isNumber(this.peek())) {
+        this.readNumber();
+      } else if (this.isIdent(ch)) {
+        this.readIdent();
+      } else if (this.is(ch, '(){}[].,;:?')) {
+        this.tokens.push({index: this.index, text: ch});
+        this.index++;
+      } else if (this.isWhitespace(ch)) {
+        this.index++;
+      } else {
+        var ch2 = ch + this.peek();
+        var ch3 = ch2 + this.peek(2);
+        var op1 = OPERATORS[ch];
+        var op2 = OPERATORS[ch2];
+        var op3 = OPERATORS[ch3];
+        if (op1 || op2 || op3) {
+          var token = op3 ? ch3 : (op2 ? ch2 : ch);
+          this.tokens.push({index: this.index, text: token, operator: true});
+          this.index += token.length;
+        } else {
+          this.throwError('Unexpected next character ', this.index, this.index + 1);
+        }
+      }
+    }
+    return this.tokens;
+  },
+
+  is: function(ch, chars) {
+    return chars.indexOf(ch) !== -1;
+  },
+
+  peek: function(i) {
+    var num = i || 1;
+    return (this.index + num < this.text.length) ? this.text.charAt(this.index + num) : false;
+  },
+
+  isNumber: function(ch) {
+    return ('0' <= ch && ch <= '9') && typeof ch === "string";
+  },
+
+  isWhitespace: function(ch) {
+    // IE treats non-breaking space as \u00A0
+    return (ch === ' ' || ch === '\r' || ch === '\t' ||
+            ch === '\n' || ch === '\v' || ch === '\u00A0');
+  },
+
+  isIdent: function(ch) {
+    return ('a' <= ch && ch <= 'z' ||
+            'A' <= ch && ch <= 'Z' ||
+            '_' === ch || ch === '$');
+  },
+
+  isExpOperator: function(ch) {
+    return (ch === '-' || ch === '+' || this.isNumber(ch));
+  },
+
+  throwError: function(error, start, end) {
+    end = end || this.index;
+    var colStr = (isDefined(start)
+            ? 's ' + start +  '-' + this.index + ' [' + this.text.substring(start, end) + ']'
+            : ' ' + end);
+    throw $parseMinErr('lexerr', 'Lexer Error: {0} at column{1} in expression [{2}].',
+        error, colStr, this.text);
+  },
+
+  readNumber: function() {
+    var number = '';
+    var start = this.index;
+    while (this.index < this.text.length) {
+      var ch = lowercase(this.text.charAt(this.index));
+      if (ch == '.' || this.isNumber(ch)) {
+        number += ch;
+      } else {
+        var peekCh = this.peek();
+        if (ch == 'e' && this.isExpOperator(peekCh)) {
+          number += ch;
+        } else if (this.isExpOperator(ch) &&
+            peekCh && this.isNumber(peekCh) &&
+            number.charAt(number.length - 1) == 'e') {
+          number += ch;
+        } else if (this.isExpOperator(ch) &&
+            (!peekCh || !this.isNumber(peekCh)) &&
+            number.charAt(number.length - 1) == 'e') {
+          this.throwError('Invalid exponent');
+        } else {
+          break;
+        }
+      }
+      this.index++;
+    }
+    this.tokens.push({
+      index: start,
+      text: number,
+      constant: true,
+      value: Number(number)
+    });
+  },
+
+  readIdent: function() {
+    var start = this.index;
+    while (this.index < this.text.length) {
+      var ch = this.text.charAt(this.index);
+      if (!(this.isIdent(ch) || this.isNumber(ch))) {
+        break;
+      }
+      this.index++;
+    }
+    this.tokens.push({
+      index: start,
+      text: this.text.slice(start, this.index),
+      identifier: true
+    });
+  },
+
+  readString: function(quote) {
+    var start = this.index;
+    this.index++;
+    var string = '';
+    var rawString = quote;
+    var escape = false;
+    while (this.index < this.text.length) {
+      var ch = this.text.charAt(this.index);
+      rawString += ch;
+      if (escape) {
+        if (ch === 'u') {
+          var hex = this.text.substring(this.index + 1, this.index + 5);
+          if (!hex.match(/[\da-f]{4}/i)) {
+            this.throwError('Invalid unicode escape [\\u' + hex + ']');
+          }
+          this.index += 4;
+          string += String.fromCharCode(parseInt(hex, 16));
+        } else {
+          var rep = ESCAPE[ch];
+          string = string + (rep || ch);
+        }
+        escape = false;
+      } else if (ch === '\\') {
+        escape = true;
+      } else if (ch === quote) {
+        this.index++;
+        this.tokens.push({
+          index: start,
+          text: rawString,
+          constant: true,
+          value: string
+        });
+        return;
+      } else {
+        string += ch;
+      }
+      this.index++;
+    }
+    this.throwError('Unterminated quote', start);
+  }
+};
+
+var AST = function(lexer, options) {
+  this.lexer = lexer;
+  this.options = options;
+};
+
+AST.Program = 'Program';
+AST.ExpressionStatement = 'ExpressionStatement';
+AST.AssignmentExpression = 'AssignmentExpression';
+AST.ConditionalExpression = 'ConditionalExpression';
+AST.LogicalExpression = 'LogicalExpression';
+AST.BinaryExpression = 'BinaryExpression';
+AST.UnaryExpression = 'UnaryExpression';
+AST.CallExpression = 'CallExpression';
+AST.MemberExpression = 'MemberExpression';
+AST.Identifier = 'Identifier';
+AST.Literal = 'Literal';
+AST.ArrayExpression = 'ArrayExpression';
+AST.Property = 'Property';
+AST.ObjectExpression = 'ObjectExpression';
+AST.ThisExpression = 'ThisExpression';
+
+// Internal use only
+AST.NGValueParameter = 'NGValueParameter';
+
+AST.prototype = {
+  ast: function(text) {
+    this.text = text;
+    this.tokens = this.lexer.lex(text);
+
+    var value = this.program();
+
+    if (this.tokens.length !== 0) {
+      this.throwError('is an unexpected token', this.tokens[0]);
+    }
+
+    return value;
+  },
+
+  program: function() {
+    var body = [];
+    while (true) {
+      if (this.tokens.length > 0 && !this.peek('}', ')', ';', ']'))
+        body.push(this.expressionStatement());
+      if (!this.expect(';')) {
+        return { type: AST.Program, body: body};
+      }
+    }
+  },
+
+  expressionStatement: function() {
+    return { type: AST.ExpressionStatement, expression: this.filterChain() };
+  },
+
+  filterChain: function() {
+    var left = this.expression();
+    var token;
+    while ((token = this.expect('|'))) {
+      left = this.filter(left);
+    }
+    return left;
+  },
+
+  expression: function() {
+    return this.assignment();
+  },
+
+  assignment: function() {
+    var result = this.ternary();
+    if (this.expect('=')) {
+      result = { type: AST.AssignmentExpression, left: result, right: this.assignment(), operator: '='};
+    }
+    return result;
+  },
+
+  ternary: function() {
+    var test = this.logicalOR();
+    var alternate;
+    var consequent;
+    if (this.expect('?')) {
+      alternate = this.expression();
+      if (this.consume(':')) {
+        consequent = this.expression();
+        return { type: AST.ConditionalExpression, test: test, alternate: alternate, consequent: consequent};
+      }
+    }
+    return test;
+  },
+
+  logicalOR: function() {
+    var left = this.logicalAND();
+    while (this.expect('||')) {
+      left = { type: AST.LogicalExpression, operator: '||', left: left, right: this.logicalAND() };
+    }
+    return left;
+  },
+
+  logicalAND: function() {
+    var left = this.equality();
+    while (this.expect('&&')) {
+      left = { type: AST.LogicalExpression, operator: '&&', left: left, right: this.equality()};
+    }
+    return left;
+  },
+
+  equality: function() {
+    var left = this.relational();
+    var token;
+    while ((token = this.expect('==','!=','===','!=='))) {
+      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.relational() };
+    }
+    return left;
+  },
+
+  relational: function() {
+    var left = this.additive();
+    var token;
+    while ((token = this.expect('<', '>', '<=', '>='))) {
+      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.additive() };
+    }
+    return left;
+  },
+
+  additive: function() {
+    var left = this.multiplicative();
+    var token;
+    while ((token = this.expect('+','-'))) {
+      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.multiplicative() };
+    }
+    return left;
+  },
+
+  multiplicative: function() {
+    var left = this.unary();
+    var token;
+    while ((token = this.expect('*','/','%'))) {
+      left = { type: AST.BinaryExpression, operator: token.text, left: left, right: this.unary() };
+    }
+    return left;
+  },
+
+  unary: function() {
+    var token;
+    if ((token = this.expect('+', '-', '!'))) {
+      return { type: AST.UnaryExpression, operator: token.text, prefix: true, argument: this.unary() };
+    } else {
+      return this.primary();
+    }
+  },
+
+  primary: function() {
+    var primary;
+    if (this.expect('(')) {
+      primary = this.filterChain();
+      this.consume(')');
+    } else if (this.expect('[')) {
+      primary = this.arrayDeclaration();
+    } else if (this.expect('{')) {
+      primary = this.object();
+    } else if (this.constants.hasOwnProperty(this.peek().text)) {
+      primary = copy(this.constants[this.consume().text]);
+    } else if (this.peek().identifier) {
+      primary = this.identifier();
+    } else if (this.peek().constant) {
+      primary = this.constant();
+    } else {
+      this.throwError('not a primary expression', this.peek());
+    }
+
+    var next;
+    while ((next = this.expect('(', '[', '.'))) {
+      if (next.text === '(') {
+        primary = {type: AST.CallExpression, callee: primary, arguments: this.parseArguments() };
+        this.consume(')');
+      } else if (next.text === '[') {
+        primary = { type: AST.MemberExpression, object: primary, property: this.expression(), computed: true };
+        this.consume(']');
+      } else if (next.text === '.') {
+        primary = { type: AST.MemberExpression, object: primary, property: this.identifier(), computed: false };
+      } else {
+        this.throwError('IMPOSSIBLE');
+      }
+    }
+    return primary;
+  },
+
+  filter: function(baseExpression) {
+    var args = [baseExpression];
+    var result = {type: AST.CallExpression, callee: this.identifier(), arguments: args, filter: true};
+
+    while (this.expect(':')) {
+      args.push(this.expression());
+    }
+
+    return result;
+  },
+
+  parseArguments: function() {
+    var args = [];
+    if (this.peekToken().text !== ')') {
+      do {
+        args.push(this.expression());
+      } while (this.expect(','));
+    }
+    return args;
+  },
+
+  identifier: function() {
+    var token = this.consume();
+    if (!token.identifier) {
+      this.throwError('is not a valid identifier', token);
+    }
+    return { type: AST.Identifier, name: token.text };
+  },
+
+  constant: function() {
+    // TODO check that it is a constant
+    return { type: AST.Literal, value: this.consume().value };
+  },
+
+  arrayDeclaration: function() {
+    var elements = [];
+    if (this.peekToken().text !== ']') {
+      do {
+        if (this.peek(']')) {
+          // Support trailing commas per ES5.1.
+          break;
+        }
+        elements.push(this.expression());
+      } while (this.expect(','));
+    }
+    this.consume(']');
+
+    return { type: AST.ArrayExpression, elements: elements };
+  },
+
+  object: function() {
+    var properties = [], property;
+    if (this.peekToken().text !== '}') {
+      do {
+        if (this.peek('}')) {
+          // Support trailing commas per ES5.1.
+          break;
+        }
+        property = {type: AST.Property, kind: 'init'};
+        if (this.peek().constant) {
+          property.key = this.constant();
+        } else if (this.peek().identifier) {
+          property.key = this.identifier();
+        } else {
+          this.throwError("invalid key", this.peek());
+        }
+        this.consume(':');
+        property.value = this.expression();
+        properties.push(property);
+      } while (this.expect(','));
+    }
+    this.consume('}');
+
+    return {type: AST.ObjectExpression, properties: properties };
+  },
+
+  throwError: function(msg, token) {
+    throw $parseMinErr('syntax',
+        'Syntax Error: Token \'{0}\' {1} at column {2} of the expression [{3}] starting at [{4}].',
+          token.text, msg, (token.index + 1), this.text, this.text.substring(token.index));
+  },
+
+  consume: function(e1) {
+    if (this.tokens.length === 0) {
+      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
+    }
+
+    var token = this.expect(e1);
+    if (!token) {
+      this.throwError('is unexpected, expecting [' + e1 + ']', this.peek());
+    }
+    return token;
+  },
+
+  peekToken: function() {
+    if (this.tokens.length === 0) {
+      throw $parseMinErr('ueoe', 'Unexpected end of expression: {0}', this.text);
+    }
+    return this.tokens[0];
+  },
+
+  peek: function(e1, e2, e3, e4) {
+    return this.peekAhead(0, e1, e2, e3, e4);
+  },
+
+  peekAhead: function(i, e1, e2, e3, e4) {
+    if (this.tokens.length > i) {
+      var token = this.tokens[i];
+      var t = token.text;
+      if (t === e1 || t === e2 || t === e3 || t === e4 ||
+          (!e1 && !e2 && !e3 && !e4)) {
+        return token;
+      }
+    }
+    return false;
+  },
+
+  expect: function(e1, e2, e3, e4) {
+    var token = this.peek(e1, e2, e3, e4);
+    if (token) {
+      this.tokens.shift();
+      return token;
+    }
+    return false;
+  },
+
+
+  /* `undefined` is not a constant, it is an identifier,
+   * but using it as an identifier is not supported
+   */
+  constants: {
+    'true': { type: AST.Literal, value: true },
+    'false': { type: AST.Literal, value: false },
+    'null': { type: AST.Literal, value: null },
+    'undefined': {type: AST.Literal, value: undefined },
+    'this': {type: AST.ThisExpression }
+  }
+};
+
+function ifDefined(v, d) {
+  return typeof v !== 'undefined' ? v : d;
+}
+
+function plusFn(l, r) {
+  if (typeof l === 'undefined') return r;
+  if (typeof r === 'undefined') return l;
+  return l + r;
+}
+
+function isStateless($filter, filterName) {
+  var fn = $filter(filterName);
+  return !fn.$stateful;
+}
+
+function findConstantAndWatchExpressions(ast, $filter) {
+  var allConstants;
+  var argsToWatch;
+  switch (ast.type) {
+  case AST.Program:
+    allConstants = true;
+    forEach(ast.body, function(expr) {
+      findConstantAndWatchExpressions(expr.expression, $filter);
+      allConstants = allConstants && expr.expression.constant;
+    });
+    ast.constant = allConstants;
+    break;
+  case AST.Literal:
+    ast.constant = true;
+    ast.toWatch = [];
+    break;
+  case AST.UnaryExpression:
+    findConstantAndWatchExpressions(ast.argument, $filter);
+    ast.constant = ast.argument.constant;
+    ast.toWatch = ast.argument.toWatch;
+    break;
+  case AST.BinaryExpression:
+    findConstantAndWatchExpressions(ast.left, $filter);
+    findConstantAndWatchExpressions(ast.right, $filter);
+    ast.constant = ast.left.constant && ast.right.constant;
+    ast.toWatch = ast.left.toWatch.concat(ast.right.toWatch);
+    break;
+  case AST.LogicalExpression:
+    findConstantAndWatchExpressions(ast.left, $filter);
+    findConstantAndWatchExpressions(ast.right, $filter);
+    ast.constant = ast.left.constant && ast.right.constant;
+    ast.toWatch = ast.constant ? [] : [ast];
+    break;
+  case AST.ConditionalExpression:
+    findConstantAndWatchExpressions(ast.test, $filter);
+    findConstantAndWatchExpressions(ast.alternate, $filter);
+    findConstantAndWatchExpressions(ast.consequent, $filter);
+    ast.constant = ast.test.constant && ast.alternate.constant && ast.consequent.constant;
+    ast.toWatch = ast.constant ? [] : [ast];
+    break;
+  case AST.Identifier:
+    ast.constant = false;
+    ast.toWatch = [ast];
+    break;
+  case AST.MemberExpression:
+    findConstantAndWatchExpressions(ast.object, $filter);
+    if (ast.computed) {
+      findConstantAndWatchExpressions(ast.property, $filter);
+    }
+    ast.constant = ast.object.constant && (!ast.computed || ast.property.constant);
+    ast.toWatch = [ast];
+    break;
+  case AST.CallExpression:
+    allConstants = ast.filter ? isStateless($filter, ast.callee.name) : false;
+    argsToWatch = [];
+    forEach(ast.arguments, function(expr) {
+      findConstantAndWatchExpressions(expr, $filter);
+      allConstants = allConstants && expr.constant;
+      if (!expr.constant) {
+        argsToWatch.push.apply(argsToWatch, expr.toWatch);
+      }
+    });
+    ast.constant = allConstants;
+    ast.toWatch = ast.filter && isStateless($filter, ast.callee.name) ? argsToWatch : [ast];
+    break;
+  case AST.AssignmentExpression:
+    findConstantAndWatchExpressions(ast.left, $filter);
+    findConstantAndWatchExpressions(ast.right, $filter);
+    ast.constant = ast.left.constant && ast.right.constant;
+    ast.toWatch = [ast];
+    break;
+  case AST.ArrayExpression:
+    allConstants = true;
+    argsToWatch = [];
+    forEach(ast.elements, function(expr) {
+      findConstantAndWatchExpressions(expr, $filter);
+      allConstants = allConstants && expr.constant;
+      if (!expr.constant) {
+        argsToWatch.push.apply(argsToWatch, expr.toWatch);
+      }
+    });
+    ast.constant = allConstants;
+    ast.toWatch = argsToWatch;
+    break;
+  case AST.ObjectExpression:
+    allConstants = true;
+    argsToWatch = [];
+    forEach(ast.properties, function(property) {
+      findConstantAndWatchExpressions(property.value, $filter);
+      allConstants = allConstants && property.value.constant;
+      if (!property.value.constant) {
+        argsToWatch.push.apply(argsToWatch, property.value.toWatch);
+      }
+    });
+    ast.constant = allConstants;
+    ast.toWatch = argsToWatch;
+    break;
+  case AST.ThisExpression:
+    ast.constant = false;
+    ast.toWatch = [];
+    break;
+  }
+}
+
+function getInputs(body) {
+  if (body.length != 1) return;
+  var lastExpression = body[0].expression;
+  var candidate = lastExpression.toWatch;
+  if (candidate.length !== 1) return candidate;
+  return candidate[0] !== lastExpression ? candidate : undefined;
+}
+
+function isAssignable(ast) {
+  return ast.type === AST.Identifier || ast.type === AST.MemberExpression;
+}
+
+function assignableAST(ast) {
+  if (ast.body.length === 1 && isAssignable(ast.body[0].expression)) {
+    return {type: AST.AssignmentExpression, left: ast.body[0].expression, right: {type: AST.NGValueParameter}, operator: '='};
+  }
+}
+
+function isLiteral(ast) {
+  return ast.body.length === 0 ||
+      ast.body.length === 1 && (
+      ast.body[0].expression.type === AST.Literal ||
+      ast.body[0].expression.type === AST.ArrayExpression ||
+      ast.body[0].expression.type === AST.ObjectExpression);
+}
+
+function isConstant(ast) {
+  return ast.constant;
+}
+
+function ASTCompiler(astBuilder, $filter) {
+  this.astBuilder = astBuilder;
+  this.$filter = $filter;
+}
+
+ASTCompiler.prototype = {
+  compile: function(expression, expensiveChecks) {
+    var self = this;
+    var ast = this.astBuilder.ast(expression);
+    this.state = {
+      nextId: 0,
+      filters: {},
+      expensiveChecks: expensiveChecks,
+      fn: {vars: [], body: [], own: {}},
+      assign: {vars: [], body: [], own: {}},
+      inputs: []
+    };
+    findConstantAndWatchExpressions(ast, self.$filter);
+    var extra = '';
+    var assignable;
+    this.stage = 'assign';
+    if ((assignable = assignableAST(ast))) {
+      this.state.computing = 'assign';
+      var result = this.nextId();
+      this.recurse(assignable, result);
+      this.return_(result);
+      extra = 'fn.assign=' + this.generateFunction('assign', 's,v,l');
+    }
+    var toWatch = getInputs(ast.body);
+    self.stage = 'inputs';
+    forEach(toWatch, function(watch, key) {
+      var fnKey = 'fn' + key;
+      self.state[fnKey] = {vars: [], body: [], own: {}};
+      self.state.computing = fnKey;
+      var intoId = self.nextId();
+      self.recurse(watch, intoId);
+      self.return_(intoId);
+      self.state.inputs.push(fnKey);
+      watch.watchId = key;
+    });
+    this.state.computing = 'fn';
+    this.stage = 'main';
+    this.recurse(ast);
+    var fnString =
+      // The build and minification steps remove the string "use strict" from the code, but this is done using a regex.
+      // This is a workaround for this until we do a better job at only removing the prefix only when we should.
+      '"' + this.USE + ' ' + this.STRICT + '";\n' +
+      this.filterPrefix() +
+      'var fn=' + this.generateFunction('fn', 's,l,a,i') +
+      extra +
+      this.watchFns() +
+      'return fn;';
+
+    /* jshint -W054 */
+    var fn = (new Function('$filter',
+        'ensureSafeMemberName',
+        'ensureSafeObject',
+        'ensureSafeFunction',
+        'getStringValue',
+        'ensureSafeAssignContext',
+        'ifDefined',
+        'plus',
+        'text',
+        fnString))(
+          this.$filter,
+          ensureSafeMemberName,
+          ensureSafeObject,
+          ensureSafeFunction,
+          getStringValue,
+          ensureSafeAssignContext,
+          ifDefined,
+          plusFn,
+          expression);
+    /* jshint +W054 */
+    this.state = this.stage = undefined;
+    fn.literal = isLiteral(ast);
+    fn.constant = isConstant(ast);
+    return fn;
+  },
+
+  USE: 'use',
+
+  STRICT: 'strict',
+
+  watchFns: function() {
+    var result = [];
+    var fns = this.state.inputs;
+    var self = this;
+    forEach(fns, function(name) {
+      result.push('var ' + name + '=' + self.generateFunction(name, 's'));
+    });
+    if (fns.length) {
+      result.push('fn.inputs=[' + fns.join(',') + '];');
+    }
+    return result.join('');
+  },
+
+  generateFunction: function(name, params) {
+    return 'function(' + params + '){' +
+        this.varsPrefix(name) +
+        this.body(name) +
+        '};';
+  },
+
+  filterPrefix: function() {
+    var parts = [];
+    var self = this;
+    forEach(this.state.filters, function(id, filter) {
+      parts.push(id + '=$filter(' + self.escape(filter) + ')');
+    });
+    if (parts.length) return 'var ' + parts.join(',') + ';';
+    return '';
+  },
+
+  varsPrefix: function(section) {
+    return this.state[section].vars.length ? 'var ' + this.state[section].vars.join(',') + ';' : '';
+  },
+
+  body: function(section) {
+    return this.state[section].body.join('');
+  },
+
+  recurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
+    var left, right, self = this, args, expression;
+    recursionFn = recursionFn || noop;
+    if (!skipWatchIdCheck && isDefined(ast.watchId)) {
+      intoId = intoId || this.nextId();
+      this.if_('i',
+        this.lazyAssign(intoId, this.computedMember('i', ast.watchId)),
+        this.lazyRecurse(ast, intoId, nameId, recursionFn, create, true)
+      );
+      return;
+    }
+    switch (ast.type) {
+    case AST.Program:
+      forEach(ast.body, function(expression, pos) {
+        self.recurse(expression.expression, undefined, undefined, function(expr) { right = expr; });
+        if (pos !== ast.body.length - 1) {
+          self.current().body.push(right, ';');
+        } else {
+          self.return_(right);
+        }
+      });
+      break;
+    case AST.Literal:
+      expression = this.escape(ast.value);
+      this.assign(intoId, expression);
+      recursionFn(expression);
+      break;
+    case AST.UnaryExpression:
+      this.recurse(ast.argument, undefined, undefined, function(expr) { right = expr; });
+      expression = ast.operator + '(' + this.ifDefined(right, 0) + ')';
+      this.assign(intoId, expression);
+      recursionFn(expression);
+      break;
+    case AST.BinaryExpression:
+      this.recurse(ast.left, undefined, undefined, function(expr) { left = expr; });
+      this.recurse(ast.right, undefined, undefined, function(expr) { right = expr; });
+      if (ast.operator === '+') {
+        expression = this.plus(left, right);
+      } else if (ast.operator === '-') {
+        expression = this.ifDefined(left, 0) + ast.operator + this.ifDefined(right, 0);
+      } else {
+        expression = '(' + left + ')' + ast.operator + '(' + right + ')';
+      }
+      this.assign(intoId, expression);
+      recursionFn(expression);
+      break;
+    case AST.LogicalExpression:
+      intoId = intoId || this.nextId();
+      self.recurse(ast.left, intoId);
+      self.if_(ast.operator === '&&' ? intoId : self.not(intoId), self.lazyRecurse(ast.right, intoId));
+      recursionFn(intoId);
+      break;
+    case AST.ConditionalExpression:
+      intoId = intoId || this.nextId();
+      self.recurse(ast.test, intoId);
+      self.if_(intoId, self.lazyRecurse(ast.alternate, intoId), self.lazyRecurse(ast.consequent, intoId));
+      recursionFn(intoId);
+      break;
+    case AST.Identifier:
+      intoId = intoId || this.nextId();
+      if (nameId) {
+        nameId.context = self.stage === 'inputs' ? 's' : this.assign(this.nextId(), this.getHasOwnProperty('l', ast.name) + '?l:s');
+        nameId.computed = false;
+        nameId.name = ast.name;
+      }
+      ensureSafeMemberName(ast.name);
+      self.if_(self.stage === 'inputs' || self.not(self.getHasOwnProperty('l', ast.name)),
+        function() {
+          self.if_(self.stage === 'inputs' || 's', function() {
+            if (create && create !== 1) {
+              self.if_(
+                self.not(self.nonComputedMember('s', ast.name)),
+                self.lazyAssign(self.nonComputedMember('s', ast.name), '{}'));
+            }
+            self.assign(intoId, self.nonComputedMember('s', ast.name));
+          });
+        }, intoId && self.lazyAssign(intoId, self.nonComputedMember('l', ast.name))
+        );
+      if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.name)) {
+        self.addEnsureSafeObject(intoId);
+      }
+      recursionFn(intoId);
+      break;
+    case AST.MemberExpression:
+      left = nameId && (nameId.context = this.nextId()) || this.nextId();
+      intoId = intoId || this.nextId();
+      self.recurse(ast.object, left, undefined, function() {
+        self.if_(self.notNull(left), function() {
+          if (ast.computed) {
+            right = self.nextId();
+            self.recurse(ast.property, right);
+            self.getStringValue(right);
+            self.addEnsureSafeMemberName(right);
+            if (create && create !== 1) {
+              self.if_(self.not(self.computedMember(left, right)), self.lazyAssign(self.computedMember(left, right), '{}'));
+            }
+            expression = self.ensureSafeObject(self.computedMember(left, right));
+            self.assign(intoId, expression);
+            if (nameId) {
+              nameId.computed = true;
+              nameId.name = right;
+            }
+          } else {
+            ensureSafeMemberName(ast.property.name);
+            if (create && create !== 1) {
+              self.if_(self.not(self.nonComputedMember(left, ast.property.name)), self.lazyAssign(self.nonComputedMember(left, ast.property.name), '{}'));
+            }
+            expression = self.nonComputedMember(left, ast.property.name);
+            if (self.state.expensiveChecks || isPossiblyDangerousMemberName(ast.property.name)) {
+              expression = self.ensureSafeObject(expression);
+            }
+            self.assign(intoId, expression);
+            if (nameId) {
+              nameId.computed = false;
+              nameId.name = ast.property.name;
+            }
+          }
+        }, function() {
+          self.assign(intoId, 'undefined');
+        });
+        recursionFn(intoId);
+      }, !!create);
+      break;
+    case AST.CallExpression:
+      intoId = intoId || this.nextId();
+      if (ast.filter) {
+        right = self.filter(ast.callee.name);
+        args = [];
+        forEach(ast.arguments, function(expr) {
+          var argument = self.nextId();
+          self.recurse(expr, argument);
+          args.push(argument);
+        });
+        expression = right + '(' + args.join(',') + ')';
+        self.assign(intoId, expression);
+        recursionFn(intoId);
+      } else {
+        right = self.nextId();
+        left = {};
+        args = [];
+        self.recurse(ast.callee, right, left, function() {
+          self.if_(self.notNull(right), function() {
+            self.addEnsureSafeFunction(right);
+            forEach(ast.arguments, function(expr) {
+              self.recurse(expr, self.nextId(), undefined, function(argument) {
+                args.push(self.ensureSafeObject(argument));
+              });
+            });
+            if (left.name) {
+              if (!self.state.expensiveChecks) {
+                self.addEnsureSafeObject(left.context);
+              }
+              expression = self.member(left.context, left.name, left.computed) + '(' + args.join(',') + ')';
+            } else {
+              expression = right + '(' + args.join(',') + ')';
+            }
+            expression = self.ensureSafeObject(expression);
+            self.assign(intoId, expression);
+          }, function() {
+            self.assign(intoId, 'undefined');
+          });
+          recursionFn(intoId);
+        });
+      }
+      break;
+    case AST.AssignmentExpression:
+      right = this.nextId();
+      left = {};
+      if (!isAssignable(ast.left)) {
+        throw $parseMinErr('lval', 'Trying to assing a value to a non l-value');
+      }
+      this.recurse(ast.left, undefined, left, function() {
+        self.if_(self.notNull(left.context), function() {
+          self.recurse(ast.right, right);
+          self.addEnsureSafeObject(self.member(left.context, left.name, left.computed));
+          self.addEnsureSafeAssignContext(left.context);
+          expression = self.member(left.context, left.name, left.computed) + ast.operator + right;
+          self.assign(intoId, expression);
+          recursionFn(intoId || expression);
+        });
+      }, 1);
+      break;
+    case AST.ArrayExpression:
+      args = [];
+      forEach(ast.elements, function(expr) {
+        self.recurse(expr, self.nextId(), undefined, function(argument) {
+          args.push(argument);
+        });
+      });
+      expression = '[' + args.join(',') + ']';
+      this.assign(intoId, expression);
+      recursionFn(expression);
+      break;
+    case AST.ObjectExpression:
+      args = [];
+      forEach(ast.properties, function(property) {
+        self.recurse(property.value, self.nextId(), undefined, function(expr) {
+          args.push(self.escape(
+              property.key.type === AST.Identifier ? property.key.name :
+                ('' + property.key.value)) +
+              ':' + expr);
+        });
+      });
+      expression = '{' + args.join(',') + '}';
+      this.assign(intoId, expression);
+      recursionFn(expression);
+      break;
+    case AST.ThisExpression:
+      this.assign(intoId, 's');
+      recursionFn('s');
+      break;
+    case AST.NGValueParameter:
+      this.assign(intoId, 'v');
+      recursionFn('v');
+      break;
+    }
+  },
+
+  getHasOwnProperty: function(element, property) {
+    var key = element + '.' + property;
+    var own = this.current().own;
+    if (!own.hasOwnProperty(key)) {
+      own[key] = this.nextId(false, element + '&&(' + this.escape(property) + ' in ' + element + ')');
+    }
+    return own[key];
+  },
+
+  assign: function(id, value) {
+    if (!id) return;
+    this.current().body.push(id, '=', value, ';');
+    return id;
+  },
+
+  filter: function(filterName) {
+    if (!this.state.filters.hasOwnProperty(filterName)) {
+      this.state.filters[filterName] = this.nextId(true);
+    }
+    return this.state.filters[filterName];
+  },
+
+  ifDefined: function(id, defaultValue) {
+    return 'ifDefined(' + id + ',' + this.escape(defaultValue) + ')';
+  },
+
+  plus: function(left, right) {
+    return 'plus(' + left + ',' + right + ')';
+  },
+
+  return_: function(id) {
+    this.current().body.push('return ', id, ';');
+  },
+
+  if_: function(test, alternate, consequent) {
+    if (test === true) {
+      alternate();
+    } else {
+      var body = this.current().body;
+      body.push('if(', test, '){');
+      alternate();
+      body.push('}');
+      if (consequent) {
+        body.push('else{');
+        consequent();
+        body.push('}');
+      }
+    }
+  },
+
+  not: function(expression) {
+    return '!(' + expression + ')';
+  },
+
+  notNull: function(expression) {
+    return expression + '!=null';
+  },
+
+  nonComputedMember: function(left, right) {
+    return left + '.' + right;
+  },
+
+  computedMember: function(left, right) {
+    return left + '[' + right + ']';
+  },
+
+  member: function(left, right, computed) {
+    if (computed) return this.computedMember(left, right);
+    return this.nonComputedMember(left, right);
+  },
+
+  addEnsureSafeObject: function(item) {
+    this.current().body.push(this.ensureSafeObject(item), ';');
+  },
+
+  addEnsureSafeMemberName: function(item) {
+    this.current().body.push(this.ensureSafeMemberName(item), ';');
+  },
+
+  addEnsureSafeFunction: function(item) {
+    this.current().body.push(this.ensureSafeFunction(item), ';');
+  },
+
+  addEnsureSafeAssignContext: function(item) {
+    this.current().body.push(this.ensureSafeAssignContext(item), ';');
+  },
+
+  ensureSafeObject: function(item) {
+    return 'ensureSafeObject(' + item + ',text)';
+  },
+
+  ensureSafeMemberName: function(item) {
+    return 'ensureSafeMemberName(' + item + ',text)';
+  },
+
+  ensureSafeFunction: function(item) {
+    return 'ensureSafeFunction(' + item + ',text)';
+  },
+
+  getStringValue: function(item) {
+    this.assign(item, 'getStringValue(' + item + ',text)');
+  },
+
+  ensureSafeAssignContext: function(item) {
+    return 'ensureSafeAssignContext(' + item + ',text)';
+  },
+
+  lazyRecurse: function(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck) {
+    var self = this;
+    return function() {
+      self.recurse(ast, intoId, nameId, recursionFn, create, skipWatchIdCheck);
+    };
+  },
+
+  lazyAssign: function(id, value) {
+    var self = this;
+    return function() {
+      self.assign(id, value);
+    };
+  },
+
+  stringEscapeRegex: /[^ a-zA-Z0-9]/g,
+
+  stringEscapeFn: function(c) {
+    return '\\u' + ('0000' + c.charCodeAt(0).toString(16)).slice(-4);
+  },
+
+  escape: function(value) {
+    if (isString(value)) return "'" + value.replace(this.stringEscapeRegex, this.stringEscapeFn) + "'";
+    if (isNumber(value)) return value.toString();
+    if (value === true) return 'true';
+    if (value === false) return 'false';
+    if (value === null) return 'null';
+    if (typeof value === 'undefined') return 'undefined';
+
+    throw $parseMinErr('esc', 'IMPOSSIBLE');
+  },
+
+  nextId: function(skip, init) {
+    var id = 'v' + (this.state.nextId++);
+    if (!skip) {
+      this.current().vars.push(id + (init ? '=' + init : ''));
+    }
+    return id;
+  },
+
+  current: function() {
+    return this.state[this.state.computing];
+  }
+};
+
+
+function ASTInterpreter(astBuilder, $filter) {
+  this.astBuilder = astBuilder;
+  this.$filter = $filter;
+}
+
+ASTInterpreter.prototype = {
+  compile: function(expression, expensiveChecks) {
+    var self = this;
+    var ast = this.astBuilder.ast(expression);
+    this.expression = expression;
+    this.expensiveChecks = expensiveChecks;
+    findConstantAndWatchExpressions(ast, self.$filter);
+    var assignable;
+    var assign;
+    if ((assignable = assignableAST(ast))) {
+      assign = this.recurse(assignable);
+    }
+    var toWatch = getInputs(ast.body);
+    var inputs;
+    if (toWatch) {
+      inputs = [];
+      forEach(toWatch, function(watch, key) {
+        var input = self.recurse(watch);
+        watch.input = input;
+        inputs.push(input);
+        watch.watchId = key;
+      });
+    }
+    var expressions = [];
+    forEach(ast.body, function(expression) {
+      expressions.push(self.recurse(expression.expression));
+    });
+    var fn = ast.body.length === 0 ? function() {} :
+             ast.body.length === 1 ? expressions[0] :
+             function(scope, locals) {
+               var lastValue;
+               forEach(expressions, function(exp) {
+                 lastValue = exp(scope, locals);
+               });
+               return lastValue;
+             };
+    if (assign) {
+      fn.assign = function(scope, value, locals) {
+        return assign(scope, locals, value);
+      };
+    }
+    if (inputs) {
+      fn.inputs = inputs;
+    }
+    fn.literal = isLiteral(ast);
+    fn.constant = isConstant(ast);
+    return fn;
+  },
+
+  recurse: function(ast, context, create) {
+    var left, right, self = this, args, expression;
+    if (ast.input) {
+      return this.inputs(ast.input, ast.watchId);
+    }
+    switch (ast.type) {
+    case AST.Literal:
+      return this.value(ast.value, context);
+    case AST.UnaryExpression:
+      right = this.recurse(ast.argument);
+      return this['unary' + ast.operator](right, context);
+    case AST.BinaryExpression:
+      left = this.recurse(ast.left);
+      right = this.recurse(ast.right);
+      return this['binary' + ast.operator](left, right, context);
+    case AST.LogicalExpression:
+      left = this.recurse(ast.left);
+      right = this.recurse(ast.right);
+      return this['binary' + ast.operator](left, right, context);
+    case AST.ConditionalExpression:
+      return this['ternary?:'](
+        this.recurse(ast.test),
+        this.recurse(ast.alternate),
+        this.recurse(ast.consequent),
+        context
+      );
+    case AST.Identifier:
+      ensureSafeMemberName(ast.name, self.expression);
+      return self.identifier(ast.name,
+                             self.expensiveChecks || isPossiblyDangerousMemberName(ast.name),
+                             context, create, self.expression);
+    case AST.MemberExpression:
+      left = this.recurse(ast.object, false, !!create);
+      if (!ast.computed) {
+        ensureSafeMemberName(ast.property.name, self.expression);
+        right = ast.property.name;
+      }
+      if (ast.computed) right = this.recurse(ast.property);
+      return ast.computed ?
+        this.computedMember(left, right, context, create, self.expression) :
+        this.nonComputedMember(left, right, self.expensiveChecks, context, create, self.expression);
+    case AST.CallExpression:
+      args = [];
+      forEach(ast.arguments, function(expr) {
+        args.push(self.recurse(expr));
+      });
+      if (ast.filter) right = this.$filter(ast.callee.name);
+      if (!ast.filter) right = this.recurse(ast.callee, true);
+      return ast.filter ?
+        function(scope, locals, assign, inputs) {
+          var values = [];
+          for (var i = 0; i < args.length; ++i) {
+            values.push(args[i](scope, locals, assign, inputs));
+          }
+          var value = right.apply(undefined, values, inputs);
+          return context ? {context: undefined, name: undefined, value: value} : value;
+        } :
+        function(scope, locals, assign, inputs) {
+          var rhs = right(scope, locals, assign, inputs);
+          var value;
+          if (rhs.value != null) {
+            ensureSafeObject(rhs.context, self.expression);
+            ensureSafeFunction(rhs.value, self.expression);
+            var values = [];
+            for (var i = 0; i < args.length; ++i) {
+              values.push(ensureSafeObject(args[i](scope, locals, assign, inputs), self.expression));
+            }
+            value = ensureSafeObject(rhs.value.apply(rhs.context, values), self.expression);
+          }
+          return context ? {value: value} : value;
+        };
+    case AST.AssignmentExpression:
+      left = this.recurse(ast.left, true, 1);
+      right = this.recurse(ast.right);
+      return function(scope, locals, assign, inputs) {
+        var lhs = left(scope, locals, assign, inputs);
+        var rhs = right(scope, locals, assign, inputs);
+        ensureSafeObject(lhs.value, self.expression);
+        ensureSafeAssignContext(lhs.context);
+        lhs.context[lhs.name] = rhs;
+        return context ? {value: rhs} : rhs;
+      };
+    case AST.ArrayExpression:
+      args = [];
+      forEach(ast.elements, function(expr) {
+        args.push(self.recurse(expr));
+      });
+      return function(scope, locals, assign, inputs) {
+        var value = [];
+        for (var i = 0; i < args.length; ++i) {
+          value.push(args[i](scope, locals, assign, inputs));
+        }
+        return context ? {value: value} : value;
+      };
+    case AST.ObjectExpression:
+      args = [];
+      forEach(ast.properties, function(property) {
+        args.push({key: property.key.type === AST.Identifier ?
+                        property.key.name :
+                        ('' + property.key.value),
+                   value: self.recurse(property.value)
+        });
+      });
+      return function(scope, locals, assign, inputs) {
+        var value = {};
+        for (var i = 0; i < args.length; ++i) {
+          value[args[i].key] = args[i].value(scope, locals, assign, inputs);
+        }
+        return context ? {value: value} : value;
+      };
+    case AST.ThisExpression:
+      return function(scope) {
+        return context ? {value: scope} : scope;
+      };
+    case AST.NGValueParameter:
+      return function(scope, locals, assign, inputs) {
+        return context ? {value: assign} : assign;
+      };
+    }
+  },
+
+  'unary+': function(argument, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = argument(scope, locals, assign, inputs);
+      if (isDefined(arg)) {
+        arg = +arg;
+      } else {
+        arg = 0;
+      }
+      return context ? {value: arg} : arg;
+    };
+  },
+  'unary-': function(argument, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = argument(scope, locals, assign, inputs);
+      if (isDefined(arg)) {
+        arg = -arg;
+      } else {
+        arg = 0;
+      }
+      return context ? {value: arg} : arg;
+    };
+  },
+  'unary!': function(argument, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = !argument(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary+': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var lhs = left(scope, locals, assign, inputs);
+      var rhs = right(scope, locals, assign, inputs);
+      var arg = plusFn(lhs, rhs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary-': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var lhs = left(scope, locals, assign, inputs);
+      var rhs = right(scope, locals, assign, inputs);
+      var arg = (isDefined(lhs) ? lhs : 0) - (isDefined(rhs) ? rhs : 0);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary*': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) * right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary/': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) / right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary%': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) % right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary===': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) === right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary!==': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) !== right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary==': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) == right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary!=': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) != right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary<': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) < right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary>': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) > right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary<=': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) <= right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary>=': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) >= right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary&&': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) && right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'binary||': function(left, right, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = left(scope, locals, assign, inputs) || right(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  'ternary?:': function(test, alternate, consequent, context) {
+    return function(scope, locals, assign, inputs) {
+      var arg = test(scope, locals, assign, inputs) ? alternate(scope, locals, assign, inputs) : consequent(scope, locals, assign, inputs);
+      return context ? {value: arg} : arg;
+    };
+  },
+  value: function(value, context) {
+    return function() { return context ? {context: undefined, name: undefined, value: value} : value; };
+  },
+  identifier: function(name, expensiveChecks, context, create, expression) {
+    return function(scope, locals, assign, inputs) {
+      var base = locals && (name in locals) ? locals : scope;
+      if (create && create !== 1 && base && !(base[name])) {
+        base[name] = {};
+      }
+      var value = base ? base[name] : undefined;
+      if (expensiveChecks) {
+        ensureSafeObject(value, expression);
+      }
+      if (context) {
+        return {context: base, name: name, value: value};
+      } else {
+        return value;
+      }
+    };
+  },
+  computedMember: function(left, right, context, create, expression) {
+    return function(scope, locals, assign, inputs) {
+      var lhs = left(scope, locals, assign, inputs);
+      var rhs;
+      var value;
+      if (lhs != null) {
+        rhs = right(scope, locals, assign, inputs);
+        rhs = getStringValue(rhs);
+        ensureSafeMemberName(rhs, expression);
+        if (create && create !== 1 && lhs && !(lhs[rhs])) {
+          lhs[rhs] = {};
+        }
+        value = lhs[rhs];
+        ensureSafeObject(value, expression);
+      }
+      if (context) {
+        return {context: lhs, name: rhs, value: value};
+      } else {
+        return value;
+      }
+    };
+  },
+  nonComputedMember: function(left, right, expensiveChecks, context, create, expression) {
+    return function(scope, locals, assign, inputs) {
+      var lhs = left(scope, locals, assign, inputs);
+      if (create && create !== 1 && lhs && !(lhs[right])) {
+        lhs[right] = {};
+      }
+      var value = lhs != null ? lhs[right] : undefined;
+      if (expensiveChecks || isPossiblyDangerousMemberName(right)) {
+        ensureSafeObject(value, expression);
+      }
+      if (context) {
+        return {context: lhs, name: right, value: value};
+      } else {
+        return value;
+      }
+    };
+  },
+  inputs: function(input, watchId) {
+    return function(scope, value, locals, inputs) {
+      if (inputs) return inputs[watchId];
+      return input(scope, value, locals);
+    };
+  }
+};
+
+/**
+ * @constructor
+ */
+var Parser = function(lexer, $filter, options) {
+  this.lexer = lexer;
+  this.$filter = $filter;
+  this.options = options;
+  this.ast = new AST(this.lexer);
+  this.astCompiler = options.csp ? new ASTInterpreter(this.ast, $filter) :
+                                   new ASTCompiler(this.ast, $filter);
+};
+
+Parser.prototype = {
+  constructor: Parser,
+
+  parse: function(text) {
+    return this.astCompiler.compile(text, this.options.expensiveChecks);
+  }
+};
+
+var getterFnCacheDefault = createMap();
+var getterFnCacheExpensive = createMap();
+
+function isPossiblyDangerousMemberName(name) {
+  return name == 'constructor';
+}
+
+var objectValueOf = Object.prototype.valueOf;
+
+function getValueOf(value) {
+  return isFunction(value.valueOf) ? value.valueOf() : objectValueOf.call(value);
+}
+
+///////////////////////////////////
+
+/**
+ * @ngdoc service
+ * @name $parse
+ * @kind function
+ *
+ * @description
+ *
+ * Converts Angular {@link guide/expression expression} into a function.
+ *
+ * ```js
+ *   var getter = $parse('user.name');
+ *   var setter = getter.assign;
+ *   var context = {user:{name:'angular'}};
+ *   var locals = {user:{name:'local'}};
+ *
+ *   expect(getter(context)).toEqual('angular');
+ *   setter(context, 'newValue');
+ *   expect(context.user.name).toEqual('newValue');
+ *   expect(getter(context, locals)).toEqual('local');
+ * ```
+ *
+ *
+ * @param {string} expression String expression to compile.
+ * @returns {function(context, locals)} a function which represents the compiled expression:
+ *
+ *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+ *      are evaluated against (typically a scope object).
+ *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+ *      `context`.
+ *
+ *    The returned function also has the following properties:
+ *      * `literal` – `{boolean}` – whether the expression's top-level node is a JavaScript
+ *        literal.
+ *      * `constant` – `{boolean}` – whether the expression is made entirely of JavaScript
+ *        constant literals.
+ *      * `assign` – `{?function(context, value)}` – if the expression is assignable, this will be
+ *        set to a function to change its value on the given context.
+ *
+ */
+
+
+/**
+ * @ngdoc provider
+ * @name $parseProvider
+ *
+ * @description
+ * `$parseProvider` can be used for configuring the default behavior of the {@link ng.$parse $parse}
+ *  service.
+ */
+function $ParseProvider() {
+  var cacheDefault = createMap();
+  var cacheExpensive = createMap();
+
+  this.$get = ['$filter', function($filter) {
+    var noUnsafeEval = csp().noUnsafeEval;
+    var $parseOptions = {
+          csp: noUnsafeEval,
+          expensiveChecks: false
+        },
+        $parseOptionsExpensive = {
+          csp: noUnsafeEval,
+          expensiveChecks: true
+        };
+
+    return function $parse(exp, interceptorFn, expensiveChecks) {
+      var parsedExpression, oneTime, cacheKey;
+
+      switch (typeof exp) {
+        case 'string':
+          exp = exp.trim();
+          cacheKey = exp;
+
+          var cache = (expensiveChecks ? cacheExpensive : cacheDefault);
+          parsedExpression = cache[cacheKey];
+
+          if (!parsedExpression) {
+            if (exp.charAt(0) === ':' && exp.charAt(1) === ':') {
+              oneTime = true;
+              exp = exp.substring(2);
+            }
+            var parseOptions = expensiveChecks ? $parseOptionsExpensive : $parseOptions;
+            var lexer = new Lexer(parseOptions);
+            var parser = new Parser(lexer, $filter, parseOptions);
+            parsedExpression = parser.parse(exp);
+            if (parsedExpression.constant) {
+              parsedExpression.$$watchDelegate = constantWatchDelegate;
+            } else if (oneTime) {
+              parsedExpression.$$watchDelegate = parsedExpression.literal ?
+                  oneTimeLiteralWatchDelegate : oneTimeWatchDelegate;
+            } else if (parsedExpression.inputs) {
+              parsedExpression.$$watchDelegate = inputsWatchDelegate;
+            }
+            cache[cacheKey] = parsedExpression;
+          }
+          return addInterceptor(parsedExpression, interceptorFn);
+
+        case 'function':
+          return addInterceptor(exp, interceptorFn);
+
+        default:
+          return noop;
+      }
+    };
+
+    function expressionInputDirtyCheck(newValue, oldValueOfValue) {
+
+      if (newValue == null || oldValueOfValue == null) { // null/undefined
+        return newValue === oldValueOfValue;
+      }
+
+      if (typeof newValue === 'object') {
+
+        // attempt to convert the value to a primitive type
+        // TODO(docs): add a note to docs that by implementing valueOf even objects and arrays can
+        //             be cheaply dirty-checked
+        newValue = getValueOf(newValue);
+
+        if (typeof newValue === 'object') {
+          // objects/arrays are not supported - deep-watching them would be too expensive
+          return false;
+        }
+
+        // fall-through to the primitive equality check
+      }
+
+      //Primitive or NaN
+      return newValue === oldValueOfValue || (newValue !== newValue && oldValueOfValue !== oldValueOfValue);
+    }
+
+    function inputsWatchDelegate(scope, listener, objectEquality, parsedExpression, prettyPrintExpression) {
+      var inputExpressions = parsedExpression.inputs;
+      var lastResult;
+
+      if (inputExpressions.length === 1) {
+        var oldInputValueOf = expressionInputDirtyCheck; // init to something unique so that equals check fails
+        inputExpressions = inputExpressions[0];
+        return scope.$watch(function expressionInputWatch(scope) {
+          var newInputValue = inputExpressions(scope);
+          if (!expressionInputDirtyCheck(newInputValue, oldInputValueOf)) {
+            lastResult = parsedExpression(scope, undefined, undefined, [newInputValue]);
+            oldInputValueOf = newInputValue && getValueOf(newInputValue);
+          }
+          return lastResult;
+        }, listener, objectEquality, prettyPrintExpression);
+      }
+
+      var oldInputValueOfValues = [];
+      var oldInputValues = [];
+      for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
+        oldInputValueOfValues[i] = expressionInputDirtyCheck; // init to something unique so that equals check fails
+        oldInputValues[i] = null;
+      }
+
+      return scope.$watch(function expressionInputsWatch(scope) {
+        var changed = false;
+
+        for (var i = 0, ii = inputExpressions.length; i < ii; i++) {
+          var newInputValue = inputExpressions[i](scope);
+          if (changed || (changed = !expressionInputDirtyCheck(newInputValue, oldInputValueOfValues[i]))) {
+            oldInputValues[i] = newInputValue;
+            oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);
+          }
+        }
+
+        if (changed) {
+          lastResult = parsedExpression(scope, undefined, undefined, oldInputValues);
+        }
+
+        return lastResult;
+      }, listener, objectEquality, prettyPrintExpression);
+    }
+
+    function oneTimeWatchDelegate(scope, listener, objectEquality, parsedExpression) {
+      var unwatch, lastValue;
+      return unwatch = scope.$watch(function oneTimeWatch(scope) {
+        return parsedExpression(scope);
+      }, function oneTimeListener(value, old, scope) {
+        lastValue = value;
+        if (isFunction(listener)) {
+          listener.apply(this, arguments);
+        }
+        if (isDefined(value)) {
+          scope.$$postDigest(function() {
+            if (isDefined(lastValue)) {
+              unwatch();
+            }
+          });
+        }
+      }, objectEquality);
+    }
+
+    function oneTimeLiteralWatchDelegate(scope, listener, objectEquality, parsedExpression) {
+      var unwatch, lastValue;
+      return unwatch = scope.$watch(function oneTimeWatch(scope) {
+        return parsedExpression(scope);
+      }, function oneTimeListener(value, old, scope) {
+        lastValue = value;
+        if (isFunction(listener)) {
+          listener.call(this, value, old, scope);
+        }
+        if (isAllDefined(value)) {
+          scope.$$postDigest(function() {
+            if (isAllDefined(lastValue)) unwatch();
+          });
+        }
+      }, objectEquality);
+
+      function isAllDefined(value) {
+        var allDefined = true;
+        forEach(value, function(val) {
+          if (!isDefined(val)) allDefined = false;
+        });
+        return allDefined;
+      }
+    }
+
+    function constantWatchDelegate(scope, listener, objectEquality, parsedExpression) {
+      var unwatch;
+      return unwatch = scope.$watch(function constantWatch(scope) {
+        return parsedExpression(scope);
+      }, function constantListener(value, old, scope) {
+        if (isFunction(listener)) {
+          listener.apply(this, arguments);
+        }
+        unwatch();
+      }, objectEquality);
+    }
+
+    function addInterceptor(parsedExpression, interceptorFn) {
+      if (!interceptorFn) return parsedExpression;
+      var watchDelegate = parsedExpression.$$watchDelegate;
+
+      var regularWatch =
+          watchDelegate !== oneTimeLiteralWatchDelegate &&
+          watchDelegate !== oneTimeWatchDelegate;
+
+      var fn = regularWatch ? function regularInterceptedExpression(scope, locals, assign, inputs) {
+        var value = parsedExpression(scope, locals, assign, inputs);
+        return interceptorFn(value, scope, locals);
+      } : function oneTimeInterceptedExpression(scope, locals, assign, inputs) {
+        var value = parsedExpression(scope, locals, assign, inputs);
+        var result = interceptorFn(value, scope, locals);
+        // we only return the interceptor's result if the
+        // initial value is defined (for bind-once)
+        return isDefined(value) ? result : value;
+      };
+
+      // Propagate $$watchDelegates other then inputsWatchDelegate
+      if (parsedExpression.$$watchDelegate &&
+          parsedExpression.$$watchDelegate !== inputsWatchDelegate) {
+        fn.$$watchDelegate = parsedExpression.$$watchDelegate;
+      } else if (!interceptorFn.$stateful) {
+        // If there is an interceptor, but no watchDelegate then treat the interceptor like
+        // we treat filters - it is assumed to be a pure function unless flagged with $stateful
+        fn.$$watchDelegate = inputsWatchDelegate;
+        fn.inputs = parsedExpression.inputs ? parsedExpression.inputs : [parsedExpression];
+      }
+
+      return fn;
+    }
+  }];
+}
+
+/**
+ * @ngdoc service
+ * @name $q
+ * @requires $rootScope
+ *
+ * @description
+ * A service that helps you run functions asynchronously, and use their return values (or exceptions)
+ * when they are done processing.
+ *
+ * This is an implementation of promises/deferred objects inspired by
+ * [Kris Kowal's Q](https://github.com/kriskowal/q).
+ *
+ * $q can be used in two fashions --- one which is more similar to Kris Kowal's Q or jQuery's Deferred
+ * implementations, and the other which resembles ES6 promises to some degree.
+ *
+ * # $q constructor
+ *
+ * The streamlined ES6 style promise is essentially just using $q as a constructor which takes a `resolver`
+ * function as the first argument. This is similar to the native Promise implementation from ES6 Harmony,
+ * see [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise).
+ *
+ * While the constructor-style use is supported, not all of the supporting methods from ES6 Harmony promises are
+ * available yet.
+ *
+ * It can be used like so:
+ *
+ * ```js
+ *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`
+ *   // are available in the current lexical scope (they could have been injected or passed in).
+ *
+ *   function asyncGreet(name) {
+ *     // perform some asynchronous operation, resolve or reject the promise when appropriate.
+ *     return $q(function(resolve, reject) {
+ *       setTimeout(function() {
+ *         if (okToGreet(name)) {
+ *           resolve('Hello, ' + name + '!');
+ *         } else {
+ *           reject('Greeting ' + name + ' is not allowed.');
+ *         }
+ *       }, 1000);
+ *     });
+ *   }
+ *
+ *   var promise = asyncGreet('Robin Hood');
+ *   promise.then(function(greeting) {
+ *     alert('Success: ' + greeting);
+ *   }, function(reason) {
+ *     alert('Failed: ' + reason);
+ *   });
+ * ```
+ *
+ * Note: progress/notify callbacks are not currently supported via the ES6-style interface.
+ *
+ * However, the more traditional CommonJS-style usage is still available, and documented below.
+ *
+ * [The CommonJS Promise proposal](http://wiki.commonjs.org/wiki/Promises) describes a promise as an
+ * interface for interacting with an object that represents the result of an action that is
+ * performed asynchronously, and may or may not be finished at any given point in time.
+ *
+ * From the perspective of dealing with error handling, deferred and promise APIs are to
+ * asynchronous programming what `try`, `catch` and `throw` keywords are to synchronous programming.
+ *
+ * ```js
+ *   // for the purpose of this example let's assume that variables `$q` and `okToGreet`
+ *   // are available in the current lexical scope (they could have been injected or passed in).
+ *
+ *   function asyncGreet(name) {
+ *     var deferred = $q.defer();
+ *
+ *     setTimeout(function() {
+ *       deferred.notify('About to greet ' + name + '.');
+ *
+ *       if (okToGreet(name)) {
+ *         deferred.resolve('Hello, ' + name + '!');
+ *       } else {
+ *         deferred.reject('Greeting ' + name + ' is not allowed.');
+ *       }
+ *     }, 1000);
+ *
+ *     return deferred.promise;
+ *   }
+ *
+ *   var promise = asyncGreet('Robin Hood');
+ *   promise.then(function(greeting) {
+ *     alert('Success: ' + greeting);
+ *   }, function(reason) {
+ *     alert('Failed: ' + reason);
+ *   }, function(update) {
+ *     alert('Got notification: ' + update);
+ *   });
+ * ```
+ *
+ * At first it might not be obvious why this extra complexity is worth the trouble. The payoff
+ * comes in the way of guarantees that promise and deferred APIs make, see
+ * https://github.com/kriskowal/uncommonjs/blob/master/promises/specification.md.
+ *
+ * Additionally the promise api allows for composition that is very hard to do with the
+ * traditional callback ([CPS](http://en.wikipedia.org/wiki/Continuation-passing_style)) approach.
+ * For more on this please see the [Q documentation](https://github.com/kriskowal/q) especially the
+ * section on serial or parallel joining of promises.
+ *
+ * # The Deferred API
+ *
+ * A new instance of deferred is constructed by calling `$q.defer()`.
+ *
+ * The purpose of the deferred object is to expose the associated Promise instance as well as APIs
+ * that can be used for signaling the successful or unsuccessful completion, as well as the status
+ * of the task.
+ *
+ * **Methods**
+ *
+ * - `resolve(value)` – resolves the derived promise with the `value`. If the value is a rejection
+ *   constructed via `$q.reject`, the promise will be rejected instead.
+ * - `reject(reason)` – rejects the derived promise with the `reason`. This is equivalent to
+ *   resolving it with a rejection constructed via `$q.reject`.
+ * - `notify(value)` - provides updates on the status of the promise's execution. This may be called
+ *   multiple times before the promise is either resolved or rejected.
+ *
+ * **Properties**
+ *
+ * - promise – `{Promise}` – promise object associated with this deferred.
+ *
+ *
+ * # The Promise API
+ *
+ * A new promise instance is created when a deferred instance is created and can be retrieved by
+ * calling `deferred.promise`.
+ *
+ * The purpose of the promise object is to allow for interested parties to get access to the result
+ * of the deferred task when it completes.
+ *
+ * **Methods**
+ *
+ * - `then(successCallback, errorCallback, notifyCallback)` – regardless of when the promise was or
+ *   will be resolved or rejected, `then` calls one of the success or error callbacks asynchronously
+ *   as soon as the result is available. The callbacks are called with a single argument: the result
+ *   or rejection reason. Additionally, the notify callback may be called zero or more times to
+ *   provide a progress indication, before the promise is resolved or rejected.
+ *
+ *   This method *returns a new promise* which is resolved or rejected via the return value of the
+ *   `successCallback`, `errorCallback` (unless that value is a promise, in which case it is resolved
+ *   with the value which is resolved in that promise using
+ *   [promise chaining](http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promises-queues)).
+ *   It also notifies via the return value of the `notifyCallback` method. The promise cannot be
+ *   resolved or rejected from the notifyCallback method.
+ *
+ * - `catch(errorCallback)` – shorthand for `promise.then(null, errorCallback)`
+ *
+ * - `finally(callback, notifyCallback)` – allows you to observe either the fulfillment or rejection of a promise,
+ *   but to do so without modifying the final value. This is useful to release resources or do some
+ *   clean-up that needs to be done whether the promise was rejected or resolved. See the [full
+ *   specification](https://github.com/kriskowal/q/wiki/API-Reference#promisefinallycallback) for
+ *   more information.
+ *
+ * # Chaining promises
+ *
+ * Because calling the `then` method of a promise returns a new derived promise, it is easily
+ * possible to create a chain of promises:
+ *
+ * ```js
+ *   promiseB = promiseA.then(function(result) {
+ *     return result + 1;
+ *   });
+ *
+ *   // promiseB will be resolved immediately after promiseA is resolved and its value
+ *   // will be the result of promiseA incremented by 1
+ * ```
+ *
+ * It is possible to create chains of any length and since a promise can be resolved with another
+ * promise (which will defer its resolution further), it is possible to pause/defer resolution of
+ * the promises at any point in the chain. This makes it possible to implement powerful APIs like
+ * $http's response interceptors.
+ *
+ *
+ * # Differences between Kris Kowal's Q and $q
+ *
+ *  There are two main differences:
+ *
+ * - $q is integrated with the {@link ng.$rootScope.Scope} Scope model observation
+ *   mechanism in angular, which means faster propagation of resolution or rejection into your
+ *   models and avoiding unnecessary browser repaints, which would result in flickering UI.
+ * - Q has many more features than $q, but that comes at a cost of bytes. $q is tiny, but contains
+ *   all the important functionality needed for common async tasks.
+ *
+ *  # Testing
+ *
+ *  ```js
+ *    it('should simulate promise', inject(function($q, $rootScope) {
+ *      var deferred = $q.defer();
+ *      var promise = deferred.promise;
+ *      var resolvedValue;
+ *
+ *      promise.then(function(value) { resolvedValue = value; });
+ *      expect(resolvedValue).toBeUndefined();
+ *
+ *      // Simulate resolving of promise
+ *      deferred.resolve(123);
+ *      // Note that the 'then' function does not get called synchronously.
+ *      // This is because we want the promise API to always be async, whether or not
+ *      // it got called synchronously or asynchronously.
+ *      expect(resolvedValue).toBeUndefined();
+ *
+ *      // Propagate promise resolution to 'then' functions using $apply().
+ *      $rootScope.$apply();
+ *      expect(resolvedValue).toEqual(123);
+ *    }));
+ *  ```
+ *
+ * @param {function(function, function)} resolver Function which is responsible for resolving or
+ *   rejecting the newly created promise. The first parameter is a function which resolves the
+ *   promise, the second parameter is a function which rejects the promise.
+ *
+ * @returns {Promise} The newly created promise.
+ */
+function $QProvider() {
+
+  this.$get = ['$rootScope', '$exceptionHandler', function($rootScope, $exceptionHandler) {
+    return qFactory(function(callback) {
+      $rootScope.$evalAsync(callback);
+    }, $exceptionHandler);
+  }];
+}
+
+function $$QProvider() {
+  this.$get = ['$browser', '$exceptionHandler', function($browser, $exceptionHandler) {
+    return qFactory(function(callback) {
+      $browser.defer(callback);
+    }, $exceptionHandler);
+  }];
+}
+
+/**
+ * Constructs a promise manager.
+ *
+ * @param {function(function)} nextTick Function for executing functions in the next turn.
+ * @param {function(...*)} exceptionHandler Function into which unexpected exceptions are passed for
+ *     debugging purposes.
+ * @returns {object} Promise manager.
+ */
+function qFactory(nextTick, exceptionHandler) {
+  var $qMinErr = minErr('$q', TypeError);
+  function callOnce(self, resolveFn, rejectFn) {
+    var called = false;
+    function wrap(fn) {
+      return function(value) {
+        if (called) return;
+        called = true;
+        fn.call(self, value);
+      };
+    }
+
+    return [wrap(resolveFn), wrap(rejectFn)];
+  }
+
+  /**
+   * @ngdoc method
+   * @name ng.$q#defer
+   * @kind function
+   *
+   * @description
+   * Creates a `Deferred` object which represents a task which will finish in the future.
+   *
+   * @returns {Deferred} Returns a new instance of deferred.
+   */
+  var defer = function() {
+    return new Deferred();
+  };
+
+  function Promise() {
+    this.$$state = { status: 0 };
+  }
+
+  extend(Promise.prototype, {
+    then: function(onFulfilled, onRejected, progressBack) {
+      if (isUndefined(onFulfilled) && isUndefined(onRejected) && isUndefined(progressBack)) {
+        return this;
+      }
+      var result = new Deferred();
+
+      this.$$state.pending = this.$$state.pending || [];
+      this.$$state.pending.push([result, onFulfilled, onRejected, progressBack]);
+      if (this.$$state.status > 0) scheduleProcessQueue(this.$$state);
+
+      return result.promise;
+    },
+
+    "catch": function(callback) {
+      return this.then(null, callback);
+    },
+
+    "finally": function(callback, progressBack) {
+      return this.then(function(value) {
+        return handleCallback(value, true, callback);
+      }, function(error) {
+        return handleCallback(error, false, callback);
+      }, progressBack);
+    }
+  });
+
+  //Faster, more basic than angular.bind http://jsperf.com/angular-bind-vs-custom-vs-native
+  function simpleBind(context, fn) {
+    return function(value) {
+      fn.call(context, value);
+    };
+  }
+
+  function processQueue(state) {
+    var fn, deferred, pending;
+
+    pending = state.pending;
+    state.processScheduled = false;
+    state.pending = undefined;
+    for (var i = 0, ii = pending.length; i < ii; ++i) {
+      deferred = pending[i][0];
+      fn = pending[i][state.status];
+      try {
+        if (isFunction(fn)) {
+          deferred.resolve(fn(state.value));
+        } else if (state.status === 1) {
+          deferred.resolve(state.value);
+        } else {
+          deferred.reject(state.value);
+        }
+      } catch (e) {
+        deferred.reject(e);
+        exceptionHandler(e);
+      }
+    }
+  }
+
+  function scheduleProcessQueue(state) {
+    if (state.processScheduled || !state.pending) return;
+    state.processScheduled = true;
+    nextTick(function() { processQueue(state); });
+  }
+
+  function Deferred() {
+    this.promise = new Promise();
+    //Necessary to support unbound execution :/
+    this.resolve = simpleBind(this, this.resolve);
+    this.reject = simpleBind(this, this.reject);
+    this.notify = simpleBind(this, this.notify);
+  }
+
+  extend(Deferred.prototype, {
+    resolve: function(val) {
+      if (this.promise.$$state.status) return;
+      if (val === this.promise) {
+        this.$$reject($qMinErr(
+          'qcycle',
+          "Expected promise to be resolved with value other than itself '{0}'",
+          val));
+      } else {
+        this.$$resolve(val);
+      }
+
+    },
+
+    $$resolve: function(val) {
+      var then, fns;
+
+      fns = callOnce(this, this.$$resolve, this.$$reject);
+      try {
+        if ((isObject(val) || isFunction(val))) then = val && val.then;
+        if (isFunction(then)) {
+          this.promise.$$state.status = -1;
+          then.call(val, fns[0], fns[1], this.notify);
+        } else {
+          this.promise.$$state.value = val;
+          this.promise.$$state.status = 1;
+          scheduleProcessQueue(this.promise.$$state);
+        }
+      } catch (e) {
+        fns[1](e);
+        exceptionHandler(e);
+      }
+    },
+
+    reject: function(reason) {
+      if (this.promise.$$state.status) return;
+      this.$$reject(reason);
+    },
+
+    $$reject: function(reason) {
+      this.promise.$$state.value = reason;
+      this.promise.$$state.status = 2;
+      scheduleProcessQueue(this.promise.$$state);
+    },
+
+    notify: function(progress) {
+      var callbacks = this.promise.$$state.pending;
+
+      if ((this.promise.$$state.status <= 0) && callbacks && callbacks.length) {
+        nextTick(function() {
+          var callback, result;
+          for (var i = 0, ii = callbacks.length; i < ii; i++) {
+            result = callbacks[i][0];
+            callback = callbacks[i][3];
+            try {
+              result.notify(isFunction(callback) ? callback(progress) : progress);
+            } catch (e) {
+              exceptionHandler(e);
+            }
+          }
+        });
+      }
+    }
+  });
+
+  /**
+   * @ngdoc method
+   * @name $q#reject
+   * @kind function
+   *
+   * @description
+   * Creates a promise that is resolved as rejected with the specified `reason`. This api should be
+   * used to forward rejection in a chain of promises. If you are dealing with the last promise in
+   * a promise chain, you don't need to worry about it.
+   *
+   * When comparing deferreds/promises to the familiar behavior of try/catch/throw, think of
+   * `reject` as the `throw` keyword in JavaScript. This also means that if you "catch" an error via
+   * a promise error callback and you want to forward the error to the promise derived from the
+   * current promise, you have to "rethrow" the error by returning a rejection constructed via
+   * `reject`.
+   *
+   * ```js
+   *   promiseB = promiseA.then(function(result) {
+   *     // success: do something and resolve promiseB
+   *     //          with the old or a new result
+   *     return result;
+   *   }, function(reason) {
+   *     // error: handle the error if possible and
+   *     //        resolve promiseB with newPromiseOrValue,
+   *     //        otherwise forward the rejection to promiseB
+   *     if (canHandle(reason)) {
+   *      // handle the error and recover
+   *      return newPromiseOrValue;
+   *     }
+   *     return $q.reject(reason);
+   *   });
+   * ```
+   *
+   * @param {*} reason Constant, message, exception or an object representing the rejection reason.
+   * @returns {Promise} Returns a promise that was already resolved as rejected with the `reason`.
+   */
+  var reject = function(reason) {
+    var result = new Deferred();
+    result.reject(reason);
+    return result.promise;
+  };
+
+  var makePromise = function makePromise(value, resolved) {
+    var result = new Deferred();
+    if (resolved) {
+      result.resolve(value);
+    } else {
+      result.reject(value);
+    }
+    return result.promise;
+  };
+
+  var handleCallback = function handleCallback(value, isResolved, callback) {
+    var callbackOutput = null;
+    try {
+      if (isFunction(callback)) callbackOutput = callback();
+    } catch (e) {
+      return makePromise(e, false);
+    }
+    if (isPromiseLike(callbackOutput)) {
+      return callbackOutput.then(function() {
+        return makePromise(value, isResolved);
+      }, function(error) {
+        return makePromise(error, false);
+      });
+    } else {
+      return makePromise(value, isResolved);
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name $q#when
+   * @kind function
+   *
+   * @description
+   * Wraps an object that might be a value or a (3rd party) then-able promise into a $q promise.
+   * This is useful when you are dealing with an object that might or might not be a promise, or if
+   * the promise comes from a source that can't be trusted.
+   *
+   * @param {*} value Value or a promise
+   * @param {Function=} successCallback
+   * @param {Function=} errorCallback
+   * @param {Function=} progressCallback
+   * @returns {Promise} Returns a promise of the passed value or promise
+   */
+
+
+  var when = function(value, callback, errback, progressBack) {
+    var result = new Deferred();
+    result.resolve(value);
+    return result.promise.then(callback, errback, progressBack);
+  };
+
+  /**
+   * @ngdoc method
+   * @name $q#resolve
+   * @kind function
+   *
+   * @description
+   * Alias of {@link ng.$q#when when} to maintain naming consistency with ES6.
+   *
+   * @param {*} value Value or a promise
+   * @param {Function=} successCallback
+   * @param {Function=} errorCallback
+   * @param {Function=} progressCallback
+   * @returns {Promise} Returns a promise of the passed value or promise
+   */
+  var resolve = when;
+
+  /**
+   * @ngdoc method
+   * @name $q#all
+   * @kind function
+   *
+   * @description
+   * Combines multiple promises into a single promise that is resolved when all of the input
+   * promises are resolved.
+   *
+   * @param {Array.<Promise>|Object.<Promise>} promises An array or hash of promises.
+   * @returns {Promise} Returns a single promise that will be resolved with an array/hash of values,
+   *   each value corresponding to the promise at the same index/key in the `promises` array/hash.
+   *   If any of the promises is resolved with a rejection, this resulting promise will be rejected
+   *   with the same rejection value.
+   */
+
+  function all(promises) {
+    var deferred = new Deferred(),
+        counter = 0,
+        results = isArray(promises) ? [] : {};
+
+    forEach(promises, function(promise, key) {
+      counter++;
+      when(promise).then(function(value) {
+        if (results.hasOwnProperty(key)) return;
+        results[key] = value;
+        if (!(--counter)) deferred.resolve(results);
+      }, function(reason) {
+        if (results.hasOwnProperty(key)) return;
+        deferred.reject(reason);
+      });
+    });
+
+    if (counter === 0) {
+      deferred.resolve(results);
+    }
+
+    return deferred.promise;
+  }
+
+  var $Q = function Q(resolver) {
+    if (!isFunction(resolver)) {
+      throw $qMinErr('norslvr', "Expected resolverFn, got '{0}'", resolver);
+    }
+
+    if (!(this instanceof Q)) {
+      // More useful when $Q is the Promise itself.
+      return new Q(resolver);
+    }
+
+    var deferred = new Deferred();
+
+    function resolveFn(value) {
+      deferred.resolve(value);
+    }
+
+    function rejectFn(reason) {
+      deferred.reject(reason);
+    }
+
+    resolver(resolveFn, rejectFn);
+
+    return deferred.promise;
+  };
+
+  $Q.defer = defer;
+  $Q.reject = reject;
+  $Q.when = when;
+  $Q.resolve = resolve;
+  $Q.all = all;
+
+  return $Q;
+}
+
+function $$RAFProvider() { //rAF
+  this.$get = ['$window', '$timeout', function($window, $timeout) {
+    var requestAnimationFrame = $window.requestAnimationFrame ||
+                                $window.webkitRequestAnimationFrame;
+
+    var cancelAnimationFrame = $window.cancelAnimationFrame ||
+                               $window.webkitCancelAnimationFrame ||
+                               $window.webkitCancelRequestAnimationFrame;
+
+    var rafSupported = !!requestAnimationFrame;
+    var raf = rafSupported
+      ? function(fn) {
+          var id = requestAnimationFrame(fn);
+          return function() {
+            cancelAnimationFrame(id);
+          };
+        }
+      : function(fn) {
+          var timer = $timeout(fn, 16.66, false); // 1000 / 60 = 16.666
+          return function() {
+            $timeout.cancel(timer);
+          };
+        };
+
+    raf.supported = rafSupported;
+
+    return raf;
+  }];
+}
+
+/**
+ * DESIGN NOTES
+ *
+ * The design decisions behind the scope are heavily favored for speed and memory consumption.
+ *
+ * The typical use of scope is to watch the expressions, which most of the time return the same
+ * value as last time so we optimize the operation.
+ *
+ * Closures construction is expensive in terms of speed as well as memory:
+ *   - No closures, instead use prototypical inheritance for API
+ *   - Internal state needs to be stored on scope directly, which means that private state is
+ *     exposed as $$____ properties
+ *
+ * Loop operations are optimized by using while(count--) { ... }
+ *   - this means that in order to keep the same order of execution as addition we have to add
+ *     items to the array at the beginning (unshift) instead of at the end (push)
+ *
+ * Child scopes are created and removed often
+ *   - Using an array would be slow since inserts in middle are expensive so we use linked list
+ *
+ * There are few watches then a lot of observers. This is why you don't want the observer to be
+ * implemented in the same way as watch. Watch requires return of initialization function which
+ * are expensive to construct.
+ */
+
+
+/**
+ * @ngdoc provider
+ * @name $rootScopeProvider
+ * @description
+ *
+ * Provider for the $rootScope service.
+ */
+
+/**
+ * @ngdoc method
+ * @name $rootScopeProvider#digestTtl
+ * @description
+ *
+ * Sets the number of `$digest` iterations the scope should attempt to execute before giving up and
+ * assuming that the model is unstable.
+ *
+ * The current default is 10 iterations.
+ *
+ * In complex applications it's possible that the dependencies between `$watch`s will result in
+ * several digest iterations. However if an application needs more than the default 10 digest
+ * iterations for its model to stabilize then you should investigate what is causing the model to
+ * continuously change during the digest.
+ *
+ * Increasing the TTL could have performance implications, so you should not change it without
+ * proper justification.
+ *
+ * @param {number} limit The number of digest iterations.
+ */
+
+
+/**
+ * @ngdoc service
+ * @name $rootScope
+ * @description
+ *
+ * Every application has a single root {@link ng.$rootScope.Scope scope}.
+ * All other scopes are descendant scopes of the root scope. Scopes provide separation
+ * between the model and the view, via a mechanism for watching the model for changes.
+ * They also provide an event emission/broadcast and subscription facility. See the
+ * {@link guide/scope developer guide on scopes}.
+ */
+function $RootScopeProvider() {
+  var TTL = 10;
+  var $rootScopeMinErr = minErr('$rootScope');
+  var lastDirtyWatch = null;
+  var applyAsyncId = null;
+
+  this.digestTtl = function(value) {
+    if (arguments.length) {
+      TTL = value;
+    }
+    return TTL;
+  };
+
+  function createChildScopeClass(parent) {
+    function ChildScope() {
+      this.$$watchers = this.$$nextSibling =
+          this.$$childHead = this.$$childTail = null;
+      this.$$listeners = {};
+      this.$$listenerCount = {};
+      this.$$watchersCount = 0;
+      this.$id = nextUid();
+      this.$$ChildScope = null;
+    }
+    ChildScope.prototype = parent;
+    return ChildScope;
+  }
+
+  this.$get = ['$injector', '$exceptionHandler', '$parse', '$browser',
+      function($injector, $exceptionHandler, $parse, $browser) {
+
+    function destroyChildScope($event) {
+        $event.currentScope.$$destroyed = true;
+    }
+
+    /**
+     * @ngdoc type
+     * @name $rootScope.Scope
+     *
+     * @description
+     * A root scope can be retrieved using the {@link ng.$rootScope $rootScope} key from the
+     * {@link auto.$injector $injector}. Child scopes are created using the
+     * {@link ng.$rootScope.Scope#$new $new()} method. (Most scopes are created automatically when
+     * compiled HTML template is executed.) See also the {@link guide/scope Scopes guide} for
+     * an in-depth introduction and usage examples.
+     *
+     *
+     * # Inheritance
+     * A scope can inherit from a parent scope, as in this example:
+     * ```js
+         var parent = $rootScope;
+         var child = parent.$new();
+
+         parent.salutation = "Hello";
+         expect(child.salutation).toEqual('Hello');
+
+         child.salutation = "Welcome";
+         expect(child.salutation).toEqual('Welcome');
+         expect(parent.salutation).toEqual('Hello');
+     * ```
+     *
+     * When interacting with `Scope` in tests, additional helper methods are available on the
+     * instances of `Scope` type. See {@link ngMock.$rootScope.Scope ngMock Scope} for additional
+     * details.
+     *
+     *
+     * @param {Object.<string, function()>=} providers Map of service factory which need to be
+     *                                       provided for the current scope. Defaults to {@link ng}.
+     * @param {Object.<string, *>=} instanceCache Provides pre-instantiated services which should
+     *                              append/override services provided by `providers`. This is handy
+     *                              when unit-testing and having the need to override a default
+     *                              service.
+     * @returns {Object} Newly created scope.
+     *
+     */
+    function Scope() {
+      this.$id = nextUid();
+      this.$$phase = this.$parent = this.$$watchers =
+                     this.$$nextSibling = this.$$prevSibling =
+                     this.$$childHead = this.$$childTail = null;
+      this.$root = this;
+      this.$$destroyed = false;
+      this.$$listeners = {};
+      this.$$listenerCount = {};
+      this.$$watchersCount = 0;
+      this.$$isolateBindings = null;
+    }
+
+    /**
+     * @ngdoc property
+     * @name $rootScope.Scope#$id
+     *
+     * @description
+     * Unique scope ID (monotonically increasing) useful for debugging.
+     */
+
+     /**
+      * @ngdoc property
+      * @name $rootScope.Scope#$parent
+      *
+      * @description
+      * Reference to the parent scope.
+      */
+
+      /**
+       * @ngdoc property
+       * @name $rootScope.Scope#$root
+       *
+       * @description
+       * Reference to the root scope.
+       */
+
+    Scope.prototype = {
+      constructor: Scope,
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$new
+       * @kind function
+       *
+       * @description
+       * Creates a new child {@link ng.$rootScope.Scope scope}.
+       *
+       * The parent scope will propagate the {@link ng.$rootScope.Scope#$digest $digest()} event.
+       * The scope can be removed from the scope hierarchy using {@link ng.$rootScope.Scope#$destroy $destroy()}.
+       *
+       * {@link ng.$rootScope.Scope#$destroy $destroy()} must be called on a scope when it is
+       * desired for the scope and its child scopes to be permanently detached from the parent and
+       * thus stop participating in model change detection and listener notification by invoking.
+       *
+       * @param {boolean} isolate If true, then the scope does not prototypically inherit from the
+       *         parent scope. The scope is isolated, as it can not see parent scope properties.
+       *         When creating widgets, it is useful for the widget to not accidentally read parent
+       *         state.
+       *
+       * @param {Scope} [parent=this] The {@link ng.$rootScope.Scope `Scope`} that will be the `$parent`
+       *                              of the newly created scope. Defaults to `this` scope if not provided.
+       *                              This is used when creating a transclude scope to correctly place it
+       *                              in the scope hierarchy while maintaining the correct prototypical
+       *                              inheritance.
+       *
+       * @returns {Object} The newly created child scope.
+       *
+       */
+      $new: function(isolate, parent) {
+        var child;
+
+        parent = parent || this;
+
+        if (isolate) {
+          child = new Scope();
+          child.$root = this.$root;
+        } else {
+          // Only create a child scope class if somebody asks for one,
+          // but cache it to allow the VM to optimize lookups.
+          if (!this.$$ChildScope) {
+            this.$$ChildScope = createChildScopeClass(this);
+          }
+          child = new this.$$ChildScope();
+        }
+        child.$parent = parent;
+        child.$$prevSibling = parent.$$childTail;
+        if (parent.$$childHead) {
+          parent.$$childTail.$$nextSibling = child;
+          parent.$$childTail = child;
+        } else {
+          parent.$$childHead = parent.$$childTail = child;
+        }
+
+        // When the new scope is not isolated or we inherit from `this`, and
+        // the parent scope is destroyed, the property `$$destroyed` is inherited
+        // prototypically. In all other cases, this property needs to be set
+        // when the parent scope is destroyed.
+        // The listener needs to be added after the parent is set
+        if (isolate || parent != this) child.$on('$destroy', destroyChildScope);
+
+        return child;
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$watch
+       * @kind function
+       *
+       * @description
+       * Registers a `listener` callback to be executed whenever the `watchExpression` changes.
+       *
+       * - The `watchExpression` is called on every call to {@link ng.$rootScope.Scope#$digest
+       *   $digest()} and should return the value that will be watched. (`watchExpression` should not change
+       *   its value when executed multiple times with the same input because it may be executed multiple
+       *   times by {@link ng.$rootScope.Scope#$digest $digest()}. That is, `watchExpression` should be
+       *   [idempotent](http://en.wikipedia.org/wiki/Idempotence).
+       * - The `listener` is called only when the value from the current `watchExpression` and the
+       *   previous call to `watchExpression` are not equal (with the exception of the initial run,
+       *   see below). Inequality is determined according to reference inequality,
+       *   [strict comparison](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Comparison_Operators)
+       *    via the `!==` Javascript operator, unless `objectEquality == true`
+       *   (see next point)
+       * - When `objectEquality == true`, inequality of the `watchExpression` is determined
+       *   according to the {@link angular.equals} function. To save the value of the object for
+       *   later comparison, the {@link angular.copy} function is used. This therefore means that
+       *   watching complex objects will have adverse memory and performance implications.
+       * - The watch `listener` may change the model, which may trigger other `listener`s to fire.
+       *   This is achieved by rerunning the watchers until no changes are detected. The rerun
+       *   iteration limit is 10 to prevent an infinite loop deadlock.
+       *
+       *
+       * If you want to be notified whenever {@link ng.$rootScope.Scope#$digest $digest} is called,
+       * you can register a `watchExpression` function with no `listener`. (Be prepared for
+       * multiple calls to your `watchExpression` because it will execute multiple times in a
+       * single {@link ng.$rootScope.Scope#$digest $digest} cycle if a change is detected.)
+       *
+       * After a watcher is registered with the scope, the `listener` fn is called asynchronously
+       * (via {@link ng.$rootScope.Scope#$evalAsync $evalAsync}) to initialize the
+       * watcher. In rare cases, this is undesirable because the listener is called when the result
+       * of `watchExpression` didn't change. To detect this scenario within the `listener` fn, you
+       * can compare the `newVal` and `oldVal`. If these two values are identical (`===`) then the
+       * listener was called due to initialization.
+       *
+       *
+       *
+       * # Example
+       * ```js
+           // let's assume that scope was dependency injected as the $rootScope
+           var scope = $rootScope;
+           scope.name = 'misko';
+           scope.counter = 0;
+
+           expect(scope.counter).toEqual(0);
+           scope.$watch('name', function(newValue, oldValue) {
+             scope.counter = scope.counter + 1;
+           });
+           expect(scope.counter).toEqual(0);
+
+           scope.$digest();
+           // the listener is always called during the first $digest loop after it was registered
+           expect(scope.counter).toEqual(1);
+
+           scope.$digest();
+           // but now it will not be called unless the value changes
+           expect(scope.counter).toEqual(1);
+
+           scope.name = 'adam';
+           scope.$digest();
+           expect(scope.counter).toEqual(2);
+
+
+
+           // Using a function as a watchExpression
+           var food;
+           scope.foodCounter = 0;
+           expect(scope.foodCounter).toEqual(0);
+           scope.$watch(
+             // This function returns the value being watched. It is called for each turn of the $digest loop
+             function() { return food; },
+             // This is the change listener, called when the value returned from the above function changes
+             function(newValue, oldValue) {
+               if ( newValue !== oldValue ) {
+                 // Only increment the counter if the value changed
+                 scope.foodCounter = scope.foodCounter + 1;
+               }
+             }
+           );
+           // No digest has been run so the counter will be zero
+           expect(scope.foodCounter).toEqual(0);
+
+           // Run the digest but since food has not changed count will still be zero
+           scope.$digest();
+           expect(scope.foodCounter).toEqual(0);
+
+           // Update food and run digest.  Now the counter will increment
+           food = 'cheeseburger';
+           scope.$digest();
+           expect(scope.foodCounter).toEqual(1);
+
+       * ```
+       *
+       *
+       *
+       * @param {(function()|string)} watchExpression Expression that is evaluated on each
+       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. A change in the return value triggers
+       *    a call to the `listener`.
+       *
+       *    - `string`: Evaluated as {@link guide/expression expression}
+       *    - `function(scope)`: called with current `scope` as a parameter.
+       * @param {function(newVal, oldVal, scope)} listener Callback called whenever the value
+       *    of `watchExpression` changes.
+       *
+       *    - `newVal` contains the current value of the `watchExpression`
+       *    - `oldVal` contains the previous value of the `watchExpression`
+       *    - `scope` refers to the current scope
+       * @param {boolean=} objectEquality Compare for object equality using {@link angular.equals} instead of
+       *     comparing for reference equality.
+       * @returns {function()} Returns a deregistration function for this listener.
+       */
+      $watch: function(watchExp, listener, objectEquality, prettyPrintExpression) {
+        var get = $parse(watchExp);
+
+        if (get.$$watchDelegate) {
+          return get.$$watchDelegate(this, listener, objectEquality, get, watchExp);
+        }
+        var scope = this,
+            array = scope.$$watchers,
+            watcher = {
+              fn: listener,
+              last: initWatchVal,
+              get: get,
+              exp: prettyPrintExpression || watchExp,
+              eq: !!objectEquality
+            };
+
+        lastDirtyWatch = null;
+
+        if (!isFunction(listener)) {
+          watcher.fn = noop;
+        }
+
+        if (!array) {
+          array = scope.$$watchers = [];
+        }
+        // we use unshift since we use a while loop in $digest for speed.
+        // the while loop reads in reverse order.
+        array.unshift(watcher);
+        incrementWatchersCount(this, 1);
+
+        return function deregisterWatch() {
+          if (arrayRemove(array, watcher) >= 0) {
+            incrementWatchersCount(scope, -1);
+          }
+          lastDirtyWatch = null;
+        };
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$watchGroup
+       * @kind function
+       *
+       * @description
+       * A variant of {@link ng.$rootScope.Scope#$watch $watch()} where it watches an array of `watchExpressions`.
+       * If any one expression in the collection changes the `listener` is executed.
+       *
+       * - The items in the `watchExpressions` array are observed via standard $watch operation and are examined on every
+       *   call to $digest() to see if any items changes.
+       * - The `listener` is called whenever any expression in the `watchExpressions` array changes.
+       *
+       * @param {Array.<string|Function(scope)>} watchExpressions Array of expressions that will be individually
+       * watched using {@link ng.$rootScope.Scope#$watch $watch()}
+       *
+       * @param {function(newValues, oldValues, scope)} listener Callback called whenever the return value of any
+       *    expression in `watchExpressions` changes
+       *    The `newValues` array contains the current values of the `watchExpressions`, with the indexes matching
+       *    those of `watchExpression`
+       *    and the `oldValues` array contains the previous values of the `watchExpressions`, with the indexes matching
+       *    those of `watchExpression`
+       *    The `scope` refers to the current scope.
+       * @returns {function()} Returns a de-registration function for all listeners.
+       */
+      $watchGroup: function(watchExpressions, listener) {
+        var oldValues = new Array(watchExpressions.length);
+        var newValues = new Array(watchExpressions.length);
+        var deregisterFns = [];
+        var self = this;
+        var changeReactionScheduled = false;
+        var firstRun = true;
+
+        if (!watchExpressions.length) {
+          // No expressions means we call the listener ASAP
+          var shouldCall = true;
+          self.$evalAsync(function() {
+            if (shouldCall) listener(newValues, newValues, self);
+          });
+          return function deregisterWatchGroup() {
+            shouldCall = false;
+          };
+        }
+
+        if (watchExpressions.length === 1) {
+          // Special case size of one
+          return this.$watch(watchExpressions[0], function watchGroupAction(value, oldValue, scope) {
+            newValues[0] = value;
+            oldValues[0] = oldValue;
+            listener(newValues, (value === oldValue) ? newValues : oldValues, scope);
+          });
+        }
+
+        forEach(watchExpressions, function(expr, i) {
+          var unwatchFn = self.$watch(expr, function watchGroupSubAction(value, oldValue) {
+            newValues[i] = value;
+            oldValues[i] = oldValue;
+            if (!changeReactionScheduled) {
+              changeReactionScheduled = true;
+              self.$evalAsync(watchGroupAction);
+            }
+          });
+          deregisterFns.push(unwatchFn);
+        });
+
+        function watchGroupAction() {
+          changeReactionScheduled = false;
+
+          if (firstRun) {
+            firstRun = false;
+            listener(newValues, newValues, self);
+          } else {
+            listener(newValues, oldValues, self);
+          }
+        }
+
+        return function deregisterWatchGroup() {
+          while (deregisterFns.length) {
+            deregisterFns.shift()();
+          }
+        };
+      },
+
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$watchCollection
+       * @kind function
+       *
+       * @description
+       * Shallow watches the properties of an object and fires whenever any of the properties change
+       * (for arrays, this implies watching the array items; for object maps, this implies watching
+       * the properties). If a change is detected, the `listener` callback is fired.
+       *
+       * - The `obj` collection is observed via standard $watch operation and is examined on every
+       *   call to $digest() to see if any items have been added, removed, or moved.
+       * - The `listener` is called whenever anything within the `obj` has changed. Examples include
+       *   adding, removing, and moving items belonging to an object or array.
+       *
+       *
+       * # Example
+       * ```js
+          $scope.names = ['igor', 'matias', 'misko', 'james'];
+          $scope.dataCount = 4;
+
+          $scope.$watchCollection('names', function(newNames, oldNames) {
+            $scope.dataCount = newNames.length;
+          });
+
+          expect($scope.dataCount).toEqual(4);
+          $scope.$digest();
+
+          //still at 4 ... no changes
+          expect($scope.dataCount).toEqual(4);
+
+          $scope.names.pop();
+          $scope.$digest();
+
+          //now there's been a change
+          expect($scope.dataCount).toEqual(3);
+       * ```
+       *
+       *
+       * @param {string|function(scope)} obj Evaluated as {@link guide/expression expression}. The
+       *    expression value should evaluate to an object or an array which is observed on each
+       *    {@link ng.$rootScope.Scope#$digest $digest} cycle. Any shallow change within the
+       *    collection will trigger a call to the `listener`.
+       *
+       * @param {function(newCollection, oldCollection, scope)} listener a callback function called
+       *    when a change is detected.
+       *    - The `newCollection` object is the newly modified data obtained from the `obj` expression
+       *    - The `oldCollection` object is a copy of the former collection data.
+       *      Due to performance considerations, the`oldCollection` value is computed only if the
+       *      `listener` function declares two or more arguments.
+       *    - The `scope` argument refers to the current scope.
+       *
+       * @returns {function()} Returns a de-registration function for this listener. When the
+       *    de-registration function is executed, the internal watch operation is terminated.
+       */
+      $watchCollection: function(obj, listener) {
+        $watchCollectionInterceptor.$stateful = true;
+
+        var self = this;
+        // the current value, updated on each dirty-check run
+        var newValue;
+        // a shallow copy of the newValue from the last dirty-check run,
+        // updated to match newValue during dirty-check run
+        var oldValue;
+        // a shallow copy of the newValue from when the last change happened
+        var veryOldValue;
+        // only track veryOldValue if the listener is asking for it
+        var trackVeryOldValue = (listener.length > 1);
+        var changeDetected = 0;
+        var changeDetector = $parse(obj, $watchCollectionInterceptor);
+        var internalArray = [];
+        var internalObject = {};
+        var initRun = true;
+        var oldLength = 0;
+
+        function $watchCollectionInterceptor(_value) {
+          newValue = _value;
+          var newLength, key, bothNaN, newItem, oldItem;
+
+          // If the new value is undefined, then return undefined as the watch may be a one-time watch
+          if (isUndefined(newValue)) return;
+
+          if (!isObject(newValue)) { // if primitive
+            if (oldValue !== newValue) {
+              oldValue = newValue;
+              changeDetected++;
+            }
+          } else if (isArrayLike(newValue)) {
+            if (oldValue !== internalArray) {
+              // we are transitioning from something which was not an array into array.
+              oldValue = internalArray;
+              oldLength = oldValue.length = 0;
+              changeDetected++;
+            }
+
+            newLength = newValue.length;
+
+            if (oldLength !== newLength) {
+              // if lengths do not match we need to trigger change notification
+              changeDetected++;
+              oldValue.length = oldLength = newLength;
+            }
+            // copy the items to oldValue and look for changes.
+            for (var i = 0; i < newLength; i++) {
+              oldItem = oldValue[i];
+              newItem = newValue[i];
+
+              bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
+              if (!bothNaN && (oldItem !== newItem)) {
+                changeDetected++;
+                oldValue[i] = newItem;
+              }
+            }
+          } else {
+            if (oldValue !== internalObject) {
+              // we are transitioning from something which was not an object into object.
+              oldValue = internalObject = {};
+              oldLength = 0;
+              changeDetected++;
+            }
+            // copy the items to oldValue and look for changes.
+            newLength = 0;
+            for (key in newValue) {
+              if (hasOwnProperty.call(newValue, key)) {
+                newLength++;
+                newItem = newValue[key];
+                oldItem = oldValue[key];
+
+                if (key in oldValue) {
+                  bothNaN = (oldItem !== oldItem) && (newItem !== newItem);
+                  if (!bothNaN && (oldItem !== newItem)) {
+                    changeDetected++;
+                    oldValue[key] = newItem;
+                  }
+                } else {
+                  oldLength++;
+                  oldValue[key] = newItem;
+                  changeDetected++;
+                }
+              }
+            }
+            if (oldLength > newLength) {
+              // we used to have more keys, need to find them and destroy them.
+              changeDetected++;
+              for (key in oldValue) {
+                if (!hasOwnProperty.call(newValue, key)) {
+                  oldLength--;
+                  delete oldValue[key];
+                }
+              }
+            }
+          }
+          return changeDetected;
+        }
+
+        function $watchCollectionAction() {
+          if (initRun) {
+            initRun = false;
+            listener(newValue, newValue, self);
+          } else {
+            listener(newValue, veryOldValue, self);
+          }
+
+          // make a copy for the next time a collection is changed
+          if (trackVeryOldValue) {
+            if (!isObject(newValue)) {
+              //primitive
+              veryOldValue = newValue;
+            } else if (isArrayLike(newValue)) {
+              veryOldValue = new Array(newValue.length);
+              for (var i = 0; i < newValue.length; i++) {
+                veryOldValue[i] = newValue[i];
+              }
+            } else { // if object
+              veryOldValue = {};
+              for (var key in newValue) {
+                if (hasOwnProperty.call(newValue, key)) {
+                  veryOldValue[key] = newValue[key];
+                }
+              }
+            }
+          }
+        }
+
+        return this.$watch(changeDetector, $watchCollectionAction);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$digest
+       * @kind function
+       *
+       * @description
+       * Processes all of the {@link ng.$rootScope.Scope#$watch watchers} of the current scope and
+       * its children. Because a {@link ng.$rootScope.Scope#$watch watcher}'s listener can change
+       * the model, the `$digest()` keeps calling the {@link ng.$rootScope.Scope#$watch watchers}
+       * until no more listeners are firing. This means that it is possible to get into an infinite
+       * loop. This function will throw `'Maximum iteration limit exceeded.'` if the number of
+       * iterations exceeds 10.
+       *
+       * Usually, you don't call `$digest()` directly in
+       * {@link ng.directive:ngController controllers} or in
+       * {@link ng.$compileProvider#directive directives}.
+       * Instead, you should call {@link ng.$rootScope.Scope#$apply $apply()} (typically from within
+       * a {@link ng.$compileProvider#directive directive}), which will force a `$digest()`.
+       *
+       * If you want to be notified whenever `$digest()` is called,
+       * you can register a `watchExpression` function with
+       * {@link ng.$rootScope.Scope#$watch $watch()} with no `listener`.
+       *
+       * In unit tests, you may need to call `$digest()` to simulate the scope life cycle.
+       *
+       * # Example
+       * ```js
+           var scope = ...;
+           scope.name = 'misko';
+           scope.counter = 0;
+
+           expect(scope.counter).toEqual(0);
+           scope.$watch('name', function(newValue, oldValue) {
+             scope.counter = scope.counter + 1;
+           });
+           expect(scope.counter).toEqual(0);
+
+           scope.$digest();
+           // the listener is always called during the first $digest loop after it was registered
+           expect(scope.counter).toEqual(1);
+
+           scope.$digest();
+           // but now it will not be called unless the value changes
+           expect(scope.counter).toEqual(1);
+
+           scope.name = 'adam';
+           scope.$digest();
+           expect(scope.counter).toEqual(2);
+       * ```
+       *
+       */
+      $digest: function() {
+        var watch, value, last,
+            watchers,
+            length,
+            dirty, ttl = TTL,
+            next, current, target = this,
+            watchLog = [],
+            logIdx, logMsg, asyncTask;
+
+        beginPhase('$digest');
+        // Check for changes to browser url that happened in sync before the call to $digest
+        $browser.$$checkUrlChange();
+
+        if (this === $rootScope && applyAsyncId !== null) {
+          // If this is the root scope, and $applyAsync has scheduled a deferred $apply(), then
+          // cancel the scheduled $apply and flush the queue of expressions to be evaluated.
+          $browser.defer.cancel(applyAsyncId);
+          flushApplyAsync();
+        }
+
+        lastDirtyWatch = null;
+
+        do { // "while dirty" loop
+          dirty = false;
+          current = target;
+
+          while (asyncQueue.length) {
+            try {
+              asyncTask = asyncQueue.shift();
+              asyncTask.scope.$eval(asyncTask.expression, asyncTask.locals);
+            } catch (e) {
+              $exceptionHandler(e);
+            }
+            lastDirtyWatch = null;
+          }
+
+          traverseScopesLoop:
+          do { // "traverse the scopes" loop
+            if ((watchers = current.$$watchers)) {
+              // process our watches
+              length = watchers.length;
+              while (length--) {
+                try {
+                  watch = watchers[length];
+                  // Most common watches are on primitives, in which case we can short
+                  // circuit it with === operator, only when === fails do we use .equals
+                  if (watch) {
+                    if ((value = watch.get(current)) !== (last = watch.last) &&
+                        !(watch.eq
+                            ? equals(value, last)
+                            : (typeof value === 'number' && typeof last === 'number'
+                               && isNaN(value) && isNaN(last)))) {
+                      dirty = true;
+                      lastDirtyWatch = watch;
+                      watch.last = watch.eq ? copy(value, null) : value;
+                      watch.fn(value, ((last === initWatchVal) ? value : last), current);
+                      if (ttl < 5) {
+                        logIdx = 4 - ttl;
+                        if (!watchLog[logIdx]) watchLog[logIdx] = [];
+                        watchLog[logIdx].push({
+                          msg: isFunction(watch.exp) ? 'fn: ' + (watch.exp.name || watch.exp.toString()) : watch.exp,
+                          newVal: value,
+                          oldVal: last
+                        });
+                      }
+                    } else if (watch === lastDirtyWatch) {
+                      // If the most recently dirty watcher is now clean, short circuit since the remaining watchers
+                      // have already been tested.
+                      dirty = false;
+                      break traverseScopesLoop;
+                    }
+                  }
+                } catch (e) {
+                  $exceptionHandler(e);
+                }
+              }
+            }
+
+            // Insanity Warning: scope depth-first traversal
+            // yes, this code is a bit crazy, but it works and we have tests to prove it!
+            // this piece should be kept in sync with the traversal in $broadcast
+            if (!(next = ((current.$$watchersCount && current.$$childHead) ||
+                (current !== target && current.$$nextSibling)))) {
+              while (current !== target && !(next = current.$$nextSibling)) {
+                current = current.$parent;
+              }
+            }
+          } while ((current = next));
+
+          // `break traverseScopesLoop;` takes us to here
+
+          if ((dirty || asyncQueue.length) && !(ttl--)) {
+            clearPhase();
+            throw $rootScopeMinErr('infdig',
+                '{0} $digest() iterations reached. Aborting!\n' +
+                'Watchers fired in the last 5 iterations: {1}',
+                TTL, watchLog);
+          }
+
+        } while (dirty || asyncQueue.length);
+
+        clearPhase();
+
+        while (postDigestQueue.length) {
+          try {
+            postDigestQueue.shift()();
+          } catch (e) {
+            $exceptionHandler(e);
+          }
+        }
+      },
+
+
+      /**
+       * @ngdoc event
+       * @name $rootScope.Scope#$destroy
+       * @eventType broadcast on scope being destroyed
+       *
+       * @description
+       * Broadcasted when a scope and its children are being destroyed.
+       *
+       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
+       * clean up DOM bindings before an element is removed from the DOM.
+       */
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$destroy
+       * @kind function
+       *
+       * @description
+       * Removes the current scope (and all of its children) from the parent scope. Removal implies
+       * that calls to {@link ng.$rootScope.Scope#$digest $digest()} will no longer
+       * propagate to the current scope and its children. Removal also implies that the current
+       * scope is eligible for garbage collection.
+       *
+       * The `$destroy()` is usually used by directives such as
+       * {@link ng.directive:ngRepeat ngRepeat} for managing the
+       * unrolling of the loop.
+       *
+       * Just before a scope is destroyed, a `$destroy` event is broadcasted on this scope.
+       * Application code can register a `$destroy` event handler that will give it a chance to
+       * perform any necessary cleanup.
+       *
+       * Note that, in AngularJS, there is also a `$destroy` jQuery event, which can be used to
+       * clean up DOM bindings before an element is removed from the DOM.
+       */
+      $destroy: function() {
+        // We can't destroy a scope that has been already destroyed.
+        if (this.$$destroyed) return;
+        var parent = this.$parent;
+
+        this.$broadcast('$destroy');
+        this.$$destroyed = true;
+
+        if (this === $rootScope) {
+          //Remove handlers attached to window when $rootScope is removed
+          $browser.$$applicationDestroyed();
+        }
+
+        incrementWatchersCount(this, -this.$$watchersCount);
+        for (var eventName in this.$$listenerCount) {
+          decrementListenerCount(this, this.$$listenerCount[eventName], eventName);
+        }
+
+        // sever all the references to parent scopes (after this cleanup, the current scope should
+        // not be retained by any of our references and should be eligible for garbage collection)
+        if (parent && parent.$$childHead == this) parent.$$childHead = this.$$nextSibling;
+        if (parent && parent.$$childTail == this) parent.$$childTail = this.$$prevSibling;
+        if (this.$$prevSibling) this.$$prevSibling.$$nextSibling = this.$$nextSibling;
+        if (this.$$nextSibling) this.$$nextSibling.$$prevSibling = this.$$prevSibling;
+
+        // Disable listeners, watchers and apply/digest methods
+        this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;
+        this.$on = this.$watch = this.$watchGroup = function() { return noop; };
+        this.$$listeners = {};
+
+        // All of the code below is bogus code that works around V8's memory leak via optimized code
+        // and inline caches.
+        //
+        // see:
+        // - https://code.google.com/p/v8/issues/detail?id=2073#c26
+        // - https://github.com/angular/angular.js/issues/6794#issuecomment-38648909
+        // - https://github.com/angular/angular.js/issues/1313#issuecomment-10378451
+
+        this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead =
+            this.$$childTail = this.$root = this.$$watchers = null;
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$eval
+       * @kind function
+       *
+       * @description
+       * Executes the `expression` on the current scope and returns the result. Any exceptions in
+       * the expression are propagated (uncaught). This is useful when evaluating Angular
+       * expressions.
+       *
+       * # Example
+       * ```js
+           var scope = ng.$rootScope.Scope();
+           scope.a = 1;
+           scope.b = 2;
+
+           expect(scope.$eval('a+b')).toEqual(3);
+           expect(scope.$eval(function(scope){ return scope.a + scope.b; })).toEqual(3);
+       * ```
+       *
+       * @param {(string|function())=} expression An angular expression to be executed.
+       *
+       *    - `string`: execute using the rules as defined in  {@link guide/expression expression}.
+       *    - `function(scope)`: execute the function with the current `scope` parameter.
+       *
+       * @param {(object)=} locals Local variables object, useful for overriding values in scope.
+       * @returns {*} The result of evaluating the expression.
+       */
+      $eval: function(expr, locals) {
+        return $parse(expr)(this, locals);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$evalAsync
+       * @kind function
+       *
+       * @description
+       * Executes the expression on the current scope at a later point in time.
+       *
+       * The `$evalAsync` makes no guarantees as to when the `expression` will be executed, only
+       * that:
+       *
+       *   - it will execute after the function that scheduled the evaluation (preferably before DOM
+       *     rendering).
+       *   - at least one {@link ng.$rootScope.Scope#$digest $digest cycle} will be performed after
+       *     `expression` execution.
+       *
+       * Any exceptions from the execution of the expression are forwarded to the
+       * {@link ng.$exceptionHandler $exceptionHandler} service.
+       *
+       * __Note:__ if this function is called outside of a `$digest` cycle, a new `$digest` cycle
+       * will be scheduled. However, it is encouraged to always call code that changes the model
+       * from within an `$apply` call. That includes code evaluated via `$evalAsync`.
+       *
+       * @param {(string|function())=} expression An angular expression to be executed.
+       *
+       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
+       *    - `function(scope)`: execute the function with the current `scope` parameter.
+       *
+       * @param {(object)=} locals Local variables object, useful for overriding values in scope.
+       */
+      $evalAsync: function(expr, locals) {
+        // if we are outside of an $digest loop and this is the first time we are scheduling async
+        // task also schedule async auto-flush
+        if (!$rootScope.$$phase && !asyncQueue.length) {
+          $browser.defer(function() {
+            if (asyncQueue.length) {
+              $rootScope.$digest();
+            }
+          });
+        }
+
+        asyncQueue.push({scope: this, expression: expr, locals: locals});
+      },
+
+      $$postDigest: function(fn) {
+        postDigestQueue.push(fn);
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$apply
+       * @kind function
+       *
+       * @description
+       * `$apply()` is used to execute an expression in angular from outside of the angular
+       * framework. (For example from browser DOM events, setTimeout, XHR or third party libraries).
+       * Because we are calling into the angular framework we need to perform proper scope life
+       * cycle of {@link ng.$exceptionHandler exception handling},
+       * {@link ng.$rootScope.Scope#$digest executing watches}.
+       *
+       * ## Life cycle
+       *
+       * # Pseudo-Code of `$apply()`
+       * ```js
+           function $apply(expr) {
+             try {
+               return $eval(expr);
+             } catch (e) {
+               $exceptionHandler(e);
+             } finally {
+               $root.$digest();
+             }
+           }
+       * ```
+       *
+       *
+       * Scope's `$apply()` method transitions through the following stages:
+       *
+       * 1. The {@link guide/expression expression} is executed using the
+       *    {@link ng.$rootScope.Scope#$eval $eval()} method.
+       * 2. Any exceptions from the execution of the expression are forwarded to the
+       *    {@link ng.$exceptionHandler $exceptionHandler} service.
+       * 3. The {@link ng.$rootScope.Scope#$watch watch} listeners are fired immediately after the
+       *    expression was executed using the {@link ng.$rootScope.Scope#$digest $digest()} method.
+       *
+       *
+       * @param {(string|function())=} exp An angular expression to be executed.
+       *
+       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
+       *    - `function(scope)`: execute the function with current `scope` parameter.
+       *
+       * @returns {*} The result of evaluating the expression.
+       */
+      $apply: function(expr) {
+        try {
+          beginPhase('$apply');
+          try {
+            return this.$eval(expr);
+          } finally {
+            clearPhase();
+          }
+        } catch (e) {
+          $exceptionHandler(e);
+        } finally {
+          try {
+            $rootScope.$digest();
+          } catch (e) {
+            $exceptionHandler(e);
+            throw e;
+          }
+        }
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$applyAsync
+       * @kind function
+       *
+       * @description
+       * Schedule the invocation of $apply to occur at a later time. The actual time difference
+       * varies across browsers, but is typically around ~10 milliseconds.
+       *
+       * This can be used to queue up multiple expressions which need to be evaluated in the same
+       * digest.
+       *
+       * @param {(string|function())=} exp An angular expression to be executed.
+       *
+       *    - `string`: execute using the rules as defined in {@link guide/expression expression}.
+       *    - `function(scope)`: execute the function with current `scope` parameter.
+       */
+      $applyAsync: function(expr) {
+        var scope = this;
+        expr && applyAsyncQueue.push($applyAsyncExpression);
+        scheduleApplyAsync();
+
+        function $applyAsyncExpression() {
+          scope.$eval(expr);
+        }
+      },
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$on
+       * @kind function
+       *
+       * @description
+       * Listens on events of a given type. See {@link ng.$rootScope.Scope#$emit $emit} for
+       * discussion of event life cycle.
+       *
+       * The event listener function format is: `function(event, args...)`. The `event` object
+       * passed into the listener has the following attributes:
+       *
+       *   - `targetScope` - `{Scope}`: the scope on which the event was `$emit`-ed or
+       *     `$broadcast`-ed.
+       *   - `currentScope` - `{Scope}`: the scope that is currently handling the event. Once the
+       *     event propagates through the scope hierarchy, this property is set to null.
+       *   - `name` - `{string}`: name of the event.
+       *   - `stopPropagation` - `{function=}`: calling `stopPropagation` function will cancel
+       *     further event propagation (available only for events that were `$emit`-ed).
+       *   - `preventDefault` - `{function}`: calling `preventDefault` sets `defaultPrevented` flag
+       *     to true.
+       *   - `defaultPrevented` - `{boolean}`: true if `preventDefault` was called.
+       *
+       * @param {string} name Event name to listen on.
+       * @param {function(event, ...args)} listener Function to call when the event is emitted.
+       * @returns {function()} Returns a deregistration function for this listener.
+       */
+      $on: function(name, listener) {
+        var namedListeners = this.$$listeners[name];
+        if (!namedListeners) {
+          this.$$listeners[name] = namedListeners = [];
+        }
+        namedListeners.push(listener);
+
+        var current = this;
+        do {
+          if (!current.$$listenerCount[name]) {
+            current.$$listenerCount[name] = 0;
+          }
+          current.$$listenerCount[name]++;
+        } while ((current = current.$parent));
+
+        var self = this;
+        return function() {
+          var indexOfListener = namedListeners.indexOf(listener);
+          if (indexOfListener !== -1) {
+            namedListeners[indexOfListener] = null;
+            decrementListenerCount(self, 1, name);
+          }
+        };
+      },
+
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$emit
+       * @kind function
+       *
+       * @description
+       * Dispatches an event `name` upwards through the scope hierarchy notifying the
+       * registered {@link ng.$rootScope.Scope#$on} listeners.
+       *
+       * The event life cycle starts at the scope on which `$emit` was called. All
+       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
+       * notified. Afterwards, the event traverses upwards toward the root scope and calls all
+       * registered listeners along the way. The event will stop propagating if one of the listeners
+       * cancels it.
+       *
+       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
+       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
+       *
+       * @param {string} name Event name to emit.
+       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
+       * @return {Object} Event object (see {@link ng.$rootScope.Scope#$on}).
+       */
+      $emit: function(name, args) {
+        var empty = [],
+            namedListeners,
+            scope = this,
+            stopPropagation = false,
+            event = {
+              name: name,
+              targetScope: scope,
+              stopPropagation: function() {stopPropagation = true;},
+              preventDefault: function() {
+                event.defaultPrevented = true;
+              },
+              defaultPrevented: false
+            },
+            listenerArgs = concat([event], arguments, 1),
+            i, length;
+
+        do {
+          namedListeners = scope.$$listeners[name] || empty;
+          event.currentScope = scope;
+          for (i = 0, length = namedListeners.length; i < length; i++) {
+
+            // if listeners were deregistered, defragment the array
+            if (!namedListeners[i]) {
+              namedListeners.splice(i, 1);
+              i--;
+              length--;
+              continue;
+            }
+            try {
+              //allow all listeners attached to the current scope to run
+              namedListeners[i].apply(null, listenerArgs);
+            } catch (e) {
+              $exceptionHandler(e);
+            }
+          }
+          //if any listener on the current scope stops propagation, prevent bubbling
+          if (stopPropagation) {
+            event.currentScope = null;
+            return event;
+          }
+          //traverse upwards
+          scope = scope.$parent;
+        } while (scope);
+
+        event.currentScope = null;
+
+        return event;
+      },
+
+
+      /**
+       * @ngdoc method
+       * @name $rootScope.Scope#$broadcast
+       * @kind function
+       *
+       * @description
+       * Dispatches an event `name` downwards to all child scopes (and their children) notifying the
+       * registered {@link ng.$rootScope.Scope#$on} listeners.
+       *
+       * The event life cycle starts at the scope on which `$broadcast` was called. All
+       * {@link ng.$rootScope.Scope#$on listeners} listening for `name` event on this scope get
+       * notified. Afterwards, the event propagates to all direct and indirect scopes of the current
+       * scope and calls all registered listeners along the way. The event cannot be canceled.
+       *
+       * Any exception emitted from the {@link ng.$rootScope.Scope#$on listeners} will be passed
+       * onto the {@link ng.$exceptionHandler $exceptionHandler} service.
+       *
+       * @param {string} name Event name to broadcast.
+       * @param {...*} args Optional one or more arguments which will be passed onto the event listeners.
+       * @return {Object} Event object, see {@link ng.$rootScope.Scope#$on}
+       */
+      $broadcast: function(name, args) {
+        var target = this,
+            current = target,
+            next = target,
+            event = {
+              name: name,
+              targetScope: target,
+              preventDefault: function() {
+                event.defaultPrevented = true;
+              },
+              defaultPrevented: false
+            };
+
+        if (!target.$$listenerCount[name]) return event;
+
+        var listenerArgs = concat([event], arguments, 1),
+            listeners, i, length;
+
+        //down while you can, then up and next sibling or up and next sibling until back at root
+        while ((current = next)) {
+          event.currentScope = current;
+          listeners = current.$$listeners[name] || [];
+          for (i = 0, length = listeners.length; i < length; i++) {
+            // if listeners were deregistered, defragment the array
+            if (!listeners[i]) {
+              listeners.splice(i, 1);
+              i--;
+              length--;
+              continue;
+            }
+
+            try {
+              listeners[i].apply(null, listenerArgs);
+            } catch (e) {
+              $exceptionHandler(e);
+            }
+          }
+
+          // Insanity Warning: scope depth-first traversal
+          // yes, this code is a bit crazy, but it works and we have tests to prove it!
+          // this piece should be kept in sync with the traversal in $digest
+          // (though it differs due to having the extra check for $$listenerCount)
+          if (!(next = ((current.$$listenerCount[name] && current.$$childHead) ||
+              (current !== target && current.$$nextSibling)))) {
+            while (current !== target && !(next = current.$$nextSibling)) {
+              current = current.$parent;
+            }
+          }
+        }
+
+        event.currentScope = null;
+        return event;
+      }
+    };
+
+    var $rootScope = new Scope();
+
+    //The internal queues. Expose them on the $rootScope for debugging/testing purposes.
+    var asyncQueue = $rootScope.$$asyncQueue = [];
+    var postDigestQueue = $rootScope.$$postDigestQueue = [];
+    var applyAsyncQueue = $rootScope.$$applyAsyncQueue = [];
+
+    return $rootScope;
+
+
+    function beginPhase(phase) {
+      if ($rootScope.$$phase) {
+        throw $rootScopeMinErr('inprog', '{0} already in progress', $rootScope.$$phase);
+      }
+
+      $rootScope.$$phase = phase;
+    }
+
+    function clearPhase() {
+      $rootScope.$$phase = null;
+    }
+
+    function incrementWatchersCount(current, count) {
+      do {
+        current.$$watchersCount += count;
+      } while ((current = current.$parent));
+    }
+
+    function decrementListenerCount(current, count, name) {
+      do {
+        current.$$listenerCount[name] -= count;
+
+        if (current.$$listenerCount[name] === 0) {
+          delete current.$$listenerCount[name];
+        }
+      } while ((current = current.$parent));
+    }
+
+    /**
+     * function used as an initial value for watchers.
+     * because it's unique we can easily tell it apart from other values
+     */
+    function initWatchVal() {}
+
+    function flushApplyAsync() {
+      while (applyAsyncQueue.length) {
+        try {
+          applyAsyncQueue.shift()();
+        } catch (e) {
+          $exceptionHandler(e);
+        }
+      }
+      applyAsyncId = null;
+    }
+
+    function scheduleApplyAsync() {
+      if (applyAsyncId === null) {
+        applyAsyncId = $browser.defer(function() {
+          $rootScope.$apply(flushApplyAsync);
+        });
+      }
+    }
+  }];
+}
+
+/**
+ * @description
+ * Private service to sanitize uris for links and images. Used by $compile and $sanitize.
+ */
+function $$SanitizeUriProvider() {
+  var aHrefSanitizationWhitelist = /^\s*(https?|ftp|mailto|tel|file):/,
+    imgSrcSanitizationWhitelist = /^\s*((https?|ftp|file|blob):|data:image\/)/;
+
+  /**
+   * @description
+   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+   * urls during a[href] sanitization.
+   *
+   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
+   *
+   * Any url about to be assigned to a[href] via data-binding is first normalized and turned into
+   * an absolute url. Afterwards, the url is matched against the `aHrefSanitizationWhitelist`
+   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
+   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
+   *
+   * @param {RegExp=} regexp New regexp to whitelist urls with.
+   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
+   *    chaining otherwise.
+   */
+  this.aHrefSanitizationWhitelist = function(regexp) {
+    if (isDefined(regexp)) {
+      aHrefSanitizationWhitelist = regexp;
+      return this;
+    }
+    return aHrefSanitizationWhitelist;
+  };
+
+
+  /**
+   * @description
+   * Retrieves or overrides the default regular expression that is used for whitelisting of safe
+   * urls during img[src] sanitization.
+   *
+   * The sanitization is a security measure aimed at prevent XSS attacks via html links.
+   *
+   * Any url about to be assigned to img[src] via data-binding is first normalized and turned into
+   * an absolute url. Afterwards, the url is matched against the `imgSrcSanitizationWhitelist`
+   * regular expression. If a match is found, the original url is written into the dom. Otherwise,
+   * the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
+   *
+   * @param {RegExp=} regexp New regexp to whitelist urls with.
+   * @returns {RegExp|ng.$compileProvider} Current RegExp if called without value or self for
+   *    chaining otherwise.
+   */
+  this.imgSrcSanitizationWhitelist = function(regexp) {
+    if (isDefined(regexp)) {
+      imgSrcSanitizationWhitelist = regexp;
+      return this;
+    }
+    return imgSrcSanitizationWhitelist;
+  };
+
+  this.$get = function() {
+    return function sanitizeUri(uri, isImage) {
+      var regex = isImage ? imgSrcSanitizationWhitelist : aHrefSanitizationWhitelist;
+      var normalizedVal;
+      normalizedVal = urlResolve(uri).href;
+      if (normalizedVal !== '' && !normalizedVal.match(regex)) {
+        return 'unsafe:' + normalizedVal;
+      }
+      return uri;
+    };
+  };
+}
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *     Any commits to this file should be reviewed with security in mind.  *
+ *   Changes to this file can potentially create security vulnerabilities. *
+ *          An approval from 2 Core members with history of modifying      *
+ *                         this file is required.                          *
+ *                                                                         *
+ *  Does the change somehow allow for arbitrary javascript to be executed? *
+ *    Or allows for someone to change the prototype of built-in objects?   *
+ *     Or gives undesired access to variables likes document or window?    *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+var $sceMinErr = minErr('$sce');
+
+var SCE_CONTEXTS = {
+  HTML: 'html',
+  CSS: 'css',
+  URL: 'url',
+  // RESOURCE_URL is a subtype of URL used in contexts where a privileged resource is sourced from a
+  // url.  (e.g. ng-include, script src, templateUrl)
+  RESOURCE_URL: 'resourceUrl',
+  JS: 'js'
+};
+
+// Helper functions follow.
+
+function adjustMatcher(matcher) {
+  if (matcher === 'self') {
+    return matcher;
+  } else if (isString(matcher)) {
+    // Strings match exactly except for 2 wildcards - '*' and '**'.
+    // '*' matches any character except those from the set ':/.?&'.
+    // '**' matches any character (like .* in a RegExp).
+    // More than 2 *'s raises an error as it's ill defined.
+    if (matcher.indexOf('***') > -1) {
+      throw $sceMinErr('iwcard',
+          'Illegal sequence *** in string matcher.  String: {0}', matcher);
+    }
+    matcher = escapeForRegexp(matcher).
+                  replace('\\*\\*', '.*').
+                  replace('\\*', '[^:/.?&;]*');
+    return new RegExp('^' + matcher + '$');
+  } else if (isRegExp(matcher)) {
+    // The only other type of matcher allowed is a Regexp.
+    // Match entire URL / disallow partial matches.
+    // Flags are reset (i.e. no global, ignoreCase or multiline)
+    return new RegExp('^' + matcher.source + '$');
+  } else {
+    throw $sceMinErr('imatcher',
+        'Matchers may only be "self", string patterns or RegExp objects');
+  }
+}
+
+
+function adjustMatchers(matchers) {
+  var adjustedMatchers = [];
+  if (isDefined(matchers)) {
+    forEach(matchers, function(matcher) {
+      adjustedMatchers.push(adjustMatcher(matcher));
+    });
+  }
+  return adjustedMatchers;
+}
+
+
+/**
+ * @ngdoc service
+ * @name $sceDelegate
+ * @kind function
+ *
+ * @description
+ *
+ * `$sceDelegate` is a service that is used by the `$sce` service to provide {@link ng.$sce Strict
+ * Contextual Escaping (SCE)} services to AngularJS.
+ *
+ * Typically, you would configure or override the {@link ng.$sceDelegate $sceDelegate} instead of
+ * the `$sce` service to customize the way Strict Contextual Escaping works in AngularJS.  This is
+ * because, while the `$sce` provides numerous shorthand methods, etc., you really only need to
+ * override 3 core functions (`trustAs`, `getTrusted` and `valueOf`) to replace the way things
+ * work because `$sce` delegates to `$sceDelegate` for these operations.
+ *
+ * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} to configure this service.
+ *
+ * The default instance of `$sceDelegate` should work out of the box with little pain.  While you
+ * can override it completely to change the behavior of `$sce`, the common case would
+ * involve configuring the {@link ng.$sceDelegateProvider $sceDelegateProvider} instead by setting
+ * your own whitelists and blacklists for trusting URLs used for loading AngularJS resources such as
+ * templates.  Refer {@link ng.$sceDelegateProvider#resourceUrlWhitelist
+ * $sceDelegateProvider.resourceUrlWhitelist} and {@link
+ * ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
+ */
+
+/**
+ * @ngdoc provider
+ * @name $sceDelegateProvider
+ * @description
+ *
+ * The `$sceDelegateProvider` provider allows developers to configure the {@link ng.$sceDelegate
+ * $sceDelegate} service.  This allows one to get/set the whitelists and blacklists used to ensure
+ * that the URLs used for sourcing Angular templates are safe.  Refer {@link
+ * ng.$sceDelegateProvider#resourceUrlWhitelist $sceDelegateProvider.resourceUrlWhitelist} and
+ * {@link ng.$sceDelegateProvider#resourceUrlBlacklist $sceDelegateProvider.resourceUrlBlacklist}
+ *
+ * For the general details about this service in Angular, read the main page for {@link ng.$sce
+ * Strict Contextual Escaping (SCE)}.
+ *
+ * **Example**:  Consider the following case. <a name="example"></a>
+ *
+ * - your app is hosted at url `http://myapp.example.com/`
+ * - but some of your templates are hosted on other domains you control such as
+ *   `http://srv01.assets.example.com/`,  `http://srv02.assets.example.com/`, etc.
+ * - and you have an open redirect at `http://myapp.example.com/clickThru?...`.
+ *
+ * Here is what a secure configuration for this scenario might look like:
+ *
+ * ```
+ *  angular.module('myApp', []).config(function($sceDelegateProvider) {
+ *    $sceDelegateProvider.resourceUrlWhitelist([
+ *      // Allow same origin resource loads.
+ *      'self',
+ *      // Allow loading from our assets domain.  Notice the difference between * and **.
+ *      'http://srv*.assets.example.com/**'
+ *    ]);
+ *
+ *    // The blacklist overrides the whitelist so the open redirect here is blocked.
+ *    $sceDelegateProvider.resourceUrlBlacklist([
+ *      'http://myapp.example.com/clickThru**'
+ *    ]);
+ *  });
+ * ```
+ */
+
+function $SceDelegateProvider() {
+  this.SCE_CONTEXTS = SCE_CONTEXTS;
+
+  // Resource URLs can also be trusted by policy.
+  var resourceUrlWhitelist = ['self'],
+      resourceUrlBlacklist = [];
+
+  /**
+   * @ngdoc method
+   * @name $sceDelegateProvider#resourceUrlWhitelist
+   * @kind function
+   *
+   * @param {Array=} whitelist When provided, replaces the resourceUrlWhitelist with the value
+   *     provided.  This must be an array or null.  A snapshot of this array is used so further
+   *     changes to the array are ignored.
+   *
+   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
+   *     allowed in this array.
+   *
+   *     Note: **an empty whitelist array will block all URLs**!
+   *
+   * @return {Array} the currently set whitelist array.
+   *
+   * The **default value** when no whitelist has been explicitly set is `['self']` allowing only
+   * same origin resource requests.
+   *
+   * @description
+   * Sets/Gets the whitelist of trusted resource URLs.
+   */
+  this.resourceUrlWhitelist = function(value) {
+    if (arguments.length) {
+      resourceUrlWhitelist = adjustMatchers(value);
+    }
+    return resourceUrlWhitelist;
+  };
+
+  /**
+   * @ngdoc method
+   * @name $sceDelegateProvider#resourceUrlBlacklist
+   * @kind function
+   *
+   * @param {Array=} blacklist When provided, replaces the resourceUrlBlacklist with the value
+   *     provided.  This must be an array or null.  A snapshot of this array is used so further
+   *     changes to the array are ignored.
+   *
+   *     Follow {@link ng.$sce#resourceUrlPatternItem this link} for a description of the items
+   *     allowed in this array.
+   *
+   *     The typical usage for the blacklist is to **block
+   *     [open redirects](http://cwe.mitre.org/data/definitions/601.html)** served by your domain as
+   *     these would otherwise be trusted but actually return content from the redirected domain.
+   *
+   *     Finally, **the blacklist overrides the whitelist** and has the final say.
+   *
+   * @return {Array} the currently set blacklist array.
+   *
+   * The **default value** when no whitelist has been explicitly set is the empty array (i.e. there
+   * is no blacklist.)
+   *
+   * @description
+   * Sets/Gets the blacklist of trusted resource URLs.
+   */
+
+  this.resourceUrlBlacklist = function(value) {
+    if (arguments.length) {
+      resourceUrlBlacklist = adjustMatchers(value);
+    }
+    return resourceUrlBlacklist;
+  };
+
+  this.$get = ['$injector', function($injector) {
+
+    var htmlSanitizer = function htmlSanitizer(html) {
+      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
+    };
+
+    if ($injector.has('$sanitize')) {
+      htmlSanitizer = $injector.get('$sanitize');
+    }
+
+
+    function matchUrl(matcher, parsedUrl) {
+      if (matcher === 'self') {
+        return urlIsSameOrigin(parsedUrl);
+      } else {
+        // definitely a regex.  See adjustMatchers()
+        return !!matcher.exec(parsedUrl.href);
+      }
+    }
+
+    function isResourceUrlAllowedByPolicy(url) {
+      var parsedUrl = urlResolve(url.toString());
+      var i, n, allowed = false;
+      // Ensure that at least one item from the whitelist allows this url.
+      for (i = 0, n = resourceUrlWhitelist.length; i < n; i++) {
+        if (matchUrl(resourceUrlWhitelist[i], parsedUrl)) {
+          allowed = true;
+          break;
+        }
+      }
+      if (allowed) {
+        // Ensure that no item from the blacklist blocked this url.
+        for (i = 0, n = resourceUrlBlacklist.length; i < n; i++) {
+          if (matchUrl(resourceUrlBlacklist[i], parsedUrl)) {
+            allowed = false;
+            break;
+          }
+        }
+      }
+      return allowed;
+    }
+
+    function generateHolderType(Base) {
+      var holderType = function TrustedValueHolderType(trustedValue) {
+        this.$$unwrapTrustedValue = function() {
+          return trustedValue;
+        };
+      };
+      if (Base) {
+        holderType.prototype = new Base();
+      }
+      holderType.prototype.valueOf = function sceValueOf() {
+        return this.$$unwrapTrustedValue();
+      };
+      holderType.prototype.toString = function sceToString() {
+        return this.$$unwrapTrustedValue().toString();
+      };
+      return holderType;
+    }
+
+    var trustedValueHolderBase = generateHolderType(),
+        byType = {};
+
+    byType[SCE_CONTEXTS.HTML] = generateHolderType(trustedValueHolderBase);
+    byType[SCE_CONTEXTS.CSS] = generateHolderType(trustedValueHolderBase);
+    byType[SCE_CONTEXTS.URL] = generateHolderType(trustedValueHolderBase);
+    byType[SCE_CONTEXTS.JS] = generateHolderType(trustedValueHolderBase);
+    byType[SCE_CONTEXTS.RESOURCE_URL] = generateHolderType(byType[SCE_CONTEXTS.URL]);
+
+    /**
+     * @ngdoc method
+     * @name $sceDelegate#trustAs
+     *
+     * @description
+     * Returns an object that is trusted by angular for use in specified strict
+     * contextual escaping contexts (such as ng-bind-html, ng-include, any src
+     * attribute interpolation, any dom event binding attribute interpolation
+     * such as for onclick,  etc.) that uses the provided value.
+     * See {@link ng.$sce $sce} for enabling strict contextual escaping.
+     *
+     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,
+     *   resourceUrl, html, js and css.
+     * @param {*} value The value that that should be considered trusted/safe.
+     * @returns {*} A value that can be used to stand in for the provided `value` in places
+     * where Angular expects a $sce.trustAs() return value.
+     */
+    function trustAs(type, trustedValue) {
+      var Constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
+      if (!Constructor) {
+        throw $sceMinErr('icontext',
+            'Attempted to trust a value in invalid context. Context: {0}; Value: {1}',
+            type, trustedValue);
+      }
+      if (trustedValue === null || isUndefined(trustedValue) || trustedValue === '') {
+        return trustedValue;
+      }
+      // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting
+      // mutable objects, we ensure here that the value passed in is actually a string.
+      if (typeof trustedValue !== 'string') {
+        throw $sceMinErr('itype',
+            'Attempted to trust a non-string value in a content requiring a string: Context: {0}',
+            type);
+      }
+      return new Constructor(trustedValue);
+    }
+
+    /**
+     * @ngdoc method
+     * @name $sceDelegate#valueOf
+     *
+     * @description
+     * If the passed parameter had been returned by a prior call to {@link ng.$sceDelegate#trustAs
+     * `$sceDelegate.trustAs`}, returns the value that had been passed to {@link
+     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.
+     *
+     * If the passed parameter is not a value that had been returned by {@link
+     * ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}, returns it as-is.
+     *
+     * @param {*} value The result of a prior {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}
+     *      call or anything else.
+     * @returns {*} The `value` that was originally provided to {@link ng.$sceDelegate#trustAs
+     *     `$sceDelegate.trustAs`} if `value` is the result of such a call.  Otherwise, returns
+     *     `value` unchanged.
+     */
+    function valueOf(maybeTrusted) {
+      if (maybeTrusted instanceof trustedValueHolderBase) {
+        return maybeTrusted.$$unwrapTrustedValue();
+      } else {
+        return maybeTrusted;
+      }
+    }
+
+    /**
+     * @ngdoc method
+     * @name $sceDelegate#getTrusted
+     *
+     * @description
+     * Takes the result of a {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`} call and
+     * returns the originally supplied value if the queried context type is a supertype of the
+     * created type.  If this condition isn't satisfied, throws an exception.
+     *
+     * @param {string} type The kind of context in which this value is to be used.
+     * @param {*} maybeTrusted The result of a prior {@link ng.$sceDelegate#trustAs
+     *     `$sceDelegate.trustAs`} call.
+     * @returns {*} The value the was originally provided to {@link ng.$sceDelegate#trustAs
+     *     `$sceDelegate.trustAs`} if valid in this context.  Otherwise, throws an exception.
+     */
+    function getTrusted(type, maybeTrusted) {
+      if (maybeTrusted === null || isUndefined(maybeTrusted) || maybeTrusted === '') {
+        return maybeTrusted;
+      }
+      var constructor = (byType.hasOwnProperty(type) ? byType[type] : null);
+      if (constructor && maybeTrusted instanceof constructor) {
+        return maybeTrusted.$$unwrapTrustedValue();
+      }
+      // If we get here, then we may only take one of two actions.
+      // 1. sanitize the value for the requested type, or
+      // 2. throw an exception.
+      if (type === SCE_CONTEXTS.RESOURCE_URL) {
+        if (isResourceUrlAllowedByPolicy(maybeTrusted)) {
+          return maybeTrusted;
+        } else {
+          throw $sceMinErr('insecurl',
+              'Blocked loading resource from url not allowed by $sceDelegate policy.  URL: {0}',
+              maybeTrusted.toString());
+        }
+      } else if (type === SCE_CONTEXTS.HTML) {
+        return htmlSanitizer(maybeTrusted);
+      }
+      throw $sceMinErr('unsafe', 'Attempting to use an unsafe value in a safe context.');
+    }
+
+    return { trustAs: trustAs,
+             getTrusted: getTrusted,
+             valueOf: valueOf };
+  }];
+}
+
+
+/**
+ * @ngdoc provider
+ * @name $sceProvider
+ * @description
+ *
+ * The $sceProvider provider allows developers to configure the {@link ng.$sce $sce} service.
+ * -   enable/disable Strict Contextual Escaping (SCE) in a module
+ * -   override the default implementation with a custom delegate
+ *
+ * Read more about {@link ng.$sce Strict Contextual Escaping (SCE)}.
+ */
+
+/* jshint maxlen: false*/
+
+/**
+ * @ngdoc service
+ * @name $sce
+ * @kind function
+ *
+ * @description
+ *
+ * `$sce` is a service that provides Strict Contextual Escaping services to AngularJS.
+ *
+ * # Strict Contextual Escaping
+ *
+ * Strict Contextual Escaping (SCE) is a mode in which AngularJS requires bindings in certain
+ * contexts to result in a value that is marked as safe to use for that context.  One example of
+ * such a context is binding arbitrary html controlled by the user via `ng-bind-html`.  We refer
+ * to these contexts as privileged or SCE contexts.
+ *
+ * As of version 1.2, Angular ships with SCE enabled by default.
+ *
+ * Note:  When enabled (the default), IE<11 in quirks mode is not supported.  In this mode, IE<11 allow
+ * one to execute arbitrary javascript by the use of the expression() syntax.  Refer
+ * <http://blogs.msdn.com/b/ie/archive/2008/10/16/ending-expressions.aspx> to learn more about them.
+ * You can ensure your document is in standards mode and not quirks mode by adding `<!doctype html>`
+ * to the top of your HTML document.
+ *
+ * SCE assists in writing code in way that (a) is secure by default and (b) makes auditing for
+ * security vulnerabilities such as XSS, clickjacking, etc. a lot easier.
+ *
+ * Here's an example of a binding in a privileged context:
+ *
+ * ```
+ * <input ng-model="userHtml" aria-label="User input">
+ * <div ng-bind-html="userHtml"></div>
+ * ```
+ *
+ * Notice that `ng-bind-html` is bound to `userHtml` controlled by the user.  With SCE
+ * disabled, this application allows the user to render arbitrary HTML into the DIV.
+ * In a more realistic example, one may be rendering user comments, blog articles, etc. via
+ * bindings.  (HTML is just one example of a context where rendering user controlled input creates
+ * security vulnerabilities.)
+ *
+ * For the case of HTML, you might use a library, either on the client side, or on the server side,
+ * to sanitize unsafe HTML before binding to the value and rendering it in the document.
+ *
+ * How would you ensure that every place that used these types of bindings was bound to a value that
+ * was sanitized by your library (or returned as safe for rendering by your server?)  How can you
+ * ensure that you didn't accidentally delete the line that sanitized the value, or renamed some
+ * properties/fields and forgot to update the binding to the sanitized value?
+ *
+ * To be secure by default, you want to ensure that any such bindings are disallowed unless you can
+ * determine that something explicitly says it's safe to use a value for binding in that
+ * context.  You can then audit your code (a simple grep would do) to ensure that this is only done
+ * for those values that you can easily tell are safe - because they were received from your server,
+ * sanitized by your library, etc.  You can organize your codebase to help with this - perhaps
+ * allowing only the files in a specific directory to do this.  Ensuring that the internal API
+ * exposed by that code doesn't markup arbitrary values as safe then becomes a more manageable task.
+ *
+ * In the case of AngularJS' SCE service, one uses {@link ng.$sce#trustAs $sce.trustAs}
+ * (and shorthand methods such as {@link ng.$sce#trustAsHtml $sce.trustAsHtml}, etc.) to
+ * obtain values that will be accepted by SCE / privileged contexts.
+ *
+ *
+ * ## How does it work?
+ *
+ * In privileged contexts, directives and code will bind to the result of {@link ng.$sce#getTrusted
+ * $sce.getTrusted(context, value)} rather than to the value directly.  Directives use {@link
+ * ng.$sce#parseAs $sce.parseAs} rather than `$parse` to watch attribute bindings, which performs the
+ * {@link ng.$sce#getTrusted $sce.getTrusted} behind the scenes on non-constant literals.
+ *
+ * As an example, {@link ng.directive:ngBindHtml ngBindHtml} uses {@link
+ * ng.$sce#parseAsHtml $sce.parseAsHtml(binding expression)}.  Here's the actual code (slightly
+ * simplified):
+ *
+ * ```
+ * var ngBindHtmlDirective = ['$sce', function($sce) {
+ *   return function(scope, element, attr) {
+ *     scope.$watch($sce.parseAsHtml(attr.ngBindHtml), function(value) {
+ *       element.html(value || '');
+ *     });
+ *   };
+ * }];
+ * ```
+ *
+ * ## Impact on loading templates
+ *
+ * This applies both to the {@link ng.directive:ngInclude `ng-include`} directive as well as
+ * `templateUrl`'s specified by {@link guide/directive directives}.
+ *
+ * By default, Angular only loads templates from the same domain and protocol as the application
+ * document.  This is done by calling {@link ng.$sce#getTrustedResourceUrl
+ * $sce.getTrustedResourceUrl} on the template URL.  To load templates from other domains and/or
+ * protocols, you may either either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist
+ * them} or {@link ng.$sce#trustAsResourceUrl wrap it} into a trusted value.
+ *
+ * *Please note*:
+ * The browser's
+ * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
+ * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
+ * policy apply in addition to this and may further restrict whether the template is successfully
+ * loaded.  This means that without the right CORS policy, loading templates from a different domain
+ * won't work on all browsers.  Also, loading templates from `file://` URL does not work on some
+ * browsers.
+ *
+ * ## This feels like too much overhead
+ *
+ * It's important to remember that SCE only applies to interpolation expressions.
+ *
+ * If your expressions are constant literals, they're automatically trusted and you don't need to
+ * call `$sce.trustAs` on them (remember to include the `ngSanitize` module) (e.g.
+ * `<div ng-bind-html="'<b>implicitly trusted</b>'"></div>`) just works.
+ *
+ * Additionally, `a[href]` and `img[src]` automatically sanitize their URLs and do not pass them
+ * through {@link ng.$sce#getTrusted $sce.getTrusted}.  SCE doesn't play a role here.
+ *
+ * The included {@link ng.$sceDelegate $sceDelegate} comes with sane defaults to allow you to load
+ * templates in `ng-include` from your application's domain without having to even know about SCE.
+ * It blocks loading templates from other domains or loading templates over http from an https
+ * served document.  You can change these by setting your own custom {@link
+ * ng.$sceDelegateProvider#resourceUrlWhitelist whitelists} and {@link
+ * ng.$sceDelegateProvider#resourceUrlBlacklist blacklists} for matching such URLs.
+ *
+ * This significantly reduces the overhead.  It is far easier to pay the small overhead and have an
+ * application that's secure and can be audited to verify that with much more ease than bolting
+ * security onto an application later.
+ *
+ * <a name="contexts"></a>
+ * ## What trusted context types are supported?
+ *
+ * | Context             | Notes          |
+ * |---------------------|----------------|
+ * | `$sce.HTML`         | For HTML that's safe to source into the application.  The {@link ng.directive:ngBindHtml ngBindHtml} directive uses this context for bindings. If an unsafe value is encountered and the {@link ngSanitize $sanitize} module is present this will sanitize the value instead of throwing an error. |
+ * | `$sce.CSS`          | For CSS that's safe to source into the application.  Currently unused.  Feel free to use it in your own directives. |
+ * | `$sce.URL`          | For URLs that are safe to follow as links.  Currently unused (`<a href=` and `<img src=` sanitize their urls and don't constitute an SCE context. |
+ * | `$sce.RESOURCE_URL` | For URLs that are not only safe to follow as links, but whose contents are also safe to include in your application.  Examples include `ng-include`, `src` / `ngSrc` bindings for tags other than `IMG` (e.g. `IFRAME`, `OBJECT`, etc.)  <br><br>Note that `$sce.RESOURCE_URL` makes a stronger statement about the URL than `$sce.URL` does and therefore contexts requiring values trusted for `$sce.RESOURCE_URL` can be used anywhere that values trusted for `$sce.URL` are required. |
+ * | `$sce.JS`           | For JavaScript that is safe to execute in your application's context.  Currently unused.  Feel free to use it in your own directives. |
+ *
+ * ## Format of items in {@link ng.$sceDelegateProvider#resourceUrlWhitelist resourceUrlWhitelist}/{@link ng.$sceDelegateProvider#resourceUrlBlacklist Blacklist} <a name="resourceUrlPatternItem"></a>
+ *
+ *  Each element in these arrays must be one of the following:
+ *
+ *  - **'self'**
+ *    - The special **string**, `'self'`, can be used to match against all URLs of the **same
+ *      domain** as the application document using the **same protocol**.
+ *  - **String** (except the special value `'self'`)
+ *    - The string is matched against the full *normalized / absolute URL* of the resource
+ *      being tested (substring matches are not good enough.)
+ *    - There are exactly **two wildcard sequences** - `*` and `**`.  All other characters
+ *      match themselves.
+ *    - `*`: matches zero or more occurrences of any character other than one of the following 6
+ *      characters: '`:`', '`/`', '`.`', '`?`', '`&`' and '`;`'.  It's a useful wildcard for use
+ *      in a whitelist.
+ *    - `**`: matches zero or more occurrences of *any* character.  As such, it's not
+ *      appropriate for use in a scheme, domain, etc. as it would match too much.  (e.g.
+ *      http://**.example.com/ would match http://evil.com/?ignore=.example.com/ and that might
+ *      not have been the intention.)  Its usage at the very end of the path is ok.  (e.g.
+ *      http://foo.example.com/templates/**).
+ *  - **RegExp** (*see caveat below*)
+ *    - *Caveat*:  While regular expressions are powerful and offer great flexibility,  their syntax
+ *      (and all the inevitable escaping) makes them *harder to maintain*.  It's easy to
+ *      accidentally introduce a bug when one updates a complex expression (imho, all regexes should
+ *      have good test coverage).  For instance, the use of `.` in the regex is correct only in a
+ *      small number of cases.  A `.` character in the regex used when matching the scheme or a
+ *      subdomain could be matched against a `:` or literal `.` that was likely not intended.   It
+ *      is highly recommended to use the string patterns and only fall back to regular expressions
+ *      as a last resort.
+ *    - The regular expression must be an instance of RegExp (i.e. not a string.)  It is
+ *      matched against the **entire** *normalized / absolute URL* of the resource being tested
+ *      (even when the RegExp did not have the `^` and `$` codes.)  In addition, any flags
+ *      present on the RegExp (such as multiline, global, ignoreCase) are ignored.
+ *    - If you are generating your JavaScript from some other templating engine (not
+ *      recommended, e.g. in issue [#4006](https://github.com/angular/angular.js/issues/4006)),
+ *      remember to escape your regular expression (and be aware that you might need more than
+ *      one level of escaping depending on your templating engine and the way you interpolated
+ *      the value.)  Do make use of your platform's escaping mechanism as it might be good
+ *      enough before coding your own.  E.g. Ruby has
+ *      [Regexp.escape(str)](http://www.ruby-doc.org/core-2.0.0/Regexp.html#method-c-escape)
+ *      and Python has [re.escape](http://docs.python.org/library/re.html#re.escape).
+ *      Javascript lacks a similar built in function for escaping.  Take a look at Google
+ *      Closure library's [goog.string.regExpEscape(s)](
+ *      http://docs.closure-library.googlecode.com/git/closure_goog_string_string.js.source.html#line962).
+ *
+ * Refer {@link ng.$sceDelegateProvider $sceDelegateProvider} for an example.
+ *
+ * ## Show me an example using SCE.
+ *
+ * <example module="mySceApp" deps="angular-sanitize.js">
+ * <file name="index.html">
+ *   <div ng-controller="AppController as myCtrl">
+ *     <i ng-bind-html="myCtrl.explicitlyTrustedHtml" id="explicitlyTrustedHtml"></i><br><br>
+ *     <b>User comments</b><br>
+ *     By default, HTML that isn't explicitly trusted (e.g. Alice's comment) is sanitized when
+ *     $sanitize is available.  If $sanitize isn't available, this results in an error instead of an
+ *     exploit.
+ *     <div class="well">
+ *       <div ng-repeat="userComment in myCtrl.userComments">
+ *         <b>{{userComment.name}}</b>:
+ *         <span ng-bind-html="userComment.htmlComment" class="htmlComment"></span>
+ *         <br>
+ *       </div>
+ *     </div>
+ *   </div>
+ * </file>
+ *
+ * <file name="script.js">
+ *   angular.module('mySceApp', ['ngSanitize'])
+ *     .controller('AppController', ['$http', '$templateCache', '$sce',
+ *       function($http, $templateCache, $sce) {
+ *         var self = this;
+ *         $http.get("test_data.json", {cache: $templateCache}).success(function(userComments) {
+ *           self.userComments = userComments;
+ *         });
+ *         self.explicitlyTrustedHtml = $sce.trustAsHtml(
+ *             '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
+ *             'sanitization.&quot;">Hover over this text.</span>');
+ *       }]);
+ * </file>
+ *
+ * <file name="test_data.json">
+ * [
+ *   { "name": "Alice",
+ *     "htmlComment":
+ *         "<span onmouseover='this.textContent=\"PWN3D!\"'>Is <i>anyone</i> reading this?</span>"
+ *   },
+ *   { "name": "Bob",
+ *     "htmlComment": "<i>Yes!</i>  Am I the only other one?"
+ *   }
+ * ]
+ * </file>
+ *
+ * <file name="protractor.js" type="protractor">
+ *   describe('SCE doc demo', function() {
+ *     it('should sanitize untrusted values', function() {
+ *       expect(element.all(by.css('.htmlComment')).first().getInnerHtml())
+ *           .toBe('<span>Is <i>anyone</i> reading this?</span>');
+ *     });
+ *
+ *     it('should NOT sanitize explicitly trusted values', function() {
+ *       expect(element(by.id('explicitlyTrustedHtml')).getInnerHtml()).toBe(
+ *           '<span onmouseover="this.textContent=&quot;Explicitly trusted HTML bypasses ' +
+ *           'sanitization.&quot;">Hover over this text.</span>');
+ *     });
+ *   });
+ * </file>
+ * </example>
+ *
+ *
+ *
+ * ## Can I disable SCE completely?
+ *
+ * Yes, you can.  However, this is strongly discouraged.  SCE gives you a lot of security benefits
+ * for little coding overhead.  It will be much harder to take an SCE disabled application and
+ * either secure it on your own or enable SCE at a later stage.  It might make sense to disable SCE
+ * for cases where you have a lot of existing code that was written before SCE was introduced and
+ * you're migrating them a module at a time.
+ *
+ * That said, here's how you can completely disable SCE:
+ *
+ * ```
+ * angular.module('myAppWithSceDisabledmyApp', []).config(function($sceProvider) {
+ *   // Completely disable SCE.  For demonstration purposes only!
+ *   // Do not use in new projects.
+ *   $sceProvider.enabled(false);
+ * });
+ * ```
+ *
+ */
+/* jshint maxlen: 100 */
+
+function $SceProvider() {
+  var enabled = true;
+
+  /**
+   * @ngdoc method
+   * @name $sceProvider#enabled
+   * @kind function
+   *
+   * @param {boolean=} value If provided, then enables/disables SCE.
+   * @return {boolean} true if SCE is enabled, false otherwise.
+   *
+   * @description
+   * Enables/disables SCE and returns the current value.
+   */
+  this.enabled = function(value) {
+    if (arguments.length) {
+      enabled = !!value;
+    }
+    return enabled;
+  };
+
+
+  /* Design notes on the default implementation for SCE.
+   *
+   * The API contract for the SCE delegate
+   * -------------------------------------
+   * The SCE delegate object must provide the following 3 methods:
+   *
+   * - trustAs(contextEnum, value)
+   *     This method is used to tell the SCE service that the provided value is OK to use in the
+   *     contexts specified by contextEnum.  It must return an object that will be accepted by
+   *     getTrusted() for a compatible contextEnum and return this value.
+   *
+   * - valueOf(value)
+   *     For values that were not produced by trustAs(), return them as is.  For values that were
+   *     produced by trustAs(), return the corresponding input value to trustAs.  Basically, if
+   *     trustAs is wrapping the given values into some type, this operation unwraps it when given
+   *     such a value.
+   *
+   * - getTrusted(contextEnum, value)
+   *     This function should return the a value that is safe to use in the context specified by
+   *     contextEnum or throw and exception otherwise.
+   *
+   * NOTE: This contract deliberately does NOT state that values returned by trustAs() must be
+   * opaque or wrapped in some holder object.  That happens to be an implementation detail.  For
+   * instance, an implementation could maintain a registry of all trusted objects by context.  In
+   * such a case, trustAs() would return the same object that was passed in.  getTrusted() would
+   * return the same object passed in if it was found in the registry under a compatible context or
+   * throw an exception otherwise.  An implementation might only wrap values some of the time based
+   * on some criteria.  getTrusted() might return a value and not throw an exception for special
+   * constants or objects even if not wrapped.  All such implementations fulfill this contract.
+   *
+   *
+   * A note on the inheritance model for SCE contexts
+   * ------------------------------------------------
+   * I've used inheritance and made RESOURCE_URL wrapped types a subtype of URL wrapped types.  This
+   * is purely an implementation details.
+   *
+   * The contract is simply this:
+   *
+   *     getTrusted($sce.RESOURCE_URL, value) succeeding implies that getTrusted($sce.URL, value)
+   *     will also succeed.
+   *
+   * Inheritance happens to capture this in a natural way.  In some future, we
+   * may not use inheritance anymore.  That is OK because no code outside of
+   * sce.js and sceSpecs.js would need to be aware of this detail.
+   */
+
+  this.$get = ['$parse', '$sceDelegate', function(
+                $parse,   $sceDelegate) {
+    // Prereq: Ensure that we're not running in IE<11 quirks mode.  In that mode, IE < 11 allow
+    // the "expression(javascript expression)" syntax which is insecure.
+    if (enabled && msie < 8) {
+      throw $sceMinErr('iequirks',
+        'Strict Contextual Escaping does not support Internet Explorer version < 11 in quirks ' +
+        'mode.  You can fix this by adding the text <!doctype html> to the top of your HTML ' +
+        'document.  See http://docs.angularjs.org/api/ng.$sce for more information.');
+    }
+
+    var sce = shallowCopy(SCE_CONTEXTS);
+
+    /**
+     * @ngdoc method
+     * @name $sce#isEnabled
+     * @kind function
+     *
+     * @return {Boolean} true if SCE is enabled, false otherwise.  If you want to set the value, you
+     * have to do it at module config time on {@link ng.$sceProvider $sceProvider}.
+     *
+     * @description
+     * Returns a boolean indicating if SCE is enabled.
+     */
+    sce.isEnabled = function() {
+      return enabled;
+    };
+    sce.trustAs = $sceDelegate.trustAs;
+    sce.getTrusted = $sceDelegate.getTrusted;
+    sce.valueOf = $sceDelegate.valueOf;
+
+    if (!enabled) {
+      sce.trustAs = sce.getTrusted = function(type, value) { return value; };
+      sce.valueOf = identity;
+    }
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAs
+     *
+     * @description
+     * Converts Angular {@link guide/expression expression} into a function.  This is like {@link
+     * ng.$parse $parse} and is identical when the expression is a literal constant.  Otherwise, it
+     * wraps the expression in a call to {@link ng.$sce#getTrusted $sce.getTrusted(*type*,
+     * *result*)}
+     *
+     * @param {string} type The kind of SCE context in which this result will be used.
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+    sce.parseAs = function sceParseAs(type, expr) {
+      var parsed = $parse(expr);
+      if (parsed.literal && parsed.constant) {
+        return parsed;
+      } else {
+        return $parse(expr, function(value) {
+          return sce.getTrusted(type, value);
+        });
+      }
+    };
+
+    /**
+     * @ngdoc method
+     * @name $sce#trustAs
+     *
+     * @description
+     * Delegates to {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs`}.  As such,
+     * returns an object that is trusted by angular for use in specified strict contextual
+     * escaping contexts (such as ng-bind-html, ng-include, any src attribute
+     * interpolation, any dom event binding attribute interpolation such as for onclick,  etc.)
+     * that uses the provided value.  See * {@link ng.$sce $sce} for enabling strict contextual
+     * escaping.
+     *
+     * @param {string} type The kind of context in which this value is safe for use.  e.g. url,
+     *   resourceUrl, html, js and css.
+     * @param {*} value The value that that should be considered trusted/safe.
+     * @returns {*} A value that can be used to stand in for the provided `value` in places
+     * where Angular expects a $sce.trustAs() return value.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#trustAsHtml
+     *
+     * @description
+     * Shorthand method.  `$sce.trustAsHtml(value)` →
+     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.HTML, value)`}
+     *
+     * @param {*} value The value to trustAs.
+     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedHtml
+     *     $sce.getTrustedHtml(value)} to obtain the original value.  (privileged directives
+     *     only accept expressions that are either literal constants or are the
+     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#trustAsUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.trustAsUrl(value)` →
+     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.URL, value)`}
+     *
+     * @param {*} value The value to trustAs.
+     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedUrl
+     *     $sce.getTrustedUrl(value)} to obtain the original value.  (privileged directives
+     *     only accept expressions that are either literal constants or are the
+     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#trustAsResourceUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.trustAsResourceUrl(value)` →
+     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.RESOURCE_URL, value)`}
+     *
+     * @param {*} value The value to trustAs.
+     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedResourceUrl
+     *     $sce.getTrustedResourceUrl(value)} to obtain the original value.  (privileged directives
+     *     only accept expressions that are either literal constants or are the return
+     *     value of {@link ng.$sce#trustAs $sce.trustAs}.)
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#trustAsJs
+     *
+     * @description
+     * Shorthand method.  `$sce.trustAsJs(value)` →
+     *     {@link ng.$sceDelegate#trustAs `$sceDelegate.trustAs($sce.JS, value)`}
+     *
+     * @param {*} value The value to trustAs.
+     * @returns {*} An object that can be passed to {@link ng.$sce#getTrustedJs
+     *     $sce.getTrustedJs(value)} to obtain the original value.  (privileged directives
+     *     only accept expressions that are either literal constants or are the
+     *     return value of {@link ng.$sce#trustAs $sce.trustAs}.)
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrusted
+     *
+     * @description
+     * Delegates to {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted`}.  As such,
+     * takes the result of a {@link ng.$sce#trustAs `$sce.trustAs`}() call and returns the
+     * originally supplied value if the queried context type is a supertype of the created type.
+     * If this condition isn't satisfied, throws an exception.
+     *
+     * @param {string} type The kind of context in which this value is to be used.
+     * @param {*} maybeTrusted The result of a prior {@link ng.$sce#trustAs `$sce.trustAs`}
+     *                         call.
+     * @returns {*} The value the was originally provided to
+     *              {@link ng.$sce#trustAs `$sce.trustAs`} if valid in this context.
+     *              Otherwise, throws an exception.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrustedHtml
+     *
+     * @description
+     * Shorthand method.  `$sce.getTrustedHtml(value)` →
+     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.HTML, value)`}
+     *
+     * @param {*} value The value to pass to `$sce.getTrusted`.
+     * @returns {*} The return value of `$sce.getTrusted($sce.HTML, value)`
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrustedCss
+     *
+     * @description
+     * Shorthand method.  `$sce.getTrustedCss(value)` →
+     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.CSS, value)`}
+     *
+     * @param {*} value The value to pass to `$sce.getTrusted`.
+     * @returns {*} The return value of `$sce.getTrusted($sce.CSS, value)`
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrustedUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.getTrustedUrl(value)` →
+     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.URL, value)`}
+     *
+     * @param {*} value The value to pass to `$sce.getTrusted`.
+     * @returns {*} The return value of `$sce.getTrusted($sce.URL, value)`
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrustedResourceUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.getTrustedResourceUrl(value)` →
+     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.RESOURCE_URL, value)`}
+     *
+     * @param {*} value The value to pass to `$sceDelegate.getTrusted`.
+     * @returns {*} The return value of `$sce.getTrusted($sce.RESOURCE_URL, value)`
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#getTrustedJs
+     *
+     * @description
+     * Shorthand method.  `$sce.getTrustedJs(value)` →
+     *     {@link ng.$sceDelegate#getTrusted `$sceDelegate.getTrusted($sce.JS, value)`}
+     *
+     * @param {*} value The value to pass to `$sce.getTrusted`.
+     * @returns {*} The return value of `$sce.getTrusted($sce.JS, value)`
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAsHtml
+     *
+     * @description
+     * Shorthand method.  `$sce.parseAsHtml(expression string)` →
+     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.HTML, value)`}
+     *
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAsCss
+     *
+     * @description
+     * Shorthand method.  `$sce.parseAsCss(value)` →
+     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.CSS, value)`}
+     *
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAsUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.parseAsUrl(value)` →
+     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.URL, value)`}
+     *
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAsResourceUrl
+     *
+     * @description
+     * Shorthand method.  `$sce.parseAsResourceUrl(value)` →
+     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.RESOURCE_URL, value)`}
+     *
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+
+    /**
+     * @ngdoc method
+     * @name $sce#parseAsJs
+     *
+     * @description
+     * Shorthand method.  `$sce.parseAsJs(value)` →
+     *     {@link ng.$sce#parseAs `$sce.parseAs($sce.JS, value)`}
+     *
+     * @param {string} expression String expression to compile.
+     * @returns {function(context, locals)} a function which represents the compiled expression:
+     *
+     *    * `context` – `{object}` – an object against which any expressions embedded in the strings
+     *      are evaluated against (typically a scope object).
+     *    * `locals` – `{object=}` – local variables context object, useful for overriding values in
+     *      `context`.
+     */
+
+    // Shorthand delegations.
+    var parse = sce.parseAs,
+        getTrusted = sce.getTrusted,
+        trustAs = sce.trustAs;
+
+    forEach(SCE_CONTEXTS, function(enumValue, name) {
+      var lName = lowercase(name);
+      sce[camelCase("parse_as_" + lName)] = function(expr) {
+        return parse(enumValue, expr);
+      };
+      sce[camelCase("get_trusted_" + lName)] = function(value) {
+        return getTrusted(enumValue, value);
+      };
+      sce[camelCase("trust_as_" + lName)] = function(value) {
+        return trustAs(enumValue, value);
+      };
+    });
+
+    return sce;
+  }];
+}
+
+/**
+ * !!! This is an undocumented "private" service !!!
+ *
+ * @name $sniffer
+ * @requires $window
+ * @requires $document
+ *
+ * @property {boolean} history Does the browser support html5 history api ?
+ * @property {boolean} transitions Does the browser support CSS transition events ?
+ * @property {boolean} animations Does the browser support CSS animation events ?
+ *
+ * @description
+ * This is very simple implementation of testing browser's features.
+ */
+function $SnifferProvider() {
+  this.$get = ['$window', '$document', function($window, $document) {
+    var eventSupport = {},
+        android =
+          toInt((/android (\d+)/.exec(lowercase(($window.navigator || {}).userAgent)) || [])[1]),
+        boxee = /Boxee/i.test(($window.navigator || {}).userAgent),
+        document = $document[0] || {},
+        vendorPrefix,
+        vendorRegex = /^(Moz|webkit|ms)(?=[A-Z])/,
+        bodyStyle = document.body && document.body.style,
+        transitions = false,
+        animations = false,
+        match;
+
+    if (bodyStyle) {
+      for (var prop in bodyStyle) {
+        if (match = vendorRegex.exec(prop)) {
+          vendorPrefix = match[0];
+          vendorPrefix = vendorPrefix.substr(0, 1).toUpperCase() + vendorPrefix.substr(1);
+          break;
+        }
+      }
+
+      if (!vendorPrefix) {
+        vendorPrefix = ('WebkitOpacity' in bodyStyle) && 'webkit';
+      }
+
+      transitions = !!(('transition' in bodyStyle) || (vendorPrefix + 'Transition' in bodyStyle));
+      animations  = !!(('animation' in bodyStyle) || (vendorPrefix + 'Animation' in bodyStyle));
+
+      if (android && (!transitions ||  !animations)) {
+        transitions = isString(bodyStyle.webkitTransition);
+        animations = isString(bodyStyle.webkitAnimation);
+      }
+    }
+
+
+    return {
+      // Android has history.pushState, but it does not update location correctly
+      // so let's not use the history API at all.
+      // http://code.google.com/p/android/issues/detail?id=17471
+      // https://github.com/angular/angular.js/issues/904
+
+      // older webkit browser (533.9) on Boxee box has exactly the same problem as Android has
+      // so let's not use the history API also
+      // We are purposefully using `!(android < 4)` to cover the case when `android` is undefined
+      // jshint -W018
+      history: !!($window.history && $window.history.pushState && !(android < 4) && !boxee),
+      // jshint +W018
+      hasEvent: function(event) {
+        // IE9 implements 'input' event it's so fubared that we rather pretend that it doesn't have
+        // it. In particular the event is not fired when backspace or delete key are pressed or
+        // when cut operation is performed.
+        // IE10+ implements 'input' event but it erroneously fires under various situations,
+        // e.g. when placeholder changes, or a form is focused.
+        if (event === 'input' && msie <= 11) return false;
+
+        if (isUndefined(eventSupport[event])) {
+          var divElm = document.createElement('div');
+          eventSupport[event] = 'on' + event in divElm;
+        }
+
+        return eventSupport[event];
+      },
+      csp: csp(),
+      vendorPrefix: vendorPrefix,
+      transitions: transitions,
+      animations: animations,
+      android: android
+    };
+  }];
+}
+
+var $compileMinErr = minErr('$compile');
+
+/**
+ * @ngdoc service
+ * @name $templateRequest
+ *
+ * @description
+ * The `$templateRequest` service runs security checks then downloads the provided template using
+ * `$http` and, upon success, stores the contents inside of `$templateCache`. If the HTTP request
+ * fails or the response data of the HTTP request is empty, a `$compile` error will be thrown (the
+ * exception can be thwarted by setting the 2nd parameter of the function to true). Note that the
+ * contents of `$templateCache` are trusted, so the call to `$sce.getTrustedUrl(tpl)` is omitted
+ * when `tpl` is of type string and `$templateCache` has the matching entry.
+ *
+ * @param {string|TrustedResourceUrl} tpl The HTTP request template URL
+ * @param {boolean=} ignoreRequestError Whether or not to ignore the exception when the request fails or the template is empty
+ *
+ * @return {Promise} a promise for the HTTP response data of the given URL.
+ *
+ * @property {number} totalPendingRequests total amount of pending template requests being downloaded.
+ */
+function $TemplateRequestProvider() {
+  this.$get = ['$templateCache', '$http', '$q', '$sce', function($templateCache, $http, $q, $sce) {
+    function handleRequestFn(tpl, ignoreRequestError) {
+      handleRequestFn.totalPendingRequests++;
+
+      // We consider the template cache holds only trusted templates, so
+      // there's no need to go through whitelisting again for keys that already
+      // are included in there. This also makes Angular accept any script
+      // directive, no matter its name. However, we still need to unwrap trusted
+      // types.
+      if (!isString(tpl) || !$templateCache.get(tpl)) {
+        tpl = $sce.getTrustedResourceUrl(tpl);
+      }
+
+      var transformResponse = $http.defaults && $http.defaults.transformResponse;
+
+      if (isArray(transformResponse)) {
+        transformResponse = transformResponse.filter(function(transformer) {
+          return transformer !== defaultHttpResponseTransform;
+        });
+      } else if (transformResponse === defaultHttpResponseTransform) {
+        transformResponse = null;
+      }
+
+      var httpOptions = {
+        cache: $templateCache,
+        transformResponse: transformResponse
+      };
+
+      return $http.get(tpl, httpOptions)
+        ['finally'](function() {
+          handleRequestFn.totalPendingRequests--;
+        })
+        .then(function(response) {
+          $templateCache.put(tpl, response.data);
+          return response.data;
+        }, handleError);
+
+      function handleError(resp) {
+        if (!ignoreRequestError) {
+          throw $compileMinErr('tpload', 'Failed to load template: {0} (HTTP status: {1} {2})',
+            tpl, resp.status, resp.statusText);
+        }
+        return $q.reject(resp);
+      }
+    }
+
+    handleRequestFn.totalPendingRequests = 0;
+
+    return handleRequestFn;
+  }];
+}
+
+function $$TestabilityProvider() {
+  this.$get = ['$rootScope', '$browser', '$location',
+       function($rootScope,   $browser,   $location) {
+
+    /**
+     * @name $testability
+     *
+     * @description
+     * The private $$testability service provides a collection of methods for use when debugging
+     * or by automated test and debugging tools.
+     */
+    var testability = {};
+
+    /**
+     * @name $$testability#findBindings
+     *
+     * @description
+     * Returns an array of elements that are bound (via ng-bind or {{}})
+     * to expressions matching the input.
+     *
+     * @param {Element} element The element root to search from.
+     * @param {string} expression The binding expression to match.
+     * @param {boolean} opt_exactMatch If true, only returns exact matches
+     *     for the expression. Filters and whitespace are ignored.
+     */
+    testability.findBindings = function(element, expression, opt_exactMatch) {
+      var bindings = element.getElementsByClassName('ng-binding');
+      var matches = [];
+      forEach(bindings, function(binding) {
+        var dataBinding = angular.element(binding).data('$binding');
+        if (dataBinding) {
+          forEach(dataBinding, function(bindingName) {
+            if (opt_exactMatch) {
+              var matcher = new RegExp('(^|\\s)' + escapeForRegexp(expression) + '(\\s|\\||$)');
+              if (matcher.test(bindingName)) {
+                matches.push(binding);
+              }
+            } else {
+              if (bindingName.indexOf(expression) != -1) {
+                matches.push(binding);
+              }
+            }
+          });
+        }
+      });
+      return matches;
+    };
+
+    /**
+     * @name $$testability#findModels
+     *
+     * @description
+     * Returns an array of elements that are two-way found via ng-model to
+     * expressions matching the input.
+     *
+     * @param {Element} element The element root to search from.
+     * @param {string} expression The model expression to match.
+     * @param {boolean} opt_exactMatch If true, only returns exact matches
+     *     for the expression.
+     */
+    testability.findModels = function(element, expression, opt_exactMatch) {
+      var prefixes = ['ng-', 'data-ng-', 'ng\\:'];
+      for (var p = 0; p < prefixes.length; ++p) {
+        var attributeEquals = opt_exactMatch ? '=' : '*=';
+        var selector = '[' + prefixes[p] + 'model' + attributeEquals + '"' + expression + '"]';
+        var elements = element.querySelectorAll(selector);
+        if (elements.length) {
+          return elements;
+        }
+      }
+    };
+
+    /**
+     * @name $$testability#getLocation
+     *
+     * @description
+     * Shortcut for getting the location in a browser agnostic way. Returns
+     *     the path, search, and hash. (e.g. /path?a=b#hash)
+     */
+    testability.getLocation = function() {
+      return $location.url();
+    };
+
+    /**
+     * @name $$testability#setLocation
+     *
+     * @description
+     * Shortcut for navigating to a location without doing a full page reload.
+     *
+     * @param {string} url The location url (path, search and hash,
+     *     e.g. /path?a=b#hash) to go to.
+     */
+    testability.setLocation = function(url) {
+      if (url !== $location.url()) {
+        $location.url(url);
+        $rootScope.$digest();
+      }
+    };
+
+    /**
+     * @name $$testability#whenStable
+     *
+     * @description
+     * Calls the callback when $timeout and $http requests are completed.
+     *
+     * @param {function} callback
+     */
+    testability.whenStable = function(callback) {
+      $browser.notifyWhenNoOutstandingRequests(callback);
+    };
+
+    return testability;
+  }];
+}
+
+function $TimeoutProvider() {
+  this.$get = ['$rootScope', '$browser', '$q', '$$q', '$exceptionHandler',
+       function($rootScope,   $browser,   $q,   $$q,   $exceptionHandler) {
+
+    var deferreds = {};
+
+
+     /**
+      * @ngdoc service
+      * @name $timeout
+      *
+      * @description
+      * Angular's wrapper for `window.setTimeout`. The `fn` function is wrapped into a try/catch
+      * block and delegates any exceptions to
+      * {@link ng.$exceptionHandler $exceptionHandler} service.
+      *
+      * The return value of calling `$timeout` is a promise, which will be resolved when
+      * the delay has passed and the timeout function, if provided, is executed.
+      *
+      * To cancel a timeout request, call `$timeout.cancel(promise)`.
+      *
+      * In tests you can use {@link ngMock.$timeout `$timeout.flush()`} to
+      * synchronously flush the queue of deferred functions.
+      *
+      * If you only want a promise that will be resolved after some specified delay
+      * then you can call `$timeout` without the `fn` function.
+      *
+      * @param {function()=} fn A function, whose execution should be delayed.
+      * @param {number=} [delay=0] Delay in milliseconds.
+      * @param {boolean=} [invokeApply=true] If set to `false` skips model dirty checking, otherwise
+      *   will invoke `fn` within the {@link ng.$rootScope.Scope#$apply $apply} block.
+      * @param {...*=} Pass additional parameters to the executed function.
+      * @returns {Promise} Promise that will be resolved when the timeout is reached. The value this
+      *   promise will be resolved with is the return value of the `fn` function.
+      *
+      */
+    function timeout(fn, delay, invokeApply) {
+      if (!isFunction(fn)) {
+        invokeApply = delay;
+        delay = fn;
+        fn = noop;
+      }
+
+      var args = sliceArgs(arguments, 3),
+          skipApply = (isDefined(invokeApply) && !invokeApply),
+          deferred = (skipApply ? $$q : $q).defer(),
+          promise = deferred.promise,
+          timeoutId;
+
+      timeoutId = $browser.defer(function() {
+        try {
+          deferred.resolve(fn.apply(null, args));
+        } catch (e) {
+          deferred.reject(e);
+          $exceptionHandler(e);
+        }
+        finally {
+          delete deferreds[promise.$$timeoutId];
+        }
+
+        if (!skipApply) $rootScope.$apply();
+      }, delay);
+
+      promise.$$timeoutId = timeoutId;
+      deferreds[timeoutId] = deferred;
+
+      return promise;
+    }
+
+
+     /**
+      * @ngdoc method
+      * @name $timeout#cancel
+      *
+      * @description
+      * Cancels a task associated with the `promise`. As a result of this, the promise will be
+      * resolved with a rejection.
+      *
+      * @param {Promise=} promise Promise returned by the `$timeout` function.
+      * @returns {boolean} Returns `true` if the task hasn't executed yet and was successfully
+      *   canceled.
+      */
+    timeout.cancel = function(promise) {
+      if (promise && promise.$$timeoutId in deferreds) {
+        deferreds[promise.$$timeoutId].reject('canceled');
+        delete deferreds[promise.$$timeoutId];
+        return $browser.defer.cancel(promise.$$timeoutId);
+      }
+      return false;
+    };
+
+    return timeout;
+  }];
+}
+
+// NOTE:  The usage of window and document instead of $window and $document here is
+// deliberate.  This service depends on the specific behavior of anchor nodes created by the
+// browser (resolving and parsing URLs) that is unlikely to be provided by mock objects and
+// cause us to break tests.  In addition, when the browser resolves a URL for XHR, it
+// doesn't know about mocked locations and resolves URLs to the real document - which is
+// exactly the behavior needed here.  There is little value is mocking these out for this
+// service.
+var urlParsingNode = document.createElement("a");
+var originUrl = urlResolve(window.location.href);
+
+
+/**
+ *
+ * Implementation Notes for non-IE browsers
+ * ----------------------------------------
+ * Assigning a URL to the href property of an anchor DOM node, even one attached to the DOM,
+ * results both in the normalizing and parsing of the URL.  Normalizing means that a relative
+ * URL will be resolved into an absolute URL in the context of the application document.
+ * Parsing means that the anchor node's host, hostname, protocol, port, pathname and related
+ * properties are all populated to reflect the normalized URL.  This approach has wide
+ * compatibility - Safari 1+, Mozilla 1+, Opera 7+,e etc.  See
+ * http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
+ *
+ * Implementation Notes for IE
+ * ---------------------------
+ * IE <= 10 normalizes the URL when assigned to the anchor node similar to the other
+ * browsers.  However, the parsed components will not be set if the URL assigned did not specify
+ * them.  (e.g. if you assign a.href = "foo", then a.protocol, a.host, etc. will be empty.)  We
+ * work around that by performing the parsing in a 2nd step by taking a previously normalized
+ * URL (e.g. by assigning to a.href) and assigning it a.href again.  This correctly populates the
+ * properties such as protocol, hostname, port, etc.
+ *
+ * References:
+ *   http://developer.mozilla.org/en-US/docs/Web/API/HTMLAnchorElement
+ *   http://www.aptana.com/reference/html/api/HTMLAnchorElement.html
+ *   http://url.spec.whatwg.org/#urlutils
+ *   https://github.com/angular/angular.js/pull/2902
+ *   http://james.padolsey.com/javascript/parsing-urls-with-the-dom/
+ *
+ * @kind function
+ * @param {string} url The URL to be parsed.
+ * @description Normalizes and parses a URL.
+ * @returns {object} Returns the normalized URL as a dictionary.
+ *
+ *   | member name   | Description    |
+ *   |---------------|----------------|
+ *   | href          | A normalized version of the provided URL if it was not an absolute URL |
+ *   | protocol      | The protocol including the trailing colon                              |
+ *   | host          | The host and port (if the port is non-default) of the normalizedUrl    |
+ *   | search        | The search params, minus the question mark                             |
+ *   | hash          | The hash string, minus the hash symbol
+ *   | hostname      | The hostname
+ *   | port          | The port, without ":"
+ *   | pathname      | The pathname, beginning with "/"
+ *
+ */
+function urlResolve(url) {
+  var href = url;
+
+  if (msie) {
+    // Normalize before parse.  Refer Implementation Notes on why this is
+    // done in two steps on IE.
+    urlParsingNode.setAttribute("href", href);
+    href = urlParsingNode.href;
+  }
+
+  urlParsingNode.setAttribute('href', href);
+
+  // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils
+  return {
+    href: urlParsingNode.href,
+    protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',
+    host: urlParsingNode.host,
+    search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, '') : '',
+    hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',
+    hostname: urlParsingNode.hostname,
+    port: urlParsingNode.port,
+    pathname: (urlParsingNode.pathname.charAt(0) === '/')
+      ? urlParsingNode.pathname
+      : '/' + urlParsingNode.pathname
+  };
+}
+
+/**
+ * Parse a request URL and determine whether this is a same-origin request as the application document.
+ *
+ * @param {string|object} requestUrl The url of the request as a string that will be resolved
+ * or a parsed URL object.
+ * @returns {boolean} Whether the request is for the same origin as the application document.
+ */
+function urlIsSameOrigin(requestUrl) {
+  var parsed = (isString(requestUrl)) ? urlResolve(requestUrl) : requestUrl;
+  return (parsed.protocol === originUrl.protocol &&
+          parsed.host === originUrl.host);
+}
+
+/**
+ * @ngdoc service
+ * @name $window
+ *
+ * @description
+ * A reference to the browser's `window` object. While `window`
+ * is globally available in JavaScript, it causes testability problems, because
+ * it is a global variable. In angular we always refer to it through the
+ * `$window` service, so it may be overridden, removed or mocked for testing.
+ *
+ * Expressions, like the one defined for the `ngClick` directive in the example
+ * below, are evaluated with respect to the current scope.  Therefore, there is
+ * no risk of inadvertently coding in a dependency on a global value in such an
+ * expression.
+ *
+ * @example
+   <example module="windowExample">
+     <file name="index.html">
+       <script>
+         angular.module('windowExample', [])
+           .controller('ExampleController', ['$scope', '$window', function($scope, $window) {
+             $scope.greeting = 'Hello, World!';
+             $scope.doGreeting = function(greeting) {
+               $window.alert(greeting);
+             };
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <input type="text" ng-model="greeting" aria-label="greeting" />
+         <button ng-click="doGreeting(greeting)">ALERT</button>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+      it('should display the greeting in the input box', function() {
+       element(by.model('greeting')).sendKeys('Hello, E2E Tests');
+       // If we click the button it will block the test runner
+       // element(':button').click();
+      });
+     </file>
+   </example>
+ */
+function $WindowProvider() {
+  this.$get = valueFn(window);
+}
+
+/**
+ * @name $$cookieReader
+ * @requires $document
+ *
+ * @description
+ * This is a private service for reading cookies used by $http and ngCookies
+ *
+ * @return {Object} a key/value map of the current cookies
+ */
+function $$CookieReader($document) {
+  var rawDocument = $document[0] || {};
+  var lastCookies = {};
+  var lastCookieString = '';
+
+  function safeDecodeURIComponent(str) {
+    try {
+      return decodeURIComponent(str);
+    } catch (e) {
+      return str;
+    }
+  }
+
+  return function() {
+    var cookieArray, cookie, i, index, name;
+    var currentCookieString = rawDocument.cookie || '';
+
+    if (currentCookieString !== lastCookieString) {
+      lastCookieString = currentCookieString;
+      cookieArray = lastCookieString.split('; ');
+      lastCookies = {};
+
+      for (i = 0; i < cookieArray.length; i++) {
+        cookie = cookieArray[i];
+        index = cookie.indexOf('=');
+        if (index > 0) { //ignore nameless cookies
+          name = safeDecodeURIComponent(cookie.substring(0, index));
+          // the first value that is seen for a cookie is the most
+          // specific one.  values for the same cookie name that
+          // follow are for less specific paths.
+          if (isUndefined(lastCookies[name])) {
+            lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));
+          }
+        }
+      }
+    }
+    return lastCookies;
+  };
+}
+
+$$CookieReader.$inject = ['$document'];
+
+function $$CookieReaderProvider() {
+  this.$get = $$CookieReader;
+}
+
+/* global currencyFilter: true,
+ dateFilter: true,
+ filterFilter: true,
+ jsonFilter: true,
+ limitToFilter: true,
+ lowercaseFilter: true,
+ numberFilter: true,
+ orderByFilter: true,
+ uppercaseFilter: true,
+ */
+
+/**
+ * @ngdoc provider
+ * @name $filterProvider
+ * @description
+ *
+ * Filters are just functions which transform input to an output. However filters need to be
+ * Dependency Injected. To achieve this a filter definition consists of a factory function which is
+ * annotated with dependencies and is responsible for creating a filter function.
+ *
+ * <div class="alert alert-warning">
+ * **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
+ * Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
+ * your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
+ * (`myapp_subsection_filterx`).
+ * </div>
+ *
+ * ```js
+ *   // Filter registration
+ *   function MyModule($provide, $filterProvider) {
+ *     // create a service to demonstrate injection (not always needed)
+ *     $provide.value('greet', function(name){
+ *       return 'Hello ' + name + '!';
+ *     });
+ *
+ *     // register a filter factory which uses the
+ *     // greet service to demonstrate DI.
+ *     $filterProvider.register('greet', function(greet){
+ *       // return the filter function which uses the greet service
+ *       // to generate salutation
+ *       return function(text) {
+ *         // filters need to be forgiving so check input validity
+ *         return text && greet(text) || text;
+ *       };
+ *     });
+ *   }
+ * ```
+ *
+ * The filter function is registered with the `$injector` under the filter name suffix with
+ * `Filter`.
+ *
+ * ```js
+ *   it('should be the same instance', inject(
+ *     function($filterProvider) {
+ *       $filterProvider.register('reverse', function(){
+ *         return ...;
+ *       });
+ *     },
+ *     function($filter, reverseFilter) {
+ *       expect($filter('reverse')).toBe(reverseFilter);
+ *     });
+ * ```
+ *
+ *
+ * For more information about how angular filters work, and how to create your own filters, see
+ * {@link guide/filter Filters} in the Angular Developer Guide.
+ */
+
+/**
+ * @ngdoc service
+ * @name $filter
+ * @kind function
+ * @description
+ * Filters are used for formatting data displayed to the user.
+ *
+ * The general syntax in templates is as follows:
+ *
+ *         {{ expression [| filter_name[:parameter_value] ... ] }}
+ *
+ * @param {String} name Name of the filter function to retrieve
+ * @return {Function} the filter function
+ * @example
+   <example name="$filter" module="filterExample">
+     <file name="index.html">
+       <div ng-controller="MainCtrl">
+        <h3>{{ originalText }}</h3>
+        <h3>{{ filteredText }}</h3>
+       </div>
+     </file>
+
+     <file name="script.js">
+      angular.module('filterExample', [])
+      .controller('MainCtrl', function($scope, $filter) {
+        $scope.originalText = 'hello';
+        $scope.filteredText = $filter('uppercase')($scope.originalText);
+      });
+     </file>
+   </example>
+  */
+$FilterProvider.$inject = ['$provide'];
+function $FilterProvider($provide) {
+  var suffix = 'Filter';
+
+  /**
+   * @ngdoc method
+   * @name $filterProvider#register
+   * @param {string|Object} name Name of the filter function, or an object map of filters where
+   *    the keys are the filter names and the values are the filter factories.
+   *
+   *    <div class="alert alert-warning">
+   *    **Note:** Filter names must be valid angular {@link expression} identifiers, such as `uppercase` or `orderBy`.
+   *    Names with special characters, such as hyphens and dots, are not allowed. If you wish to namespace
+   *    your filters, then you can use capitalization (`myappSubsectionFilterx`) or underscores
+   *    (`myapp_subsection_filterx`).
+   *    </div>
+    * @param {Function} factory If the first argument was a string, a factory function for the filter to be registered.
+   * @returns {Object} Registered filter instance, or if a map of filters was provided then a map
+   *    of the registered filter instances.
+   */
+  function register(name, factory) {
+    if (isObject(name)) {
+      var filters = {};
+      forEach(name, function(filter, key) {
+        filters[key] = register(key, filter);
+      });
+      return filters;
+    } else {
+      return $provide.factory(name + suffix, factory);
+    }
+  }
+  this.register = register;
+
+  this.$get = ['$injector', function($injector) {
+    return function(name) {
+      return $injector.get(name + suffix);
+    };
+  }];
+
+  ////////////////////////////////////////
+
+  /* global
+    currencyFilter: false,
+    dateFilter: false,
+    filterFilter: false,
+    jsonFilter: false,
+    limitToFilter: false,
+    lowercaseFilter: false,
+    numberFilter: false,
+    orderByFilter: false,
+    uppercaseFilter: false,
+  */
+
+  register('currency', currencyFilter);
+  register('date', dateFilter);
+  register('filter', filterFilter);
+  register('json', jsonFilter);
+  register('limitTo', limitToFilter);
+  register('lowercase', lowercaseFilter);
+  register('number', numberFilter);
+  register('orderBy', orderByFilter);
+  register('uppercase', uppercaseFilter);
+}
+
+/**
+ * @ngdoc filter
+ * @name filter
+ * @kind function
+ *
+ * @description
+ * Selects a subset of items from `array` and returns it as a new array.
+ *
+ * @param {Array} array The source array.
+ * @param {string|Object|function()} expression The predicate to be used for selecting items from
+ *   `array`.
+ *
+ *   Can be one of:
+ *
+ *   - `string`: The string is used for matching against the contents of the `array`. All strings or
+ *     objects with string properties in `array` that match this string will be returned. This also
+ *     applies to nested object properties.
+ *     The predicate can be negated by prefixing the string with `!`.
+ *
+ *   - `Object`: A pattern object can be used to filter specific properties on objects contained
+ *     by `array`. For example `{name:"M", phone:"1"}` predicate will return an array of items
+ *     which have property `name` containing "M" and property `phone` containing "1". A special
+ *     property name `$` can be used (as in `{$:"text"}`) to accept a match against any
+ *     property of the object or its nested object properties. That's equivalent to the simple
+ *     substring match with a `string` as described above. The predicate can be negated by prefixing
+ *     the string with `!`.
+ *     For example `{name: "!M"}` predicate will return an array of items which have property `name`
+ *     not containing "M".
+ *
+ *     Note that a named property will match properties on the same level only, while the special
+ *     `$` property will match properties on the same level or deeper. E.g. an array item like
+ *     `{name: {first: 'John', last: 'Doe'}}` will **not** be matched by `{name: 'John'}`, but
+ *     **will** be matched by `{$: 'John'}`.
+ *
+ *   - `function(value, index, array)`: A predicate function can be used to write arbitrary filters.
+ *     The function is called for each element of the array, with the element, its index, and
+ *     the entire array itself as arguments.
+ *
+ *     The final result is an array of those elements that the predicate returned true for.
+ *
+ * @param {function(actual, expected)|true|undefined} comparator Comparator which is used in
+ *     determining if the expected value (from the filter expression) and actual value (from
+ *     the object in the array) should be considered a match.
+ *
+ *   Can be one of:
+ *
+ *   - `function(actual, expected)`:
+ *     The function will be given the object value and the predicate value to compare and
+ *     should return true if both values should be considered equal.
+ *
+ *   - `true`: A shorthand for `function(actual, expected) { return angular.equals(actual, expected)}`.
+ *     This is essentially strict comparison of expected and actual.
+ *
+ *   - `false|undefined`: A short hand for a function which will look for a substring match in case
+ *     insensitive way.
+ *
+ *     Primitive values are converted to strings. Objects are not compared against primitives,
+ *     unless they have a custom `toString` method (e.g. `Date` objects).
+ *
+ * @example
+   <example>
+     <file name="index.html">
+       <div ng-init="friends = [{name:'John', phone:'555-1276'},
+                                {name:'Mary', phone:'800-BIG-MARY'},
+                                {name:'Mike', phone:'555-4321'},
+                                {name:'Adam', phone:'555-5678'},
+                                {name:'Julie', phone:'555-8765'},
+                                {name:'Juliette', phone:'555-5678'}]"></div>
+
+       <label>Search: <input ng-model="searchText"></label>
+       <table id="searchTextResults">
+         <tr><th>Name</th><th>Phone</th></tr>
+         <tr ng-repeat="friend in friends | filter:searchText">
+           <td>{{friend.name}}</td>
+           <td>{{friend.phone}}</td>
+         </tr>
+       </table>
+       <hr>
+       <label>Any: <input ng-model="search.$"></label> <br>
+       <label>Name only <input ng-model="search.name"></label><br>
+       <label>Phone only <input ng-model="search.phone"></label><br>
+       <label>Equality <input type="checkbox" ng-model="strict"></label><br>
+       <table id="searchObjResults">
+         <tr><th>Name</th><th>Phone</th></tr>
+         <tr ng-repeat="friendObj in friends | filter:search:strict">
+           <td>{{friendObj.name}}</td>
+           <td>{{friendObj.phone}}</td>
+         </tr>
+       </table>
+     </file>
+     <file name="protractor.js" type="protractor">
+       var expectFriendNames = function(expectedNames, key) {
+         element.all(by.repeater(key + ' in friends').column(key + '.name')).then(function(arr) {
+           arr.forEach(function(wd, i) {
+             expect(wd.getText()).toMatch(expectedNames[i]);
+           });
+         });
+       };
+
+       it('should search across all fields when filtering with a string', function() {
+         var searchText = element(by.model('searchText'));
+         searchText.clear();
+         searchText.sendKeys('m');
+         expectFriendNames(['Mary', 'Mike', 'Adam'], 'friend');
+
+         searchText.clear();
+         searchText.sendKeys('76');
+         expectFriendNames(['John', 'Julie'], 'friend');
+       });
+
+       it('should search in specific fields when filtering with a predicate object', function() {
+         var searchAny = element(by.model('search.$'));
+         searchAny.clear();
+         searchAny.sendKeys('i');
+         expectFriendNames(['Mary', 'Mike', 'Julie', 'Juliette'], 'friendObj');
+       });
+       it('should use a equal comparison when comparator is true', function() {
+         var searchName = element(by.model('search.name'));
+         var strict = element(by.model('strict'));
+         searchName.clear();
+         searchName.sendKeys('Julie');
+         strict.click();
+         expectFriendNames(['Julie'], 'friendObj');
+       });
+     </file>
+   </example>
+ */
+function filterFilter() {
+  return function(array, expression, comparator) {
+    if (!isArrayLike(array)) {
+      if (array == null) {
+        return array;
+      } else {
+        throw minErr('filter')('notarray', 'Expected array but received: {0}', array);
+      }
+    }
+
+    var expressionType = getTypeForFilter(expression);
+    var predicateFn;
+    var matchAgainstAnyProp;
+
+    switch (expressionType) {
+      case 'function':
+        predicateFn = expression;
+        break;
+      case 'boolean':
+      case 'null':
+      case 'number':
+      case 'string':
+        matchAgainstAnyProp = true;
+        //jshint -W086
+      case 'object':
+        //jshint +W086
+        predicateFn = createPredicateFn(expression, comparator, matchAgainstAnyProp);
+        break;
+      default:
+        return array;
+    }
+
+    return Array.prototype.filter.call(array, predicateFn);
+  };
+}
+
+// Helper functions for `filterFilter`
+function createPredicateFn(expression, comparator, matchAgainstAnyProp) {
+  var shouldMatchPrimitives = isObject(expression) && ('$' in expression);
+  var predicateFn;
+
+  if (comparator === true) {
+    comparator = equals;
+  } else if (!isFunction(comparator)) {
+    comparator = function(actual, expected) {
+      if (isUndefined(actual)) {
+        // No substring matching against `undefined`
+        return false;
+      }
+      if ((actual === null) || (expected === null)) {
+        // No substring matching against `null`; only match against `null`
+        return actual === expected;
+      }
+      if (isObject(expected) || (isObject(actual) && !hasCustomToString(actual))) {
+        // Should not compare primitives against objects, unless they have custom `toString` method
+        return false;
+      }
+
+      actual = lowercase('' + actual);
+      expected = lowercase('' + expected);
+      return actual.indexOf(expected) !== -1;
+    };
+  }
+
+  predicateFn = function(item) {
+    if (shouldMatchPrimitives && !isObject(item)) {
+      return deepCompare(item, expression.$, comparator, false);
+    }
+    return deepCompare(item, expression, comparator, matchAgainstAnyProp);
+  };
+
+  return predicateFn;
+}
+
+function deepCompare(actual, expected, comparator, matchAgainstAnyProp, dontMatchWholeObject) {
+  var actualType = getTypeForFilter(actual);
+  var expectedType = getTypeForFilter(expected);
+
+  if ((expectedType === 'string') && (expected.charAt(0) === '!')) {
+    return !deepCompare(actual, expected.substring(1), comparator, matchAgainstAnyProp);
+  } else if (isArray(actual)) {
+    // In case `actual` is an array, consider it a match
+    // if ANY of it's items matches `expected`
+    return actual.some(function(item) {
+      return deepCompare(item, expected, comparator, matchAgainstAnyProp);
+    });
+  }
+
+  switch (actualType) {
+    case 'object':
+      var key;
+      if (matchAgainstAnyProp) {
+        for (key in actual) {
+          if ((key.charAt(0) !== '$') && deepCompare(actual[key], expected, comparator, true)) {
+            return true;
+          }
+        }
+        return dontMatchWholeObject ? false : deepCompare(actual, expected, comparator, false);
+      } else if (expectedType === 'object') {
+        for (key in expected) {
+          var expectedVal = expected[key];
+          if (isFunction(expectedVal) || isUndefined(expectedVal)) {
+            continue;
+          }
+
+          var matchAnyProperty = key === '$';
+          var actualVal = matchAnyProperty ? actual : actual[key];
+          if (!deepCompare(actualVal, expectedVal, comparator, matchAnyProperty, matchAnyProperty)) {
+            return false;
+          }
+        }
+        return true;
+      } else {
+        return comparator(actual, expected);
+      }
+      break;
+    case 'function':
+      return false;
+    default:
+      return comparator(actual, expected);
+  }
+}
+
+// Used for easily differentiating between `null` and actual `object`
+function getTypeForFilter(val) {
+  return (val === null) ? 'null' : typeof val;
+}
+
+/**
+ * @ngdoc filter
+ * @name currency
+ * @kind function
+ *
+ * @description
+ * Formats a number as a currency (ie $1,234.56). When no currency symbol is provided, default
+ * symbol for current locale is used.
+ *
+ * @param {number} amount Input to filter.
+ * @param {string=} symbol Currency symbol or identifier to be displayed.
+ * @param {number=} fractionSize Number of decimal places to round the amount to, defaults to default max fraction size for current locale
+ * @returns {string} Formatted number.
+ *
+ *
+ * @example
+   <example module="currencyExample">
+     <file name="index.html">
+       <script>
+         angular.module('currencyExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.amount = 1234.56;
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <input type="number" ng-model="amount" aria-label="amount"> <br>
+         default currency symbol ($): <span id="currency-default">{{amount | currency}}</span><br>
+         custom currency identifier (USD$): <span id="currency-custom">{{amount | currency:"USD$"}}</span>
+         no fractions (0): <span id="currency-no-fractions">{{amount | currency:"USD$":0}}</span>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should init with 1234.56', function() {
+         expect(element(by.id('currency-default')).getText()).toBe('$1,234.56');
+         expect(element(by.id('currency-custom')).getText()).toBe('USD$1,234.56');
+         expect(element(by.id('currency-no-fractions')).getText()).toBe('USD$1,235');
+       });
+       it('should update', function() {
+         if (browser.params.browser == 'safari') {
+           // Safari does not understand the minus key. See
+           // https://github.com/angular/protractor/issues/481
+           return;
+         }
+         element(by.model('amount')).clear();
+         element(by.model('amount')).sendKeys('-1234');
+         expect(element(by.id('currency-default')).getText()).toBe('-$1,234.00');
+         expect(element(by.id('currency-custom')).getText()).toBe('-USD$1,234.00');
+         expect(element(by.id('currency-no-fractions')).getText()).toBe('-USD$1,234');
+       });
+     </file>
+   </example>
+ */
+currencyFilter.$inject = ['$locale'];
+function currencyFilter($locale) {
+  var formats = $locale.NUMBER_FORMATS;
+  return function(amount, currencySymbol, fractionSize) {
+    if (isUndefined(currencySymbol)) {
+      currencySymbol = formats.CURRENCY_SYM;
+    }
+
+    if (isUndefined(fractionSize)) {
+      fractionSize = formats.PATTERNS[1].maxFrac;
+    }
+
+    // if null or undefined pass it through
+    return (amount == null)
+        ? amount
+        : formatNumber(amount, formats.PATTERNS[1], formats.GROUP_SEP, formats.DECIMAL_SEP, fractionSize).
+            replace(/\u00A4/g, currencySymbol);
+  };
+}
+
+/**
+ * @ngdoc filter
+ * @name number
+ * @kind function
+ *
+ * @description
+ * Formats a number as text.
+ *
+ * If the input is null or undefined, it will just be returned.
+ * If the input is infinite (Infinity/-Infinity) the Infinity symbol '∞' is returned.
+ * If the input is not a number an empty string is returned.
+ *
+ *
+ * @param {number|string} number Number to format.
+ * @param {(number|string)=} fractionSize Number of decimal places to round the number to.
+ * If this is not provided then the fraction size is computed from the current locale's number
+ * formatting pattern. In the case of the default locale, it will be 3.
+ * @returns {string} Number rounded to decimalPlaces and places a “,” after each third digit.
+ *
+ * @example
+   <example module="numberFilterExample">
+     <file name="index.html">
+       <script>
+         angular.module('numberFilterExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.val = 1234.56789;
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <label>Enter number: <input ng-model='val'></label><br>
+         Default formatting: <span id='number-default'>{{val | number}}</span><br>
+         No fractions: <span>{{val | number:0}}</span><br>
+         Negative number: <span>{{-val | number:4}}</span>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should format numbers', function() {
+         expect(element(by.id('number-default')).getText()).toBe('1,234.568');
+         expect(element(by.binding('val | number:0')).getText()).toBe('1,235');
+         expect(element(by.binding('-val | number:4')).getText()).toBe('-1,234.5679');
+       });
+
+       it('should update', function() {
+         element(by.model('val')).clear();
+         element(by.model('val')).sendKeys('3374.333');
+         expect(element(by.id('number-default')).getText()).toBe('3,374.333');
+         expect(element(by.binding('val | number:0')).getText()).toBe('3,374');
+         expect(element(by.binding('-val | number:4')).getText()).toBe('-3,374.3330');
+      });
+     </file>
+   </example>
+ */
+
+
+numberFilter.$inject = ['$locale'];
+function numberFilter($locale) {
+  var formats = $locale.NUMBER_FORMATS;
+  return function(number, fractionSize) {
+
+    // if null or undefined pass it through
+    return (number == null)
+        ? number
+        : formatNumber(number, formats.PATTERNS[0], formats.GROUP_SEP, formats.DECIMAL_SEP,
+                       fractionSize);
+  };
+}
+
+var DECIMAL_SEP = '.';
+function formatNumber(number, pattern, groupSep, decimalSep, fractionSize) {
+  if (isObject(number)) return '';
+
+  var isNegative = number < 0;
+  number = Math.abs(number);
+
+  var isInfinity = number === Infinity;
+  if (!isInfinity && !isFinite(number)) return '';
+
+  var numStr = number + '',
+      formatedText = '',
+      hasExponent = false,
+      parts = [];
+
+  if (isInfinity) formatedText = '\u221e';
+
+  if (!isInfinity && numStr.indexOf('e') !== -1) {
+    var match = numStr.match(/([\d\.]+)e(-?)(\d+)/);
+    if (match && match[2] == '-' && match[3] > fractionSize + 1) {
+      number = 0;
+    } else {
+      formatedText = numStr;
+      hasExponent = true;
+    }
+  }
+
+  if (!isInfinity && !hasExponent) {
+    var fractionLen = (numStr.split(DECIMAL_SEP)[1] || '').length;
+
+    // determine fractionSize if it is not specified
+    if (isUndefined(fractionSize)) {
+      fractionSize = Math.min(Math.max(pattern.minFrac, fractionLen), pattern.maxFrac);
+    }
+
+    // safely round numbers in JS without hitting imprecisions of floating-point arithmetics
+    // inspired by:
+    // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round
+    number = +(Math.round(+(number.toString() + 'e' + fractionSize)).toString() + 'e' + -fractionSize);
+
+    var fraction = ('' + number).split(DECIMAL_SEP);
+    var whole = fraction[0];
+    fraction = fraction[1] || '';
+
+    var i, pos = 0,
+        lgroup = pattern.lgSize,
+        group = pattern.gSize;
+
+    if (whole.length >= (lgroup + group)) {
+      pos = whole.length - lgroup;
+      for (i = 0; i < pos; i++) {
+        if ((pos - i) % group === 0 && i !== 0) {
+          formatedText += groupSep;
+        }
+        formatedText += whole.charAt(i);
+      }
+    }
+
+    for (i = pos; i < whole.length; i++) {
+      if ((whole.length - i) % lgroup === 0 && i !== 0) {
+        formatedText += groupSep;
+      }
+      formatedText += whole.charAt(i);
+    }
+
+    // format fraction part.
+    while (fraction.length < fractionSize) {
+      fraction += '0';
+    }
+
+    if (fractionSize && fractionSize !== "0") formatedText += decimalSep + fraction.substr(0, fractionSize);
+  } else {
+    if (fractionSize > 0 && number < 1) {
+      formatedText = number.toFixed(fractionSize);
+      number = parseFloat(formatedText);
+      formatedText = formatedText.replace(DECIMAL_SEP, decimalSep);
+    }
+  }
+
+  if (number === 0) {
+    isNegative = false;
+  }
+
+  parts.push(isNegative ? pattern.negPre : pattern.posPre,
+             formatedText,
+             isNegative ? pattern.negSuf : pattern.posSuf);
+  return parts.join('');
+}
+
+function padNumber(num, digits, trim) {
+  var neg = '';
+  if (num < 0) {
+    neg =  '-';
+    num = -num;
+  }
+  num = '' + num;
+  while (num.length < digits) num = '0' + num;
+  if (trim) {
+    num = num.substr(num.length - digits);
+  }
+  return neg + num;
+}
+
+
+function dateGetter(name, size, offset, trim) {
+  offset = offset || 0;
+  return function(date) {
+    var value = date['get' + name]();
+    if (offset > 0 || value > -offset) {
+      value += offset;
+    }
+    if (value === 0 && offset == -12) value = 12;
+    return padNumber(value, size, trim);
+  };
+}
+
+function dateStrGetter(name, shortForm) {
+  return function(date, formats) {
+    var value = date['get' + name]();
+    var get = uppercase(shortForm ? ('SHORT' + name) : name);
+
+    return formats[get][value];
+  };
+}
+
+function timeZoneGetter(date, formats, offset) {
+  var zone = -1 * offset;
+  var paddedZone = (zone >= 0) ? "+" : "";
+
+  paddedZone += padNumber(Math[zone > 0 ? 'floor' : 'ceil'](zone / 60), 2) +
+                padNumber(Math.abs(zone % 60), 2);
+
+  return paddedZone;
+}
+
+function getFirstThursdayOfYear(year) {
+    // 0 = index of January
+    var dayOfWeekOnFirst = (new Date(year, 0, 1)).getDay();
+    // 4 = index of Thursday (+1 to account for 1st = 5)
+    // 11 = index of *next* Thursday (+1 account for 1st = 12)
+    return new Date(year, 0, ((dayOfWeekOnFirst <= 4) ? 5 : 12) - dayOfWeekOnFirst);
+}
+
+function getThursdayThisWeek(datetime) {
+    return new Date(datetime.getFullYear(), datetime.getMonth(),
+      // 4 = index of Thursday
+      datetime.getDate() + (4 - datetime.getDay()));
+}
+
+function weekGetter(size) {
+   return function(date) {
+      var firstThurs = getFirstThursdayOfYear(date.getFullYear()),
+         thisThurs = getThursdayThisWeek(date);
+
+      var diff = +thisThurs - +firstThurs,
+         result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
+
+      return padNumber(result, size);
+   };
+}
+
+function ampmGetter(date, formats) {
+  return date.getHours() < 12 ? formats.AMPMS[0] : formats.AMPMS[1];
+}
+
+function eraGetter(date, formats) {
+  return date.getFullYear() <= 0 ? formats.ERAS[0] : formats.ERAS[1];
+}
+
+function longEraGetter(date, formats) {
+  return date.getFullYear() <= 0 ? formats.ERANAMES[0] : formats.ERANAMES[1];
+}
+
+var DATE_FORMATS = {
+  yyyy: dateGetter('FullYear', 4),
+    yy: dateGetter('FullYear', 2, 0, true),
+     y: dateGetter('FullYear', 1),
+  MMMM: dateStrGetter('Month'),
+   MMM: dateStrGetter('Month', true),
+    MM: dateGetter('Month', 2, 1),
+     M: dateGetter('Month', 1, 1),
+    dd: dateGetter('Date', 2),
+     d: dateGetter('Date', 1),
+    HH: dateGetter('Hours', 2),
+     H: dateGetter('Hours', 1),
+    hh: dateGetter('Hours', 2, -12),
+     h: dateGetter('Hours', 1, -12),
+    mm: dateGetter('Minutes', 2),
+     m: dateGetter('Minutes', 1),
+    ss: dateGetter('Seconds', 2),
+     s: dateGetter('Seconds', 1),
+     // while ISO 8601 requires fractions to be prefixed with `.` or `,`
+     // we can be just safely rely on using `sss` since we currently don't support single or two digit fractions
+   sss: dateGetter('Milliseconds', 3),
+  EEEE: dateStrGetter('Day'),
+   EEE: dateStrGetter('Day', true),
+     a: ampmGetter,
+     Z: timeZoneGetter,
+    ww: weekGetter(2),
+     w: weekGetter(1),
+     G: eraGetter,
+     GG: eraGetter,
+     GGG: eraGetter,
+     GGGG: longEraGetter
+};
+
+var DATE_FORMATS_SPLIT = /((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,
+    NUMBER_STRING = /^\-?\d+$/;
+
+/**
+ * @ngdoc filter
+ * @name date
+ * @kind function
+ *
+ * @description
+ *   Formats `date` to a string based on the requested `format`.
+ *
+ *   `format` string can be composed of the following elements:
+ *
+ *   * `'yyyy'`: 4 digit representation of year (e.g. AD 1 => 0001, AD 2010 => 2010)
+ *   * `'yy'`: 2 digit representation of year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
+ *   * `'y'`: 1 digit representation of year, e.g. (AD 1 => 1, AD 199 => 199)
+ *   * `'MMMM'`: Month in year (January-December)
+ *   * `'MMM'`: Month in year (Jan-Dec)
+ *   * `'MM'`: Month in year, padded (01-12)
+ *   * `'M'`: Month in year (1-12)
+ *   * `'dd'`: Day in month, padded (01-31)
+ *   * `'d'`: Day in month (1-31)
+ *   * `'EEEE'`: Day in Week,(Sunday-Saturday)
+ *   * `'EEE'`: Day in Week, (Sun-Sat)
+ *   * `'HH'`: Hour in day, padded (00-23)
+ *   * `'H'`: Hour in day (0-23)
+ *   * `'hh'`: Hour in AM/PM, padded (01-12)
+ *   * `'h'`: Hour in AM/PM, (1-12)
+ *   * `'mm'`: Minute in hour, padded (00-59)
+ *   * `'m'`: Minute in hour (0-59)
+ *   * `'ss'`: Second in minute, padded (00-59)
+ *   * `'s'`: Second in minute (0-59)
+ *   * `'sss'`: Millisecond in second, padded (000-999)
+ *   * `'a'`: AM/PM marker
+ *   * `'Z'`: 4 digit (+sign) representation of the timezone offset (-1200-+1200)
+ *   * `'ww'`: Week of year, padded (00-53). Week 01 is the week with the first Thursday of the year
+ *   * `'w'`: Week of year (0-53). Week 1 is the week with the first Thursday of the year
+ *   * `'G'`, `'GG'`, `'GGG'`: The abbreviated form of the era string (e.g. 'AD')
+ *   * `'GGGG'`: The long form of the era string (e.g. 'Anno Domini')
+ *
+ *   `format` string can also be one of the following predefined
+ *   {@link guide/i18n localizable formats}:
+ *
+ *   * `'medium'`: equivalent to `'MMM d, y h:mm:ss a'` for en_US locale
+ *     (e.g. Sep 3, 2010 12:05:08 PM)
+ *   * `'short'`: equivalent to `'M/d/yy h:mm a'` for en_US  locale (e.g. 9/3/10 12:05 PM)
+ *   * `'fullDate'`: equivalent to `'EEEE, MMMM d, y'` for en_US  locale
+ *     (e.g. Friday, September 3, 2010)
+ *   * `'longDate'`: equivalent to `'MMMM d, y'` for en_US  locale (e.g. September 3, 2010)
+ *   * `'mediumDate'`: equivalent to `'MMM d, y'` for en_US  locale (e.g. Sep 3, 2010)
+ *   * `'shortDate'`: equivalent to `'M/d/yy'` for en_US locale (e.g. 9/3/10)
+ *   * `'mediumTime'`: equivalent to `'h:mm:ss a'` for en_US locale (e.g. 12:05:08 PM)
+ *   * `'shortTime'`: equivalent to `'h:mm a'` for en_US locale (e.g. 12:05 PM)
+ *
+ *   `format` string can contain literal values. These need to be escaped by surrounding with single quotes (e.g.
+ *   `"h 'in the morning'"`). In order to output a single quote, escape it - i.e., two single quotes in a sequence
+ *   (e.g. `"h 'o''clock'"`).
+ *
+ * @param {(Date|number|string)} date Date to format either as Date object, milliseconds (string or
+ *    number) or various ISO 8601 datetime string formats (e.g. yyyy-MM-ddTHH:mm:ss.sssZ and its
+ *    shorter versions like yyyy-MM-ddTHH:mmZ, yyyy-MM-dd or yyyyMMddTHHmmssZ). If no timezone is
+ *    specified in the string input, the time is considered to be in the local timezone.
+ * @param {string=} format Formatting rules (see Description). If not specified,
+ *    `mediumDate` is used.
+ * @param {string=} timezone Timezone to be used for formatting. It understands UTC/GMT and the
+ *    continental US time zone abbreviations, but for general use, use a time zone offset, for
+ *    example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
+ *    If not specified, the timezone of the browser will be used.
+ * @returns {string} Formatted string or the input if input is not recognized as date/millis.
+ *
+ * @example
+   <example>
+     <file name="index.html">
+       <span ng-non-bindable>{{1288323623006 | date:'medium'}}</span>:
+           <span>{{1288323623006 | date:'medium'}}</span><br>
+       <span ng-non-bindable>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span>:
+          <span>{{1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'}}</span><br>
+       <span ng-non-bindable>{{1288323623006 | date:'MM/dd/yyyy @ h:mma'}}</span>:
+          <span>{{'1288323623006' | date:'MM/dd/yyyy @ h:mma'}}</span><br>
+       <span ng-non-bindable>{{1288323623006 | date:"MM/dd/yyyy 'at' h:mma"}}</span>:
+          <span>{{'1288323623006' | date:"MM/dd/yyyy 'at' h:mma"}}</span><br>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should format date', function() {
+         expect(element(by.binding("1288323623006 | date:'medium'")).getText()).
+            toMatch(/Oct 2\d, 2010 \d{1,2}:\d{2}:\d{2} (AM|PM)/);
+         expect(element(by.binding("1288323623006 | date:'yyyy-MM-dd HH:mm:ss Z'")).getText()).
+            toMatch(/2010\-10\-2\d \d{2}:\d{2}:\d{2} (\-|\+)?\d{4}/);
+         expect(element(by.binding("'1288323623006' | date:'MM/dd/yyyy @ h:mma'")).getText()).
+            toMatch(/10\/2\d\/2010 @ \d{1,2}:\d{2}(AM|PM)/);
+         expect(element(by.binding("'1288323623006' | date:\"MM/dd/yyyy 'at' h:mma\"")).getText()).
+            toMatch(/10\/2\d\/2010 at \d{1,2}:\d{2}(AM|PM)/);
+       });
+     </file>
+   </example>
+ */
+dateFilter.$inject = ['$locale'];
+function dateFilter($locale) {
+
+
+  var R_ISO8601_STR = /^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
+                     // 1        2       3         4          5          6          7          8  9     10      11
+  function jsonStringToDate(string) {
+    var match;
+    if (match = string.match(R_ISO8601_STR)) {
+      var date = new Date(0),
+          tzHour = 0,
+          tzMin  = 0,
+          dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear,
+          timeSetter = match[8] ? date.setUTCHours : date.setHours;
+
+      if (match[9]) {
+        tzHour = toInt(match[9] + match[10]);
+        tzMin = toInt(match[9] + match[11]);
+      }
+      dateSetter.call(date, toInt(match[1]), toInt(match[2]) - 1, toInt(match[3]));
+      var h = toInt(match[4] || 0) - tzHour;
+      var m = toInt(match[5] || 0) - tzMin;
+      var s = toInt(match[6] || 0);
+      var ms = Math.round(parseFloat('0.' + (match[7] || 0)) * 1000);
+      timeSetter.call(date, h, m, s, ms);
+      return date;
+    }
+    return string;
+  }
+
+
+  return function(date, format, timezone) {
+    var text = '',
+        parts = [],
+        fn, match;
+
+    format = format || 'mediumDate';
+    format = $locale.DATETIME_FORMATS[format] || format;
+    if (isString(date)) {
+      date = NUMBER_STRING.test(date) ? toInt(date) : jsonStringToDate(date);
+    }
+
+    if (isNumber(date)) {
+      date = new Date(date);
+    }
+
+    if (!isDate(date) || !isFinite(date.getTime())) {
+      return date;
+    }
+
+    while (format) {
+      match = DATE_FORMATS_SPLIT.exec(format);
+      if (match) {
+        parts = concat(parts, match, 1);
+        format = parts.pop();
+      } else {
+        parts.push(format);
+        format = null;
+      }
+    }
+
+    var dateTimezoneOffset = date.getTimezoneOffset();
+    if (timezone) {
+      dateTimezoneOffset = timezoneToOffset(timezone, date.getTimezoneOffset());
+      date = convertTimezoneToLocal(date, timezone, true);
+    }
+    forEach(parts, function(value) {
+      fn = DATE_FORMATS[value];
+      text += fn ? fn(date, $locale.DATETIME_FORMATS, dateTimezoneOffset)
+                 : value.replace(/(^'|'$)/g, '').replace(/''/g, "'");
+    });
+
+    return text;
+  };
+}
+
+
+/**
+ * @ngdoc filter
+ * @name json
+ * @kind function
+ *
+ * @description
+ *   Allows you to convert a JavaScript object into JSON string.
+ *
+ *   This filter is mostly useful for debugging. When using the double curly {{value}} notation
+ *   the binding is automatically converted to JSON.
+ *
+ * @param {*} object Any JavaScript object (including arrays and primitive types) to filter.
+ * @param {number=} spacing The number of spaces to use per indentation, defaults to 2.
+ * @returns {string} JSON string.
+ *
+ *
+ * @example
+   <example>
+     <file name="index.html">
+       <pre id="default-spacing">{{ {'name':'value'} | json }}</pre>
+       <pre id="custom-spacing">{{ {'name':'value'} | json:4 }}</pre>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should jsonify filtered objects', function() {
+         expect(element(by.id('default-spacing')).getText()).toMatch(/\{\n  "name": ?"value"\n}/);
+         expect(element(by.id('custom-spacing')).getText()).toMatch(/\{\n    "name": ?"value"\n}/);
+       });
+     </file>
+   </example>
+ *
+ */
+function jsonFilter() {
+  return function(object, spacing) {
+    if (isUndefined(spacing)) {
+        spacing = 2;
+    }
+    return toJson(object, spacing);
+  };
+}
+
+
+/**
+ * @ngdoc filter
+ * @name lowercase
+ * @kind function
+ * @description
+ * Converts string to lowercase.
+ * @see angular.lowercase
+ */
+var lowercaseFilter = valueFn(lowercase);
+
+
+/**
+ * @ngdoc filter
+ * @name uppercase
+ * @kind function
+ * @description
+ * Converts string to uppercase.
+ * @see angular.uppercase
+ */
+var uppercaseFilter = valueFn(uppercase);
+
+/**
+ * @ngdoc filter
+ * @name limitTo
+ * @kind function
+ *
+ * @description
+ * Creates a new array or string containing only a specified number of elements. The elements
+ * are taken from either the beginning or the end of the source array, string or number, as specified by
+ * the value and sign (positive or negative) of `limit`. If a number is used as input, it is
+ * converted to a string.
+ *
+ * @param {Array|string|number} input Source array, string or number to be limited.
+ * @param {string|number} limit The length of the returned array or string. If the `limit` number
+ *     is positive, `limit` number of items from the beginning of the source array/string are copied.
+ *     If the number is negative, `limit` number  of items from the end of the source array/string
+ *     are copied. The `limit` will be trimmed if it exceeds `array.length`. If `limit` is undefined,
+ *     the input will be returned unchanged.
+ * @param {(string|number)=} begin Index at which to begin limitation. As a negative index, `begin`
+ *     indicates an offset from the end of `input`. Defaults to `0`.
+ * @returns {Array|string} A new sub-array or substring of length `limit` or less if input array
+ *     had less than `limit` elements.
+ *
+ * @example
+   <example module="limitToExample">
+     <file name="index.html">
+       <script>
+         angular.module('limitToExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.numbers = [1,2,3,4,5,6,7,8,9];
+             $scope.letters = "abcdefghi";
+             $scope.longNumber = 2345432342;
+             $scope.numLimit = 3;
+             $scope.letterLimit = 3;
+             $scope.longNumberLimit = 3;
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <label>
+            Limit {{numbers}} to:
+            <input type="number" step="1" ng-model="numLimit">
+         </label>
+         <p>Output numbers: {{ numbers | limitTo:numLimit }}</p>
+         <label>
+            Limit {{letters}} to:
+            <input type="number" step="1" ng-model="letterLimit">
+         </label>
+         <p>Output letters: {{ letters | limitTo:letterLimit }}</p>
+         <label>
+            Limit {{longNumber}} to:
+            <input type="number" step="1" ng-model="longNumberLimit">
+         </label>
+         <p>Output long number: {{ longNumber | limitTo:longNumberLimit }}</p>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       var numLimitInput = element(by.model('numLimit'));
+       var letterLimitInput = element(by.model('letterLimit'));
+       var longNumberLimitInput = element(by.model('longNumberLimit'));
+       var limitedNumbers = element(by.binding('numbers | limitTo:numLimit'));
+       var limitedLetters = element(by.binding('letters | limitTo:letterLimit'));
+       var limitedLongNumber = element(by.binding('longNumber | limitTo:longNumberLimit'));
+
+       it('should limit the number array to first three items', function() {
+         expect(numLimitInput.getAttribute('value')).toBe('3');
+         expect(letterLimitInput.getAttribute('value')).toBe('3');
+         expect(longNumberLimitInput.getAttribute('value')).toBe('3');
+         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3]');
+         expect(limitedLetters.getText()).toEqual('Output letters: abc');
+         expect(limitedLongNumber.getText()).toEqual('Output long number: 234');
+       });
+
+       // There is a bug in safari and protractor that doesn't like the minus key
+       // it('should update the output when -3 is entered', function() {
+       //   numLimitInput.clear();
+       //   numLimitInput.sendKeys('-3');
+       //   letterLimitInput.clear();
+       //   letterLimitInput.sendKeys('-3');
+       //   longNumberLimitInput.clear();
+       //   longNumberLimitInput.sendKeys('-3');
+       //   expect(limitedNumbers.getText()).toEqual('Output numbers: [7,8,9]');
+       //   expect(limitedLetters.getText()).toEqual('Output letters: ghi');
+       //   expect(limitedLongNumber.getText()).toEqual('Output long number: 342');
+       // });
+
+       it('should not exceed the maximum size of input array', function() {
+         numLimitInput.clear();
+         numLimitInput.sendKeys('100');
+         letterLimitInput.clear();
+         letterLimitInput.sendKeys('100');
+         longNumberLimitInput.clear();
+         longNumberLimitInput.sendKeys('100');
+         expect(limitedNumbers.getText()).toEqual('Output numbers: [1,2,3,4,5,6,7,8,9]');
+         expect(limitedLetters.getText()).toEqual('Output letters: abcdefghi');
+         expect(limitedLongNumber.getText()).toEqual('Output long number: 2345432342');
+       });
+     </file>
+   </example>
+*/
+function limitToFilter() {
+  return function(input, limit, begin) {
+    if (Math.abs(Number(limit)) === Infinity) {
+      limit = Number(limit);
+    } else {
+      limit = toInt(limit);
+    }
+    if (isNaN(limit)) return input;
+
+    if (isNumber(input)) input = input.toString();
+    if (!isArray(input) && !isString(input)) return input;
+
+    begin = (!begin || isNaN(begin)) ? 0 : toInt(begin);
+    begin = (begin < 0 && begin >= -input.length) ? input.length + begin : begin;
+
+    if (limit >= 0) {
+      return input.slice(begin, begin + limit);
+    } else {
+      if (begin === 0) {
+        return input.slice(limit, input.length);
+      } else {
+        return input.slice(Math.max(0, begin + limit), begin);
+      }
+    }
+  };
+}
+
+/**
+ * @ngdoc filter
+ * @name orderBy
+ * @kind function
+ *
+ * @description
+ * Orders a specified `array` by the `expression` predicate. It is ordered alphabetically
+ * for strings and numerically for numbers. Note: if you notice numbers are not being sorted
+ * as expected, make sure they are actually being saved as numbers and not strings.
+ *
+ * @param {Array} array The array to sort.
+ * @param {function(*)|string|Array.<(function(*)|string)>=} expression A predicate to be
+ *    used by the comparator to determine the order of elements.
+ *
+ *    Can be one of:
+ *
+ *    - `function`: Getter function. The result of this function will be sorted using the
+ *      `<`, `===`, `>` operator.
+ *    - `string`: An Angular expression. The result of this expression is used to compare elements
+ *      (for example `name` to sort by a property called `name` or `name.substr(0, 3)` to sort by
+ *      3 first characters of a property called `name`). The result of a constant expression
+ *      is interpreted as a property name to be used in comparisons (for example `"special name"`
+ *      to sort object by the value of their `special name` property). An expression can be
+ *      optionally prefixed with `+` or `-` to control ascending or descending sort order
+ *      (for example, `+name` or `-name`). If no property is provided, (e.g. `'+'`) then the array
+ *      element itself is used to compare where sorting.
+ *    - `Array`: An array of function or string predicates. The first predicate in the array
+ *      is used for sorting, but when two items are equivalent, the next predicate is used.
+ *
+ *    If the predicate is missing or empty then it defaults to `'+'`.
+ *
+ * @param {boolean=} reverse Reverse the order of the array.
+ * @returns {Array} Sorted copy of the source array.
+ *
+ *
+ * @example
+ * The example below demonstrates a simple ngRepeat, where the data is sorted
+ * by age in descending order (predicate is set to `'-age'`).
+ * `reverse` is not set, which means it defaults to `false`.
+   <example module="orderByExample">
+     <file name="index.html">
+       <script>
+         angular.module('orderByExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.friends =
+                 [{name:'John', phone:'555-1212', age:10},
+                  {name:'Mary', phone:'555-9876', age:19},
+                  {name:'Mike', phone:'555-4321', age:21},
+                  {name:'Adam', phone:'555-5678', age:35},
+                  {name:'Julie', phone:'555-8765', age:29}];
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <table class="friend">
+           <tr>
+             <th>Name</th>
+             <th>Phone Number</th>
+             <th>Age</th>
+           </tr>
+           <tr ng-repeat="friend in friends | orderBy:'-age'">
+             <td>{{friend.name}}</td>
+             <td>{{friend.phone}}</td>
+             <td>{{friend.age}}</td>
+           </tr>
+         </table>
+       </div>
+     </file>
+   </example>
+ *
+ * The predicate and reverse parameters can be controlled dynamically through scope properties,
+ * as shown in the next example.
+ * @example
+   <example module="orderByExample">
+     <file name="index.html">
+       <script>
+         angular.module('orderByExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.friends =
+                 [{name:'John', phone:'555-1212', age:10},
+                  {name:'Mary', phone:'555-9876', age:19},
+                  {name:'Mike', phone:'555-4321', age:21},
+                  {name:'Adam', phone:'555-5678', age:35},
+                  {name:'Julie', phone:'555-8765', age:29}];
+             $scope.predicate = 'age';
+             $scope.reverse = true;
+             $scope.order = function(predicate) {
+               $scope.reverse = ($scope.predicate === predicate) ? !$scope.reverse : false;
+               $scope.predicate = predicate;
+             };
+           }]);
+       </script>
+       <style type="text/css">
+         .sortorder:after {
+           content: '\25b2';
+         }
+         .sortorder.reverse:after {
+           content: '\25bc';
+         }
+       </style>
+       <div ng-controller="ExampleController">
+         <pre>Sorting predicate = {{predicate}}; reverse = {{reverse}}</pre>
+         <hr/>
+         [ <a href="" ng-click="predicate=''">unsorted</a> ]
+         <table class="friend">
+           <tr>
+             <th>
+               <a href="" ng-click="order('name')">Name</a>
+               <span class="sortorder" ng-show="predicate === 'name'" ng-class="{reverse:reverse}"></span>
+             </th>
+             <th>
+               <a href="" ng-click="order('phone')">Phone Number</a>
+               <span class="sortorder" ng-show="predicate === 'phone'" ng-class="{reverse:reverse}"></span>
+             </th>
+             <th>
+               <a href="" ng-click="order('age')">Age</a>
+               <span class="sortorder" ng-show="predicate === 'age'" ng-class="{reverse:reverse}"></span>
+             </th>
+           </tr>
+           <tr ng-repeat="friend in friends | orderBy:predicate:reverse">
+             <td>{{friend.name}}</td>
+             <td>{{friend.phone}}</td>
+             <td>{{friend.age}}</td>
+           </tr>
+         </table>
+       </div>
+     </file>
+   </example>
+ *
+ * It's also possible to call the orderBy filter manually, by injecting `$filter`, retrieving the
+ * filter routine with `$filter('orderBy')`, and calling the returned filter routine with the
+ * desired parameters.
+ *
+ * Example:
+ *
+ * @example
+  <example module="orderByExample">
+    <file name="index.html">
+      <div ng-controller="ExampleController">
+        <table class="friend">
+          <tr>
+            <th><a href="" ng-click="reverse=false;order('name', false)">Name</a>
+              (<a href="" ng-click="order('-name',false)">^</a>)</th>
+            <th><a href="" ng-click="reverse=!reverse;order('phone', reverse)">Phone Number</a></th>
+            <th><a href="" ng-click="reverse=!reverse;order('age',reverse)">Age</a></th>
+          </tr>
+          <tr ng-repeat="friend in friends">
+            <td>{{friend.name}}</td>
+            <td>{{friend.phone}}</td>
+            <td>{{friend.age}}</td>
+          </tr>
+        </table>
+      </div>
+    </file>
+
+    <file name="script.js">
+      angular.module('orderByExample', [])
+        .controller('ExampleController', ['$scope', '$filter', function($scope, $filter) {
+          var orderBy = $filter('orderBy');
+          $scope.friends = [
+            { name: 'John',    phone: '555-1212',    age: 10 },
+            { name: 'Mary',    phone: '555-9876',    age: 19 },
+            { name: 'Mike',    phone: '555-4321',    age: 21 },
+            { name: 'Adam',    phone: '555-5678',    age: 35 },
+            { name: 'Julie',   phone: '555-8765',    age: 29 }
+          ];
+          $scope.order = function(predicate, reverse) {
+            $scope.friends = orderBy($scope.friends, predicate, reverse);
+          };
+          $scope.order('-age',false);
+        }]);
+    </file>
+</example>
+ */
+orderByFilter.$inject = ['$parse'];
+function orderByFilter($parse) {
+  return function(array, sortPredicate, reverseOrder) {
+
+    if (!(isArrayLike(array))) return array;
+
+    if (!isArray(sortPredicate)) { sortPredicate = [sortPredicate]; }
+    if (sortPredicate.length === 0) { sortPredicate = ['+']; }
+
+    var predicates = processPredicates(sortPredicate, reverseOrder);
+    // Add a predicate at the end that evaluates to the element index. This makes the
+    // sort stable as it works as a tie-breaker when all the input predicates cannot
+    // distinguish between two elements.
+    predicates.push({ get: function() { return {}; }, descending: reverseOrder ? -1 : 1});
+
+    // The next three lines are a version of a Swartzian Transform idiom from Perl
+    // (sometimes called the Decorate-Sort-Undecorate idiom)
+    // See https://en.wikipedia.org/wiki/Schwartzian_transform
+    var compareValues = Array.prototype.map.call(array, getComparisonObject);
+    compareValues.sort(doComparison);
+    array = compareValues.map(function(item) { return item.value; });
+
+    return array;
+
+    function getComparisonObject(value, index) {
+      return {
+        value: value,
+        predicateValues: predicates.map(function(predicate) {
+          return getPredicateValue(predicate.get(value), index);
+        })
+      };
+    }
+
+    function doComparison(v1, v2) {
+      var result = 0;
+      for (var index=0, length = predicates.length; index < length; ++index) {
+        result = compare(v1.predicateValues[index], v2.predicateValues[index]) * predicates[index].descending;
+        if (result) break;
+      }
+      return result;
+    }
+  };
+
+  function processPredicates(sortPredicate, reverseOrder) {
+    reverseOrder = reverseOrder ? -1 : 1;
+    return sortPredicate.map(function(predicate) {
+      var descending = 1, get = identity;
+
+      if (isFunction(predicate)) {
+        get = predicate;
+      } else if (isString(predicate)) {
+        if ((predicate.charAt(0) == '+' || predicate.charAt(0) == '-')) {
+          descending = predicate.charAt(0) == '-' ? -1 : 1;
+          predicate = predicate.substring(1);
+        }
+        if (predicate !== '') {
+          get = $parse(predicate);
+          if (get.constant) {
+            var key = get();
+            get = function(value) { return value[key]; };
+          }
+        }
+      }
+      return { get: get, descending: descending * reverseOrder };
+    });
+  }
+
+  function isPrimitive(value) {
+    switch (typeof value) {
+      case 'number': /* falls through */
+      case 'boolean': /* falls through */
+      case 'string':
+        return true;
+      default:
+        return false;
+    }
+  }
+
+  function objectValue(value, index) {
+    // If `valueOf` is a valid function use that
+    if (typeof value.valueOf === 'function') {
+      value = value.valueOf();
+      if (isPrimitive(value)) return value;
+    }
+    // If `toString` is a valid function and not the one from `Object.prototype` use that
+    if (hasCustomToString(value)) {
+      value = value.toString();
+      if (isPrimitive(value)) return value;
+    }
+    // We have a basic object so we use the position of the object in the collection
+    return index;
+  }
+
+  function getPredicateValue(value, index) {
+    var type = typeof value;
+    if (value === null) {
+      type = 'string';
+      value = 'null';
+    } else if (type === 'string') {
+      value = value.toLowerCase();
+    } else if (type === 'object') {
+      value = objectValue(value, index);
+    }
+    return { value: value, type: type };
+  }
+
+  function compare(v1, v2) {
+    var result = 0;
+    if (v1.type === v2.type) {
+      if (v1.value !== v2.value) {
+        result = v1.value < v2.value ? -1 : 1;
+      }
+    } else {
+      result = v1.type < v2.type ? -1 : 1;
+    }
+    return result;
+  }
+}
+
+function ngDirective(directive) {
+  if (isFunction(directive)) {
+    directive = {
+      link: directive
+    };
+  }
+  directive.restrict = directive.restrict || 'AC';
+  return valueFn(directive);
+}
+
+/**
+ * @ngdoc directive
+ * @name a
+ * @restrict E
+ *
+ * @description
+ * Modifies the default behavior of the html A tag so that the default action is prevented when
+ * the href attribute is empty.
+ *
+ * This change permits the easy creation of action links with the `ngClick` directive
+ * without changing the location or causing page reloads, e.g.:
+ * `<a href="" ng-click="list.addItem()">Add Item</a>`
+ */
+var htmlAnchorDirective = valueFn({
+  restrict: 'E',
+  compile: function(element, attr) {
+    if (!attr.href && !attr.xlinkHref) {
+      return function(scope, element) {
+        // If the linked element is not an anchor tag anymore, do nothing
+        if (element[0].nodeName.toLowerCase() !== 'a') return;
+
+        // SVGAElement does not use the href attribute, but rather the 'xlinkHref' attribute.
+        var href = toString.call(element.prop('href')) === '[object SVGAnimatedString]' ?
+                   'xlink:href' : 'href';
+        element.on('click', function(event) {
+          // if we have no href url, then don't navigate anywhere.
+          if (!element.attr(href)) {
+            event.preventDefault();
+          }
+        });
+      };
+    }
+  }
+});
+
+/**
+ * @ngdoc directive
+ * @name ngHref
+ * @restrict A
+ * @priority 99
+ *
+ * @description
+ * Using Angular markup like `{{hash}}` in an href attribute will
+ * make the link go to the wrong URL if the user clicks it before
+ * Angular has a chance to replace the `{{hash}}` markup with its
+ * value. Until Angular replaces the markup the link will be broken
+ * and will most likely return a 404 error. The `ngHref` directive
+ * solves this problem.
+ *
+ * The wrong way to write it:
+ * ```html
+ * <a href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
+ * ```
+ *
+ * The correct way to write it:
+ * ```html
+ * <a ng-href="http://www.gravatar.com/avatar/{{hash}}">link1</a>
+ * ```
+ *
+ * @element A
+ * @param {template} ngHref any string which can contain `{{}}` markup.
+ *
+ * @example
+ * This example shows various combinations of `href`, `ng-href` and `ng-click` attributes
+ * in links and their different behaviors:
+    <example>
+      <file name="index.html">
+        <input ng-model="value" /><br />
+        <a id="link-1" href ng-click="value = 1">link 1</a> (link, don't reload)<br />
+        <a id="link-2" href="" ng-click="value = 2">link 2</a> (link, don't reload)<br />
+        <a id="link-3" ng-href="/{{'123'}}">link 3</a> (link, reload!)<br />
+        <a id="link-4" href="" name="xx" ng-click="value = 4">anchor</a> (link, don't reload)<br />
+        <a id="link-5" name="xxx" ng-click="value = 5">anchor</a> (no link)<br />
+        <a id="link-6" ng-href="{{value}}">link</a> (link, change location)
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should execute ng-click but not reload when href without value', function() {
+          element(by.id('link-1')).click();
+          expect(element(by.model('value')).getAttribute('value')).toEqual('1');
+          expect(element(by.id('link-1')).getAttribute('href')).toBe('');
+        });
+
+        it('should execute ng-click but not reload when href empty string', function() {
+          element(by.id('link-2')).click();
+          expect(element(by.model('value')).getAttribute('value')).toEqual('2');
+          expect(element(by.id('link-2')).getAttribute('href')).toBe('');
+        });
+
+        it('should execute ng-click and change url when ng-href specified', function() {
+          expect(element(by.id('link-3')).getAttribute('href')).toMatch(/\/123$/);
+
+          element(by.id('link-3')).click();
+
+          // At this point, we navigate away from an Angular page, so we need
+          // to use browser.driver to get the base webdriver.
+
+          browser.wait(function() {
+            return browser.driver.getCurrentUrl().then(function(url) {
+              return url.match(/\/123$/);
+            });
+          }, 5000, 'page should navigate to /123');
+        });
+
+        it('should execute ng-click but not reload when href empty string and name specified', function() {
+          element(by.id('link-4')).click();
+          expect(element(by.model('value')).getAttribute('value')).toEqual('4');
+          expect(element(by.id('link-4')).getAttribute('href')).toBe('');
+        });
+
+        it('should execute ng-click but not reload when no href but name specified', function() {
+          element(by.id('link-5')).click();
+          expect(element(by.model('value')).getAttribute('value')).toEqual('5');
+          expect(element(by.id('link-5')).getAttribute('href')).toBe(null);
+        });
+
+        it('should only change url when only ng-href', function() {
+          element(by.model('value')).clear();
+          element(by.model('value')).sendKeys('6');
+          expect(element(by.id('link-6')).getAttribute('href')).toMatch(/\/6$/);
+
+          element(by.id('link-6')).click();
+
+          // At this point, we navigate away from an Angular page, so we need
+          // to use browser.driver to get the base webdriver.
+          browser.wait(function() {
+            return browser.driver.getCurrentUrl().then(function(url) {
+              return url.match(/\/6$/);
+            });
+          }, 5000, 'page should navigate to /6');
+        });
+      </file>
+    </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngSrc
+ * @restrict A
+ * @priority 99
+ *
+ * @description
+ * Using Angular markup like `{{hash}}` in a `src` attribute doesn't
+ * work right: The browser will fetch from the URL with the literal
+ * text `{{hash}}` until Angular replaces the expression inside
+ * `{{hash}}`. The `ngSrc` directive solves this problem.
+ *
+ * The buggy way to write it:
+ * ```html
+ * <img src="http://www.gravatar.com/avatar/{{hash}}" alt="Description"/>
+ * ```
+ *
+ * The correct way to write it:
+ * ```html
+ * <img ng-src="http://www.gravatar.com/avatar/{{hash}}" alt="Description" />
+ * ```
+ *
+ * @element IMG
+ * @param {template} ngSrc any string which can contain `{{}}` markup.
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngSrcset
+ * @restrict A
+ * @priority 99
+ *
+ * @description
+ * Using Angular markup like `{{hash}}` in a `srcset` attribute doesn't
+ * work right: The browser will fetch from the URL with the literal
+ * text `{{hash}}` until Angular replaces the expression inside
+ * `{{hash}}`. The `ngSrcset` directive solves this problem.
+ *
+ * The buggy way to write it:
+ * ```html
+ * <img srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description"/>
+ * ```
+ *
+ * The correct way to write it:
+ * ```html
+ * <img ng-srcset="http://www.gravatar.com/avatar/{{hash}} 2x" alt="Description" />
+ * ```
+ *
+ * @element IMG
+ * @param {template} ngSrcset any string which can contain `{{}}` markup.
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngDisabled
+ * @restrict A
+ * @priority 100
+ *
+ * @description
+ *
+ * This directive sets the `disabled` attribute on the element if the
+ * {@link guide/expression expression} inside `ngDisabled` evaluates to truthy.
+ *
+ * A special directive is necessary because we cannot use interpolation inside the `disabled`
+ * attribute.  The following example would make the button enabled on Chrome/Firefox
+ * but not on older IEs:
+ *
+ * ```html
+ * <!-- See below for an example of ng-disabled being used correctly -->
+ * <div ng-init="isDisabled = false">
+ *  <button disabled="{{isDisabled}}">Disabled</button>
+ * </div>
+ * ```
+ *
+ * This is because the HTML specification does not require browsers to preserve the values of
+ * boolean attributes such as `disabled` (Their presence means true and their absence means false.)
+ * If we put an Angular interpolation expression into such an attribute then the
+ * binding information would be lost when the browser removes the attribute.
+ *
+ * @example
+    <example>
+      <file name="index.html">
+        <label>Click me to toggle: <input type="checkbox" ng-model="checked"></label><br/>
+        <button ng-model="button" ng-disabled="checked">Button</button>
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should toggle button', function() {
+          expect(element(by.css('button')).getAttribute('disabled')).toBeFalsy();
+          element(by.model('checked')).click();
+          expect(element(by.css('button')).getAttribute('disabled')).toBeTruthy();
+        });
+      </file>
+    </example>
+ *
+ * @element INPUT
+ * @param {expression} ngDisabled If the {@link guide/expression expression} is truthy,
+ *     then the `disabled` attribute will be set on the element
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngChecked
+ * @restrict A
+ * @priority 100
+ *
+ * @description
+ * Sets the `checked` attribute on the element, if the expression inside `ngChecked` is truthy.
+ *
+ * Note that this directive should not be used together with {@link ngModel `ngModel`},
+ * as this can lead to unexpected behavior.
+ *
+ * ### Why do we need `ngChecked`?
+ *
+ * The HTML specification does not require browsers to preserve the values of boolean attributes
+ * such as checked. (Their presence means true and their absence means false.)
+ * If we put an Angular interpolation expression into such an attribute then the
+ * binding information would be lost when the browser removes the attribute.
+ * The `ngChecked` directive solves this problem for the `checked` attribute.
+ * This complementary directive is not removed by the browser and so provides
+ * a permanent reliable place to store the binding information.
+ * @example
+    <example>
+      <file name="index.html">
+        <label>Check me to check both: <input type="checkbox" ng-model="master"></label><br/>
+        <input id="checkSlave" type="checkbox" ng-checked="master" aria-label="Slave input">
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should check both checkBoxes', function() {
+          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeFalsy();
+          element(by.model('master')).click();
+          expect(element(by.id('checkSlave')).getAttribute('checked')).toBeTruthy();
+        });
+      </file>
+    </example>
+ *
+ * @element INPUT
+ * @param {expression} ngChecked If the {@link guide/expression expression} is truthy,
+ *     then the `checked` attribute will be set on the element
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngReadonly
+ * @restrict A
+ * @priority 100
+ *
+ * @description
+ * The HTML specification does not require browsers to preserve the values of boolean attributes
+ * such as readonly. (Their presence means true and their absence means false.)
+ * If we put an Angular interpolation expression into such an attribute then the
+ * binding information would be lost when the browser removes the attribute.
+ * The `ngReadonly` directive solves this problem for the `readonly` attribute.
+ * This complementary directive is not removed by the browser and so provides
+ * a permanent reliable place to store the binding information.
+ * @example
+    <example>
+      <file name="index.html">
+        <label>Check me to make text readonly: <input type="checkbox" ng-model="checked"></label><br/>
+        <input type="text" ng-readonly="checked" value="I'm Angular" aria-label="Readonly field" />
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should toggle readonly attr', function() {
+          expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeFalsy();
+          element(by.model('checked')).click();
+          expect(element(by.css('[type="text"]')).getAttribute('readonly')).toBeTruthy();
+        });
+      </file>
+    </example>
+ *
+ * @element INPUT
+ * @param {expression} ngReadonly If the {@link guide/expression expression} is truthy,
+ *     then special attribute "readonly" will be set on the element
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngSelected
+ * @restrict A
+ * @priority 100
+ *
+ * @description
+ * The HTML specification does not require browsers to preserve the values of boolean attributes
+ * such as selected. (Their presence means true and their absence means false.)
+ * If we put an Angular interpolation expression into such an attribute then the
+ * binding information would be lost when the browser removes the attribute.
+ * The `ngSelected` directive solves this problem for the `selected` attribute.
+ * This complementary directive is not removed by the browser and so provides
+ * a permanent reliable place to store the binding information.
+ *
+ * @example
+    <example>
+      <file name="index.html">
+        <label>Check me to select: <input type="checkbox" ng-model="selected"></label><br/>
+        <select aria-label="ngSelected demo">
+          <option>Hello!</option>
+          <option id="greet" ng-selected="selected">Greetings!</option>
+        </select>
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should select Greetings!', function() {
+          expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
+          element(by.model('selected')).click();
+          expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
+        });
+      </file>
+    </example>
+ *
+ * @element OPTION
+ * @param {expression} ngSelected If the {@link guide/expression expression} is truthy,
+ *     then special attribute "selected" will be set on the element
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngOpen
+ * @restrict A
+ * @priority 100
+ *
+ * @description
+ * The HTML specification does not require browsers to preserve the values of boolean attributes
+ * such as open. (Their presence means true and their absence means false.)
+ * If we put an Angular interpolation expression into such an attribute then the
+ * binding information would be lost when the browser removes the attribute.
+ * The `ngOpen` directive solves this problem for the `open` attribute.
+ * This complementary directive is not removed by the browser and so provides
+ * a permanent reliable place to store the binding information.
+ * @example
+     <example>
+       <file name="index.html">
+         <label>Check me check multiple: <input type="checkbox" ng-model="open"></label><br/>
+         <details id="details" ng-open="open">
+            <summary>Show/Hide me</summary>
+         </details>
+       </file>
+       <file name="protractor.js" type="protractor">
+         it('should toggle open', function() {
+           expect(element(by.id('details')).getAttribute('open')).toBeFalsy();
+           element(by.model('open')).click();
+           expect(element(by.id('details')).getAttribute('open')).toBeTruthy();
+         });
+       </file>
+     </example>
+ *
+ * @element DETAILS
+ * @param {expression} ngOpen If the {@link guide/expression expression} is truthy,
+ *     then special attribute "open" will be set on the element
+ */
+
+var ngAttributeAliasDirectives = {};
+
+// boolean attrs are evaluated
+forEach(BOOLEAN_ATTR, function(propName, attrName) {
+  // binding to multiple is not supported
+  if (propName == "multiple") return;
+
+  function defaultLinkFn(scope, element, attr) {
+    scope.$watch(attr[normalized], function ngBooleanAttrWatchAction(value) {
+      attr.$set(attrName, !!value);
+    });
+  }
+
+  var normalized = directiveNormalize('ng-' + attrName);
+  var linkFn = defaultLinkFn;
+
+  if (propName === 'checked') {
+    linkFn = function(scope, element, attr) {
+      // ensuring ngChecked doesn't interfere with ngModel when both are set on the same input
+      if (attr.ngModel !== attr[normalized]) {
+        defaultLinkFn(scope, element, attr);
+      }
+    };
+  }
+
+  ngAttributeAliasDirectives[normalized] = function() {
+    return {
+      restrict: 'A',
+      priority: 100,
+      link: linkFn
+    };
+  };
+});
+
+// aliased input attrs are evaluated
+forEach(ALIASED_ATTR, function(htmlAttr, ngAttr) {
+  ngAttributeAliasDirectives[ngAttr] = function() {
+    return {
+      priority: 100,
+      link: function(scope, element, attr) {
+        //special case ngPattern when a literal regular expression value
+        //is used as the expression (this way we don't have to watch anything).
+        if (ngAttr === "ngPattern" && attr.ngPattern.charAt(0) == "/") {
+          var match = attr.ngPattern.match(REGEX_STRING_REGEXP);
+          if (match) {
+            attr.$set("ngPattern", new RegExp(match[1], match[2]));
+            return;
+          }
+        }
+
+        scope.$watch(attr[ngAttr], function ngAttrAliasWatchAction(value) {
+          attr.$set(ngAttr, value);
+        });
+      }
+    };
+  };
+});
+
+// ng-src, ng-srcset, ng-href are interpolated
+forEach(['src', 'srcset', 'href'], function(attrName) {
+  var normalized = directiveNormalize('ng-' + attrName);
+  ngAttributeAliasDirectives[normalized] = function() {
+    return {
+      priority: 99, // it needs to run after the attributes are interpolated
+      link: function(scope, element, attr) {
+        var propName = attrName,
+            name = attrName;
+
+        if (attrName === 'href' &&
+            toString.call(element.prop('href')) === '[object SVGAnimatedString]') {
+          name = 'xlinkHref';
+          attr.$attr[name] = 'xlink:href';
+          propName = null;
+        }
+
+        attr.$observe(normalized, function(value) {
+          if (!value) {
+            if (attrName === 'href') {
+              attr.$set(name, null);
+            }
+            return;
+          }
+
+          attr.$set(name, value);
+
+          // on IE, if "ng:src" directive declaration is used and "src" attribute doesn't exist
+          // then calling element.setAttribute('src', 'foo') doesn't do anything, so we need
+          // to set the property as well to achieve the desired effect.
+          // we use attr[attrName] value since $set can sanitize the url.
+          if (msie && propName) element.prop(propName, attr[name]);
+        });
+      }
+    };
+  };
+});
+
+/* global -nullFormCtrl, -SUBMITTED_CLASS, addSetValidityMethod: true
+ */
+var nullFormCtrl = {
+  $addControl: noop,
+  $$renameControl: nullFormRenameControl,
+  $removeControl: noop,
+  $setValidity: noop,
+  $setDirty: noop,
+  $setPristine: noop,
+  $setSubmitted: noop
+},
+SUBMITTED_CLASS = 'ng-submitted';
+
+function nullFormRenameControl(control, name) {
+  control.$name = name;
+}
+
+/**
+ * @ngdoc type
+ * @name form.FormController
+ *
+ * @property {boolean} $pristine True if user has not interacted with the form yet.
+ * @property {boolean} $dirty True if user has already interacted with the form.
+ * @property {boolean} $valid True if all of the containing forms and controls are valid.
+ * @property {boolean} $invalid True if at least one containing control or form is invalid.
+ * @property {boolean} $pending True if at least one containing control or form is pending.
+ * @property {boolean} $submitted True if user has submitted the form even if its invalid.
+ *
+ * @property {Object} $error Is an object hash, containing references to controls or
+ *  forms with failing validators, where:
+ *
+ *  - keys are validation tokens (error names),
+ *  - values are arrays of controls or forms that have a failing validator for given error name.
+ *
+ *  Built-in validation tokens:
+ *
+ *  - `email`
+ *  - `max`
+ *  - `maxlength`
+ *  - `min`
+ *  - `minlength`
+ *  - `number`
+ *  - `pattern`
+ *  - `required`
+ *  - `url`
+ *  - `date`
+ *  - `datetimelocal`
+ *  - `time`
+ *  - `week`
+ *  - `month`
+ *
+ * @description
+ * `FormController` keeps track of all its controls and nested forms as well as the state of them,
+ * such as being valid/invalid or dirty/pristine.
+ *
+ * Each {@link ng.directive:form form} directive creates an instance
+ * of `FormController`.
+ *
+ */
+//asks for $scope to fool the BC controller module
+FormController.$inject = ['$element', '$attrs', '$scope', '$animate', '$interpolate'];
+function FormController(element, attrs, $scope, $animate, $interpolate) {
+  var form = this,
+      controls = [];
+
+  // init state
+  form.$error = {};
+  form.$$success = {};
+  form.$pending = undefined;
+  form.$name = $interpolate(attrs.name || attrs.ngForm || '')($scope);
+  form.$dirty = false;
+  form.$pristine = true;
+  form.$valid = true;
+  form.$invalid = false;
+  form.$submitted = false;
+  form.$$parentForm = nullFormCtrl;
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$rollbackViewValue
+   *
+   * @description
+   * Rollback all form controls pending updates to the `$modelValue`.
+   *
+   * Updates may be pending by a debounced event or because the input is waiting for a some future
+   * event defined in `ng-model-options`. This method is typically needed by the reset button of
+   * a form that uses `ng-model-options` to pend updates.
+   */
+  form.$rollbackViewValue = function() {
+    forEach(controls, function(control) {
+      control.$rollbackViewValue();
+    });
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$commitViewValue
+   *
+   * @description
+   * Commit all form controls pending updates to the `$modelValue`.
+   *
+   * Updates may be pending by a debounced event or because the input is waiting for a some future
+   * event defined in `ng-model-options`. This method is rarely needed as `NgModelController`
+   * usually handles calling this in response to input events.
+   */
+  form.$commitViewValue = function() {
+    forEach(controls, function(control) {
+      control.$commitViewValue();
+    });
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$addControl
+   * @param {object} control control object, either a {@link form.FormController} or an
+   * {@link ngModel.NgModelController}
+   *
+   * @description
+   * Register a control with the form. Input elements using ngModelController do this automatically
+   * when they are linked.
+   *
+   * Note that the current state of the control will not be reflected on the new parent form. This
+   * is not an issue with normal use, as freshly compiled and linked controls are in a `$pristine`
+   * state.
+   *
+   * However, if the method is used programmatically, for example by adding dynamically created controls,
+   * or controls that have been previously removed without destroying their corresponding DOM element,
+   * it's the developers responsiblity to make sure the current state propagates to the parent form.
+   *
+   * For example, if an input control is added that is already `$dirty` and has `$error` properties,
+   * calling `$setDirty()` and `$validate()` afterwards will propagate the state to the parent form.
+   */
+  form.$addControl = function(control) {
+    // Breaking change - before, inputs whose name was "hasOwnProperty" were quietly ignored
+    // and not added to the scope.  Now we throw an error.
+    assertNotHasOwnProperty(control.$name, 'input');
+    controls.push(control);
+
+    if (control.$name) {
+      form[control.$name] = control;
+    }
+
+    control.$$parentForm = form;
+  };
+
+  // Private API: rename a form control
+  form.$$renameControl = function(control, newName) {
+    var oldName = control.$name;
+
+    if (form[oldName] === control) {
+      delete form[oldName];
+    }
+    form[newName] = control;
+    control.$name = newName;
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$removeControl
+   * @param {object} control control object, either a {@link form.FormController} or an
+   * {@link ngModel.NgModelController}
+   *
+   * @description
+   * Deregister a control from the form.
+   *
+   * Input elements using ngModelController do this automatically when they are destroyed.
+   *
+   * Note that only the removed control's validation state (`$errors`etc.) will be removed from the
+   * form. `$dirty`, `$submitted` states will not be changed, because the expected behavior can be
+   * different from case to case. For example, removing the only `$dirty` control from a form may or
+   * may not mean that the form is still `$dirty`.
+   */
+  form.$removeControl = function(control) {
+    if (control.$name && form[control.$name] === control) {
+      delete form[control.$name];
+    }
+    forEach(form.$pending, function(value, name) {
+      form.$setValidity(name, null, control);
+    });
+    forEach(form.$error, function(value, name) {
+      form.$setValidity(name, null, control);
+    });
+    forEach(form.$$success, function(value, name) {
+      form.$setValidity(name, null, control);
+    });
+
+    arrayRemove(controls, control);
+    control.$$parentForm = nullFormCtrl;
+  };
+
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$setValidity
+   *
+   * @description
+   * Sets the validity of a form control.
+   *
+   * This method will also propagate to parent forms.
+   */
+  addSetValidityMethod({
+    ctrl: this,
+    $element: element,
+    set: function(object, property, controller) {
+      var list = object[property];
+      if (!list) {
+        object[property] = [controller];
+      } else {
+        var index = list.indexOf(controller);
+        if (index === -1) {
+          list.push(controller);
+        }
+      }
+    },
+    unset: function(object, property, controller) {
+      var list = object[property];
+      if (!list) {
+        return;
+      }
+      arrayRemove(list, controller);
+      if (list.length === 0) {
+        delete object[property];
+      }
+    },
+    $animate: $animate
+  });
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$setDirty
+   *
+   * @description
+   * Sets the form to a dirty state.
+   *
+   * This method can be called to add the 'ng-dirty' class and set the form to a dirty
+   * state (ng-dirty class). This method will also propagate to parent forms.
+   */
+  form.$setDirty = function() {
+    $animate.removeClass(element, PRISTINE_CLASS);
+    $animate.addClass(element, DIRTY_CLASS);
+    form.$dirty = true;
+    form.$pristine = false;
+    form.$$parentForm.$setDirty();
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$setPristine
+   *
+   * @description
+   * Sets the form to its pristine state.
+   *
+   * This method can be called to remove the 'ng-dirty' class and set the form to its pristine
+   * state (ng-pristine class). This method will also propagate to all the controls contained
+   * in this form.
+   *
+   * Setting a form back to a pristine state is often useful when we want to 'reuse' a form after
+   * saving or resetting it.
+   */
+  form.$setPristine = function() {
+    $animate.setClass(element, PRISTINE_CLASS, DIRTY_CLASS + ' ' + SUBMITTED_CLASS);
+    form.$dirty = false;
+    form.$pristine = true;
+    form.$submitted = false;
+    forEach(controls, function(control) {
+      control.$setPristine();
+    });
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$setUntouched
+   *
+   * @description
+   * Sets the form to its untouched state.
+   *
+   * This method can be called to remove the 'ng-touched' class and set the form controls to their
+   * untouched state (ng-untouched class).
+   *
+   * Setting a form controls back to their untouched state is often useful when setting the form
+   * back to its pristine state.
+   */
+  form.$setUntouched = function() {
+    forEach(controls, function(control) {
+      control.$setUntouched();
+    });
+  };
+
+  /**
+   * @ngdoc method
+   * @name form.FormController#$setSubmitted
+   *
+   * @description
+   * Sets the form to its submitted state.
+   */
+  form.$setSubmitted = function() {
+    $animate.addClass(element, SUBMITTED_CLASS);
+    form.$submitted = true;
+    form.$$parentForm.$setSubmitted();
+  };
+}
+
+/**
+ * @ngdoc directive
+ * @name ngForm
+ * @restrict EAC
+ *
+ * @description
+ * Nestable alias of {@link ng.directive:form `form`} directive. HTML
+ * does not allow nesting of form elements. It is useful to nest forms, for example if the validity of a
+ * sub-group of controls needs to be determined.
+ *
+ * Note: the purpose of `ngForm` is to group controls,
+ * but not to be a replacement for the `<form>` tag with all of its capabilities
+ * (e.g. posting to the server, ...).
+ *
+ * @param {string=} ngForm|name Name of the form. If specified, the form controller will be published into
+ *                       related scope, under this name.
+ *
+ */
+
+ /**
+ * @ngdoc directive
+ * @name form
+ * @restrict E
+ *
+ * @description
+ * Directive that instantiates
+ * {@link form.FormController FormController}.
+ *
+ * If the `name` attribute is specified, the form controller is published onto the current scope under
+ * this name.
+ *
+ * # Alias: {@link ng.directive:ngForm `ngForm`}
+ *
+ * In Angular, forms can be nested. This means that the outer form is valid when all of the child
+ * forms are valid as well. However, browsers do not allow nesting of `<form>` elements, so
+ * Angular provides the {@link ng.directive:ngForm `ngForm`} directive which behaves identically to
+ * `<form>` but can be nested.  This allows you to have nested forms, which is very useful when
+ * using Angular validation directives in forms that are dynamically generated using the
+ * {@link ng.directive:ngRepeat `ngRepeat`} directive. Since you cannot dynamically generate the `name`
+ * attribute of input elements using interpolation, you have to wrap each set of repeated inputs in an
+ * `ngForm` directive and nest these in an outer `form` element.
+ *
+ *
+ * # CSS classes
+ *  - `ng-valid` is set if the form is valid.
+ *  - `ng-invalid` is set if the form is invalid.
+ *  - `ng-pending` is set if the form is pending.
+ *  - `ng-pristine` is set if the form is pristine.
+ *  - `ng-dirty` is set if the form is dirty.
+ *  - `ng-submitted` is set if the form was submitted.
+ *
+ * Keep in mind that ngAnimate can detect each of these classes when added and removed.
+ *
+ *
+ * # Submitting a form and preventing the default action
+ *
+ * Since the role of forms in client-side Angular applications is different than in classical
+ * roundtrip apps, it is desirable for the browser not to translate the form submission into a full
+ * page reload that sends the data to the server. Instead some javascript logic should be triggered
+ * to handle the form submission in an application-specific way.
+ *
+ * For this reason, Angular prevents the default action (form submission to the server) unless the
+ * `<form>` element has an `action` attribute specified.
+ *
+ * You can use one of the following two ways to specify what javascript method should be called when
+ * a form is submitted:
+ *
+ * - {@link ng.directive:ngSubmit ngSubmit} directive on the form element
+ * - {@link ng.directive:ngClick ngClick} directive on the first
+  *  button or input field of type submit (input[type=submit])
+ *
+ * To prevent double execution of the handler, use only one of the {@link ng.directive:ngSubmit ngSubmit}
+ * or {@link ng.directive:ngClick ngClick} directives.
+ * This is because of the following form submission rules in the HTML specification:
+ *
+ * - If a form has only one input field then hitting enter in this field triggers form submit
+ * (`ngSubmit`)
+ * - if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter
+ * doesn't trigger submit
+ * - if a form has one or more input fields and one or more buttons or input[type=submit] then
+ * hitting enter in any of the input fields will trigger the click handler on the *first* button or
+ * input[type=submit] (`ngClick`) *and* a submit handler on the enclosing form (`ngSubmit`)
+ *
+ * Any pending `ngModelOptions` changes will take place immediately when an enclosing form is
+ * submitted. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
+ * to have access to the updated model.
+ *
+ * ## Animation Hooks
+ *
+ * Animations in ngForm are triggered when any of the associated CSS classes are added and removed.
+ * These classes are: `.ng-pristine`, `.ng-dirty`, `.ng-invalid` and `.ng-valid` as well as any
+ * other validations that are performed within the form. Animations in ngForm are similar to how
+ * they work in ngClass and animations can be hooked into using CSS transitions, keyframes as well
+ * as JS animations.
+ *
+ * The following example shows a simple way to utilize CSS transitions to style a form element
+ * that has been rendered as invalid after it has been validated:
+ *
+ * <pre>
+ * //be sure to include ngAnimate as a module to hook into more
+ * //advanced animations
+ * .my-form {
+ *   transition:0.5s linear all;
+ *   background: white;
+ * }
+ * .my-form.ng-invalid {
+ *   background: red;
+ *   color:white;
+ * }
+ * </pre>
+ *
+ * @example
+    <example deps="angular-animate.js" animations="true" fixBase="true" module="formExample">
+      <file name="index.html">
+       <script>
+         angular.module('formExample', [])
+           .controller('FormController', ['$scope', function($scope) {
+             $scope.userType = 'guest';
+           }]);
+       </script>
+       <style>
+        .my-form {
+          transition:all linear 0.5s;
+          background: transparent;
+        }
+        .my-form.ng-invalid {
+          background: red;
+        }
+       </style>
+       <form name="myForm" ng-controller="FormController" class="my-form">
+         userType: <input name="input" ng-model="userType" required>
+         <span class="error" ng-show="myForm.input.$error.required">Required!</span><br>
+         <code>userType = {{userType}}</code><br>
+         <code>myForm.input.$valid = {{myForm.input.$valid}}</code><br>
+         <code>myForm.input.$error = {{myForm.input.$error}}</code><br>
+         <code>myForm.$valid = {{myForm.$valid}}</code><br>
+         <code>myForm.$error.required = {{!!myForm.$error.required}}</code><br>
+        </form>
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should initialize to model', function() {
+          var userType = element(by.binding('userType'));
+          var valid = element(by.binding('myForm.input.$valid'));
+
+          expect(userType.getText()).toContain('guest');
+          expect(valid.getText()).toContain('true');
+        });
+
+        it('should be invalid if empty', function() {
+          var userType = element(by.binding('userType'));
+          var valid = element(by.binding('myForm.input.$valid'));
+          var userInput = element(by.model('userType'));
+
+          userInput.clear();
+          userInput.sendKeys('');
+
+          expect(userType.getText()).toEqual('userType =');
+          expect(valid.getText()).toContain('false');
+        });
+      </file>
+    </example>
+ *
+ * @param {string=} name Name of the form. If specified, the form controller will be published into
+ *                       related scope, under this name.
+ */
+var formDirectiveFactory = function(isNgForm) {
+  return ['$timeout', '$parse', function($timeout, $parse) {
+    var formDirective = {
+      name: 'form',
+      restrict: isNgForm ? 'EAC' : 'E',
+      require: ['form', '^^?form'], //first is the form's own ctrl, second is an optional parent form
+      controller: FormController,
+      compile: function ngFormCompile(formElement, attr) {
+        // Setup initial state of the control
+        formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);
+
+        var nameAttr = attr.name ? 'name' : (isNgForm && attr.ngForm ? 'ngForm' : false);
+
+        return {
+          pre: function ngFormPreLink(scope, formElement, attr, ctrls) {
+            var controller = ctrls[0];
+
+            // if `action` attr is not present on the form, prevent the default action (submission)
+            if (!('action' in attr)) {
+              // we can't use jq events because if a form is destroyed during submission the default
+              // action is not prevented. see #1238
+              //
+              // IE 9 is not affected because it doesn't fire a submit event and try to do a full
+              // page reload if the form was destroyed by submission of the form via a click handler
+              // on a button in the form. Looks like an IE9 specific bug.
+              var handleFormSubmission = function(event) {
+                scope.$apply(function() {
+                  controller.$commitViewValue();
+                  controller.$setSubmitted();
+                });
+
+                event.preventDefault();
+              };
+
+              addEventListenerFn(formElement[0], 'submit', handleFormSubmission);
+
+              // unregister the preventDefault listener so that we don't not leak memory but in a
+              // way that will achieve the prevention of the default action.
+              formElement.on('$destroy', function() {
+                $timeout(function() {
+                  removeEventListenerFn(formElement[0], 'submit', handleFormSubmission);
+                }, 0, false);
+              });
+            }
+
+            var parentFormCtrl = ctrls[1] || controller.$$parentForm;
+            parentFormCtrl.$addControl(controller);
+
+            var setter = nameAttr ? getSetter(controller.$name) : noop;
+
+            if (nameAttr) {
+              setter(scope, controller);
+              attr.$observe(nameAttr, function(newValue) {
+                if (controller.$name === newValue) return;
+                setter(scope, undefined);
+                controller.$$parentForm.$$renameControl(controller, newValue);
+                setter = getSetter(controller.$name);
+                setter(scope, controller);
+              });
+            }
+            formElement.on('$destroy', function() {
+              controller.$$parentForm.$removeControl(controller);
+              setter(scope, undefined);
+              extend(controller, nullFormCtrl); //stop propagating child destruction handlers upwards
+            });
+          }
+        };
+      }
+    };
+
+    return formDirective;
+
+    function getSetter(expression) {
+      if (expression === '') {
+        //create an assignable expression, so forms with an empty name can be renamed later
+        return $parse('this[""]').assign;
+      }
+      return $parse(expression).assign || noop;
+    }
+  }];
+};
+
+var formDirective = formDirectiveFactory();
+var ngFormDirective = formDirectiveFactory(true);
+
+/* global VALID_CLASS: false,
+  INVALID_CLASS: false,
+  PRISTINE_CLASS: false,
+  DIRTY_CLASS: false,
+  UNTOUCHED_CLASS: false,
+  TOUCHED_CLASS: false,
+  ngModelMinErr: false,
+*/
+
+// Regex code is obtained from SO: https://stackoverflow.com/questions/3143070/javascript-regex-iso-datetime#answer-3143231
+var ISO_DATE_REGEXP = /\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/;
+var URL_REGEXP = /^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/;
+var EMAIL_REGEXP = /^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
+var NUMBER_REGEXP = /^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/;
+var DATE_REGEXP = /^(\d{4})-(\d{2})-(\d{2})$/;
+var DATETIMELOCAL_REGEXP = /^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
+var WEEK_REGEXP = /^(\d{4})-W(\d\d)$/;
+var MONTH_REGEXP = /^(\d{4})-(\d\d)$/;
+var TIME_REGEXP = /^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/;
+
+var inputType = {
+
+  /**
+   * @ngdoc input
+   * @name input[text]
+   *
+   * @description
+   * Standard HTML text input with angular data binding, inherited by most of the `input` elements.
+   *
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} required Adds `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+   *    minlength.
+   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
+   *    any length.
+   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
+   *    that contains the regular expression body that will be converted to a regular expression
+   *    as in the ngPattern directive.
+   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+   *    a RegExp found by evaluating the Angular expression given in the attribute value.
+   *    If the expression evaluates to a RegExp object, then this is used directly.
+   *    If the expression evaluates to a string, then it will be converted to a RegExp
+   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+   *    `new RegExp('^abc$')`.<br />
+   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+   *    start at the index of the last search's match, thus not taking the whole input value into
+   *    account.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
+   *    This parameter is ignored for input[type=password] controls, which will never trim the
+   *    input.
+   *
+   * @example
+      <example name="text-input-directive" module="textInputExample">
+        <file name="index.html">
+         <script>
+           angular.module('textInputExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.example = {
+                 text: 'guest',
+                 word: /^\s*\w*\s*$/
+               };
+             }]);
+         </script>
+         <form name="myForm" ng-controller="ExampleController">
+           <label>Single word:
+             <input type="text" name="input" ng-model="example.text"
+                    ng-pattern="example.word" required ng-trim="false">
+           </label>
+           <div role="alert">
+             <span class="error" ng-show="myForm.input.$error.required">
+               Required!</span>
+             <span class="error" ng-show="myForm.input.$error.pattern">
+               Single word only!</span>
+           </div>
+           <tt>text = {{example.text}}</tt><br/>
+           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+          </form>
+        </file>
+        <file name="protractor.js" type="protractor">
+          var text = element(by.binding('example.text'));
+          var valid = element(by.binding('myForm.input.$valid'));
+          var input = element(by.model('example.text'));
+
+          it('should initialize to model', function() {
+            expect(text.getText()).toContain('guest');
+            expect(valid.getText()).toContain('true');
+          });
+
+          it('should be invalid if empty', function() {
+            input.clear();
+            input.sendKeys('');
+
+            expect(text.getText()).toEqual('text =');
+            expect(valid.getText()).toContain('false');
+          });
+
+          it('should be invalid if multi word', function() {
+            input.clear();
+            input.sendKeys('hello world');
+
+            expect(valid.getText()).toContain('false');
+          });
+        </file>
+      </example>
+   */
+  'text': textInputType,
+
+    /**
+     * @ngdoc input
+     * @name input[date]
+     *
+     * @description
+     * Input with date validation and transformation. In browsers that do not yet support
+     * the HTML5 date input, a text element will be used. In that case, text must be entered in a valid ISO-8601
+     * date format (yyyy-MM-dd), for example: `2009-01-06`. Since many
+     * modern browsers do not yet support this input type, it is important to provide cues to users on the
+     * expected input format via a placeholder or label.
+     *
+     * The model must always be a Date object, otherwise Angular will throw an error.
+     * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
+     *
+     * The timezone to be used to read/write the `Date` instance in the model can be defined using
+     * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
+     *
+     * @param {string} ngModel Assignable angular expression to data-bind to.
+     * @param {string=} name Property name of the form under which the control is published.
+     * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`. This must be a
+     *   valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
+     *   (e.g. `min="{{minDate | date:'yyyy-MM-dd'}}"`). Note that `min` will also add native HTML5
+     *   constraint validation.
+     * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`. This must be
+     *   a valid ISO date string (yyyy-MM-dd). You can also use interpolation inside this attribute
+     *   (e.g. `max="{{maxDate | date:'yyyy-MM-dd'}}"`). Note that `max` will also add native HTML5
+     *   constraint validation.
+     * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO date string
+     *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
+     * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO date string
+     *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
+     * @param {string=} required Sets `required` validation error key if the value is not entered.
+     * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+     *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+     *    `required` when you want to data-bind to the `required` attribute.
+     * @param {string=} ngChange Angular expression to be executed when input changes due to user
+     *    interaction with the input element.
+     *
+     * @example
+     <example name="date-input-directive" module="dateInputExample">
+     <file name="index.html">
+       <script>
+          angular.module('dateInputExample', [])
+            .controller('DateController', ['$scope', function($scope) {
+              $scope.example = {
+                value: new Date(2013, 9, 22)
+              };
+            }]);
+       </script>
+       <form name="myForm" ng-controller="DateController as dateCtrl">
+          <label for="exampleInput">Pick a date in 2013:</label>
+          <input type="date" id="exampleInput" name="input" ng-model="example.value"
+              placeholder="yyyy-MM-dd" min="2013-01-01" max="2013-12-31" required />
+          <div role="alert">
+            <span class="error" ng-show="myForm.input.$error.required">
+                Required!</span>
+            <span class="error" ng-show="myForm.input.$error.date">
+                Not a valid date!</span>
+           </div>
+           <tt>value = {{example.value | date: "yyyy-MM-dd"}}</tt><br/>
+           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+       </form>
+     </file>
+     <file name="protractor.js" type="protractor">
+        var value = element(by.binding('example.value | date: "yyyy-MM-dd"'));
+        var valid = element(by.binding('myForm.input.$valid'));
+        var input = element(by.model('example.value'));
+
+        // currently protractor/webdriver does not support
+        // sending keys to all known HTML5 input controls
+        // for various browsers (see https://github.com/angular/protractor/issues/562).
+        function setInput(val) {
+          // set the value of the element and force validation.
+          var scr = "var ipt = document.getElementById('exampleInput'); " +
+          "ipt.value = '" + val + "';" +
+          "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
+          browser.executeScript(scr);
+        }
+
+        it('should initialize to model', function() {
+          expect(value.getText()).toContain('2013-10-22');
+          expect(valid.getText()).toContain('myForm.input.$valid = true');
+        });
+
+        it('should be invalid if empty', function() {
+          setInput('');
+          expect(value.getText()).toEqual('value =');
+          expect(valid.getText()).toContain('myForm.input.$valid = false');
+        });
+
+        it('should be invalid if over max', function() {
+          setInput('2015-01-01');
+          expect(value.getText()).toContain('');
+          expect(valid.getText()).toContain('myForm.input.$valid = false');
+        });
+     </file>
+     </example>
+     */
+  'date': createDateInputType('date', DATE_REGEXP,
+         createDateParser(DATE_REGEXP, ['yyyy', 'MM', 'dd']),
+         'yyyy-MM-dd'),
+
+   /**
+    * @ngdoc input
+    * @name input[datetime-local]
+    *
+    * @description
+    * Input with datetime validation and transformation. In browsers that do not yet support
+    * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
+    * local datetime format (yyyy-MM-ddTHH:mm:ss), for example: `2010-12-28T14:57:00`.
+    *
+    * The model must always be a Date object, otherwise Angular will throw an error.
+    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
+    *
+    * The timezone to be used to read/write the `Date` instance in the model can be defined using
+    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
+    *
+    * @param {string} ngModel Assignable angular expression to data-bind to.
+    * @param {string=} name Property name of the form under which the control is published.
+    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
+    *   This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
+    *   inside this attribute (e.g. `min="{{minDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
+    *   Note that `min` will also add native HTML5 constraint validation.
+    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
+    *   This must be a valid ISO datetime format (yyyy-MM-ddTHH:mm:ss). You can also use interpolation
+    *   inside this attribute (e.g. `max="{{maxDatetimeLocal | date:'yyyy-MM-ddTHH:mm:ss'}}"`).
+    *   Note that `max` will also add native HTML5 constraint validation.
+    * @param {(date|string)=} ngMin Sets the `min` validation error key to the Date / ISO datetime string
+    *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
+    * @param {(date|string)=} ngMax Sets the `max` validation error key to the Date / ISO datetime string
+    *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
+    * @param {string=} required Sets `required` validation error key if the value is not entered.
+    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+    *    `required` when you want to data-bind to the `required` attribute.
+    * @param {string=} ngChange Angular expression to be executed when input changes due to user
+    *    interaction with the input element.
+    *
+    * @example
+    <example name="datetimelocal-input-directive" module="dateExample">
+    <file name="index.html">
+      <script>
+        angular.module('dateExample', [])
+          .controller('DateController', ['$scope', function($scope) {
+            $scope.example = {
+              value: new Date(2010, 11, 28, 14, 57)
+            };
+          }]);
+      </script>
+      <form name="myForm" ng-controller="DateController as dateCtrl">
+        <label for="exampleInput">Pick a date between in 2013:</label>
+        <input type="datetime-local" id="exampleInput" name="input" ng-model="example.value"
+            placeholder="yyyy-MM-ddTHH:mm:ss" min="2001-01-01T00:00:00" max="2013-12-31T00:00:00" required />
+        <div role="alert">
+          <span class="error" ng-show="myForm.input.$error.required">
+              Required!</span>
+          <span class="error" ng-show="myForm.input.$error.datetimelocal">
+              Not a valid date!</span>
+        </div>
+        <tt>value = {{example.value | date: "yyyy-MM-ddTHH:mm:ss"}}</tt><br/>
+        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+      </form>
+    </file>
+    <file name="protractor.js" type="protractor">
+      var value = element(by.binding('example.value | date: "yyyy-MM-ddTHH:mm:ss"'));
+      var valid = element(by.binding('myForm.input.$valid'));
+      var input = element(by.model('example.value'));
+
+      // currently protractor/webdriver does not support
+      // sending keys to all known HTML5 input controls
+      // for various browsers (https://github.com/angular/protractor/issues/562).
+      function setInput(val) {
+        // set the value of the element and force validation.
+        var scr = "var ipt = document.getElementById('exampleInput'); " +
+        "ipt.value = '" + val + "';" +
+        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
+        browser.executeScript(scr);
+      }
+
+      it('should initialize to model', function() {
+        expect(value.getText()).toContain('2010-12-28T14:57:00');
+        expect(valid.getText()).toContain('myForm.input.$valid = true');
+      });
+
+      it('should be invalid if empty', function() {
+        setInput('');
+        expect(value.getText()).toEqual('value =');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+
+      it('should be invalid if over max', function() {
+        setInput('2015-01-01T23:59:00');
+        expect(value.getText()).toContain('');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+    </file>
+    </example>
+    */
+  'datetime-local': createDateInputType('datetimelocal', DATETIMELOCAL_REGEXP,
+      createDateParser(DATETIMELOCAL_REGEXP, ['yyyy', 'MM', 'dd', 'HH', 'mm', 'ss', 'sss']),
+      'yyyy-MM-ddTHH:mm:ss.sss'),
+
+  /**
+   * @ngdoc input
+   * @name input[time]
+   *
+   * @description
+   * Input with time validation and transformation. In browsers that do not yet support
+   * the HTML5 date input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
+   * local time format (HH:mm:ss), for example: `14:57:00`. Model must be a Date object. This binding will always output a
+   * Date object to the model of January 1, 1970, or local date `new Date(1970, 0, 1, HH, mm, ss)`.
+   *
+   * The model must always be a Date object, otherwise Angular will throw an error.
+   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
+   *
+   * The timezone to be used to read/write the `Date` instance in the model can be defined using
+   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
+   *   This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
+   *   attribute (e.g. `min="{{minTime | date:'HH:mm:ss'}}"`). Note that `min` will also add
+   *   native HTML5 constraint validation.
+   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
+   *   This must be a valid ISO time format (HH:mm:ss). You can also use interpolation inside this
+   *   attribute (e.g. `max="{{maxTime | date:'HH:mm:ss'}}"`). Note that `max` will also add
+   *   native HTML5 constraint validation.
+   * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO time string the
+   *   `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
+   * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO time string the
+   *   `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
+   * @param {string=} required Sets `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+   <example name="time-input-directive" module="timeExample">
+   <file name="index.html">
+     <script>
+      angular.module('timeExample', [])
+        .controller('DateController', ['$scope', function($scope) {
+          $scope.example = {
+            value: new Date(1970, 0, 1, 14, 57, 0)
+          };
+        }]);
+     </script>
+     <form name="myForm" ng-controller="DateController as dateCtrl">
+        <label for="exampleInput">Pick a between 8am and 5pm:</label>
+        <input type="time" id="exampleInput" name="input" ng-model="example.value"
+            placeholder="HH:mm:ss" min="08:00:00" max="17:00:00" required />
+        <div role="alert">
+          <span class="error" ng-show="myForm.input.$error.required">
+              Required!</span>
+          <span class="error" ng-show="myForm.input.$error.time">
+              Not a valid date!</span>
+        </div>
+        <tt>value = {{example.value | date: "HH:mm:ss"}}</tt><br/>
+        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+     </form>
+   </file>
+   <file name="protractor.js" type="protractor">
+      var value = element(by.binding('example.value | date: "HH:mm:ss"'));
+      var valid = element(by.binding('myForm.input.$valid'));
+      var input = element(by.model('example.value'));
+
+      // currently protractor/webdriver does not support
+      // sending keys to all known HTML5 input controls
+      // for various browsers (https://github.com/angular/protractor/issues/562).
+      function setInput(val) {
+        // set the value of the element and force validation.
+        var scr = "var ipt = document.getElementById('exampleInput'); " +
+        "ipt.value = '" + val + "';" +
+        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
+        browser.executeScript(scr);
+      }
+
+      it('should initialize to model', function() {
+        expect(value.getText()).toContain('14:57:00');
+        expect(valid.getText()).toContain('myForm.input.$valid = true');
+      });
+
+      it('should be invalid if empty', function() {
+        setInput('');
+        expect(value.getText()).toEqual('value =');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+
+      it('should be invalid if over max', function() {
+        setInput('23:59:00');
+        expect(value.getText()).toContain('');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+   </file>
+   </example>
+   */
+  'time': createDateInputType('time', TIME_REGEXP,
+      createDateParser(TIME_REGEXP, ['HH', 'mm', 'ss', 'sss']),
+     'HH:mm:ss.sss'),
+
+   /**
+    * @ngdoc input
+    * @name input[week]
+    *
+    * @description
+    * Input with week-of-the-year validation and transformation to Date. In browsers that do not yet support
+    * the HTML5 week input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
+    * week format (yyyy-W##), for example: `2013-W02`.
+    *
+    * The model must always be a Date object, otherwise Angular will throw an error.
+    * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
+    *
+    * The timezone to be used to read/write the `Date` instance in the model can be defined using
+    * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
+    *
+    * @param {string} ngModel Assignable angular expression to data-bind to.
+    * @param {string=} name Property name of the form under which the control is published.
+    * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
+    *   This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
+    *   attribute (e.g. `min="{{minWeek | date:'yyyy-Www'}}"`). Note that `min` will also add
+    *   native HTML5 constraint validation.
+    * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
+    *   This must be a valid ISO week format (yyyy-W##). You can also use interpolation inside this
+    *   attribute (e.g. `max="{{maxWeek | date:'yyyy-Www'}}"`). Note that `max` will also add
+    *   native HTML5 constraint validation.
+    * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
+    *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
+    * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
+    *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
+    * @param {string=} required Sets `required` validation error key if the value is not entered.
+    * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+    *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+    *    `required` when you want to data-bind to the `required` attribute.
+    * @param {string=} ngChange Angular expression to be executed when input changes due to user
+    *    interaction with the input element.
+    *
+    * @example
+    <example name="week-input-directive" module="weekExample">
+    <file name="index.html">
+      <script>
+      angular.module('weekExample', [])
+        .controller('DateController', ['$scope', function($scope) {
+          $scope.example = {
+            value: new Date(2013, 0, 3)
+          };
+        }]);
+      </script>
+      <form name="myForm" ng-controller="DateController as dateCtrl">
+        <label>Pick a date between in 2013:
+          <input id="exampleInput" type="week" name="input" ng-model="example.value"
+                 placeholder="YYYY-W##" min="2012-W32"
+                 max="2013-W52" required />
+        </label>
+        <div role="alert">
+          <span class="error" ng-show="myForm.input.$error.required">
+              Required!</span>
+          <span class="error" ng-show="myForm.input.$error.week">
+              Not a valid date!</span>
+        </div>
+        <tt>value = {{example.value | date: "yyyy-Www"}}</tt><br/>
+        <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+        <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+        <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+        <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+      </form>
+    </file>
+    <file name="protractor.js" type="protractor">
+      var value = element(by.binding('example.value | date: "yyyy-Www"'));
+      var valid = element(by.binding('myForm.input.$valid'));
+      var input = element(by.model('example.value'));
+
+      // currently protractor/webdriver does not support
+      // sending keys to all known HTML5 input controls
+      // for various browsers (https://github.com/angular/protractor/issues/562).
+      function setInput(val) {
+        // set the value of the element and force validation.
+        var scr = "var ipt = document.getElementById('exampleInput'); " +
+        "ipt.value = '" + val + "';" +
+        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
+        browser.executeScript(scr);
+      }
+
+      it('should initialize to model', function() {
+        expect(value.getText()).toContain('2013-W01');
+        expect(valid.getText()).toContain('myForm.input.$valid = true');
+      });
+
+      it('should be invalid if empty', function() {
+        setInput('');
+        expect(value.getText()).toEqual('value =');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+
+      it('should be invalid if over max', function() {
+        setInput('2015-W01');
+        expect(value.getText()).toContain('');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+    </file>
+    </example>
+    */
+  'week': createDateInputType('week', WEEK_REGEXP, weekParser, 'yyyy-Www'),
+
+  /**
+   * @ngdoc input
+   * @name input[month]
+   *
+   * @description
+   * Input with month validation and transformation. In browsers that do not yet support
+   * the HTML5 month input, a text element will be used. In that case, the text must be entered in a valid ISO-8601
+   * month format (yyyy-MM), for example: `2009-01`.
+   *
+   * The model must always be a Date object, otherwise Angular will throw an error.
+   * Invalid `Date` objects (dates whose `getTime()` is `NaN`) will be rendered as an empty string.
+   * If the model is not set to the first of the month, the next view to model update will set it
+   * to the first of the month.
+   *
+   * The timezone to be used to read/write the `Date` instance in the model can be defined using
+   * {@link ng.directive:ngModelOptions ngModelOptions}. By default, this is the timezone of the browser.
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
+   *   This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
+   *   attribute (e.g. `min="{{minMonth | date:'yyyy-MM'}}"`). Note that `min` will also add
+   *   native HTML5 constraint validation.
+   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
+   *   This must be a valid ISO month format (yyyy-MM). You can also use interpolation inside this
+   *   attribute (e.g. `max="{{maxMonth | date:'yyyy-MM'}}"`). Note that `max` will also add
+   *   native HTML5 constraint validation.
+   * @param {(date|string)=} ngMin Sets the `min` validation constraint to the Date / ISO week string
+   *   the `ngMin` expression evaluates to. Note that it does not set the `min` attribute.
+   * @param {(date|string)=} ngMax Sets the `max` validation constraint to the Date / ISO week string
+   *   the `ngMax` expression evaluates to. Note that it does not set the `max` attribute.
+
+   * @param {string=} required Sets `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+   <example name="month-input-directive" module="monthExample">
+   <file name="index.html">
+     <script>
+      angular.module('monthExample', [])
+        .controller('DateController', ['$scope', function($scope) {
+          $scope.example = {
+            value: new Date(2013, 9, 1)
+          };
+        }]);
+     </script>
+     <form name="myForm" ng-controller="DateController as dateCtrl">
+       <label for="exampleInput">Pick a month in 2013:</label>
+       <input id="exampleInput" type="month" name="input" ng-model="example.value"
+          placeholder="yyyy-MM" min="2013-01" max="2013-12" required />
+       <div role="alert">
+         <span class="error" ng-show="myForm.input.$error.required">
+            Required!</span>
+         <span class="error" ng-show="myForm.input.$error.month">
+            Not a valid month!</span>
+       </div>
+       <tt>value = {{example.value | date: "yyyy-MM"}}</tt><br/>
+       <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+       <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+       <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+       <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+     </form>
+   </file>
+   <file name="protractor.js" type="protractor">
+      var value = element(by.binding('example.value | date: "yyyy-MM"'));
+      var valid = element(by.binding('myForm.input.$valid'));
+      var input = element(by.model('example.value'));
+
+      // currently protractor/webdriver does not support
+      // sending keys to all known HTML5 input controls
+      // for various browsers (https://github.com/angular/protractor/issues/562).
+      function setInput(val) {
+        // set the value of the element and force validation.
+        var scr = "var ipt = document.getElementById('exampleInput'); " +
+        "ipt.value = '" + val + "';" +
+        "angular.element(ipt).scope().$apply(function(s) { s.myForm[ipt.name].$setViewValue('" + val + "'); });";
+        browser.executeScript(scr);
+      }
+
+      it('should initialize to model', function() {
+        expect(value.getText()).toContain('2013-10');
+        expect(valid.getText()).toContain('myForm.input.$valid = true');
+      });
+
+      it('should be invalid if empty', function() {
+        setInput('');
+        expect(value.getText()).toEqual('value =');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+
+      it('should be invalid if over max', function() {
+        setInput('2015-01');
+        expect(value.getText()).toContain('');
+        expect(valid.getText()).toContain('myForm.input.$valid = false');
+      });
+   </file>
+   </example>
+   */
+  'month': createDateInputType('month', MONTH_REGEXP,
+     createDateParser(MONTH_REGEXP, ['yyyy', 'MM']),
+     'yyyy-MM'),
+
+  /**
+   * @ngdoc input
+   * @name input[number]
+   *
+   * @description
+   * Text input with number validation and transformation. Sets the `number` validation
+   * error if not a valid number.
+   *
+   * <div class="alert alert-warning">
+   * The model must always be of type `number` otherwise Angular will throw an error.
+   * Be aware that a string containing a number is not enough. See the {@link ngModel:numfmt}
+   * error docs for more information and an example of how to convert your model if necessary.
+   * </div>
+   *
+   * ## Issues with HTML5 constraint validation
+   *
+   * In browsers that follow the
+   * [HTML5 specification](https://html.spec.whatwg.org/multipage/forms.html#number-state-%28type=number%29),
+   * `input[number]` does not work as expected with {@link ngModelOptions `ngModelOptions.allowInvalid`}.
+   * If a non-number is entered in the input, the browser will report the value as an empty string,
+   * which means the view / model values in `ngModel` and subsequently the scope value
+   * will also be an empty string.
+   *
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} min Sets the `min` validation error key if the value entered is less than `min`.
+   * @param {string=} max Sets the `max` validation error key if the value entered is greater than `max`.
+   * @param {string=} required Sets `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+   *    minlength.
+   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
+   *    any length.
+   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
+   *    that contains the regular expression body that will be converted to a regular expression
+   *    as in the ngPattern directive.
+   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+   *    a RegExp found by evaluating the Angular expression given in the attribute value.
+   *    If the expression evaluates to a RegExp object, then this is used directly.
+   *    If the expression evaluates to a string, then it will be converted to a RegExp
+   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+   *    `new RegExp('^abc$')`.<br />
+   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+   *    start at the index of the last search's match, thus not taking the whole input value into
+   *    account.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+      <example name="number-input-directive" module="numberExample">
+        <file name="index.html">
+         <script>
+           angular.module('numberExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.example = {
+                 value: 12
+               };
+             }]);
+         </script>
+         <form name="myForm" ng-controller="ExampleController">
+           <label>Number:
+             <input type="number" name="input" ng-model="example.value"
+                    min="0" max="99" required>
+          </label>
+           <div role="alert">
+             <span class="error" ng-show="myForm.input.$error.required">
+               Required!</span>
+             <span class="error" ng-show="myForm.input.$error.number">
+               Not valid number!</span>
+           </div>
+           <tt>value = {{example.value}}</tt><br/>
+           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+          </form>
+        </file>
+        <file name="protractor.js" type="protractor">
+          var value = element(by.binding('example.value'));
+          var valid = element(by.binding('myForm.input.$valid'));
+          var input = element(by.model('example.value'));
+
+          it('should initialize to model', function() {
+            expect(value.getText()).toContain('12');
+            expect(valid.getText()).toContain('true');
+          });
+
+          it('should be invalid if empty', function() {
+            input.clear();
+            input.sendKeys('');
+            expect(value.getText()).toEqual('value =');
+            expect(valid.getText()).toContain('false');
+          });
+
+          it('should be invalid if over max', function() {
+            input.clear();
+            input.sendKeys('123');
+            expect(value.getText()).toEqual('value =');
+            expect(valid.getText()).toContain('false');
+          });
+        </file>
+      </example>
+   */
+  'number': numberInputType,
+
+
+  /**
+   * @ngdoc input
+   * @name input[url]
+   *
+   * @description
+   * Text input with URL validation. Sets the `url` validation error key if the content is not a
+   * valid URL.
+   *
+   * <div class="alert alert-warning">
+   * **Note:** `input[url]` uses a regex to validate urls that is derived from the regex
+   * used in Chromium. If you need stricter validation, you can use `ng-pattern` or modify
+   * the built-in validators (see the {@link guide/forms Forms guide})
+   * </div>
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} required Sets `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+   *    minlength.
+   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
+   *    any length.
+   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
+   *    that contains the regular expression body that will be converted to a regular expression
+   *    as in the ngPattern directive.
+   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+   *    a RegExp found by evaluating the Angular expression given in the attribute value.
+   *    If the expression evaluates to a RegExp object, then this is used directly.
+   *    If the expression evaluates to a string, then it will be converted to a RegExp
+   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+   *    `new RegExp('^abc$')`.<br />
+   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+   *    start at the index of the last search's match, thus not taking the whole input value into
+   *    account.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+      <example name="url-input-directive" module="urlExample">
+        <file name="index.html">
+         <script>
+           angular.module('urlExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.url = {
+                 text: 'http://google.com'
+               };
+             }]);
+         </script>
+         <form name="myForm" ng-controller="ExampleController">
+           <label>URL:
+             <input type="url" name="input" ng-model="url.text" required>
+           <label>
+           <div role="alert">
+             <span class="error" ng-show="myForm.input.$error.required">
+               Required!</span>
+             <span class="error" ng-show="myForm.input.$error.url">
+               Not valid url!</span>
+           </div>
+           <tt>text = {{url.text}}</tt><br/>
+           <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+           <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+           <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+           <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+           <tt>myForm.$error.url = {{!!myForm.$error.url}}</tt><br/>
+          </form>
+        </file>
+        <file name="protractor.js" type="protractor">
+          var text = element(by.binding('url.text'));
+          var valid = element(by.binding('myForm.input.$valid'));
+          var input = element(by.model('url.text'));
+
+          it('should initialize to model', function() {
+            expect(text.getText()).toContain('http://google.com');
+            expect(valid.getText()).toContain('true');
+          });
+
+          it('should be invalid if empty', function() {
+            input.clear();
+            input.sendKeys('');
+
+            expect(text.getText()).toEqual('text =');
+            expect(valid.getText()).toContain('false');
+          });
+
+          it('should be invalid if not url', function() {
+            input.clear();
+            input.sendKeys('box');
+
+            expect(valid.getText()).toContain('false');
+          });
+        </file>
+      </example>
+   */
+  'url': urlInputType,
+
+
+  /**
+   * @ngdoc input
+   * @name input[email]
+   *
+   * @description
+   * Text input with email validation. Sets the `email` validation error key if not a valid email
+   * address.
+   *
+   * <div class="alert alert-warning">
+   * **Note:** `input[email]` uses a regex to validate email addresses that is derived from the regex
+   * used in Chromium. If you need stricter validation (e.g. requiring a top-level domain), you can
+   * use `ng-pattern` or modify the built-in validators (see the {@link guide/forms Forms guide})
+   * </div>
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} required Sets `required` validation error key if the value is not entered.
+   * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+   *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+   *    `required` when you want to data-bind to the `required` attribute.
+   * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+   *    minlength.
+   * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+   *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of
+   *    any length.
+   * @param {string=} pattern Similar to `ngPattern` except that the attribute value is the actual string
+   *    that contains the regular expression body that will be converted to a regular expression
+   *    as in the ngPattern directive.
+   * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+   *    a RegExp found by evaluating the Angular expression given in the attribute value.
+   *    If the expression evaluates to a RegExp object, then this is used directly.
+   *    If the expression evaluates to a string, then it will be converted to a RegExp
+   *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+   *    `new RegExp('^abc$')`.<br />
+   *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+   *    start at the index of the last search's match, thus not taking the whole input value into
+   *    account.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+      <example name="email-input-directive" module="emailExample">
+        <file name="index.html">
+         <script>
+           angular.module('emailExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.email = {
+                 text: 'me@example.com'
+               };
+             }]);
+         </script>
+           <form name="myForm" ng-controller="ExampleController">
+             <label>Email:
+               <input type="email" name="input" ng-model="email.text" required>
+             </label>
+             <div role="alert">
+               <span class="error" ng-show="myForm.input.$error.required">
+                 Required!</span>
+               <span class="error" ng-show="myForm.input.$error.email">
+                 Not valid email!</span>
+             </div>
+             <tt>text = {{email.text}}</tt><br/>
+             <tt>myForm.input.$valid = {{myForm.input.$valid}}</tt><br/>
+             <tt>myForm.input.$error = {{myForm.input.$error}}</tt><br/>
+             <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+             <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+             <tt>myForm.$error.email = {{!!myForm.$error.email}}</tt><br/>
+           </form>
+         </file>
+        <file name="protractor.js" type="protractor">
+          var text = element(by.binding('email.text'));
+          var valid = element(by.binding('myForm.input.$valid'));
+          var input = element(by.model('email.text'));
+
+          it('should initialize to model', function() {
+            expect(text.getText()).toContain('me@example.com');
+            expect(valid.getText()).toContain('true');
+          });
+
+          it('should be invalid if empty', function() {
+            input.clear();
+            input.sendKeys('');
+            expect(text.getText()).toEqual('text =');
+            expect(valid.getText()).toContain('false');
+          });
+
+          it('should be invalid if not email', function() {
+            input.clear();
+            input.sendKeys('xxx');
+
+            expect(valid.getText()).toContain('false');
+          });
+        </file>
+      </example>
+   */
+  'email': emailInputType,
+
+
+  /**
+   * @ngdoc input
+   * @name input[radio]
+   *
+   * @description
+   * HTML radio button.
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string} value The value to which the `ngModel` expression should be set when selected.
+   *    Note that `value` only supports `string` values, i.e. the scope model needs to be a string,
+   *    too. Use `ngValue` if you need complex models (`number`, `object`, ...).
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   * @param {string} ngValue Angular expression to which `ngModel` will be be set when the radio
+   *    is selected. Should be used instead of the `value` attribute if you need
+   *    a non-string `ngModel` (`boolean`, `array`, ...).
+   *
+   * @example
+      <example name="radio-input-directive" module="radioExample">
+        <file name="index.html">
+         <script>
+           angular.module('radioExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.color = {
+                 name: 'blue'
+               };
+               $scope.specialValue = {
+                 "id": "12345",
+                 "value": "green"
+               };
+             }]);
+         </script>
+         <form name="myForm" ng-controller="ExampleController">
+           <label>
+             <input type="radio" ng-model="color.name" value="red">
+             Red
+           </label><br/>
+           <label>
+             <input type="radio" ng-model="color.name" ng-value="specialValue">
+             Green
+           </label><br/>
+           <label>
+             <input type="radio" ng-model="color.name" value="blue">
+             Blue
+           </label><br/>
+           <tt>color = {{color.name | json}}</tt><br/>
+          </form>
+          Note that `ng-value="specialValue"` sets radio item's value to be the value of `$scope.specialValue`.
+        </file>
+        <file name="protractor.js" type="protractor">
+          it('should change state', function() {
+            var color = element(by.binding('color.name'));
+
+            expect(color.getText()).toContain('blue');
+
+            element.all(by.model('color.name')).get(0).click();
+
+            expect(color.getText()).toContain('red');
+          });
+        </file>
+      </example>
+   */
+  'radio': radioInputType,
+
+
+  /**
+   * @ngdoc input
+   * @name input[checkbox]
+   *
+   * @description
+   * HTML checkbox.
+   *
+   * @param {string} ngModel Assignable angular expression to data-bind to.
+   * @param {string=} name Property name of the form under which the control is published.
+   * @param {expression=} ngTrueValue The value to which the expression should be set when selected.
+   * @param {expression=} ngFalseValue The value to which the expression should be set when not selected.
+   * @param {string=} ngChange Angular expression to be executed when input changes due to user
+   *    interaction with the input element.
+   *
+   * @example
+      <example name="checkbox-input-directive" module="checkboxExample">
+        <file name="index.html">
+         <script>
+           angular.module('checkboxExample', [])
+             .controller('ExampleController', ['$scope', function($scope) {
+               $scope.checkboxModel = {
+                value1 : true,
+                value2 : 'YES'
+              };
+             }]);
+         </script>
+         <form name="myForm" ng-controller="ExampleController">
+           <label>Value1:
+             <input type="checkbox" ng-model="checkboxModel.value1">
+           </label><br/>
+           <label>Value2:
+             <input type="checkbox" ng-model="checkboxModel.value2"
+                    ng-true-value="'YES'" ng-false-value="'NO'">
+            </label><br/>
+           <tt>value1 = {{checkboxModel.value1}}</tt><br/>
+           <tt>value2 = {{checkboxModel.value2}}</tt><br/>
+          </form>
+        </file>
+        <file name="protractor.js" type="protractor">
+          it('should change state', function() {
+            var value1 = element(by.binding('checkboxModel.value1'));
+            var value2 = element(by.binding('checkboxModel.value2'));
+
+            expect(value1.getText()).toContain('true');
+            expect(value2.getText()).toContain('YES');
+
+            element(by.model('checkboxModel.value1')).click();
+            element(by.model('checkboxModel.value2')).click();
+
+            expect(value1.getText()).toContain('false');
+            expect(value2.getText()).toContain('NO');
+          });
+        </file>
+      </example>
+   */
+  'checkbox': checkboxInputType,
+
+  'hidden': noop,
+  'button': noop,
+  'submit': noop,
+  'reset': noop,
+  'file': noop
+};
+
+function stringBasedInputType(ctrl) {
+  ctrl.$formatters.push(function(value) {
+    return ctrl.$isEmpty(value) ? value : value.toString();
+  });
+}
+
+function textInputType(scope, element, attr, ctrl, $sniffer, $browser) {
+  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
+  stringBasedInputType(ctrl);
+}
+
+function baseInputType(scope, element, attr, ctrl, $sniffer, $browser) {
+  var type = lowercase(element[0].type);
+
+  // In composition mode, users are still inputing intermediate text buffer,
+  // hold the listener until composition is done.
+  // More about composition events: https://developer.mozilla.org/en-US/docs/Web/API/CompositionEvent
+  if (!$sniffer.android) {
+    var composing = false;
+
+    element.on('compositionstart', function(data) {
+      composing = true;
+    });
+
+    element.on('compositionend', function() {
+      composing = false;
+      listener();
+    });
+  }
+
+  var listener = function(ev) {
+    if (timeout) {
+      $browser.defer.cancel(timeout);
+      timeout = null;
+    }
+    if (composing) return;
+    var value = element.val(),
+        event = ev && ev.type;
+
+    // By default we will trim the value
+    // If the attribute ng-trim exists we will avoid trimming
+    // If input type is 'password', the value is never trimmed
+    if (type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')) {
+      value = trim(value);
+    }
+
+    // If a control is suffering from bad input (due to native validators), browsers discard its
+    // value, so it may be necessary to revalidate (by calling $setViewValue again) even if the
+    // control's value is the same empty value twice in a row.
+    if (ctrl.$viewValue !== value || (value === '' && ctrl.$$hasNativeValidators)) {
+      ctrl.$setViewValue(value, event);
+    }
+  };
+
+  // if the browser does support "input" event, we are fine - except on IE9 which doesn't fire the
+  // input event on backspace, delete or cut
+  if ($sniffer.hasEvent('input')) {
+    element.on('input', listener);
+  } else {
+    var timeout;
+
+    var deferListener = function(ev, input, origValue) {
+      if (!timeout) {
+        timeout = $browser.defer(function() {
+          timeout = null;
+          if (!input || input.value !== origValue) {
+            listener(ev);
+          }
+        });
+      }
+    };
+
+    element.on('keydown', function(event) {
+      var key = event.keyCode;
+
+      // ignore
+      //    command            modifiers                   arrows
+      if (key === 91 || (15 < key && key < 19) || (37 <= key && key <= 40)) return;
+
+      deferListener(event, this, this.value);
+    });
+
+    // if user modifies input value using context menu in IE, we need "paste" and "cut" events to catch it
+    if ($sniffer.hasEvent('paste')) {
+      element.on('paste cut', deferListener);
+    }
+  }
+
+  // if user paste into input using mouse on older browser
+  // or form autocomplete on newer browser, we need "change" event to catch it
+  element.on('change', listener);
+
+  ctrl.$render = function() {
+    // Workaround for Firefox validation #12102.
+    var value = ctrl.$isEmpty(ctrl.$viewValue) ? '' : ctrl.$viewValue;
+    if (element.val() !== value) {
+      element.val(value);
+    }
+  };
+}
+
+function weekParser(isoWeek, existingDate) {
+  if (isDate(isoWeek)) {
+    return isoWeek;
+  }
+
+  if (isString(isoWeek)) {
+    WEEK_REGEXP.lastIndex = 0;
+    var parts = WEEK_REGEXP.exec(isoWeek);
+    if (parts) {
+      var year = +parts[1],
+          week = +parts[2],
+          hours = 0,
+          minutes = 0,
+          seconds = 0,
+          milliseconds = 0,
+          firstThurs = getFirstThursdayOfYear(year),
+          addDays = (week - 1) * 7;
+
+      if (existingDate) {
+        hours = existingDate.getHours();
+        minutes = existingDate.getMinutes();
+        seconds = existingDate.getSeconds();
+        milliseconds = existingDate.getMilliseconds();
+      }
+
+      return new Date(year, 0, firstThurs.getDate() + addDays, hours, minutes, seconds, milliseconds);
+    }
+  }
+
+  return NaN;
+}
+
+function createDateParser(regexp, mapping) {
+  return function(iso, date) {
+    var parts, map;
+
+    if (isDate(iso)) {
+      return iso;
+    }
+
+    if (isString(iso)) {
+      // When a date is JSON'ified to wraps itself inside of an extra
+      // set of double quotes. This makes the date parsing code unable
+      // to match the date string and parse it as a date.
+      if (iso.charAt(0) == '"' && iso.charAt(iso.length - 1) == '"') {
+        iso = iso.substring(1, iso.length - 1);
+      }
+      if (ISO_DATE_REGEXP.test(iso)) {
+        return new Date(iso);
+      }
+      regexp.lastIndex = 0;
+      parts = regexp.exec(iso);
+
+      if (parts) {
+        parts.shift();
+        if (date) {
+          map = {
+            yyyy: date.getFullYear(),
+            MM: date.getMonth() + 1,
+            dd: date.getDate(),
+            HH: date.getHours(),
+            mm: date.getMinutes(),
+            ss: date.getSeconds(),
+            sss: date.getMilliseconds() / 1000
+          };
+        } else {
+          map = { yyyy: 1970, MM: 1, dd: 1, HH: 0, mm: 0, ss: 0, sss: 0 };
+        }
+
+        forEach(parts, function(part, index) {
+          if (index < mapping.length) {
+            map[mapping[index]] = +part;
+          }
+        });
+        return new Date(map.yyyy, map.MM - 1, map.dd, map.HH, map.mm, map.ss || 0, map.sss * 1000 || 0);
+      }
+    }
+
+    return NaN;
+  };
+}
+
+function createDateInputType(type, regexp, parseDate, format) {
+  return function dynamicDateInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter) {
+    badInputChecker(scope, element, attr, ctrl);
+    baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
+    var timezone = ctrl && ctrl.$options && ctrl.$options.timezone;
+    var previousDate;
+
+    ctrl.$$parserName = type;
+    ctrl.$parsers.push(function(value) {
+      if (ctrl.$isEmpty(value)) return null;
+      if (regexp.test(value)) {
+        // Note: We cannot read ctrl.$modelValue, as there might be a different
+        // parser/formatter in the processing chain so that the model
+        // contains some different data format!
+        var parsedDate = parseDate(value, previousDate);
+        if (timezone) {
+          parsedDate = convertTimezoneToLocal(parsedDate, timezone);
+        }
+        return parsedDate;
+      }
+      return undefined;
+    });
+
+    ctrl.$formatters.push(function(value) {
+      if (value && !isDate(value)) {
+        throw ngModelMinErr('datefmt', 'Expected `{0}` to be a date', value);
+      }
+      if (isValidDate(value)) {
+        previousDate = value;
+        if (previousDate && timezone) {
+          previousDate = convertTimezoneToLocal(previousDate, timezone, true);
+        }
+        return $filter('date')(value, format, timezone);
+      } else {
+        previousDate = null;
+        return '';
+      }
+    });
+
+    if (isDefined(attr.min) || attr.ngMin) {
+      var minVal;
+      ctrl.$validators.min = function(value) {
+        return !isValidDate(value) || isUndefined(minVal) || parseDate(value) >= minVal;
+      };
+      attr.$observe('min', function(val) {
+        minVal = parseObservedDateValue(val);
+        ctrl.$validate();
+      });
+    }
+
+    if (isDefined(attr.max) || attr.ngMax) {
+      var maxVal;
+      ctrl.$validators.max = function(value) {
+        return !isValidDate(value) || isUndefined(maxVal) || parseDate(value) <= maxVal;
+      };
+      attr.$observe('max', function(val) {
+        maxVal = parseObservedDateValue(val);
+        ctrl.$validate();
+      });
+    }
+
+    function isValidDate(value) {
+      // Invalid Date: getTime() returns NaN
+      return value && !(value.getTime && value.getTime() !== value.getTime());
+    }
+
+    function parseObservedDateValue(val) {
+      return isDefined(val) && !isDate(val) ? parseDate(val) || undefined : val;
+    }
+  };
+}
+
+function badInputChecker(scope, element, attr, ctrl) {
+  var node = element[0];
+  var nativeValidation = ctrl.$$hasNativeValidators = isObject(node.validity);
+  if (nativeValidation) {
+    ctrl.$parsers.push(function(value) {
+      var validity = element.prop(VALIDITY_STATE_PROPERTY) || {};
+      // Detect bug in FF35 for input[email] (https://bugzilla.mozilla.org/show_bug.cgi?id=1064430):
+      // - also sets validity.badInput (should only be validity.typeMismatch).
+      // - see http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email)
+      // - can ignore this case as we can still read out the erroneous email...
+      return validity.badInput && !validity.typeMismatch ? undefined : value;
+    });
+  }
+}
+
+function numberInputType(scope, element, attr, ctrl, $sniffer, $browser) {
+  badInputChecker(scope, element, attr, ctrl);
+  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
+
+  ctrl.$$parserName = 'number';
+  ctrl.$parsers.push(function(value) {
+    if (ctrl.$isEmpty(value))      return null;
+    if (NUMBER_REGEXP.test(value)) return parseFloat(value);
+    return undefined;
+  });
+
+  ctrl.$formatters.push(function(value) {
+    if (!ctrl.$isEmpty(value)) {
+      if (!isNumber(value)) {
+        throw ngModelMinErr('numfmt', 'Expected `{0}` to be a number', value);
+      }
+      value = value.toString();
+    }
+    return value;
+  });
+
+  if (isDefined(attr.min) || attr.ngMin) {
+    var minVal;
+    ctrl.$validators.min = function(value) {
+      return ctrl.$isEmpty(value) || isUndefined(minVal) || value >= minVal;
+    };
+
+    attr.$observe('min', function(val) {
+      if (isDefined(val) && !isNumber(val)) {
+        val = parseFloat(val, 10);
+      }
+      minVal = isNumber(val) && !isNaN(val) ? val : undefined;
+      // TODO(matsko): implement validateLater to reduce number of validations
+      ctrl.$validate();
+    });
+  }
+
+  if (isDefined(attr.max) || attr.ngMax) {
+    var maxVal;
+    ctrl.$validators.max = function(value) {
+      return ctrl.$isEmpty(value) || isUndefined(maxVal) || value <= maxVal;
+    };
+
+    attr.$observe('max', function(val) {
+      if (isDefined(val) && !isNumber(val)) {
+        val = parseFloat(val, 10);
+      }
+      maxVal = isNumber(val) && !isNaN(val) ? val : undefined;
+      // TODO(matsko): implement validateLater to reduce number of validations
+      ctrl.$validate();
+    });
+  }
+}
+
+function urlInputType(scope, element, attr, ctrl, $sniffer, $browser) {
+  // Note: no badInputChecker here by purpose as `url` is only a validation
+  // in browsers, i.e. we can always read out input.value even if it is not valid!
+  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
+  stringBasedInputType(ctrl);
+
+  ctrl.$$parserName = 'url';
+  ctrl.$validators.url = function(modelValue, viewValue) {
+    var value = modelValue || viewValue;
+    return ctrl.$isEmpty(value) || URL_REGEXP.test(value);
+  };
+}
+
+function emailInputType(scope, element, attr, ctrl, $sniffer, $browser) {
+  // Note: no badInputChecker here by purpose as `url` is only a validation
+  // in browsers, i.e. we can always read out input.value even if it is not valid!
+  baseInputType(scope, element, attr, ctrl, $sniffer, $browser);
+  stringBasedInputType(ctrl);
+
+  ctrl.$$parserName = 'email';
+  ctrl.$validators.email = function(modelValue, viewValue) {
+    var value = modelValue || viewValue;
+    return ctrl.$isEmpty(value) || EMAIL_REGEXP.test(value);
+  };
+}
+
+function radioInputType(scope, element, attr, ctrl) {
+  // make the name unique, if not defined
+  if (isUndefined(attr.name)) {
+    element.attr('name', nextUid());
+  }
+
+  var listener = function(ev) {
+    if (element[0].checked) {
+      ctrl.$setViewValue(attr.value, ev && ev.type);
+    }
+  };
+
+  element.on('click', listener);
+
+  ctrl.$render = function() {
+    var value = attr.value;
+    element[0].checked = (value == ctrl.$viewValue);
+  };
+
+  attr.$observe('value', ctrl.$render);
+}
+
+function parseConstantExpr($parse, context, name, expression, fallback) {
+  var parseFn;
+  if (isDefined(expression)) {
+    parseFn = $parse(expression);
+    if (!parseFn.constant) {
+      throw ngModelMinErr('constexpr', 'Expected constant expression for `{0}`, but saw ' +
+                                   '`{1}`.', name, expression);
+    }
+    return parseFn(context);
+  }
+  return fallback;
+}
+
+function checkboxInputType(scope, element, attr, ctrl, $sniffer, $browser, $filter, $parse) {
+  var trueValue = parseConstantExpr($parse, scope, 'ngTrueValue', attr.ngTrueValue, true);
+  var falseValue = parseConstantExpr($parse, scope, 'ngFalseValue', attr.ngFalseValue, false);
+
+  var listener = function(ev) {
+    ctrl.$setViewValue(element[0].checked, ev && ev.type);
+  };
+
+  element.on('click', listener);
+
+  ctrl.$render = function() {
+    element[0].checked = ctrl.$viewValue;
+  };
+
+  // Override the standard `$isEmpty` because the $viewValue of an empty checkbox is always set to `false`
+  // This is because of the parser below, which compares the `$modelValue` with `trueValue` to convert
+  // it to a boolean.
+  ctrl.$isEmpty = function(value) {
+    return value === false;
+  };
+
+  ctrl.$formatters.push(function(value) {
+    return equals(value, trueValue);
+  });
+
+  ctrl.$parsers.push(function(value) {
+    return value ? trueValue : falseValue;
+  });
+}
+
+
+/**
+ * @ngdoc directive
+ * @name textarea
+ * @restrict E
+ *
+ * @description
+ * HTML textarea element control with angular data-binding. The data-binding and validation
+ * properties of this element are exactly the same as those of the
+ * {@link ng.directive:input input element}.
+ *
+ * @param {string} ngModel Assignable angular expression to data-bind to.
+ * @param {string=} name Property name of the form under which the control is published.
+ * @param {string=} required Sets `required` validation error key if the value is not entered.
+ * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+ *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+ *    `required` when you want to data-bind to the `required` attribute.
+ * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+ *    minlength.
+ * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+ *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
+ *    length.
+ * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+ *    a RegExp found by evaluating the Angular expression given in the attribute value.
+ *    If the expression evaluates to a RegExp object, then this is used directly.
+ *    If the expression evaluates to a string, then it will be converted to a RegExp
+ *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+ *    `new RegExp('^abc$')`.<br />
+ *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+ *    start at the index of the last search's match, thus not taking the whole input value into
+ *    account.
+ * @param {string=} ngChange Angular expression to be executed when input changes due to user
+ *    interaction with the input element.
+ * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name input
+ * @restrict E
+ *
+ * @description
+ * HTML input element control. When used together with {@link ngModel `ngModel`}, it provides data-binding,
+ * input state control, and validation.
+ * Input control follows HTML5 input types and polyfills the HTML5 validation behavior for older browsers.
+ *
+ * <div class="alert alert-warning">
+ * **Note:** Not every feature offered is available for all input types.
+ * Specifically, data binding and event handling via `ng-model` is unsupported for `input[file]`.
+ * </div>
+ *
+ * @param {string} ngModel Assignable angular expression to data-bind to.
+ * @param {string=} name Property name of the form under which the control is published.
+ * @param {string=} required Sets `required` validation error key if the value is not entered.
+ * @param {boolean=} ngRequired Sets `required` attribute if set to true
+ * @param {number=} ngMinlength Sets `minlength` validation error key if the value is shorter than
+ *    minlength.
+ * @param {number=} ngMaxlength Sets `maxlength` validation error key if the value is longer than
+ *    maxlength. Setting the attribute to a negative or non-numeric value, allows view values of any
+ *    length.
+ * @param {string=} ngPattern Sets `pattern` validation error key if the ngModel value does not match
+ *    a RegExp found by evaluating the Angular expression given in the attribute value.
+ *    If the expression evaluates to a RegExp object, then this is used directly.
+ *    If the expression evaluates to a string, then it will be converted to a RegExp
+ *    after wrapping it in `^` and `$` characters. For instance, `"abc"` will be converted to
+ *    `new RegExp('^abc$')`.<br />
+ *    **Note:** Avoid using the `g` flag on the RegExp, as it will cause each successive search to
+ *    start at the index of the last search's match, thus not taking the whole input value into
+ *    account.
+ * @param {string=} ngChange Angular expression to be executed when input changes due to user
+ *    interaction with the input element.
+ * @param {boolean=} [ngTrim=true] If set to false Angular will not automatically trim the input.
+ *    This parameter is ignored for input[type=password] controls, which will never trim the
+ *    input.
+ *
+ * @example
+    <example name="input-directive" module="inputExample">
+      <file name="index.html">
+       <script>
+          angular.module('inputExample', [])
+            .controller('ExampleController', ['$scope', function($scope) {
+              $scope.user = {name: 'guest', last: 'visitor'};
+            }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <form name="myForm">
+           <label>
+              User name:
+              <input type="text" name="userName" ng-model="user.name" required>
+           </label>
+           <div role="alert">
+             <span class="error" ng-show="myForm.userName.$error.required">
+              Required!</span>
+           </div>
+           <label>
+              Last name:
+              <input type="text" name="lastName" ng-model="user.last"
+              ng-minlength="3" ng-maxlength="10">
+           </label>
+           <div role="alert">
+             <span class="error" ng-show="myForm.lastName.$error.minlength">
+               Too short!</span>
+             <span class="error" ng-show="myForm.lastName.$error.maxlength">
+               Too long!</span>
+           </div>
+         </form>
+         <hr>
+         <tt>user = {{user}}</tt><br/>
+         <tt>myForm.userName.$valid = {{myForm.userName.$valid}}</tt><br/>
+         <tt>myForm.userName.$error = {{myForm.userName.$error}}</tt><br/>
+         <tt>myForm.lastName.$valid = {{myForm.lastName.$valid}}</tt><br/>
+         <tt>myForm.lastName.$error = {{myForm.lastName.$error}}</tt><br/>
+         <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+         <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+         <tt>myForm.$error.minlength = {{!!myForm.$error.minlength}}</tt><br/>
+         <tt>myForm.$error.maxlength = {{!!myForm.$error.maxlength}}</tt><br/>
+       </div>
+      </file>
+      <file name="protractor.js" type="protractor">
+        var user = element(by.exactBinding('user'));
+        var userNameValid = element(by.binding('myForm.userName.$valid'));
+        var lastNameValid = element(by.binding('myForm.lastName.$valid'));
+        var lastNameError = element(by.binding('myForm.lastName.$error'));
+        var formValid = element(by.binding('myForm.$valid'));
+        var userNameInput = element(by.model('user.name'));
+        var userLastInput = element(by.model('user.last'));
+
+        it('should initialize to model', function() {
+          expect(user.getText()).toContain('{"name":"guest","last":"visitor"}');
+          expect(userNameValid.getText()).toContain('true');
+          expect(formValid.getText()).toContain('true');
+        });
+
+        it('should be invalid if empty when required', function() {
+          userNameInput.clear();
+          userNameInput.sendKeys('');
+
+          expect(user.getText()).toContain('{"last":"visitor"}');
+          expect(userNameValid.getText()).toContain('false');
+          expect(formValid.getText()).toContain('false');
+        });
+
+        it('should be valid if empty when min length is set', function() {
+          userLastInput.clear();
+          userLastInput.sendKeys('');
+
+          expect(user.getText()).toContain('{"name":"guest","last":""}');
+          expect(lastNameValid.getText()).toContain('true');
+          expect(formValid.getText()).toContain('true');
+        });
+
+        it('should be invalid if less than required min length', function() {
+          userLastInput.clear();
+          userLastInput.sendKeys('xx');
+
+          expect(user.getText()).toContain('{"name":"guest"}');
+          expect(lastNameValid.getText()).toContain('false');
+          expect(lastNameError.getText()).toContain('minlength');
+          expect(formValid.getText()).toContain('false');
+        });
+
+        it('should be invalid if longer than max length', function() {
+          userLastInput.clear();
+          userLastInput.sendKeys('some ridiculously long name');
+
+          expect(user.getText()).toContain('{"name":"guest"}');
+          expect(lastNameValid.getText()).toContain('false');
+          expect(lastNameError.getText()).toContain('maxlength');
+          expect(formValid.getText()).toContain('false');
+        });
+      </file>
+    </example>
+ */
+var inputDirective = ['$browser', '$sniffer', '$filter', '$parse',
+    function($browser, $sniffer, $filter, $parse) {
+  return {
+    restrict: 'E',
+    require: ['?ngModel'],
+    link: {
+      pre: function(scope, element, attr, ctrls) {
+        if (ctrls[0]) {
+          (inputType[lowercase(attr.type)] || inputType.text)(scope, element, attr, ctrls[0], $sniffer,
+                                                              $browser, $filter, $parse);
+        }
+      }
+    }
+  };
+}];
+
+
+
+var CONSTANT_VALUE_REGEXP = /^(true|false|\d+)$/;
+/**
+ * @ngdoc directive
+ * @name ngValue
+ *
+ * @description
+ * Binds the given expression to the value of `<option>` or {@link input[radio] `input[radio]`},
+ * so that when the element is selected, the {@link ngModel `ngModel`} of that element is set to
+ * the bound value.
+ *
+ * `ngValue` is useful when dynamically generating lists of radio buttons using
+ * {@link ngRepeat `ngRepeat`}, as shown below.
+ *
+ * Likewise, `ngValue` can be used to generate `<option>` elements for
+ * the {@link select `select`} element. In that case however, only strings are supported
+ * for the `value `attribute, so the resulting `ngModel` will always be a string.
+ * Support for `select` models with non-string values is available via `ngOptions`.
+ *
+ * @element input
+ * @param {string=} ngValue angular expression, whose value will be bound to the `value` attribute
+ *   of the `input` element
+ *
+ * @example
+    <example name="ngValue-directive" module="valueExample">
+      <file name="index.html">
+       <script>
+          angular.module('valueExample', [])
+            .controller('ExampleController', ['$scope', function($scope) {
+              $scope.names = ['pizza', 'unicorns', 'robots'];
+              $scope.my = { favorite: 'unicorns' };
+            }]);
+       </script>
+        <form ng-controller="ExampleController">
+          <h2>Which is your favorite?</h2>
+            <label ng-repeat="name in names" for="{{name}}">
+              {{name}}
+              <input type="radio"
+                     ng-model="my.favorite"
+                     ng-value="name"
+                     id="{{name}}"
+                     name="favorite">
+            </label>
+          <div>You chose {{my.favorite}}</div>
+        </form>
+      </file>
+      <file name="protractor.js" type="protractor">
+        var favorite = element(by.binding('my.favorite'));
+
+        it('should initialize to model', function() {
+          expect(favorite.getText()).toContain('unicorns');
+        });
+        it('should bind the values to the inputs', function() {
+          element.all(by.model('my.favorite')).get(0).click();
+          expect(favorite.getText()).toContain('pizza');
+        });
+      </file>
+    </example>
+ */
+var ngValueDirective = function() {
+  return {
+    restrict: 'A',
+    priority: 100,
+    compile: function(tpl, tplAttr) {
+      if (CONSTANT_VALUE_REGEXP.test(tplAttr.ngValue)) {
+        return function ngValueConstantLink(scope, elm, attr) {
+          attr.$set('value', scope.$eval(attr.ngValue));
+        };
+      } else {
+        return function ngValueLink(scope, elm, attr) {
+          scope.$watch(attr.ngValue, function valueWatchAction(value) {
+            attr.$set('value', value);
+          });
+        };
+      }
+    }
+  };
+};
+
+/**
+ * @ngdoc directive
+ * @name ngBind
+ * @restrict AC
+ *
+ * @description
+ * The `ngBind` attribute tells Angular to replace the text content of the specified HTML element
+ * with the value of a given expression, and to update the text content when the value of that
+ * expression changes.
+ *
+ * Typically, you don't use `ngBind` directly, but instead you use the double curly markup like
+ * `{{ expression }}` which is similar but less verbose.
+ *
+ * It is preferable to use `ngBind` instead of `{{ expression }}` if a template is momentarily
+ * displayed by the browser in its raw state before Angular compiles it. Since `ngBind` is an
+ * element attribute, it makes the bindings invisible to the user while the page is loading.
+ *
+ * An alternative solution to this problem would be using the
+ * {@link ng.directive:ngCloak ngCloak} directive.
+ *
+ *
+ * @element ANY
+ * @param {expression} ngBind {@link guide/expression Expression} to evaluate.
+ *
+ * @example
+ * Enter a name in the Live Preview text box; the greeting below the text box changes instantly.
+   <example module="bindExample">
+     <file name="index.html">
+       <script>
+         angular.module('bindExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.name = 'Whirled';
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <label>Enter name: <input type="text" ng-model="name"></label><br>
+         Hello <span ng-bind="name"></span>!
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-bind', function() {
+         var nameInput = element(by.model('name'));
+
+         expect(element(by.binding('name')).getText()).toBe('Whirled');
+         nameInput.clear();
+         nameInput.sendKeys('world');
+         expect(element(by.binding('name')).getText()).toBe('world');
+       });
+     </file>
+   </example>
+ */
+var ngBindDirective = ['$compile', function($compile) {
+  return {
+    restrict: 'AC',
+    compile: function ngBindCompile(templateElement) {
+      $compile.$$addBindingClass(templateElement);
+      return function ngBindLink(scope, element, attr) {
+        $compile.$$addBindingInfo(element, attr.ngBind);
+        element = element[0];
+        scope.$watch(attr.ngBind, function ngBindWatchAction(value) {
+          element.textContent = isUndefined(value) ? '' : value;
+        });
+      };
+    }
+  };
+}];
+
+
+/**
+ * @ngdoc directive
+ * @name ngBindTemplate
+ *
+ * @description
+ * The `ngBindTemplate` directive specifies that the element
+ * text content should be replaced with the interpolation of the template
+ * in the `ngBindTemplate` attribute.
+ * Unlike `ngBind`, the `ngBindTemplate` can contain multiple `{{` `}}`
+ * expressions. This directive is needed since some HTML elements
+ * (such as TITLE and OPTION) cannot contain SPAN elements.
+ *
+ * @element ANY
+ * @param {string} ngBindTemplate template of form
+ *   <tt>{{</tt> <tt>expression</tt> <tt>}}</tt> to eval.
+ *
+ * @example
+ * Try it here: enter text in text box and watch the greeting change.
+   <example module="bindExample">
+     <file name="index.html">
+       <script>
+         angular.module('bindExample', [])
+           .controller('ExampleController', ['$scope', function($scope) {
+             $scope.salutation = 'Hello';
+             $scope.name = 'World';
+           }]);
+       </script>
+       <div ng-controller="ExampleController">
+        <label>Salutation: <input type="text" ng-model="salutation"></label><br>
+        <label>Name: <input type="text" ng-model="name"></label><br>
+        <pre ng-bind-template="{{salutation}} {{name}}!"></pre>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-bind', function() {
+         var salutationElem = element(by.binding('salutation'));
+         var salutationInput = element(by.model('salutation'));
+         var nameInput = element(by.model('name'));
+
+         expect(salutationElem.getText()).toBe('Hello World!');
+
+         salutationInput.clear();
+         salutationInput.sendKeys('Greetings');
+         nameInput.clear();
+         nameInput.sendKeys('user');
+
+         expect(salutationElem.getText()).toBe('Greetings user!');
+       });
+     </file>
+   </example>
+ */
+var ngBindTemplateDirective = ['$interpolate', '$compile', function($interpolate, $compile) {
+  return {
+    compile: function ngBindTemplateCompile(templateElement) {
+      $compile.$$addBindingClass(templateElement);
+      return function ngBindTemplateLink(scope, element, attr) {
+        var interpolateFn = $interpolate(element.attr(attr.$attr.ngBindTemplate));
+        $compile.$$addBindingInfo(element, interpolateFn.expressions);
+        element = element[0];
+        attr.$observe('ngBindTemplate', function(value) {
+          element.textContent = isUndefined(value) ? '' : value;
+        });
+      };
+    }
+  };
+}];
+
+
+/**
+ * @ngdoc directive
+ * @name ngBindHtml
+ *
+ * @description
+ * Evaluates the expression and inserts the resulting HTML into the element in a secure way. By default,
+ * the resulting HTML content will be sanitized using the {@link ngSanitize.$sanitize $sanitize} service.
+ * To utilize this functionality, ensure that `$sanitize` is available, for example, by including {@link
+ * ngSanitize} in your module's dependencies (not in core Angular). In order to use {@link ngSanitize}
+ * in your module's dependencies, you need to include "angular-sanitize.js" in your application.
+ *
+ * You may also bypass sanitization for values you know are safe. To do so, bind to
+ * an explicitly trusted value via {@link ng.$sce#trustAsHtml $sce.trustAsHtml}.  See the example
+ * under {@link ng.$sce#show-me-an-example-using-sce- Strict Contextual Escaping (SCE)}.
+ *
+ * Note: If a `$sanitize` service is unavailable and the bound value isn't explicitly trusted, you
+ * will have an exception (instead of an exploit.)
+ *
+ * @element ANY
+ * @param {expression} ngBindHtml {@link guide/expression Expression} to evaluate.
+ *
+ * @example
+
+   <example module="bindHtmlExample" deps="angular-sanitize.js">
+     <file name="index.html">
+       <div ng-controller="ExampleController">
+        <p ng-bind-html="myHTML"></p>
+       </div>
+     </file>
+
+     <file name="script.js">
+       angular.module('bindHtmlExample', ['ngSanitize'])
+         .controller('ExampleController', ['$scope', function($scope) {
+           $scope.myHTML =
+              'I am an <code>HTML</code>string with ' +
+              '<a href="#">links!</a> and other <em>stuff</em>';
+         }]);
+     </file>
+
+     <file name="protractor.js" type="protractor">
+       it('should check ng-bind-html', function() {
+         expect(element(by.binding('myHTML')).getText()).toBe(
+             'I am an HTMLstring with links! and other stuff');
+       });
+     </file>
+   </example>
+ */
+var ngBindHtmlDirective = ['$sce', '$parse', '$compile', function($sce, $parse, $compile) {
+  return {
+    restrict: 'A',
+    compile: function ngBindHtmlCompile(tElement, tAttrs) {
+      var ngBindHtmlGetter = $parse(tAttrs.ngBindHtml);
+      var ngBindHtmlWatch = $parse(tAttrs.ngBindHtml, function getStringValue(value) {
+        return (value || '').toString();
+      });
+      $compile.$$addBindingClass(tElement);
+
+      return function ngBindHtmlLink(scope, element, attr) {
+        $compile.$$addBindingInfo(element, attr.ngBindHtml);
+
+        scope.$watch(ngBindHtmlWatch, function ngBindHtmlWatchAction() {
+          // we re-evaluate the expr because we want a TrustedValueHolderType
+          // for $sce, not a string
+          element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');
+        });
+      };
+    }
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngChange
+ *
+ * @description
+ * Evaluate the given expression when the user changes the input.
+ * The expression is evaluated immediately, unlike the JavaScript onchange event
+ * which only triggers at the end of a change (usually, when the user leaves the
+ * form element or presses the return key).
+ *
+ * The `ngChange` expression is only evaluated when a change in the input value causes
+ * a new value to be committed to the model.
+ *
+ * It will not be evaluated:
+ * * if the value returned from the `$parsers` transformation pipeline has not changed
+ * * if the input has continued to be invalid since the model will stay `null`
+ * * if the model is changed programmatically and not by a change to the input value
+ *
+ *
+ * Note, this directive requires `ngModel` to be present.
+ *
+ * @element input
+ * @param {expression} ngChange {@link guide/expression Expression} to evaluate upon change
+ * in input value.
+ *
+ * @example
+ * <example name="ngChange-directive" module="changeExample">
+ *   <file name="index.html">
+ *     <script>
+ *       angular.module('changeExample', [])
+ *         .controller('ExampleController', ['$scope', function($scope) {
+ *           $scope.counter = 0;
+ *           $scope.change = function() {
+ *             $scope.counter++;
+ *           };
+ *         }]);
+ *     </script>
+ *     <div ng-controller="ExampleController">
+ *       <input type="checkbox" ng-model="confirmed" ng-change="change()" id="ng-change-example1" />
+ *       <input type="checkbox" ng-model="confirmed" id="ng-change-example2" />
+ *       <label for="ng-change-example2">Confirmed</label><br />
+ *       <tt>debug = {{confirmed}}</tt><br/>
+ *       <tt>counter = {{counter}}</tt><br/>
+ *     </div>
+ *   </file>
+ *   <file name="protractor.js" type="protractor">
+ *     var counter = element(by.binding('counter'));
+ *     var debug = element(by.binding('confirmed'));
+ *
+ *     it('should evaluate the expression if changing from view', function() {
+ *       expect(counter.getText()).toContain('0');
+ *
+ *       element(by.id('ng-change-example1')).click();
+ *
+ *       expect(counter.getText()).toContain('1');
+ *       expect(debug.getText()).toContain('true');
+ *     });
+ *
+ *     it('should not evaluate the expression if changing from model', function() {
+ *       element(by.id('ng-change-example2')).click();
+
+ *       expect(counter.getText()).toContain('0');
+ *       expect(debug.getText()).toContain('true');
+ *     });
+ *   </file>
+ * </example>
+ */
+var ngChangeDirective = valueFn({
+  restrict: 'A',
+  require: 'ngModel',
+  link: function(scope, element, attr, ctrl) {
+    ctrl.$viewChangeListeners.push(function() {
+      scope.$eval(attr.ngChange);
+    });
+  }
+});
+
+function classDirective(name, selector) {
+  name = 'ngClass' + name;
+  return ['$animate', function($animate) {
+    return {
+      restrict: 'AC',
+      link: function(scope, element, attr) {
+        var oldVal;
+
+        scope.$watch(attr[name], ngClassWatchAction, true);
+
+        attr.$observe('class', function(value) {
+          ngClassWatchAction(scope.$eval(attr[name]));
+        });
+
+
+        if (name !== 'ngClass') {
+          scope.$watch('$index', function($index, old$index) {
+            // jshint bitwise: false
+            var mod = $index & 1;
+            if (mod !== (old$index & 1)) {
+              var classes = arrayClasses(scope.$eval(attr[name]));
+              mod === selector ?
+                addClasses(classes) :
+                removeClasses(classes);
+            }
+          });
+        }
+
+        function addClasses(classes) {
+          var newClasses = digestClassCounts(classes, 1);
+          attr.$addClass(newClasses);
+        }
+
+        function removeClasses(classes) {
+          var newClasses = digestClassCounts(classes, -1);
+          attr.$removeClass(newClasses);
+        }
+
+        function digestClassCounts(classes, count) {
+          // Use createMap() to prevent class assumptions involving property
+          // names in Object.prototype
+          var classCounts = element.data('$classCounts') || createMap();
+          var classesToUpdate = [];
+          forEach(classes, function(className) {
+            if (count > 0 || classCounts[className]) {
+              classCounts[className] = (classCounts[className] || 0) + count;
+              if (classCounts[className] === +(count > 0)) {
+                classesToUpdate.push(className);
+              }
+            }
+          });
+          element.data('$classCounts', classCounts);
+          return classesToUpdate.join(' ');
+        }
+
+        function updateClasses(oldClasses, newClasses) {
+          var toAdd = arrayDifference(newClasses, oldClasses);
+          var toRemove = arrayDifference(oldClasses, newClasses);
+          toAdd = digestClassCounts(toAdd, 1);
+          toRemove = digestClassCounts(toRemove, -1);
+          if (toAdd && toAdd.length) {
+            $animate.addClass(element, toAdd);
+          }
+          if (toRemove && toRemove.length) {
+            $animate.removeClass(element, toRemove);
+          }
+        }
+
+        function ngClassWatchAction(newVal) {
+          if (selector === true || scope.$index % 2 === selector) {
+            var newClasses = arrayClasses(newVal || []);
+            if (!oldVal) {
+              addClasses(newClasses);
+            } else if (!equals(newVal,oldVal)) {
+              var oldClasses = arrayClasses(oldVal);
+              updateClasses(oldClasses, newClasses);
+            }
+          }
+          oldVal = shallowCopy(newVal);
+        }
+      }
+    };
+
+    function arrayDifference(tokens1, tokens2) {
+      var values = [];
+
+      outer:
+      for (var i = 0; i < tokens1.length; i++) {
+        var token = tokens1[i];
+        for (var j = 0; j < tokens2.length; j++) {
+          if (token == tokens2[j]) continue outer;
+        }
+        values.push(token);
+      }
+      return values;
+    }
+
+    function arrayClasses(classVal) {
+      var classes = [];
+      if (isArray(classVal)) {
+        forEach(classVal, function(v) {
+          classes = classes.concat(arrayClasses(v));
+        });
+        return classes;
+      } else if (isString(classVal)) {
+        return classVal.split(' ');
+      } else if (isObject(classVal)) {
+        forEach(classVal, function(v, k) {
+          if (v) {
+            classes = classes.concat(k.split(' '));
+          }
+        });
+        return classes;
+      }
+      return classVal;
+    }
+  }];
+}
+
+/**
+ * @ngdoc directive
+ * @name ngClass
+ * @restrict AC
+ *
+ * @description
+ * The `ngClass` directive allows you to dynamically set CSS classes on an HTML element by databinding
+ * an expression that represents all classes to be added.
+ *
+ * The directive operates in three different ways, depending on which of three types the expression
+ * evaluates to:
+ *
+ * 1. If the expression evaluates to a string, the string should be one or more space-delimited class
+ * names.
+ *
+ * 2. If the expression evaluates to an object, then for each key-value pair of the
+ * object with a truthy value the corresponding key is used as a class name.
+ *
+ * 3. If the expression evaluates to an array, each element of the array should either be a string as in
+ * type 1 or an object as in type 2. This means that you can mix strings and objects together in an array
+ * to give you more control over what CSS classes appear. See the code below for an example of this.
+ *
+ *
+ * The directive won't add duplicate classes if a particular class was already set.
+ *
+ * When the expression changes, the previously added classes are removed and only then are the
+ * new classes added.
+ *
+ * @animations
+ * **add** - happens just before the class is applied to the elements
+ *
+ * **remove** - happens just before the class is removed from the element
+ *
+ * @element ANY
+ * @param {expression} ngClass {@link guide/expression Expression} to eval. The result
+ *   of the evaluation can be a string representing space delimited class
+ *   names, an array, or a map of class names to boolean values. In the case of a map, the
+ *   names of the properties whose values are truthy will be added as css classes to the
+ *   element.
+ *
+ * @example Example that demonstrates basic bindings via ngClass directive.
+   <example>
+     <file name="index.html">
+       <p ng-class="{strike: deleted, bold: important, 'has-error': error}">Map Syntax Example</p>
+       <label>
+          <input type="checkbox" ng-model="deleted">
+          deleted (apply "strike" class)
+       </label><br>
+       <label>
+          <input type="checkbox" ng-model="important">
+          important (apply "bold" class)
+       </label><br>
+       <label>
+          <input type="checkbox" ng-model="error">
+          error (apply "has-error" class)
+       </label>
+       <hr>
+       <p ng-class="style">Using String Syntax</p>
+       <input type="text" ng-model="style"
+              placeholder="Type: bold strike red" aria-label="Type: bold strike red">
+       <hr>
+       <p ng-class="[style1, style2, style3]">Using Array Syntax</p>
+       <input ng-model="style1"
+              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red"><br>
+       <input ng-model="style2"
+              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 2"><br>
+       <input ng-model="style3"
+              placeholder="Type: bold, strike or red" aria-label="Type: bold, strike or red 3"><br>
+       <hr>
+       <p ng-class="[style4, {orange: warning}]">Using Array and Map Syntax</p>
+       <input ng-model="style4" placeholder="Type: bold, strike" aria-label="Type: bold, strike"><br>
+       <label><input type="checkbox" ng-model="warning"> warning (apply "orange" class)</label>
+     </file>
+     <file name="style.css">
+       .strike {
+           text-decoration: line-through;
+       }
+       .bold {
+           font-weight: bold;
+       }
+       .red {
+           color: red;
+       }
+       .has-error {
+           color: red;
+           background-color: yellow;
+       }
+       .orange {
+           color: orange;
+       }
+     </file>
+     <file name="protractor.js" type="protractor">
+       var ps = element.all(by.css('p'));
+
+       it('should let you toggle the class', function() {
+
+         expect(ps.first().getAttribute('class')).not.toMatch(/bold/);
+         expect(ps.first().getAttribute('class')).not.toMatch(/has-error/);
+
+         element(by.model('important')).click();
+         expect(ps.first().getAttribute('class')).toMatch(/bold/);
+
+         element(by.model('error')).click();
+         expect(ps.first().getAttribute('class')).toMatch(/has-error/);
+       });
+
+       it('should let you toggle string example', function() {
+         expect(ps.get(1).getAttribute('class')).toBe('');
+         element(by.model('style')).clear();
+         element(by.model('style')).sendKeys('red');
+         expect(ps.get(1).getAttribute('class')).toBe('red');
+       });
+
+       it('array example should have 3 classes', function() {
+         expect(ps.get(2).getAttribute('class')).toBe('');
+         element(by.model('style1')).sendKeys('bold');
+         element(by.model('style2')).sendKeys('strike');
+         element(by.model('style3')).sendKeys('red');
+         expect(ps.get(2).getAttribute('class')).toBe('bold strike red');
+       });
+
+       it('array with map example should have 2 classes', function() {
+         expect(ps.last().getAttribute('class')).toBe('');
+         element(by.model('style4')).sendKeys('bold');
+         element(by.model('warning')).click();
+         expect(ps.last().getAttribute('class')).toBe('bold orange');
+       });
+     </file>
+   </example>
+
+   ## Animations
+
+   The example below demonstrates how to perform animations using ngClass.
+
+   <example module="ngAnimate" deps="angular-animate.js" animations="true">
+     <file name="index.html">
+      <input id="setbtn" type="button" value="set" ng-click="myVar='my-class'">
+      <input id="clearbtn" type="button" value="clear" ng-click="myVar=''">
+      <br>
+      <span class="base-class" ng-class="myVar">Sample Text</span>
+     </file>
+     <file name="style.css">
+       .base-class {
+         transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
+       }
+
+       .base-class.my-class {
+         color: red;
+         font-size:3em;
+       }
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-class', function() {
+         expect(element(by.css('.base-class')).getAttribute('class')).not.
+           toMatch(/my-class/);
+
+         element(by.id('setbtn')).click();
+
+         expect(element(by.css('.base-class')).getAttribute('class')).
+           toMatch(/my-class/);
+
+         element(by.id('clearbtn')).click();
+
+         expect(element(by.css('.base-class')).getAttribute('class')).not.
+           toMatch(/my-class/);
+       });
+     </file>
+   </example>
+
+
+   ## ngClass and pre-existing CSS3 Transitions/Animations
+   The ngClass directive still supports CSS3 Transitions/Animations even if they do not follow the ngAnimate CSS naming structure.
+   Upon animation ngAnimate will apply supplementary CSS classes to track the start and end of an animation, but this will not hinder
+   any pre-existing CSS transitions already on the element. To get an idea of what happens during a class-based animation, be sure
+   to view the step by step details of {@link $animate#addClass $animate.addClass} and
+   {@link $animate#removeClass $animate.removeClass}.
+ */
+var ngClassDirective = classDirective('', true);
+
+/**
+ * @ngdoc directive
+ * @name ngClassOdd
+ * @restrict AC
+ *
+ * @description
+ * The `ngClassOdd` and `ngClassEven` directives work exactly as
+ * {@link ng.directive:ngClass ngClass}, except they work in
+ * conjunction with `ngRepeat` and take effect only on odd (even) rows.
+ *
+ * This directive can be applied only within the scope of an
+ * {@link ng.directive:ngRepeat ngRepeat}.
+ *
+ * @element ANY
+ * @param {expression} ngClassOdd {@link guide/expression Expression} to eval. The result
+ *   of the evaluation can be a string representing space delimited class names or an array.
+ *
+ * @example
+   <example>
+     <file name="index.html">
+        <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
+          <li ng-repeat="name in names">
+           <span ng-class-odd="'odd'" ng-class-even="'even'">
+             {{name}}
+           </span>
+          </li>
+        </ol>
+     </file>
+     <file name="style.css">
+       .odd {
+         color: red;
+       }
+       .even {
+         color: blue;
+       }
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-class-odd and ng-class-even', function() {
+         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
+           toMatch(/odd/);
+         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
+           toMatch(/even/);
+       });
+     </file>
+   </example>
+ */
+var ngClassOddDirective = classDirective('Odd', 0);
+
+/**
+ * @ngdoc directive
+ * @name ngClassEven
+ * @restrict AC
+ *
+ * @description
+ * The `ngClassOdd` and `ngClassEven` directives work exactly as
+ * {@link ng.directive:ngClass ngClass}, except they work in
+ * conjunction with `ngRepeat` and take effect only on odd (even) rows.
+ *
+ * This directive can be applied only within the scope of an
+ * {@link ng.directive:ngRepeat ngRepeat}.
+ *
+ * @element ANY
+ * @param {expression} ngClassEven {@link guide/expression Expression} to eval. The
+ *   result of the evaluation can be a string representing space delimited class names or an array.
+ *
+ * @example
+   <example>
+     <file name="index.html">
+        <ol ng-init="names=['John', 'Mary', 'Cate', 'Suz']">
+          <li ng-repeat="name in names">
+           <span ng-class-odd="'odd'" ng-class-even="'even'">
+             {{name}} &nbsp; &nbsp; &nbsp;
+           </span>
+          </li>
+        </ol>
+     </file>
+     <file name="style.css">
+       .odd {
+         color: red;
+       }
+       .even {
+         color: blue;
+       }
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-class-odd and ng-class-even', function() {
+         expect(element(by.repeater('name in names').row(0).column('name')).getAttribute('class')).
+           toMatch(/odd/);
+         expect(element(by.repeater('name in names').row(1).column('name')).getAttribute('class')).
+           toMatch(/even/);
+       });
+     </file>
+   </example>
+ */
+var ngClassEvenDirective = classDirective('Even', 1);
+
+/**
+ * @ngdoc directive
+ * @name ngCloak
+ * @restrict AC
+ *
+ * @description
+ * The `ngCloak` directive is used to prevent the Angular html template from being briefly
+ * displayed by the browser in its raw (uncompiled) form while your application is loading. Use this
+ * directive to avoid the undesirable flicker effect caused by the html template display.
+ *
+ * The directive can be applied to the `<body>` element, but the preferred usage is to apply
+ * multiple `ngCloak` directives to small portions of the page to permit progressive rendering
+ * of the browser view.
+ *
+ * `ngCloak` works in cooperation with the following css rule embedded within `angular.js` and
+ * `angular.min.js`.
+ * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
+ *
+ * ```css
+ * [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
+ *   display: none !important;
+ * }
+ * ```
+ *
+ * When this css rule is loaded by the browser, all html elements (including their children) that
+ * are tagged with the `ngCloak` directive are hidden. When Angular encounters this directive
+ * during the compilation of the template it deletes the `ngCloak` element attribute, making
+ * the compiled element visible.
+ *
+ * For the best result, the `angular.js` script must be loaded in the head section of the html
+ * document; alternatively, the css rule above must be included in the external stylesheet of the
+ * application.
+ *
+ * @element ANY
+ *
+ * @example
+   <example>
+     <file name="index.html">
+        <div id="template1" ng-cloak>{{ 'hello' }}</div>
+        <div id="template2" class="ng-cloak">{{ 'world' }}</div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should remove the template directive and css class', function() {
+         expect($('#template1').getAttribute('ng-cloak')).
+           toBeNull();
+         expect($('#template2').getAttribute('ng-cloak')).
+           toBeNull();
+       });
+     </file>
+   </example>
+ *
+ */
+var ngCloakDirective = ngDirective({
+  compile: function(element, attr) {
+    attr.$set('ngCloak', undefined);
+    element.removeClass('ng-cloak');
+  }
+});
+
+/**
+ * @ngdoc directive
+ * @name ngController
+ *
+ * @description
+ * The `ngController` directive attaches a controller class to the view. This is a key aspect of how angular
+ * supports the principles behind the Model-View-Controller design pattern.
+ *
+ * MVC components in angular:
+ *
+ * * Model — Models are the properties of a scope; scopes are attached to the DOM where scope properties
+ *   are accessed through bindings.
+ * * View — The template (HTML with data bindings) that is rendered into the View.
+ * * Controller — The `ngController` directive specifies a Controller class; the class contains business
+ *   logic behind the application to decorate the scope with functions and values
+ *
+ * Note that you can also attach controllers to the DOM by declaring it in a route definition
+ * via the {@link ngRoute.$route $route} service. A common mistake is to declare the controller
+ * again using `ng-controller` in the template itself.  This will cause the controller to be attached
+ * and executed twice.
+ *
+ * @element ANY
+ * @scope
+ * @priority 500
+ * @param {expression} ngController Name of a constructor function registered with the current
+ * {@link ng.$controllerProvider $controllerProvider} or an {@link guide/expression expression}
+ * that on the current scope evaluates to a constructor function.
+ *
+ * The controller instance can be published into a scope property by specifying
+ * `ng-controller="as propertyName"`.
+ *
+ * If the current `$controllerProvider` is configured to use globals (via
+ * {@link ng.$controllerProvider#allowGlobals `$controllerProvider.allowGlobals()` }), this may
+ * also be the name of a globally accessible constructor function (not recommended).
+ *
+ * @example
+ * Here is a simple form for editing user contact information. Adding, removing, clearing, and
+ * greeting are methods declared on the controller (see source tab). These methods can
+ * easily be called from the angular markup. Any changes to the data are automatically reflected
+ * in the View without the need for a manual update.
+ *
+ * Two different declaration styles are included below:
+ *
+ * * one binds methods and properties directly onto the controller using `this`:
+ * `ng-controller="SettingsController1 as settings"`
+ * * one injects `$scope` into the controller:
+ * `ng-controller="SettingsController2"`
+ *
+ * The second option is more common in the Angular community, and is generally used in boilerplates
+ * and in this guide. However, there are advantages to binding properties directly to the controller
+ * and avoiding scope.
+ *
+ * * Using `controller as` makes it obvious which controller you are accessing in the template when
+ * multiple controllers apply to an element.
+ * * If you are writing your controllers as classes you have easier access to the properties and
+ * methods, which will appear on the scope, from inside the controller code.
+ * * Since there is always a `.` in the bindings, you don't have to worry about prototypal
+ * inheritance masking primitives.
+ *
+ * This example demonstrates the `controller as` syntax.
+ *
+ * <example name="ngControllerAs" module="controllerAsExample">
+ *   <file name="index.html">
+ *    <div id="ctrl-as-exmpl" ng-controller="SettingsController1 as settings">
+ *      <label>Name: <input type="text" ng-model="settings.name"/></label>
+ *      <button ng-click="settings.greet()">greet</button><br/>
+ *      Contact:
+ *      <ul>
+ *        <li ng-repeat="contact in settings.contacts">
+ *          <select ng-model="contact.type" aria-label="Contact method" id="select_{{$index}}">
+ *             <option>phone</option>
+ *             <option>email</option>
+ *          </select>
+ *          <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" />
+ *          <button ng-click="settings.clearContact(contact)">clear</button>
+ *          <button ng-click="settings.removeContact(contact)" aria-label="Remove">X</button>
+ *        </li>
+ *        <li><button ng-click="settings.addContact()">add</button></li>
+ *     </ul>
+ *    </div>
+ *   </file>
+ *   <file name="app.js">
+ *    angular.module('controllerAsExample', [])
+ *      .controller('SettingsController1', SettingsController1);
+ *
+ *    function SettingsController1() {
+ *      this.name = "John Smith";
+ *      this.contacts = [
+ *        {type: 'phone', value: '408 555 1212'},
+ *        {type: 'email', value: 'john.smith@example.org'} ];
+ *    }
+ *
+ *    SettingsController1.prototype.greet = function() {
+ *      alert(this.name);
+ *    };
+ *
+ *    SettingsController1.prototype.addContact = function() {
+ *      this.contacts.push({type: 'email', value: 'yourname@example.org'});
+ *    };
+ *
+ *    SettingsController1.prototype.removeContact = function(contactToRemove) {
+ *     var index = this.contacts.indexOf(contactToRemove);
+ *      this.contacts.splice(index, 1);
+ *    };
+ *
+ *    SettingsController1.prototype.clearContact = function(contact) {
+ *      contact.type = 'phone';
+ *      contact.value = '';
+ *    };
+ *   </file>
+ *   <file name="protractor.js" type="protractor">
+ *     it('should check controller as', function() {
+ *       var container = element(by.id('ctrl-as-exmpl'));
+ *         expect(container.element(by.model('settings.name'))
+ *           .getAttribute('value')).toBe('John Smith');
+ *
+ *       var firstRepeat =
+ *           container.element(by.repeater('contact in settings.contacts').row(0));
+ *       var secondRepeat =
+ *           container.element(by.repeater('contact in settings.contacts').row(1));
+ *
+ *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *           .toBe('408 555 1212');
+ *
+ *       expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *           .toBe('john.smith@example.org');
+ *
+ *       firstRepeat.element(by.buttonText('clear')).click();
+ *
+ *       expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *           .toBe('');
+ *
+ *       container.element(by.buttonText('add')).click();
+ *
+ *       expect(container.element(by.repeater('contact in settings.contacts').row(2))
+ *           .element(by.model('contact.value'))
+ *           .getAttribute('value'))
+ *           .toBe('yourname@example.org');
+ *     });
+ *   </file>
+ * </example>
+ *
+ * This example demonstrates the "attach to `$scope`" style of controller.
+ *
+ * <example name="ngController" module="controllerExample">
+ *  <file name="index.html">
+ *   <div id="ctrl-exmpl" ng-controller="SettingsController2">
+ *     <label>Name: <input type="text" ng-model="name"/></label>
+ *     <button ng-click="greet()">greet</button><br/>
+ *     Contact:
+ *     <ul>
+ *       <li ng-repeat="contact in contacts">
+ *         <select ng-model="contact.type" id="select_{{$index}}">
+ *            <option>phone</option>
+ *            <option>email</option>
+ *         </select>
+ *         <input type="text" ng-model="contact.value" aria-labelledby="select_{{$index}}" />
+ *         <button ng-click="clearContact(contact)">clear</button>
+ *         <button ng-click="removeContact(contact)">X</button>
+ *       </li>
+ *       <li>[ <button ng-click="addContact()">add</button> ]</li>
+ *    </ul>
+ *   </div>
+ *  </file>
+ *  <file name="app.js">
+ *   angular.module('controllerExample', [])
+ *     .controller('SettingsController2', ['$scope', SettingsController2]);
+ *
+ *   function SettingsController2($scope) {
+ *     $scope.name = "John Smith";
+ *     $scope.contacts = [
+ *       {type:'phone', value:'408 555 1212'},
+ *       {type:'email', value:'john.smith@example.org'} ];
+ *
+ *     $scope.greet = function() {
+ *       alert($scope.name);
+ *     };
+ *
+ *     $scope.addContact = function() {
+ *       $scope.contacts.push({type:'email', value:'yourname@example.org'});
+ *     };
+ *
+ *     $scope.removeContact = function(contactToRemove) {
+ *       var index = $scope.contacts.indexOf(contactToRemove);
+ *       $scope.contacts.splice(index, 1);
+ *     };
+ *
+ *     $scope.clearContact = function(contact) {
+ *       contact.type = 'phone';
+ *       contact.value = '';
+ *     };
+ *   }
+ *  </file>
+ *  <file name="protractor.js" type="protractor">
+ *    it('should check controller', function() {
+ *      var container = element(by.id('ctrl-exmpl'));
+ *
+ *      expect(container.element(by.model('name'))
+ *          .getAttribute('value')).toBe('John Smith');
+ *
+ *      var firstRepeat =
+ *          container.element(by.repeater('contact in contacts').row(0));
+ *      var secondRepeat =
+ *          container.element(by.repeater('contact in contacts').row(1));
+ *
+ *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *          .toBe('408 555 1212');
+ *      expect(secondRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *          .toBe('john.smith@example.org');
+ *
+ *      firstRepeat.element(by.buttonText('clear')).click();
+ *
+ *      expect(firstRepeat.element(by.model('contact.value')).getAttribute('value'))
+ *          .toBe('');
+ *
+ *      container.element(by.buttonText('add')).click();
+ *
+ *      expect(container.element(by.repeater('contact in contacts').row(2))
+ *          .element(by.model('contact.value'))
+ *          .getAttribute('value'))
+ *          .toBe('yourname@example.org');
+ *    });
+ *  </file>
+ *</example>
+
+ */
+var ngControllerDirective = [function() {
+  return {
+    restrict: 'A',
+    scope: true,
+    controller: '@',
+    priority: 500
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngCsp
+ *
+ * @element html
+ * @description
+ *
+ * Angular has some features that can break certain
+ * [CSP (Content Security Policy)](https://developer.mozilla.org/en/Security/CSP) rules.
+ *
+ * If you intend to implement these rules then you must tell Angular not to use these features.
+ *
+ * This is necessary when developing things like Google Chrome Extensions or Universal Windows Apps.
+ *
+ *
+ * The following rules affect Angular:
+ *
+ * * `unsafe-eval`: this rule forbids apps to use `eval` or `Function(string)` generated functions
+ * (among other things). Angular makes use of this in the {@link $parse} service to provide a 30%
+ * increase in the speed of evaluating Angular expressions.
+ *
+ * * `unsafe-inline`: this rule forbids apps from inject custom styles into the document. Angular
+ * makes use of this to include some CSS rules (e.g. {@link ngCloak} and {@link ngHide}).
+ * To make these directives work when a CSP rule is blocking inline styles, you must link to the
+ * `angular-csp.css` in your HTML manually.
+ *
+ * If you do not provide `ngCsp` then Angular tries to autodetect if CSP is blocking unsafe-eval
+ * and automatically deactivates this feature in the {@link $parse} service. This autodetection,
+ * however, triggers a CSP error to be logged in the console:
+ *
+ * ```
+ * Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of
+ * script in the following Content Security Policy directive: "default-src 'self'". Note that
+ * 'script-src' was not explicitly set, so 'default-src' is used as a fallback.
+ * ```
+ *
+ * This error is harmless but annoying. To prevent the error from showing up, put the `ngCsp`
+ * directive on an element of the HTML document that appears before the `<script>` tag that loads
+ * the `angular.js` file.
+ *
+ * *Note: This directive is only available in the `ng-csp` and `data-ng-csp` attribute form.*
+ *
+ * You can specify which of the CSP related Angular features should be deactivated by providing
+ * a value for the `ng-csp` attribute. The options are as follows:
+ *
+ * * no-inline-style: this stops Angular from injecting CSS styles into the DOM
+ *
+ * * no-unsafe-eval: this stops Angular from optimising $parse with unsafe eval of strings
+ *
+ * You can use these values in the following combinations:
+ *
+ *
+ * * No declaration means that Angular will assume that you can do inline styles, but it will do
+ * a runtime check for unsafe-eval. E.g. `<body>`. This is backwardly compatible with previous versions
+ * of Angular.
+ *
+ * * A simple `ng-csp` (or `data-ng-csp`) attribute will tell Angular to deactivate both inline
+ * styles and unsafe eval. E.g. `<body ng-csp>`. This is backwardly compatible with previous versions
+ * of Angular.
+ *
+ * * Specifying only `no-unsafe-eval` tells Angular that we must not use eval, but that we can inject
+ * inline styles. E.g. `<body ng-csp="no-unsafe-eval">`.
+ *
+ * * Specifying only `no-inline-style` tells Angular that we must not inject styles, but that we can
+ * run eval - no automcatic check for unsafe eval will occur. E.g. `<body ng-csp="no-inline-style">`
+ *
+ * * Specifying both `no-unsafe-eval` and `no-inline-style` tells Angular that we must not inject
+ * styles nor use eval, which is the same as an empty: ng-csp.
+ * E.g.`<body ng-csp="no-inline-style;no-unsafe-eval">`
+ *
+ * @example
+ * This example shows how to apply the `ngCsp` directive to the `html` tag.
+   ```html
+     <!doctype html>
+     <html ng-app ng-csp>
+     ...
+     ...
+     </html>
+   ```
+  * @example
+      // Note: the suffix `.csp` in the example name triggers
+      // csp mode in our http server!
+      <example name="example.csp" module="cspExample" ng-csp="true">
+        <file name="index.html">
+          <div ng-controller="MainController as ctrl">
+            <div>
+              <button ng-click="ctrl.inc()" id="inc">Increment</button>
+              <span id="counter">
+                {{ctrl.counter}}
+              </span>
+            </div>
+
+            <div>
+              <button ng-click="ctrl.evil()" id="evil">Evil</button>
+              <span id="evilError">
+                {{ctrl.evilError}}
+              </span>
+            </div>
+          </div>
+        </file>
+        <file name="script.js">
+           angular.module('cspExample', [])
+             .controller('MainController', function() {
+                this.counter = 0;
+                this.inc = function() {
+                  this.counter++;
+                };
+                this.evil = function() {
+                  // jshint evil:true
+                  try {
+                    eval('1+2');
+                  } catch (e) {
+                    this.evilError = e.message;
+                  }
+                };
+              });
+        </file>
+        <file name="protractor.js" type="protractor">
+          var util, webdriver;
+
+          var incBtn = element(by.id('inc'));
+          var counter = element(by.id('counter'));
+          var evilBtn = element(by.id('evil'));
+          var evilError = element(by.id('evilError'));
+
+          function getAndClearSevereErrors() {
+            return browser.manage().logs().get('browser').then(function(browserLog) {
+              return browserLog.filter(function(logEntry) {
+                return logEntry.level.value > webdriver.logging.Level.WARNING.value;
+              });
+            });
+          }
+
+          function clearErrors() {
+            getAndClearSevereErrors();
+          }
+
+          function expectNoErrors() {
+            getAndClearSevereErrors().then(function(filteredLog) {
+              expect(filteredLog.length).toEqual(0);
+              if (filteredLog.length) {
+                console.log('browser console errors: ' + util.inspect(filteredLog));
+              }
+            });
+          }
+
+          function expectError(regex) {
+            getAndClearSevereErrors().then(function(filteredLog) {
+              var found = false;
+              filteredLog.forEach(function(log) {
+                if (log.message.match(regex)) {
+                  found = true;
+                }
+              });
+              if (!found) {
+                throw new Error('expected an error that matches ' + regex);
+              }
+            });
+          }
+
+          beforeEach(function() {
+            util = require('util');
+            webdriver = require('protractor/node_modules/selenium-webdriver');
+          });
+
+          // For now, we only test on Chrome,
+          // as Safari does not load the page with Protractor's injected scripts,
+          // and Firefox webdriver always disables content security policy (#6358)
+          if (browser.params.browser !== 'chrome') {
+            return;
+          }
+
+          it('should not report errors when the page is loaded', function() {
+            // clear errors so we are not dependent on previous tests
+            clearErrors();
+            // Need to reload the page as the page is already loaded when
+            // we come here
+            browser.driver.getCurrentUrl().then(function(url) {
+              browser.get(url);
+            });
+            expectNoErrors();
+          });
+
+          it('should evaluate expressions', function() {
+            expect(counter.getText()).toEqual('0');
+            incBtn.click();
+            expect(counter.getText()).toEqual('1');
+            expectNoErrors();
+          });
+
+          it('should throw and report an error when using "eval"', function() {
+            evilBtn.click();
+            expect(evilError.getText()).toMatch(/Content Security Policy/);
+            expectError(/Content Security Policy/);
+          });
+        </file>
+      </example>
+  */
+
+// ngCsp is not implemented as a proper directive any more, because we need it be processed while we
+// bootstrap the system (before $parse is instantiated), for this reason we just have
+// the csp() fn that looks for the `ng-csp` attribute anywhere in the current doc
+
+/**
+ * @ngdoc directive
+ * @name ngClick
+ *
+ * @description
+ * The ngClick directive allows you to specify custom behavior when
+ * an element is clicked.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngClick {@link guide/expression Expression} to evaluate upon
+ * click. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-click="count = count + 1" ng-init="count=0">
+        Increment
+      </button>
+      <span>
+        count: {{count}}
+      </span>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-click', function() {
+         expect(element(by.binding('count')).getText()).toMatch('0');
+         element(by.css('button')).click();
+         expect(element(by.binding('count')).getText()).toMatch('1');
+       });
+     </file>
+   </example>
+ */
+/*
+ * A collection of directives that allows creation of custom event handlers that are defined as
+ * angular expressions and are compiled and executed within the current scope.
+ */
+var ngEventDirectives = {};
+
+// For events that might fire synchronously during DOM manipulation
+// we need to execute their event handlers asynchronously using $evalAsync,
+// so that they are not executed in an inconsistent state.
+var forceAsyncEvents = {
+  'blur': true,
+  'focus': true
+};
+forEach(
+  'click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste'.split(' '),
+  function(eventName) {
+    var directiveName = directiveNormalize('ng-' + eventName);
+    ngEventDirectives[directiveName] = ['$parse', '$rootScope', function($parse, $rootScope) {
+      return {
+        restrict: 'A',
+        compile: function($element, attr) {
+          // We expose the powerful $event object on the scope that provides access to the Window,
+          // etc. that isn't protected by the fast paths in $parse.  We explicitly request better
+          // checks at the cost of speed since event handler expressions are not executed as
+          // frequently as regular change detection.
+          var fn = $parse(attr[directiveName], /* interceptorFn */ null, /* expensiveChecks */ true);
+          return function ngEventHandler(scope, element) {
+            element.on(eventName, function(event) {
+              var callback = function() {
+                fn(scope, {$event:event});
+              };
+              if (forceAsyncEvents[eventName] && $rootScope.$$phase) {
+                scope.$evalAsync(callback);
+              } else {
+                scope.$apply(callback);
+              }
+            });
+          };
+        }
+      };
+    }];
+  }
+);
+
+/**
+ * @ngdoc directive
+ * @name ngDblclick
+ *
+ * @description
+ * The `ngDblclick` directive allows you to specify custom behavior on a dblclick event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngDblclick {@link guide/expression Expression} to evaluate upon
+ * a dblclick. (The Event object is available as `$event`)
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-dblclick="count = count + 1" ng-init="count=0">
+        Increment (on double click)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngMousedown
+ *
+ * @description
+ * The ngMousedown directive allows you to specify custom behavior on mousedown event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMousedown {@link guide/expression Expression} to evaluate upon
+ * mousedown. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mousedown="count = count + 1" ng-init="count=0">
+        Increment (on mouse down)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngMouseup
+ *
+ * @description
+ * Specify custom behavior on mouseup event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMouseup {@link guide/expression Expression} to evaluate upon
+ * mouseup. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mouseup="count = count + 1" ng-init="count=0">
+        Increment (on mouse up)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngMouseover
+ *
+ * @description
+ * Specify custom behavior on mouseover event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMouseover {@link guide/expression Expression} to evaluate upon
+ * mouseover. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mouseover="count = count + 1" ng-init="count=0">
+        Increment (when mouse is over)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngMouseenter
+ *
+ * @description
+ * Specify custom behavior on mouseenter event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMouseenter {@link guide/expression Expression} to evaluate upon
+ * mouseenter. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mouseenter="count = count + 1" ng-init="count=0">
+        Increment (when mouse enters)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngMouseleave
+ *
+ * @description
+ * Specify custom behavior on mouseleave event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMouseleave {@link guide/expression Expression} to evaluate upon
+ * mouseleave. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mouseleave="count = count + 1" ng-init="count=0">
+        Increment (when mouse leaves)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngMousemove
+ *
+ * @description
+ * Specify custom behavior on mousemove event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngMousemove {@link guide/expression Expression} to evaluate upon
+ * mousemove. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <button ng-mousemove="count = count + 1" ng-init="count=0">
+        Increment (when mouse moves)
+      </button>
+      count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngKeydown
+ *
+ * @description
+ * Specify custom behavior on keydown event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngKeydown {@link guide/expression Expression} to evaluate upon
+ * keydown. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <input ng-keydown="count = count + 1" ng-init="count=0">
+      key down count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngKeyup
+ *
+ * @description
+ * Specify custom behavior on keyup event.
+ *
+ * @element ANY
+ * @priority 0
+ * @param {expression} ngKeyup {@link guide/expression Expression} to evaluate upon
+ * keyup. (Event object is available as `$event` and can be interrogated for keyCode, altKey, etc.)
+ *
+ * @example
+   <example>
+     <file name="index.html">
+       <p>Typing in the input box below updates the key count</p>
+       <input ng-keyup="count = count + 1" ng-init="count=0"> key up count: {{count}}
+
+       <p>Typing in the input box below updates the keycode</p>
+       <input ng-keyup="event=$event">
+       <p>event keyCode: {{ event.keyCode }}</p>
+       <p>event altKey: {{ event.altKey }}</p>
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngKeypress
+ *
+ * @description
+ * Specify custom behavior on keypress event.
+ *
+ * @element ANY
+ * @param {expression} ngKeypress {@link guide/expression Expression} to evaluate upon
+ * keypress. ({@link guide/expression#-event- Event object is available as `$event`}
+ * and can be interrogated for keyCode, altKey, etc.)
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <input ng-keypress="count = count + 1" ng-init="count=0">
+      key press count: {{count}}
+     </file>
+   </example>
+ */
+
+
+/**
+ * @ngdoc directive
+ * @name ngSubmit
+ *
+ * @description
+ * Enables binding angular expressions to onsubmit events.
+ *
+ * Additionally it prevents the default action (which for form means sending the request to the
+ * server and reloading the current page), but only if the form does not contain `action`,
+ * `data-action`, or `x-action` attributes.
+ *
+ * <div class="alert alert-warning">
+ * **Warning:** Be careful not to cause "double-submission" by using both the `ngClick` and
+ * `ngSubmit` handlers together. See the
+ * {@link form#submitting-a-form-and-preventing-the-default-action `form` directive documentation}
+ * for a detailed discussion of when `ngSubmit` may be triggered.
+ * </div>
+ *
+ * @element form
+ * @priority 0
+ * @param {expression} ngSubmit {@link guide/expression Expression} to eval.
+ * ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example module="submitExample">
+     <file name="index.html">
+      <script>
+        angular.module('submitExample', [])
+          .controller('ExampleController', ['$scope', function($scope) {
+            $scope.list = [];
+            $scope.text = 'hello';
+            $scope.submit = function() {
+              if ($scope.text) {
+                $scope.list.push(this.text);
+                $scope.text = '';
+              }
+            };
+          }]);
+      </script>
+      <form ng-submit="submit()" ng-controller="ExampleController">
+        Enter text and hit enter:
+        <input type="text" ng-model="text" name="text" />
+        <input type="submit" id="submit" value="Submit" />
+        <pre>list={{list}}</pre>
+      </form>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should check ng-submit', function() {
+         expect(element(by.binding('list')).getText()).toBe('list=[]');
+         element(by.css('#submit')).click();
+         expect(element(by.binding('list')).getText()).toContain('hello');
+         expect(element(by.model('text')).getAttribute('value')).toBe('');
+       });
+       it('should ignore empty strings', function() {
+         expect(element(by.binding('list')).getText()).toBe('list=[]');
+         element(by.css('#submit')).click();
+         element(by.css('#submit')).click();
+         expect(element(by.binding('list')).getText()).toContain('hello');
+        });
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngFocus
+ *
+ * @description
+ * Specify custom behavior on focus event.
+ *
+ * Note: As the `focus` event is executed synchronously when calling `input.focus()`
+ * AngularJS executes the expression using `scope.$evalAsync` if the event is fired
+ * during an `$apply` to ensure a consistent state.
+ *
+ * @element window, input, select, textarea, a
+ * @priority 0
+ * @param {expression} ngFocus {@link guide/expression Expression} to evaluate upon
+ * focus. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+ * See {@link ng.directive:ngClick ngClick}
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngBlur
+ *
+ * @description
+ * Specify custom behavior on blur event.
+ *
+ * A [blur event](https://developer.mozilla.org/en-US/docs/Web/Events/blur) fires when
+ * an element has lost focus.
+ *
+ * Note: As the `blur` event is executed synchronously also during DOM manipulations
+ * (e.g. removing a focussed input),
+ * AngularJS executes the expression using `scope.$evalAsync` if the event is fired
+ * during an `$apply` to ensure a consistent state.
+ *
+ * @element window, input, select, textarea, a
+ * @priority 0
+ * @param {expression} ngBlur {@link guide/expression Expression} to evaluate upon
+ * blur. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+ * See {@link ng.directive:ngClick ngClick}
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngCopy
+ *
+ * @description
+ * Specify custom behavior on copy event.
+ *
+ * @element window, input, select, textarea, a
+ * @priority 0
+ * @param {expression} ngCopy {@link guide/expression Expression} to evaluate upon
+ * copy. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <input ng-copy="copied=true" ng-init="copied=false; value='copy me'" ng-model="value">
+      copied: {{copied}}
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngCut
+ *
+ * @description
+ * Specify custom behavior on cut event.
+ *
+ * @element window, input, select, textarea, a
+ * @priority 0
+ * @param {expression} ngCut {@link guide/expression Expression} to evaluate upon
+ * cut. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <input ng-cut="cut=true" ng-init="cut=false; value='cut me'" ng-model="value">
+      cut: {{cut}}
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngPaste
+ *
+ * @description
+ * Specify custom behavior on paste event.
+ *
+ * @element window, input, select, textarea, a
+ * @priority 0
+ * @param {expression} ngPaste {@link guide/expression Expression} to evaluate upon
+ * paste. ({@link guide/expression#-event- Event object is available as `$event`})
+ *
+ * @example
+   <example>
+     <file name="index.html">
+      <input ng-paste="paste=true" ng-init="paste=false" placeholder='paste here'>
+      pasted: {{paste}}
+     </file>
+   </example>
+ */
+
+/**
+ * @ngdoc directive
+ * @name ngIf
+ * @restrict A
+ * @multiElement
+ *
+ * @description
+ * The `ngIf` directive removes or recreates a portion of the DOM tree based on an
+ * {expression}. If the expression assigned to `ngIf` evaluates to a false
+ * value then the element is removed from the DOM, otherwise a clone of the
+ * element is reinserted into the DOM.
+ *
+ * `ngIf` differs from `ngShow` and `ngHide` in that `ngIf` completely removes and recreates the
+ * element in the DOM rather than changing its visibility via the `display` css property.  A common
+ * case when this difference is significant is when using css selectors that rely on an element's
+ * position within the DOM, such as the `:first-child` or `:last-child` pseudo-classes.
+ *
+ * Note that when an element is removed using `ngIf` its scope is destroyed and a new scope
+ * is created when the element is restored.  The scope created within `ngIf` inherits from
+ * its parent scope using
+ * [prototypal inheritance](https://github.com/angular/angular.js/wiki/Understanding-Scopes#javascript-prototypal-inheritance).
+ * An important implication of this is if `ngModel` is used within `ngIf` to bind to
+ * a javascript primitive defined in the parent scope. In this case any modifications made to the
+ * variable within the child scope will override (hide) the value in the parent scope.
+ *
+ * Also, `ngIf` recreates elements using their compiled state. An example of this behavior
+ * is if an element's class attribute is directly modified after it's compiled, using something like
+ * jQuery's `.addClass()` method, and the element is later removed. When `ngIf` recreates the element
+ * the added class will be lost because the original compiled state is used to regenerate the element.
+ *
+ * Additionally, you can provide animations via the `ngAnimate` module to animate the `enter`
+ * and `leave` effects.
+ *
+ * @animations
+ * enter - happens just after the `ngIf` contents change and a new DOM element is created and injected into the `ngIf` container
+ * leave - happens just before the `ngIf` contents are removed from the DOM
+ *
+ * @element ANY
+ * @scope
+ * @priority 600
+ * @param {expression} ngIf If the {@link guide/expression expression} is falsy then
+ *     the element is removed from the DOM tree. If it is truthy a copy of the compiled
+ *     element is added to the DOM tree.
+ *
+ * @example
+  <example module="ngAnimate" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+      <label>Click me: <input type="checkbox" ng-model="checked" ng-init="checked=true" /></label><br/>
+      Show when checked:
+      <span ng-if="checked" class="animate-if">
+        This is removed when the checkbox is unchecked.
+      </span>
+    </file>
+    <file name="animations.css">
+      .animate-if {
+        background:white;
+        border:1px solid black;
+        padding:10px;
+      }
+
+      .animate-if.ng-enter, .animate-if.ng-leave {
+        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
+      }
+
+      .animate-if.ng-enter,
+      .animate-if.ng-leave.ng-leave-active {
+        opacity:0;
+      }
+
+      .animate-if.ng-leave,
+      .animate-if.ng-enter.ng-enter-active {
+        opacity:1;
+      }
+    </file>
+  </example>
+ */
+var ngIfDirective = ['$animate', function($animate) {
+  return {
+    multiElement: true,
+    transclude: 'element',
+    priority: 600,
+    terminal: true,
+    restrict: 'A',
+    $$tlb: true,
+    link: function($scope, $element, $attr, ctrl, $transclude) {
+        var block, childScope, previousElements;
+        $scope.$watch($attr.ngIf, function ngIfWatchAction(value) {
+
+          if (value) {
+            if (!childScope) {
+              $transclude(function(clone, newScope) {
+                childScope = newScope;
+                clone[clone.length++] = document.createComment(' end ngIf: ' + $attr.ngIf + ' ');
+                // Note: We only need the first/last node of the cloned nodes.
+                // However, we need to keep the reference to the jqlite wrapper as it might be changed later
+                // by a directive with templateUrl when its template arrives.
+                block = {
+                  clone: clone
+                };
+                $animate.enter(clone, $element.parent(), $element);
+              });
+            }
+          } else {
+            if (previousElements) {
+              previousElements.remove();
+              previousElements = null;
+            }
+            if (childScope) {
+              childScope.$destroy();
+              childScope = null;
+            }
+            if (block) {
+              previousElements = getBlockNodes(block.clone);
+              $animate.leave(previousElements).then(function() {
+                previousElements = null;
+              });
+              block = null;
+            }
+          }
+        });
+    }
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngInclude
+ * @restrict ECA
+ *
+ * @description
+ * Fetches, compiles and includes an external HTML fragment.
+ *
+ * By default, the template URL is restricted to the same domain and protocol as the
+ * application document. This is done by calling {@link $sce#getTrustedResourceUrl
+ * $sce.getTrustedResourceUrl} on it. To load templates from other domains or protocols
+ * you may either {@link ng.$sceDelegateProvider#resourceUrlWhitelist whitelist them} or
+ * {@link $sce#trustAsResourceUrl wrap them} as trusted values. Refer to Angular's {@link
+ * ng.$sce Strict Contextual Escaping}.
+ *
+ * In addition, the browser's
+ * [Same Origin Policy](https://code.google.com/p/browsersec/wiki/Part2#Same-origin_policy_for_XMLHttpRequest)
+ * and [Cross-Origin Resource Sharing (CORS)](http://www.w3.org/TR/cors/)
+ * policy may further restrict whether the template is successfully loaded.
+ * For example, `ngInclude` won't work for cross-domain requests on all browsers and for `file://`
+ * access on some browsers.
+ *
+ * @animations
+ * enter - animation is used to bring new content into the browser.
+ * leave - animation is used to animate existing content away.
+ *
+ * The enter and leave animation occur concurrently.
+ *
+ * @scope
+ * @priority 400
+ *
+ * @param {string} ngInclude|src angular expression evaluating to URL. If the source is a string constant,
+ *                 make sure you wrap it in **single** quotes, e.g. `src="'myPartialTemplate.html'"`.
+ * @param {string=} onload Expression to evaluate when a new partial is loaded.
+ *
+ * @param {string=} autoscroll Whether `ngInclude` should call {@link ng.$anchorScroll
+ *                  $anchorScroll} to scroll the viewport after the content is loaded.
+ *
+ *                  - If the attribute is not set, disable scrolling.
+ *                  - If the attribute is set without value, enable scrolling.
+ *                  - Otherwise enable scrolling only if the expression evaluates to truthy value.
+ *
+ * @example
+  <example module="includeExample" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+     <div ng-controller="ExampleController">
+       <select ng-model="template" ng-options="t.name for t in templates">
+        <option value="">(blank)</option>
+       </select>
+       url of the template: <code>{{template.url}}</code>
+       <hr/>
+       <div class="slide-animate-container">
+         <div class="slide-animate" ng-include="template.url"></div>
+       </div>
+     </div>
+    </file>
+    <file name="script.js">
+      angular.module('includeExample', ['ngAnimate'])
+        .controller('ExampleController', ['$scope', function($scope) {
+          $scope.templates =
+            [ { name: 'template1.html', url: 'template1.html'},
+              { name: 'template2.html', url: 'template2.html'} ];
+          $scope.template = $scope.templates[0];
+        }]);
+     </file>
+    <file name="template1.html">
+      Content of template1.html
+    </file>
+    <file name="template2.html">
+      Content of template2.html
+    </file>
+    <file name="animations.css">
+      .slide-animate-container {
+        position:relative;
+        background:white;
+        border:1px solid black;
+        height:40px;
+        overflow:hidden;
+      }
+
+      .slide-animate {
+        padding:10px;
+      }
+
+      .slide-animate.ng-enter, .slide-animate.ng-leave {
+        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
+
+        position:absolute;
+        top:0;
+        left:0;
+        right:0;
+        bottom:0;
+        display:block;
+        padding:10px;
+      }
+
+      .slide-animate.ng-enter {
+        top:-50px;
+      }
+      .slide-animate.ng-enter.ng-enter-active {
+        top:0;
+      }
+
+      .slide-animate.ng-leave {
+        top:0;
+      }
+      .slide-animate.ng-leave.ng-leave-active {
+        top:50px;
+      }
+    </file>
+    <file name="protractor.js" type="protractor">
+      var templateSelect = element(by.model('template'));
+      var includeElem = element(by.css('[ng-include]'));
+
+      it('should load template1.html', function() {
+        expect(includeElem.getText()).toMatch(/Content of template1.html/);
+      });
+
+      it('should load template2.html', function() {
+        if (browser.params.browser == 'firefox') {
+          // Firefox can't handle using selects
+          // See https://github.com/angular/protractor/issues/480
+          return;
+        }
+        templateSelect.click();
+        templateSelect.all(by.css('option')).get(2).click();
+        expect(includeElem.getText()).toMatch(/Content of template2.html/);
+      });
+
+      it('should change to blank', function() {
+        if (browser.params.browser == 'firefox') {
+          // Firefox can't handle using selects
+          return;
+        }
+        templateSelect.click();
+        templateSelect.all(by.css('option')).get(0).click();
+        expect(includeElem.isPresent()).toBe(false);
+      });
+    </file>
+  </example>
+ */
+
+
+/**
+ * @ngdoc event
+ * @name ngInclude#$includeContentRequested
+ * @eventType emit on the scope ngInclude was declared in
+ * @description
+ * Emitted every time the ngInclude content is requested.
+ *
+ * @param {Object} angularEvent Synthetic event object.
+ * @param {String} src URL of content to load.
+ */
+
+
+/**
+ * @ngdoc event
+ * @name ngInclude#$includeContentLoaded
+ * @eventType emit on the current ngInclude scope
+ * @description
+ * Emitted every time the ngInclude content is reloaded.
+ *
+ * @param {Object} angularEvent Synthetic event object.
+ * @param {String} src URL of content to load.
+ */
+
+
+/**
+ * @ngdoc event
+ * @name ngInclude#$includeContentError
+ * @eventType emit on the scope ngInclude was declared in
+ * @description
+ * Emitted when a template HTTP request yields an erroneous response (status < 200 || status > 299)
+ *
+ * @param {Object} angularEvent Synthetic event object.
+ * @param {String} src URL of content to load.
+ */
+var ngIncludeDirective = ['$templateRequest', '$anchorScroll', '$animate',
+                  function($templateRequest,   $anchorScroll,   $animate) {
+  return {
+    restrict: 'ECA',
+    priority: 400,
+    terminal: true,
+    transclude: 'element',
+    controller: angular.noop,
+    compile: function(element, attr) {
+      var srcExp = attr.ngInclude || attr.src,
+          onloadExp = attr.onload || '',
+          autoScrollExp = attr.autoscroll;
+
+      return function(scope, $element, $attr, ctrl, $transclude) {
+        var changeCounter = 0,
+            currentScope,
+            previousElement,
+            currentElement;
+
+        var cleanupLastIncludeContent = function() {
+          if (previousElement) {
+            previousElement.remove();
+            previousElement = null;
+          }
+          if (currentScope) {
+            currentScope.$destroy();
+            currentScope = null;
+          }
+          if (currentElement) {
+            $animate.leave(currentElement).then(function() {
+              previousElement = null;
+            });
+            previousElement = currentElement;
+            currentElement = null;
+          }
+        };
+
+        scope.$watch(srcExp, function ngIncludeWatchAction(src) {
+          var afterAnimation = function() {
+            if (isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))) {
+              $anchorScroll();
+            }
+          };
+          var thisChangeId = ++changeCounter;
+
+          if (src) {
+            //set the 2nd param to true to ignore the template request error so that the inner
+            //contents and scope can be cleaned up.
+            $templateRequest(src, true).then(function(response) {
+              if (thisChangeId !== changeCounter) return;
+              var newScope = scope.$new();
+              ctrl.template = response;
+
+              // Note: This will also link all children of ng-include that were contained in the original
+              // html. If that content contains controllers, ... they could pollute/change the scope.
+              // However, using ng-include on an element with additional content does not make sense...
+              // Note: We can't remove them in the cloneAttchFn of $transclude as that
+              // function is called before linking the content, which would apply child
+              // directives to non existing elements.
+              var clone = $transclude(newScope, function(clone) {
+                cleanupLastIncludeContent();
+                $animate.enter(clone, null, $element).then(afterAnimation);
+              });
+
+              currentScope = newScope;
+              currentElement = clone;
+
+              currentScope.$emit('$includeContentLoaded', src);
+              scope.$eval(onloadExp);
+            }, function() {
+              if (thisChangeId === changeCounter) {
+                cleanupLastIncludeContent();
+                scope.$emit('$includeContentError', src);
+              }
+            });
+            scope.$emit('$includeContentRequested', src);
+          } else {
+            cleanupLastIncludeContent();
+            ctrl.template = null;
+          }
+        });
+      };
+    }
+  };
+}];
+
+// This directive is called during the $transclude call of the first `ngInclude` directive.
+// It will replace and compile the content of the element with the loaded template.
+// We need this directive so that the element content is already filled when
+// the link function of another directive on the same element as ngInclude
+// is called.
+var ngIncludeFillContentDirective = ['$compile',
+  function($compile) {
+    return {
+      restrict: 'ECA',
+      priority: -400,
+      require: 'ngInclude',
+      link: function(scope, $element, $attr, ctrl) {
+        if (/SVG/.test($element[0].toString())) {
+          // WebKit: https://bugs.webkit.org/show_bug.cgi?id=135698 --- SVG elements do not
+          // support innerHTML, so detect this here and try to generate the contents
+          // specially.
+          $element.empty();
+          $compile(jqLiteBuildFragment(ctrl.template, document).childNodes)(scope,
+              function namespaceAdaptedClone(clone) {
+            $element.append(clone);
+          }, {futureParentElement: $element});
+          return;
+        }
+
+        $element.html(ctrl.template);
+        $compile($element.contents())(scope);
+      }
+    };
+  }];
+
+/**
+ * @ngdoc directive
+ * @name ngInit
+ * @restrict AC
+ *
+ * @description
+ * The `ngInit` directive allows you to evaluate an expression in the
+ * current scope.
+ *
+ * <div class="alert alert-danger">
+ * This directive can be abused to add unnecessary amounts of logic into your templates.
+ * There are only a few appropriate uses of `ngInit`, such as for aliasing special properties of
+ * {@link ng.directive:ngRepeat `ngRepeat`}, as seen in the demo below; and for injecting data via
+ * server side scripting. Besides these few cases, you should use {@link guide/controller controllers}
+ * rather than `ngInit` to initialize values on a scope.
+ * </div>
+ *
+ * <div class="alert alert-warning">
+ * **Note**: If you have assignment in `ngInit` along with a {@link ng.$filter `filter`}, make
+ * sure you have parentheses to ensure correct operator precedence:
+ * <pre class="prettyprint">
+ * `<div ng-init="test1 = ($index | toString)"></div>`
+ * </pre>
+ * </div>
+ *
+ * @priority 450
+ *
+ * @element ANY
+ * @param {expression} ngInit {@link guide/expression Expression} to eval.
+ *
+ * @example
+   <example module="initExample">
+     <file name="index.html">
+   <script>
+     angular.module('initExample', [])
+       .controller('ExampleController', ['$scope', function($scope) {
+         $scope.list = [['a', 'b'], ['c', 'd']];
+       }]);
+   </script>
+   <div ng-controller="ExampleController">
+     <div ng-repeat="innerList in list" ng-init="outerIndex = $index">
+       <div ng-repeat="value in innerList" ng-init="innerIndex = $index">
+          <span class="example-init">list[ {{outerIndex}} ][ {{innerIndex}} ] = {{value}};</span>
+       </div>
+     </div>
+   </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+       it('should alias index positions', function() {
+         var elements = element.all(by.css('.example-init'));
+         expect(elements.get(0).getText()).toBe('list[ 0 ][ 0 ] = a;');
+         expect(elements.get(1).getText()).toBe('list[ 0 ][ 1 ] = b;');
+         expect(elements.get(2).getText()).toBe('list[ 1 ][ 0 ] = c;');
+         expect(elements.get(3).getText()).toBe('list[ 1 ][ 1 ] = d;');
+       });
+     </file>
+   </example>
+ */
+var ngInitDirective = ngDirective({
+  priority: 450,
+  compile: function() {
+    return {
+      pre: function(scope, element, attrs) {
+        scope.$eval(attrs.ngInit);
+      }
+    };
+  }
+});
+
+/**
+ * @ngdoc directive
+ * @name ngList
+ *
+ * @description
+ * Text input that converts between a delimited string and an array of strings. The default
+ * delimiter is a comma followed by a space - equivalent to `ng-list=", "`. You can specify a custom
+ * delimiter as the value of the `ngList` attribute - for example, `ng-list=" | "`.
+ *
+ * The behaviour of the directive is affected by the use of the `ngTrim` attribute.
+ * * If `ngTrim` is set to `"false"` then whitespace around both the separator and each
+ *   list item is respected. This implies that the user of the directive is responsible for
+ *   dealing with whitespace but also allows you to use whitespace as a delimiter, such as a
+ *   tab or newline character.
+ * * Otherwise whitespace around the delimiter is ignored when splitting (although it is respected
+ *   when joining the list items back together) and whitespace around each list item is stripped
+ *   before it is added to the model.
+ *
+ * ### Example with Validation
+ *
+ * <example name="ngList-directive" module="listExample">
+ *   <file name="app.js">
+ *      angular.module('listExample', [])
+ *        .controller('ExampleController', ['$scope', function($scope) {
+ *          $scope.names = ['morpheus', 'neo', 'trinity'];
+ *        }]);
+ *   </file>
+ *   <file name="index.html">
+ *    <form name="myForm" ng-controller="ExampleController">
+ *      <label>List: <input name="namesInput" ng-model="names" ng-list required></label>
+ *      <span role="alert">
+ *        <span class="error" ng-show="myForm.namesInput.$error.required">
+ *        Required!</span>
+ *      </span>
+ *      <br>
+ *      <tt>names = {{names}}</tt><br/>
+ *      <tt>myForm.namesInput.$valid = {{myForm.namesInput.$valid}}</tt><br/>
+ *      <tt>myForm.namesInput.$error = {{myForm.namesInput.$error}}</tt><br/>
+ *      <tt>myForm.$valid = {{myForm.$valid}}</tt><br/>
+ *      <tt>myForm.$error.required = {{!!myForm.$error.required}}</tt><br/>
+ *     </form>
+ *   </file>
+ *   <file name="protractor.js" type="protractor">
+ *     var listInput = element(by.model('names'));
+ *     var names = element(by.exactBinding('names'));
+ *     var valid = element(by.binding('myForm.namesInput.$valid'));
+ *     var error = element(by.css('span.error'));
+ *
+ *     it('should initialize to model', function() {
+ *       expect(names.getText()).toContain('["morpheus","neo","trinity"]');
+ *       expect(valid.getText()).toContain('true');
+ *       expect(error.getCssValue('display')).toBe('none');
+ *     });
+ *
+ *     it('should be invalid if empty', function() {
+ *       listInput.clear();
+ *       listInput.sendKeys('');
+ *
+ *       expect(names.getText()).toContain('');
+ *       expect(valid.getText()).toContain('false');
+ *       expect(error.getCssValue('display')).not.toBe('none');
+ *     });
+ *   </file>
+ * </example>
+ *
+ * ### Example - splitting on newline
+ * <example name="ngList-directive-newlines">
+ *   <file name="index.html">
+ *    <textarea ng-model="list" ng-list="&#10;" ng-trim="false"></textarea>
+ *    <pre>{{ list | json }}</pre>
+ *   </file>
+ *   <file name="protractor.js" type="protractor">
+ *     it("should split the text by newlines", function() {
+ *       var listInput = element(by.model('list'));
+ *       var output = element(by.binding('list | json'));
+ *       listInput.sendKeys('abc\ndef\nghi');
+ *       expect(output.getText()).toContain('[\n  "abc",\n  "def",\n  "ghi"\n]');
+ *     });
+ *   </file>
+ * </example>
+ *
+ * @element input
+ * @param {string=} ngList optional delimiter that should be used to split the value.
+ */
+var ngListDirective = function() {
+  return {
+    restrict: 'A',
+    priority: 100,
+    require: 'ngModel',
+    link: function(scope, element, attr, ctrl) {
+      // We want to control whitespace trimming so we use this convoluted approach
+      // to access the ngList attribute, which doesn't pre-trim the attribute
+      var ngList = element.attr(attr.$attr.ngList) || ', ';
+      var trimValues = attr.ngTrim !== 'false';
+      var separator = trimValues ? trim(ngList) : ngList;
+
+      var parse = function(viewValue) {
+        // If the viewValue is invalid (say required but empty) it will be `undefined`
+        if (isUndefined(viewValue)) return;
+
+        var list = [];
+
+        if (viewValue) {
+          forEach(viewValue.split(separator), function(value) {
+            if (value) list.push(trimValues ? trim(value) : value);
+          });
+        }
+
+        return list;
+      };
+
+      ctrl.$parsers.push(parse);
+      ctrl.$formatters.push(function(value) {
+        if (isArray(value)) {
+          return value.join(ngList);
+        }
+
+        return undefined;
+      });
+
+      // Override the standard $isEmpty because an empty array means the input is empty.
+      ctrl.$isEmpty = function(value) {
+        return !value || !value.length;
+      };
+    }
+  };
+};
+
+/* global VALID_CLASS: true,
+  INVALID_CLASS: true,
+  PRISTINE_CLASS: true,
+  DIRTY_CLASS: true,
+  UNTOUCHED_CLASS: true,
+  TOUCHED_CLASS: true,
+*/
+
+var VALID_CLASS = 'ng-valid',
+    INVALID_CLASS = 'ng-invalid',
+    PRISTINE_CLASS = 'ng-pristine',
+    DIRTY_CLASS = 'ng-dirty',
+    UNTOUCHED_CLASS = 'ng-untouched',
+    TOUCHED_CLASS = 'ng-touched',
+    PENDING_CLASS = 'ng-pending';
+
+var ngModelMinErr = minErr('ngModel');
+
+/**
+ * @ngdoc type
+ * @name ngModel.NgModelController
+ *
+ * @property {*} $viewValue The actual value from the control's view. For `input` elements, this is a
+ * String. See {@link ngModel.NgModelController#$setViewValue} for information about when the $viewValue
+ * is set.
+ * @property {*} $modelValue The value in the model that the control is bound to.
+ * @property {Array.<Function>} $parsers Array of functions to execute, as a pipeline, whenever
+       the control reads value from the DOM. The functions are called in array order, each passing
+       its return value through to the next. The last return value is forwarded to the
+       {@link ngModel.NgModelController#$validators `$validators`} collection.
+
+Parsers are used to sanitize / convert the {@link ngModel.NgModelController#$viewValue
+`$viewValue`}.
+
+Returning `undefined` from a parser means a parse error occurred. In that case,
+no {@link ngModel.NgModelController#$validators `$validators`} will run and the `ngModel`
+will be set to `undefined` unless {@link ngModelOptions `ngModelOptions.allowInvalid`}
+is set to `true`. The parse error is stored in `ngModel.$error.parse`.
+
+ *
+ * @property {Array.<Function>} $formatters Array of functions to execute, as a pipeline, whenever
+       the model value changes. The functions are called in reverse array order, each passing the value through to the
+       next. The last return value is used as the actual DOM value.
+       Used to format / convert values for display in the control.
+ * ```js
+ * function formatter(value) {
+ *   if (value) {
+ *     return value.toUpperCase();
+ *   }
+ * }
+ * ngModel.$formatters.push(formatter);
+ * ```
+ *
+ * @property {Object.<string, function>} $validators A collection of validators that are applied
+ *      whenever the model value changes. The key value within the object refers to the name of the
+ *      validator while the function refers to the validation operation. The validation operation is
+ *      provided with the model value as an argument and must return a true or false value depending
+ *      on the response of that validation.
+ *
+ * ```js
+ * ngModel.$validators.validCharacters = function(modelValue, viewValue) {
+ *   var value = modelValue || viewValue;
+ *   return /[0-9]+/.test(value) &&
+ *          /[a-z]+/.test(value) &&
+ *          /[A-Z]+/.test(value) &&
+ *          /\W+/.test(value);
+ * };
+ * ```
+ *
+ * @property {Object.<string, function>} $asyncValidators A collection of validations that are expected to
+ *      perform an asynchronous validation (e.g. a HTTP request). The validation function that is provided
+ *      is expected to return a promise when it is run during the model validation process. Once the promise
+ *      is delivered then the validation status will be set to true when fulfilled and false when rejected.
+ *      When the asynchronous validators are triggered, each of the validators will run in parallel and the model
+ *      value will only be updated once all validators have been fulfilled. As long as an asynchronous validator
+ *      is unfulfilled, its key will be added to the controllers `$pending` property. Also, all asynchronous validators
+ *      will only run once all synchronous validators have passed.
+ *
+ * Please note that if $http is used then it is important that the server returns a success HTTP response code
+ * in order to fulfill the validation and a status level of `4xx` in order to reject the validation.
+ *
+ * ```js
+ * ngModel.$asyncValidators.uniqueUsername = function(modelValue, viewValue) {
+ *   var value = modelValue || viewValue;
+ *
+ *   // Lookup user by username
+ *   return $http.get('/api/users/' + value).
+ *      then(function resolved() {
+ *        //username exists, this means validation fails
+ *        return $q.reject('exists');
+ *      }, function rejected() {
+ *        //username does not exist, therefore this validation passes
+ *        return true;
+ *      });
+ * };
+ * ```
+ *
+ * @property {Array.<Function>} $viewChangeListeners Array of functions to execute whenever the
+ *     view value has changed. It is called with no arguments, and its return value is ignored.
+ *     This can be used in place of additional $watches against the model value.
+ *
+ * @property {Object} $error An object hash with all failing validator ids as keys.
+ * @property {Object} $pending An object hash with all pending validator ids as keys.
+ *
+ * @property {boolean} $untouched True if control has not lost focus yet.
+ * @property {boolean} $touched True if control has lost focus.
+ * @property {boolean} $pristine True if user has not interacted with the control yet.
+ * @property {boolean} $dirty True if user has already interacted with the control.
+ * @property {boolean} $valid True if there is no error.
+ * @property {boolean} $invalid True if at least one error on the control.
+ * @property {string} $name The name attribute of the control.
+ *
+ * @description
+ *
+ * `NgModelController` provides API for the {@link ngModel `ngModel`} directive.
+ * The controller contains services for data-binding, validation, CSS updates, and value formatting
+ * and parsing. It purposefully does not contain any logic which deals with DOM rendering or
+ * listening to DOM events.
+ * Such DOM related logic should be provided by other directives which make use of
+ * `NgModelController` for data-binding to control elements.
+ * Angular provides this DOM logic for most {@link input `input`} elements.
+ * At the end of this page you can find a {@link ngModel.NgModelController#custom-control-example
+ * custom control example} that uses `ngModelController` to bind to `contenteditable` elements.
+ *
+ * @example
+ * ### Custom Control Example
+ * This example shows how to use `NgModelController` with a custom control to achieve
+ * data-binding. Notice how different directives (`contenteditable`, `ng-model`, and `required`)
+ * collaborate together to achieve the desired result.
+ *
+ * `contenteditable` is an HTML5 attribute, which tells the browser to let the element
+ * contents be edited in place by the user.
+ *
+ * We are using the {@link ng.service:$sce $sce} service here and include the {@link ngSanitize $sanitize}
+ * module to automatically remove "bad" content like inline event listener (e.g. `<span onclick="...">`).
+ * However, as we are using `$sce` the model can still decide to provide unsafe content if it marks
+ * that content using the `$sce` service.
+ *
+ * <example name="NgModelController" module="customControl" deps="angular-sanitize.js">
+    <file name="style.css">
+      [contenteditable] {
+        border: 1px solid black;
+        background-color: white;
+        min-height: 20px;
+      }
+
+      .ng-invalid {
+        border: 1px solid red;
+      }
+
+    </file>
+    <file name="script.js">
+      angular.module('customControl', ['ngSanitize']).
+        directive('contenteditable', ['$sce', function($sce) {
+          return {
+            restrict: 'A', // only activate on element attribute
+            require: '?ngModel', // get a hold of NgModelController
+            link: function(scope, element, attrs, ngModel) {
+              if (!ngModel) return; // do nothing if no ng-model
+
+              // Specify how UI should be updated
+              ngModel.$render = function() {
+                element.html($sce.getTrustedHtml(ngModel.$viewValue || ''));
+              };
+
+              // Listen for change events to enable binding
+              element.on('blur keyup change', function() {
+                scope.$evalAsync(read);
+              });
+              read(); // initialize
+
+              // Write data to the model
+              function read() {
+                var html = element.html();
+                // When we clear the content editable the browser leaves a <br> behind
+                // If strip-br attribute is provided then we strip this out
+                if ( attrs.stripBr && html == '<br>' ) {
+                  html = '';
+                }
+                ngModel.$setViewValue(html);
+              }
+            }
+          };
+        }]);
+    </file>
+    <file name="index.html">
+      <form name="myForm">
+       <div contenteditable
+            name="myWidget" ng-model="userContent"
+            strip-br="true"
+            required>Change me!</div>
+        <span ng-show="myForm.myWidget.$error.required">Required!</span>
+       <hr>
+       <textarea ng-model="userContent" aria-label="Dynamic textarea"></textarea>
+      </form>
+    </file>
+    <file name="protractor.js" type="protractor">
+    it('should data-bind and become invalid', function() {
+      if (browser.params.browser == 'safari' || browser.params.browser == 'firefox') {
+        // SafariDriver can't handle contenteditable
+        // and Firefox driver can't clear contenteditables very well
+        return;
+      }
+      var contentEditable = element(by.css('[contenteditable]'));
+      var content = 'Change me!';
+
+      expect(contentEditable.getText()).toEqual(content);
+
+      contentEditable.clear();
+      contentEditable.sendKeys(protractor.Key.BACK_SPACE);
+      expect(contentEditable.getText()).toEqual('');
+      expect(contentEditable.getAttribute('class')).toMatch(/ng-invalid-required/);
+    });
+    </file>
+ * </example>
+ *
+ *
+ */
+var NgModelController = ['$scope', '$exceptionHandler', '$attrs', '$element', '$parse', '$animate', '$timeout', '$rootScope', '$q', '$interpolate',
+    function($scope, $exceptionHandler, $attr, $element, $parse, $animate, $timeout, $rootScope, $q, $interpolate) {
+  this.$viewValue = Number.NaN;
+  this.$modelValue = Number.NaN;
+  this.$$rawModelValue = undefined; // stores the parsed modelValue / model set from scope regardless of validity.
+  this.$validators = {};
+  this.$asyncValidators = {};
+  this.$parsers = [];
+  this.$formatters = [];
+  this.$viewChangeListeners = [];
+  this.$untouched = true;
+  this.$touched = false;
+  this.$pristine = true;
+  this.$dirty = false;
+  this.$valid = true;
+  this.$invalid = false;
+  this.$error = {}; // keep invalid keys here
+  this.$$success = {}; // keep valid keys here
+  this.$pending = undefined; // keep pending keys here
+  this.$name = $interpolate($attr.name || '', false)($scope);
+  this.$$parentForm = nullFormCtrl;
+
+  var parsedNgModel = $parse($attr.ngModel),
+      parsedNgModelAssign = parsedNgModel.assign,
+      ngModelGet = parsedNgModel,
+      ngModelSet = parsedNgModelAssign,
+      pendingDebounce = null,
+      parserValid,
+      ctrl = this;
+
+  this.$$setOptions = function(options) {
+    ctrl.$options = options;
+    if (options && options.getterSetter) {
+      var invokeModelGetter = $parse($attr.ngModel + '()'),
+          invokeModelSetter = $parse($attr.ngModel + '($$$p)');
+
+      ngModelGet = function($scope) {
+        var modelValue = parsedNgModel($scope);
+        if (isFunction(modelValue)) {
+          modelValue = invokeModelGetter($scope);
+        }
+        return modelValue;
+      };
+      ngModelSet = function($scope, newValue) {
+        if (isFunction(parsedNgModel($scope))) {
+          invokeModelSetter($scope, {$$$p: ctrl.$modelValue});
+        } else {
+          parsedNgModelAssign($scope, ctrl.$modelValue);
+        }
+      };
+    } else if (!parsedNgModel.assign) {
+      throw ngModelMinErr('nonassign', "Expression '{0}' is non-assignable. Element: {1}",
+          $attr.ngModel, startingTag($element));
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$render
+   *
+   * @description
+   * Called when the view needs to be updated. It is expected that the user of the ng-model
+   * directive will implement this method.
+   *
+   * The `$render()` method is invoked in the following situations:
+   *
+   * * `$rollbackViewValue()` is called.  If we are rolling back the view value to the last
+   *   committed value then `$render()` is called to update the input control.
+   * * The value referenced by `ng-model` is changed programmatically and both the `$modelValue` and
+   *   the `$viewValue` are different from last time.
+   *
+   * Since `ng-model` does not do a deep watch, `$render()` is only invoked if the values of
+   * `$modelValue` and `$viewValue` are actually different from their previous value. If `$modelValue`
+   * or `$viewValue` are objects (rather than a string or number) then `$render()` will not be
+   * invoked if you only change a property on the objects.
+   */
+  this.$render = noop;
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$isEmpty
+   *
+   * @description
+   * This is called when we need to determine if the value of an input is empty.
+   *
+   * For instance, the required directive does this to work out if the input has data or not.
+   *
+   * The default `$isEmpty` function checks whether the value is `undefined`, `''`, `null` or `NaN`.
+   *
+   * You can override this for input directives whose concept of being empty is different from the
+   * default. The `checkboxInputType` directive does this because in its case a value of `false`
+   * implies empty.
+   *
+   * @param {*} value The value of the input to check for emptiness.
+   * @returns {boolean} True if `value` is "empty".
+   */
+  this.$isEmpty = function(value) {
+    return isUndefined(value) || value === '' || value === null || value !== value;
+  };
+
+  var currentValidationRunId = 0;
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setValidity
+   *
+   * @description
+   * Change the validity state, and notify the form.
+   *
+   * This method can be called within $parsers/$formatters or a custom validation implementation.
+   * However, in most cases it should be sufficient to use the `ngModel.$validators` and
+   * `ngModel.$asyncValidators` collections which will call `$setValidity` automatically.
+   *
+   * @param {string} validationErrorKey Name of the validator. The `validationErrorKey` will be assigned
+   *        to either `$error[validationErrorKey]` or `$pending[validationErrorKey]`
+   *        (for unfulfilled `$asyncValidators`), so that it is available for data-binding.
+   *        The `validationErrorKey` should be in camelCase and will get converted into dash-case
+   *        for class name. Example: `myError` will result in `ng-valid-my-error` and `ng-invalid-my-error`
+   *        class and can be bound to as  `{{someForm.someControl.$error.myError}}` .
+   * @param {boolean} isValid Whether the current state is valid (true), invalid (false), pending (undefined),
+   *                          or skipped (null). Pending is used for unfulfilled `$asyncValidators`.
+   *                          Skipped is used by Angular when validators do not run because of parse errors and
+   *                          when `$asyncValidators` do not run because any of the `$validators` failed.
+   */
+  addSetValidityMethod({
+    ctrl: this,
+    $element: $element,
+    set: function(object, property) {
+      object[property] = true;
+    },
+    unset: function(object, property) {
+      delete object[property];
+    },
+    $animate: $animate
+  });
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setPristine
+   *
+   * @description
+   * Sets the control to its pristine state.
+   *
+   * This method can be called to remove the `ng-dirty` class and set the control to its pristine
+   * state (`ng-pristine` class). A model is considered to be pristine when the control
+   * has not been changed from when first compiled.
+   */
+  this.$setPristine = function() {
+    ctrl.$dirty = false;
+    ctrl.$pristine = true;
+    $animate.removeClass($element, DIRTY_CLASS);
+    $animate.addClass($element, PRISTINE_CLASS);
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setDirty
+   *
+   * @description
+   * Sets the control to its dirty state.
+   *
+   * This method can be called to remove the `ng-pristine` class and set the control to its dirty
+   * state (`ng-dirty` class). A model is considered to be dirty when the control has been changed
+   * from when first compiled.
+   */
+  this.$setDirty = function() {
+    ctrl.$dirty = true;
+    ctrl.$pristine = false;
+    $animate.removeClass($element, PRISTINE_CLASS);
+    $animate.addClass($element, DIRTY_CLASS);
+    ctrl.$$parentForm.$setDirty();
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setUntouched
+   *
+   * @description
+   * Sets the control to its untouched state.
+   *
+   * This method can be called to remove the `ng-touched` class and set the control to its
+   * untouched state (`ng-untouched` class). Upon compilation, a model is set as untouched
+   * by default, however this function can be used to restore that state if the model has
+   * already been touched by the user.
+   */
+  this.$setUntouched = function() {
+    ctrl.$touched = false;
+    ctrl.$untouched = true;
+    $animate.setClass($element, UNTOUCHED_CLASS, TOUCHED_CLASS);
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setTouched
+   *
+   * @description
+   * Sets the control to its touched state.
+   *
+   * This method can be called to remove the `ng-untouched` class and set the control to its
+   * touched state (`ng-touched` class). A model is considered to be touched when the user has
+   * first focused the control element and then shifted focus away from the control (blur event).
+   */
+  this.$setTouched = function() {
+    ctrl.$touched = true;
+    ctrl.$untouched = false;
+    $animate.setClass($element, TOUCHED_CLASS, UNTOUCHED_CLASS);
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$rollbackViewValue
+   *
+   * @description
+   * Cancel an update and reset the input element's value to prevent an update to the `$modelValue`,
+   * which may be caused by a pending debounced event or because the input is waiting for a some
+   * future event.
+   *
+   * If you have an input that uses `ng-model-options` to set up debounced events or events such
+   * as blur you can have a situation where there is a period when the `$viewValue`
+   * is out of synch with the ngModel's `$modelValue`.
+   *
+   * In this case, you can run into difficulties if you try to update the ngModel's `$modelValue`
+   * programmatically before these debounced/future events have resolved/occurred, because Angular's
+   * dirty checking mechanism is not able to tell whether the model has actually changed or not.
+   *
+   * The `$rollbackViewValue()` method should be called before programmatically changing the model of an
+   * input which may have such events pending. This is important in order to make sure that the
+   * input field will be updated with the new model value and any pending operations are cancelled.
+   *
+   * <example name="ng-model-cancel-update" module="cancel-update-example">
+   *   <file name="app.js">
+   *     angular.module('cancel-update-example', [])
+   *
+   *     .controller('CancelUpdateController', ['$scope', function($scope) {
+   *       $scope.resetWithCancel = function(e) {
+   *         if (e.keyCode == 27) {
+   *           $scope.myForm.myInput1.$rollbackViewValue();
+   *           $scope.myValue = '';
+   *         }
+   *       };
+   *       $scope.resetWithoutCancel = function(e) {
+   *         if (e.keyCode == 27) {
+   *           $scope.myValue = '';
+   *         }
+   *       };
+   *     }]);
+   *   </file>
+   *   <file name="index.html">
+   *     <div ng-controller="CancelUpdateController">
+   *       <p>Try typing something in each input.  See that the model only updates when you
+   *          blur off the input.
+   *        </p>
+   *        <p>Now see what happens if you start typing then press the Escape key</p>
+   *
+   *       <form name="myForm" ng-model-options="{ updateOn: 'blur' }">
+   *         <p id="inputDescription1">With $rollbackViewValue()</p>
+   *         <input name="myInput1" aria-describedby="inputDescription1" ng-model="myValue"
+   *                ng-keydown="resetWithCancel($event)"><br/>
+   *         myValue: "{{ myValue }}"
+   *
+   *         <p id="inputDescription2">Without $rollbackViewValue()</p>
+   *         <input name="myInput2" aria-describedby="inputDescription2" ng-model="myValue"
+   *                ng-keydown="resetWithoutCancel($event)"><br/>
+   *         myValue: "{{ myValue }}"
+   *       </form>
+   *     </div>
+   *   </file>
+   * </example>
+   */
+  this.$rollbackViewValue = function() {
+    $timeout.cancel(pendingDebounce);
+    ctrl.$viewValue = ctrl.$$lastCommittedViewValue;
+    ctrl.$render();
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$validate
+   *
+   * @description
+   * Runs each of the registered validators (first synchronous validators and then
+   * asynchronous validators).
+   * If the validity changes to invalid, the model will be set to `undefined`,
+   * unless {@link ngModelOptions `ngModelOptions.allowInvalid`} is `true`.
+   * If the validity changes to valid, it will set the model to the last available valid
+   * `$modelValue`, i.e. either the last parsed value or the last value set from the scope.
+   */
+  this.$validate = function() {
+    // ignore $validate before model is initialized
+    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {
+      return;
+    }
+
+    var viewValue = ctrl.$$lastCommittedViewValue;
+    // Note: we use the $$rawModelValue as $modelValue might have been
+    // set to undefined during a view -> model update that found validation
+    // errors. We can't parse the view here, since that could change
+    // the model although neither viewValue nor the model on the scope changed
+    var modelValue = ctrl.$$rawModelValue;
+
+    var prevValid = ctrl.$valid;
+    var prevModelValue = ctrl.$modelValue;
+
+    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
+
+    ctrl.$$runValidators(modelValue, viewValue, function(allValid) {
+      // If there was no change in validity, don't update the model
+      // This prevents changing an invalid modelValue to undefined
+      if (!allowInvalid && prevValid !== allValid) {
+        // Note: Don't check ctrl.$valid here, as we could have
+        // external validators (e.g. calculated on the server),
+        // that just call $setValidity and need the model value
+        // to calculate their validity.
+        ctrl.$modelValue = allValid ? modelValue : undefined;
+
+        if (ctrl.$modelValue !== prevModelValue) {
+          ctrl.$$writeModelToScope();
+        }
+      }
+    });
+
+  };
+
+  this.$$runValidators = function(modelValue, viewValue, doneCallback) {
+    currentValidationRunId++;
+    var localValidationRunId = currentValidationRunId;
+
+    // check parser error
+    if (!processParseErrors()) {
+      validationDone(false);
+      return;
+    }
+    if (!processSyncValidators()) {
+      validationDone(false);
+      return;
+    }
+    processAsyncValidators();
+
+    function processParseErrors() {
+      var errorKey = ctrl.$$parserName || 'parse';
+      if (isUndefined(parserValid)) {
+        setValidity(errorKey, null);
+      } else {
+        if (!parserValid) {
+          forEach(ctrl.$validators, function(v, name) {
+            setValidity(name, null);
+          });
+          forEach(ctrl.$asyncValidators, function(v, name) {
+            setValidity(name, null);
+          });
+        }
+        // Set the parse error last, to prevent unsetting it, should a $validators key == parserName
+        setValidity(errorKey, parserValid);
+        return parserValid;
+      }
+      return true;
+    }
+
+    function processSyncValidators() {
+      var syncValidatorsValid = true;
+      forEach(ctrl.$validators, function(validator, name) {
+        var result = validator(modelValue, viewValue);
+        syncValidatorsValid = syncValidatorsValid && result;
+        setValidity(name, result);
+      });
+      if (!syncValidatorsValid) {
+        forEach(ctrl.$asyncValidators, function(v, name) {
+          setValidity(name, null);
+        });
+        return false;
+      }
+      return true;
+    }
+
+    function processAsyncValidators() {
+      var validatorPromises = [];
+      var allValid = true;
+      forEach(ctrl.$asyncValidators, function(validator, name) {
+        var promise = validator(modelValue, viewValue);
+        if (!isPromiseLike(promise)) {
+          throw ngModelMinErr("$asyncValidators",
+            "Expected asynchronous validator to return a promise but got '{0}' instead.", promise);
+        }
+        setValidity(name, undefined);
+        validatorPromises.push(promise.then(function() {
+          setValidity(name, true);
+        }, function(error) {
+          allValid = false;
+          setValidity(name, false);
+        }));
+      });
+      if (!validatorPromises.length) {
+        validationDone(true);
+      } else {
+        $q.all(validatorPromises).then(function() {
+          validationDone(allValid);
+        }, noop);
+      }
+    }
+
+    function setValidity(name, isValid) {
+      if (localValidationRunId === currentValidationRunId) {
+        ctrl.$setValidity(name, isValid);
+      }
+    }
+
+    function validationDone(allValid) {
+      if (localValidationRunId === currentValidationRunId) {
+
+        doneCallback(allValid);
+      }
+    }
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$commitViewValue
+   *
+   * @description
+   * Commit a pending update to the `$modelValue`.
+   *
+   * Updates may be pending by a debounced event or because the input is waiting for a some future
+   * event defined in `ng-model-options`. this method is rarely needed as `NgModelController`
+   * usually handles calling this in response to input events.
+   */
+  this.$commitViewValue = function() {
+    var viewValue = ctrl.$viewValue;
+
+    $timeout.cancel(pendingDebounce);
+
+    // If the view value has not changed then we should just exit, except in the case where there is
+    // a native validator on the element. In this case the validation state may have changed even though
+    // the viewValue has stayed empty.
+    if (ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)) {
+      return;
+    }
+    ctrl.$$lastCommittedViewValue = viewValue;
+
+    // change to dirty
+    if (ctrl.$pristine) {
+      this.$setDirty();
+    }
+    this.$$parseAndValidate();
+  };
+
+  this.$$parseAndValidate = function() {
+    var viewValue = ctrl.$$lastCommittedViewValue;
+    var modelValue = viewValue;
+    parserValid = isUndefined(modelValue) ? undefined : true;
+
+    if (parserValid) {
+      for (var i = 0; i < ctrl.$parsers.length; i++) {
+        modelValue = ctrl.$parsers[i](modelValue);
+        if (isUndefined(modelValue)) {
+          parserValid = false;
+          break;
+        }
+      }
+    }
+    if (isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)) {
+      // ctrl.$modelValue has not been touched yet...
+      ctrl.$modelValue = ngModelGet($scope);
+    }
+    var prevModelValue = ctrl.$modelValue;
+    var allowInvalid = ctrl.$options && ctrl.$options.allowInvalid;
+    ctrl.$$rawModelValue = modelValue;
+
+    if (allowInvalid) {
+      ctrl.$modelValue = modelValue;
+      writeToModelIfNeeded();
+    }
+
+    // Pass the $$lastCommittedViewValue here, because the cached viewValue might be out of date.
+    // This can happen if e.g. $setViewValue is called from inside a parser
+    ctrl.$$runValidators(modelValue, ctrl.$$lastCommittedViewValue, function(allValid) {
+      if (!allowInvalid) {
+        // Note: Don't check ctrl.$valid here, as we could have
+        // external validators (e.g. calculated on the server),
+        // that just call $setValidity and need the model value
+        // to calculate their validity.
+        ctrl.$modelValue = allValid ? modelValue : undefined;
+        writeToModelIfNeeded();
+      }
+    });
+
+    function writeToModelIfNeeded() {
+      if (ctrl.$modelValue !== prevModelValue) {
+        ctrl.$$writeModelToScope();
+      }
+    }
+  };
+
+  this.$$writeModelToScope = function() {
+    ngModelSet($scope, ctrl.$modelValue);
+    forEach(ctrl.$viewChangeListeners, function(listener) {
+      try {
+        listener();
+      } catch (e) {
+        $exceptionHandler(e);
+      }
+    });
+  };
+
+  /**
+   * @ngdoc method
+   * @name ngModel.NgModelController#$setViewValue
+   *
+   * @description
+   * Update the view value.
+   *
+   * This method should be called when a control wants to change the view value; typically,
+   * this is done from within a DOM event handler. For example, the {@link ng.directive:input input}
+   * directive calls it when the value of the input changes and {@link ng.directive:select select}
+   * calls it when an option is selected.
+   *
+   * When `$setViewValue` is called, the new `value` will be staged for committing through the `$parsers`
+   * and `$validators` pipelines. If there are no special {@link ngModelOptions} specified then the staged
+   * value sent directly for processing, finally to be applied to `$modelValue` and then the
+   * **expression** specified in the `ng-model` attribute. Lastly, all the registered change listeners,
+   * in the `$viewChangeListeners` list, are called.
+   *
+   * In case the {@link ng.directive:ngModelOptions ngModelOptions} directive is used with `updateOn`
+   * and the `default` trigger is not listed, all those actions will remain pending until one of the
+   * `updateOn` events is triggered on the DOM element.
+   * All these actions will be debounced if the {@link ng.directive:ngModelOptions ngModelOptions}
+   * directive is used with a custom debounce for this particular event.
+   * Note that a `$digest` is only triggered once the `updateOn` events are fired, or if `debounce`
+   * is specified, once the timer runs out.
+   *
+   * When used with standard inputs, the view value will always be a string (which is in some cases
+   * parsed into another type, such as a `Date` object for `input[date]`.)
+   * However, custom controls might also pass objects to this method. In this case, we should make
+   * a copy of the object before passing it to `$setViewValue`. This is because `ngModel` does not
+   * perform a deep watch of objects, it only looks for a change of identity. If you only change
+   * the property of the object then ngModel will not realise that the object has changed and
+   * will not invoke the `$parsers` and `$validators` pipelines. For this reason, you should
+   * not change properties of the copy once it has been passed to `$setViewValue`.
+   * Otherwise you may cause the model value on the scope to change incorrectly.
+   *
+   * <div class="alert alert-info">
+   * In any case, the value passed to the method should always reflect the current value
+   * of the control. For example, if you are calling `$setViewValue` for an input element,
+   * you should pass the input DOM value. Otherwise, the control and the scope model become
+   * out of sync. It's also important to note that `$setViewValue` does not call `$render` or change
+   * the control's DOM value in any way. If we want to change the control's DOM value
+   * programmatically, we should update the `ngModel` scope expression. Its new value will be
+   * picked up by the model controller, which will run it through the `$formatters`, `$render` it
+   * to update the DOM, and finally call `$validate` on it.
+   * </div>
+   *
+   * @param {*} value value from the view.
+   * @param {string} trigger Event that triggered the update.
+   */
+  this.$setViewValue = function(value, trigger) {
+    ctrl.$viewValue = value;
+    if (!ctrl.$options || ctrl.$options.updateOnDefault) {
+      ctrl.$$debounceViewValueCommit(trigger);
+    }
+  };
+
+  this.$$debounceViewValueCommit = function(trigger) {
+    var debounceDelay = 0,
+        options = ctrl.$options,
+        debounce;
+
+    if (options && isDefined(options.debounce)) {
+      debounce = options.debounce;
+      if (isNumber(debounce)) {
+        debounceDelay = debounce;
+      } else if (isNumber(debounce[trigger])) {
+        debounceDelay = debounce[trigger];
+      } else if (isNumber(debounce['default'])) {
+        debounceDelay = debounce['default'];
+      }
+    }
+
+    $timeout.cancel(pendingDebounce);
+    if (debounceDelay) {
+      pendingDebounce = $timeout(function() {
+        ctrl.$commitViewValue();
+      }, debounceDelay);
+    } else if ($rootScope.$$phase) {
+      ctrl.$commitViewValue();
+    } else {
+      $scope.$apply(function() {
+        ctrl.$commitViewValue();
+      });
+    }
+  };
+
+  // model -> value
+  // Note: we cannot use a normal scope.$watch as we want to detect the following:
+  // 1. scope value is 'a'
+  // 2. user enters 'b'
+  // 3. ng-change kicks in and reverts scope value to 'a'
+  //    -> scope value did not change since the last digest as
+  //       ng-change executes in apply phase
+  // 4. view should be changed back to 'a'
+  $scope.$watch(function ngModelWatch() {
+    var modelValue = ngModelGet($scope);
+
+    // if scope model value and ngModel value are out of sync
+    // TODO(perf): why not move this to the action fn?
+    if (modelValue !== ctrl.$modelValue &&
+       // checks for NaN is needed to allow setting the model to NaN when there's an asyncValidator
+       (ctrl.$modelValue === ctrl.$modelValue || modelValue === modelValue)
+    ) {
+      ctrl.$modelValue = ctrl.$$rawModelValue = modelValue;
+      parserValid = undefined;
+
+      var formatters = ctrl.$formatters,
+          idx = formatters.length;
+
+      var viewValue = modelValue;
+      while (idx--) {
+        viewValue = formatters[idx](viewValue);
+      }
+      if (ctrl.$viewValue !== viewValue) {
+        ctrl.$viewValue = ctrl.$$lastCommittedViewValue = viewValue;
+        ctrl.$render();
+
+        ctrl.$$runValidators(modelValue, viewValue, noop);
+      }
+    }
+
+    return modelValue;
+  });
+}];
+
+
+/**
+ * @ngdoc directive
+ * @name ngModel
+ *
+ * @element input
+ * @priority 1
+ *
+ * @description
+ * The `ngModel` directive binds an `input`,`select`, `textarea` (or custom form control) to a
+ * property on the scope using {@link ngModel.NgModelController NgModelController},
+ * which is created and exposed by this directive.
+ *
+ * `ngModel` is responsible for:
+ *
+ * - Binding the view into the model, which other directives such as `input`, `textarea` or `select`
+ *   require.
+ * - Providing validation behavior (i.e. required, number, email, url).
+ * - Keeping the state of the control (valid/invalid, dirty/pristine, touched/untouched, validation errors).
+ * - Setting related css classes on the element (`ng-valid`, `ng-invalid`, `ng-dirty`, `ng-pristine`, `ng-touched`, `ng-untouched`) including animations.
+ * - Registering the control with its parent {@link ng.directive:form form}.
+ *
+ * Note: `ngModel` will try to bind to the property given by evaluating the expression on the
+ * current scope. If the property doesn't already exist on this scope, it will be created
+ * implicitly and added to the scope.
+ *
+ * For best practices on using `ngModel`, see:
+ *
+ *  - [Understanding Scopes](https://github.com/angular/angular.js/wiki/Understanding-Scopes)
+ *
+ * For basic examples, how to use `ngModel`, see:
+ *
+ *  - {@link ng.directive:input input}
+ *    - {@link input[text] text}
+ *    - {@link input[checkbox] checkbox}
+ *    - {@link input[radio] radio}
+ *    - {@link input[number] number}
+ *    - {@link input[email] email}
+ *    - {@link input[url] url}
+ *    - {@link input[date] date}
+ *    - {@link input[datetime-local] datetime-local}
+ *    - {@link input[time] time}
+ *    - {@link input[month] month}
+ *    - {@link input[week] week}
+ *  - {@link ng.directive:select select}
+ *  - {@link ng.directive:textarea textarea}
+ *
+ * # CSS classes
+ * The following CSS classes are added and removed on the associated input/select/textarea element
+ * depending on the validity of the model.
+ *
+ *  - `ng-valid`: the model is valid
+ *  - `ng-invalid`: the model is invalid
+ *  - `ng-valid-[key]`: for each valid key added by `$setValidity`
+ *  - `ng-invalid-[key]`: for each invalid key added by `$setValidity`
+ *  - `ng-pristine`: the control hasn't been interacted with yet
+ *  - `ng-dirty`: the control has been interacted with
+ *  - `ng-touched`: the control has been blurred
+ *  - `ng-untouched`: the control hasn't been blurred
+ *  - `ng-pending`: any `$asyncValidators` are unfulfilled
+ *
+ * Keep in mind that ngAnimate can detect each of these classes when added and removed.
+ *
+ * ## Animation Hooks
+ *
+ * Animations within models are triggered when any of the associated CSS classes are added and removed
+ * on the input element which is attached to the model. These classes are: `.ng-pristine`, `.ng-dirty`,
+ * `.ng-invalid` and `.ng-valid` as well as any other validations that are performed on the model itself.
+ * The animations that are triggered within ngModel are similar to how they work in ngClass and
+ * animations can be hooked into using CSS transitions, keyframes as well as JS animations.
+ *
+ * The following example shows a simple way to utilize CSS transitions to style an input element
+ * that has been rendered as invalid after it has been validated:
+ *
+ * <pre>
+ * //be sure to include ngAnimate as a module to hook into more
+ * //advanced animations
+ * .my-input {
+ *   transition:0.5s linear all;
+ *   background: white;
+ * }
+ * .my-input.ng-invalid {
+ *   background: red;
+ *   color:white;
+ * }
+ * </pre>
+ *
+ * @example
+ * <example deps="angular-animate.js" animations="true" fixBase="true" module="inputExample">
+     <file name="index.html">
+       <script>
+        angular.module('inputExample', [])
+          .controller('ExampleController', ['$scope', function($scope) {
+            $scope.val = '1';
+          }]);
+       </script>
+       <style>
+         .my-input {
+           transition:all linear 0.5s;
+           background: transparent;
+         }
+         .my-input.ng-invalid {
+           color:white;
+           background: red;
+         }
+       </style>
+       <p id="inputDescription">
+        Update input to see transitions when valid/invalid.
+        Integer is a valid value.
+       </p>
+       <form name="testForm" ng-controller="ExampleController">
+         <input ng-model="val" ng-pattern="/^\d+$/" name="anim" class="my-input"
+                aria-describedby="inputDescription" />
+       </form>
+     </file>
+ * </example>
+ *
+ * ## Binding to a getter/setter
+ *
+ * Sometimes it's helpful to bind `ngModel` to a getter/setter function.  A getter/setter is a
+ * function that returns a representation of the model when called with zero arguments, and sets
+ * the internal state of a model when called with an argument. It's sometimes useful to use this
+ * for models that have an internal representation that's different from what the model exposes
+ * to the view.
+ *
+ * <div class="alert alert-success">
+ * **Best Practice:** It's best to keep getters fast because Angular is likely to call them more
+ * frequently than other parts of your code.
+ * </div>
+ *
+ * You use this behavior by adding `ng-model-options="{ getterSetter: true }"` to an element that
+ * has `ng-model` attached to it. You can also add `ng-model-options="{ getterSetter: true }"` to
+ * a `<form>`, which will enable this behavior for all `<input>`s within it. See
+ * {@link ng.directive:ngModelOptions `ngModelOptions`} for more.
+ *
+ * The following example shows how to use `ngModel` with a getter/setter:
+ *
+ * @example
+ * <example name="ngModel-getter-setter" module="getterSetterExample">
+     <file name="index.html">
+       <div ng-controller="ExampleController">
+         <form name="userForm">
+           <label>Name:
+             <input type="text" name="userName"
+                    ng-model="user.name"
+                    ng-model-options="{ getterSetter: true }" />
+           </label>
+         </form>
+         <pre>user.name = <span ng-bind="user.name()"></span></pre>
+       </div>
+     </file>
+     <file name="app.js">
+       angular.module('getterSetterExample', [])
+         .controller('ExampleController', ['$scope', function($scope) {
+           var _name = 'Brian';
+           $scope.user = {
+             name: function(newName) {
+              // Note that newName can be undefined for two reasons:
+              // 1. Because it is called as a getter and thus called with no arguments
+              // 2. Because the property should actually be set to undefined. This happens e.g. if the
+              //    input is invalid
+              return arguments.length ? (_name = newName) : _name;
+             }
+           };
+         }]);
+     </file>
+ * </example>
+ */
+var ngModelDirective = ['$rootScope', function($rootScope) {
+  return {
+    restrict: 'A',
+    require: ['ngModel', '^?form', '^?ngModelOptions'],
+    controller: NgModelController,
+    // Prelink needs to run before any input directive
+    // so that we can set the NgModelOptions in NgModelController
+    // before anyone else uses it.
+    priority: 1,
+    compile: function ngModelCompile(element) {
+      // Setup initial state of the control
+      element.addClass(PRISTINE_CLASS).addClass(UNTOUCHED_CLASS).addClass(VALID_CLASS);
+
+      return {
+        pre: function ngModelPreLink(scope, element, attr, ctrls) {
+          var modelCtrl = ctrls[0],
+              formCtrl = ctrls[1] || modelCtrl.$$parentForm;
+
+          modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);
+
+          // notify others, especially parent forms
+          formCtrl.$addControl(modelCtrl);
+
+          attr.$observe('name', function(newValue) {
+            if (modelCtrl.$name !== newValue) {
+              modelCtrl.$$parentForm.$$renameControl(modelCtrl, newValue);
+            }
+          });
+
+          scope.$on('$destroy', function() {
+            modelCtrl.$$parentForm.$removeControl(modelCtrl);
+          });
+        },
+        post: function ngModelPostLink(scope, element, attr, ctrls) {
+          var modelCtrl = ctrls[0];
+          if (modelCtrl.$options && modelCtrl.$options.updateOn) {
+            element.on(modelCtrl.$options.updateOn, function(ev) {
+              modelCtrl.$$debounceViewValueCommit(ev && ev.type);
+            });
+          }
+
+          element.on('blur', function(ev) {
+            if (modelCtrl.$touched) return;
+
+            if ($rootScope.$$phase) {
+              scope.$evalAsync(modelCtrl.$setTouched);
+            } else {
+              scope.$apply(modelCtrl.$setTouched);
+            }
+          });
+        }
+      };
+    }
+  };
+}];
+
+var DEFAULT_REGEXP = /(\s+|^)default(\s+|$)/;
+
+/**
+ * @ngdoc directive
+ * @name ngModelOptions
+ *
+ * @description
+ * Allows tuning how model updates are done. Using `ngModelOptions` you can specify a custom list of
+ * events that will trigger a model update and/or a debouncing delay so that the actual update only
+ * takes place when a timer expires; this timer will be reset after another change takes place.
+ *
+ * Given the nature of `ngModelOptions`, the value displayed inside input fields in the view might
+ * be different from the value in the actual model. This means that if you update the model you
+ * should also invoke {@link ngModel.NgModelController `$rollbackViewValue`} on the relevant input field in
+ * order to make sure it is synchronized with the model and that any debounced action is canceled.
+ *
+ * The easiest way to reference the control's {@link ngModel.NgModelController `$rollbackViewValue`}
+ * method is by making sure the input is placed inside a form that has a `name` attribute. This is
+ * important because `form` controllers are published to the related scope under the name in their
+ * `name` attribute.
+ *
+ * Any pending changes will take place immediately when an enclosing form is submitted via the
+ * `submit` event. Note that `ngClick` events will occur before the model is updated. Use `ngSubmit`
+ * to have access to the updated model.
+ *
+ * `ngModelOptions` has an effect on the element it's declared on and its descendants.
+ *
+ * @param {Object} ngModelOptions options to apply to the current model. Valid keys are:
+ *   - `updateOn`: string specifying which event should the input be bound to. You can set several
+ *     events using an space delimited list. There is a special event called `default` that
+ *     matches the default events belonging of the control.
+ *   - `debounce`: integer value which contains the debounce model update value in milliseconds. A
+ *     value of 0 triggers an immediate update. If an object is supplied instead, you can specify a
+ *     custom value for each event. For example:
+ *     `ng-model-options="{ updateOn: 'default blur', debounce: { 'default': 500, 'blur': 0 } }"`
+ *   - `allowInvalid`: boolean value which indicates that the model can be set with values that did
+ *     not validate correctly instead of the default behavior of setting the model to undefined.
+ *   - `getterSetter`: boolean value which determines whether or not to treat functions bound to
+       `ngModel` as getters/setters.
+ *   - `timezone`: Defines the timezone to be used to read/write the `Date` instance in the model for
+ *     `<input type="date">`, `<input type="time">`, ... . It understands UTC/GMT and the
+ *     continental US time zone abbreviations, but for general use, use a time zone offset, for
+ *     example, `'+0430'` (4 hours, 30 minutes east of the Greenwich meridian)
+ *     If not specified, the timezone of the browser will be used.
+ *
+ * @example
+
+  The following example shows how to override immediate updates. Changes on the inputs within the
+  form will update the model only when the control loses focus (blur event). If `escape` key is
+  pressed while the input field is focused, the value is reset to the value in the current model.
+
+  <example name="ngModelOptions-directive-blur" module="optionsExample">
+    <file name="index.html">
+      <div ng-controller="ExampleController">
+        <form name="userForm">
+          <label>Name:
+            <input type="text" name="userName"
+                   ng-model="user.name"
+                   ng-model-options="{ updateOn: 'blur' }"
+                   ng-keyup="cancel($event)" />
+          </label><br />
+          <label>Other data:
+            <input type="text" ng-model="user.data" />
+          </label><br />
+        </form>
+        <pre>user.name = <span ng-bind="user.name"></span></pre>
+      </div>
+    </file>
+    <file name="app.js">
+      angular.module('optionsExample', [])
+        .controller('ExampleController', ['$scope', function($scope) {
+          $scope.user = { name: 'say', data: '' };
+
+          $scope.cancel = function(e) {
+            if (e.keyCode == 27) {
+              $scope.userForm.userName.$rollbackViewValue();
+            }
+          };
+        }]);
+    </file>
+    <file name="protractor.js" type="protractor">
+      var model = element(by.binding('user.name'));
+      var input = element(by.model('user.name'));
+      var other = element(by.model('user.data'));
+
+      it('should allow custom events', function() {
+        input.sendKeys(' hello');
+        input.click();
+        expect(model.getText()).toEqual('say');
+        other.click();
+        expect(model.getText()).toEqual('say hello');
+      });
+
+      it('should $rollbackViewValue when model changes', function() {
+        input.sendKeys(' hello');
+        expect(input.getAttribute('value')).toEqual('say hello');
+        input.sendKeys(protractor.Key.ESCAPE);
+        expect(input.getAttribute('value')).toEqual('say');
+        other.click();
+        expect(model.getText()).toEqual('say');
+      });
+    </file>
+  </example>
+
+  This one shows how to debounce model changes. Model will be updated only 1 sec after last change.
+  If the `Clear` button is pressed, any debounced action is canceled and the value becomes empty.
+
+  <example name="ngModelOptions-directive-debounce" module="optionsExample">
+    <file name="index.html">
+      <div ng-controller="ExampleController">
+        <form name="userForm">
+          <label>Name:
+            <input type="text" name="userName"
+                   ng-model="user.name"
+                   ng-model-options="{ debounce: 1000 }" />
+          </label>
+          <button ng-click="userForm.userName.$rollbackViewValue(); user.name=''">Clear</button>
+          <br />
+        </form>
+        <pre>user.name = <span ng-bind="user.name"></span></pre>
+      </div>
+    </file>
+    <file name="app.js">
+      angular.module('optionsExample', [])
+        .controller('ExampleController', ['$scope', function($scope) {
+          $scope.user = { name: 'say' };
+        }]);
+    </file>
+  </example>
+
+  This one shows how to bind to getter/setters:
+
+  <example name="ngModelOptions-directive-getter-setter" module="getterSetterExample">
+    <file name="index.html">
+      <div ng-controller="ExampleController">
+        <form name="userForm">
+          <label>Name:
+            <input type="text" name="userName"
+                   ng-model="user.name"
+                   ng-model-options="{ getterSetter: true }" />
+          </label>
+        </form>
+        <pre>user.name = <span ng-bind="user.name()"></span></pre>
+      </div>
+    </file>
+    <file name="app.js">
+      angular.module('getterSetterExample', [])
+        .controller('ExampleController', ['$scope', function($scope) {
+          var _name = 'Brian';
+          $scope.user = {
+            name: function(newName) {
+              // Note that newName can be undefined for two reasons:
+              // 1. Because it is called as a getter and thus called with no arguments
+              // 2. Because the property should actually be set to undefined. This happens e.g. if the
+              //    input is invalid
+              return arguments.length ? (_name = newName) : _name;
+            }
+          };
+        }]);
+    </file>
+  </example>
+ */
+var ngModelOptionsDirective = function() {
+  return {
+    restrict: 'A',
+    controller: ['$scope', '$attrs', function($scope, $attrs) {
+      var that = this;
+      this.$options = copy($scope.$eval($attrs.ngModelOptions));
+      // Allow adding/overriding bound events
+      if (isDefined(this.$options.updateOn)) {
+        this.$options.updateOnDefault = false;
+        // extract "default" pseudo-event from list of events that can trigger a model update
+        this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP, function() {
+          that.$options.updateOnDefault = true;
+          return ' ';
+        }));
+      } else {
+        this.$options.updateOnDefault = true;
+      }
+    }]
+  };
+};
+
+
+
+// helper methods
+function addSetValidityMethod(context) {
+  var ctrl = context.ctrl,
+      $element = context.$element,
+      classCache = {},
+      set = context.set,
+      unset = context.unset,
+      $animate = context.$animate;
+
+  classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));
+
+  ctrl.$setValidity = setValidity;
+
+  function setValidity(validationErrorKey, state, controller) {
+    if (isUndefined(state)) {
+      createAndSet('$pending', validationErrorKey, controller);
+    } else {
+      unsetAndCleanup('$pending', validationErrorKey, controller);
+    }
+    if (!isBoolean(state)) {
+      unset(ctrl.$error, validationErrorKey, controller);
+      unset(ctrl.$$success, validationErrorKey, controller);
+    } else {
+      if (state) {
+        unset(ctrl.$error, validationErrorKey, controller);
+        set(ctrl.$$success, validationErrorKey, controller);
+      } else {
+        set(ctrl.$error, validationErrorKey, controller);
+        unset(ctrl.$$success, validationErrorKey, controller);
+      }
+    }
+    if (ctrl.$pending) {
+      cachedToggleClass(PENDING_CLASS, true);
+      ctrl.$valid = ctrl.$invalid = undefined;
+      toggleValidationCss('', null);
+    } else {
+      cachedToggleClass(PENDING_CLASS, false);
+      ctrl.$valid = isObjectEmpty(ctrl.$error);
+      ctrl.$invalid = !ctrl.$valid;
+      toggleValidationCss('', ctrl.$valid);
+    }
+
+    // re-read the state as the set/unset methods could have
+    // combined state in ctrl.$error[validationError] (used for forms),
+    // where setting/unsetting only increments/decrements the value,
+    // and does not replace it.
+    var combinedState;
+    if (ctrl.$pending && ctrl.$pending[validationErrorKey]) {
+      combinedState = undefined;
+    } else if (ctrl.$error[validationErrorKey]) {
+      combinedState = false;
+    } else if (ctrl.$$success[validationErrorKey]) {
+      combinedState = true;
+    } else {
+      combinedState = null;
+    }
+
+    toggleValidationCss(validationErrorKey, combinedState);
+    ctrl.$$parentForm.$setValidity(validationErrorKey, combinedState, ctrl);
+  }
+
+  function createAndSet(name, value, controller) {
+    if (!ctrl[name]) {
+      ctrl[name] = {};
+    }
+    set(ctrl[name], value, controller);
+  }
+
+  function unsetAndCleanup(name, value, controller) {
+    if (ctrl[name]) {
+      unset(ctrl[name], value, controller);
+    }
+    if (isObjectEmpty(ctrl[name])) {
+      ctrl[name] = undefined;
+    }
+  }
+
+  function cachedToggleClass(className, switchValue) {
+    if (switchValue && !classCache[className]) {
+      $animate.addClass($element, className);
+      classCache[className] = true;
+    } else if (!switchValue && classCache[className]) {
+      $animate.removeClass($element, className);
+      classCache[className] = false;
+    }
+  }
+
+  function toggleValidationCss(validationErrorKey, isValid) {
+    validationErrorKey = validationErrorKey ? '-' + snake_case(validationErrorKey, '-') : '';
+
+    cachedToggleClass(VALID_CLASS + validationErrorKey, isValid === true);
+    cachedToggleClass(INVALID_CLASS + validationErrorKey, isValid === false);
+  }
+}
+
+function isObjectEmpty(obj) {
+  if (obj) {
+    for (var prop in obj) {
+      if (obj.hasOwnProperty(prop)) {
+        return false;
+      }
+    }
+  }
+  return true;
+}
+
+/**
+ * @ngdoc directive
+ * @name ngNonBindable
+ * @restrict AC
+ * @priority 1000
+ *
+ * @description
+ * The `ngNonBindable` directive tells Angular not to compile or bind the contents of the current
+ * DOM element. This is useful if the element contains what appears to be Angular directives and
+ * bindings but which should be ignored by Angular. This could be the case if you have a site that
+ * displays snippets of code, for instance.
+ *
+ * @element ANY
+ *
+ * @example
+ * In this example there are two locations where a simple interpolation binding (`{{}}`) is present,
+ * but the one wrapped in `ngNonBindable` is left alone.
+ *
+ * @example
+    <example>
+      <file name="index.html">
+        <div>Normal: {{1 + 2}}</div>
+        <div ng-non-bindable>Ignored: {{1 + 2}}</div>
+      </file>
+      <file name="protractor.js" type="protractor">
+       it('should check ng-non-bindable', function() {
+         expect(element(by.binding('1 + 2')).getText()).toContain('3');
+         expect(element.all(by.css('div')).last().getText()).toMatch(/1 \+ 2/);
+       });
+      </file>
+    </example>
+ */
+var ngNonBindableDirective = ngDirective({ terminal: true, priority: 1000 });
+
+/* global jqLiteRemove */
+
+var ngOptionsMinErr = minErr('ngOptions');
+
+/**
+ * @ngdoc directive
+ * @name ngOptions
+ * @restrict A
+ *
+ * @description
+ *
+ * The `ngOptions` attribute can be used to dynamically generate a list of `<option>`
+ * elements for the `<select>` element using the array or object obtained by evaluating the
+ * `ngOptions` comprehension expression.
+ *
+ * In many cases, `ngRepeat` can be used on `<option>` elements instead of `ngOptions` to achieve a
+ * similar result. However, `ngOptions` provides some benefits such as reducing memory and
+ * increasing speed by not creating a new scope for each repeated instance, as well as providing
+ * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
+ * comprehension expression. `ngOptions` should be used when the `<select>` model needs to be bound
+ *  to a non-string value. This is because an option element can only be bound to string values at
+ * present.
+ *
+ * When an item in the `<select>` menu is selected, the array element or object property
+ * represented by the selected option will be bound to the model identified by the `ngModel`
+ * directive.
+ *
+ * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
+ * be nested into the `<select>` element. This element will then represent the `null` or "not selected"
+ * option. See example below for demonstration.
+ *
+ * ## Complex Models (objects or collections)
+ *
+ * **Note:** By default, `ngModel` watches the model by reference, not value. This is important when
+ * binding any input directive to a model that is an object or a collection.
+ *
+ * Since this is a common situation for `ngOptions` the directive additionally watches the model using
+ * `$watchCollection` when the select has the `multiple` attribute or when there is a `track by` clause in
+ * the options expression. This allows ngOptions to trigger a re-rendering of the options even if the actual
+ * object/collection has not changed identity but only a property on the object or an item in the collection
+ * changes.
+ *
+ * Note that `$watchCollection` does a shallow comparison of the properties of the object (or the items in the collection
+ * if the model is an array). This means that changing a property deeper inside the object/collection that the
+ * first level will not trigger a re-rendering.
+ *
+ *
+ * ## `select` **`as`**
+ *
+ * Using `select` **`as`** will bind the result of the `select` expression to the model, but
+ * the value of the `<select>` and `<option>` html elements will be either the index (for array data sources)
+ * or property name (for object data sources) of the value within the collection. If a **`track by`** expression
+ * is used, the result of that expression will be set as the value of the `option` and `select` elements.
+ *
+ *
+ * ### `select` **`as`** and **`track by`**
+ *
+ * <div class="alert alert-warning">
+ * Do not use `select` **`as`** and **`track by`** in the same expression. They are not designed to work together.
+ * </div>
+ *
+ * Consider the following example:
+ *
+ * ```html
+ * <select ng-options="item.subItem as item.label for item in values track by item.id" ng-model="selected"></select>
+ * ```
+ *
+ * ```js
+ * $scope.values = [{
+ *   id: 1,
+ *   label: 'aLabel',
+ *   subItem: { name: 'aSubItem' }
+ * }, {
+ *   id: 2,
+ *   label: 'bLabel',
+ *   subItem: { name: 'bSubItem' }
+ * }];
+ *
+ * $scope.selected = { name: 'aSubItem' };
+ * ```
+ *
+ * With the purpose of preserving the selection, the **`track by`** expression is always applied to the element
+ * of the data source (to `item` in this example). To calculate whether an element is selected, we do the
+ * following:
+ *
+ * 1. Apply **`track by`** to the elements in the array. In the example: `[1, 2]`
+ * 2. Apply **`track by`** to the already selected value in `ngModel`.
+ *    In the example: this is not possible as **`track by`** refers to `item.id`, but the selected
+ *    value from `ngModel` is `{name: 'aSubItem'}`, so the **`track by`** expression is applied to
+ *    a wrong object, the selected element can't be found, `<select>` is always reset to the "not
+ *    selected" option.
+ *
+ *
+ * @param {string} ngModel Assignable angular expression to data-bind to.
+ * @param {string=} name Property name of the form under which the control is published.
+ * @param {string=} required The control is considered valid only if value is entered.
+ * @param {string=} ngRequired Adds `required` attribute and `required` validation constraint to
+ *    the element when the ngRequired expression evaluates to true. Use `ngRequired` instead of
+ *    `required` when you want to data-bind to the `required` attribute.
+ * @param {comprehension_expression=} ngOptions in one of the following forms:
+ *
+ *   * for array data sources:
+ *     * `label` **`for`** `value` **`in`** `array`
+ *     * `select` **`as`** `label` **`for`** `value` **`in`** `array`
+ *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array`
+ *     * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array`
+ *     * `label` **`group by`** `group` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
+ *     * `label` **`disable when`** `disable` **`for`** `value` **`in`** `array` **`track by`** `trackexpr`
+ *     * `label` **`for`** `value` **`in`** `array` | orderBy:`orderexpr` **`track by`** `trackexpr`
+ *        (for including a filter with `track by`)
+ *   * for object data sources:
+ *     * `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
+ *     * `select` **`as`** `label` **`for (`**`key` **`,`** `value`**`) in`** `object`
+ *     * `label` **`group by`** `group` **`for (`**`key`**`,`** `value`**`) in`** `object`
+ *     * `label` **`disable when`** `disable` **`for (`**`key`**`,`** `value`**`) in`** `object`
+ *     * `select` **`as`** `label` **`group by`** `group`
+ *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`
+ *     * `select` **`as`** `label` **`disable when`** `disable`
+ *         **`for` `(`**`key`**`,`** `value`**`) in`** `object`
+ *
+ * Where:
+ *
+ *   * `array` / `object`: an expression which evaluates to an array / object to iterate over.
+ *   * `value`: local variable which will refer to each item in the `array` or each property value
+ *      of `object` during iteration.
+ *   * `key`: local variable which will refer to a property name in `object` during iteration.
+ *   * `label`: The result of this expression will be the label for `<option>` element. The
+ *     `expression` will most likely refer to the `value` variable (e.g. `value.propertyName`).
+ *   * `select`: The result of this expression will be bound to the model of the parent `<select>`
+ *      element. If not specified, `select` expression will default to `value`.
+ *   * `group`: The result of this expression will be used to group options using the `<optgroup>`
+ *      DOM element.
+ *   * `disable`: The result of this expression will be used to disable the rendered `<option>`
+ *      element. Return `true` to disable.
+ *   * `trackexpr`: Used when working with an array of objects. The result of this expression will be
+ *      used to identify the objects in the array. The `trackexpr` will most likely refer to the
+ *     `value` variable (e.g. `value.propertyName`). With this the selection is preserved
+ *      even when the options are recreated (e.g. reloaded from the server).
+ *
+ * @example
+    <example module="selectExample">
+      <file name="index.html">
+        <script>
+        angular.module('selectExample', [])
+          .controller('ExampleController', ['$scope', function($scope) {
+            $scope.colors = [
+              {name:'black', shade:'dark'},
+              {name:'white', shade:'light', notAnOption: true},
+              {name:'red', shade:'dark'},
+              {name:'blue', shade:'dark', notAnOption: true},
+              {name:'yellow', shade:'light', notAnOption: false}
+            ];
+            $scope.myColor = $scope.colors[2]; // red
+          }]);
+        </script>
+        <div ng-controller="ExampleController">
+          <ul>
+            <li ng-repeat="color in colors">
+              <label>Name: <input ng-model="color.name"></label>
+              <label><input type="checkbox" ng-model="color.notAnOption"> Disabled?</label>
+              <button ng-click="colors.splice($index, 1)" aria-label="Remove">X</button>
+            </li>
+            <li>
+              <button ng-click="colors.push({})">add</button>
+            </li>
+          </ul>
+          <hr/>
+          <label>Color (null not allowed):
+            <select ng-model="myColor" ng-options="color.name for color in colors"></select>
+          </label><br/>
+          <label>Color (null allowed):
+          <span  class="nullable">
+            <select ng-model="myColor" ng-options="color.name for color in colors">
+              <option value="">-- choose color --</option>
+            </select>
+          </span></label><br/>
+
+          <label>Color grouped by shade:
+            <select ng-model="myColor" ng-options="color.name group by color.shade for color in colors">
+            </select>
+          </label><br/>
+
+          <label>Color grouped by shade, with some disabled:
+            <select ng-model="myColor"
+                  ng-options="color.name group by color.shade disable when color.notAnOption for color in colors">
+            </select>
+          </label><br/>
+
+
+
+          Select <button ng-click="myColor = { name:'not in list', shade: 'other' }">bogus</button>.
+          <br/>
+          <hr/>
+          Currently selected: {{ {selected_color:myColor} }}
+          <div style="border:solid 1px black; height:20px"
+               ng-style="{'background-color':myColor.name}">
+          </div>
+        </div>
+      </file>
+      <file name="protractor.js" type="protractor">
+         it('should check ng-options', function() {
+           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('red');
+           element.all(by.model('myColor')).first().click();
+           element.all(by.css('select[ng-model="myColor"] option')).first().click();
+           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('black');
+           element(by.css('.nullable select[ng-model="myColor"]')).click();
+           element.all(by.css('.nullable select[ng-model="myColor"] option')).first().click();
+           expect(element(by.binding('{selected_color:myColor}')).getText()).toMatch('null');
+         });
+      </file>
+    </example>
+ */
+
+// jshint maxlen: false
+//                     //00001111111111000000000002222222222000000000000000000000333333333300000000000000000000000004444444444400000000000005555555555555550000000006666666666666660000000777777777777777000000000000000888888888800000000000000000009999999999
+var NG_OPTIONS_REGEXP = /^\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]+?))?$/;
+                        // 1: value expression (valueFn)
+                        // 2: label expression (displayFn)
+                        // 3: group by expression (groupByFn)
+                        // 4: disable when expression (disableWhenFn)
+                        // 5: array item variable name
+                        // 6: object item key variable name
+                        // 7: object item value variable name
+                        // 8: collection expression
+                        // 9: track by expression
+// jshint maxlen: 100
+
+
+var ngOptionsDirective = ['$compile', '$parse', function($compile, $parse) {
+
+  function parseOptionsExpression(optionsExp, selectElement, scope) {
+
+    var match = optionsExp.match(NG_OPTIONS_REGEXP);
+    if (!(match)) {
+      throw ngOptionsMinErr('iexp',
+        "Expected expression in form of " +
+        "'_select_ (as _label_)? for (_key_,)?_value_ in _collection_'" +
+        " but got '{0}'. Element: {1}",
+        optionsExp, startingTag(selectElement));
+    }
+
+    // Extract the parts from the ngOptions expression
+
+    // The variable name for the value of the item in the collection
+    var valueName = match[5] || match[7];
+    // The variable name for the key of the item in the collection
+    var keyName = match[6];
+
+    // An expression that generates the viewValue for an option if there is a label expression
+    var selectAs = / as /.test(match[0]) && match[1];
+    // An expression that is used to track the id of each object in the options collection
+    var trackBy = match[9];
+    // An expression that generates the viewValue for an option if there is no label expression
+    var valueFn = $parse(match[2] ? match[1] : valueName);
+    var selectAsFn = selectAs && $parse(selectAs);
+    var viewValueFn = selectAsFn || valueFn;
+    var trackByFn = trackBy && $parse(trackBy);
+
+    // Get the value by which we are going to track the option
+    // if we have a trackFn then use that (passing scope and locals)
+    // otherwise just hash the given viewValue
+    var getTrackByValueFn = trackBy ?
+                              function(value, locals) { return trackByFn(scope, locals); } :
+                              function getHashOfValue(value) { return hashKey(value); };
+    var getTrackByValue = function(value, key) {
+      return getTrackByValueFn(value, getLocals(value, key));
+    };
+
+    var displayFn = $parse(match[2] || match[1]);
+    var groupByFn = $parse(match[3] || '');
+    var disableWhenFn = $parse(match[4] || '');
+    var valuesFn = $parse(match[8]);
+
+    var locals = {};
+    var getLocals = keyName ? function(value, key) {
+      locals[keyName] = key;
+      locals[valueName] = value;
+      return locals;
+    } : function(value) {
+      locals[valueName] = value;
+      return locals;
+    };
+
+
+    function Option(selectValue, viewValue, label, group, disabled) {
+      this.selectValue = selectValue;
+      this.viewValue = viewValue;
+      this.label = label;
+      this.group = group;
+      this.disabled = disabled;
+    }
+
+    function getOptionValuesKeys(optionValues) {
+      var optionValuesKeys;
+
+      if (!keyName && isArrayLike(optionValues)) {
+        optionValuesKeys = optionValues;
+      } else {
+        // if object, extract keys, in enumeration order, unsorted
+        optionValuesKeys = [];
+        for (var itemKey in optionValues) {
+          if (optionValues.hasOwnProperty(itemKey) && itemKey.charAt(0) !== '$') {
+            optionValuesKeys.push(itemKey);
+          }
+        }
+      }
+      return optionValuesKeys;
+    }
+
+    return {
+      trackBy: trackBy,
+      getTrackByValue: getTrackByValue,
+      getWatchables: $parse(valuesFn, function(optionValues) {
+        // Create a collection of things that we would like to watch (watchedArray)
+        // so that they can all be watched using a single $watchCollection
+        // that only runs the handler once if anything changes
+        var watchedArray = [];
+        optionValues = optionValues || [];
+
+        var optionValuesKeys = getOptionValuesKeys(optionValues);
+        var optionValuesLength = optionValuesKeys.length;
+        for (var index = 0; index < optionValuesLength; index++) {
+          var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
+          var value = optionValues[key];
+
+          var locals = getLocals(optionValues[key], key);
+          var selectValue = getTrackByValueFn(optionValues[key], locals);
+          watchedArray.push(selectValue);
+
+          // Only need to watch the displayFn if there is a specific label expression
+          if (match[2] || match[1]) {
+            var label = displayFn(scope, locals);
+            watchedArray.push(label);
+          }
+
+          // Only need to watch the disableWhenFn if there is a specific disable expression
+          if (match[4]) {
+            var disableWhen = disableWhenFn(scope, locals);
+            watchedArray.push(disableWhen);
+          }
+        }
+        return watchedArray;
+      }),
+
+      getOptions: function() {
+
+        var optionItems = [];
+        var selectValueMap = {};
+
+        // The option values were already computed in the `getWatchables` fn,
+        // which must have been called to trigger `getOptions`
+        var optionValues = valuesFn(scope) || [];
+        var optionValuesKeys = getOptionValuesKeys(optionValues);
+        var optionValuesLength = optionValuesKeys.length;
+
+        for (var index = 0; index < optionValuesLength; index++) {
+          var key = (optionValues === optionValuesKeys) ? index : optionValuesKeys[index];
+          var value = optionValues[key];
+          var locals = getLocals(value, key);
+          var viewValue = viewValueFn(scope, locals);
+          var selectValue = getTrackByValueFn(viewValue, locals);
+          var label = displayFn(scope, locals);
+          var group = groupByFn(scope, locals);
+          var disabled = disableWhenFn(scope, locals);
+          var optionItem = new Option(selectValue, viewValue, label, group, disabled);
+
+          optionItems.push(optionItem);
+          selectValueMap[selectValue] = optionItem;
+        }
+
+        return {
+          items: optionItems,
+          selectValueMap: selectValueMap,
+          getOptionFromViewValue: function(value) {
+            return selectValueMap[getTrackByValue(value)];
+          },
+          getViewValueFromOption: function(option) {
+            // If the viewValue could be an object that may be mutated by the application,
+            // we need to make a copy and not return the reference to the value on the option.
+            return trackBy ? angular.copy(option.viewValue) : option.viewValue;
+          }
+        };
+      }
+    };
+  }
+
+
+  // we can't just jqLite('<option>') since jqLite is not smart enough
+  // to create it in <select> and IE barfs otherwise.
+  var optionTemplate = document.createElement('option'),
+      optGroupTemplate = document.createElement('optgroup');
+
+  return {
+    restrict: 'A',
+    terminal: true,
+    require: ['select', '?ngModel'],
+    link: function(scope, selectElement, attr, ctrls) {
+
+      // if ngModel is not defined, we don't need to do anything
+      var ngModelCtrl = ctrls[1];
+      if (!ngModelCtrl) return;
+
+      var selectCtrl = ctrls[0];
+      var multiple = attr.multiple;
+
+      // The emptyOption allows the application developer to provide their own custom "empty"
+      // option when the viewValue does not match any of the option values.
+      var emptyOption;
+      for (var i = 0, children = selectElement.children(), ii = children.length; i < ii; i++) {
+        if (children[i].value === '') {
+          emptyOption = children.eq(i);
+          break;
+        }
+      }
+
+      var providedEmptyOption = !!emptyOption;
+
+      var unknownOption = jqLite(optionTemplate.cloneNode(false));
+      unknownOption.val('?');
+
+      var options;
+      var ngOptions = parseOptionsExpression(attr.ngOptions, selectElement, scope);
+
+
+      var renderEmptyOption = function() {
+        if (!providedEmptyOption) {
+          selectElement.prepend(emptyOption);
+        }
+        selectElement.val('');
+        emptyOption.prop('selected', true); // needed for IE
+        emptyOption.attr('selected', true);
+      };
+
+      var removeEmptyOption = function() {
+        if (!providedEmptyOption) {
+          emptyOption.remove();
+        }
+      };
+
+
+      var renderUnknownOption = function() {
+        selectElement.prepend(unknownOption);
+        selectElement.val('?');
+        unknownOption.prop('selected', true); // needed for IE
+        unknownOption.attr('selected', true);
+      };
+
+      var removeUnknownOption = function() {
+        unknownOption.remove();
+      };
+
+
+      // Update the controller methods for multiple selectable options
+      if (!multiple) {
+
+        selectCtrl.writeValue = function writeNgOptionsValue(value) {
+          var option = options.getOptionFromViewValue(value);
+
+          if (option && !option.disabled) {
+            if (selectElement[0].value !== option.selectValue) {
+              removeUnknownOption();
+              removeEmptyOption();
+
+              selectElement[0].value = option.selectValue;
+              option.element.selected = true;
+              option.element.setAttribute('selected', 'selected');
+            }
+          } else {
+            if (value === null || providedEmptyOption) {
+              removeUnknownOption();
+              renderEmptyOption();
+            } else {
+              removeEmptyOption();
+              renderUnknownOption();
+            }
+          }
+        };
+
+        selectCtrl.readValue = function readNgOptionsValue() {
+
+          var selectedOption = options.selectValueMap[selectElement.val()];
+
+          if (selectedOption && !selectedOption.disabled) {
+            removeEmptyOption();
+            removeUnknownOption();
+            return options.getViewValueFromOption(selectedOption);
+          }
+          return null;
+        };
+
+        // If we are using `track by` then we must watch the tracked value on the model
+        // since ngModel only watches for object identity change
+        if (ngOptions.trackBy) {
+          scope.$watch(
+            function() { return ngOptions.getTrackByValue(ngModelCtrl.$viewValue); },
+            function() { ngModelCtrl.$render(); }
+          );
+        }
+
+      } else {
+
+        ngModelCtrl.$isEmpty = function(value) {
+          return !value || value.length === 0;
+        };
+
+
+        selectCtrl.writeValue = function writeNgOptionsMultiple(value) {
+          options.items.forEach(function(option) {
+            option.element.selected = false;
+          });
+
+          if (value) {
+            value.forEach(function(item) {
+              var option = options.getOptionFromViewValue(item);
+              if (option && !option.disabled) option.element.selected = true;
+            });
+          }
+        };
+
+
+        selectCtrl.readValue = function readNgOptionsMultiple() {
+          var selectedValues = selectElement.val() || [],
+              selections = [];
+
+          forEach(selectedValues, function(value) {
+            var option = options.selectValueMap[value];
+            if (option && !option.disabled) selections.push(options.getViewValueFromOption(option));
+          });
+
+          return selections;
+        };
+
+        // If we are using `track by` then we must watch these tracked values on the model
+        // since ngModel only watches for object identity change
+        if (ngOptions.trackBy) {
+
+          scope.$watchCollection(function() {
+            if (isArray(ngModelCtrl.$viewValue)) {
+              return ngModelCtrl.$viewValue.map(function(value) {
+                return ngOptions.getTrackByValue(value);
+              });
+            }
+          }, function() {
+            ngModelCtrl.$render();
+          });
+
+        }
+      }
+
+
+      if (providedEmptyOption) {
+
+        // we need to remove it before calling selectElement.empty() because otherwise IE will
+        // remove the label from the element. wtf?
+        emptyOption.remove();
+
+        // compile the element since there might be bindings in it
+        $compile(emptyOption)(scope);
+
+        // remove the class, which is added automatically because we recompile the element and it
+        // becomes the compilation root
+        emptyOption.removeClass('ng-scope');
+      } else {
+        emptyOption = jqLite(optionTemplate.cloneNode(false));
+      }
+
+      // We need to do this here to ensure that the options object is defined
+      // when we first hit it in writeNgOptionsValue
+      updateOptions();
+
+      // We will re-render the option elements if the option values or labels change
+      scope.$watchCollection(ngOptions.getWatchables, updateOptions);
+
+      // ------------------------------------------------------------------ //
+
+
+      function updateOptionElement(option, element) {
+        option.element = element;
+        element.disabled = option.disabled;
+        // NOTE: The label must be set before the value, otherwise IE10/11/EDGE create unresponsive
+        // selects in certain circumstances when multiple selects are next to each other and display
+        // the option list in listbox style, i.e. the select is [multiple], or specifies a [size].
+        // See https://github.com/angular/angular.js/issues/11314 for more info.
+        // This is unfortunately untestable with unit / e2e tests
+        if (option.label !== element.label) {
+          element.label = option.label;
+          element.textContent = option.label;
+        }
+        if (option.value !== element.value) element.value = option.selectValue;
+      }
+
+      function addOrReuseElement(parent, current, type, templateElement) {
+        var element;
+        // Check whether we can reuse the next element
+        if (current && lowercase(current.nodeName) === type) {
+          // The next element is the right type so reuse it
+          element = current;
+        } else {
+          // The next element is not the right type so create a new one
+          element = templateElement.cloneNode(false);
+          if (!current) {
+            // There are no more elements so just append it to the select
+            parent.appendChild(element);
+          } else {
+            // The next element is not a group so insert the new one
+            parent.insertBefore(element, current);
+          }
+        }
+        return element;
+      }
+
+
+      function removeExcessElements(current) {
+        var next;
+        while (current) {
+          next = current.nextSibling;
+          jqLiteRemove(current);
+          current = next;
+        }
+      }
+
+
+      function skipEmptyAndUnknownOptions(current) {
+        var emptyOption_ = emptyOption && emptyOption[0];
+        var unknownOption_ = unknownOption && unknownOption[0];
+
+        if (emptyOption_ || unknownOption_) {
+          while (current &&
+                (current === emptyOption_ ||
+                current === unknownOption_ ||
+                emptyOption_ && emptyOption_.nodeType === NODE_TYPE_COMMENT)) {
+            // Empty options might have directives that transclude
+            // and insert comments (e.g. ngIf)
+            current = current.nextSibling;
+          }
+        }
+        return current;
+      }
+
+
+      function updateOptions() {
+
+        var previousValue = options && selectCtrl.readValue();
+
+        options = ngOptions.getOptions();
+
+        var groupMap = {};
+        var currentElement = selectElement[0].firstChild;
+
+        // Ensure that the empty option is always there if it was explicitly provided
+        if (providedEmptyOption) {
+          selectElement.prepend(emptyOption);
+        }
+
+        currentElement = skipEmptyAndUnknownOptions(currentElement);
+
+        options.items.forEach(function updateOption(option) {
+          var group;
+          var groupElement;
+          var optionElement;
+
+          if (option.group) {
+
+            // This option is to live in a group
+            // See if we have already created this group
+            group = groupMap[option.group];
+
+            if (!group) {
+
+              // We have not already created this group
+              groupElement = addOrReuseElement(selectElement[0],
+                                               currentElement,
+                                               'optgroup',
+                                               optGroupTemplate);
+              // Move to the next element
+              currentElement = groupElement.nextSibling;
+
+              // Update the label on the group element
+              groupElement.label = option.group;
+
+              // Store it for use later
+              group = groupMap[option.group] = {
+                groupElement: groupElement,
+                currentOptionElement: groupElement.firstChild
+              };
+
+            }
+
+            // So now we have a group for this option we add the option to the group
+            optionElement = addOrReuseElement(group.groupElement,
+                                              group.currentOptionElement,
+                                              'option',
+                                              optionTemplate);
+            updateOptionElement(option, optionElement);
+            // Move to the next element
+            group.currentOptionElement = optionElement.nextSibling;
+
+          } else {
+
+            // This option is not in a group
+            optionElement = addOrReuseElement(selectElement[0],
+                                              currentElement,
+                                              'option',
+                                              optionTemplate);
+            updateOptionElement(option, optionElement);
+            // Move to the next element
+            currentElement = optionElement.nextSibling;
+          }
+        });
+
+
+        // Now remove all excess options and group
+        Object.keys(groupMap).forEach(function(key) {
+          removeExcessElements(groupMap[key].currentOptionElement);
+        });
+        removeExcessElements(currentElement);
+
+        ngModelCtrl.$render();
+
+        // Check to see if the value has changed due to the update to the options
+        if (!ngModelCtrl.$isEmpty(previousValue)) {
+          var nextValue = selectCtrl.readValue();
+          if (ngOptions.trackBy ? !equals(previousValue, nextValue) : previousValue !== nextValue) {
+            ngModelCtrl.$setViewValue(nextValue);
+            ngModelCtrl.$render();
+          }
+        }
+
+      }
+
+    }
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngPluralize
+ * @restrict EA
+ *
+ * @description
+ * `ngPluralize` is a directive that displays messages according to en-US localization rules.
+ * These rules are bundled with angular.js, but can be overridden
+ * (see {@link guide/i18n Angular i18n} dev guide). You configure ngPluralize directive
+ * by specifying the mappings between
+ * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
+ * and the strings to be displayed.
+ *
+ * # Plural categories and explicit number rules
+ * There are two
+ * [plural categories](http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html)
+ * in Angular's default en-US locale: "one" and "other".
+ *
+ * While a plural category may match many numbers (for example, in en-US locale, "other" can match
+ * any number that is not 1), an explicit number rule can only match one number. For example, the
+ * explicit number rule for "3" matches the number 3. There are examples of plural categories
+ * and explicit number rules throughout the rest of this documentation.
+ *
+ * # Configuring ngPluralize
+ * You configure ngPluralize by providing 2 attributes: `count` and `when`.
+ * You can also provide an optional attribute, `offset`.
+ *
+ * The value of the `count` attribute can be either a string or an {@link guide/expression
+ * Angular expression}; these are evaluated on the current scope for its bound value.
+ *
+ * The `when` attribute specifies the mappings between plural categories and the actual
+ * string to be displayed. The value of the attribute should be a JSON object.
+ *
+ * The following example shows how to configure ngPluralize:
+ *
+ * ```html
+ * <ng-pluralize count="personCount"
+                 when="{'0': 'Nobody is viewing.',
+ *                      'one': '1 person is viewing.',
+ *                      'other': '{} people are viewing.'}">
+ * </ng-pluralize>
+ *```
+ *
+ * In the example, `"0: Nobody is viewing."` is an explicit number rule. If you did not
+ * specify this rule, 0 would be matched to the "other" category and "0 people are viewing"
+ * would be shown instead of "Nobody is viewing". You can specify an explicit number rule for
+ * other numbers, for example 12, so that instead of showing "12 people are viewing", you can
+ * show "a dozen people are viewing".
+ *
+ * You can use a set of closed braces (`{}`) as a placeholder for the number that you want substituted
+ * into pluralized strings. In the previous example, Angular will replace `{}` with
+ * <span ng-non-bindable>`{{personCount}}`</span>. The closed braces `{}` is a placeholder
+ * for <span ng-non-bindable>{{numberExpression}}</span>.
+ *
+ * If no rule is defined for a category, then an empty string is displayed and a warning is generated.
+ * Note that some locales define more categories than `one` and `other`. For example, fr-fr defines `few` and `many`.
+ *
+ * # Configuring ngPluralize with offset
+ * The `offset` attribute allows further customization of pluralized text, which can result in
+ * a better user experience. For example, instead of the message "4 people are viewing this document",
+ * you might display "John, Kate and 2 others are viewing this document".
+ * The offset attribute allows you to offset a number by any desired value.
+ * Let's take a look at an example:
+ *
+ * ```html
+ * <ng-pluralize count="personCount" offset=2
+ *               when="{'0': 'Nobody is viewing.',
+ *                      '1': '{{person1}} is viewing.',
+ *                      '2': '{{person1}} and {{person2}} are viewing.',
+ *                      'one': '{{person1}}, {{person2}} and one other person are viewing.',
+ *                      'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
+ * </ng-pluralize>
+ * ```
+ *
+ * Notice that we are still using two plural categories(one, other), but we added
+ * three explicit number rules 0, 1 and 2.
+ * When one person, perhaps John, views the document, "John is viewing" will be shown.
+ * When three people view the document, no explicit number rule is found, so
+ * an offset of 2 is taken off 3, and Angular uses 1 to decide the plural category.
+ * In this case, plural category 'one' is matched and "John, Mary and one other person are viewing"
+ * is shown.
+ *
+ * Note that when you specify offsets, you must provide explicit number rules for
+ * numbers from 0 up to and including the offset. If you use an offset of 3, for example,
+ * you must provide explicit number rules for 0, 1, 2 and 3. You must also provide plural strings for
+ * plural categories "one" and "other".
+ *
+ * @param {string|expression} count The variable to be bound to.
+ * @param {string} when The mapping between plural category to its corresponding strings.
+ * @param {number=} offset Offset to deduct from the total number.
+ *
+ * @example
+    <example module="pluralizeExample">
+      <file name="index.html">
+        <script>
+          angular.module('pluralizeExample', [])
+            .controller('ExampleController', ['$scope', function($scope) {
+              $scope.person1 = 'Igor';
+              $scope.person2 = 'Misko';
+              $scope.personCount = 1;
+            }]);
+        </script>
+        <div ng-controller="ExampleController">
+          <label>Person 1:<input type="text" ng-model="person1" value="Igor" /></label><br/>
+          <label>Person 2:<input type="text" ng-model="person2" value="Misko" /></label><br/>
+          <label>Number of People:<input type="text" ng-model="personCount" value="1" /></label><br/>
+
+          <!--- Example with simple pluralization rules for en locale --->
+          Without Offset:
+          <ng-pluralize count="personCount"
+                        when="{'0': 'Nobody is viewing.',
+                               'one': '1 person is viewing.',
+                               'other': '{} people are viewing.'}">
+          </ng-pluralize><br>
+
+          <!--- Example with offset --->
+          With Offset(2):
+          <ng-pluralize count="personCount" offset=2
+                        when="{'0': 'Nobody is viewing.',
+                               '1': '{{person1}} is viewing.',
+                               '2': '{{person1}} and {{person2}} are viewing.',
+                               'one': '{{person1}}, {{person2}} and one other person are viewing.',
+                               'other': '{{person1}}, {{person2}} and {} other people are viewing.'}">
+          </ng-pluralize>
+        </div>
+      </file>
+      <file name="protractor.js" type="protractor">
+        it('should show correct pluralized string', function() {
+          var withoutOffset = element.all(by.css('ng-pluralize')).get(0);
+          var withOffset = element.all(by.css('ng-pluralize')).get(1);
+          var countInput = element(by.model('personCount'));
+
+          expect(withoutOffset.getText()).toEqual('1 person is viewing.');
+          expect(withOffset.getText()).toEqual('Igor is viewing.');
+
+          countInput.clear();
+          countInput.sendKeys('0');
+
+          expect(withoutOffset.getText()).toEqual('Nobody is viewing.');
+          expect(withOffset.getText()).toEqual('Nobody is viewing.');
+
+          countInput.clear();
+          countInput.sendKeys('2');
+
+          expect(withoutOffset.getText()).toEqual('2 people are viewing.');
+          expect(withOffset.getText()).toEqual('Igor and Misko are viewing.');
+
+          countInput.clear();
+          countInput.sendKeys('3');
+
+          expect(withoutOffset.getText()).toEqual('3 people are viewing.');
+          expect(withOffset.getText()).toEqual('Igor, Misko and one other person are viewing.');
+
+          countInput.clear();
+          countInput.sendKeys('4');
+
+          expect(withoutOffset.getText()).toEqual('4 people are viewing.');
+          expect(withOffset.getText()).toEqual('Igor, Misko and 2 other people are viewing.');
+        });
+        it('should show data-bound names', function() {
+          var withOffset = element.all(by.css('ng-pluralize')).get(1);
+          var personCount = element(by.model('personCount'));
+          var person1 = element(by.model('person1'));
+          var person2 = element(by.model('person2'));
+          personCount.clear();
+          personCount.sendKeys('4');
+          person1.clear();
+          person1.sendKeys('Di');
+          person2.clear();
+          person2.sendKeys('Vojta');
+          expect(withOffset.getText()).toEqual('Di, Vojta and 2 other people are viewing.');
+        });
+      </file>
+    </example>
+ */
+var ngPluralizeDirective = ['$locale', '$interpolate', '$log', function($locale, $interpolate, $log) {
+  var BRACE = /{}/g,
+      IS_WHEN = /^when(Minus)?(.+)$/;
+
+  return {
+    link: function(scope, element, attr) {
+      var numberExp = attr.count,
+          whenExp = attr.$attr.when && element.attr(attr.$attr.when), // we have {{}} in attrs
+          offset = attr.offset || 0,
+          whens = scope.$eval(whenExp) || {},
+          whensExpFns = {},
+          startSymbol = $interpolate.startSymbol(),
+          endSymbol = $interpolate.endSymbol(),
+          braceReplacement = startSymbol + numberExp + '-' + offset + endSymbol,
+          watchRemover = angular.noop,
+          lastCount;
+
+      forEach(attr, function(expression, attributeName) {
+        var tmpMatch = IS_WHEN.exec(attributeName);
+        if (tmpMatch) {
+          var whenKey = (tmpMatch[1] ? '-' : '') + lowercase(tmpMatch[2]);
+          whens[whenKey] = element.attr(attr.$attr[attributeName]);
+        }
+      });
+      forEach(whens, function(expression, key) {
+        whensExpFns[key] = $interpolate(expression.replace(BRACE, braceReplacement));
+
+      });
+
+      scope.$watch(numberExp, function ngPluralizeWatchAction(newVal) {
+        var count = parseFloat(newVal);
+        var countIsNaN = isNaN(count);
+
+        if (!countIsNaN && !(count in whens)) {
+          // If an explicit number rule such as 1, 2, 3... is defined, just use it.
+          // Otherwise, check it against pluralization rules in $locale service.
+          count = $locale.pluralCat(count - offset);
+        }
+
+        // If both `count` and `lastCount` are NaN, we don't need to re-register a watch.
+        // In JS `NaN !== NaN`, so we have to exlicitly check.
+        if ((count !== lastCount) && !(countIsNaN && isNumber(lastCount) && isNaN(lastCount))) {
+          watchRemover();
+          var whenExpFn = whensExpFns[count];
+          if (isUndefined(whenExpFn)) {
+            if (newVal != null) {
+              $log.debug("ngPluralize: no rule defined for '" + count + "' in " + whenExp);
+            }
+            watchRemover = noop;
+            updateElementText();
+          } else {
+            watchRemover = scope.$watch(whenExpFn, updateElementText);
+          }
+          lastCount = count;
+        }
+      });
+
+      function updateElementText(newText) {
+        element.text(newText || '');
+      }
+    }
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngRepeat
+ * @multiElement
+ *
+ * @description
+ * The `ngRepeat` directive instantiates a template once per item from a collection. Each template
+ * instance gets its own scope, where the given loop variable is set to the current collection item,
+ * and `$index` is set to the item index or key.
+ *
+ * Special properties are exposed on the local scope of each template instance, including:
+ *
+ * | Variable  | Type            | Details                                                                     |
+ * |-----------|-----------------|-----------------------------------------------------------------------------|
+ * | `$index`  | {@type number}  | iterator offset of the repeated element (0..length-1)                       |
+ * | `$first`  | {@type boolean} | true if the repeated element is first in the iterator.                      |
+ * | `$middle` | {@type boolean} | true if the repeated element is between the first and last in the iterator. |
+ * | `$last`   | {@type boolean} | true if the repeated element is last in the iterator.                       |
+ * | `$even`   | {@type boolean} | true if the iterator position `$index` is even (otherwise false).           |
+ * | `$odd`    | {@type boolean} | true if the iterator position `$index` is odd (otherwise false).            |
+ *
+ * <div class="alert alert-info">
+ *   Creating aliases for these properties is possible with {@link ng.directive:ngInit `ngInit`}.
+ *   This may be useful when, for instance, nesting ngRepeats.
+ * </div>
+ *
+ *
+ * # Iterating over object properties
+ *
+ * It is possible to get `ngRepeat` to iterate over the properties of an object using the following
+ * syntax:
+ *
+ * ```js
+ * <div ng-repeat="(key, value) in myObj"> ... </div>
+ * ```
+ *
+ * You need to be aware that the JavaScript specification does not define the order of keys
+ * returned for an object. (To mitigate this in Angular 1.3 the `ngRepeat` directive
+ * used to sort the keys alphabetically.)
+ *
+ * Version 1.4 removed the alphabetic sorting. We now rely on the order returned by the browser
+ * when running `for key in myObj`. It seems that browsers generally follow the strategy of providing
+ * keys in the order in which they were defined, although there are exceptions when keys are deleted
+ * and reinstated. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/delete#Cross-browser_issues
+ *
+ * If this is not desired, the recommended workaround is to convert your object into an array
+ * that is sorted into the order that you prefer before providing it to `ngRepeat`.  You could
+ * do this with a filter such as [toArrayFilter](http://ngmodules.org/modules/angular-toArrayFilter)
+ * or implement a `$watch` on the object yourself.
+ *
+ *
+ * # Tracking and Duplicates
+ *
+ * When the contents of the collection change, `ngRepeat` makes the corresponding changes to the DOM:
+ *
+ * * When an item is added, a new instance of the template is added to the DOM.
+ * * When an item is removed, its template instance is removed from the DOM.
+ * * When items are reordered, their respective templates are reordered in the DOM.
+ *
+ * By default, `ngRepeat` does not allow duplicate items in arrays. This is because when
+ * there are duplicates, it is not possible to maintain a one-to-one mapping between collection
+ * items and DOM elements.
+ *
+ * If you do need to repeat duplicate items, you can substitute the default tracking behavior
+ * with your own using the `track by` expression.
+ *
+ * For example, you may track items by the index of each item in the collection, using the
+ * special scope property `$index`:
+ * ```html
+ *    <div ng-repeat="n in [42, 42, 43, 43] track by $index">
+ *      {{n}}
+ *    </div>
+ * ```
+ *
+ * You may use arbitrary expressions in `track by`, including references to custom functions
+ * on the scope:
+ * ```html
+ *    <div ng-repeat="n in [42, 42, 43, 43] track by myTrackingFunction(n)">
+ *      {{n}}
+ *    </div>
+ * ```
+ *
+ * If you are working with objects that have an identifier property, you can track
+ * by the identifier instead of the whole object. Should you reload your data later, `ngRepeat`
+ * will not have to rebuild the DOM elements for items it has already rendered, even if the
+ * JavaScript objects in the collection have been substituted for new ones:
+ * ```html
+ *    <div ng-repeat="model in collection track by model.id">
+ *      {{model.name}}
+ *    </div>
+ * ```
+ *
+ * When no `track by` expression is provided, it is equivalent to tracking by the built-in
+ * `$id` function, which tracks items by their identity:
+ * ```html
+ *    <div ng-repeat="obj in collection track by $id(obj)">
+ *      {{obj.prop}}
+ *    </div>
+ * ```
+ *
+ * <div class="alert alert-warning">
+ * **Note:** `track by` must always be the last expression:
+ * </div>
+ * ```
+ * <div ng-repeat="model in collection | orderBy: 'id' as filtered_result track by model.id">
+ *     {{model.name}}
+ * </div>
+ * ```
+ *
+ * # Special repeat start and end points
+ * To repeat a series of elements instead of just one parent element, ngRepeat (as well as other ng directives) supports extending
+ * the range of the repeater by defining explicit start and end points by using **ng-repeat-start** and **ng-repeat-end** respectively.
+ * The **ng-repeat-start** directive works the same as **ng-repeat**, but will repeat all the HTML code (including the tag it's defined on)
+ * up to and including the ending HTML tag where **ng-repeat-end** is placed.
+ *
+ * The example below makes use of this feature:
+ * ```html
+ *   <header ng-repeat-start="item in items">
+ *     Header {{ item }}
+ *   </header>
+ *   <div class="body">
+ *     Body {{ item }}
+ *   </div>
+ *   <footer ng-repeat-end>
+ *     Footer {{ item }}
+ *   </footer>
+ * ```
+ *
+ * And with an input of {@type ['A','B']} for the items variable in the example above, the output will evaluate to:
+ * ```html
+ *   <header>
+ *     Header A
+ *   </header>
+ *   <div class="body">
+ *     Body A
+ *   </div>
+ *   <footer>
+ *     Footer A
+ *   </footer>
+ *   <header>
+ *     Header B
+ *   </header>
+ *   <div class="body">
+ *     Body B
+ *   </div>
+ *   <footer>
+ *     Footer B
+ *   </footer>
+ * ```
+ *
+ * The custom start and end points for ngRepeat also support all other HTML directive syntax flavors provided in AngularJS (such
+ * as **data-ng-repeat-start**, **x-ng-repeat-start** and **ng:repeat-start**).
+ *
+ * @animations
+ * **.enter** - when a new item is added to the list or when an item is revealed after a filter
+ *
+ * **.leave** - when an item is removed from the list or when an item is filtered out
+ *
+ * **.move** - when an adjacent item is filtered out causing a reorder or when the item contents are reordered
+ *
+ * @element ANY
+ * @scope
+ * @priority 1000
+ * @param {repeat_expression} ngRepeat The expression indicating how to enumerate a collection. These
+ *   formats are currently supported:
+ *
+ *   * `variable in expression` – where variable is the user defined loop variable and `expression`
+ *     is a scope expression giving the collection to enumerate.
+ *
+ *     For example: `album in artist.albums`.
+ *
+ *   * `(key, value) in expression` – where `key` and `value` can be any user defined identifiers,
+ *     and `expression` is the scope expression giving the collection to enumerate.
+ *
+ *     For example: `(name, age) in {'adam':10, 'amalie':12}`.
+ *
+ *   * `variable in expression track by tracking_expression` – You can also provide an optional tracking expression
+ *     which can be used to associate the objects in the collection with the DOM elements. If no tracking expression
+ *     is specified, ng-repeat associates elements by identity. It is an error to have
+ *     more than one tracking expression value resolve to the same key. (This would mean that two distinct objects are
+ *     mapped to the same DOM element, which is not possible.)
+ *
+ *     Note that the tracking expression must come last, after any filters, and the alias expression.
+ *
+ *     For example: `item in items` is equivalent to `item in items track by $id(item)`. This implies that the DOM elements
+ *     will be associated by item identity in the array.
+ *
+ *     For example: `item in items track by $id(item)`. A built in `$id()` function can be used to assign a unique
+ *     `$$hashKey` property to each item in the array. This property is then used as a key to associated DOM elements
+ *     with the corresponding item in the array by identity. Moving the same object in array would move the DOM
+ *     element in the same way in the DOM.
+ *
+ *     For example: `item in items track by item.id` is a typical pattern when the items come from the database. In this
+ *     case the object identity does not matter. Two objects are considered equivalent as long as their `id`
+ *     property is same.
+ *
+ *     For example: `item in items | filter:searchText track by item.id` is a pattern that might be used to apply a filter
+ *     to items in conjunction with a tracking expression.
+ *
+ *   * `variable in expression as alias_expression` – You can also provide an optional alias expression which will then store the
+ *     intermediate results of the repeater after the filters have been applied. Typically this is used to render a special message
+ *     when a filter is active on the repeater, but the filtered result set is empty.
+ *
+ *     For example: `item in items | filter:x as results` will store the fragment of the repeated items as `results`, but only after
+ *     the items have been processed through the filter.
+ *
+ *     Please note that `as [variable name] is not an operator but rather a part of ngRepeat micro-syntax so it can be used only at the end
+ *     (and not as operator, inside an expression).
+ *
+ *     For example: `item in items | filter : x | orderBy : order | limitTo : limit as results` .
+ *
+ * @example
+ * This example initializes the scope to a list of names and
+ * then uses `ngRepeat` to display every person:
+  <example module="ngAnimate" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+      <div ng-init="friends = [
+        {name:'John', age:25, gender:'boy'},
+        {name:'Jessie', age:30, gender:'girl'},
+        {name:'Johanna', age:28, gender:'girl'},
+        {name:'Joy', age:15, gender:'girl'},
+        {name:'Mary', age:28, gender:'girl'},
+        {name:'Peter', age:95, gender:'boy'},
+        {name:'Sebastian', age:50, gender:'boy'},
+        {name:'Erika', age:27, gender:'girl'},
+        {name:'Patrick', age:40, gender:'boy'},
+        {name:'Samantha', age:60, gender:'girl'}
+      ]">
+        I have {{friends.length}} friends. They are:
+        <input type="search" ng-model="q" placeholder="filter friends..." aria-label="filter friends" />
+        <ul class="example-animate-container">
+          <li class="animate-repeat" ng-repeat="friend in friends | filter:q as results">
+            [{{$index + 1}}] {{friend.name}} who is {{friend.age}} years old.
+          </li>
+          <li class="animate-repeat" ng-if="results.length == 0">
+            <strong>No results found...</strong>
+          </li>
+        </ul>
+      </div>
+    </file>
+    <file name="animations.css">
+      .example-animate-container {
+        background:white;
+        border:1px solid black;
+        list-style:none;
+        margin:0;
+        padding:0 10px;
+      }
+
+      .animate-repeat {
+        line-height:40px;
+        list-style:none;
+        box-sizing:border-box;
+      }
+
+      .animate-repeat.ng-move,
+      .animate-repeat.ng-enter,
+      .animate-repeat.ng-leave {
+        transition:all linear 0.5s;
+      }
+
+      .animate-repeat.ng-leave.ng-leave-active,
+      .animate-repeat.ng-move,
+      .animate-repeat.ng-enter {
+        opacity:0;
+        max-height:0;
+      }
+
+      .animate-repeat.ng-leave,
+      .animate-repeat.ng-move.ng-move-active,
+      .animate-repeat.ng-enter.ng-enter-active {
+        opacity:1;
+        max-height:40px;
+      }
+    </file>
+    <file name="protractor.js" type="protractor">
+      var friends = element.all(by.repeater('friend in friends'));
+
+      it('should render initial data set', function() {
+        expect(friends.count()).toBe(10);
+        expect(friends.get(0).getText()).toEqual('[1] John who is 25 years old.');
+        expect(friends.get(1).getText()).toEqual('[2] Jessie who is 30 years old.');
+        expect(friends.last().getText()).toEqual('[10] Samantha who is 60 years old.');
+        expect(element(by.binding('friends.length')).getText())
+            .toMatch("I have 10 friends. They are:");
+      });
+
+       it('should update repeater when filter predicate changes', function() {
+         expect(friends.count()).toBe(10);
+
+         element(by.model('q')).sendKeys('ma');
+
+         expect(friends.count()).toBe(2);
+         expect(friends.get(0).getText()).toEqual('[1] Mary who is 28 years old.');
+         expect(friends.last().getText()).toEqual('[2] Samantha who is 60 years old.');
+       });
+      </file>
+    </example>
+ */
+var ngRepeatDirective = ['$parse', '$animate', function($parse, $animate) {
+  var NG_REMOVED = '$$NG_REMOVED';
+  var ngRepeatMinErr = minErr('ngRepeat');
+
+  var updateScope = function(scope, index, valueIdentifier, value, keyIdentifier, key, arrayLength) {
+    // TODO(perf): generate setters to shave off ~40ms or 1-1.5%
+    scope[valueIdentifier] = value;
+    if (keyIdentifier) scope[keyIdentifier] = key;
+    scope.$index = index;
+    scope.$first = (index === 0);
+    scope.$last = (index === (arrayLength - 1));
+    scope.$middle = !(scope.$first || scope.$last);
+    // jshint bitwise: false
+    scope.$odd = !(scope.$even = (index&1) === 0);
+    // jshint bitwise: true
+  };
+
+  var getBlockStart = function(block) {
+    return block.clone[0];
+  };
+
+  var getBlockEnd = function(block) {
+    return block.clone[block.clone.length - 1];
+  };
+
+
+  return {
+    restrict: 'A',
+    multiElement: true,
+    transclude: 'element',
+    priority: 1000,
+    terminal: true,
+    $$tlb: true,
+    compile: function ngRepeatCompile($element, $attr) {
+      var expression = $attr.ngRepeat;
+      var ngRepeatEndComment = document.createComment(' end ngRepeat: ' + expression + ' ');
+
+      var match = expression.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
+
+      if (!match) {
+        throw ngRepeatMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
+            expression);
+      }
+
+      var lhs = match[1];
+      var rhs = match[2];
+      var aliasAs = match[3];
+      var trackByExp = match[4];
+
+      match = lhs.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);
+
+      if (!match) {
+        throw ngRepeatMinErr('iidexp', "'_item_' in '_item_ in _collection_' should be an identifier or '(_key_, _value_)' expression, but got '{0}'.",
+            lhs);
+      }
+      var valueIdentifier = match[3] || match[1];
+      var keyIdentifier = match[2];
+
+      if (aliasAs && (!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(aliasAs) ||
+          /^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(aliasAs))) {
+        throw ngRepeatMinErr('badident', "alias '{0}' is invalid --- must be a valid JS identifier which is not a reserved name.",
+          aliasAs);
+      }
+
+      var trackByExpGetter, trackByIdExpFn, trackByIdArrayFn, trackByIdObjFn;
+      var hashFnLocals = {$id: hashKey};
+
+      if (trackByExp) {
+        trackByExpGetter = $parse(trackByExp);
+      } else {
+        trackByIdArrayFn = function(key, value) {
+          return hashKey(value);
+        };
+        trackByIdObjFn = function(key) {
+          return key;
+        };
+      }
+
+      return function ngRepeatLink($scope, $element, $attr, ctrl, $transclude) {
+
+        if (trackByExpGetter) {
+          trackByIdExpFn = function(key, value, index) {
+            // assign key, value, and $index to the locals so that they can be used in hash functions
+            if (keyIdentifier) hashFnLocals[keyIdentifier] = key;
+            hashFnLocals[valueIdentifier] = value;
+            hashFnLocals.$index = index;
+            return trackByExpGetter($scope, hashFnLocals);
+          };
+        }
+
+        // Store a list of elements from previous run. This is a hash where key is the item from the
+        // iterator, and the value is objects with following properties.
+        //   - scope: bound scope
+        //   - element: previous element.
+        //   - index: position
+        //
+        // We are using no-proto object so that we don't need to guard against inherited props via
+        // hasOwnProperty.
+        var lastBlockMap = createMap();
+
+        //watch props
+        $scope.$watchCollection(rhs, function ngRepeatAction(collection) {
+          var index, length,
+              previousNode = $element[0],     // node that cloned nodes should be inserted after
+                                              // initialized to the comment node anchor
+              nextNode,
+              // Same as lastBlockMap but it has the current state. It will become the
+              // lastBlockMap on the next iteration.
+              nextBlockMap = createMap(),
+              collectionLength,
+              key, value, // key/value of iteration
+              trackById,
+              trackByIdFn,
+              collectionKeys,
+              block,       // last object information {scope, element, id}
+              nextBlockOrder,
+              elementsToRemove;
+
+          if (aliasAs) {
+            $scope[aliasAs] = collection;
+          }
+
+          if (isArrayLike(collection)) {
+            collectionKeys = collection;
+            trackByIdFn = trackByIdExpFn || trackByIdArrayFn;
+          } else {
+            trackByIdFn = trackByIdExpFn || trackByIdObjFn;
+            // if object, extract keys, in enumeration order, unsorted
+            collectionKeys = [];
+            for (var itemKey in collection) {
+              if (hasOwnProperty.call(collection, itemKey) && itemKey.charAt(0) !== '$') {
+                collectionKeys.push(itemKey);
+              }
+            }
+          }
+
+          collectionLength = collectionKeys.length;
+          nextBlockOrder = new Array(collectionLength);
+
+          // locate existing items
+          for (index = 0; index < collectionLength; index++) {
+            key = (collection === collectionKeys) ? index : collectionKeys[index];
+            value = collection[key];
+            trackById = trackByIdFn(key, value, index);
+            if (lastBlockMap[trackById]) {
+              // found previously seen block
+              block = lastBlockMap[trackById];
+              delete lastBlockMap[trackById];
+              nextBlockMap[trackById] = block;
+              nextBlockOrder[index] = block;
+            } else if (nextBlockMap[trackById]) {
+              // if collision detected. restore lastBlockMap and throw an error
+              forEach(nextBlockOrder, function(block) {
+                if (block && block.scope) lastBlockMap[block.id] = block;
+              });
+              throw ngRepeatMinErr('dupes',
+                  "Duplicates in a repeater are not allowed. Use 'track by' expression to specify unique keys. Repeater: {0}, Duplicate key: {1}, Duplicate value: {2}",
+                  expression, trackById, value);
+            } else {
+              // new never before seen block
+              nextBlockOrder[index] = {id: trackById, scope: undefined, clone: undefined};
+              nextBlockMap[trackById] = true;
+            }
+          }
+
+          // remove leftover items
+          for (var blockKey in lastBlockMap) {
+            block = lastBlockMap[blockKey];
+            elementsToRemove = getBlockNodes(block.clone);
+            $animate.leave(elementsToRemove);
+            if (elementsToRemove[0].parentNode) {
+              // if the element was not removed yet because of pending animation, mark it as deleted
+              // so that we can ignore it later
+              for (index = 0, length = elementsToRemove.length; index < length; index++) {
+                elementsToRemove[index][NG_REMOVED] = true;
+              }
+            }
+            block.scope.$destroy();
+          }
+
+          // we are not using forEach for perf reasons (trying to avoid #call)
+          for (index = 0; index < collectionLength; index++) {
+            key = (collection === collectionKeys) ? index : collectionKeys[index];
+            value = collection[key];
+            block = nextBlockOrder[index];
+
+            if (block.scope) {
+              // if we have already seen this object, then we need to reuse the
+              // associated scope/element
+
+              nextNode = previousNode;
+
+              // skip nodes that are already pending removal via leave animation
+              do {
+                nextNode = nextNode.nextSibling;
+              } while (nextNode && nextNode[NG_REMOVED]);
+
+              if (getBlockStart(block) != nextNode) {
+                // existing item which got moved
+                $animate.move(getBlockNodes(block.clone), null, jqLite(previousNode));
+              }
+              previousNode = getBlockEnd(block);
+              updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
+            } else {
+              // new item which we don't know about
+              $transclude(function ngRepeatTransclude(clone, scope) {
+                block.scope = scope;
+                // http://jsperf.com/clone-vs-createcomment
+                var endNode = ngRepeatEndComment.cloneNode(false);
+                clone[clone.length++] = endNode;
+
+                // TODO(perf): support naked previousNode in `enter` to avoid creation of jqLite wrapper?
+                $animate.enter(clone, null, jqLite(previousNode));
+                previousNode = endNode;
+                // Note: We only need the first/last node of the cloned nodes.
+                // However, we need to keep the reference to the jqlite wrapper as it might be changed later
+                // by a directive with templateUrl when its template arrives.
+                block.clone = clone;
+                nextBlockMap[block.id] = block;
+                updateScope(block.scope, index, valueIdentifier, value, keyIdentifier, key, collectionLength);
+              });
+            }
+          }
+          lastBlockMap = nextBlockMap;
+        });
+      };
+    }
+  };
+}];
+
+var NG_HIDE_CLASS = 'ng-hide';
+var NG_HIDE_IN_PROGRESS_CLASS = 'ng-hide-animate';
+/**
+ * @ngdoc directive
+ * @name ngShow
+ * @multiElement
+ *
+ * @description
+ * The `ngShow` directive shows or hides the given HTML element based on the expression
+ * provided to the `ngShow` attribute. The element is shown or hidden by removing or adding
+ * the `.ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
+ * in AngularJS and sets the display style to none (using an !important flag).
+ * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
+ *
+ * ```html
+ * <!-- when $scope.myValue is truthy (element is visible) -->
+ * <div ng-show="myValue"></div>
+ *
+ * <!-- when $scope.myValue is falsy (element is hidden) -->
+ * <div ng-show="myValue" class="ng-hide"></div>
+ * ```
+ *
+ * When the `ngShow` expression evaluates to a falsy value then the `.ng-hide` CSS class is added to the class
+ * attribute on the element causing it to become hidden. When truthy, the `.ng-hide` CSS class is removed
+ * from the element causing the element not to appear hidden.
+ *
+ * ## Why is !important used?
+ *
+ * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
+ * can be easily overridden by heavier selectors. For example, something as simple
+ * as changing the display style on a HTML list item would make hidden elements appear visible.
+ * This also becomes a bigger issue when dealing with CSS frameworks.
+ *
+ * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
+ * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
+ * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
+ *
+ * ### Overriding `.ng-hide`
+ *
+ * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change
+ * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
+ * class CSS. Note that the selector that needs to be used is actually `.ng-hide:not(.ng-hide-animate)` to cope
+ * with extra animation classes that can be added.
+ *
+ * ```css
+ * .ng-hide:not(.ng-hide-animate) {
+ *   /&#42; this is just another form of hiding an element &#42;/
+ *   display: block!important;
+ *   position: absolute;
+ *   top: -9999px;
+ *   left: -9999px;
+ * }
+ * ```
+ *
+ * By default you don't need to override in CSS anything and the animations will work around the display style.
+ *
+ * ## A note about animations with `ngShow`
+ *
+ * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
+ * is true and false. This system works like the animation system present with ngClass except that
+ * you must also include the !important flag to override the display property
+ * so that you can perform an animation when the element is hidden during the time of the animation.
+ *
+ * ```css
+ * //
+ * //a working example can be found at the bottom of this page
+ * //
+ * .my-element.ng-hide-add, .my-element.ng-hide-remove {
+ *   /&#42; this is required as of 1.3x to properly
+ *      apply all styling in a show/hide animation &#42;/
+ *   transition: 0s linear all;
+ * }
+ *
+ * .my-element.ng-hide-add-active,
+ * .my-element.ng-hide-remove-active {
+ *   /&#42; the transition is defined in the active class &#42;/
+ *   transition: 1s linear all;
+ * }
+ *
+ * .my-element.ng-hide-add { ... }
+ * .my-element.ng-hide-add.ng-hide-add-active { ... }
+ * .my-element.ng-hide-remove { ... }
+ * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
+ * ```
+ *
+ * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display
+ * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
+ *
+ * @animations
+ * addClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a truthy value and the just before contents are set to visible
+ * removeClass: `.ng-hide` - happens after the `ngShow` expression evaluates to a non truthy value and just before the contents are set to hidden
+ *
+ * @element ANY
+ * @param {expression} ngShow If the {@link guide/expression expression} is truthy
+ *     then the element is shown or hidden respectively.
+ *
+ * @example
+  <example module="ngAnimate" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+      Click me: <input type="checkbox" ng-model="checked" aria-label="Toggle ngHide"><br/>
+      <div>
+        Show:
+        <div class="check-element animate-show" ng-show="checked">
+          <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
+        </div>
+      </div>
+      <div>
+        Hide:
+        <div class="check-element animate-show" ng-hide="checked">
+          <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
+        </div>
+      </div>
+    </file>
+    <file name="glyphicons.css">
+      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
+    </file>
+    <file name="animations.css">
+      .animate-show {
+        line-height: 20px;
+        opacity: 1;
+        padding: 10px;
+        border: 1px solid black;
+        background: white;
+      }
+
+      .animate-show.ng-hide-add, .animate-show.ng-hide-remove {
+        transition: all linear 0.5s;
+      }
+
+      .animate-show.ng-hide {
+        line-height: 0;
+        opacity: 0;
+        padding: 0 10px;
+      }
+
+      .check-element {
+        padding: 10px;
+        border: 1px solid black;
+        background: white;
+      }
+    </file>
+    <file name="protractor.js" type="protractor">
+      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
+      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
+
+      it('should check ng-show / ng-hide', function() {
+        expect(thumbsUp.isDisplayed()).toBeFalsy();
+        expect(thumbsDown.isDisplayed()).toBeTruthy();
+
+        element(by.model('checked')).click();
+
+        expect(thumbsUp.isDisplayed()).toBeTruthy();
+        expect(thumbsDown.isDisplayed()).toBeFalsy();
+      });
+    </file>
+  </example>
+ */
+var ngShowDirective = ['$animate', function($animate) {
+  return {
+    restrict: 'A',
+    multiElement: true,
+    link: function(scope, element, attr) {
+      scope.$watch(attr.ngShow, function ngShowWatchAction(value) {
+        // we're adding a temporary, animation-specific class for ng-hide since this way
+        // we can control when the element is actually displayed on screen without having
+        // to have a global/greedy CSS selector that breaks when other animations are run.
+        // Read: https://github.com/angular/angular.js/issues/9103#issuecomment-58335845
+        $animate[value ? 'removeClass' : 'addClass'](element, NG_HIDE_CLASS, {
+          tempClasses: NG_HIDE_IN_PROGRESS_CLASS
+        });
+      });
+    }
+  };
+}];
+
+
+/**
+ * @ngdoc directive
+ * @name ngHide
+ * @multiElement
+ *
+ * @description
+ * The `ngHide` directive shows or hides the given HTML element based on the expression
+ * provided to the `ngHide` attribute. The element is shown or hidden by removing or adding
+ * the `ng-hide` CSS class onto the element. The `.ng-hide` CSS class is predefined
+ * in AngularJS and sets the display style to none (using an !important flag).
+ * For CSP mode please add `angular-csp.css` to your html file (see {@link ng.directive:ngCsp ngCsp}).
+ *
+ * ```html
+ * <!-- when $scope.myValue is truthy (element is hidden) -->
+ * <div ng-hide="myValue" class="ng-hide"></div>
+ *
+ * <!-- when $scope.myValue is falsy (element is visible) -->
+ * <div ng-hide="myValue"></div>
+ * ```
+ *
+ * When the `ngHide` expression evaluates to a truthy value then the `.ng-hide` CSS class is added to the class
+ * attribute on the element causing it to become hidden. When falsy, the `.ng-hide` CSS class is removed
+ * from the element causing the element not to appear hidden.
+ *
+ * ## Why is !important used?
+ *
+ * You may be wondering why !important is used for the `.ng-hide` CSS class. This is because the `.ng-hide` selector
+ * can be easily overridden by heavier selectors. For example, something as simple
+ * as changing the display style on a HTML list item would make hidden elements appear visible.
+ * This also becomes a bigger issue when dealing with CSS frameworks.
+ *
+ * By using !important, the show and hide behavior will work as expected despite any clash between CSS selector
+ * specificity (when !important isn't used with any conflicting styles). If a developer chooses to override the
+ * styling to change how to hide an element then it is just a matter of using !important in their own CSS code.
+ *
+ * ### Overriding `.ng-hide`
+ *
+ * By default, the `.ng-hide` class will style the element with `display: none!important`. If you wish to change
+ * the hide behavior with ngShow/ngHide then this can be achieved by restating the styles for the `.ng-hide`
+ * class in CSS:
+ *
+ * ```css
+ * .ng-hide {
+ *   /&#42; this is just another form of hiding an element &#42;/
+ *   display: block!important;
+ *   position: absolute;
+ *   top: -9999px;
+ *   left: -9999px;
+ * }
+ * ```
+ *
+ * By default you don't need to override in CSS anything and the animations will work around the display style.
+ *
+ * ## A note about animations with `ngHide`
+ *
+ * Animations in ngShow/ngHide work with the show and hide events that are triggered when the directive expression
+ * is true and false. This system works like the animation system present with ngClass, except that the `.ng-hide`
+ * CSS class is added and removed for you instead of your own CSS class.
+ *
+ * ```css
+ * //
+ * //a working example can be found at the bottom of this page
+ * //
+ * .my-element.ng-hide-add, .my-element.ng-hide-remove {
+ *   transition: 0.5s linear all;
+ * }
+ *
+ * .my-element.ng-hide-add { ... }
+ * .my-element.ng-hide-add.ng-hide-add-active { ... }
+ * .my-element.ng-hide-remove { ... }
+ * .my-element.ng-hide-remove.ng-hide-remove-active { ... }
+ * ```
+ *
+ * Keep in mind that, as of AngularJS version 1.3.0-beta.11, there is no need to change the display
+ * property to block during animation states--ngAnimate will handle the style toggling automatically for you.
+ *
+ * @animations
+ * removeClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a truthy value and just before the contents are set to hidden
+ * addClass: `.ng-hide` - happens after the `ngHide` expression evaluates to a non truthy value and just before the contents are set to visible
+ *
+ * @element ANY
+ * @param {expression} ngHide If the {@link guide/expression expression} is truthy then
+ *     the element is shown or hidden respectively.
+ *
+ * @example
+  <example module="ngAnimate" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+      Click me: <input type="checkbox" ng-model="checked" aria-label="Toggle ngShow"><br/>
+      <div>
+        Show:
+        <div class="check-element animate-hide" ng-show="checked">
+          <span class="glyphicon glyphicon-thumbs-up"></span> I show up when your checkbox is checked.
+        </div>
+      </div>
+      <div>
+        Hide:
+        <div class="check-element animate-hide" ng-hide="checked">
+          <span class="glyphicon glyphicon-thumbs-down"></span> I hide when your checkbox is checked.
+        </div>
+      </div>
+    </file>
+    <file name="glyphicons.css">
+      @import url(../../components/bootstrap-3.1.1/css/bootstrap.css);
+    </file>
+    <file name="animations.css">
+      .animate-hide {
+        transition: all linear 0.5s;
+        line-height: 20px;
+        opacity: 1;
+        padding: 10px;
+        border: 1px solid black;
+        background: white;
+      }
+
+      .animate-hide.ng-hide {
+        line-height: 0;
+        opacity: 0;
+        padding: 0 10px;
+      }
+
+      .check-element {
+        padding: 10px;
+        border: 1px solid black;
+        background: white;
+      }
+    </file>
+    <file name="protractor.js" type="protractor">
+      var thumbsUp = element(by.css('span.glyphicon-thumbs-up'));
+      var thumbsDown = element(by.css('span.glyphicon-thumbs-down'));
+
+      it('should check ng-show / ng-hide', function() {
+        expect(thumbsUp.isDisplayed()).toBeFalsy();
+        expect(thumbsDown.isDisplayed()).toBeTruthy();
+
+        element(by.model('checked')).click();
+
+        expect(thumbsUp.isDisplayed()).toBeTruthy();
+        expect(thumbsDown.isDisplayed()).toBeFalsy();
+      });
+    </file>
+  </example>
+ */
+var ngHideDirective = ['$animate', function($animate) {
+  return {
+    restrict: 'A',
+    multiElement: true,
+    link: function(scope, element, attr) {
+      scope.$watch(attr.ngHide, function ngHideWatchAction(value) {
+        // The comment inside of the ngShowDirective explains why we add and
+        // remove a temporary class for the show/hide animation
+        $animate[value ? 'addClass' : 'removeClass'](element,NG_HIDE_CLASS, {
+          tempClasses: NG_HIDE_IN_PROGRESS_CLASS
+        });
+      });
+    }
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name ngStyle
+ * @restrict AC
+ *
+ * @description
+ * The `ngStyle` directive allows you to set CSS style on an HTML element conditionally.
+ *
+ * @element ANY
+ * @param {expression} ngStyle
+ *
+ * {@link guide/expression Expression} which evals to an
+ * object whose keys are CSS style names and values are corresponding values for those CSS
+ * keys.
+ *
+ * Since some CSS style names are not valid keys for an object, they must be quoted.
+ * See the 'background-color' style in the example below.
+ *
+ * @example
+   <example>
+     <file name="index.html">
+        <input type="button" value="set color" ng-click="myStyle={color:'red'}">
+        <input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
+        <input type="button" value="clear" ng-click="myStyle={}">
+        <br/>
+        <span ng-style="myStyle">Sample Text</span>
+        <pre>myStyle={{myStyle}}</pre>
+     </file>
+     <file name="style.css">
+       span {
+         color: black;
+       }
+     </file>
+     <file name="protractor.js" type="protractor">
+       var colorSpan = element(by.css('span'));
+
+       it('should check ng-style', function() {
+         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
+         element(by.css('input[value=\'set color\']')).click();
+         expect(colorSpan.getCssValue('color')).toBe('rgba(255, 0, 0, 1)');
+         element(by.css('input[value=clear]')).click();
+         expect(colorSpan.getCssValue('color')).toBe('rgba(0, 0, 0, 1)');
+       });
+     </file>
+   </example>
+ */
+var ngStyleDirective = ngDirective(function(scope, element, attr) {
+  scope.$watch(attr.ngStyle, function ngStyleWatchAction(newStyles, oldStyles) {
+    if (oldStyles && (newStyles !== oldStyles)) {
+      forEach(oldStyles, function(val, style) { element.css(style, '');});
+    }
+    if (newStyles) element.css(newStyles);
+  }, true);
+});
+
+/**
+ * @ngdoc directive
+ * @name ngSwitch
+ * @restrict EA
+ *
+ * @description
+ * The `ngSwitch` directive is used to conditionally swap DOM structure on your template based on a scope expression.
+ * Elements within `ngSwitch` but without `ngSwitchWhen` or `ngSwitchDefault` directives will be preserved at the location
+ * as specified in the template.
+ *
+ * The directive itself works similar to ngInclude, however, instead of downloading template code (or loading it
+ * from the template cache), `ngSwitch` simply chooses one of the nested elements and makes it visible based on which element
+ * matches the value obtained from the evaluated expression. In other words, you define a container element
+ * (where you place the directive), place an expression on the **`on="..."` attribute**
+ * (or the **`ng-switch="..."` attribute**), define any inner elements inside of the directive and place
+ * a when attribute per element. The when attribute is used to inform ngSwitch which element to display when the on
+ * expression is evaluated. If a matching expression is not found via a when attribute then an element with the default
+ * attribute is displayed.
+ *
+ * <div class="alert alert-info">
+ * Be aware that the attribute values to match against cannot be expressions. They are interpreted
+ * as literal string values to match against.
+ * For example, **`ng-switch-when="someVal"`** will match against the string `"someVal"` not against the
+ * value of the expression `$scope.someVal`.
+ * </div>
+
+ * @animations
+ * enter - happens after the ngSwitch contents change and the matched child element is placed inside the container
+ * leave - happens just after the ngSwitch contents change and just before the former contents are removed from the DOM
+ *
+ * @usage
+ *
+ * ```
+ * <ANY ng-switch="expression">
+ *   <ANY ng-switch-when="matchValue1">...</ANY>
+ *   <ANY ng-switch-when="matchValue2">...</ANY>
+ *   <ANY ng-switch-default>...</ANY>
+ * </ANY>
+ * ```
+ *
+ *
+ * @scope
+ * @priority 1200
+ * @param {*} ngSwitch|on expression to match against <code>ng-switch-when</code>.
+ * On child elements add:
+ *
+ * * `ngSwitchWhen`: the case statement to match against. If match then this
+ *   case will be displayed. If the same match appears multiple times, all the
+ *   elements will be displayed.
+ * * `ngSwitchDefault`: the default case when no other case match. If there
+ *   are multiple default cases, all of them will be displayed when no other
+ *   case match.
+ *
+ *
+ * @example
+  <example module="switchExample" deps="angular-animate.js" animations="true">
+    <file name="index.html">
+      <div ng-controller="ExampleController">
+        <select ng-model="selection" ng-options="item for item in items">
+        </select>
+        <code>selection={{selection}}</code>
+        <hr/>
+        <div class="animate-switch-container"
+          ng-switch on="selection">
+            <div class="animate-switch" ng-switch-when="settings">Settings Div</div>
+            <div class="animate-switch" ng-switch-when="home">Home Span</div>
+            <div class="animate-switch" ng-switch-default>default</div>
+        </div>
+      </div>
+    </file>
+    <file name="script.js">
+      angular.module('switchExample', ['ngAnimate'])
+        .controller('ExampleController', ['$scope', function($scope) {
+          $scope.items = ['settings', 'home', 'other'];
+          $scope.selection = $scope.items[0];
+        }]);
+    </file>
+    <file name="animations.css">
+      .animate-switch-container {
+        position:relative;
+        background:white;
+        border:1px solid black;
+        height:40px;
+        overflow:hidden;
+      }
+
+      .animate-switch {
+        padding:10px;
+      }
+
+      .animate-switch.ng-animate {
+        transition:all cubic-bezier(0.250, 0.460, 0.450, 0.940) 0.5s;
+
+        position:absolute;
+        top:0;
+        left:0;
+        right:0;
+        bottom:0;
+      }
+
+      .animate-switch.ng-leave.ng-leave-active,
+      .animate-switch.ng-enter {
+        top:-50px;
+      }
+      .animate-switch.ng-leave,
+      .animate-switch.ng-enter.ng-enter-active {
+        top:0;
+      }
+    </file>
+    <file name="protractor.js" type="protractor">
+      var switchElem = element(by.css('[ng-switch]'));
+      var select = element(by.model('selection'));
+
+      it('should start in settings', function() {
+        expect(switchElem.getText()).toMatch(/Settings Div/);
+      });
+      it('should change to home', function() {
+        select.all(by.css('option')).get(1).click();
+        expect(switchElem.getText()).toMatch(/Home Span/);
+      });
+      it('should select default', function() {
+        select.all(by.css('option')).get(2).click();
+        expect(switchElem.getText()).toMatch(/default/);
+      });
+    </file>
+  </example>
+ */
+var ngSwitchDirective = ['$animate', function($animate) {
+  return {
+    require: 'ngSwitch',
+
+    // asks for $scope to fool the BC controller module
+    controller: ['$scope', function ngSwitchController() {
+     this.cases = {};
+    }],
+    link: function(scope, element, attr, ngSwitchController) {
+      var watchExpr = attr.ngSwitch || attr.on,
+          selectedTranscludes = [],
+          selectedElements = [],
+          previousLeaveAnimations = [],
+          selectedScopes = [];
+
+      var spliceFactory = function(array, index) {
+          return function() { array.splice(index, 1); };
+      };
+
+      scope.$watch(watchExpr, function ngSwitchWatchAction(value) {
+        var i, ii;
+        for (i = 0, ii = previousLeaveAnimations.length; i < ii; ++i) {
+          $animate.cancel(previousLeaveAnimations[i]);
+        }
+        previousLeaveAnimations.length = 0;
+
+        for (i = 0, ii = selectedScopes.length; i < ii; ++i) {
+          var selected = getBlockNodes(selectedElements[i].clone);
+          selectedScopes[i].$destroy();
+          var promise = previousLeaveAnimations[i] = $animate.leave(selected);
+          promise.then(spliceFactory(previousLeaveAnimations, i));
+        }
+
+        selectedElements.length = 0;
+        selectedScopes.length = 0;
+
+        if ((selectedTranscludes = ngSwitchController.cases['!' + value] || ngSwitchController.cases['?'])) {
+          forEach(selectedTranscludes, function(selectedTransclude) {
+            selectedTransclude.transclude(function(caseElement, selectedScope) {
+              selectedScopes.push(selectedScope);
+              var anchor = selectedTransclude.element;
+              caseElement[caseElement.length++] = document.createComment(' end ngSwitchWhen: ');
+              var block = { clone: caseElement };
+
+              selectedElements.push(block);
+              $animate.enter(caseElement, anchor.parent(), anchor);
+            });
+          });
+        }
+      });
+    }
+  };
+}];
+
+var ngSwitchWhenDirective = ngDirective({
+  transclude: 'element',
+  priority: 1200,
+  require: '^ngSwitch',
+  multiElement: true,
+  link: function(scope, element, attrs, ctrl, $transclude) {
+    ctrl.cases['!' + attrs.ngSwitchWhen] = (ctrl.cases['!' + attrs.ngSwitchWhen] || []);
+    ctrl.cases['!' + attrs.ngSwitchWhen].push({ transclude: $transclude, element: element });
+  }
+});
+
+var ngSwitchDefaultDirective = ngDirective({
+  transclude: 'element',
+  priority: 1200,
+  require: '^ngSwitch',
+  multiElement: true,
+  link: function(scope, element, attr, ctrl, $transclude) {
+    ctrl.cases['?'] = (ctrl.cases['?'] || []);
+    ctrl.cases['?'].push({ transclude: $transclude, element: element });
+   }
+});
+
+/**
+ * @ngdoc directive
+ * @name ngTransclude
+ * @restrict EAC
+ *
+ * @description
+ * Directive that marks the insertion point for the transcluded DOM of the nearest parent directive that uses transclusion.
+ *
+ * Any existing content of the element that this directive is placed on will be removed before the transcluded content is inserted.
+ *
+ * @element ANY
+ *
+ * @example
+   <example module="transcludeExample">
+     <file name="index.html">
+       <script>
+         angular.module('transcludeExample', [])
+          .directive('pane', function(){
+             return {
+               restrict: 'E',
+               transclude: true,
+               scope: { title:'@' },
+               template: '<div style="border: 1px solid black;">' +
+                           '<div style="background-color: gray">{{title}}</div>' +
+                           '<ng-transclude></ng-transclude>' +
+                         '</div>'
+             };
+         })
+         .controller('ExampleController', ['$scope', function($scope) {
+           $scope.title = 'Lorem Ipsum';
+           $scope.text = 'Neque porro quisquam est qui dolorem ipsum quia dolor...';
+         }]);
+       </script>
+       <div ng-controller="ExampleController">
+         <input ng-model="title" aria-label="title"> <br/>
+         <textarea ng-model="text" aria-label="text"></textarea> <br/>
+         <pane title="{{title}}">{{text}}</pane>
+       </div>
+     </file>
+     <file name="protractor.js" type="protractor">
+        it('should have transcluded', function() {
+          var titleElement = element(by.model('title'));
+          titleElement.clear();
+          titleElement.sendKeys('TITLE');
+          var textElement = element(by.model('text'));
+          textElement.clear();
+          textElement.sendKeys('TEXT');
+          expect(element(by.binding('title')).getText()).toEqual('TITLE');
+          expect(element(by.binding('text')).getText()).toEqual('TEXT');
+        });
+     </file>
+   </example>
+ *
+ */
+var ngTranscludeDirective = ngDirective({
+  restrict: 'EAC',
+  link: function($scope, $element, $attrs, controller, $transclude) {
+    if (!$transclude) {
+      throw minErr('ngTransclude')('orphan',
+       'Illegal use of ngTransclude directive in the template! ' +
+       'No parent directive that requires a transclusion found. ' +
+       'Element: {0}',
+       startingTag($element));
+    }
+
+    $transclude(function(clone) {
+      $element.empty();
+      $element.append(clone);
+    });
+  }
+});
+
+/**
+ * @ngdoc directive
+ * @name script
+ * @restrict E
+ *
+ * @description
+ * Load the content of a `<script>` element into {@link ng.$templateCache `$templateCache`}, so that the
+ * template can be used by {@link ng.directive:ngInclude `ngInclude`},
+ * {@link ngRoute.directive:ngView `ngView`}, or {@link guide/directive directives}. The type of the
+ * `<script>` element must be specified as `text/ng-template`, and a cache name for the template must be
+ * assigned through the element's `id`, which can then be used as a directive's `templateUrl`.
+ *
+ * @param {string} type Must be set to `'text/ng-template'`.
+ * @param {string} id Cache name of the template.
+ *
+ * @example
+  <example>
+    <file name="index.html">
+      <script type="text/ng-template" id="/tpl.html">
+        Content of the template.
+      </script>
+
+      <a ng-click="currentTpl='/tpl.html'" id="tpl-link">Load inlined template</a>
+      <div id="tpl-content" ng-include src="currentTpl"></div>
+    </file>
+    <file name="protractor.js" type="protractor">
+      it('should load template defined inside script tag', function() {
+        element(by.css('#tpl-link')).click();
+        expect(element(by.css('#tpl-content')).getText()).toMatch(/Content of the template/);
+      });
+    </file>
+  </example>
+ */
+var scriptDirective = ['$templateCache', function($templateCache) {
+  return {
+    restrict: 'E',
+    terminal: true,
+    compile: function(element, attr) {
+      if (attr.type == 'text/ng-template') {
+        var templateUrl = attr.id,
+            text = element[0].text;
+
+        $templateCache.put(templateUrl, text);
+      }
+    }
+  };
+}];
+
+var noopNgModelController = { $setViewValue: noop, $render: noop };
+
+/**
+ * @ngdoc type
+ * @name  select.SelectController
+ * @description
+ * The controller for the `<select>` directive. This provides support for reading
+ * and writing the selected value(s) of the control and also coordinates dynamically
+ * added `<option>` elements, perhaps by an `ngRepeat` directive.
+ */
+var SelectController =
+        ['$element', '$scope', '$attrs', function($element, $scope, $attrs) {
+
+  var self = this,
+      optionsMap = new HashMap();
+
+  // If the ngModel doesn't get provided then provide a dummy noop version to prevent errors
+  self.ngModelCtrl = noopNgModelController;
+
+  // The "unknown" option is one that is prepended to the list if the viewValue
+  // does not match any of the options. When it is rendered the value of the unknown
+  // option is '? XXX ?' where XXX is the hashKey of the value that is not known.
+  //
+  // We can't just jqLite('<option>') since jqLite is not smart enough
+  // to create it in <select> and IE barfs otherwise.
+  self.unknownOption = jqLite(document.createElement('option'));
+  self.renderUnknownOption = function(val) {
+    var unknownVal = '? ' + hashKey(val) + ' ?';
+    self.unknownOption.val(unknownVal);
+    $element.prepend(self.unknownOption);
+    $element.val(unknownVal);
+  };
+
+  $scope.$on('$destroy', function() {
+    // disable unknown option so that we don't do work when the whole select is being destroyed
+    self.renderUnknownOption = noop;
+  });
+
+  self.removeUnknownOption = function() {
+    if (self.unknownOption.parent()) self.unknownOption.remove();
+  };
+
+
+  // Read the value of the select control, the implementation of this changes depending
+  // upon whether the select can have multiple values and whether ngOptions is at work.
+  self.readValue = function readSingleValue() {
+    self.removeUnknownOption();
+    return $element.val();
+  };
+
+
+  // Write the value to the select control, the implementation of this changes depending
+  // upon whether the select can have multiple values and whether ngOptions is at work.
+  self.writeValue = function writeSingleValue(value) {
+    if (self.hasOption(value)) {
+      self.removeUnknownOption();
+      $element.val(value);
+      if (value === '') self.emptyOption.prop('selected', true); // to make IE9 happy
+    } else {
+      if (value == null && self.emptyOption) {
+        self.removeUnknownOption();
+        $element.val('');
+      } else {
+        self.renderUnknownOption(value);
+      }
+    }
+  };
+
+
+  // Tell the select control that an option, with the given value, has been added
+  self.addOption = function(value, element) {
+    assertNotHasOwnProperty(value, '"option value"');
+    if (value === '') {
+      self.emptyOption = element;
+    }
+    var count = optionsMap.get(value) || 0;
+    optionsMap.put(value, count + 1);
+  };
+
+  // Tell the select control that an option, with the given value, has been removed
+  self.removeOption = function(value) {
+    var count = optionsMap.get(value);
+    if (count) {
+      if (count === 1) {
+        optionsMap.remove(value);
+        if (value === '') {
+          self.emptyOption = undefined;
+        }
+      } else {
+        optionsMap.put(value, count - 1);
+      }
+    }
+  };
+
+  // Check whether the select control has an option matching the given value
+  self.hasOption = function(value) {
+    return !!optionsMap.get(value);
+  };
+}];
+
+/**
+ * @ngdoc directive
+ * @name select
+ * @restrict E
+ *
+ * @description
+ * HTML `SELECT` element with angular data-binding.
+ *
+ * The `select` directive is used together with {@link ngModel `ngModel`} to provide data-binding
+ * between the scope and the `<select>` control (including setting default values).
+ * Ìt also handles dynamic `<option>` elements, which can be added using the {@link ngRepeat `ngRepeat}` or
+ * {@link ngOptions `ngOptions`} directives.
+ *
+ * When an item in the `<select>` menu is selected, the value of the selected option will be bound
+ * to the model identified by the `ngModel` directive. With static or repeated options, this is
+ * the content of the `value` attribute or the textContent of the `<option>`, if the value attribute is missing.
+ * If you want dynamic value attributes, you can use interpolation inside the value attribute.
+ *
+ * <div class="alert alert-warning">
+ * Note that the value of a `select` directive used without `ngOptions` is always a string.
+ * When the model needs to be bound to a non-string value, you must either explictly convert it
+ * using a directive (see example below) or use `ngOptions` to specify the set of options.
+ * This is because an option element can only be bound to string values at present.
+ * </div>
+ *
+ * If the viewValue of `ngModel` does not match any of the options, then the control
+ * will automatically add an "unknown" option, which it then removes when the mismatch is resolved.
+ *
+ * Optionally, a single hard-coded `<option>` element, with the value set to an empty string, can
+ * be nested into the `<select>` element. This element will then represent the `null` or "not selected"
+ * option. See example below for demonstration.
+ *
+ * <div class="alert alert-info">
+ * In many cases, `ngRepeat` can be used on `<option>` elements instead of {@link ng.directive:ngOptions
+ * ngOptions} to achieve a similar result. However, `ngOptions` provides some benefits, such as
+ * more flexibility in how the `<select>`'s model is assigned via the `select` **`as`** part of the
+ * comprehension expression, and additionally in reducing memory and increasing speed by not creating
+ * a new scope for each repeated instance.
+ * </div>
+ *
+ *
+ * @param {string} ngModel Assignable angular expression to data-bind to.
+ * @param {string=} name Property name of the form under which the control is published.
+ * @param {string=} required Sets `required` validation error key if the value is not entered.
+ * @param {string=} ngRequired Adds required attribute and required validation constraint to
+ * the element when the ngRequired expression evaluates to true. Use ngRequired instead of required
+ * when you want to data-bind to the required attribute.
+ * @param {string=} ngChange Angular expression to be executed when selected option(s) changes due to user
+ *    interaction with the select element.
+ * @param {string=} ngOptions sets the options that the select is populated with and defines what is
+ * set on the model on selection. See {@link ngOptions `ngOptions`}.
+ *
+ * @example
+ * ### Simple `select` elements with static options
+ *
+ * <example name="static-select" module="staticSelect">
+ * <file name="index.html">
+ * <div ng-controller="ExampleController">
+ *   <form name="myForm">
+ *     <label for="singleSelect"> Single select: </label><br>
+ *     <select name="singleSelect" ng-model="data.singleSelect">
+ *       <option value="option-1">Option 1</option>
+ *       <option value="option-2">Option 2</option>
+ *     </select><br>
+ *
+ *     <label for="singleSelect"> Single select with "not selected" option and dynamic option values: </label><br>
+ *     <select name="singleSelect" id="singleSelect" ng-model="data.singleSelect">
+ *       <option value="">---Please select---</option> <!-- not selected / blank option -->
+ *       <option value="{{data.option1}}">Option 1</option> <!-- interpolation -->
+ *       <option value="option-2">Option 2</option>
+ *     </select><br>
+ *     <button ng-click="forceUnknownOption()">Force unknown option</button><br>
+ *     <tt>singleSelect = {{data.singleSelect}}</tt>
+ *
+ *     <hr>
+ *     <label for="multipleSelect"> Multiple select: </label><br>
+ *     <select name="multipleSelect" id="multipleSelect" ng-model="data.multipleSelect" multiple>
+ *       <option value="option-1">Option 1</option>
+ *       <option value="option-2">Option 2</option>
+ *       <option value="option-3">Option 3</option>
+ *     </select><br>
+ *     <tt>multipleSelect = {{data.multipleSelect}}</tt><br/>
+ *   </form>
+ * </div>
+ * </file>
+ * <file name="app.js">
+ *  angular.module('staticSelect', [])
+ *    .controller('ExampleController', ['$scope', function($scope) {
+ *      $scope.data = {
+ *       singleSelect: null,
+ *       multipleSelect: [],
+ *       option1: 'option-1',
+ *      };
+ *
+ *      $scope.forceUnknownOption = function() {
+ *        $scope.data.singleSelect = 'nonsense';
+ *      };
+ *   }]);
+ * </file>
+ *</example>
+ *
+ * ### Using `ngRepeat` to generate `select` options
+ * <example name="ngrepeat-select" module="ngrepeatSelect">
+ * <file name="index.html">
+ * <div ng-controller="ExampleController">
+ *   <form name="myForm">
+ *     <label for="repeatSelect"> Repeat select: </label>
+ *     <select name="repeatSelect" id="repeatSelect" ng-model="data.repeatSelect">
+ *       <option ng-repeat="option in data.availableOptions" value="{{option.id}}">{{option.name}}</option>
+ *     </select>
+ *   </form>
+ *   <hr>
+ *   <tt>repeatSelect = {{data.repeatSelect}}</tt><br/>
+ * </div>
+ * </file>
+ * <file name="app.js">
+ *  angular.module('ngrepeatSelect', [])
+ *    .controller('ExampleController', ['$scope', function($scope) {
+ *      $scope.data = {
+ *       repeatSelect: null,
+ *       availableOptions: [
+ *         {id: '1', name: 'Option A'},
+ *         {id: '2', name: 'Option B'},
+ *         {id: '3', name: 'Option C'}
+ *       ],
+ *      };
+ *   }]);
+ * </file>
+ *</example>
+ *
+ *
+ * ### Using `select` with `ngOptions` and setting a default value
+ * See the {@link ngOptions ngOptions documentation} for more `ngOptions` usage examples.
+ *
+ * <example name="select-with-default-values" module="defaultValueSelect">
+ * <file name="index.html">
+ * <div ng-controller="ExampleController">
+ *   <form name="myForm">
+ *     <label for="mySelect">Make a choice:</label>
+ *     <select name="mySelect" id="mySelect"
+ *       ng-options="option.name for option in data.availableOptions track by option.id"
+ *       ng-model="data.selectedOption"></select>
+ *   </form>
+ *   <hr>
+ *   <tt>option = {{data.selectedOption}}</tt><br/>
+ * </div>
+ * </file>
+ * <file name="app.js">
+ *  angular.module('defaultValueSelect', [])
+ *    .controller('ExampleController', ['$scope', function($scope) {
+ *      $scope.data = {
+ *       availableOptions: [
+ *         {id: '1', name: 'Option A'},
+ *         {id: '2', name: 'Option B'},
+ *         {id: '3', name: 'Option C'}
+ *       ],
+ *       selectedOption: {id: '3', name: 'Option C'} //This sets the default value of the select in the ui
+ *       };
+ *   }]);
+ * </file>
+ *</example>
+ *
+ *
+ * ### Binding `select` to a non-string value via `ngModel` parsing / formatting
+ *
+ * <example name="select-with-non-string-options" module="nonStringSelect">
+ *   <file name="index.html">
+ *     <select ng-model="model.id" convert-to-number>
+ *       <option value="0">Zero</option>
+ *       <option value="1">One</option>
+ *       <option value="2">Two</option>
+ *     </select>
+ *     {{ model }}
+ *   </file>
+ *   <file name="app.js">
+ *     angular.module('nonStringSelect', [])
+ *       .run(function($rootScope) {
+ *         $rootScope.model = { id: 2 };
+ *       })
+ *       .directive('convertToNumber', function() {
+ *         return {
+ *           require: 'ngModel',
+ *           link: function(scope, element, attrs, ngModel) {
+ *             ngModel.$parsers.push(function(val) {
+ *               return parseInt(val, 10);
+ *             });
+ *             ngModel.$formatters.push(function(val) {
+ *               return '' + val;
+ *             });
+ *           }
+ *         };
+ *       });
+ *   </file>
+ *   <file name="protractor.js" type="protractor">
+ *     it('should initialize to model', function() {
+ *       var select = element(by.css('select'));
+ *       expect(element(by.model('model.id')).$('option:checked').getText()).toEqual('Two');
+ *     });
+ *   </file>
+ * </example>
+ *
+ */
+var selectDirective = function() {
+
+  return {
+    restrict: 'E',
+    require: ['select', '?ngModel'],
+    controller: SelectController,
+    link: function(scope, element, attr, ctrls) {
+
+      // if ngModel is not defined, we don't need to do anything
+      var ngModelCtrl = ctrls[1];
+      if (!ngModelCtrl) return;
+
+      var selectCtrl = ctrls[0];
+
+      selectCtrl.ngModelCtrl = ngModelCtrl;
+
+      // We delegate rendering to the `writeValue` method, which can be changed
+      // if the select can have multiple selected values or if the options are being
+      // generated by `ngOptions`
+      ngModelCtrl.$render = function() {
+        selectCtrl.writeValue(ngModelCtrl.$viewValue);
+      };
+
+      // When the selected item(s) changes we delegate getting the value of the select control
+      // to the `readValue` method, which can be changed if the select can have multiple
+      // selected values or if the options are being generated by `ngOptions`
+      element.on('change', function() {
+        scope.$apply(function() {
+          ngModelCtrl.$setViewValue(selectCtrl.readValue());
+        });
+      });
+
+      // If the select allows multiple values then we need to modify how we read and write
+      // values from and to the control; also what it means for the value to be empty and
+      // we have to add an extra watch since ngModel doesn't work well with arrays - it
+      // doesn't trigger rendering if only an item in the array changes.
+      if (attr.multiple) {
+
+        // Read value now needs to check each option to see if it is selected
+        selectCtrl.readValue = function readMultipleValue() {
+          var array = [];
+          forEach(element.find('option'), function(option) {
+            if (option.selected) {
+              array.push(option.value);
+            }
+          });
+          return array;
+        };
+
+        // Write value now needs to set the selected property of each matching option
+        selectCtrl.writeValue = function writeMultipleValue(value) {
+          var items = new HashMap(value);
+          forEach(element.find('option'), function(option) {
+            option.selected = isDefined(items.get(option.value));
+          });
+        };
+
+        // we have to do it on each watch since ngModel watches reference, but
+        // we need to work of an array, so we need to see if anything was inserted/removed
+        var lastView, lastViewRef = NaN;
+        scope.$watch(function selectMultipleWatch() {
+          if (lastViewRef === ngModelCtrl.$viewValue && !equals(lastView, ngModelCtrl.$viewValue)) {
+            lastView = shallowCopy(ngModelCtrl.$viewValue);
+            ngModelCtrl.$render();
+          }
+          lastViewRef = ngModelCtrl.$viewValue;
+        });
+
+        // If we are a multiple select then value is now a collection
+        // so the meaning of $isEmpty changes
+        ngModelCtrl.$isEmpty = function(value) {
+          return !value || value.length === 0;
+        };
+
+      }
+    }
+  };
+};
+
+
+// The option directive is purely designed to communicate the existence (or lack of)
+// of dynamically created (and destroyed) option elements to their containing select
+// directive via its controller.
+var optionDirective = ['$interpolate', function($interpolate) {
+
+  function chromeHack(optionElement) {
+    // Workaround for https://code.google.com/p/chromium/issues/detail?id=381459
+    // Adding an <option selected="selected"> element to a <select required="required"> should
+    // automatically select the new element
+    if (optionElement[0].hasAttribute('selected')) {
+      optionElement[0].selected = true;
+    }
+  }
+
+  return {
+    restrict: 'E',
+    priority: 100,
+    compile: function(element, attr) {
+
+      if (isDefined(attr.value)) {
+        // If the value attribute is defined, check if it contains an interpolation
+        var valueInterpolated = $interpolate(attr.value, true);
+      } else {
+        // If the value attribute is not defined then we fall back to the
+        // text content of the option element, which may be interpolated
+        var interpolateFn = $interpolate(element.text(), true);
+        if (!interpolateFn) {
+          attr.$set('value', element.text());
+        }
+      }
+
+      return function(scope, element, attr) {
+
+        // This is an optimization over using ^^ since we don't want to have to search
+        // all the way to the root of the DOM for every single option element
+        var selectCtrlName = '$selectController',
+            parent = element.parent(),
+            selectCtrl = parent.data(selectCtrlName) ||
+              parent.parent().data(selectCtrlName); // in case we are in optgroup
+
+        function addOption(optionValue) {
+          selectCtrl.addOption(optionValue, element);
+          selectCtrl.ngModelCtrl.$render();
+          chromeHack(element);
+        }
+
+        // Only update trigger option updates if this is an option within a `select`
+        // that also has `ngModel` attached
+        if (selectCtrl && selectCtrl.ngModelCtrl) {
+
+          if (valueInterpolated) {
+            // The value attribute is interpolated
+            var oldVal;
+            attr.$observe('value', function valueAttributeObserveAction(newVal) {
+              if (isDefined(oldVal)) {
+                selectCtrl.removeOption(oldVal);
+              }
+              oldVal = newVal;
+              addOption(newVal);
+            });
+          } else if (interpolateFn) {
+            // The text content is interpolated
+            scope.$watch(interpolateFn, function interpolateWatchAction(newVal, oldVal) {
+              attr.$set('value', newVal);
+              if (oldVal !== newVal) {
+                selectCtrl.removeOption(oldVal);
+              }
+              addOption(newVal);
+            });
+          } else {
+            // The value attribute is static
+            addOption(attr.value);
+          }
+
+          element.on('$destroy', function() {
+            selectCtrl.removeOption(attr.value);
+            selectCtrl.ngModelCtrl.$render();
+          });
+        }
+      };
+    }
+  };
+}];
+
+var styleDirective = valueFn({
+  restrict: 'E',
+  terminal: false
+});
+
+var requiredDirective = function() {
+  return {
+    restrict: 'A',
+    require: '?ngModel',
+    link: function(scope, elm, attr, ctrl) {
+      if (!ctrl) return;
+      attr.required = true; // force truthy in case we are on non input element
+
+      ctrl.$validators.required = function(modelValue, viewValue) {
+        return !attr.required || !ctrl.$isEmpty(viewValue);
+      };
+
+      attr.$observe('required', function() {
+        ctrl.$validate();
+      });
+    }
+  };
+};
+
+
+var patternDirective = function() {
+  return {
+    restrict: 'A',
+    require: '?ngModel',
+    link: function(scope, elm, attr, ctrl) {
+      if (!ctrl) return;
+
+      var regexp, patternExp = attr.ngPattern || attr.pattern;
+      attr.$observe('pattern', function(regex) {
+        if (isString(regex) && regex.length > 0) {
+          regex = new RegExp('^' + regex + '$');
+        }
+
+        if (regex && !regex.test) {
+          throw minErr('ngPattern')('noregexp',
+            'Expected {0} to be a RegExp but was {1}. Element: {2}', patternExp,
+            regex, startingTag(elm));
+        }
+
+        regexp = regex || undefined;
+        ctrl.$validate();
+      });
+
+      ctrl.$validators.pattern = function(modelValue, viewValue) {
+        // HTML5 pattern constraint validates the input value, so we validate the viewValue
+        return ctrl.$isEmpty(viewValue) || isUndefined(regexp) || regexp.test(viewValue);
+      };
+    }
+  };
+};
+
+
+var maxlengthDirective = function() {
+  return {
+    restrict: 'A',
+    require: '?ngModel',
+    link: function(scope, elm, attr, ctrl) {
+      if (!ctrl) return;
+
+      var maxlength = -1;
+      attr.$observe('maxlength', function(value) {
+        var intVal = toInt(value);
+        maxlength = isNaN(intVal) ? -1 : intVal;
+        ctrl.$validate();
+      });
+      ctrl.$validators.maxlength = function(modelValue, viewValue) {
+        return (maxlength < 0) || ctrl.$isEmpty(viewValue) || (viewValue.length <= maxlength);
+      };
+    }
+  };
+};
+
+var minlengthDirective = function() {
+  return {
+    restrict: 'A',
+    require: '?ngModel',
+    link: function(scope, elm, attr, ctrl) {
+      if (!ctrl) return;
+
+      var minlength = 0;
+      attr.$observe('minlength', function(value) {
+        minlength = toInt(value) || 0;
+        ctrl.$validate();
+      });
+      ctrl.$validators.minlength = function(modelValue, viewValue) {
+        return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;
+      };
+    }
+  };
+};
+
+if (window.angular.bootstrap) {
+  //AngularJS is already loaded, so we can return here...
+  console.log('WARNING: Tried to load angular more than once.');
+  return;
+}
+
+//try to bind to jquery now so that one can write jqLite(document).ready()
+//but we will rebind on bootstrap again.
+bindJQuery();
+
+publishExternalAPI(angular);
+
+angular.module("ngLocale", [], ["$provide", function($provide) {
+var PLURAL_CATEGORY = {ZERO: "zero", ONE: "one", TWO: "two", FEW: "few", MANY: "many", OTHER: "other"};
+function getDecimals(n) {
+  n = n + '';
+  var i = n.indexOf('.');
+  return (i == -1) ? 0 : n.length - i - 1;
+}
+
+function getVF(n, opt_precision) {
+  var v = opt_precision;
+
+  if (undefined === v) {
+    v = Math.min(getDecimals(n), 3);
+  }
+
+  var base = Math.pow(10, v);
+  var f = ((n * base) | 0) % base;
+  return {v: v, f: f};
+}
+
+$provide.value("$locale", {
+  "DATETIME_FORMATS": {
+    "AMPMS": [
+      "AM",
+      "PM"
+    ],
+    "DAY": [
+      "Sunday",
+      "Monday",
+      "Tuesday",
+      "Wednesday",
+      "Thursday",
+      "Friday",
+      "Saturday"
+    ],
+    "ERANAMES": [
+      "Before Christ",
+      "Anno Domini"
+    ],
+    "ERAS": [
+      "BC",
+      "AD"
+    ],
+    "FIRSTDAYOFWEEK": 6,
+    "MONTH": [
+      "January",
+      "February",
+      "March",
+      "April",
+      "May",
+      "June",
+      "July",
+      "August",
+      "September",
+      "October",
+      "November",
+      "December"
+    ],
+    "SHORTDAY": [
+      "Sun",
+      "Mon",
+      "Tue",
+      "Wed",
+      "Thu",
+      "Fri",
+      "Sat"
+    ],
+    "SHORTMONTH": [
+      "Jan",
+      "Feb",
+      "Mar",
+      "Apr",
+      "May",
+      "Jun",
+      "Jul",
+      "Aug",
+      "Sep",
+      "Oct",
+      "Nov",
+      "Dec"
+    ],
+    "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",
+  "pluralCat": function(n, opt_precision) {  var i = n | 0;  var vf = getVF(n, opt_precision);  if (i == 1 && vf.v == 0) {    return PLURAL_CATEGORY.ONE;  }  return PLURAL_CATEGORY.OTHER;}
+});
+}]);
+
+  jqLite(document).ready(function() {
+    angularInit(document, bootstrap);
+  });
+
+})(window, document);
+
+!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>');
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js
new file mode 100644
index 0000000..272101e
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js
@@ -0,0 +1,294 @@
+/*
+ AngularJS v1.4.7
+ (c) 2010-2015 Google, Inc. http://angularjs.org
+ License: MIT
+*/
+(function(Q,X,w){'use strict';function I(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.7/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Da(b){if(null==b||Za(b))return!1;var a="length"in Object(b)&&b.length;
+return b.nodeType===pa&&a?!0:G(b)||J(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function m(b,a,c){var d,e;if(b)if(x(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(J(b)||Da(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==m)b.forEach(a,c,b);else if(mc(b))for(d in b)a.call(c,b[d],d,b);else if("function"===typeof b.hasOwnProperty)for(d in b)b.hasOwnProperty(d)&&
+a.call(c,b[d],d,b);else for(d in b)ta.call(b,d)&&a.call(c,b[d],d,b);return b}function nc(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function oc(b){return function(a,c){b(c,a)}}function Ud(){return++nb}function pc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function Mb(b,a,c){for(var d=b.$$hashKey,e=0,f=a.length;e<f;++e){var h=a[e];if(C(h)||x(h))for(var g=Object.keys(h),l=0,k=g.length;l<k;l++){var n=g[l],p=h[n];c&&C(p)?ea(p)?b[n]=new Date(p.valueOf()):Oa(p)?
+b[n]=new RegExp(p):(C(b[n])||(b[n]=J(p)?[]:{}),Mb(b[n],[p],!0)):b[n]=p}}pc(b,d);return b}function P(b){return Mb(b,ua.call(arguments,1),!1)}function Vd(b){return Mb(b,ua.call(arguments,1),!0)}function Y(b){return parseInt(b,10)}function Nb(b,a){return P(Object.create(b),a)}function y(){}function $a(b){return b}function qa(b){return function(){return b}}function qc(b){return x(b.toString)&&b.toString!==Object.prototype.toString}function v(b){return"undefined"===typeof b}function A(b){return"undefined"!==
+typeof b}function C(b){return null!==b&&"object"===typeof b}function mc(b){return null!==b&&"object"===typeof b&&!rc(b)}function G(b){return"string"===typeof b}function V(b){return"number"===typeof b}function ea(b){return"[object Date]"===va.call(b)}function x(b){return"function"===typeof b}function Oa(b){return"[object RegExp]"===va.call(b)}function Za(b){return b&&b.window===b}function ab(b){return b&&b.$evalAsync&&b.$watch}function bb(b){return"boolean"===typeof b}function sc(b){return!(!b||!(b.nodeName||
+b.prop&&b.attr&&b.find))}function Wd(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function wa(b){return F(b.nodeName||b[0]&&b[0].nodeName)}function cb(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return c}function ha(b,a,c,d){if(Za(b)||ab(b))throw Ea("cpws");if(tc.test(va.call(a)))throw Ea("cpta");if(a){if(b===a)throw Ea("cpi");c=c||[];d=d||[];C(b)&&(c.push(b),d.push(a));var e;if(J(b))for(e=a.length=0;e<b.length;e++)a.push(ha(b[e],null,c,d));else{var f=a.$$hashKey;J(a)?
+a.length=0:m(a,function(b,c){delete a[c]});if(mc(b))for(e in b)a[e]=ha(b[e],null,c,d);else if(b&&"function"===typeof b.hasOwnProperty)for(e in b)b.hasOwnProperty(e)&&(a[e]=ha(b[e],null,c,d));else for(e in b)ta.call(b,e)&&(a[e]=ha(b[e],null,c,d));pc(a,f)}}else if(a=b,C(b)){if(c&&-1!==(f=c.indexOf(b)))return d[f];if(J(b))return ha(b,[],c,d);if(tc.test(va.call(b)))a=new b.constructor(b);else if(ea(b))a=new Date(b.getTime());else if(Oa(b))a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=
+b.lastIndex;else if(x(b.cloneNode))a=b.cloneNode(!0);else return e=Object.create(rc(b)),ha(b,e,c,d);d&&(c.push(b),d.push(a))}return a}function ja(b,a){if(J(b)){a=a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(C(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function ka(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(J(b)){if(!J(a))return!1;if((c=b.length)==a.length){for(d=0;d<
+c;d++)if(!ka(b[d],a[d]))return!1;return!0}}else{if(ea(b))return ea(a)?ka(b.getTime(),a.getTime()):!1;if(Oa(b))return Oa(a)?b.toString()==a.toString():!1;if(ab(b)||ab(a)||Za(b)||Za(a)||J(a)||ea(a)||Oa(a))return!1;c=fa();for(d in b)if("$"!==d.charAt(0)&&!x(b[d])){if(!ka(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!(d in c)&&"$"!==d.charAt(0)&&A(a[d])&&!x(a[d]))return!1;return!0}return!1}function db(b,a,c){return b.concat(ua.call(a,c))}function uc(b,a){var c=2<arguments.length?ua.call(arguments,2):[];
+return!x(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,db(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}}function Xd(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=w:Za(a)?c="$WINDOW":a&&X===a?c="$DOCUMENT":ab(a)&&(c="$SCOPE");return c}function eb(b,a){if("undefined"===typeof b)return w;V(a)||(a=a?2:null);return JSON.stringify(b,Xd,a)}function vc(b){return G(b)?JSON.parse(b):b}function wc(b,
+a){var c=Date.parse("Jan 01, 1970 00:00:00 "+b)/6E4;return isNaN(c)?a:c}function Ob(b,a,c){c=c?-1:1;var d=wc(a,b.getTimezoneOffset());a=b;b=c*(d-b.getTimezoneOffset());a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function xa(b){b=B(b).clone();try{b.empty()}catch(a){}var c=B("<div>").append(b).html();try{return b[0].nodeType===Pa?F(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+F(b)})}catch(d){return F(c)}}function xc(b){try{return decodeURIComponent(b)}catch(a){}}
+function yc(b){var a={};m((b||"").split("&"),function(b){var d,e,f;b&&(e=b=b.replace(/\+/g,"%20"),d=b.indexOf("="),-1!==d&&(e=b.substring(0,d),f=b.substring(d+1)),e=xc(e),A(e)&&(f=A(f)?xc(f):!0,ta.call(a,e)?J(a[e])?a[e].push(f):a[e]=[a[e],f]:a[e]=f))});return a}function Pb(b){var a=[];m(b,function(b,d){J(b)?m(b,function(b){a.push(la(d,!0)+(!0===b?"":"="+la(b,!0)))}):a.push(la(d,!0)+(!0===b?"":"="+la(b,!0)))});return a.length?a.join("&"):""}function ob(b){return la(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,
+"=").replace(/%2B/gi,"+")}function la(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}function Yd(b,a){var c,d,e=Qa.length;for(d=0;d<e;++d)if(c=Qa[d]+a,G(c=b.getAttribute(c)))return c;return null}function Zd(b,a){var c,d,e={};m(Qa,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});m(Qa,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":",
+"\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Yd(c,"strict-di"),a(c,d?[d]:[],e))}function zc(b,a,c){C(c)||(c={});c=P({strictDi:!1},c);var d=function(){b=B(b);if(b.injector()){var d=b[0]===X?"document":xa(b);throw Ea("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=fb(a,c.strictDi);d.invoke(["$rootScope",
+"$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;Q&&e.test(Q.name)&&(c.debugInfoEnabled=!0,Q.name=Q.name.replace(e,""));if(Q&&!f.test(Q.name))return d();Q.name=Q.name.replace(f,"");da.resumeBootstrap=function(b){m(b,function(b){a.push(b)});return d()};x(da.resumeDeferredBootstrap)&&da.resumeDeferredBootstrap()}function $d(){Q.name="NG_ENABLE_DEBUG_INFO!"+Q.name;Q.location.reload()}
+function ae(b){b=da.element(b).injector();if(!b)throw Ea("test");return b.get("$$testability")}function Ac(b,a){a=a||"_";return b.replace(be,function(b,d){return(d?a:"")+b.toLowerCase()})}function ce(){var b;if(!Bc){var a=pb();(ra=v(a)?Q.jQuery:a?Q[a]:w)&&ra.fn.on?(B=ra,P(ra.fn,{scope:Ra.scope,isolateScope:Ra.isolateScope,controller:Ra.controller,injector:Ra.injector,inheritedData:Ra.inheritedData}),b=ra.cleanData,ra.cleanData=function(a){var d;if(Qb)Qb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=
+ra._data(f,"events"))&&d.$destroy&&ra(f).triggerHandler("$destroy");b(a)}):B=R;da.element=B;Bc=!0}}function qb(b,a,c){if(!b)throw Ea("areq",a||"?",c||"required");return b}function Sa(b,a,c){c&&J(b)&&(b=b[b.length-1]);qb(x(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Ta(b,a){if("hasOwnProperty"===b)throw Ea("badname",a);}function Cc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,h=0;h<f;h++)d=a[h],b&&(b=(e=b)[d]);return!c&&
+x(b)?uc(e,b):b}function rb(b){for(var a=b[0],c=b[b.length-1],d,e=1;a!==c&&(a=a.nextSibling);e++)if(d||b[e]!==a)d||(d=B(ua.call(b,0,e))),d.push(a);return d||b}function fa(){return Object.create(null)}function de(b){function a(a,b,c){return a[b]||(a[b]=c())}var c=I("$injector"),d=I("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||I;return a(b,"module",function(){var b={};return function(f,h,g){if("hasOwnProperty"===f)throw d("badname","module");h&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(b,
+c,e,f){f||(f=d);return function(){f[e||"push"]([b,c,arguments]);return E}}function b(a,c){return function(b,e){e&&x(e)&&(e.$$moduleName=f);d.push([a,c,arguments]);return E}}if(!h)throw c("nomod",f);var d=[],e=[],r=[],t=a("$injector","invoke","push",e),E={_invokeQueue:d,_configBlocks:e,_runBlocks:r,requires:h,name:f,provider:b("$provide","provider"),factory:b("$provide","factory"),service:b("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:b("$provide",
+"decorator"),animation:b("$animateProvider","register"),filter:b("$filterProvider","register"),controller:b("$controllerProvider","register"),directive:b("$compileProvider","directive"),config:t,run:function(a){r.push(a);return this}};g&&t(g);return E})}})}function ee(b){P(b,{bootstrap:zc,copy:ha,extend:P,merge:Vd,equals:ka,element:B,forEach:m,injector:fb,noop:y,bind:uc,toJson:eb,fromJson:vc,identity:$a,isUndefined:v,isDefined:A,isString:G,isFunction:x,isObject:C,isNumber:V,isElement:sc,isArray:J,
+version:fe,isDate:ea,lowercase:F,uppercase:sb,callbacks:{counter:0},getTestability:ae,$$minErr:I,$$csp:Fa,reloadWithDebugInfo:$d});Rb=de(Q);Rb("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ge});a.provider("$compile",Dc).directive({a:he,input:Ec,textarea:Ec,form:ie,script:je,select:ke,style:le,option:me,ngBind:ne,ngBindHtml:oe,ngBindTemplate:pe,ngClass:qe,ngClassEven:re,ngClassOdd:se,ngCloak:te,ngController:ue,ngForm:ve,ngHide:we,ngIf:xe,ngInclude:ye,ngInit:ze,ngNonBindable:Ae,
+ngPluralize:Be,ngRepeat:Ce,ngShow:De,ngStyle:Ee,ngSwitch:Fe,ngSwitchWhen:Ge,ngSwitchDefault:He,ngOptions:Ie,ngTransclude:Je,ngModel:Ke,ngList:Le,ngChange:Me,pattern:Fc,ngPattern:Fc,required:Gc,ngRequired:Gc,minlength:Hc,ngMinlength:Hc,maxlength:Ic,ngMaxlength:Ic,ngValue:Ne,ngModelOptions:Oe}).directive({ngInclude:Pe}).directive(tb).directive(Jc);a.provider({$anchorScroll:Qe,$animate:Re,$animateCss:Se,$$animateQueue:Te,$$AnimateRunner:Ue,$browser:Ve,$cacheFactory:We,$controller:Xe,$document:Ye,$exceptionHandler:Ze,
+$filter:Kc,$$forceReflow:$e,$interpolate:af,$interval:bf,$http:cf,$httpParamSerializer:df,$httpParamSerializerJQLike:ef,$httpBackend:ff,$xhrFactory:gf,$location:hf,$log:jf,$parse:kf,$rootScope:lf,$q:mf,$$q:nf,$sce:of,$sceDelegate:pf,$sniffer:qf,$templateCache:rf,$templateRequest:sf,$$testability:tf,$timeout:uf,$window:vf,$$rAF:wf,$$jqLite:xf,$$HashMap:yf,$$cookieReader:zf})}])}function gb(b){return b.replace(Af,function(a,b,d,e){return e?d.toUpperCase():d}).replace(Bf,"Moz$1")}function Lc(b){b=b.nodeType;
+return b===pa||!b||9===b}function Mc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Sb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(Cf.exec(b)||["",""])[1].toLowerCase();d=ma[d]||ma._default;c.innerHTML=d[1]+b.replace(Df,"<$1></$2>")+d[2];for(d=d[0];d--;)c=c.lastChild;f=db(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";m(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;G(b)&&(b=T(b),
+a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Tb("nosel");return new R(b)}if(a){a=X;var c;b=(c=Ef.exec(b))?[a.createElement(c[1])]:(c=Mc(b,a))?c.childNodes:[]}Nc(this,b)}function Ub(b){return b.cloneNode(!0)}function ub(b,a){a||vb(b);if(b.querySelectorAll)for(var c=b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)vb(c[d])}function Oc(b,a,c,d){if(A(d))throw Tb("offargs");var e=(d=wb(b))&&d.events,f=d&&d.handle;if(f)if(a)m(a.split(" "),function(a){if(A(c)){var d=e[a];cb(d||[],c);if(d&&0<
+d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function vb(b,a){var c=b.ng339,d=c&&hb[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Oc(b)),delete hb[c],b.ng339=w))}function wb(b,a){var c=b.ng339,c=c&&hb[c];a&&!c&&(b.ng339=c=++Ff,c=hb[c]={events:{},data:{},handle:w});return c}function Vb(b,a,c){if(Lc(b)){var d=A(c),e=!d&&a&&!C(a),f=!a;b=(b=wb(b,!e))&&b.data;if(d)b[a]=c;else{if(f)return b;
+if(e)return b&&b[a];P(b,a)}}}function xb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function yb(b,a){a&&b.setAttribute&&m(a.split(" "),function(a){b.setAttribute("class",T((" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").replace(" "+T(a)+" "," ")))})}function zb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");m(a.split(" "),function(a){a=T(a);-1===c.indexOf(" "+a+" ")&&
+(c+=a+" ")});b.setAttribute("class",T(c))}}function Nc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Pc(b,a){return Ab(b,"$"+(a||"ngController")+"Controller")}function Ab(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=J(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if(A(c=B.data(b,a[d])))return c;b=b.parentNode||11===b.nodeType&&b.host}}function Qc(b){for(ub(b,!0);b.firstChild;)b.removeChild(b.firstChild)}
+function Wb(b,a){a||ub(b);var c=b.parentNode;c&&c.removeChild(b)}function Gf(b,a){a=a||Q;if("complete"===a.document.readyState)a.setTimeout(b);else B(a).on("load",b)}function Rc(b,a){var c=Bb[a.toLowerCase()];return c&&Sc[wa(b)]&&c}function Hf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],h=f?f.length:0;if(h){if(v(c.immediatePropagationStopped)){var g=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=
+!0;c.stopPropagation&&c.stopPropagation();g&&g.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};1<h&&(f=ja(f));for(var l=0;l<h;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function xf(){this.$get=function(){return P(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return xb(b,a)},addClass:function(b,a){b.attr&&(b=b[0]);return zb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return yb(b,a)}})}}function Ga(b,a){var c=b&&b.$$hashKey;
+if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Ud)():c+":"+b}function Ua(b,a){if(a){var c=0;this.nextUid=function(){return++c}}m(b,this.put,this)}function If(b){return(b=b.toString().replace(Tc,"").match(Uc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function fb(b,a){function c(a){return function(b,c){if(C(b))m(b,oc(a));else return a(b,c)}}function d(a,b){Ta(a,"service");if(x(b)||J(b))b=r.instantiate(b);
+if(!b.$get)throw Ha("pget",a);return p[a+"Provider"]=b}function e(a,b){return function(){var c=E.invoke(b,this);if(v(c))throw Ha("undef",a);return c}}function f(a,b,c){return d(a,{$get:!1!==c?e(a,b):b})}function h(a){qb(v(a)||J(a),"modulesToLoad","not an array");var b=[],c;m(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{G(a)?(c=Rb(a),b=b.concat(h(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):
+x(a)?b.push(r.invoke(a)):J(a)?b.push(r.invoke(a)):Sa(a,"module")}catch(e){throw J(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ha("modulerr",a,e.stack||e.message||e);}}});return b}function g(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ha("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=
+f,f=null);var h=[],k=fb.$$annotate(b,a,g),l,r,p;r=0;for(l=k.length;r<l;r++){p=k[r];if("string"!==typeof p)throw Ha("itkn",p);h.push(f&&f.hasOwnProperty(p)?f[p]:d(p,g))}J(b)&&(b=b[l]);return b.apply(c,h)}return{invoke:e,instantiate:function(a,b,c){var d=Object.create((J(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return C(a)||x(a)?a:d},get:d,annotate:fb.$$annotate,has:function(a){return p.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],n=new Ua([],!0),p={$provide:{provider:c(d),
+factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:c(function(a,b){return f(a,qa(b),!1)}),constant:c(function(a,b){Ta(a,"constant");p[a]=b;t[a]=b}),decorator:function(a,b){var c=r.get(a+"Provider"),d=c.$get;c.$get=function(){var a=E.invoke(d,c);return E.invoke(b,null,{$delegate:a})}}}},r=p.$injector=g(p,function(a,b){da.isString(b)&&k.push(b);throw Ha("unpr",k.join(" <- "));}),t={},E=t.$injector=g(t,function(a,b){var c=r.get(a+"Provider",b);
+return E.invoke(c.$get,c,w,a)});m(h(b),function(a){a&&E.invoke(a)});return E}function Qe(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=null;Array.prototype.some.call(a,function(a){if("a"===wa(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=h.yOffset;x(c)?c=c():sc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):V(c)||(c=0);c&&(b=b.getBoundingClientRect().top,
+a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function h(a){a=G(a)?a:c.hash();var b;a?(b=g.getElementById(a))?f(b):(b=e(g.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var g=a.document;b&&d.$watch(function(){return c.hash()},function(a,b){a===b&&""===a||Gf(function(){d.$evalAsync(h)})});return h}]}function ib(b,a){if(!b&&!a)return"";if(!b)return a;if(!a)return b;J(b)&&(b=b.join(" "));J(a)&&(a=a.join(" "));return b+" "+a}function Jf(b){G(b)&&(b=b.split(" "));var a=fa();m(b,function(b){b.length&&
+(a[b]=!0)});return a}function Ia(b){return C(b)?b:{}}function Kf(b,a,c,d){function e(a){try{a.apply(null,ua.call(arguments,1))}finally{if(E--,0===E)for(;K.length;)try{K.pop()()}catch(b){c.error(b)}}}function f(){ia=null;h();g()}function h(){a:{try{u=n.state;break a}catch(a){}u=void 0}u=v(u)?null:u;ka(u,L)&&(u=L);L=u}function g(){if(z!==l.url()||q!==u)z=l.url(),q=u,m(O,function(a){a(l.url(),u)})}var l=this,k=b.location,n=b.history,p=b.setTimeout,r=b.clearTimeout,t={};l.isMock=!1;var E=0,K=[];l.$$completeOutstandingRequest=
+e;l.$$incOutstandingRequestCount=function(){E++};l.notifyWhenNoOutstandingRequests=function(a){0===E?a():K.push(a)};var u,q,z=k.href,N=a.find("base"),ia=null;h();q=u;l.url=function(a,c,e){v(e)&&(e=null);k!==b.location&&(k=b.location);n!==b.history&&(n=b.history);if(a){var f=q===e;if(z===a&&(!d.history||f))return l;var g=z&&Ja(z)===Ja(a);z=a;q=e;if(!d.history||g&&f){if(!g||ia)ia=a;c?k.replace(a):g?(c=k,e=a.indexOf("#"),e=-1===e?"":a.substr(e),c.hash=e):k.href=a;k.href!==a&&(ia=a)}else n[c?"replaceState":
+"pushState"](e,"",a),h(),q=u;return l}return ia||k.href.replace(/%27/g,"'")};l.state=function(){return u};var O=[],H=!1,L=null;l.onUrlChange=function(a){if(!H){if(d.history)B(b).on("popstate",f);B(b).on("hashchange",f);H=!0}O.push(a);return a};l.$$applicationDestroyed=function(){B(b).off("hashchange popstate",f)};l.$$checkUrlChange=g;l.baseHref=function(){var a=N.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};l.defer=function(a,b){var c;E++;c=p(function(){delete t[c];e(a)},b||0);
+t[c]=!0;return c};l.defer.cancel=function(a){return t[a]?(delete t[a],r(a),e(y),!0):!1}}function Ve(){this.$get=["$window","$log","$sniffer","$document",function(b,a,c,d){return new Kf(b,d,a,c)}]}function We(){this.$get=function(){function b(b,d){function e(a){a!=p&&(r?r==a&&(r=a.n):r=a,f(a.n,a.p),f(a,p),p=a,p.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw I("$cacheFactory")("iid",b);var h=0,g=P({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,n={},p=null,r=null;return a[b]=
+{put:function(a,b){if(!v(b)){if(k<Number.MAX_VALUE){var c=n[a]||(n[a]={key:a});e(c)}a in l||h++;l[a]=b;h>k&&this.remove(r.key);return b}},get:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=n[a];if(!b)return;b==p&&(p=b.p);b==r&&(r=b.n);f(b.n,b.p);delete n[a]}delete l[a];h--},removeAll:function(){l={};h=0;n={};p=r=null},destroy:function(){n=g=l=null;delete a[b]},info:function(){return P({},g,{size:h})}}}var a={};b.info=function(){var b=
+{};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function rf(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Dc(b,a){function c(a,b,c){var d=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,e={};m(a,function(a,f){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}});return e}function d(a){var b=a.charAt(0);if(!b||
+b!==F(b))throw ga("baddir",a);if(a!==a.trim())throw ga("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,h=/(([\w\-]+)(?:\:([^;]+))?;?)/,g=Wd("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function r(a,f){Ta(a,"directive");G(a)?(d(a),qb(f,"directiveFactory"),e.hasOwnProperty(a)||(e[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,d){var f=[];m(e[a],function(e,g){try{var h=b.invoke(e);x(h)?h={compile:qa(h)}:
+!h.compile&&h.link&&(h.compile=qa(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||a;h.require=h.require||h.controller&&h.name;h.restrict=h.restrict||"EA";var k=h,l=h,r=h.name,n={isolateScope:null,bindToController:null};C(l.scope)&&(!0===l.bindToController?(n.bindToController=c(l.scope,r,!0),n.isolateScope={}):n.isolateScope=c(l.scope,r,!1));C(l.bindToController)&&(n.bindToController=c(l.bindToController,r,!0));if(C(n.bindToController)){var S=l.controller,E=l.controllerAs;if(!S)throw ga("noctrl",
+r);var ca;a:if(E&&G(E))ca=E;else{if(G(S)){var m=Vc.exec(S);if(m){ca=m[3];break a}}ca=void 0}if(!ca)throw ga("noident",r);}var s=k.$$bindings=n;C(s.isolateScope)&&(h.$$isolateBindings=s.isolateScope);h.$$moduleName=e.$$moduleName;f.push(h)}catch(w){d(w)}});return f}])),e[a].push(f)):m(a,oc(r));return this};this.aHrefSanitizationWhitelist=function(b){return A(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a.imgSrcSanitizationWhitelist(b),
+this):a.imgSrcSanitizationWhitelist()};var n=!0;this.debugInfoEnabled=function(a){return A(a)?(n=a,this):n};this.$get=["$injector","$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,d,u,q,z,N,ia,O,H){function L(a,b){try{a.addClass(b)}catch(c){}}function W(a,b,c,d,e){a instanceof B||(a=B(a));m(a,function(b,c){b.nodeType==Pa&&b.nodeValue.match(/\S+/)&&(a[c]=B(b).wrap("<span></span>").parent()[0])});var f=
+S(a,b,a,c,d,e);W.$$addScopeClass(a);var g=null;return function(b,c,d){qb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==wa(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?B(Xb(g,B("<div>").append(a).html())):c?Ra.clone.call(a):a;if(h)for(var k in h)d.data("$"+k+"Controller",h[k].instance);W.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function S(a,
+b,c,d,e,f){function g(a,c,d,e){var f,k,l,r,n,t,O;if(q)for(O=Array(c.length),r=0;r<h.length;r+=3)f=h[r],O[f]=c[f];else O=c;r=0;for(n=h.length;r<n;)if(k=O[h[r++]],c=h[r++],f=h[r++],c){if(c.scope){if(l=a.$new(),W.$$addScopeInfo(B(k),l),t=c.$$destroyBindings)c.$$destroyBindings=null,l.$on("$destroyed",t)}else l=a;t=c.transcludeOnThisElement?ba(a,c.transclude,e):!c.templateOnThisElement&&e?e:!e&&b?ba(a,b):null;c(f,l,k,d,t,c)}else f&&f(a,k.childNodes,w,e)}for(var h=[],k,l,r,n,q,t=0;t<a.length;t++){k=new Z;
+l=ca(a[t],[],k,0===t?d:w,e);(f=l.length?D(l,a[t],k,b,c,null,[],[],f):null)&&f.scope&&W.$$addScopeClass(k.$$element);k=f&&f.terminal||!(r=a[t].childNodes)||!r.length?null:S(r,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||k)h.push(t,f,k),n=!0,q=q||f;f=null}return n?g:null}function ba(a,b,c){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function ca(a,b,c,d,e){var g=
+c.$attr,k;switch(a.nodeType){case pa:na(b,ya(wa(a)),"E",d,e);for(var l,r,n,q=a.attributes,t=0,O=q&&q.length;t<O;t++){var K=!1,H=!1;l=q[t];k=l.name;r=T(l.value);l=ya(k);if(n=ja.test(l))k=k.replace(Wc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var S=l.replace(/(Start|End)$/,"");I(S)&&l===S+"Start"&&(K=k,H=k.substr(0,k.length-5)+"end",k=k.substr(0,k.length-6));l=ya(k.toLowerCase());g[l]=k;if(n||!c.hasOwnProperty(l))c[l]=r,Rc(a,l)&&(c[l]=!0);V(a,b,r,l,n);na(b,l,"A",d,e,K,H)}a=
+a.className;C(a)&&(a=a.animVal);if(G(a)&&""!==a)for(;k=h.exec(a);)l=ya(k[2]),na(b,l,"C",d,e)&&(c[l]=T(k[3])),a=a.substr(k.index+k[0].length);break;case Pa:if(11===Wa)for(;a.parentNode&&a.nextSibling&&a.nextSibling.nodeType===Pa;)a.nodeValue+=a.nextSibling.nodeValue,a.parentNode.removeChild(a.nextSibling);Ka(b,a.nodeValue);break;case 8:try{if(k=f.exec(a.nodeValue))l=ya(k[1]),na(b,l,"M",d,e)&&(c[l]=T(k[2]))}catch(E){}}b.sort(M);return b}function za(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ga("uterdir",
+b,c);a.nodeType==pa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return B(d)}function s(a,b,c){return function(d,e,f,g,h){e=za(e[0],b,c);return a(d,e,f,g,h)}}function D(a,b,d,e,f,g,h,k,r){function n(a,b,c,d){if(a){c&&(a=s(a,c,d));a.require=D.require;a.directiveName=y;if(u===D||D.$$isolateScope)a=$(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=s(b,c,d));b.require=D.require;b.directiveName=y;if(u===D||D.$$isolateScope)b=$(b,{isolateScope:!0});k.push(b)}}
+function t(a,b,c,d){var e;if(G(b)){var f=b.match(l);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;e||(d="$"+b+"Controller",e=g?c.inheritedData(d):c.data(d));if(!e&&!f)throw ga("ctreq",b,a);}else if(J(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=t(a,b[g],c,d);return e||null}function O(a,b,c,d,e,f){var g=fa(),h;for(h in d){var k=d[h],l={$scope:k===u||k.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},r=k.controller;"@"==r&&(r=b[k.name]);l=q(r,
+l,!0,k.controllerAs);g[k.name]=l;ia||a.data("$"+k.name+"Controller",l.instance)}return g}function K(a,c,e,f,g,l){function r(a,b,c){var d;ab(a)||(c=b,b=a,a=w);ia&&(d=ca);c||(c=ia?N.parent():N);return g(a,b,d,c,za)}var n,q,H,E,ca,z,N;b===e?(f=d,N=d.$$element):(N=B(e),f=new Z(N,d));u&&(E=c.$new(!0));g&&(z=r,z.$$boundTransclude=g);ba&&(ca=O(N,f,z,ba,E,c));u&&(W.$$addScopeInfo(N,E,!0,!(L&&(L===u||L===u.$$originalDirective))),W.$$addScopeClass(N,!0),E.$$isolateBindings=u.$$isolateBindings,Y(c,f,E,E.$$isolateBindings,
+u,E));if(ca){var Va=u||S,m;Va&&ca[Va.name]&&(q=Va.$$bindings.bindToController,(H=ca[Va.name])&&H.identifier&&q&&(m=H,l.$$destroyBindings=Y(c,f,H.instance,q,Va)));for(n in ca){H=ca[n];var D=H();D!==H.instance&&(H.instance=D,N.data("$"+n+"Controller",D),H===m&&(l.$$destroyBindings(),l.$$destroyBindings=Y(c,f,D,q,Va)))}}n=0;for(l=h.length;n<l;n++)q=h[n],aa(q,q.isolateScope?E:c,N,f,q.require&&t(q.directiveName,q.require,N,ca),z);var za=c;u&&(u.template||null===u.templateUrl)&&(za=E);a&&a(za,e.childNodes,
+w,g);for(n=k.length-1;0<=n;n--)q=k[n],aa(q,q.isolateScope?E:c,N,f,q.require&&t(q.directiveName,q.require,N,ca),z)}r=r||{};for(var H=-Number.MAX_VALUE,S=r.newScopeDirective,ba=r.controllerDirectives,u=r.newIsolateScopeDirective,L=r.templateDirective,z=r.nonTlbTranscludeDirective,N=!1,m=!1,ia=r.hasElementTranscludeDirective,v=d.$$element=B(b),D,y,M,Ka=e,na,I=0,F=a.length;I<F;I++){D=a[I];var P=D.$$start,R=D.$$end;P&&(v=za(b,P,R));M=w;if(H>D.priority)break;if(M=D.scope)D.templateUrl||(C(M)?(Q("new/isolated scope",
+u||S,D,v),u=D):Q("new/isolated scope",u,D,v)),S=S||D;y=D.name;!D.templateUrl&&D.controller&&(M=D.controller,ba=ba||fa(),Q("'"+y+"' controller",ba[y],D,v),ba[y]=D);if(M=D.transclude)N=!0,D.$$tlb||(Q("transclusion",z,D,v),z=D),"element"==M?(ia=!0,H=D.priority,M=v,v=d.$$element=B(X.createComment(" "+y+": "+d[y]+" ")),b=v[0],U(f,ua.call(M,0),b),Ka=W(M,e,H,g&&g.name,{nonTlbTranscludeDirective:z})):(M=B(Ub(b)).contents(),v.empty(),Ka=W(M,e));if(D.template)if(m=!0,Q("template",L,D,v),L=D,M=x(D.template)?
+D.template(v,d):D.template,M=ha(M),D.replace){g=D;M=Sb.test(M)?Xc(Xb(D.templateNamespace,T(M))):[];b=M[0];if(1!=M.length||b.nodeType!==pa)throw ga("tplrt",y,"");U(f,v,b);F={$attr:{}};M=ca(b,[],F);var Lf=a.splice(I+1,a.length-(I+1));u&&A(M);a=a.concat(M).concat(Lf);Yc(d,F);F=a.length}else v.html(M);if(D.templateUrl)m=!0,Q("template",L,D,v),L=D,D.replace&&(g=D),K=Mf(a.splice(I,a.length-I),v,d,f,N&&Ka,h,k,{controllerDirectives:ba,newScopeDirective:S!==D&&S,newIsolateScopeDirective:u,templateDirective:L,
+nonTlbTranscludeDirective:z}),F=a.length;else if(D.compile)try{na=D.compile(v,d,Ka),x(na)?n(null,na,P,R):na&&n(na.pre,na.post,P,R)}catch(V){c(V,xa(v))}D.terminal&&(K.terminal=!0,H=Math.max(H,D.priority))}K.scope=S&&!0===S.scope;K.transcludeOnThisElement=N;K.templateOnThisElement=m;K.transclude=Ka;r.hasElementTranscludeDirective=ia;return K}function A(a){for(var b=0,c=a.length;b<c;b++)a[b]=Nb(a[b],{$$isolateScope:!0})}function na(b,d,f,g,h,k,l){if(d===h)return null;h=null;if(e.hasOwnProperty(d)){var n;
+d=a.get(d+"Directive");for(var q=0,t=d.length;q<t;q++)try{n=d[q],(v(g)||g>n.priority)&&-1!=n.restrict.indexOf(f)&&(k&&(n=Nb(n,{$$start:k,$$end:l})),b.push(n),h=n)}catch(H){c(H)}}return h}function I(b){if(e.hasOwnProperty(b))for(var c=a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function Yc(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,f){"class"==
+f?(L(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 Mf(a,b,c,e,f,g,h,k){var l=[],r,n,q=b[0],t=a.shift(),H=Nb(t,{templateUrl:null,transclude:null,replace:null,$$originalDirective:t}),O=x(t.templateUrl)?t.templateUrl(b,c):t.templateUrl,E=t.templateNamespace;b.empty();d(O).then(function(d){var K,u;d=ha(d);if(t.replace){d=Sb.test(d)?Xc(Xb(E,T(d))):
+[];K=d[0];if(1!=d.length||K.nodeType!==pa)throw ga("tplrt",t.name,O);d={$attr:{}};U(e,b,K);var z=ca(K,[],d);C(t.scope)&&A(z);a=z.concat(a);Yc(c,d)}else K=q,b.html(d);a.unshift(H);r=D(a,K,c,f,b,t,g,h,k);m(e,function(a,c){a==K&&(e[c]=b[0])});for(n=S(b[0].childNodes,f);l.length;){d=l.shift();u=l.shift();var N=l.shift(),W=l.shift(),z=b[0];if(!d.$$destroyed){if(u!==q){var za=u.className;k.hasElementTranscludeDirective&&t.replace||(z=Ub(K));U(N,B(u),z);L(B(z),za)}u=r.transcludeOnThisElement?ba(d,r.transclude,
+W):W;r(n,d,z,e,u,r)}}l=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(l?l.push(b,c,d,a):(r.transcludeOnThisElement&&(a=ba(b,r.transclude,e)),r(n,b,c,d,a,r)))}}function M(a,b){var c=b.priority-a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function Q(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,xa(d));}function Ka(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=
+a.parent();var b=!!a.length;b&&W.$$addBindingClass(a);return function(a,c){var e=c.parent();b||W.$$addBindingClass(e);W.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Xb(a,b){a=F(a||"html");switch(a){case "svg":case "math":var c=X.createElement("div");c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return ia.HTML;var c=wa(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||
+"ngSrc"==b))return ia.RESOURCE_URL}function V(a,c,d,e,f){var h=R(a,e);f=g[e]||f;var l=b(d,!0,h,f);if(l){if("multiple"===e&&"select"===wa(a))throw ga("selmulti",xa(a));c.push({priority:100,compile:function(){return{pre:function(a,c,g){c=g.$$observers||(g.$$observers=fa());if(k.test(e))throw ga("nodomevents");var r=g[e];r!==d&&(l=r&&b(r,!0,h,f),d=r);l&&(g[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(g.$$observers&&g.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?g.$updateClass(a,b):g.$set(e,
+a)}))}}}})}}function U(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=c);break}f&&f.replaceChild(c,d);a=X.createDocumentFragment();a.appendChild(d);B.hasData(d)&&(B(c).data(B(d).data()),ra?(Qb=!0,ra.cleanData([d])):delete B.cache[d[B.expando]]);d=1;for(e=b.length;d<e;d++)f=b[d],B(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function $(a,
+b){return P(function(){return a.apply(null,arguments)},a,b)}function aa(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,xa(d))}}function Y(a,c,d,e,f,g){var h;m(e,function(e,g){var k=e.attrName,l=e.optional,r,n,q,K;switch(e.mode){case "@":l||ta.call(c,k)||(d[g]=c[k]=void 0);c.$observe(k,function(a){G(a)&&(d[g]=a)});c.$$observers[k].$$scope=a;G(c[k])&&(d[g]=b(c[k])(a));break;case "=":if(!ta.call(c,k)){if(l)break;c[k]=void 0}if(l&&!c[k])break;n=u(c[k]);K=n.literal?ka:function(a,b){return a===b||a!==a&&b!==
+b};q=n.assign||function(){r=d[g]=n(a);throw ga("nonassign",c[k],f.name);};r=d[g]=n(a);l=function(b){K(b,d[g])||(K(b,r)?q(a,b=d[g]):d[g]=b);return r=b};l.$stateful=!0;l=e.collection?a.$watchCollection(c[k],l):a.$watch(u(c[k],l),null,n.literal);h=h||[];h.push(l);break;case "&":n=c.hasOwnProperty(k)?u(c[k]):y;if(n===y&&l)break;d[g]=function(b){return n(a,b)}}});e=h?function(){for(var a=0,b=h.length;a<b;++a)h[a]()}:y;return g&&e!==y?(g.$on("$destroy",e),y):e}var Z=function(a,b){if(b){var c=Object.keys(b),
+d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a};Z.prototype={$normalize:ya,$addClass:function(a){a&&0<a.length&&O.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&O.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=Zc(a,b);c&&c.length&&O.addClass(this.$$element,c);(c=Zc(b,a))&&c.length&&O.removeClass(this.$$element,c)},$set:function(a,b,d,e){var f=Rc(this.$$element[0],a),g=$c[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=Ac(a,"-"));f=wa(this.$$element);if("a"===f&&"href"===a||"img"===f&&"src"===a)this[a]=b=H(b,"src"===a);else if("img"===f&&"srcset"===a){for(var f="",g=T(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 r=2*l,f=f+H(T(g[r]),!0),f=f+(" "+T(g[r+1]));g=T(g[2*l]).split(/\s/);f+=H(T(g[0]),!0);2===g.length&&(f+=" "+T(g[1]));this[a]=b=f}!1!==d&&(null===b||v(b)?this.$$element.removeAttr(e):
+this.$$element.attr(e,b));(a=this.$$observers)&&m(a[h],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=fa()),e=d[a]||(d[a]=[]);e.push(b);z.$evalAsync(function(){e.$$inter||!c.hasOwnProperty(a)||v(c[a])||b(c[a])});return function(){cb(e,b)}}};var da=b.startSymbol(),ea=b.endSymbol(),ha="{{"==da||"}}"==ea?$a:function(a){return a.replace(/\{\{/g,da).replace(/}}/g,ea)},ja=/^ngAttr[A-Z]/;W.$$addBindingInfo=n?function(a,b){var c=a.data("$binding")||
+[];J(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:y;W.$$addBindingClass=n?function(a){L(a,"ng-binding")}:y;W.$$addScopeInfo=n?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:y;W.$$addScopeClass=n?function(a,b){L(a,b?"ng-isolate-scope":"ng-scope")}:y;return W}]}function ya(b){return gb(b.replace(Wc,""))}function Zc(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),f=0;a:for(;f<d.length;f++){for(var h=d[f],g=0;g<e.length;g++)if(h==e[g])continue a;c+=(0<c.length?
+" ":"")+h}return c}function Xc(b){b=B(b);var a=b.length;if(1>=a)return b;for(;a--;)8===b[a].nodeType&&Nf.call(b,a,1);return b}function Xe(){var b={},a=!1;this.register=function(a,d){Ta(a,"controller");C(a)?P(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!C(a.$scope))throw I("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,h,g,l){var k,n,p;g=!0===g;l&&G(l)&&(p=l);if(G(f)){l=f.match(Vc);if(!l)throw Of("ctrlfmt",f);
+n=l[1];p=p||l[3];f=b.hasOwnProperty(n)?b[n]:Cc(h.$scope,n,!0)||(a?Cc(d,n,!0):w);Sa(f,n,!0)}if(g)return g=(J(f)?f[f.length-1]:f).prototype,k=Object.create(g||null),p&&e(h,p,k,n||f.name),P(function(){var a=c.invoke(f,k,h,n);a!==k&&(C(a)||x(a))&&(k=a,p&&e(h,p,k,n||f.name));return k},{instance:k,identifier:p});k=c.instantiate(f,h,n);p&&e(h,p,k,n||f.name);return k}}]}function Ye(){this.$get=["$window",function(b){return B(b.document)}]}function Ze(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,
+arguments)}}]}function Yb(b){return C(b)?ea(b)?b.toISOString():eb(b):b}function df(){this.$get=function(){return function(b){if(!b)return"";var a=[];nc(b,function(b,d){null===b||v(b)||(J(b)?m(b,function(b,c){a.push(la(d)+"="+la(Yb(b)))}):a.push(la(d)+"="+la(Yb(b))))});return a.join("&")}}}function ef(){this.$get=function(){return function(b){function a(b,e,f){null===b||v(b)||(J(b)?m(b,function(b,c){a(b,e+"["+(C(b)?c:"")+"]")}):C(b)&&!ea(b)?nc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(la(e)+
+"="+la(Yb(b))))}if(!b)return"";var c=[];a(b,"",!0);return c.join("&")}}}function Zb(b,a){if(G(b)){var c=b.replace(Pf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(ad))||(d=(d=c.match(Qf))&&Rf[d[0]].test(c));d&&(b=vc(c))}}return b}function bd(b){var a=fa(),c;G(b)?m(b.split("\n"),function(b){c=b.indexOf(":");var e=F(T(b.substr(0,c)));b=T(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):C(b)&&m(b,function(b,c){var f=F(c),h=T(b);f&&(a[f]=a[f]?a[f]+", "+h:h)});return a}function cd(b){var a;
+return function(c){a||(a=bd(b));return c?(c=a[F(c)],void 0===c&&(c=null),c):a}}function dd(b,a,c,d){if(x(d))return d(b,a,c);m(d,function(d){b=d(b,a,c)});return b}function cf(){var b=this.defaults={transformResponse:[Zb],transformRequest:[function(a){return C(a)&&"[object File]"!==va.call(a)&&"[object Blob]"!==va.call(a)&&"[object FormData]"!==va.call(a)?eb(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:ja($b),put:ja($b),patch:ja($b)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",
+paramSerializer:"$httpParamSerializer"},a=!1;this.useApplyAsync=function(b){return A(b)?(a=!!b,this):a};var c=!0;this.useLegacyPromiseExtensions=function(a){return A(a)?(c=!!a,this):c};var d=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(e,f,h,g,l,k){function n(a){function d(a){var b=P({},a);b.data=a.data?dd(a.data,a.headers,a.status,f.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:l.reject(b)}function e(a,b){var c,
+d={};m(a,function(a,e){x(a)?(c=a(b),null!=c&&(d[e]=c)):d[e]=a});return d}if(!da.isObject(a))throw I("$http")("badreq",a);var f=P({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);f.headers=function(a){var c=b.headers,d=P({},a.headers),f,g,h,c=P({},c.common,c[F(a.method)]);a:for(f in c){g=F(f);for(h in d)if(F(h)===g)continue a;d[f]=c[f]}return e(d,ja(a))}(a);f.method=sb(f.method);f.paramSerializer=G(f.paramSerializer)?k.get(f.paramSerializer):
+f.paramSerializer;var g=[function(a){var c=a.headers,e=dd(a.data,cd(c),w,a.transformRequest);v(e)&&m(c,function(a,b){"content-type"===F(b)&&delete c[b]});v(a.withCredentials)&&!v(b.withCredentials)&&(a.withCredentials=b.withCredentials);return p(a,e).then(d,d)},w],h=l.when(f);for(m(E,function(a){(a.request||a.requestError)&&g.unshift(a.request,a.requestError);(a.response||a.responseError)&&g.push(a.response,a.responseError)});g.length;){a=g.shift();var r=g.shift(),h=h.then(a,r)}c?(h.success=function(a){Sa(a,
+"fn");h.then(function(b){a(b.data,b.status,b.headers,f)});return h},h.error=function(a){Sa(a,"fn");h.then(null,function(b){a(b.data,b.status,b.headers,f)});return h}):(h.success=ed("success"),h.error=ed("error"));return h}function p(c,d){function h(b,c,d,e){function f(){k(c,b,d,e)}L&&(200<=b&&300>b?L.put(ba,[b,c,bd(d),e]):L.remove(ba));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function k(a,b,d,e){b=-1<=b?b:0;(200<=b&&300>b?O.resolve:O.reject)({data:a,status:b,headers:cd(d),config:c,statusText:e})}
+function p(a){k(a.data,a.status,ja(a.headers()),a.statusText)}function E(){var a=n.pendingRequests.indexOf(c);-1!==a&&n.pendingRequests.splice(a,1)}var O=l.defer(),H=O.promise,L,m,S=c.headers,ba=r(c.url,c.paramSerializer(c.params));n.pendingRequests.push(c);H.then(E,E);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(L=C(c.cache)?c.cache:C(b.cache)?b.cache:t);L&&(m=L.get(ba),A(m)?m&&x(m.then)?m.then(p,p):J(m)?k(m[1],m[0],ja(m[2]),m[3]):k(m,200,{},"OK"):L.put(ba,H));v(m)&&((m=
+fd(c.url)?f()[c.xsrfCookieName||b.xsrfCookieName]:w)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=m),e(c.method,ba,d,h,S,c.timeout,c.withCredentials,c.responseType));return H}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var t=h("$http");b.paramSerializer=G(b.paramSerializer)?k.get(b.paramSerializer):b.paramSerializer;var E=[];m(d,function(a){E.unshift(G(a)?k.get(a):k.invoke(a))});n.pendingRequests=[];(function(a){m(arguments,function(a){n[a]=function(b,c){return n(P({},c||{},
+{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){n[a]=function(b,c,d){return n(P({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");n.defaults=b;return n}]}function gf(){this.$get=function(){return function(){return new Q.XMLHttpRequest}}}function ff(){this.$get=["$browser","$window","$document","$xhrFactory",function(b,a,c,d){return Sf(b,d,b.defer,a.angular.callbacks,c[0])}]}function Sf(b,a,c,d,e){function f(a,b,c){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 h=-1,t="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),t=a.type,h="error"===a.type?404:200);c&&c(h,t)};f.addEventListener("load",n,!1);f.addEventListener("error",n,!1);e.body.appendChild(f);return n}return function(e,g,l,k,n,p,r,t){function E(){q&&q();z&&z.abort()}function K(a,d,e,f,g){A(s)&&c.cancel(s);q=z=null;a(d,
+e,f,g);b.$$completeOutstandingRequest(y)}b.$$incOutstandingRequestCount();g=g||b.url();if("jsonp"==F(e)){var u="_"+(d.counter++).toString(36);d[u]=function(a){d[u].data=a;d[u].called=!0};var q=f(g.replace("JSON_CALLBACK","angular.callbacks."+u),u,function(a,b){K(k,a,d[u].data,"",b);d[u]=y})}else{var z=a(e,g);z.open(e,g,!0);m(n,function(a,b){A(a)&&z.setRequestHeader(b,a)});z.onload=function(){var a=z.statusText||"",b="response"in z?z.response:z.responseText,c=1223===z.status?204:z.status;0===c&&(c=
+b?200:"file"==Aa(g).protocol?404:0);K(k,c,b,z.getAllResponseHeaders(),a)};e=function(){K(k,-1,null,null,"")};z.onerror=e;z.onabort=e;r&&(z.withCredentials=!0);if(t)try{z.responseType=t}catch(N){if("json"!==t)throw N;}z.send(v(l)?null:l)}if(0<p)var s=c(E,p);else p&&x(p.then)&&p.then(E)}}function af(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+
+a}function h(c){return c.replace(n,b).replace(p,a)}function g(f,g,n,p){function u(a){try{var b=a;a=n?e.getTrusted(n,b):e.valueOf(b);var c;if(p&&!A(a))c=a;else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=eb(a)}c=a}return c}catch(g){d(La.interr(f,g))}}p=!!p;for(var q,m,N=0,s=[],O=[],H=f.length,L=[],W=[];N<H;)if(-1!=(q=f.indexOf(b,N))&&-1!=(m=f.indexOf(a,q+l)))N!==q&&L.push(h(f.substring(N,q))),N=f.substring(q+l,m),s.push(N),O.push(c(N,u)),N=m+k,W.push(L.length),
+L.push("");else{N!==H&&L.push(h(f.substring(N)));break}n&&1<L.length&&La.throwNoconcat(f);if(!g||s.length){var S=function(a){for(var b=0,c=s.length;b<c;b++){if(p&&v(a[b]))return;L[W[b]]=a[b]}return L.join("")};return P(function(a){var b=0,c=s.length,e=Array(c);try{for(;b<c;b++)e[b]=O[b](a);return S(e)}catch(g){d(La.interr(f,g))}},{exp:f,expressions:s,$$watchDelegate:function(a,b){var c;return a.$watchGroup(O,function(d,e){var f=S(d);x(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=b.length,k=a.length,
+n=new RegExp(b.replace(/./g,f),"g"),p=new RegExp(a.replace(/./g,f),"g");g.startSymbol=function(){return b};g.endSymbol=function(){return a};return g}]}function bf(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,g,l,k){var n=4<arguments.length,p=n?ua.call(arguments,4):[],r=a.setInterval,t=a.clearInterval,E=0,K=A(k)&&!k,u=(K?d:c).defer(),q=u.promise;l=A(l)?l:0;q.then(null,null,n?function(){e.apply(null,p)}:e);q.$$intervalId=r(function(){u.notify(E++);0<l&&E>=l&&(u.resolve(E),
+t(q.$$intervalId),delete f[q.$$intervalId]);K||b.$apply()},g);f[q.$$intervalId]=u;return q}var f={};e.cancel=function(b){return b&&b.$$intervalId in f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function ac(b){b=b.split("/");for(var a=b.length;a--;)b[a]=ob(b[a]);return b.join("/")}function gd(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=Y(c.port)||Tf[c.protocol]||null}function hd(b,a){var c="/"!==b.charAt(0);
+c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=yc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function sa(b,a){if(0===a.indexOf(b))return a.substr(b.length)}function Ja(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Cb(b){return b.replace(/(#.+)|#$/,"$1")}function bc(b,a,c){this.$$html5=!0;c=c||"";gd(b,this);this.$$parse=function(b){var c=sa(a,
+b);if(!G(c))throw Db("ipthprfx",b,a);hd(c,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var b=Pb(this.$$search),c=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(b?"?"+b:"")+c;this.$$absUrl=a+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,h;A(f=sa(b,d))?(h=f,h=A(f=sa(c,f))?a+(sa("/",f)||f):b+h):A(f=sa(a,d))?h=a+f:a==d+"/"&&(h=a);h&&this.$$parse(h);return!!h}}function cc(b,a,c){gd(b,this);
+this.$$parse=function(d){var e=sa(b,d)||sa(a,d),f;v(e)||"#"!==e.charAt(0)?this.$$html5?f=e:(f="",v(e)&&(b=d,this.replace())):(f=sa(c,e),v(f)&&(f=e));hd(f,this);d=this.$$path;var e=b,h=/^\/[A-Z]:(\/.*)/;0===f.indexOf(e)&&(f=f.replace(e,""));h.exec(f)||(d=(f=h.exec(d))?f[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+(this.$$url?c+this.$$url:"")};this.$$parseLinkUrl=
+function(a,c){return Ja(b)==Ja(a)?(this.$$parse(a),!0):!1}}function id(b,a,c){this.$$html5=!0;cc.apply(this,arguments);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,h;b==Ja(d)?f=d:(h=sa(a,d))?f=b+c+h:a===d+"/"&&(f=a);f&&this.$$parse(f);return!!f};this.$$compose=function(){var a=Pb(this.$$search),e=this.$$hash?"#"+ob(this.$$hash):"";this.$$url=ac(this.$$path)+(a?"?"+a:"")+e;this.$$absUrl=b+c+this.$$url}}function Eb(b){return function(){return this[b]}}function jd(b,
+a){return function(c){if(v(c))return this[b];this[b]=a(c);this.$$compose();return this}}function hf(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return A(a)?(b=a,this):b};this.html5Mode=function(b){return bb(b)?(a.enabled=b,this):C(b)?(bb(b.enabled)&&(a.enabled=b.enabled),bb(b.requireBase)&&(a.requireBase=b.requireBase),bb(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,
+d,e,f,h){function g(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),a,k.$$state,b)}var k,n;n=d.baseHref();var p=d.url(),r;if(a.enabled){if(!n&&a.requireBase)throw Db("nobase");r=p.substring(0,p.indexOf("/",p.indexOf("//")+2))+(n||"/");n=e.history?bc:id}else r=Ja(p),n=cc;var t=r.substr(0,Ja(r).lastIndexOf("/")+1);k=new n(r,t,"#"+b);k.$$parseLinkUrl(p,p);k.$$state=d.state();
+var E=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=B(b.target);"a"!==wa(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var g=e.prop("href"),l=e.attr("href")||e.attr("xlink:href");C(g)&&"[object SVGAnimatedString]"===g.toString()&&(g=Aa(g.animVal).href);E.test(g)||!g||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(g,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),h.angular["ff-684208-preventDefault"]=
+!0))}});Cb(k.absUrl())!=Cb(p)&&d.url(k.absUrl(),!0);var K=!0;d.onUrlChange(function(a,b){v(sa(t,a))?h.location.href=a:(c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,g(d,!1,e)):(K=!1,l(d,e)))}),c.$$phase||c.$digest())});c.$watch(function(){var a=Cb(d.url()),b=Cb(k.absUrl()),f=d.state(),h=k.$$replace,r=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(K||r)K=!1,
+c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(r&&g(b,h,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function jf(){var b=!0,a=this;this.debugEnabled=function(a){return A(a)?(b=a,this):b};this.$get=["$window",function(c){function d(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&&(a=
+a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||y;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];m(arguments,function(b){a.push(d(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(){b&&c.apply(a,arguments)}}()}}]}function Xa(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===
+b||"__proto__"===b)throw Z("isecfld",a);return b}function kd(b,a){b+="";if(!G(b))throw Z("iseccst",a);return b}function Ba(b,a){if(b){if(b.constructor===b)throw Z("isecfn",a);if(b.window===b)throw Z("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw Z("isecdom",a);if(b===Object)throw Z("isecobj",a);}return b}function ld(b,a){if(b){if(b.constructor===b)throw Z("isecfn",a);if(b===Uf||b===Vf||b===Wf)throw Z("isecff",a);}}function md(b,a){if(b&&(b===(0).constructor||b===(!1).constructor||
+b==="".constructor||b==={}.constructor||b===[].constructor||b===Function.constructor))throw Z("isecaf",a);}function Xf(b,a){return"undefined"!==typeof b?b:a}function nd(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function U(b,a){var c,d;switch(b.type){case s.Program:c=!0;m(b.body,function(b){U(b.expression,a);c=c&&b.expression.constant});b.constant=c;break;case s.Literal:b.constant=!0;b.toWatch=[];break;case s.UnaryExpression:U(b.argument,a);b.constant=b.argument.constant;b.toWatch=
+b.argument.toWatch;break;case s.BinaryExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);break;case s.LogicalExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case s.ConditionalExpression:U(b.test,a);U(b.alternate,a);U(b.consequent,a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case s.Identifier:b.constant=
+!1;b.toWatch=[b];break;case s.MemberExpression:U(b.object,a);b.computed&&U(b.property,a);b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=[b];break;case s.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];m(b.arguments,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&!a(b.callee.name).$stateful?d:[b];break;case s.AssignmentExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;
+b.toWatch=[b];break;case s.ArrayExpression:c=!0;d=[];m(b.elements,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=d;break;case s.ObjectExpression:c=!0;d=[];m(b.properties,function(b){U(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case s.ThisExpression:b.constant=!1,b.toWatch=[]}}function od(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:w}}
+function pd(b){return b.type===s.Identifier||b.type===s.MemberExpression}function qd(b){if(1===b.body.length&&pd(b.body[0].expression))return{type:s.AssignmentExpression,left:b.body[0].expression,right:{type:s.NGValueParameter},operator:"="}}function rd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===s.Literal||b.body[0].expression.type===s.ArrayExpression||b.body[0].expression.type===s.ObjectExpression)}function sd(b,a){this.astBuilder=b;this.$filter=a}function td(b,
+a){this.astBuilder=b;this.$filter=a}function Fb(b){return"constructor"==b}function dc(b){return x(b.valueOf)?b.valueOf():Yf.call(b)}function kf(){var b=fa(),a=fa();this.$get=["$filter",function(c){function d(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=dc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==b}function e(a,b,c,e,f){var g=e.inputs,h;if(1===g.length){var k=d,g=g[0];return a.$watch(function(a){var b=g(a);d(b,k)||(h=e(a,w,w,[b]),k=b&&dc(b));return h},b,c,f)}for(var l=[],n=[],p=0,
+m=g.length;p<m;p++)l[p]=d,n[p]=null;return a.$watch(function(a){for(var b=!1,c=0,f=g.length;c<f;c++){var k=g[c](a);if(b||(b=!d(k,l[c])))n[c]=k,l[c]=k&&dc(k)}b&&(h=e(a,w,w,n));return h},b,c,f)}function f(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;x(b)&&b.apply(this,arguments);A(a)&&d.$$postDigest(function(){A(f)&&e()})},c)}function h(a,b,c,d){function e(a){var b=!0;m(a,function(a){A(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,
+c,d){g=a;x(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function g(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){x(b)&&b.apply(this,arguments);e()},c)}function l(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==h&&c!==f?function(c,d,e,f){e=a(c,d,e,f);return b(e,c,d)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return A(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==e?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=e,c.inputs=
+a.inputs?a.inputs:[a]);return c}var k=Fa().noUnsafeEval,n={csp:k,expensiveChecks:!1},p={csp:k,expensiveChecks:!0};return function(d,k,E){var m,u,q;switch(typeof d){case "string":q=d=d.trim();var s=E?a:b;m=s[q];m||(":"===d.charAt(0)&&":"===d.charAt(1)&&(u=!0,d=d.substring(2)),E=E?p:n,m=new ec(E),m=(new fc(m,c,E)).parse(d),m.constant?m.$$watchDelegate=g:u?m.$$watchDelegate=m.literal?h:f:m.inputs&&(m.$$watchDelegate=e),s[q]=m);return l(m,k);case "function":return l(d,k);default:return y}}}]}function mf(){this.$get=
+["$rootScope","$exceptionHandler",function(b,a){return ud(function(a){b.$evalAsync(a)},a)}]}function nf(){this.$get=["$browser","$exceptionHandler",function(b,a){return ud(function(a){b.defer(a)},a)}]}function ud(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;
+c.processScheduled=!1;c.pending=w;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{x(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function h(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=e(this,this.notify)}var g=I("$q",TypeError);P(d.prototype,{then:function(a,b,c){if(v(a)&&v(b)&&v(c))return this;var d=new h;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,
+a,b,c]);0<this.$$state.status&&f(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)}});P(h.prototype,{resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(g("qcycle",a)):this.$$resolve(a))},$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(C(b)||x(b))d=b&&b.then;x(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],
+this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(x(b)?b(c):c)}catch(h){a(h)}}})}});
+var l=function(a,b){var c=new h;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{x(c)&&(d=c())}catch(e){return l(e,!1)}return d&&x(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},n=function(a,b,c,d){var e=new h;e.resolve(a);return e.promise.then(b,c,d)},p=function t(a){if(!x(a))throw g("norslvr",a);if(!(this instanceof t))return new t(a);var b=new h;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};p.defer=function(){return new h};
+p.reject=function(a){var b=new h;b.reject(a);return b.promise};p.when=n;p.resolve=n;p.all=function(a){var b=new h,c=0,d=J(a)?[]:{};m(a,function(a,e){c++;n(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 p}function wf(){this.$get=["$window","$timeout",function(b,a){var c=b.requestAnimationFrame||b.webkitRequestAnimationFrame,d=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,
+e=!!c,f=e?function(a){var b=c(a);return function(){d(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};f.supported=e;return f}]}function lf(){function b(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++nb;this.$$ChildScope=null}b.prototype=a;return b}var a=10,c=I("$rootScope"),d=null,e=null;this.digestTtl=function(b){arguments.length&&(a=b);return a};this.$get=
+["$injector","$exceptionHandler","$parse","$browser",function(f,h,g,l){function k(a){a.currentScope.$$destroyed=!0}function n(){this.$id=++nb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function p(a){if(q.$$phase)throw c("inprog",q.$$phase);q.$$phase=a}function r(a,b){do a.$$watchersCount+=b;while(a=
+a.$parent)}function t(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];while(a=a.$parent)}function E(){}function s(){for(;w.length;)try{w.shift()()}catch(a){h(a)}e=null}function u(){null===e&&(e=l.defer(function(){q.$apply(s)}))}n.prototype={constructor:n,$new:function(a,c){var d;c=c||this;a?(d=new n,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=b(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;(a||c!=this)&&d.$on("$destroy",k);return d},$watch:function(a,b,c,e){var f=g(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,c,f,a);var h=this,k=h.$$watchers,l={fn:b,last:E,get:f,exp:e||a,eq:!!c};d=null;x(b)||(l.fn=y);k||(k=h.$$watchers=[]);k.unshift(l);r(this,1);return function(){0<=cb(k,l)&&r(h,-1);d=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)});m(a,function(a,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(!v(e)){if(C(e))if(Da(e))for(f!==p&&(f=p,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)ta.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>a)for(b in l++,f)ta.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),p=[],r={},q=!0,t=0;return this.$watch(n,function(){q?(q=!1,b(e,e,d)):b(e,h,d);if(k)if(C(e))if(Da(e)){h=Array(e.length);for(var a=0;a<e.length;a++)h[a]=e[a]}else for(a in h=
+{},e)ta.call(e,a)&&(h[a]=e[a]);else h=e})},$digest:function(){var b,f,g,k,n,r,t=a,m,u=[],D,v;p("$digest");l.$$checkUrlChange();this===q&&null!==e&&(l.defer.cancel(e),s());d=null;do{r=!1;for(m=this;z.length;){try{v=z.shift(),v.scope.$eval(v.expression,v.locals)}catch(w){h(w)}d=null}a:do{if(k=m.$$watchers)for(n=k.length;n--;)try{if(b=k[n])if((f=b.get(m))!==(g=b.last)&&!(b.eq?ka(f,g):"number"===typeof f&&"number"===typeof g&&isNaN(f)&&isNaN(g)))r=!0,d=b,b.last=b.eq?ha(f,null):f,b.fn(f,g===E?f:g,m),5>
+t&&(D=4-t,u[D]||(u[D]=[]),u[D].push({msg:x(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:g}));else if(b===d){r=!1;break a}}catch(y){h(y)}if(!(k=m.$$watchersCount&&m.$$childHead||m!==this&&m.$$nextSibling))for(;m!==this&&!(k=m.$$nextSibling);)m=m.$parent}while(m=k);if((r||z.length)&&!t--)throw q.$$phase=null,c("infdig",a,u);}while(r||z.length);for(q.$$phase=null;N.length;)try{N.shift()()}catch(A){h(A)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");
+this.$$destroyed=!0;this===q&&l.$$applicationDestroyed();r(this,-this.$$watchersCount);for(var b in this.$$listenerCount)t(this,this.$$listenerCount[b],b);a&&a.$$childHead==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=y;this.$on=
+this.$watch=this.$watchGroup=function(){return y};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(a,b){return g(a)(this,b)},$evalAsync:function(a,b){q.$$phase||z.length||l.defer(function(){z.length&&q.$digest()});z.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){N.push(a)},$apply:function(a){try{p("$apply");try{return this.$eval(a)}finally{q.$$phase=null}}catch(b){h(b)}finally{try{q.$digest()}catch(c){throw h(c),
+c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&w.push(b);u()},$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]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,t(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,g={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){g.defaultPrevented=!0},defaultPrevented:!1},
+k=db([g],arguments,1),l,n;do{d=e.$$listeners[a]||c;g.currentScope=e;l=0;for(n=d.length;l<n;l++)if(d[l])try{d[l].apply(null,k)}catch(p){h(p)}else d.splice(l,1),l--,n--;if(f)return g.currentScope=null,g;e=e.$parent}while(e);g.currentScope=null;return g},$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 f=db([e],arguments,1),g,k;c=d;){e.currentScope=c;d=c.$$listeners[a]||
+[];g=0;for(k=d.length;g<k;g++)if(d[g])try{d[g].apply(null,f)}catch(l){h(l)}else d.splice(g,1),g--,k--;if(!(d=c.$$listenerCount[a]&&c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var q=new n,z=q.$$asyncQueue=[],N=q.$$postDigestQueue=[],w=q.$$applyAsyncQueue=[];return q}]}function ge(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return A(a)?
+(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return A(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=d?a:b,f;f=Aa(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Zf(b){if("self"===b)return b;if(G(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=vd(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(Oa(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function wd(b){var a=[];A(b)&&m(b,function(b){a.push(Zf(b))});
+return a}function pf(){this.SCE_CONTEXTS=oa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=wd(a));return b};this.resourceUrlBlacklist=function(b){arguments.length&&(a=wd(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?fd(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 Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));var h=e(),g={};g[oa.HTML]=e(h);g[oa.CSS]=e(h);g[oa.URL]=e(h);g[oa.JS]=e(h);g[oa.RESOURCE_URL]=e(g[oa.URL]);return{trustAs:function(a,b){var c=g.hasOwnProperty(a)?g[a]:null;if(!c)throw Ca("icontext",a,b);if(null===b||v(b)||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||v(e)||""===e)return e;var h=g.hasOwnProperty(c)?g[c]:null;if(h&&e instanceof
+h)return e.$$unwrapTrustedValue();if(c===oa.RESOURCE_URL){var h=Aa(e.toString()),p,r,t=!1;p=0;for(r=b.length;p<r;p++)if(d(b[p],h)){t=!0;break}if(t)for(p=0,r=a.length;p<r;p++)if(d(a[p],h)){t=!1;break}if(t)return e;throw Ca("insecurl",e.toString());}if(c===oa.HTML)return f(e);throw Ca("unsafe");},valueOf:function(a){return a instanceof h?a.$$unwrapTrustedValue():a}}}]}function of(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&
+8>Wa)throw Ca("iequirks");var d=ja(oa);d.isEnabled=function(){return b};d.trustAs=c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=$a);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,h=d.trustAs;m(oa,function(a,b){var c=F(b);d[gb("parse_as_"+c)]=function(b){return e(a,b)};d[gb("get_trusted_"+c)]=function(b){return f(a,b)};d[gb("trust_as_"+
+c)]=function(b){return h(a,b)}});return d}]}function qf(){this.$get=["$window","$document",function(b,a){var c={},d=Y((/android (\d+)/.exec(F((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},h,g=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,n=!1;if(l){for(var p in l)if(k=g.exec(p)){h=k[0];h=h.substr(0,1).toUpperCase()+h.substr(1);break}h||(h="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||h+"Transition"in l);n=!!("animation"in l||h+"Animation"in
+l);!d||k&&n||(k=G(l.webkitTransition),n=G(l.webkitAnimation))}return{history:!(!b.history||!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===a&&11>=Wa)return!1;if(v(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:Fa(),vendorPrefix:h,transitions:k,animations:n,android:d}}]}function sf(){this.$get=["$templateCache","$http","$q","$sce",function(b,a,c,d){function e(f,h){e.totalPendingRequests++;G(f)&&b.get(f)||(f=d.getTrustedResourceUrl(f));var g=a.defaults&&a.defaults.transformResponse;
+J(g)?g=g.filter(function(a){return a!==Zb}):g===Zb&&(g=null);return a.get(f,{cache:b,transformResponse:g})["finally"](function(){e.totalPendingRequests--}).then(function(a){b.put(f,a.data);return a.data},function(a){if(!h)throw ga("tpload",f,a.status,a.statusText);return c.reject(a)})}e.totalPendingRequests=0;return e}]}function tf(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var h=[];m(a,function(a){var d=
+da.element(a).data("$binding");d&&m(d,function(d){c?(new RegExp("(^|\\s)"+vd(b)+"(\\s|\\||$)")).test(d)&&h.push(a):-1!=d.indexOf(b)&&h.push(a)})});return h},findModels:function(a,b,c){for(var h=["ng-","data-ng-","ng\\:"],g=0;g<h.length;++g){var l=a.querySelectorAll("["+h[g]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function uf(){this.$get=
+["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,l,k){x(f)||(k=l,l=f,f=y);var n=ua.call(arguments,3),p=A(k)&&!k,r=(p?d:c).defer(),t=r.promise,m;m=a.defer(function(){try{r.resolve(f.apply(null,n))}catch(a){r.reject(a),e(a)}finally{delete h[t.$$timeoutId]}p||b.$apply()},l);t.$$timeoutId=m;h[m]=r;return t}var h={};f.cancel=function(b){return b&&b.$$timeoutId in h?(h[b.$$timeoutId].reject("canceled"),delete h[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return f}]}
+function Aa(b){Wa&&($.setAttribute("href",b),b=$.href);$.setAttribute("href",b);return{href:$.href,protocol:$.protocol?$.protocol.replace(/:$/,""):"",host:$.host,search:$.search?$.search.replace(/^\?/,""):"",hash:$.hash?$.hash.replace(/^#/,""):"",hostname:$.hostname,port:$.port,pathname:"/"===$.pathname.charAt(0)?$.pathname:"/"+$.pathname}}function fd(b){b=G(b)?Aa(b):b;return b.protocol===xd.protocol&&b.host===xd.host}function vf(){this.$get=qa(Q)}function yd(b){function a(a){try{return decodeURIComponent(a)}catch(b){return a}}
+var c=b[0]||{},d={},e="";return function(){var b,h,g,l,k;b=c.cookie||"";if(b!==e)for(e=b,b=e.split("; "),d={},g=0;g<b.length;g++)h=b[g],l=h.indexOf("="),0<l&&(k=a(h.substring(0,l)),v(d[k])&&(d[k]=a(h.substring(l+1))));return d}}function zf(){this.$get=yd}function Kc(b){function a(c,d){if(C(c)){var e={};m(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",zd);a("date",Ad);
+a("filter",$f);a("json",ag);a("limitTo",bg);a("lowercase",cg);a("number",Bd);a("orderBy",Cd);a("uppercase",dg)}function $f(){return function(b,a,c){if(!Da(b)){if(null==b)return b;throw I("filter")("notarray",b);}var d;switch(gc(a)){case "function":break;case "boolean":case "null":case "number":case "string":d=!0;case "object":a=eg(a,c,d);break;default:return b}return Array.prototype.filter.call(b,a)}}function eg(b,a,c){var d=C(b)&&"$"in b;!0===a?a=ka:x(a)||(a=function(a,b){if(v(a))return!1;if(null===
+a||null===b)return a===b;if(C(b)||C(a)&&!qc(a))return!1;a=F(""+a);b=F(""+b);return-1!==a.indexOf(b)});return function(e){return d&&!C(e)?Ma(e,b.$,a,!1):Ma(e,b,a,c)}}function Ma(b,a,c,d,e){var f=gc(b),h=gc(a);if("string"===h&&"!"===a.charAt(0))return!Ma(b,a.substring(1),c,d);if(J(b))return b.some(function(b){return Ma(b,a,c,d)});switch(f){case "object":var g;if(d){for(g in b)if("$"!==g.charAt(0)&&Ma(b[g],a,c,!0))return!0;return e?!1:Ma(b,a,c,!1)}if("object"===h){for(g in a)if(e=a[g],!x(e)&&!v(e)&&
+(f="$"===g,!Ma(f?b:b[g],e,c,f,f)))return!1;return!0}return c(b,a);case "function":return!1;default:return c(b,a)}}function gc(b){return null===b?"null":typeof b}function zd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){v(d)&&(d=a.CURRENCY_SYM);v(e)&&(e=a.PATTERNS[1].maxFrac);return null==b?b:Dd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function Bd(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:Dd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Dd(b,
+a,c,d,e){if(C(b))return"";var f=0>b;b=Math.abs(b);var h=Infinity===b;if(!h&&!isFinite(b))return"";var g=b+"",l="",k=!1,n=[];h&&(l="\u221e");if(!h&&-1!==g.indexOf("e")){var p=g.match(/([\d\.]+)e(-?)(\d+)/);p&&"-"==p[2]&&p[3]>e+1?b=0:(l=g,k=!0)}if(h||k)0<e&&1>b&&(l=b.toFixed(e),b=parseFloat(l),l=l.replace(hc,d));else{h=(g.split(hc)[1]||"").length;v(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var h=(""+b).split(hc),g=h[0],h=h[1]||"",p=0,
+r=a.lgSize,t=a.gSize;if(g.length>=r+t)for(p=g.length-r,k=0;k<p;k++)0===(p-k)%t&&0!==k&&(l+=c),l+=g.charAt(k);for(k=p;k<g.length;k++)0===(g.length-k)%r&&0!==k&&(l+=c),l+=g.charAt(k);for(;h.length<e;)h+="0";e&&"0"!==e&&(l+=d+h.substr(0,e))}0===b&&(f=!1);n.push(f?a.negPre:a.posPre,l,f?a.negSuf:a.posSuf);return n.join("")}function Gb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function aa(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<
+c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,d){var e=c["get"+b](),f=sb(a?"SHORT"+b:b);return d[f][e]}}function Ed(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Fd(b){return function(a){var c=Ed(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function ic(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function Ad(b){function a(a){var b;if(b=
+a.match(c)){a=new Date(0);var f=0,h=0,g=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:a.setHours;b[9]&&(f=Y(b[9]+b[10]),h=Y(b[9]+b[11]));g.call(a,Y(b[1]),Y(b[2])-1,Y(b[3]));f=Y(b[4]||0)-f;h=Y(b[5]||0)-h;g=Y(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,h,g,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var h="",g=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;G(c)&&(c=
+fg.test(c)?Y(c):a(c));V(c)&&(c=new Date(c));if(!ea(c)||!isFinite(c.getTime()))return c;for(;e;)(k=gg.exec(e))?(g=db(g,k,1),e=g.pop()):(g.push(e),e=null);var n=c.getTimezoneOffset();f&&(n=wc(f,c.getTimezoneOffset()),c=Ob(c,f,!0));m(g,function(a){l=hg[a];h+=l?l(c,b.DATETIME_FORMATS,n):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return h}}function ag(){return function(b,a){v(a)&&(a=2);return eb(b,a)}}function bg(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):Y(a);if(isNaN(a))return b;
+V(b)&&(b=b.toString());if(!J(b)&&!G(b))return b;c=!c||isNaN(c)?0:Y(c);c=0>c&&c>=-b.length?b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0,c+a),c)}}function Cd(b){function a(a,c){c=c?-1:1;return a.map(function(a){var d=1,g=$a;if(x(a))g=a;else if(G(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))d="-"==a.charAt(0)?-1:1,a=a.substring(1);if(""!==a&&(g=b(a),g.constant))var l=g(),g=function(a){return a[l]}}return{get:g,descending:d*c}})}function c(a){switch(typeof a){case "number":case "boolean":case "string":return!0;
+default:return!1}}return function(b,e,f){if(!Da(b))return b;J(e)||(e=[e]);0===e.length&&(e=["+"]);var h=a(e,f);h.push({get:function(){return{}},descending:f?-1:1});b=Array.prototype.map.call(b,function(a,b){return{value:a,predicateValues:h.map(function(d){var e=d.get(a);d=typeof e;if(null===e)d="string",e="null";else if("string"===d)e=e.toLowerCase();else if("object"===d)a:{if("function"===typeof e.valueOf&&(e=e.valueOf(),c(e)))break a;if(qc(e)&&(e=e.toString(),c(e)))break a;e=b}return{value:e,type:d}})}});
+b.sort(function(a,b){for(var c=0,d=0,e=h.length;d<e;++d){var c=a.predicateValues[d],f=b.predicateValues[d],t=0;c.type===f.type?c.value!==f.value&&(t=c.value<f.value?-1:1):t=c.type<f.type?-1:1;if(c=t*h[d].descending)break}return c});return b=b.map(function(a){return a.value})}}function Na(b){x(b)&&(b={link:b});b.restrict=b.restrict||"AC";return qa(b)}function Gd(b,a,c,d,e){var f=this,h=[];f.$error={};f.$$success={};f.$pending=w;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=
+!0;f.$invalid=!1;f.$submitted=!1;f.$$parentForm=Ib;f.$rollbackViewValue=function(){m(h,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){m(h,function(a){a.$commitViewValue()})};f.$addControl=function(a){Ta(a.$name,"input");h.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];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];m(f.$pending,function(b,c){f.$setValidity(c,null,a)});
+m(f.$error,function(b,c){f.$setValidity(c,null,a)});m(f.$$success,function(b,c){f.$setValidity(c,null,a)});cb(h,a);a.$$parentForm=Ib};Hd({ctrl:this,$element:b,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&&(cb(d,c),0===d.length&&delete a[b])},$animate:d});f.$setDirty=function(){d.removeClass(b,Ya);d.addClass(b,Jb);f.$dirty=!0;f.$pristine=!1;f.$$parentForm.$setDirty()};f.$setPristine=function(){d.setClass(b,Ya,Jb+" ng-submitted");f.$dirty=
+!1;f.$pristine=!0;f.$submitted=!1;m(h,function(a){a.$setPristine()})};f.$setUntouched=function(){m(h,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;f.$$parentForm.$setSubmitted()}}function jc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function jb(b,a,c,d,e,f){var h=F(a[0].type);if(!e.android){var g=!1;a.on("compositionstart",function(a){g=!0});a.on("compositionend",function(){g=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),
+k=null);if(!g){var e=a.val();b=b&&b.type;"password"===h||c.ngTrim&&"false"===c.ngTrim||(e=T(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input",l);else{var k,n=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||n(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",n)}a.on("change",l);d.$render=function(){var b=d.$isEmpty(d.$viewValue)?
+"":d.$viewValue;a.val()!==b&&a.val(b)}}function Kb(b,a){return function(c,d){var e,f;if(ea(c))return c;if(G(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(ig.test(c))return new Date(c);b.lastIndex=0;if(e=b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},m(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,
+f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function kb(b,a,c,d){return function(e,f,h,g,l,k,n){function p(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function r(a){return A(a)&&!ea(a)?c(a)||w:a}Id(e,f,h,g);jb(e,f,h,g,l,k);var t=g&&g.$options&&g.$options.timezone,m;g.$$parserName=b;g.$parsers.push(function(b){return g.$isEmpty(b)?null:a.test(b)?(b=c(b,m),t&&(b=Ob(b,t)),b):w});g.$formatters.push(function(a){if(a&&!ea(a))throw lb("datefmt",a);if(p(a))return(m=a)&&t&&(m=Ob(m,t,!0)),
+n("date")(a,d,t);m=null;return""});if(A(h.min)||h.ngMin){var s;g.$validators.min=function(a){return!p(a)||v(s)||c(a)>=s};h.$observe("min",function(a){s=r(a);g.$validate()})}if(A(h.max)||h.ngMax){var u;g.$validators.max=function(a){return!p(a)||v(u)||c(a)<=u};h.$observe("max",function(a){u=r(a);g.$validate()})}}}function Id(b,a,c,d){(d.$$hasNativeValidators=C(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?w:b})}function Jd(b,a,c,d,e){if(A(d)){b=
+b(d);if(!b.constant)throw lb("constexpr",c,d);return b(a)}return e}function kc(b,a){b="ngClass"+b;return["$animate",function(c){function d(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 J(a)?(m(a,function(a){b=b.concat(e(a))}),b):G(a)?a.split(" "):C(a)?(m(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,h,g){function l(a,b){var c=h.data("$classCounts")||fa(),
+d=[];m(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});h.data("$classCounts",c);return d.join(" ")}function k(b){if(!0===a||f.$index%2===a){var k=e(b||[]);if(!n){var m=l(k,1);g.$addClass(m)}else if(!ka(b,n)){var s=e(n),m=d(k,s),k=d(s,k),m=l(m,1),k=l(k,-1);m&&m.length&&c.addClass(h,m);k&&k.length&&c.removeClass(h,k)}}n=ja(b)}var n;f.$watch(g[b],k,!0);g.$observe("class",function(a){k(f.$eval(g[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var h=c&1;if(h!==(d&1)){var k=
+e(f.$eval(g[b]));h===a?(h=l(k,1),g.$addClass(h)):(h=l(k,-1),g.$removeClass(h))}})}}}]}function Hd(b){function a(a,b){b&&!f[a]?(l.addClass(e,a),f[a]=!0):!b&&f[a]&&(l.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+Ac(b,"-"):"";a(mb+b,!0===c);a(Kd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},h=b.set,g=b.unset,l=b.$animate;f[Kd]=!(f[mb]=e.hasClass(mb));d.$setValidity=function(b,e,f){v(e)?(d.$pending||(d.$pending={}),h(d.$pending,b,f)):(d.$pending&&g(d.$pending,b,f),Ld(d.$pending)&&(d.$pending=w));bb(e)?
+e?(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),g(d.$$success,b,f));d.$pending?(a(Md,!0),d.$valid=d.$invalid=w,c("",null)):(a(Md,!1),d.$valid=Ld(d.$error),d.$invalid=!d.$valid,c("",d.$valid));e=d.$pending&&d.$pending[b]?w:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);d.$$parentForm.$setValidity(b,e,d)}}function Ld(b){if(b)for(var a in b)if(b.hasOwnProperty(a))return!1;return!0}var jg=/^\/(.+)\/([a-z]*)$/,F=function(b){return G(b)?b.toLowerCase():b},ta=Object.prototype.hasOwnProperty,
+sb=function(b){return G(b)?b.toUpperCase():b},Wa,B,ra,ua=[].slice,Nf=[].splice,kg=[].push,va=Object.prototype.toString,rc=Object.getPrototypeOf,Ea=I("ng"),da=Q.angular||(Q.angular={}),Rb,nb=0;Wa=X.documentMode;y.$inject=[];$a.$inject=[];var J=Array.isArray,tc=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,T=function(b){return G(b)?b.trim():b},vd=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},Fa=function(){if(!A(Fa.rules)){var b=
+X.querySelector("[ng-csp]")||X.querySelector("[data-ng-csp]");if(b){var a=b.getAttribute("ng-csp")||b.getAttribute("data-ng-csp");Fa.rules={noUnsafeEval:!a||-1!==a.indexOf("no-unsafe-eval"),noInlineStyle:!a||-1!==a.indexOf("no-inline-style")}}else{b=Fa;try{new Function(""),a=!1}catch(c){a=!0}b.rules={noUnsafeEval:a,noInlineStyle:!1}}}return Fa.rules},pb=function(){if(A(pb.name_))return pb.name_;var b,a,c=Qa.length,d,e;for(a=0;a<c;++a)if(d=Qa[a],b=X.querySelector("["+d.replace(":","\\:")+"jq]")){e=
+b.getAttribute(d+"jq");break}return pb.name_=e},Qa=["ng-","data-ng-","ng:","x-ng-"],be=/[A-Z]/g,Bc=!1,Qb,pa=1,Pa=3,fe={full:"1.4.7",major:1,minor:4,dot:7,codeName:"dark-luminescence"};R.expando="ng339";var hb=R.cache={},Ff=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var Af=/([\:\-\_]+(.))/g,Bf=/^moz([A-Z])/,lg={mouseleave:"mouseout",mouseenter:"mouseover"},Tb=I("jqLite"),Ef=/^<([\w-]+)\s*\/?>(?:<\/\1>|)$/,Sb=/<|&#?\w+;/,Cf=/<([\w:-]+)/,Df=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:-]+)[^>]*)\/>/gi,
+ma={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,"",""]};ma.optgroup=ma.option;ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead;ma.th=ma.td;var Ra=R.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;"complete"===X.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(Q).on("load",a))},
+toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?B(this[b]):B(this[this.length+b])},length:0,push:kg,sort:[].sort,splice:[].splice},Bb={};m("multiple selected checked disabled readOnly required open".split(" "),function(b){Bb[F(b)]=b});var Sc={};m("input select option textarea button form details".split(" "),function(b){Sc[b]=!0});var $c={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};
+m({data:Vb,removeData:vb,hasData:function(b){for(var a in hb[b.ng339])return!0;return!1}},function(b,a){R[a]=b});m({data:Vb,inheritedData:Ab,scope:function(b){return B.data(b,"$scope")||Ab(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return B.data(b,"$isolateScope")||B.data(b,"$isolateScopeNoTemplate")},controller:Pc,injector:function(b){return Ab(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:xb,css:function(b,a,c){a=gb(a);if(A(c))b.style[a]=c;else return b.style[a]},
+attr:function(b,a,c){var d=b.nodeType;if(d!==Pa&&2!==d&&8!==d)if(d=F(a),Bb[d])if(A(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||y).specified?d:w;else if(A(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?w:b},prop:function(b,a,c){if(A(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(v(b)){var d=a.nodeType;return d===pa||d===Pa?a.textContent:""}a.textContent=b}b.$dv="";return b}(),
+val:function(b,a){if(v(a)){if(b.multiple&&"select"===wa(b)){var c=[];m(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(v(a))return b.innerHTML;ub(b,!0);b.innerHTML=a},empty:Qc},function(b,a){R.prototype[a]=function(a,d){var e,f,h=this.length;if(b!==Qc&&v(2==b.length&&b!==xb&&b!==Pc?a:d)){if(C(a)){for(e=0;e<h;e++)if(b===Vb)b(this[e],a);else for(f in a)b(this[e],f,a[f]);return this}e=b.$dv;h=v(e)?Math.min(h,1):h;
+for(f=0;f<h;f++){var g=b(this[f],a,d);e=e?e+g:g}return e}for(e=0;e<h;e++)b(this[e],a,d);return this}});m({removeData:vb,on:function a(c,d,e,f){if(A(f))throw Tb("onargs");if(Lc(c)){var h=wb(c,!0);f=h.events;var g=h.handle;g||(g=h.handle=Hf(c,f));for(var h=0<=d.indexOf(" ")?d.split(" "):[d],l=h.length;l--;){d=h[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,lg[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||g(a,d)}):"$destroy"!==d&&c.addEventListener(d,g,!1),
+k=f[d]);k.push(e)}}},off:Oc,one:function(a,c,d){a=B(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;ub(a);m(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];m(a.childNodes,function(a){a.nodeType===pa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===pa||11===d){c=new R(c);for(var d=0,e=c.length;d<
+e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===pa){var d=a.firstChild;m(new R(c),function(c){a.insertBefore(c,d)})}},wrap:function(a,c){c=B(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Wb,detach:function(a){Wb(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,h=c.length;f<h;f++){var g=c[f];e.insertBefore(g,d.nextSibling);d=g}},addClass:zb,removeClass:yb,toggleClass:function(a,c,d){c&&m(c.split(" "),function(c){var f=
+d;v(f)&&(f=!xb(a,c));(f?zb:yb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Ub,triggerHandler:function(a,c,d){var e,f,h=c.type||c,g=wb(a);if(g=(g=g&&g.events)&&g[h])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
+!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:y,type:h,target:a},c.type&&(e=P(e,c)),c=ja(g),f=d?[e].concat(d):[e],m(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var h,g=0,l=this.length;g<l;g++)v(h)?(h=a(this[g],c,e,f),A(h)&&(h=B(h))):Nc(h,a(this[g],c,e,f));return A(h)?h:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});Ua.prototype={put:function(a,
+c){this[Ga(a,this.nextUid)]=c},get:function(a){return this[Ga(a,this.nextUid)]},remove:function(a){var c=this[a=Ga(a,this.nextUid)];delete this[a];return c}};var yf=[function(){this.$get=[function(){return Ua}]}],Uc=/^[^\(]*\(\s*([^\)]*)\)/m,mg=/,/,ng=/^\s*(_?)(\S+?)\1\s*$/,Tc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ha=I("$injector");fb.$$annotate=function(a,c,d){var e;if("function"===typeof a){if(!(e=a.$inject)){e=[];if(a.length){if(c)throw G(d)&&d||(d=a.name||If(a)),Ha("strictdi",d);c=a.toString().replace(Tc,
+"");c=c.match(Uc);m(c[1].split(mg),function(a){a.replace(ng,function(a,c,d){e.push(d)})})}a.$inject=e}}else J(a)?(c=a.length-1,Sa(a[c],"fn"),e=a.slice(0,c)):Sa(a,"fn",!0);return e};var Nd=I("$animate"),Ue=function(){this.$get=["$q","$$rAF",function(a,c){function d(){}d.all=y;d.chain=y;d.prototype={end:y,cancel:y,resume:y,pause:y,complete:y,then:function(d,f){return a(function(a){c(function(){a()})}).then(d,f)}};return d}]},Te=function(){var a=new Ua,c=[];this.$get=["$$AnimateRunner","$rootScope",
+function(d,e){function f(a,c,d){var e=!1;c&&(c=G(c)?c.split(" "):J(c)?c:[],m(c,function(c){c&&(e=!0,a[c]=d)}));return e}function h(){m(c,function(c){var d=a.get(c);if(d){var e=Jf(c.attr("class")),f="",h="";m(d,function(a,c){a!==!!e[c]&&(a?f+=(f.length?" ":"")+c:h+=(h.length?" ":"")+c)});m(c,function(a){f&&zb(a,f);h&&yb(a,h)});a.remove(c)}});c.length=0}return{enabled:y,on:y,off:y,pin:y,push:function(g,l,k,n){n&&n();k=k||{};k.from&&g.css(k.from);k.to&&g.css(k.to);if(k.addClass||k.removeClass)if(l=k.addClass,
+n=k.removeClass,k=a.get(g)||{},l=f(k,l,!0),n=f(k,n,!1),l||n)a.put(g,k),c.push(g),1===c.length&&e.$$postDigest(h);return new d}}}]},Re=["$provide",function(a){var c=this;this.$$registeredAnimations=Object.create(null);this.register=function(d,e){if(d&&"."!==d.charAt(0))throw Nd("notcsel",d);var f=d+"-animation";c.$$registeredAnimations[d.substr(1)]=f;a.factory(f,e)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Nd("nongcls",
+"ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function c(a,d,e){if(e){var l;a:{for(l=0;l<e.length;l++){var k=e[l];if(1===k.nodeType){l=k;break a}}l=void 0}!l||l.parentNode||l.previousElementSibling||(e=null)}e?e.after(a):d.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(f,h,g,l){h=h&&B(h);g=g&&B(g);h=h||g.parent();c(f,h,g);return a.push(f,"enter",Ia(l))},move:function(f,h,g,l){h=h&&B(h);g=g&&B(g);
+h=h||g.parent();c(f,h,g);return a.push(f,"move",Ia(l))},leave:function(c,e){return a.push(c,"leave",Ia(e),function(){c.remove()})},addClass:function(c,e,g){g=Ia(g);g.addClass=ib(g.addclass,e);return a.push(c,"addClass",g)},removeClass:function(c,e,g){g=Ia(g);g.removeClass=ib(g.removeClass,e);return a.push(c,"removeClass",g)},setClass:function(c,e,g,l){l=Ia(l);l.addClass=ib(l.addClass,e);l.removeClass=ib(l.removeClass,g);return a.push(c,"setClass",l)},animate:function(c,e,g,l,k){k=Ia(k);k.from=k.from?
+P(k.from,e):e;k.to=k.to?P(k.to,g):g;k.tempClasses=ib(k.tempClasses,l||"ng-inline-animate");return a.push(c,"animate",k)}}}]}],Se=function(){this.$get=["$$rAF","$q",function(a,c){var d=function(){};d.prototype={done:function(a){this.defer&&this.defer[!0===a?"reject":"resolve"]()},end:function(){this.done()},cancel:function(){this.done(!0)},getPromise:function(){this.defer||(this.defer=c.defer());return this.defer.promise},then:function(a,c){return this.getPromise().then(a,c)},"catch":function(a){return this.getPromise()["catch"](a)},
+"finally":function(a){return this.getPromise()["finally"](a)}};return function(c,f){function h(){a(function(){f.addClass&&(c.addClass(f.addClass),f.addClass=null);f.removeClass&&(c.removeClass(f.removeClass),f.removeClass=null);f.to&&(c.css(f.to),f.to=null);g||l.done();g=!0});return l}f.cleanupStyles&&(f.from=f.to=null);f.from&&(c.css(f.from),f.from=null);var g,l=new d;return{start:h,end:h}}}]},ga=I("$compile");Dc.$inject=["$provide","$$sanitizeUriProvider"];var Wc=/^((?:x|data)[\:\-_])/i,Of=I("$controller"),
+Vc=/^(\S+)(\s+as\s+(\w+))?$/,$e=function(){this.$get=["$document",function(a){return function(c){c?!c.nodeType&&c instanceof B&&(c=c[0]):c=a[0].body;return c.offsetWidth+1}}]},ad="application/json",$b={"Content-Type":ad+";charset=utf-8"},Qf=/^\[|^\{(?!\{)/,Rf={"[":/]$/,"{":/}$/},Pf=/^\)\]\}',?\n/,og=I("$http"),ed=function(a){return function(){throw og("legacy",a);}},La=da.$interpolateMinErr=I("$interpolate");La.throwNoconcat=function(a){throw La("noconcat",a);};La.interr=function(a,c){return La("interr",
+a,c.toString())};var pg=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Tf={http:80,https:443,ftp:21},Db=I("$location"),qg={$$html5:!1,$$replace:!1,absUrl:Eb("$$absUrl"),url:function(a){if(v(a))return this.$$url;var c=pg.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Eb("$$protocol"),host:Eb("$$host"),port:Eb("$$port"),path:jd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?a:"/"+a}),search:function(a,
+c){switch(arguments.length){case 0:return this.$$search;case 1:if(G(a)||V(a))a=a.toString(),this.$$search=yc(a);else if(C(a))a=ha(a,{}),m(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Db("isrcharg");break;default:v(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:jd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};m([id,cc,bc],function(a){a.prototype=Object.create(qg);a.prototype.state=
+function(c){if(!arguments.length)return this.$$state;if(a!==bc||!this.$$html5)throw Db("nostate");this.$$state=v(c)?null:c;return this}});var Z=I("$parse"),Uf=Function.prototype.call,Vf=Function.prototype.apply,Wf=Function.prototype.bind,Lb=fa();m("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Lb[a]=!0});var rg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},ec=function(a){this.options=a};ec.prototype={constructor:ec,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.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=Lb[c],f=Lb[d];Lb[a]||e||f?(a=f?d:e?c: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,c){return-1!==c.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||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===
+a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=A(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw Z("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=F(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||
+e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var h=
+this.text.charAt(this.index),e=e+h;if(f)"u"===h?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=rg[h]||h,f=!1;else if("\\"===h)f=!0;else{if(h===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=h}this.index++}this.throwError("Unterminated quote",c)}};var s=function(a,c){this.lexer=a;this.options=c};s.Program="Program";s.ExpressionStatement=
+"ExpressionStatement";s.AssignmentExpression="AssignmentExpression";s.ConditionalExpression="ConditionalExpression";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.NGValueParameter="NGValueParameter";
+s.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);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()},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(),c,d;return this.expect("?")&&(c=this.expression(),this.consume(":"))?(d=this.expression(),{type:s.ConditionalExpression,test:a,alternate:c,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=this.equality();this.expect("&&");)a={type:s.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a={type:s.BinaryExpression,operator:c.text,
+left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a={type:s.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:s.BinaryExpression,operator:c.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(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=ha(this.constants[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 c;c=this.expect("(","[",".");)"("===c.text?(a={type:s.CallExpression,callee:a,arguments:this.parseArguments()},
+this.consume(")")):"["===c.text?(a={type:s.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===c.text?a={type:s.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:s.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==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}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
+c={type:s.Property,kind:"init"};this.peek().constant?c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:s.ObjectExpression,properties:a}},throwError:function(a,c){throw Z("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw Z("ueoe",this.text);var c=this.expect(a);
+c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw Z("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var h=a.text;if(h===c||h===d||h===e||h===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:s.Literal,value:!0},
+"false":{type:s.Literal,value:!1},"null":{type:s.Literal,value:null},undefined:{type:s.Literal,value:w},"this":{type:s.ThisExpression}}};sd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};U(e,d.$filter);var f="",h;this.stage="assign";if(h=qd(e))this.state.computing="assign",f=this.nextId(),this.recurse(h,f),this.return_(f),f="fn.assign="+this.generateFunction("assign",
+"s,v,l");h=od(e.body);d.stage="inputs";m(h,function(a,c){var e="fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","getStringValue",
+"ensureSafeAssignContext","ifDefined","plus","text",f))(this.$filter,Xa,Ba,ld,kd,md,Xf,nd,a);this.state=this.stage=w;f.literal=rd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;m(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")},generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=
+[],c=this;m(this.state.filters,function(d,e){a.push(d+"=$filter("+c.escape(e)+")")});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,c,d,e,f,h){var g,l,k=this,n,p;e=e||y;if(!h&&A(a.watchId))c=c||this.nextId(),this.if_("i",this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case s.Program:m(a.body,
+function(c,d){k.recurse(c.expression,w,w,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,";"):k.return_(l)});break;case s.Literal:p=this.escape(a.value);this.assign(c,p);e(p);break;case s.UnaryExpression:this.recurse(a.argument,w,w,function(a){l=a});p=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,p);e(p);break;case s.BinaryExpression:this.recurse(a.left,w,w,function(a){g=a});this.recurse(a.right,w,w,function(a){l=a});p="+"===a.operator?this.plus(g,l):"-"===a.operator?this.ifDefined(g,
+0)+a.operator+this.ifDefined(l,0):"("+g+")"+a.operator+"("+l+")";this.assign(c,p);e(p);break;case s.LogicalExpression:c=c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case s.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c);break;case s.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",
+a.name)+"?l:s"),d.computed=!1,d.name=a.name);Xa(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case s.MemberExpression:g=d&&(d.context=this.nextId())||
+this.nextId();c=c||this.nextId();k.recurse(a.object,g,w,function(){k.if_(k.notNull(g),function(){if(a.computed)l=k.nextId(),k.recurse(a.property,l),k.getStringValue(l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(g,l)),k.lazyAssign(k.computedMember(g,l),"{}")),p=k.ensureSafeObject(k.computedMember(g,l)),k.assign(c,p),d&&(d.computed=!0,d.name=l);else{Xa(a.property.name);f&&1!==f&&k.if_(k.not(k.nonComputedMember(g,a.property.name)),k.lazyAssign(k.nonComputedMember(g,a.property.name),
+"{}"));p=k.nonComputedMember(g,a.property.name);if(k.state.expensiveChecks||Fb(a.property.name))p=k.ensureSafeObject(p);k.assign(c,p);d&&(d.computed=!1,d.name=a.property.name)}},function(){k.assign(c,"undefined")});e(c)},!!f);break;case s.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),n=[],m(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);n.push(c)}),p=l+"("+n.join(",")+")",k.assign(c,p),e(c)):(l=k.nextId(),g={},n=[],k.recurse(a.callee,l,g,function(){k.if_(k.notNull(l),
+function(){k.addEnsureSafeFunction(l);m(a.arguments,function(a){k.recurse(a,k.nextId(),w,function(a){n.push(k.ensureSafeObject(a))})});g.name?(k.state.expensiveChecks||k.addEnsureSafeObject(g.context),p=k.member(g.context,g.name,g.computed)+"("+n.join(",")+")"):p=l+"("+n.join(",")+")";p=k.ensureSafeObject(p);k.assign(c,p)},function(){k.assign(c,"undefined")});e(c)}));break;case s.AssignmentExpression:l=this.nextId();g={};if(!pd(a.left))throw Z("lval");this.recurse(a.left,w,g,function(){k.if_(k.notNull(g.context),
+function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(g.context,g.name,g.computed));k.addEnsureSafeAssignContext(g.context);p=k.member(g.context,g.name,g.computed)+a.operator+l;k.assign(c,p);e(c||p)})},1);break;case s.ArrayExpression:n=[];m(a.elements,function(a){k.recurse(a,k.nextId(),w,function(a){n.push(a)})});p="["+n.join(",")+"]";this.assign(c,p);e(p);break;case s.ObjectExpression:n=[];m(a.properties,function(a){k.recurse(a.value,k.nextId(),w,function(c){n.push(k.escape(a.key.type===
+s.Identifier?a.key.name:""+a.key.value)+":"+c)})});p="{"+n.join(",")+"}";this.assign(c,p);e(p);break;case s.ThisExpression:this.assign(c,"s");e("s");break;case s.NGValueParameter:this.assign(c,"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=
+this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+a+","+c+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+"."+c},computedMember:function(a,
+c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},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),";")},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+",text)")},ensureSafeAssignContext:function(a){return"ensureSafeAssignContext("+a+",text)"},lazyRecurse:function(a,c,d,e,f,h){var g=this;return function(){g.recurse(a,c,d,e,f,h)}},lazyAssign:function(a,c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,
+stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(G(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(V(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 Z("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};
+td.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;U(e,d.$filter);var f,h;if(f=qd(e))h=this.recurse(f);f=od(e.body);var g;f&&(g=[],m(f,function(a,c){var e=d.recurse(a);a.input=e;g.push(e);a.watchId=c}));var l=[];m(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;m(l,function(e){d=e(a,c)});return d};h&&(f.assign=function(a,c,d){return h(a,d,c)});g&&(f.inputs=
+g);f.literal=rd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,h=this,g;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case s.Literal:return this.value(a.value,c);case s.UnaryExpression:return f=this.recurse(a.argument),this["unary"+a.operator](f,c);case s.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case s.LogicalExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,
+f,c);case s.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case s.Identifier:return Xa(a.name,h.expression),h.identifier(a.name,h.expensiveChecks||Fb(a.name),c,d,h.expression);case s.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Xa(a.property.name,h.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?this.computedMember(e,f,c,d,h.expression):this.nonComputedMember(e,f,
+h.expensiveChecks,c,d,h.expression);case s.CallExpression:return g=[],m(a.arguments,function(a){g.push(h.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,h){for(var r=[],m=0;m<g.length;++m)r.push(g[m](a,d,e,h));a=f.apply(w,r,h);return c?{context:w,name:w,value:a}:a}:function(a,d,e,p){var r=f(a,d,e,p),m;if(null!=r.value){Ba(r.context,h.expression);ld(r.value,h.expression);m=[];for(var s=0;s<g.length;++s)m.push(Ba(g[s](a,d,e,p),
+h.expression));m=Ba(r.value.apply(r.context,m),h.expression)}return c?{value:m}:m};case s.AssignmentExpression:return e=this.recurse(a.left,!0,1),f=this.recurse(a.right),function(a,d,g,p){var r=e(a,d,g,p);a=f(a,d,g,p);Ba(r.value,h.expression);md(r.context);r.context[r.name]=a;return c?{value:a}:a};case s.ArrayExpression:return g=[],m(a.elements,function(a){g.push(h.recurse(a))}),function(a,d,e,f){for(var h=[],m=0;m<g.length;++m)h.push(g[m](a,d,e,f));return c?{value:h}:h};case s.ObjectExpression:return g=
+[],m(a.properties,function(a){g.push({key:a.key.type===s.Identifier?a.key.name:""+a.key.value,value:h.recurse(a.value)})}),function(a,d,e,f){for(var h={},m=0;m<g.length;++m)h[g[m].key]=g[m].value(a,d,e,f);return c?{value:h}:h};case s.ThisExpression:return function(a){return c?{value:a}:a};case s.NGValueParameter:return function(a,d,e,f){return c?{value:e}:e}}},"unary+":function(a,c){return function(d,e,f,h){d=a(d,e,f,h);d=A(d)?+d:0;return c?{value:d}:d}},"unary-":function(a,c){return function(d,e,
+f,h){d=a(d,e,f,h);d=A(d)?-d:0;return c?{value:d}:d}},"unary!":function(a,c){return function(d,e,f,h){d=!a(d,e,f,h);return c?{value:d}:d}},"binary+":function(a,c,d){return function(e,f,h,g){var l=a(e,f,h,g);e=c(e,f,h,g);l=nd(l,e);return d?{value:l}:l}},"binary-":function(a,c,d){return function(e,f,h,g){var l=a(e,f,h,g);e=c(e,f,h,g);l=(A(l)?l:0)-(A(e)?e:0);return d?{value:l}:l}},"binary*":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)*c(e,f,h,g);return d?{value:e}:e}},"binary/":function(a,c,
+d){return function(e,f,h,g){e=a(e,f,h,g)/c(e,f,h,g);return d?{value:e}:e}},"binary%":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)%c(e,f,h,g);return d?{value:e}:e}},"binary===":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)===c(e,f,h,g);return d?{value:e}:e}},"binary!==":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)!==c(e,f,h,g);return d?{value:e}:e}},"binary==":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)==c(e,f,h,g);return d?{value:e}:e}},"binary!=":function(a,c,
+d){return function(e,f,h,g){e=a(e,f,h,g)!=c(e,f,h,g);return d?{value:e}:e}},"binary<":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)<c(e,f,h,g);return d?{value:e}:e}},"binary>":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)>c(e,f,h,g);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)<=c(e,f,h,g);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)>=c(e,f,h,g);return d?{value:e}:e}},"binary&&":function(a,c,d){return function(e,
+f,h,g){e=a(e,f,h,g)&&c(e,f,h,g);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,h,g){e=a(e,f,h,g)||c(e,f,h,g);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,h,g,l){f=a(f,h,g,l)?c(f,h,g,l):d(f,h,g,l);return e?{value:f}:f}},value:function(a,c){return function(){return c?{context:w,name:w,value:a}:a}},identifier:function(a,c,d,e,f){return function(h,g,l,k){h=g&&a in g?g:h;e&&1!==e&&h&&!h[a]&&(h[a]={});g=h?h[a]:w;c&&Ba(g,f);return d?{context:h,name:a,value:g}:
+g}},computedMember:function(a,c,d,e,f){return function(h,g,l,k){var n=a(h,g,l,k),p,m;null!=n&&(p=c(h,g,l,k),p=kd(p),Xa(p,f),e&&1!==e&&n&&!n[p]&&(n[p]={}),m=n[p],Ba(m,f));return d?{context:n,name:p,value:m}:m}},nonComputedMember:function(a,c,d,e,f,h){return function(g,l,k,n){g=a(g,l,k,n);f&&1!==f&&g&&!g[c]&&(g[c]={});l=null!=g?g[c]:w;(d||Fb(c))&&Ba(l,h);return e?{context:g,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,h){return h?h[c]:a(d,e,f)}}};var fc=function(a,c,d){this.lexer=
+a;this.$filter=c;this.options=d;this.ast=new s(this.lexer);this.astCompiler=d.csp?new td(this.ast,c):new sd(this.ast,c)};fc.prototype={constructor:fc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};fa();fa();var Yf=Object.prototype.valueOf,Ca=I("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ga=I("$compile"),$=X.createElement("a"),xd=Aa(Q.location.href);yd.$inject=["$document"];Kc.$inject=["$provide"];zd.$inject=["$locale"];Bd.$inject=
+["$locale"];var hc=".",hg={yyyy:aa("FullYear",4),yy:aa("FullYear",2,0,!0),y:aa("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:aa("Month",2,1),M:aa("Month",1,1),dd:aa("Date",2),d:aa("Date",1),HH:aa("Hours",2),H:aa("Hours",1),hh:aa("Hours",2,-12),h:aa("Hours",1,-12),mm:aa("Minutes",2),m:aa("Minutes",1),ss:aa("Seconds",2),s:aa("Seconds",1),sss:aa("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,c,d){a=-1*d;return a=(0<=
+a?"+":"")+(Gb(Math[0<a?"floor":"ceil"](a/60),2)+Gb(Math.abs(a%60),2))},ww:Fd(2),w:Fd(1),G:ic,GG:ic,GGG:ic,GGGG:function(a,c){return 0>=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},gg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,fg=/^\-?\d+$/;Ad.$inject=["$locale"];var cg=qa(F),dg=qa(sb);Cd.$inject=["$parse"];var he=qa({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f="[object SVGAnimatedString]"===
+va.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),tb={};m(Bb,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=ya("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});tb[e]=function(){return{restrict:"A",priority:100,link:f}}}});m($c,function(a,c){tb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&(e=f.ngPattern.match(jg))){f.$set("ngPattern",
+new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});m(["src","srcset","href"],function(a){var c=ya("ng-"+a);tb[c]=function(){return{priority:99,link:function(d,e,f){var h=a,g=a;"href"===a&&"[object SVGAnimatedString]"===va.call(e.prop("href"))&&(g="xlinkHref",f.$attr[g]="xlink:href",h=null);f.$observe(c,function(c){c?(f.$set(g,c),Wa&&h&&e.prop(h,f[g])):"href"===a&&f.$set(g,null)})}}}});var Ib={$addControl:y,$$renameControl:function(a,c){a.$name=c},$removeControl:y,$setValidity:y,
+$setDirty:y,$setPristine:y,$setSubmitted:y};Gd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Od=function(a){return["$timeout","$parse",function(c,d){function e(a){return""===a?d('this[""]').assign:d(a).assign||y}return{name:"form",restrict:a?"EAC":"E",require:["form","^^?form"],controller:Gd,compile:function(d,h){d.addClass(Ya).addClass(mb);var g=h.name?"name":a&&h.ngForm?"ngForm":!1;return{pre:function(a,d,f,h){var m=h[0];if(!("action"in f)){var t=function(c){a.$apply(function(){m.$commitViewValue();
+m.$setSubmitted()});c.preventDefault()};d[0].addEventListener("submit",t,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",t,!1)},0,!1)})}(h[1]||m.$$parentForm).$addControl(m);var s=g?e(m.$name):y;g&&(s(a,m),f.$observe(g,function(c){m.$name!==c&&(s(a,w),m.$$parentForm.$$renameControl(m,c),s=e(m.$name),s(a,m))}));d.on("$destroy",function(){m.$$parentForm.$removeControl(m);s(a,w);P(m,Ib)})}}}}}]},ie=Od(),ve=Od(!0),ig=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,
+sg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,tg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,ug=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))([eE][+-]?\d+)?\s*$/,Pd=/^(\d{4})-(\d{2})-(\d{2})$/,Qd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,lc=/^(\d{4})-W(\d\d)$/,Rd=/^(\d{4})-(\d\d)$/,Sd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Td={text:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e)},date:kb("date",
+Pd,Kb(Pd,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":kb("datetimelocal",Qd,Kb(Qd,"yyyy MM dd HH mm ss sss".split(" ")),"yyyy-MM-ddTHH:mm:ss.sss"),time:kb("time",Sd,Kb(Sd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:kb("week",lc,function(a,c){if(ea(a))return a;if(G(a)){lc.lastIndex=0;var d=lc.exec(a);if(d){var e=+d[1],f=+d[2],h=d=0,g=0,l=0,k=Ed(e),f=7*(f-1);c&&(d=c.getHours(),h=c.getMinutes(),g=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,h,g,l)}}return NaN},"yyyy-Www"),
+month:kb("month",Rd,Kb(Rd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,h){Id(a,c,d,e);jb(a,c,d,e,f,h);e.$$parserName="number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:ug.test(a)?parseFloat(a):w});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw lb("numfmt",a);a=a.toString()}return a});if(A(d.min)||d.ngMin){var g;e.$validators.min=function(a){return e.$isEmpty(a)||v(g)||a>=g};d.$observe("min",function(a){A(a)&&!V(a)&&(a=parseFloat(a,10));g=V(a)&&!isNaN(a)?a:w;e.$validate()})}if(A(d.max)||
+d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||v(l)||a<=l};d.$observe("max",function(a){A(a)&&!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:w;e.$validate()})}},url:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||sg.test(d)}},email:function(a,c,d,e,f,h){jb(a,c,d,e,f,h);jc(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||tg.test(d)}},radio:function(a,c,
+d,e){v(d.name)&&c.attr("name",++nb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,h,g,l){var k=Jd(l,a,"ngTrueValue",d.ngTrueValue,!0),n=Jd(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,
+k)});e.$parsers.push(function(a){return a?k:n})},hidden:y,button:y,submit:y,reset:y,file:y},Ec=["$browser","$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,h,g,l){l[0]&&(Td[F(g.type)]||Td.text)(f,h,g,l[0],c,a,d,e)}}}}],vg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a,c){return vg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",
+a)})}}}},ne=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=v(a)?"":a})}}}}],pe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,h){d=a(f.attr(h.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];h.$observe("ngBindTemplate",function(a){f.textContent=v(a)?"":a})}}}}],oe=["$sce","$parse",
+"$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var h=c(f.ngBindHtml),g=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(g,function(){e.html(a.getTrustedHtml(h(c))||"")})}}}}],Me=qa({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),qe=kc("",!0),se=kc("Odd",0),re=kc("Even",1),te=Na({compile:function(a,c){c.$set("ngCloak",
+w);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",scope:!0,controller:"@",priority:500}}],Jc={},wg={blur:!0,focus:!0};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=ya("ng-"+a);Jc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,h){var g=d(h[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){g(c,{$event:d})};
+wg[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var xe=["$animate",function(a){return{multiElement:!0,transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,h){var g,l,k;c.$watch(e.ngIf,function(c){c?l||h(function(c,f){l=f;c[c.length++]=X.createComment(" end ngIf: "+e.ngIf+" ");g={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),g&&(k=rb(g.clone),a.leave(k).then(function(){k=null}),g=null))})}}}],ye=["$templateRequest","$anchorScroll",
+"$animate",function(a,c,d){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",controller:da.noop,compile:function(e,f){var h=f.ngInclude||f.src,g=f.onload||"",l=f.autoscroll;return function(e,f,m,r,t){var s=0,v,u,q,z=function(){u&&(u.remove(),u=null);v&&(v.$destroy(),v=null);q&&(d.leave(q).then(function(){u=null}),u=q,q=null)};e.$watch(h,function(h){var m=function(){!A(l)||l&&!e.$eval(l)||c()},p=++s;h?(a(h,!0).then(function(a){if(p===s){var c=e.$new();r.template=a;a=t(c,function(a){z();
+d.enter(a,null,f).then(m)});v=c;q=a;v.$emit("$includeContentLoaded",h);e.$eval(g)}},function(){p===s&&(z(),e.$emit("$includeContentError",h))}),e.$emit("$includeContentRequested",h)):(z(),r.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Mc(f.template,X).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ze=Na({priority:450,
+compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",h="false"!==d.ngTrim,g=h?T(f):f;e.$parsers.push(function(a){if(!v(a)){var c=[];a&&m(a.split(g),function(a){a&&c.push(h?T(a):a)});return c}});e.$formatters.push(function(a){return J(a)?a.join(f):w});e.$isEmpty=function(a){return!a||!a.length}}}},mb="ng-valid",Kd="ng-invalid",Ya="ng-pristine",Jb="ng-dirty",Md=
+"ng-pending",lb=I("ngModel"),xg=["$scope","$exceptionHandler","$attrs","$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,h,g,l,k,n){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=w;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=
+w;this.$name=n(d.name||"",!1)(a);this.$$parentForm=Ib;var p=f(d.ngModel),r=p.assign,t=p,s=r,K=null,u,q=this;this.$$setOptions=function(a){if((q.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");t=function(a){var d=p(a);x(d)&&(d=c(a));return d};s=function(a,c){x(p(a))?g(a,{$$$p:q.$modelValue}):r(a,q.$modelValue)}}else if(!p.assign)throw lb("nonassign",d.ngModel,xa(e));};this.$render=y;this.$isEmpty=function(a){return v(a)||""===a||null===a||a!==a};var z=0;Hd({ctrl:this,$element:e,
+set:function(a,c){a[c]=!0},unset:function(a,c){delete a[c]},$animate:h});this.$setPristine=function(){q.$dirty=!1;q.$pristine=!0;h.removeClass(e,Jb);h.addClass(e,Ya)};this.$setDirty=function(){q.$dirty=!0;q.$pristine=!1;h.removeClass(e,Ya);h.addClass(e,Jb);q.$$parentForm.$setDirty()};this.$setUntouched=function(){q.$touched=!1;q.$untouched=!0;h.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){q.$touched=!0;q.$untouched=!1;h.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=
+function(){g.cancel(K);q.$viewValue=q.$$lastCommittedViewValue;q.$render()};this.$validate=function(){if(!V(q.$modelValue)||!isNaN(q.$modelValue)){var a=q.$$rawModelValue,c=q.$valid,d=q.$modelValue,e=q.$options&&q.$options.allowInvalid;q.$$runValidators(a,q.$$lastCommittedViewValue,function(f){e||c===f||(q.$modelValue=f?a:w,q.$modelValue!==d&&q.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d){function e(){var d=!0;m(q.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?
+!0:(m(q.$asyncValidators,function(a,c){g(c,null)}),!1)}function f(){var d=[],e=!0;m(q.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!x(k.then))throw lb("$asyncValidators",k);g(h,w);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},y):h(!0)}function g(a,c){l===z&&q.$setValidity(a,c)}function h(a){l===z&&d(a)}z++;var l=z;(function(){var a=q.$$parserName||"parse";if(v(u))g(a,null);else return u||(m(q.$validators,function(a,c){g(c,null)}),m(q.$asyncValidators,
+function(a,c){g(c,null)})),g(a,u),u;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=q.$viewValue;g.cancel(K);if(q.$$lastCommittedViewValue!==a||""===a&&q.$$hasNativeValidators)q.$$lastCommittedViewValue=a,q.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=q.$$lastCommittedViewValue;if(u=v(c)?w:!0)for(var d=0;d<q.$parsers.length;d++)if(c=q.$parsers[d](c),v(c)){u=!1;break}V(q.$modelValue)&&isNaN(q.$modelValue)&&(q.$modelValue=t(a));
+var e=q.$modelValue,f=q.$options&&q.$options.allowInvalid;q.$$rawModelValue=c;f&&(q.$modelValue=c,q.$modelValue!==e&&q.$$writeModelToScope());q.$$runValidators(c,q.$$lastCommittedViewValue,function(a){f||(q.$modelValue=a?c:w,q.$modelValue!==e&&q.$$writeModelToScope())})};this.$$writeModelToScope=function(){s(a,q.$modelValue);m(q.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){q.$viewValue=a;q.$options&&!q.$options.updateOnDefault||q.$$debounceViewValueCommit(c)};
+this.$$debounceViewValueCommit=function(c){var d=0,e=q.$options;e&&A(e.debounce)&&(e=e.debounce,V(e)?d=e:V(e[c])?d=e[c]:V(e["default"])&&(d=e["default"]));g.cancel(K);d?K=g(function(){q.$commitViewValue()},d):l.$$phase?q.$commitViewValue():a.$apply(function(){q.$commitViewValue()})};a.$watch(function(){var c=t(a);if(c!==q.$modelValue&&(q.$modelValue===q.$modelValue||c===c)){q.$modelValue=q.$$rawModelValue=c;u=w;for(var d=q.$formatters,e=d.length,f=c;e--;)f=d[e](f);q.$viewValue!==f&&(q.$viewValue=
+q.$$lastCommittedViewValue=f,q.$render(),q.$$runValidators(c,f,y))}return c})}],Ke=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:xg,priority:1,compile:function(c){c.addClass(Ya).addClass("ng-untouched").addClass(mb);return{pre:function(a,c,f,h){var g=h[0];c=h[1]||g.$$parentForm;g.$$setOptions(h[2]&&h[2].$options);c.$addControl(g);f.$observe("name",function(a){g.$name!==a&&g.$$parentForm.$$renameControl(g,a)});a.$on("$destroy",function(){g.$$parentForm.$removeControl(g)})},
+post:function(c,e,f,h){var g=h[0];if(g.$options&&g.$options.updateOn)e.on(g.$options.updateOn,function(a){g.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){g.$touched||(a.$$phase?c.$evalAsync(g.$setTouched):c.$apply(g.$setTouched))})}}}}}],yg=/(\s+|^)default(\s+|$)/,Oe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=ha(a.$eval(c.ngModelOptions));A(this.$options.updateOn)?(this.$options.updateOnDefault=!1,this.$options.updateOn=T(this.$options.updateOn.replace(yg,
+function(){d.$options.updateOnDefault=!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ae=Na({terminal:!0,priority:1E3}),zg=I("ngOptions"),Ag=/^\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]+?))?$/,Ie=["$compile","$parse",function(a,c){function d(a,d,e){function f(a,c,d,e,g){this.selectValue=a;this.viewValue=c;this.label=
+d;this.group=e;this.disabled=g}function n(a){var c;if(!s&&Da(a))c=a;else{c=[];for(var d in a)a.hasOwnProperty(d)&&"$"!==d.charAt(0)&&c.push(d)}return c}var m=a.match(Ag);if(!m)throw zg("iexp",a,xa(d));var r=m[5]||m[7],s=m[6];a=/ as /.test(m[0])&&m[1];var v=m[9];d=c(m[2]?m[1]:r);var w=a&&c(a)||d,u=v&&c(v),q=v?function(a,c){return u(e,c)}:function(a){return Ga(a)},z=function(a,c){return q(a,x(a,c))},y=c(m[2]||m[1]),A=c(m[3]||""),O=c(m[4]||""),H=c(m[8]),B={},x=s?function(a,c){B[s]=c;B[r]=a;return B}:
+function(a){B[r]=a;return B};return{trackBy:v,getTrackByValue:z,getWatchables:c(H,function(a){var c=[];a=a||[];for(var d=n(a),f=d.length,g=0;g<f;g++){var h=a===d?g:d[g],k=x(a[h],h),h=q(a[h],k);c.push(h);if(m[2]||m[1])h=y(e,k),c.push(h);m[4]&&(k=O(e,k),c.push(k))}return c}),getOptions:function(){for(var a=[],c={},d=H(e)||[],g=n(d),h=g.length,m=0;m<h;m++){var p=d===g?m:g[m],r=x(d[p],p),s=w(e,r),p=q(s,r),t=y(e,r),u=A(e,r),r=O(e,r),s=new f(p,s,t,u,r);a.push(s);c[p]=s}return{items:a,selectValueMap:c,getOptionFromViewValue:function(a){return c[z(a)]},
+getViewValueFromOption:function(a){return v?da.copy(a.viewValue):a.viewValue}}}}}var e=X.createElement("option"),f=X.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(c,g,l,k){function n(a,c){a.element=c;c.disabled=a.disabled;a.label!==c.label&&(c.label=a.label,c.textContent=a.label);a.value!==c.value&&(c.value=a.selectValue)}function p(a,c,d,e){c&&F(c.nodeName)===d?d=c:(d=e.cloneNode(!1),c?a.insertBefore(d,c):a.appendChild(d));return d}function r(a){for(var c;a;)c=
+a.nextSibling,Wb(a),a=c}function s(a){var c=q&&q[0],d=H&&H[0];if(c||d)for(;a&&(a===c||a===d||c&&8===c.nodeType);)a=a.nextSibling;return a}function v(){var a=x&&u.readValue();x=C.getOptions();var c={},d=g[0].firstChild;O&&g.prepend(q);d=s(d);x.items.forEach(function(a){var h,k;a.group?(h=c[a.group],h||(h=p(g[0],d,"optgroup",f),d=h.nextSibling,h.label=a.group,h=c[a.group]={groupElement:h,currentOptionElement:h.firstChild}),k=p(h.groupElement,h.currentOptionElement,"option",e),n(a,k),h.currentOptionElement=
+k.nextSibling):(k=p(g[0],d,"option",e),n(a,k),d=k.nextSibling)});Object.keys(c).forEach(function(a){r(c[a].currentOptionElement)});r(d);w.$render();if(!w.$isEmpty(a)){var h=u.readValue();(C.trackBy?ka(a,h):a===h)||(w.$setViewValue(h),w.$render())}}var w=k[1];if(w){var u=k[0];k=l.multiple;for(var q,z=0,y=g.children(),A=y.length;z<A;z++)if(""===y[z].value){q=y.eq(z);break}var O=!!q,H=B(e.cloneNode(!1));H.val("?");var x,C=d(l.ngOptions,g,c);k?(w.$isEmpty=function(a){return!a||0===a.length},u.writeValue=
+function(a){x.items.forEach(function(a){a.element.selected=!1});a&&a.forEach(function(a){(a=x.getOptionFromViewValue(a))&&!a.disabled&&(a.element.selected=!0)})},u.readValue=function(){var a=g.val()||[],c=[];m(a,function(a){(a=x.selectValueMap[a])&&!a.disabled&&c.push(x.getViewValueFromOption(a))});return c},C.trackBy&&c.$watchCollection(function(){if(J(w.$viewValue))return w.$viewValue.map(function(a){return C.getTrackByValue(a)})},function(){w.$render()})):(u.writeValue=function(a){var c=x.getOptionFromViewValue(a);
+c&&!c.disabled?g[0].value!==c.selectValue&&(H.remove(),O||q.remove(),g[0].value=c.selectValue,c.element.selected=!0,c.element.setAttribute("selected","selected")):null===a||O?(H.remove(),O||g.prepend(q),g.val(""),q.prop("selected",!0),q.attr("selected",!0)):(O||q.remove(),g.prepend(H),g.val("?"),H.prop("selected",!0),H.attr("selected",!0))},u.readValue=function(){var a=x.selectValueMap[g.val()];return a&&!a.disabled?(O||q.remove(),H.remove(),x.getViewValueFromOption(a)):null},C.trackBy&&c.$watch(function(){return C.getTrackByValue(w.$viewValue)},
+function(){w.$render()}));O?(q.remove(),a(q)(c),q.removeClass("ng-scope")):q=B(e.cloneNode(!1));v();c.$watchCollection(C.getWatchables,v)}}}}],Be=["$locale","$interpolate","$log",function(a,c,d){var e=/{}/g,f=/^when(Minus)?(.+)$/;return{link:function(h,g,l){function k(a){g.text(a||"")}var n=l.count,p=l.$attr.when&&g.attr(l.$attr.when),r=l.offset||0,s=h.$eval(p)||{},w={},A=c.startSymbol(),u=c.endSymbol(),q=A+n+"-"+r+u,z=da.noop,x;m(l,function(a,c){var d=f.exec(c);d&&(d=(d[1]?"-":"")+F(d[2]),s[d]=g.attr(l.$attr[c]))});
+m(s,function(a,d){w[d]=c(a.replace(e,q))});h.$watch(n,function(c){var e=parseFloat(c),f=isNaN(e);f||e in s||(e=a.pluralCat(e-r));e===x||f&&V(x)&&isNaN(x)||(z(),f=w[e],v(f)?(null!=c&&d.debug("ngPluralize: no rule defined for '"+e+"' in "+p),z=y,k()):z=h.$watch(f,k),x=e)})}}}],Ce=["$parse","$animate",function(a,c){var d=I("ngRepeat"),e=function(a,c,d,e,k,m,p){a[d]=e;k&&(a[k]=m);a.$index=c;a.$first=0===c;a.$last=c===p-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",
+multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,h){var g=h.ngRepeat,l=X.createComment(" end ngRepeat: "+g+" "),k=g.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",g);var n=k[1],p=k[2],r=k[3],s=k[4],k=n.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",n);var v=k[3]||k[1],y=k[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 d("badident",
+r);var u,q,z,A,x={$id:Ga};s?u=a(s):(z=function(a,c){return Ga(c)},A=function(a){return a});return function(a,f,h,k,n){u&&(q=function(c,d,e){y&&(x[y]=c);x[v]=d;x.$index=e;return u(a,x)});var s=fa();a.$watchCollection(p,function(h){var k,p,t=f[0],u,x=fa(),C,G,J,M,I,F,L;r&&(a[r]=h);if(Da(h))I=h,p=q||z;else for(L in p=q||A,I=[],h)ta.call(h,L)&&"$"!==L.charAt(0)&&I.push(L);C=I.length;L=Array(C);for(k=0;k<C;k++)if(G=h===I?k:I[k],J=h[G],M=p(G,J,k),s[M])F=s[M],delete s[M],x[M]=F,L[k]=F;else{if(x[M])throw m(L,
+function(a){a&&a.scope&&(s[a.id]=a)}),d("dupes",g,M,J);L[k]={id:M,scope:w,clone:w};x[M]=!0}for(u in s){F=s[u];M=rb(F.clone);c.leave(M);if(M[0].parentNode)for(k=0,p=M.length;k<p;k++)M[k].$$NG_REMOVED=!0;F.scope.$destroy()}for(k=0;k<C;k++)if(G=h===I?k:I[k],J=h[G],F=L[k],F.scope){u=t;do u=u.nextSibling;while(u&&u.$$NG_REMOVED);F.clone[0]!=u&&c.move(rb(F.clone),null,B(t));t=F.clone[F.clone.length-1];e(F.scope,k,v,J,y,G,C)}else n(function(a,d){F.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a,
+null,B(t));t=f;F.clone=a;x[F.id]=F;e(F.scope,k,v,J,y,G,C)});s=x})}}}}],De=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],we=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ee=Na(function(a,c,d){a.$watch(d.ngStyle,
+function(a,d){d&&a!==d&&m(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Fe=["$animate",function(a){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var h=[],g=[],l=[],k=[],n=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var s=rb(g[d].clone);k[d].$destroy();(l[d]=a.leave(s)).then(n(l,d))}g.length=0;k.length=0;(h=f.cases["!"+
+c]||f.cases["?"])&&m(h,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=X.createComment(" end ngSwitchWhen: ");g.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Ge=Na({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),He=Na({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
+c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Je=Na({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw I("ngTransclude")("orphan",xa(c));f(function(a){c.empty();c.append(a)})}}),je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],Bg={$setViewValue:y,$render:y},Cg=["$element","$scope","$attrs",function(a,c,d){var e=this,f=new Ua;e.ngModelCtrl=Bg;e.unknownOption=B(X.createElement("option"));
+e.renderUnknownOption=function(c){c="? "+Ga(c)+" ?";e.unknownOption.val(c);a.prepend(e.unknownOption);a.val(c)};c.$on("$destroy",function(){e.renderUnknownOption=y});e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.readValue=function(){e.removeUnknownOption();return a.val()};e.writeValue=function(c){e.hasOption(c)?(e.removeUnknownOption(),a.val(c),""===c&&e.emptyOption.prop("selected",!0)):null==c&&e.emptyOption?(e.removeUnknownOption(),a.val("")):e.renderUnknownOption(c)};
+e.addOption=function(a,c){Ta(a,'"option value"');""===a&&(e.emptyOption=c);var d=f.get(a)||0;f.put(a,d+1)};e.removeOption=function(a){var c=f.get(a);c&&(1===c?(f.remove(a),""===a&&(e.emptyOption=w)):f.put(a,c-1))};e.hasOption=function(a){return!!f.get(a)}}],ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:Cg,link:function(a,c,d,e){var f=e[1];if(f){var h=e[0];h.ngModelCtrl=f;f.$render=function(){h.writeValue(f.$viewValue)};c.on("change",function(){a.$apply(function(){f.$setViewValue(h.readValue())})});
+if(d.multiple){h.readValue=function(){var a=[];m(c.find("option"),function(c){c.selected&&a.push(c.value)});return a};h.writeValue=function(a){var d=new Ua(a);m(c.find("option"),function(a){a.selected=A(d.get(a.value))})};var g,l=NaN;a.$watch(function(){l!==f.$viewValue||ka(g,f.$viewValue)||(g=ja(f.$viewValue),f.$render());l=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}}}},me=["$interpolate",function(a){return{restrict:"E",priority:100,compile:function(c,d){if(A(d.value))var e=a(d.value,
+!0);else{var f=a(c.text(),!0);f||d.$set("value",c.text())}return function(a,c,d){function k(a){p.addOption(a,c);p.ngModelCtrl.$render();c[0].hasAttribute("selected")&&(c[0].selected=!0)}var m=c.parent(),p=m.data("$selectController")||m.parent().data("$selectController");if(p&&p.ngModelCtrl){if(e){var r;d.$observe("value",function(a){A(r)&&p.removeOption(r);r=a;k(a)})}else f?a.$watch(f,function(a,c){d.$set("value",a);c!==a&&p.removeOption(c);k(a)}):k(d.value);c.on("$destroy",function(){p.removeOption(d.value);
+p.ngModelCtrl.$render()})}}}}}],le=qa({restrict:"E",terminal:!1}),Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}},Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,h=d.ngPattern||d.pattern;d.$observe("pattern",function(a){G(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw I("ngPattern")("noregexp",
+h,a,xa(c));f=a||w;e.$validate()});e.$validators.pattern=function(a,c){return e.$isEmpty(c)||v(f)||f.test(c)}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=Y(a);f=isNaN(a)?-1:a;e.$validate()});e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(c)||c.length<=f}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=Y(a)||0;e.$validate()});
+e.$validators.minlength=function(a,c){return e.$isEmpty(c)||c.length>=f}}}}};Q.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(ce(),ee(da),da.module("ngLocale",[],["$provide",function(a){function c(a){a+="";var c=a.indexOf(".");return-1==c?0:a.length-c-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(" "),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",pluralCat:function(a,e){var f=a|0,h=e;w===h&&(h=Math.min(c(a),3));Math.pow(10,h);return 1==f&&0==h?"one":"other"}})}]),B(X).ready(function(){Zd(X,zc)}))})(window,document);!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>');
+//# sourceMappingURL=angular.min.js.map
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.gzip b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.gzip
new file mode 100644
index 0000000..ede8ca3
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.gzip
Binary files differ
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.map b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.map
new file mode 100644
index 0000000..a57c997
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/angular.min.js.map
@@ -0,0 +1,8 @@
+{
+"version":3,
+"file":"angular.min.js",
+"lineCount":293,
+"mappings":"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",
+"sources":["angular.js"],
+"names":["window","document","undefined","minErr","isArrayLike","obj","isWindow","length","Object","nodeType","NODE_TYPE_ELEMENT","isString","isArray","forEach","iterator","context","key","isFunction","hasOwnProperty","call","isPrimitive","isBlankObject","forEachSorted","keys","sort","i","reverseParams","iteratorFn","value","nextUid","uid","setHashKey","h","$$hashKey","baseExtend","dst","objs","deep","ii","isObject","j","jj","src","isDate","Date","valueOf","isRegExp","RegExp","extend","slice","arguments","merge","toInt","str","parseInt","inherit","parent","extra","create","noop","identity","$","valueFn","hasCustomToString","toString","prototype","isUndefined","isDefined","getPrototypeOf","isNumber","isScope","$evalAsync","$watch","isBoolean","isElement","node","nodeName","prop","attr","find","makeMap","items","split","nodeName_","element","lowercase","arrayRemove","array","index","indexOf","splice","copy","source","destination","stackSource","stackDest","ngMinErr","TYPED_ARRAY_REGEXP","test","push","constructor","getTime","match","lastIndex","cloneNode","emptyObject","shallowCopy","charAt","equals","o1","o2","t1","t2","keySet","createMap","concat","array1","array2","bind","self","fn","curryArgs","startIndex","apply","toJsonReplacer","val","toJson","pretty","JSON","stringify","fromJson","json","parse","timezoneToOffset","timezone","fallback","requestedTimezoneOffset","isNaN","convertTimezoneToLocal","date","reverse","timezoneOffset","getTimezoneOffset","setMinutes","getMinutes","minutes","startingTag","jqLite","clone","empty","e","elemHtml","append","html","NODE_TYPE_TEXT","replace","tryDecodeURIComponent","decodeURIComponent","parseKeyValue","keyValue","splitPoint","substring","toKeyValue","parts","arrayValue","encodeUriQuery","join","encodeUriSegment","pctEncodeSpaces","encodeURIComponent","getNgAttribute","ngAttr","ngAttrPrefixes","getAttribute","angularInit","bootstrap","appElement","module","config","prefix","name","hasAttribute","candidate","querySelector","strictDi","modules","defaultConfig","doBootstrap","injector","tag","unshift","$provide","debugInfoEnabled","$compileProvider","createInjector","invoke","bootstrapApply","scope","compile","$apply","data","NG_ENABLE_DEBUG_INFO","NG_DEFER_BOOTSTRAP","angular","resumeBootstrap","angular.resumeBootstrap","extraModules","resumeDeferredBootstrap","reloadWithDebugInfo","location","reload","getTestability","rootElement","get","snake_case","separator","SNAKE_CASE_REGEXP","letter","pos","toLowerCase","bindJQuery","originalCleanData","bindJQueryFired","jqName","jq","jQuery","on","JQLitePrototype","isolateScope","controller","inheritedData","cleanData","jQuery.cleanData","elems","events","skipDestroyOnNextJQueryCleanData","elem","_data","$destroy","triggerHandler","JQLite","assertArg","arg","reason","assertArgFn","acceptArrayAnnotation","assertNotHasOwnProperty","getter","path","bindFnToScope","lastInstance","len","getBlockNodes","nodes","endNode","blockNodes","nextSibling","setupModuleLoader","ensure","factory","$injectorMinErr","$$minErr","requires","configFn","invokeLater","provider","method","insertMethod","queue","invokeQueue","moduleInstance","invokeLaterAndSetModuleName","recipeName","factoryFunction","$$moduleName","configBlocks","runBlocks","_invokeQueue","_configBlocks","_runBlocks","service","constant","decorator","animation","filter","directive","run","block","publishExternalAPI","version","uppercase","counter","csp","angularModule","ngModule","$$sanitizeUri","$$SanitizeUriProvider","$CompileProvider","a","htmlAnchorDirective","input","inputDirective","textarea","form","formDirective","script","scriptDirective","select","selectDirective","style","styleDirective","option","optionDirective","ngBind","ngBindDirective","ngBindHtml","ngBindHtmlDirective","ngBindTemplate","ngBindTemplateDirective","ngClass","ngClassDirective","ngClassEven","ngClassEvenDirective","ngClassOdd","ngClassOddDirective","ngCloak","ngCloakDirective","ngController","ngControllerDirective","ngForm","ngFormDirective","ngHide","ngHideDirective","ngIf","ngIfDirective","ngInclude","ngIncludeDirective","ngInit","ngInitDirective","ngNonBindable","ngNonBindableDirective","ngPluralize","ngPluralizeDirective","ngRepeat","ngRepeatDirective","ngShow","ngShowDirective","ngStyle","ngStyleDirective","ngSwitch","ngSwitchDirective","ngSwitchWhen","ngSwitchWhenDirective","ngSwitchDefault","ngSwitchDefaultDirective","ngOptions","ngOptionsDirective","ngTransclude","ngTranscludeDirective","ngModel","ngModelDirective","ngList","ngListDirective","ngChange","ngChangeDirective","pattern","patternDirective","ngPattern","required","requiredDirective","ngRequired","minlength","minlengthDirective","ngMinlength","maxlength","maxlengthDirective","ngMaxlength","ngValue","ngValueDirective","ngModelOptions","ngModelOptionsDirective","ngIncludeFillContentDirective","ngAttributeAliasDirectives","ngEventDirectives","$anchorScroll","$AnchorScrollProvider","$animate","$AnimateProvider","$animateCss","$CoreAnimateCssProvider","$$animateQueue","$$CoreAnimateQueueProvider","$$AnimateRunner","$$CoreAnimateRunnerProvider","$browser","$BrowserProvider","$cacheFactory","$CacheFactoryProvider","$controller","$ControllerProvider","$document","$DocumentProvider","$exceptionHandler","$ExceptionHandlerProvider","$filter","$FilterProvider","$$forceReflow","$$ForceReflowProvider","$interpolate","$InterpolateProvider","$interval","$IntervalProvider","$http","$HttpProvider","$httpParamSerializer","$HttpParamSerializerProvider","$httpParamSerializerJQLike","$HttpParamSerializerJQLikeProvider","$httpBackend","$HttpBackendProvider","$xhrFactory","$xhrFactoryProvider","$location","$LocationProvider","$log","$LogProvider","$parse","$ParseProvider","$rootScope","$RootScopeProvider","$q","$QProvider","$$q","$$QProvider","$sce","$SceProvider","$sceDelegate","$SceDelegateProvider","$sniffer","$SnifferProvider","$templateCache","$TemplateCacheProvider","$templateRequest","$TemplateRequestProvider","$$testability","$$TestabilityProvider","$timeout","$TimeoutProvider","$window","$WindowProvider","$$rAF","$$RAFProvider","$$jqLite","$$jqLiteProvider","$$HashMap","$$HashMapProvider","$$cookieReader","$$CookieReaderProvider","camelCase","SPECIAL_CHARS_REGEXP","_","offset","toUpperCase","MOZ_HACK_REGEXP","jqLiteAcceptsData","NODE_TYPE_DOCUMENT","jqLiteBuildFragment","tmp","fragment","createDocumentFragment","HTML_REGEXP","appendChild","createElement","TAG_NAME_REGEXP","exec","wrap","wrapMap","_default","innerHTML","XHTML_TAG_REGEXP","lastChild","childNodes","firstChild","textContent","createTextNode","argIsString","trim","jqLiteMinErr","parsed","SINGLE_TAG_REGEXP","jqLiteAddNodes","jqLiteClone","jqLiteDealoc","onlyDescendants","jqLiteRemoveData","querySelectorAll","descendants","l","jqLiteOff","type","unsupported","expandoStore","jqLiteExpandoStore","handle","listenerFns","removeEventListener","expandoId","ng339","jqCache","createIfNecessary","jqId","jqLiteData","isSimpleSetter","isSimpleGetter","massGetter","jqLiteHasClass","selector","jqLiteRemoveClass","cssClasses","setAttribute","cssClass","jqLiteAddClass","existingClasses","root","elements","jqLiteController","jqLiteInheritedData","documentElement","names","parentNode","NODE_TYPE_DOCUMENT_FRAGMENT","host","jqLiteEmpty","removeChild","jqLiteRemove","keepData","jqLiteDocumentLoaded","action","win","readyState","setTimeout","getBooleanAttrName","booleanAttr","BOOLEAN_ATTR","BOOLEAN_ELEMENTS","createEventHandler","eventHandler","event","isDefaultPrevented","event.isDefaultPrevented","defaultPrevented","eventFns","eventFnsLength","immediatePropagationStopped","originalStopImmediatePropagation","stopImmediatePropagation","event.stopImmediatePropagation","stopPropagation","isImmediatePropagationStopped","event.isImmediatePropagationStopped","$get","this.$get","hasClass","classes","addClass","removeClass","hashKey","nextUidFn","objType","HashMap","isolatedUid","this.nextUid","put","anonFn","args","fnText","STRIP_COMMENTS","FN_ARGS","modulesToLoad","supportObject","delegate","provider_","providerInjector","instantiate","providerCache","providerSuffix","enforceReturnValue","enforcedReturnValue","result","instanceInjector","factoryFn","enforce","loadModules","moduleFn","runInvokeQueue","invokeArgs","loadedModules","message","stack","createInternalInjector","cache","getService","serviceName","caller","INSTANTIATING","err","shift","locals","$inject","$$annotate","Type","instance","returnedValue","annotate","has","$injector","instanceCache","decorFn","origProvider","orig$get","origProvider.$get","origInstance","$delegate","autoScrollingEnabled","disableAutoScrolling","this.disableAutoScrolling","getFirstAnchor","list","Array","some","scrollTo","scrollIntoView","scroll","yOffset","getComputedStyle","position","getBoundingClientRect","bottom","elemTop","top","scrollBy","hash","elm","getElementById","getElementsByName","autoScrollWatch","autoScrollWatchAction","newVal","oldVal","mergeClasses","b","splitClasses","klass","prepareAnimateOptions","options","Browser","completeOutstandingRequest","outstandingRequestCount","outstandingRequestCallbacks","pop","error","cacheStateAndFireUrlChange","pendingLocation","cacheState","fireUrlChange","history","state","cachedState","lastCachedState","lastBrowserUrl","url","lastHistoryState","urlChangeListeners","listener","clearTimeout","pendingDeferIds","isMock","$$completeOutstandingRequest","$$incOutstandingRequestCount","self.$$incOutstandingRequestCount","notifyWhenNoOutstandingRequests","self.notifyWhenNoOutstandingRequests","callback","href","baseElement","self.url","sameState","sameBase","stripHash","substr","self.state","urlChangeInit","onUrlChange","self.onUrlChange","$$applicationDestroyed","self.$$applicationDestroyed","off","$$checkUrlChange","baseHref","self.baseHref","defer","self.defer","delay","timeoutId","cancel","self.defer.cancel","deferId","cacheFactory","cacheId","refresh","entry","freshEnd","staleEnd","n","link","p","nextEntry","prevEntry","caches","size","stats","id","capacity","Number","MAX_VALUE","lruHash","lruEntry","remove","removeAll","destroy","info","cacheFactory.info","cacheFactory.get","$$sanitizeUriProvider","parseIsolateBindings","directiveName","isController","LOCAL_REGEXP","bindings","definition","scopeName","$compileMinErr","mode","collection","optional","attrName","assertValidDirectiveName","hasDirectives","COMMENT_DIRECTIVE_REGEXP","CLASS_DIRECTIVE_REGEXP","ALL_OR_NOTHING_ATTRS","REQUIRE_PREFIX_REGEXP","EVENT_HANDLER_ATTR_REGEXP","this.directive","registerDirective","directiveFactory","Suffix","directives","priority","require","restrict","bindToController","controllerAs","CNTRL_REG","$$bindings","$$isolateBindings","aHrefSanitizationWhitelist","this.aHrefSanitizationWhitelist","regexp","imgSrcSanitizationWhitelist","this.imgSrcSanitizationWhitelist","this.debugInfoEnabled","enabled","safeAddClass","$element","className","$compileNodes","transcludeFn","maxPriority","ignoreDirective","previousCompileContext","nodeValue","compositeLinkFn","compileNodes","$$addScopeClass","namespace","publicLinkFn","cloneConnectFn","parentBoundTranscludeFn","transcludeControllers","futureParentElement","$$boundTransclude","$linkNode","wrapTemplate","controllerName","$$addScopeInfo","nodeList","$rootElement","childLinkFn","childScope","childBoundTranscludeFn","stableNodeList","nodeLinkFnFound","linkFns","idx","nodeLinkFn","destroyBindings","$new","$$destroyBindings","$on","transcludeOnThisElement","createBoundTranscludeFn","transclude","templateOnThisElement","attrs","linkFnFound","Attributes","collectDirectives","applyDirectivesToNode","$$element","terminal","previousBoundTranscludeFn","boundTranscludeFn","transcludedScope","cloneFn","controllers","containingScope","$$transcluded","attrsMap","$attr","addDirective","directiveNormalize","isNgAttr","nAttrs","attributes","attrStartName","attrEndName","ngAttrName","NG_ATTR_BINDING","PREFIX_REGEXP","directiveNName","directiveIsMultiElement","nName","addAttrInterpolateDirective","animVal","msie","addTextInterpolateDirective","NODE_TYPE_COMMENT","byPriority","groupScan","attrStart","attrEnd","depth","groupElementsLinkFnWrapper","linkFn","compileNode","templateAttrs","jqCollection","originalReplaceDirective","preLinkFns","postLinkFns","addLinkFns","pre","post","newIsolateScopeDirective","$$isolateScope","cloneAndAnnotateFn","getControllers","elementControllers","inheritType","dataName","setupControllers","controllerDirectives","controllerKey","$scope","$attrs","$transclude","controllerInstance","hasElementTranscludeDirective","linkNode","thisLinkFn","controllersBoundTransclude","cloneAttachFn","scopeToChild","templateDirective","$$originalDirective","initializeDirectiveBindings","scopeDirective","newScopeDirective","controllerForBindings","identifier","controllerResult","invokeLinkFn","template","templateUrl","terminalPriority","nonTlbTranscludeDirective","hasTranscludeDirective","hasTemplate","$compileNode","$template","childTranscludeFn","$$start","$$end","directiveValue","assertNoDuplicate","$$tlb","createComment","replaceWith","replaceDirective","contents","denormalizeTemplate","removeComments","templateNamespace","newTemplateAttrs","templateDirectives","unprocessedDirectives","markDirectivesAsIsolate","mergeTemplateAttributes","compileTemplateUrl","Math","max","tDirectives","startAttrName","endAttrName","multiElement","srcAttr","dstAttr","$set","tAttrs","linkQueue","afterTemplateNodeLinkFn","afterTemplateChildLinkFn","beforeTemplateCompileNode","origAsyncDirective","derivedSyncDirective","then","content","tempTemplateAttrs","beforeTemplateLinkNode","linkRootElement","$$destroyed","oldClasses","delayedNodeLinkFn","ignoreChildLinkFn","diff","what","previousDirective","wrapModuleNameIfDefined","moduleName","text","interpolateFn","textInterpolateCompileFn","templateNode","templateNodeParent","hasCompileParent","$$addBindingClass","textInterpolateLinkFn","$$addBindingInfo","expressions","interpolateFnWatchAction","wrapper","getTrustedContext","attrNormalizedName","HTML","RESOURCE_URL","allOrNothing","trustedContext","attrInterpolatePreLinkFn","$$observers","newValue","$$inter","$$scope","oldValue","$updateClass","elementsToRemove","newNode","firstElementToRemove","removeCount","j2","replaceChild","hasData","expando","k","kk","annotation","newScope","onNewScopeDestroyed","lastValue","parentGet","parentSet","compare","$observe","literal","assign","parentValueWatch","parentValue","$stateful","unwatch","$watchCollection","attributesToCopy","$normalize","$addClass","classVal","$removeClass","newClasses","toAdd","tokenDifference","toRemove","writeAttr","booleanKey","aliasedKey","ALIASED_ATTR","observer","trimmedSrcset","srcPattern","rawUris","nbrUrisWith2parts","floor","innerIdx","lastTuple","removeAttr","listeners","startSymbol","endSymbol","binding","isolated","noTemplate","str1","str2","values","tokens1","tokens2","token","jqNodes","globals","register","this.register","allowGlobals","this.allowGlobals","addIdentifier","expression","later","ident","$controllerMinErr","controllerPrototype","exception","cause","serializeValue","v","toISOString","ngParamSerializer","params","jQueryLikeParamSerializer","serialize","toSerialize","topLevel","defaultHttpResponseTransform","headers","tempData","JSON_PROTECTION_PREFIX","contentType","jsonStart","JSON_START","JSON_ENDS","parseHeaders","line","headerVal","headerKey","headersGetter","headersObj","transformData","status","fns","defaults","transformResponse","transformRequest","d","common","CONTENT_TYPE_APPLICATION_JSON","patch","xsrfCookieName","xsrfHeaderName","paramSerializer","useApplyAsync","this.useApplyAsync","useLegacyPromise","useLegacyPromiseExtensions","this.useLegacyPromiseExtensions","interceptorFactories","interceptors","requestConfig","response","resp","reject","executeHeaderFns","headerContent","processedHeaders","headerFn","header","mergeHeaders","defHeaders","reqHeaders","defHeaderName","lowercaseDefHeaderName","reqHeaderName","chain","serverRequest","reqData","withCredentials","sendReq","promise","when","reversedInterceptors","interceptor","request","requestError","responseError","thenFn","rejectFn","success","promise.success","promise.error","$httpMinErrLegacyFn","done","headersString","statusText","resolveHttpPromise","resolvePromise","$applyAsync","$$phase","deferred","resolve","resolvePromiseWithResult","removePendingReq","pendingRequests","cachedResp","buildUrl","defaultCache","xsrfValue","urlIsSameOrigin","timeout","responseType","serializedParams","interceptorFactory","createShortMethods","createShortMethodsWithData","createXhr","XMLHttpRequest","createHttpBackend","callbacks","$browserDefer","rawDocument","jsonpReq","callbackId","async","body","called","addEventListener","timeoutRequest","jsonpDone","xhr","abort","completeRequest","open","setRequestHeader","onload","xhr.onload","responseText","urlResolve","protocol","getAllResponseHeaders","onerror","onabort","send","this.startSymbol","this.endSymbol","escape","ch","unescapeText","escapedStartRegexp","escapedEndRegexp","mustHaveExpression","parseStringifyInterceptor","getTrusted","$interpolateMinErr","interr","endIndex","parseFns","textLength","expressionPositions","startSymbolLength","exp","endSymbolLength","throwNoconcat","compute","interpolationFn","$$watchDelegate","$watchGroup","interpolateFnWatcher","oldValues","currValue","$interpolate.startSymbol","$interpolate.endSymbol","interval","count","invokeApply","hasParams","setInterval","clearInterval","iteration","skipApply","$$intervalId","tick","notify","intervals","interval.cancel","encodePath","segments","parseAbsoluteUrl","absoluteUrl","locationObj","parsedUrl","$$protocol","$$host","hostname","$$port","port","DEFAULT_PORTS","parseAppUrl","relativeUrl","prefixed","$$path","pathname","$$search","search","$$hash","beginsWith","begin","whole","trimEmptyHash","LocationHtml5Url","appBase","appBaseNoFile","basePrefix","$$html5","$$parse","this.$$parse","pathUrl","$locationMinErr","$$compose","this.$$compose","$$url","$$absUrl","$$parseLinkUrl","this.$$parseLinkUrl","relHref","appUrl","prevAppUrl","rewrittenUrl","LocationHashbangUrl","hashPrefix","withoutBaseUrl","withoutHashUrl","windowsFilePathExp","base","firstPathSegmentMatch","LocationHashbangInHtml5Url","locationGetter","property","locationGetterSetter","preprocess","html5Mode","requireBase","rewriteLinks","this.hashPrefix","this.html5Mode","setBrowserUrlWithFallback","oldUrl","oldState","$$state","afterLocationChange","$broadcast","absUrl","LocationMode","initialUrl","lastIndexOf","IGNORE_URI_REGEXP","ctrlKey","metaKey","shiftKey","which","button","target","absHref","preventDefault","initializing","newUrl","newState","$digest","$locationWatch","currentReplace","$$replace","urlOrStateChanged","debug","debugEnabled","this.debugEnabled","flag","formatError","Error","sourceURL","consoleLog","console","logFn","log","hasApply","arg1","arg2","warn","ensureSafeMemberName","fullExpression","$parseMinErr","getStringValue","ensureSafeObject","children","ensureSafeFunction","CALL","APPLY","BIND","ensureSafeAssignContext","Function","ifDefined","plusFn","r","findConstantAndWatchExpressions","ast","allConstants","argsToWatch","AST","Program","expr","Literal","toWatch","UnaryExpression","argument","BinaryExpression","left","right","LogicalExpression","ConditionalExpression","alternate","consequent","Identifier","MemberExpression","object","computed","CallExpression","callee","AssignmentExpression","ArrayExpression","ObjectExpression","properties","ThisExpression","getInputs","lastExpression","isAssignable","assignableAST","NGValueParameter","operator","isLiteral","ASTCompiler","astBuilder","ASTInterpreter","isPossiblyDangerousMemberName","getValueOf","objectValueOf","cacheDefault","cacheExpensive","expressionInputDirtyCheck","oldValueOfValue","inputsWatchDelegate","objectEquality","parsedExpression","prettyPrintExpression","inputExpressions","inputs","lastResult","oldInputValueOf","expressionInputWatch","newInputValue","oldInputValueOfValues","oldInputValues","expressionInputsWatch","changed","oneTimeWatchDelegate","oneTimeWatch","oneTimeListener","old","$$postDigest","oneTimeLiteralWatchDelegate","isAllDefined","allDefined","constantWatchDelegate","constantWatch","constantListener","addInterceptor","interceptorFn","watchDelegate","regularInterceptedExpression","oneTimeInterceptedExpression","noUnsafeEval","$parseOptions","expensiveChecks","$parseOptionsExpensive","oneTime","cacheKey","parseOptions","lexer","Lexer","parser","Parser","qFactory","nextTick","exceptionHandler","callOnce","resolveFn","Promise","simpleBind","scheduleProcessQueue","processScheduled","pending","Deferred","$qMinErr","TypeError","onFulfilled","onRejected","progressBack","catch","finally","handleCallback","$$reject","$$resolve","progress","makePromise","resolved","isResolved","callbackOutput","errback","$Q","Q","resolver","all","promises","results","requestAnimationFrame","webkitRequestAnimationFrame","cancelAnimationFrame","webkitCancelAnimationFrame","webkitCancelRequestAnimationFrame","rafSupported","raf","timer","supported","createChildScopeClass","ChildScope","$$watchers","$$nextSibling","$$childHead","$$childTail","$$listeners","$$listenerCount","$$watchersCount","$id","$$ChildScope","TTL","$rootScopeMinErr","lastDirtyWatch","applyAsyncId","digestTtl","this.digestTtl","destroyChildScope","$event","currentScope","Scope","$parent","$$prevSibling","$root","beginPhase","phase","incrementWatchersCount","current","decrementListenerCount","initWatchVal","flushApplyAsync","applyAsyncQueue","scheduleApplyAsync","isolate","child","watchExp","watcher","last","eq","deregisterWatch","watchExpressions","watchGroupAction","changeReactionScheduled","firstRun","newValues","deregisterFns","shouldCall","deregisterWatchGroup","unwatchFn","watchGroupSubAction","$watchCollectionInterceptor","_value","bothNaN","newItem","oldItem","internalArray","oldLength","changeDetected","newLength","internalObject","veryOldValue","trackVeryOldValue","changeDetector","initRun","$watchCollectionAction","watch","watchers","dirty","ttl","watchLog","logIdx","asyncTask","asyncQueue","$eval","msg","next","postDigestQueue","eventName","this.$watchGroup","$applyAsyncExpression","namedListeners","indexOfListener","$emit","targetScope","listenerArgs","$$asyncQueue","$$postDigestQueue","$$applyAsyncQueue","sanitizeUri","uri","isImage","regex","normalizedVal","adjustMatcher","matcher","$sceMinErr","escapeForRegexp","adjustMatchers","matchers","adjustedMatchers","SCE_CONTEXTS","resourceUrlWhitelist","resourceUrlBlacklist","this.resourceUrlWhitelist","this.resourceUrlBlacklist","matchUrl","generateHolderType","Base","holderType","trustedValue","$$unwrapTrustedValue","this.$$unwrapTrustedValue","holderType.prototype.valueOf","holderType.prototype.toString","htmlSanitizer","trustedValueHolderBase","byType","CSS","URL","JS","trustAs","Constructor","maybeTrusted","allowed","this.enabled","sce","isEnabled","sce.isEnabled","sce.getTrusted","parseAs","sce.parseAs","enumValue","lName","eventSupport","android","userAgent","navigator","boxee","vendorPrefix","vendorRegex","bodyStyle","transitions","animations","webkitTransition","webkitAnimation","pushState","hasEvent","divElm","handleRequestFn","tpl","ignoreRequestError","totalPendingRequests","getTrustedResourceUrl","transformer","httpOptions","handleError","testability","testability.findBindings","opt_exactMatch","getElementsByClassName","matches","dataBinding","bindingName","testability.findModels","prefixes","attributeEquals","testability.getLocation","testability.setLocation","testability.whenStable","deferreds","$$timeoutId","timeout.cancel","urlParsingNode","requestUrl","originUrl","$$CookieReader","safeDecodeURIComponent","lastCookies","lastCookieString","cookieArray","cookie","currentCookieString","filters","suffix","currencyFilter","dateFilter","filterFilter","jsonFilter","limitToFilter","lowercaseFilter","numberFilter","orderByFilter","uppercaseFilter","comparator","matchAgainstAnyProp","getTypeForFilter","expressionType","predicateFn","createPredicateFn","shouldMatchPrimitives","actual","expected","item","deepCompare","dontMatchWholeObject","actualType","expectedType","expectedVal","matchAnyProperty","actualVal","$locale","formats","NUMBER_FORMATS","amount","currencySymbol","fractionSize","CURRENCY_SYM","PATTERNS","maxFrac","formatNumber","GROUP_SEP","DECIMAL_SEP","number","groupSep","decimalSep","isNegative","abs","isInfinity","Infinity","isFinite","numStr","formatedText","hasExponent","toFixed","parseFloat","fractionLen","min","minFrac","round","fraction","lgroup","lgSize","group","gSize","negPre","posPre","negSuf","posSuf","padNumber","num","digits","neg","dateGetter","dateStrGetter","shortForm","getFirstThursdayOfYear","year","dayOfWeekOnFirst","getDay","weekGetter","firstThurs","getFullYear","thisThurs","getMonth","getDate","eraGetter","ERAS","jsonStringToDate","string","R_ISO8601_STR","tzHour","tzMin","dateSetter","setUTCFullYear","setFullYear","timeSetter","setUTCHours","setHours","m","s","ms","format","DATETIME_FORMATS","NUMBER_STRING","DATE_FORMATS_SPLIT","dateTimezoneOffset","DATE_FORMATS","spacing","limit","processPredicates","sortPredicate","reverseOrder","map","predicate","descending","predicates","compareValues","getComparisonObject","predicateValues","doComparison","v1","v2","ngDirective","FormController","controls","$error","$$success","$pending","$name","$dirty","$pristine","$valid","$invalid","$submitted","$$parentForm","nullFormCtrl","$rollbackViewValue","form.$rollbackViewValue","control","$commitViewValue","form.$commitViewValue","$addControl","form.$addControl","$$renameControl","form.$$renameControl","newName","oldName","$removeControl","form.$removeControl","$setValidity","addSetValidityMethod","ctrl","set","unset","$setDirty","form.$setDirty","PRISTINE_CLASS","DIRTY_CLASS","$setPristine","form.$setPristine","setClass","SUBMITTED_CLASS","$setUntouched","form.$setUntouched","$setSubmitted","form.$setSubmitted","stringBasedInputType","$formatters","$isEmpty","baseInputType","composing","ev","ngTrim","$viewValue","$$hasNativeValidators","$setViewValue","deferListener","origValue","keyCode","$render","ctrl.$render","createDateParser","mapping","iso","ISO_DATE_REGEXP","yyyy","MM","dd","HH","getHours","mm","ss","getSeconds","sss","getMilliseconds","part","NaN","createDateInputType","parseDate","dynamicDateInputType","isValidDate","parseObservedDateValue","badInputChecker","$options","previousDate","$$parserName","$parsers","parsedDate","ngModelMinErr","ngMin","minVal","$validators","ctrl.$validators.min","$validate","ngMax","maxVal","ctrl.$validators.max","validity","VALIDITY_STATE_PROPERTY","badInput","typeMismatch","parseConstantExpr","parseFn","classDirective","arrayDifference","arrayClasses","digestClassCounts","classCounts","classesToUpdate","ngClassWatchAction","$index","old$index","mod","cachedToggleClass","switchValue","classCache","toggleValidationCss","validationErrorKey","isValid","VALID_CLASS","INVALID_CLASS","setValidity","isObjectEmpty","PENDING_CLASS","combinedState","REGEX_STRING_REGEXP","documentMode","rules","ngCspElement","ngCspAttribute","noInlineStyle","name_","el","full","major","minor","dot","codeName","JQLite._data","MOUSE_EVENT_MAP","mouseleave","mouseenter","optgroup","tbody","tfoot","colgroup","caption","thead","th","td","ready","trigger","fired","removeData","jqLiteHasData","removeAttribute","css","NODE_TYPE_ATTRIBUTE","lowercasedName","specified","getNamedItem","ret","getText","$dv","multiple","selected","nodeCount","jqLiteOn","types","related","relatedTarget","contains","one","onFn","replaceNode","insertBefore","contentDocument","prepend","wrapNode","detach","after","newElement","toggleClass","condition","classCondition","nextElementSibling","getElementsByTagName","extraParameters","dummyEvent","handlerArgs","eventFnsCopy","arg3","unbind","FN_ARG_SPLIT","FN_ARG","argDecl","underscore","$animateMinErr","AnimateRunner","end","resume","pause","complete","pass","fail","postDigestElements","updateData","handleCSSClassChanges","existing","pin","domOperation","from","to","classesAdded","add","classesRemoved","$$registeredAnimations","classNameFilter","this.classNameFilter","$$classNameFilter","reservedRegex","NG_ANIMATE_CLASSNAME","domInsert","parentElement","afterElement","afterNode","ELEMENT_NODE","previousElementSibling","runner","enter","move","leave","addclass","animate","tempClasses","RAFPromise","getPromise","f1","f2","closed","cleanupStyles","start","domNode","offsetWidth","APPLICATION_JSON","$httpMinErr","$interpolateMinErr.throwNoconcat","$interpolateMinErr.interr","PATH_MATCH","locationPrototype","paramValue","Location","Location.prototype.state","OPERATORS","ESCAPE","lex","tokens","readString","peek","readNumber","isIdent","readIdent","is","isWhitespace","ch2","ch3","op2","op3","op1","throwError","chars","isExpOperator","colStr","peekCh","quote","rawString","hex","String","fromCharCode","rep","ExpressionStatement","Property","program","expressionStatement","expect","filterChain","assignment","ternary","logicalOR","consume","logicalAND","equality","relational","additive","multiplicative","unary","primary","arrayDeclaration","constants","parseArguments","baseExpression","peekToken","kind","e1","e2","e3","e4","peekAhead","t","nextId","vars","own","assignable","stage","computing","recurse","return_","generateFunction","fnKey","intoId","watchId","fnString","USE","STRICT","filterPrefix","watchFns","varsPrefix","section","nameId","recursionFn","skipWatchIdCheck","if_","lazyAssign","computedMember","lazyRecurse","plus","not","getHasOwnProperty","nonComputedMember","addEnsureSafeObject","notNull","addEnsureSafeMemberName","addEnsureSafeFunction","member","addEnsureSafeAssignContext","filterName","defaultValue","stringEscapeRegex","stringEscapeFn","c","charCodeAt","skip","init","fn.assign","rhs","lhs","unary+","unary-","unary!","binary+","binary-","binary*","binary/","binary%","binary===","binary!==","binary==","binary!=","binary<","binary>","binary<=","binary>=","binary&&","binary||","ternary?:","astCompiler","yy","y","MMMM","MMM","M","H","hh","EEEE","EEE","ampmGetter","AMPMS","Z","timeZoneGetter","zone","paddedZone","ww","w","G","GG","GGG","GGGG","longEraGetter","ERANAMES","xlinkHref","propName","defaultLinkFn","normalized","ngBooleanAttrWatchAction","htmlAttr","ngAttrAliasWatchAction","nullFormRenameControl","formDirectiveFactory","isNgForm","getSetter","ngFormCompile","formElement","nameAttr","ngFormPreLink","ctrls","handleFormSubmission","setter","URL_REGEXP","EMAIL_REGEXP","NUMBER_REGEXP","DATE_REGEXP","DATETIMELOCAL_REGEXP","WEEK_REGEXP","MONTH_REGEXP","TIME_REGEXP","inputType","textInputType","weekParser","isoWeek","existingDate","week","hours","seconds","milliseconds","addDays","numberInputType","urlInputType","ctrl.$validators.url","modelValue","viewValue","emailInputType","email","ctrl.$validators.email","radioInputType","checked","checkboxInputType","trueValue","ngTrueValue","falseValue","ngFalseValue","ctrl.$isEmpty","CONSTANT_VALUE_REGEXP","tplAttr","ngValueConstantLink","ngValueLink","valueWatchAction","$compile","ngBindCompile","templateElement","ngBindLink","ngBindWatchAction","ngBindTemplateCompile","ngBindTemplateLink","ngBindHtmlCompile","tElement","ngBindHtmlGetter","ngBindHtmlWatch","ngBindHtmlLink","ngBindHtmlWatchAction","getTrustedHtml","$viewChangeListeners","forceAsyncEvents","ngEventHandler","previousElements","ngIfWatchAction","srcExp","onloadExp","autoScrollExp","autoscroll","changeCounter","previousElement","currentElement","cleanupLastIncludeContent","ngIncludeWatchAction","afterAnimation","thisChangeId","namespaceAdaptedClone","trimValues","NgModelController","$modelValue","$$rawModelValue","$asyncValidators","$untouched","$touched","parsedNgModel","parsedNgModelAssign","ngModelGet","ngModelSet","pendingDebounce","parserValid","$$setOptions","this.$$setOptions","getterSetter","invokeModelGetter","invokeModelSetter","$$$p","this.$isEmpty","currentValidationRunId","this.$setPristine","this.$setDirty","this.$setUntouched","UNTOUCHED_CLASS","TOUCHED_CLASS","$setTouched","this.$setTouched","this.$rollbackViewValue","$$lastCommittedViewValue","this.$validate","prevValid","prevModelValue","allowInvalid","$$runValidators","allValid","$$writeModelToScope","this.$$runValidators","doneCallback","processSyncValidators","syncValidatorsValid","validator","processAsyncValidators","validatorPromises","validationDone","localValidationRunId","processParseErrors","errorKey","this.$commitViewValue","$$parseAndValidate","this.$$parseAndValidate","this.$$writeModelToScope","this.$setViewValue","updateOnDefault","$$debounceViewValueCommit","this.$$debounceViewValueCommit","debounceDelay","debounce","ngModelWatch","formatters","ngModelCompile","ngModelPreLink","modelCtrl","formCtrl","ngModelPostLink","updateOn","DEFAULT_REGEXP","that","ngOptionsMinErr","NG_OPTIONS_REGEXP","parseOptionsExpression","optionsExp","selectElement","Option","selectValue","label","disabled","getOptionValuesKeys","optionValues","optionValuesKeys","keyName","itemKey","valueName","selectAs","trackBy","viewValueFn","trackByFn","getTrackByValueFn","getHashOfValue","getTrackByValue","getLocals","displayFn","groupByFn","disableWhenFn","valuesFn","getWatchables","watchedArray","optionValuesLength","disableWhen","getOptions","optionItems","selectValueMap","optionItem","getOptionFromViewValue","getViewValueFromOption","optionTemplate","optGroupTemplate","updateOptionElement","addOrReuseElement","removeExcessElements","skipEmptyAndUnknownOptions","emptyOption_","emptyOption","unknownOption_","unknownOption","updateOptions","previousValue","selectCtrl","readValue","groupMap","providedEmptyOption","updateOption","optionElement","groupElement","currentOptionElement","ngModelCtrl","nextValue","ngModelCtrl.$isEmpty","writeValue","selectCtrl.writeValue","selectCtrl.readValue","selectedValues","selections","selectedOption","BRACE","IS_WHEN","updateElementText","newText","numberExp","whenExp","whens","whensExpFns","braceReplacement","watchRemover","lastCount","attributeName","tmpMatch","whenKey","ngPluralizeWatchAction","countIsNaN","pluralCat","whenExpFn","ngRepeatMinErr","updateScope","valueIdentifier","keyIdentifier","arrayLength","$first","$last","$middle","$odd","$even","ngRepeatCompile","ngRepeatEndComment","aliasAs","trackByExp","trackByExpGetter","trackByIdExpFn","trackByIdArrayFn","trackByIdObjFn","hashFnLocals","ngRepeatLink","lastBlockMap","ngRepeatAction","previousNode","nextNode","nextBlockMap","collectionLength","trackById","collectionKeys","nextBlockOrder","trackByIdFn","blockKey","ngRepeatTransclude","ngShowWatchAction","NG_HIDE_CLASS","NG_HIDE_IN_PROGRESS_CLASS","ngHideWatchAction","ngStyleWatchAction","newStyles","oldStyles","ngSwitchController","cases","selectedTranscludes","selectedElements","previousLeaveAnimations","selectedScopes","spliceFactory","ngSwitchWatchAction","selectedTransclude","caseElement","selectedScope","anchor","noopNgModelController","SelectController","optionsMap","renderUnknownOption","self.renderUnknownOption","unknownVal","removeUnknownOption","self.removeUnknownOption","self.readValue","self.writeValue","hasOption","addOption","self.addOption","removeOption","self.removeOption","self.hasOption","ngModelCtrl.$render","lastView","lastViewRef","selectMultipleWatch","valueInterpolated","optionValue","selectCtrlName","valueAttributeObserveAction","interpolateWatchAction","ctrl.$validators.required","patternExp","ctrl.$validators.pattern","intVal","ctrl.$validators.maxlength","ctrl.$validators.minlength","getDecimals","opt_precision","pow","ONE","OTHER","$$csp","head"]
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/bower.json
new file mode 100644
index 0000000..12b4e8c
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/bower.json
@@ -0,0 +1,8 @@
+{
+  "name": "angular",
+  "version": "1.4.7",
+  "main": "./angular.js",
+  "ignore": [],
+  "dependencies": {
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/index.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/index.js
new file mode 100644
index 0000000..5c1aafc
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/index.js
@@ -0,0 +1,2 @@
+require('./angular');
+module.exports = angular;
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/package.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/package.json
new file mode 100644
index 0000000..c39a534
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/angular/package.json
@@ -0,0 +1,25 @@
+{
+  "name": "angular",
+  "version": "1.4.7",
+  "description": "HTML enhanced for web apps",
+  "main": "index.js",
+  "scripts": {
+    "test": "echo \"Error: no test specified\" && exit 1"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/angular/angular.js.git"
+  },
+  "keywords": [
+    "angular",
+    "framework",
+    "browser",
+    "client-side"
+  ],
+  "author": "Angular Core Team <angular-core+npm@google.com>",
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/angular/angular.js/issues"
+  },
+  "homepage": "http://angularjs.org"
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bower.json
new file mode 100644
index 0000000..a913870
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bower.json
@@ -0,0 +1,43 @@
+{
+  "name": "ng-lodash",
+  "version": "0.3.0",
+  "description": "An Angular module wrapper for lodash",
+  "author": [
+    "Rockabox <tech@rockabox.com> (http://www.rockabox.com)"
+  ],
+  "license": "MIT",
+  "keywords": [
+    "nglodash",
+    "angular",
+    "lodash"
+  ],
+  "ignore": [
+    "test",
+    "*.",
+    "karma.conf.js",
+    "Gruntfile.js"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/rockabox/ng-lodash.git"
+  },
+  "main": [
+    "build/ng-lodash.js"
+  ],
+  "dependencies": {
+    "angular": ">=1.2"
+  },
+  "devDependencies": {
+    "angular-mocks": ">=1.2"
+  },
+  "homepage": "https://github.com/rockabox/ng-lodash",
+  "_release": "0.3.0",
+  "_resolution": {
+    "type": "version",
+    "tag": "0.3.0",
+    "commit": "16eedfec93b22cea2bbf1732b96d08fc11bce5f6"
+  },
+  "_source": "git://github.com/rockabox/ng-lodash.git",
+  "_target": "~0.3.0",
+  "_originalSource": "ng-lodash"
+}
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bowerrc b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bowerrc
new file mode 100644
index 0000000..daf4083
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.bowerrc
@@ -0,0 +1,3 @@
+{
+    "directory": "lib"
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.editorconfig b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.editorconfig
new file mode 100644
index 0000000..03b2556
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.editorconfig
@@ -0,0 +1,12 @@
+# editorconfig.org
+
+root = true
+
+[*]
+indent_style = space
+indent_size = 4
+end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 120
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.gitignore b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.gitignore
new file mode 100644
index 0000000..904971f
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.gitignore
@@ -0,0 +1,3 @@
+.grunt
+node_modules
+lib
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jscsrc b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jscsrc
new file mode 100644
index 0000000..84bb7cf
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jscsrc
@@ -0,0 +1,153 @@
+{
+    "requireCurlyBraces": [
+        "if",
+        "else",
+        "for",
+        "while",
+        "do",
+        "try",
+        "catch"
+    ],
+    "requireSpaceAfterKeywords": [
+        "if",
+        "else",
+        "for",
+        "while",
+        "do",
+        "switch",
+        "return",
+        "try",
+        "catch"
+    ],
+    "requireSpaceBeforeBlockStatements": true,
+    "requireSpacesInConditionalExpression": {
+        "afterTest": true,
+        "beforeConsequent": true,
+        "afterConsequent": true,
+        "beforeAlternate": true
+    },
+    "requireSpacesInFunctionExpression": {
+        "beforeOpeningRoundBrace": true,
+        "beforeOpeningCurlyBrace": true
+    },
+    "requireSpacesInAnonymousFunctionExpression": {
+        "beforeOpeningRoundBrace": true,
+        "beforeOpeningCurlyBrace": true
+    },
+    "requireSpacesInNamedFunctionExpression": {
+        "beforeOpeningRoundBrace": true,
+        "beforeOpeningCurlyBrace": true
+    },
+    "requireSpacesInFunctionDeclaration": {
+        "beforeOpeningRoundBrace": true,
+        "beforeOpeningCurlyBrace": true
+    },
+    "requireMultipleVarDecl": true,
+    "requireBlocksOnNewline": 1,
+    "disallowEmptyBlocks": true,
+    "disallowSpacesInsideObjectBrackets": true,
+    "disallowSpacesInsideArrayBrackets": true,
+    "disallowSpacesInsideParentheses": true,
+    "disallowSpaceAfterObjectKeys": true,
+    "requireCommaBeforeLineBreak": true,
+    "requireOperatorBeforeLineBreak": [
+        "?",
+        "=",
+        "+",
+        "-",
+        "/",
+        "*",
+        "==",
+        "===",
+        "!=",
+        "!==",
+        ">",
+        ">=",
+        "<",
+        "<="
+    ],
+    "requireSpaceBeforeBinaryOperators": [
+        "?",
+        "=",
+        "+",
+        "-",
+        "/",
+        "*",
+        "==",
+        "===",
+        "!=",
+        "!==",
+        ">",
+        ">=",
+        "<",
+        "<="
+    ],
+    "requireSpaceAfterBinaryOperators": [
+        "?",
+        "=",
+        "+",
+        "/",
+        "*",
+        ":",
+        "==",
+        "===",
+        "!=",
+        "!==",
+        ">",
+        ">=",
+        "<",
+        "<=",
+        ","
+    ],
+    "disallowSpaceBeforeBinaryOperators": [","],
+    "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+    "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+    "requireSpaceBeforeBinaryOperators": [
+        "=",
+        "+",
+        "-",
+        "/",
+        "*",
+        "==",
+        "===",
+        "!=",
+        "!=="
+    ],
+    "requireSpaceAfterBinaryOperators": [
+        "=",
+        ",",
+        "+",
+        "-",
+        "/",
+        "*",
+        "==",
+        "===",
+        "!=",
+        "!=="
+    ],
+    "disallowImplicitTypeConversion": [
+        "numeric",
+        "boolean",
+        "binary",
+        "string"
+    ],
+    "requireCamelCaseOrUpperCaseIdentifiers": true,
+    "disallowKeywords": ["with"],
+    "disallowMultipleLineBreaks": true,
+    "validateLineBreaks": "LF",
+    "validateQuoteMarks": "'",
+    "validateIndentation": 4,
+    "disallowMixedSpacesAndTabs": true,
+    "disallowTrailingWhitespace": true,
+    "disallowTrailingComma": true,
+    "disallowKeywordsOnNewLine": ["else"],
+    "maximumLineLength": 120,
+    "safeContextKeyword": ["$this"],
+    "disallowYodaConditions": true,
+    "validateJSDoc": {
+        "checkParamNames": true,
+        "checkRedundantParams": true,
+        "requireParamTypes": true
+    },
+    "requireLineFeedAtFileEnd": true
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jshintrc b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jshintrc
new file mode 100644
index 0000000..75c081f
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.jshintrc
@@ -0,0 +1,19 @@
+{
+    // Predefined globals
+    "browser"       : true,     // Standard browser globals
+
+    // Development
+    "debug"         : false,    // Allow debugger statements e.g. browser breakpoints.
+    "devel"         : true,     // Allow development statements e.g. `console.log();`.
+
+    // The Good Parts
+    "evil"          : false,    // Tolerate use of `eval`.
+    "regexdash"     : true,     // Tolerate unescaped last dash i.e. `[-...]`.
+    "trailing"      : true,     // Prohibit trailing whitespaces.
+    "sub"           : true,     // Tolerate all forms of subscript notation besides dot notation e.g. `dict['key']` instead of `dict.key`.
+    "eqeqeq"        : false,    // Require triple equals i.e. `===`.
+
+    // Styling preferences.
+    "indent"        : 4,        // Indent level
+    "camelcase"     : true      // Use CAMEL Casing for variables
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.travis.yml b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.travis.yml
new file mode 100644
index 0000000..6e5919d
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+  - "0.10"
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/CONTRIBUTING.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/CONTRIBUTING.md
new file mode 100644
index 0000000..930d581
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/CONTRIBUTING.md
@@ -0,0 +1,657 @@
+# Contributing
+
+This document outlines general guidelines, best practices and coding style rules
+for developers contributing to the project.
+
+## Contents
+
+- [Pull requests](#pull-requests)
+- [Bugs](#bugs)
+- [Features](#features)
+- [Node dependencies](#node-dependencies)
+- [Frontend dependencies](#frontend-dependencies)
+- [Using grunt](#grunt)
+- [JS Guidelines](#js)
+
+## Pull requests
+
+If you fixed or added something useful to the project, you can send a
+pull request. It will be reviewed by maintainer and accepted, or commented for
+rework, or declined.
+
+## Bugs
+
+If you found an error, typo or any other flaw in the project, please report
+about it using GitHub Issues. The more details you provide, the easier it could
+be reproduced and the faster it could be fixed. Unfortunately, sometimes the
+bug can only be reproduced in your project or in your environment, so
+maintainers cannot reproduce it. In this case we believe you can fix the bug
+and send us the fix.
+
+## Features
+
+If you've got an idea about a new feature, it's most likely that you'll have to
+implement it on your own. If you cannot implement the feature, but it is very
+important, you can create an issue at GitHub, but expect it to be declined by
+the maintainer.
+
+## Node dependencies
+
+This project's build process uses Node npm modules defined via the
+`package.json` file.
+
+To add the latest version of new npm package to the project and automatically
+append it to `package.json` run:
+
+```
+npm install <pkg> --save-dev
+```
+
+If new packages have been added by other contributors then run:
+
+```
+npm update
+```
+
+To update all your local packages to the latest possible versions as constrained
+by `package.json` then run:
+
+```
+npm install
+```
+
+### JS
+
+#### General top level guidelines
+
+- Don't skip semicolons
+- 4 spaces for indentation
+- Single quotes for strings
+- Use `{}` instead of `new Object();`
+- Use `[]` instead of `new Array();`
+- Don't use single line `if` statements.
+- 80 chars maximum line length.
+- Use inline comments only where needed to document dense code, code should
+otherwise be clearly comprehensible without redundant commenting
+- Add a whitespace char when writing inline comments, i.e `// Good` vs `//Bad`.
+
+#### Variable naming
+
+- Always use `var` to declare variables.
+- Use only one `var` for multiple variables.
+- Define variables before use.
+- Define constants in CAPS.
+
+```js
+// Good
+var aVariable = 0,
+    aSecondVariable = null,
+    A_CONSTANT = 'constant';
+
+// Bad
+var a_variable = 0;
+var a_second_variable = null;
+```
+
+#### Whitespace
+
+Our JavaScript code is compressed so don't try and save on space when writing
+code, focus on readability by trying to (however do not add unnecessary spaces).
+
+ - Use one (and only one) blank line to separate logical sets of code.
+ - Add a whitespace character after keywords like `if` and after right
+parenthesis.
+ - Add a whitespace character after commas.
+ - Leave a line before a function or `if` statement.
+
+```js
+if (foo === 'foo') {
+    var array = ['one', 'two', 'three'];
+    bar(array);
+
+    foo = 'bar';
+}
+
+function (arg1, arg2) {
+    var foo = arg1;
+    bar(foo);
+}
+```
+
+- Don't add superfluos newlines when writing short/simple indented blocks:
+
+```js
+// Bad
+
+if ( foo ) {
+
+    bar();
+}
+
+function ( baz ) {
+
+    bar();
+}
+```
+
+- Do add newlines in blocks when the opening part of the block has wrapped onto
+a newline due to the 80 char line length limit:
+
+```js
+// Good
+
+angular.module('foo')
+    .controller('FooCtrl', function ($scope, $someReallyLongServiceName,
+        $anotherService, $somethingElse) {
+
+        $scope.bar = 'baz';
+        $scope.qux = 'quux';
+    });
+```
+
+#### JSHint
+
+This repo uses [JSHint](http://www.jshint.com/about/), defined in
+[.jshintrc](../../.jshintrc). Files are checked on save, and errors are visible
+in the console. Optionally this config file can also be used by your code
+editor.
+
+The following guidelines are checked by JSHint.
+
+- Four spaces for indentation, never tabs.
+- Lines no longer than 80 Characters (including comments).
+- Use single `'` quotes for strings.
+- Use `===` and `!==` over `==` and `!=`
+- Use `camelCase` for variables.
+- Don't leave trailing whitespace.
+
+#### JS Code Style (JSCS)
+
+This repo also uses [JSCS](https://github.com/mdevils/node-jscs), defined in
+[.jscsrc](../../.jscsrc). Files are checked on save, and errors are visible in
+the console. Optionally this config file can also be used by your code editor.
+
+The following rules have been defined.
+
+##### `requireCurlyBraces`
+
+Use curly braces after statements.
+
+```js
+// Good
+if (x) {
+    x++;
+}
+
+// Bad
+if (x) x++;
+```
+
+##### `requireSpaceAfterKeywords`
+
+Use spaces after keywords:
+
+```js
+// Good
+if (x) {
+    x++;
+}
+
+// Bad
+if(x) {
+    x++;
+}
+```
+
+##### `requireSpaceBeforeBlockStatements`
+
+Use spaces after parenthesis, before curly brace:
+
+```js
+// Good
+if (x) {
+    x++;
+}
+
+// Bad
+if (x){
+    x++;
+}
+```
+
+##### `requireSpacesInConditionalExpression`
+
+Use spaces around conditional expressions:
+
+```js
+// Good
+var a = b ? c : d;
+
+// Bad
+var a=b?c:d;
+```
+
+##### `requireSpacesInFunctionExpression`
+
+
+##### `requireSpacesInAnonymousFunctionExpression`
+
+
+##### `requireSpacesInNamedFunctionExpression`
+
+
+##### `requireSpacesInFunctionDeclaration`
+
+Use spaces before and after parenthesis:
+
+```js
+// Good
+function a () {}
+
+// Bad
+function a() {}
+function a (){}
+```
+
+##### `requireMultipleVarDecl`
+
+Use one `var` statement for multiple variables:
+
+```js
+// Good
+var x = 1,
+    y = 2;
+
+// Bad
+var x = 1;
+var y = 2;
+```
+
+##### `requireBlocksOnNewline`
+
+Use new lines for multiple statements
+
+```js
+// Good
+if (true) {
+    doSomething();
+    doSomethingElse();
+}
+
+// Bad
+if (true) { doSomething(); doSomethingElse(); }
+```
+
+##### `disallowEmptyBlocks`
+
+Don't use empty blocks
+
+```js
+// Good
+if ( a === b ) {
+    c = d;
+}
+
+// Bad
+if ( a !== b ) {
+
+} else {
+    c = d;
+}
+```
+
+##### `disallowSpacesInsideObjectBrackets`
+
+Don't use a space after an opening or before a closing curly bracket
+
+```js
+// Good
+var x = {a: 1};
+
+// Bad
+var x = { a: 1 };
+```
+
+##### `disallowSpacesInsideArrayBrackets`
+
+Don't use a space after an opening or before a closing square bracket
+
+```js
+// Good
+var x = [1];
+
+// Bad
+var x = [ 1 ];
+```
+
+##### `disallowSpacesInsideParentheses`
+
+Don't use a space after an opening or before a closing parenthesis
+
+```js
+// Good
+var x = (1 + 2) * 3;
+
+// Bad
+var x = ( 1 + 2 ) * 3;
+```
+
+##### `disallowSpaceAfterObjectKeys`
+
+Don't use a space after a key in an object
+
+```js
+// Good
+var x = {a: 1};
+
+// Bad
+var x = {a : 1};
+```
+
+##### `requireCommaBeforeLineBreak`
+
+Don't put commas on the following line
+
+```js
+// Good
+var x = {
+    one: 1,
+    two: 2
+};
+
+// Bad
+var x = {
+    one: 1
+    , two: 2
+};
+```
+
+##### `requireOperatorBeforeLineBreak`
+
+Break lines after (not before) an operator
+
+```js
+// Good
+x = y ?
+    1 : 2;
+
+// Bad
+x = y
+    ? 1 : 2;
+```
+
+##### `disallowLeftStickedOperators`
+
+Put a space before an operator
+
+```js
+// Good
+x = y ? 1 : 2;
+
+// Bad
+x = y? 1 : 2;
+```
+
+##### `disallowRightStickedOperators`
+
+Put a space after an operator
+
+```js
+// Good
+x = y + 1;
+
+// Bad
+x = y +1;
+```
+
+##### `requireLeftStickedOperators`
+
+Don't put a space before a comma
+
+```js
+// Good
+x = [1, 2];
+
+// Bad
+x = [1 , 2];
+```
+
+##### `disallowSpaceAfterPrefixUnaryOperators`
+
+Don't put a space after a prefix unary operator
+
+```js
+// Good
+x = !y;
+y = ++z;
+// Bad
+x = ! y;
+y = ++ z;
+```
+
+##### `disallowSpaceBeforePostfixUnaryOperators`
+
+Don't put a space after a postfix unary operator
+
+```js
+// Good
+x = y++;
+
+// Bad
+x = y ++;
+```
+
+##### `requireSpaceBeforeBinaryOperators`
+
+Put a space before binary operators
+
+```js
+// Good
+x !== y;
+
+// Bad
+x!== y;
+```
+
+##### `requireSpaceAfterBinaryOperators`
+
+Put a space after binary operators
+
+```js
+// Good
+x + y;
+
+// Bad
+x +y;
+```
+
+##### `disallowImplicitTypeConversion`
+
+Don't use implicit type conversion
+
+```js
+// Good
+x = Boolean(y);
+x = Number(y);
+x = String(y);
+x = s.indexOf('.') !== -1;
+
+// Bad
+x = !!y;
+x = +y;
+x = '' + y;
+x = ~s.indexOf('.');
+```
+
+##### `requireCamelCaseOrUpperCaseIdentifiers`
+
+Use camelCase or
+UPPERCASE_WITH_UNDERSCORES for variable names
+
+```js
+// Good
+var camelCase = 0;
+var UPPER_CASE = 4;
+
+// Bad
+var lower_case = 1;
+var Mixed_case = 2;
+var mixed_Case = 3;
+```
+
+##### `disallowKeywords`
+
+Disallow certain keywords from anywhere in the code base.
+
+```js
+// Bad
+with (foo) {
+}
+```
+
+##### `disallowMultipleLineBreaks`
+
+Don't use multiple blank lines in a row
+
+```js
+// Bad
+var x = 1;
+x++;
+```
+
+##### `validateLineBreaks`
+
+Checks line break character consistency:
+
+```js
+// Good
+foo();<LF>
+
+// Bad
+foo();<CRLF>
+foo();<CR>
+```
+##### `validateQuoteMarks`
+
+Check quote mark usage is single quotes.
+
+```js
+// Good
+var foo = 'bar';
+
+// Bad
+var foo = "bar";
+```
+
+##### `validateIndentation`
+
+Check indentation is at 4 spaces, no tabs.
+
+```js
+// Good
+function foo (bar) {
+    console.log(bar);
+}
+
+// Bad
+function foo (bar) {
+  console.log(bar);
+}
+
+```
+
+##### `disallowMixedSpacesAndTabs`
+
+Check that spaces and tabs are not mixed.
+
+##### `disallowTrailingWhitespace`
+
+Check that no line ends in a whitespace char.
+
+```js
+// Good
+var foo = "blah blah";<LF>
+
+// Bad
+var foo = "blah blah"; <LF>
+```
+
+##### `disallowTrailingComma`
+
+Don't use a comma at the end of an array or object
+
+```js
+// Good
+var foo = [1, 2, 3];
+var bar = {a: "a", b: "b"}
+
+// Bad
+var foo = [1, 2, 3,];
+var bar = {a: "a", b: "b",}
+```
+
+##### `disallowKeywordsOnNewLine`
+
+Don't place `else` statements on their own line
+
+```js
+// Good
+if (x < 0) {
+    x++;
+} else {
+    x--;
+}
+
+// Bad
+if (x < 0) {
+    x++;
+}
+else {
+    x--;
+}
+```
+
+##### `maximumLineLength`
+
+Checks that no single line extends beyond 80 chars.
+
+##### `requireCapitalizedConstructors`
+
+Constructor variable names should be Capitalised.
+
+```js
+// Good
+var foo = new Bar();
+
+// Bad
+var foo = new bar();
+```
+
+##### `safeContextKeyword`
+
+When saving `this` context call the variable `$this`.
+
+```js
+// Good
+var $this = this;
+
+// Bad
+var that = this;
+var self = this;
+```
+
+##### `disallowYodaConditions`
+
+The variable should be on the left in boolean comparisons.
+
+```js
+// Good
+if (a === 1) {
+    // ...
+}
+
+// Bad
+if (1 === a) {
+    // ...
+}
+```
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/License.txt b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/License.txt
new file mode 100644
index 0000000..be8afc1
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/License.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Rockabox Ltd.
+
+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:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+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.
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/README.md b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/README.md
new file mode 100644
index 0000000..0b2443c
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/README.md
@@ -0,0 +1,61 @@
+[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
+[![Build Status](https://travis-ci.org/rockabox/ng-lodash.svg?branch=master)](https://travis-ci.org/rockabox/ng-lodash)
+[![devDependency Status](https://david-dm.org/rockabox/ng-lodash/dev-status.svg)](https://david-dm.org/rockabox/ng-lodash#info=devDependencies)
+
+ng-lodash
+=========
+
+This is a wrapper for the utility library [Lo-Dash](http://lodash.com/) for
+Angular JS. One aim for this project is to ensure Lo-Dash doesn't have to be
+left on the window, and we use Lo-Dash with Angular, in the normal depenedency
+ injection manner.
+
+## Installing
+Install via bower
+
+```bower install ng-lodash```
+
+Require it into your application (after Angular)
+
+```<script src="ng-lodash.min.js"></script>```
+
+Add the module as a dependency to your app
+
+```js
+var app = angular.module('yourAwesomeApp', ['ngLodash']);
+```
+
+And inject it into your controller like so!
+
+```js
+var YourCtrl = app.controller('yourController', function($scope, lodash) {
+  lodash.assign({ 'a': 1 }, { 'b': 2 }, { 'c': 3 });
+});
+```
+
+## Developing
+
+To help us develop this module, we are using Grunt some tasks that may be
+helpful for you to know about are:
+
+### Testing
+
+This command will run JSHint and JSCS testing JS Files (note files within build)
+are not tested, it will also run your local build of the module with all of the
+Karma tests:
+
+```grunt test``` it can also be run by using ```npm test```
+
+### Build
+
+This command will build the module, run it through ngMin and then create a
+minified version of the module, ready for distribution:
+
+```grunt build```
+
+### Dist
+
+This command will build the module initially and then run the test suite.
+Testing with JSHint, JSCS and Karma:
+
+```grunt dist```
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/bower.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/bower.json
new file mode 100644
index 0000000..eb17cb3
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/bower.json
@@ -0,0 +1,31 @@
+{
+  "name": "ng-lodash",
+  "version": "0.3.0",
+  "description": "An Angular module wrapper for lodash",
+  "author": ["Rockabox <tech@rockabox.com> (http://www.rockabox.com)"],
+  "license": "MIT",
+  "keywords": [
+    "nglodash",
+    "angular",
+    "lodash"
+  ],
+  "ignore": [
+    "test",
+    "*.",
+    "karma.conf.js",
+    "Gruntfile.js"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/rockabox/ng-lodash.git"
+  },
+  "main": [
+    "build/ng-lodash.js"
+  ],
+  "dependencies": {
+    "angular": ">=1.2"
+  },
+  "devDependencies": {
+    "angular-mocks": ">=1.2"
+  }
+}
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.js
new file mode 100644
index 0000000..6e4a6b5
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.js
@@ -0,0 +1,11267 @@
+/**
+ * @license
+ * lodash 3.10.1 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modern exports="amd,commonjs,node" iife="angular.module('ngLodash', []).constant('lodash', null).config(function ($provide) { %output% $provide.constant('lodash', _);});" --output build/ng-lodash.js`
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license <https://lodash.com/license>
+ */
+angular.module('ngLodash', []).constant('lodash', null).config([
+  '$provide',
+  function ($provide) {
+    /** Used as a safe reference for `undefined` in pre-ES5 environments. */
+    var undefined;
+    /** Used as the semantic version number. */
+    var VERSION = '3.10.1';
+    /** Used to compose bitmasks for wrapper metadata. */
+    var BIND_FLAG = 1, BIND_KEY_FLAG = 2, CURRY_BOUND_FLAG = 4, CURRY_FLAG = 8, CURRY_RIGHT_FLAG = 16, PARTIAL_FLAG = 32, PARTIAL_RIGHT_FLAG = 64, ARY_FLAG = 128, REARG_FLAG = 256;
+    /** Used as default options for `_.trunc`. */
+    var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = '...';
+    /** Used to detect when a function becomes hot. */
+    var HOT_COUNT = 150, HOT_SPAN = 16;
+    /** Used as the size to enable large array optimizations. */
+    var LARGE_ARRAY_SIZE = 200;
+    /** Used to indicate the type of lazy iteratees. */
+    var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2;
+    /** Used as the `TypeError` message for "Functions" methods. */
+    var FUNC_ERROR_TEXT = 'Expected a function';
+    /** Used as the internal argument placeholder. */
+    var PLACEHOLDER = '__lodash_placeholder__';
+    /** `Object#toString` result references. */
+    var argsTag = '[object Arguments]', arrayTag = '[object Array]', boolTag = '[object Boolean]', dateTag = '[object Date]', errorTag = '[object Error]', funcTag = '[object Function]', mapTag = '[object Map]', numberTag = '[object Number]', objectTag = '[object Object]', regexpTag = '[object RegExp]', setTag = '[object Set]', stringTag = '[object String]', weakMapTag = '[object WeakMap]';
+    var arrayBufferTag = '[object ArrayBuffer]', float32Tag = '[object Float32Array]', float64Tag = '[object Float64Array]', int8Tag = '[object Int8Array]', int16Tag = '[object Int16Array]', int32Tag = '[object Int32Array]', uint8Tag = '[object Uint8Array]', uint8ClampedTag = '[object Uint8ClampedArray]', uint16Tag = '[object Uint16Array]', uint32Tag = '[object Uint32Array]';
+    /** Used to match empty string literals in compiled template source. */
+    var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g;
+    /** Used to match HTML entities and HTML characters. */
+    var reEscapedHtml = /&(?:amp|lt|gt|quot|#39|#96);/g, reUnescapedHtml = /[&<>"'`]/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source);
+    /** Used to match template delimiters. */
+    var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g;
+    /** Used to match property names within property paths. */
+    var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g;
+    /**
+   * Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns)
+   * and those outlined by [`EscapeRegExpPattern`](http://ecma-international.org/ecma-262/6.0/#sec-escaperegexppattern).
+   */
+    var reRegExpChars = /^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g, reHasRegExpChars = RegExp(reRegExpChars.source);
+    /** Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks). */
+    var reComboMark = /[\u0300-\u036f\ufe20-\ufe23]/g;
+    /** Used to match backslashes in property paths. */
+    var reEscapeChar = /\\(\\)?/g;
+    /** Used to match [ES template delimiters](http://ecma-international.org/ecma-262/6.0/#sec-template-literal-lexical-components). */
+    var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g;
+    /** Used to match `RegExp` flags from their coerced string values. */
+    var reFlags = /\w*$/;
+    /** Used to detect hexadecimal string values. */
+    var reHasHexPrefix = /^0[xX]/;
+    /** Used to detect host constructors (Safari > 5). */
+    var reIsHostCtor = /^\[object .+?Constructor\]$/;
+    /** Used to detect unsigned integer values. */
+    var reIsUint = /^\d+$/;
+    /** Used to match latin-1 supplementary letters (excluding mathematical operators). */
+    var reLatin1 = /[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g;
+    /** Used to ensure capturing order of template delimiters. */
+    var reNoMatch = /($^)/;
+    /** Used to match unescaped characters in compiled string literals. */
+    var reUnescapedString = /['\n\r\u2028\u2029\\]/g;
+    /** Used to match words to create compound words. */
+    var reWords = function () {
+        var upper = '[A-Z\\xc0-\\xd6\\xd8-\\xde]', lower = '[a-z\\xdf-\\xf6\\xf8-\\xff]+';
+        return RegExp(upper + '+(?=' + upper + lower + ')|' + upper + '?' + lower + '|' + upper + '+|[0-9]+', 'g');
+      }();
+    /** Used to assign default `context` object properties. */
+    var contextProps = [
+        'Array',
+        'ArrayBuffer',
+        'Date',
+        'Error',
+        'Float32Array',
+        'Float64Array',
+        'Function',
+        'Int8Array',
+        'Int16Array',
+        'Int32Array',
+        'Math',
+        'Number',
+        'Object',
+        'RegExp',
+        'Set',
+        'String',
+        '_',
+        'clearTimeout',
+        'isFinite',
+        'parseFloat',
+        'parseInt',
+        'setTimeout',
+        'TypeError',
+        'Uint8Array',
+        'Uint8ClampedArray',
+        'Uint16Array',
+        'Uint32Array',
+        'WeakMap'
+      ];
+    /** Used to make template sourceURLs easier to identify. */
+    var templateCounter = -1;
+    /** Used to identify `toStringTag` values of typed arrays. */
+    var typedArrayTags = {};
+    typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
+    typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
+    /** Used to identify `toStringTag` values supported by `_.clone`. */
+    var cloneableTags = {};
+    cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[stringTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
+    cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[mapTag] = cloneableTags[setTag] = cloneableTags[weakMapTag] = false;
+    /** Used to map latin-1 supplementary letters to basic latin letters. */
+    var deburredLetters = {
+        '\xc0': 'A',
+        '\xc1': 'A',
+        '\xc2': 'A',
+        '\xc3': 'A',
+        '\xc4': 'A',
+        '\xc5': 'A',
+        '\xe0': 'a',
+        '\xe1': 'a',
+        '\xe2': 'a',
+        '\xe3': 'a',
+        '\xe4': 'a',
+        '\xe5': 'a',
+        '\xc7': 'C',
+        '\xe7': 'c',
+        '\xd0': 'D',
+        '\xf0': 'd',
+        '\xc8': 'E',
+        '\xc9': 'E',
+        '\xca': 'E',
+        '\xcb': 'E',
+        '\xe8': 'e',
+        '\xe9': 'e',
+        '\xea': 'e',
+        '\xeb': 'e',
+        '\xcc': 'I',
+        '\xcd': 'I',
+        '\xce': 'I',
+        '\xcf': 'I',
+        '\xec': 'i',
+        '\xed': 'i',
+        '\xee': 'i',
+        '\xef': 'i',
+        '\xd1': 'N',
+        '\xf1': 'n',
+        '\xd2': 'O',
+        '\xd3': 'O',
+        '\xd4': 'O',
+        '\xd5': 'O',
+        '\xd6': 'O',
+        '\xd8': 'O',
+        '\xf2': 'o',
+        '\xf3': 'o',
+        '\xf4': 'o',
+        '\xf5': 'o',
+        '\xf6': 'o',
+        '\xf8': 'o',
+        '\xd9': 'U',
+        '\xda': 'U',
+        '\xdb': 'U',
+        '\xdc': 'U',
+        '\xf9': 'u',
+        '\xfa': 'u',
+        '\xfb': 'u',
+        '\xfc': 'u',
+        '\xdd': 'Y',
+        '\xfd': 'y',
+        '\xff': 'y',
+        '\xc6': 'Ae',
+        '\xe6': 'ae',
+        '\xde': 'Th',
+        '\xfe': 'th',
+        '\xdf': 'ss'
+      };
+    /** Used to map characters to HTML entities. */
+    var htmlEscapes = {
+        '&': '&amp;',
+        '<': '&lt;',
+        '>': '&gt;',
+        '"': '&quot;',
+        '\'': '&#39;',
+        '`': '&#96;'
+      };
+    /** Used to map HTML entities to characters. */
+    var htmlUnescapes = {
+        '&amp;': '&',
+        '&lt;': '<',
+        '&gt;': '>',
+        '&quot;': '"',
+        '&#39;': '\'',
+        '&#96;': '`'
+      };
+    /** Used to determine if values are of the language type `Object`. */
+    var objectTypes = {
+        'function': true,
+        'object': true
+      };
+    /** Used to escape characters for inclusion in compiled regexes. */
+    var regexpEscapes = {
+        '0': 'x30',
+        '1': 'x31',
+        '2': 'x32',
+        '3': 'x33',
+        '4': 'x34',
+        '5': 'x35',
+        '6': 'x36',
+        '7': 'x37',
+        '8': 'x38',
+        '9': 'x39',
+        'A': 'x41',
+        'B': 'x42',
+        'C': 'x43',
+        'D': 'x44',
+        'E': 'x45',
+        'F': 'x46',
+        'a': 'x61',
+        'b': 'x62',
+        'c': 'x63',
+        'd': 'x64',
+        'e': 'x65',
+        'f': 'x66',
+        'n': 'x6e',
+        'r': 'x72',
+        't': 'x74',
+        'u': 'x75',
+        'v': 'x76',
+        'x': 'x78'
+      };
+    /** Used to escape characters for inclusion in compiled string literals. */
+    var stringEscapes = {
+        '\\': '\\',
+        '\'': '\'',
+        '\n': 'n',
+        '\r': 'r',
+        '\u2028': 'u2028',
+        '\u2029': 'u2029'
+      };
+    /** Detect free variable `exports`. */
+    var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;
+    /** Detect free variable `module`. */
+    var freeModule = objectTypes[typeof module] && module && !module.nodeType && module;
+    /** Detect free variable `global` from Node.js. */
+    var freeGlobal = freeExports && freeModule && typeof global == 'object' && global && global.Object && global;
+    /** Detect free variable `self`. */
+    var freeSelf = objectTypes[typeof self] && self && self.Object && self;
+    /** Detect free variable `window`. */
+    var freeWindow = objectTypes[typeof window] && window && window.Object && window;
+    /** Detect the popular CommonJS extension `module.exports`. */
+    var moduleExports = freeModule && freeModule.exports === freeExports && freeExports;
+    /**
+   * Used as a reference to the global object.
+   *
+   * The `this` value is used if it's the global object to avoid Greasemonkey's
+   * restricted `window` object, otherwise the `window` object is used.
+   */
+    var root = freeGlobal || freeWindow !== (this && this.window) && freeWindow || freeSelf || this;
+    /*--------------------------------------------------------------------------*/
+    /**
+   * The base implementation of `compareAscending` which compares values and
+   * sorts them in ascending order without guaranteeing a stable sort.
+   *
+   * @private
+   * @param {*} value The value to compare.
+   * @param {*} other The other value to compare.
+   * @returns {number} Returns the sort order indicator for `value`.
+   */
+    function baseCompareAscending(value, other) {
+      if (value !== other) {
+        var valIsNull = value === null, valIsUndef = value === undefined, valIsReflexive = value === value;
+        var othIsNull = other === null, othIsUndef = other === undefined, othIsReflexive = other === other;
+        if (value > other && !othIsNull || !valIsReflexive || valIsNull && !othIsUndef && othIsReflexive || valIsUndef && othIsReflexive) {
+          return 1;
+        }
+        if (value < other && !valIsNull || !othIsReflexive || othIsNull && !valIsUndef && valIsReflexive || othIsUndef && valIsReflexive) {
+          return -1;
+        }
+      }
+      return 0;
+    }
+    /**
+   * The base implementation of `_.findIndex` and `_.findLastIndex` without
+   * support for callback shorthands and `this` binding.
+   *
+   * @private
+   * @param {Array} array The array to search.
+   * @param {Function} predicate The function invoked per iteration.
+   * @param {boolean} [fromRight] Specify iterating from right to left.
+   * @returns {number} Returns the index of the matched value, else `-1`.
+   */
+    function baseFindIndex(array, predicate, fromRight) {
+      var length = array.length, index = fromRight ? length : -1;
+      while (fromRight ? index-- : ++index < length) {
+        if (predicate(array[index], index, array)) {
+          return index;
+        }
+      }
+      return -1;
+    }
+    /**
+   * The base implementation of `_.indexOf` without support for binary searches.
+   *
+   * @private
+   * @param {Array} array The array to search.
+   * @param {*} value The value to search for.
+   * @param {number} fromIndex The index to search from.
+   * @returns {number} Returns the index of the matched value, else `-1`.
+   */
+    function baseIndexOf(array, value, fromIndex) {
+      if (value !== value) {
+        return indexOfNaN(array, fromIndex);
+      }
+      var index = fromIndex - 1, length = array.length;
+      while (++index < length) {
+        if (array[index] === value) {
+          return index;
+        }
+      }
+      return -1;
+    }
+    /**
+   * The base implementation of `_.isFunction` without support for environments
+   * with incorrect `typeof` results.
+   *
+   * @private
+   * @param {*} value The value to check.
+   * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+   */
+    function baseIsFunction(value) {
+      // Avoid a Chakra JIT bug in compatibility modes of IE 11.
+      // See https://github.com/jashkenas/underscore/issues/1621 for more details.
+      return typeof value == 'function' || false;
+    }
+    /**
+   * Converts `value` to a string if it's not one. An empty string is returned
+   * for `null` or `undefined` values.
+   *
+   * @private
+   * @param {*} value The value to process.
+   * @returns {string} Returns the string.
+   */
+    function baseToString(value) {
+      return value == null ? '' : value + '';
+    }
+    /**
+   * Used by `_.trim` and `_.trimLeft` to get the index of the first character
+   * of `string` that is not found in `chars`.
+   *
+   * @private
+   * @param {string} string The string to inspect.
+   * @param {string} chars The characters to find.
+   * @returns {number} Returns the index of the first character not found in `chars`.
+   */
+    function charsLeftIndex(string, chars) {
+      var index = -1, length = string.length;
+      while (++index < length && chars.indexOf(string.charAt(index)) > -1) {
+      }
+      return index;
+    }
+    /**
+   * Used by `_.trim` and `_.trimRight` to get the index of the last character
+   * of `string` that is not found in `chars`.
+   *
+   * @private
+   * @param {string} string The string to inspect.
+   * @param {string} chars The characters to find.
+   * @returns {number} Returns the index of the last character not found in `chars`.
+   */
+    function charsRightIndex(string, chars) {
+      var index = string.length;
+      while (index-- && chars.indexOf(string.charAt(index)) > -1) {
+      }
+      return index;
+    }
+    /**
+   * Used by `_.sortBy` to compare transformed elements of a collection and stable
+   * sort them in ascending order.
+   *
+   * @private
+   * @param {Object} object The object to compare.
+   * @param {Object} other The other object to compare.
+   * @returns {number} Returns the sort order indicator for `object`.
+   */
+    function compareAscending(object, other) {
+      return baseCompareAscending(object.criteria, other.criteria) || object.index - other.index;
+    }
+    /**
+   * Used by `_.sortByOrder` to compare multiple properties of a value to another
+   * and stable sort them.
+   *
+   * If `orders` is unspecified, all valuess are sorted in ascending order. Otherwise,
+   * a value is sorted in ascending order if its corresponding order is "asc", and
+   * descending if "desc".
+   *
+   * @private
+   * @param {Object} object The object to compare.
+   * @param {Object} other The other object to compare.
+   * @param {boolean[]} orders The order to sort by for each property.
+   * @returns {number} Returns the sort order indicator for `object`.
+   */
+    function compareMultiple(object, other, orders) {
+      var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length;
+      while (++index < length) {
+        var result = baseCompareAscending(objCriteria[index], othCriteria[index]);
+        if (result) {
+          if (index >= ordersLength) {
+            return result;
+          }
+          var order = orders[index];
+          return result * (order === 'asc' || order === true ? 1 : -1);
+        }
+      }
+      // Fixes an `Array#sort` bug in the JS engine embedded in Adobe applications
+      // that causes it, under certain circumstances, to provide the same value for
+      // `object` and `other`. See https://github.com/jashkenas/underscore/pull/1247
+      // for more details.
+      //
+      // This also ensures a stable sort in V8 and other engines.
+      // See https://code.google.com/p/v8/issues/detail?id=90 for more details.
+      return object.index - other.index;
+    }
+    /**
+   * Used by `_.deburr` to convert latin-1 supplementary letters to basic latin letters.
+   *
+   * @private
+   * @param {string} letter The matched letter to deburr.
+   * @returns {string} Returns the deburred letter.
+   */
+    function deburrLetter(letter) {
+      return deburredLetters[letter];
+    }
+    /**
+   * Used by `_.escape` to convert characters to HTML entities.
+   *
+   * @private
+   * @param {string} chr The matched character to escape.
+   * @returns {string} Returns the escaped character.
+   */
+    function escapeHtmlChar(chr) {
+      return htmlEscapes[chr];
+    }
+    /**
+   * Used by `_.escapeRegExp` to escape characters for inclusion in compiled regexes.
+   *
+   * @private
+   * @param {string} chr The matched character to escape.
+   * @param {string} leadingChar The capture group for a leading character.
+   * @param {string} whitespaceChar The capture group for a whitespace character.
+   * @returns {string} Returns the escaped character.
+   */
+    function escapeRegExpChar(chr, leadingChar, whitespaceChar) {
+      if (leadingChar) {
+        chr = regexpEscapes[chr];
+      } else if (whitespaceChar) {
+        chr = stringEscapes[chr];
+      }
+      return '\\' + chr;
+    }
+    /**
+   * Used by `_.template` to escape characters for inclusion in compiled string literals.
+   *
+   * @private
+   * @param {string} chr The matched character to escape.
+   * @returns {string} Returns the escaped character.
+   */
+    function escapeStringChar(chr) {
+      return '\\' + stringEscapes[chr];
+    }
+    /**
+   * Gets the index at which the first occurrence of `NaN` is found in `array`.
+   *
+   * @private
+   * @param {Array} array The array to search.
+   * @param {number} fromIndex The index to search from.
+   * @param {boolean} [fromRight] Specify iterating from right to left.
+   * @returns {number} Returns the index of the matched `NaN`, else `-1`.
+   */
+    function indexOfNaN(array, fromIndex, fromRight) {
+      var length = array.length, index = fromIndex + (fromRight ? 0 : -1);
+      while (fromRight ? index-- : ++index < length) {
+        var other = array[index];
+        if (other !== other) {
+          return index;
+        }
+      }
+      return -1;
+    }
+    /**
+   * Checks if `value` is object-like.
+   *
+   * @private
+   * @param {*} value The value to check.
+   * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+   */
+    function isObjectLike(value) {
+      return !!value && typeof value == 'object';
+    }
+    /**
+   * Used by `trimmedLeftIndex` and `trimmedRightIndex` to determine if a
+   * character code is whitespace.
+   *
+   * @private
+   * @param {number} charCode The character code to inspect.
+   * @returns {boolean} Returns `true` if `charCode` is whitespace, else `false`.
+   */
+    function isSpace(charCode) {
+      return charCode <= 160 && (charCode >= 9 && charCode <= 13) || charCode == 32 || charCode == 160 || charCode == 5760 || charCode == 6158 || charCode >= 8192 && (charCode <= 8202 || charCode == 8232 || charCode == 8233 || charCode == 8239 || charCode == 8287 || charCode == 12288 || charCode == 65279);
+    }
+    /**
+   * Replaces all `placeholder` elements in `array` with an internal placeholder
+   * and returns an array of their indexes.
+   *
+   * @private
+   * @param {Array} array The array to modify.
+   * @param {*} placeholder The placeholder to replace.
+   * @returns {Array} Returns the new array of placeholder indexes.
+   */
+    function replaceHolders(array, placeholder) {
+      var index = -1, length = array.length, resIndex = -1, result = [];
+      while (++index < length) {
+        if (array[index] === placeholder) {
+          array[index] = PLACEHOLDER;
+          result[++resIndex] = index;
+        }
+      }
+      return result;
+    }
+    /**
+   * An implementation of `_.uniq` optimized for sorted arrays without support
+   * for callback shorthands and `this` binding.
+   *
+   * @private
+   * @param {Array} array The array to inspect.
+   * @param {Function} [iteratee] The function invoked per iteration.
+   * @returns {Array} Returns the new duplicate free array.
+   */
+    function sortedUniq(array, iteratee) {
+      var seen, index = -1, length = array.length, resIndex = -1, result = [];
+      while (++index < length) {
+        var value = array[index], computed = iteratee ? iteratee(value, index, array) : value;
+        if (!index || seen !== computed) {
+          seen = computed;
+          result[++resIndex] = value;
+        }
+      }
+      return result;
+    }
+    /**
+   * Used by `_.trim` and `_.trimLeft` to get the index of the first non-whitespace
+   * character of `string`.
+   *
+   * @private
+   * @param {string} string The string to inspect.
+   * @returns {number} Returns the index of the first non-whitespace character.
+   */
+    function trimmedLeftIndex(string) {
+      var index = -1, length = string.length;
+      while (++index < length && isSpace(string.charCodeAt(index))) {
+      }
+      return index;
+    }
+    /**
+   * Used by `_.trim` and `_.trimRight` to get the index of the last non-whitespace
+   * character of `string`.
+   *
+   * @private
+   * @param {string} string The string to inspect.
+   * @returns {number} Returns the index of the last non-whitespace character.
+   */
+    function trimmedRightIndex(string) {
+      var index = string.length;
+      while (index-- && isSpace(string.charCodeAt(index))) {
+      }
+      return index;
+    }
+    /**
+   * Used by `_.unescape` to convert HTML entities to characters.
+   *
+   * @private
+   * @param {string} chr The matched character to unescape.
+   * @returns {string} Returns the unescaped character.
+   */
+    function unescapeHtmlChar(chr) {
+      return htmlUnescapes[chr];
+    }
+    /*--------------------------------------------------------------------------*/
+    /**
+   * Create a new pristine `lodash` function using the given `context` object.
+   *
+   * @static
+   * @memberOf _
+   * @category Utility
+   * @param {Object} [context=root] The context object.
+   * @returns {Function} Returns a new `lodash` function.
+   * @example
+   *
+   * _.mixin({ 'foo': _.constant('foo') });
+   *
+   * var lodash = _.runInContext();
+   * lodash.mixin({ 'bar': lodash.constant('bar') });
+   *
+   * _.isFunction(_.foo);
+   * // => true
+   * _.isFunction(_.bar);
+   * // => false
+   *
+   * lodash.isFunction(lodash.foo);
+   * // => false
+   * lodash.isFunction(lodash.bar);
+   * // => true
+   *
+   * // using `context` to mock `Date#getTime` use in `_.now`
+   * var mock = _.runInContext({
+   *   'Date': function() {
+   *     return { 'getTime': getTimeMock };
+   *   }
+   * });
+   *
+   * // or creating a suped-up `defer` in Node.js
+   * var defer = _.runInContext({ 'setTimeout': setImmediate }).defer;
+   */
+    function runInContext(context) {
+      // Avoid issues with some ES3 environments that attempt to use values, named
+      // after built-in constructors like `Object`, for the creation of literals.
+      // ES5 clears this up by stating that literals must use built-in constructors.
+      // See https://es5.github.io/#x11.1.5 for more details.
+      context = context ? _.defaults(root.Object(), context, _.pick(root, contextProps)) : root;
+      /** Native constructor references. */
+      var Array = context.Array, Date = context.Date, Error = context.Error, Function = context.Function, Math = context.Math, Number = context.Number, Object = context.Object, RegExp = context.RegExp, String = context.String, TypeError = context.TypeError;
+      /** Used for native method references. */
+      var arrayProto = Array.prototype, objectProto = Object.prototype, stringProto = String.prototype;
+      /** Used to resolve the decompiled source of functions. */
+      var fnToString = Function.prototype.toString;
+      /** Used to check objects for own properties. */
+      var hasOwnProperty = objectProto.hasOwnProperty;
+      /** Used to generate unique IDs. */
+      var idCounter = 0;
+      /**
+     * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+     * of values.
+     */
+      var objToString = objectProto.toString;
+      /** Used to restore the original `_` reference in `_.noConflict`. */
+      var oldDash = root._;
+      /** Used to detect if a method is native. */
+      var reIsNative = RegExp('^' + fnToString.call(hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$');
+      /** Native method references. */
+      var ArrayBuffer = context.ArrayBuffer, clearTimeout = context.clearTimeout, parseFloat = context.parseFloat, pow = Math.pow, propertyIsEnumerable = objectProto.propertyIsEnumerable, Set = getNative(context, 'Set'), setTimeout = context.setTimeout, splice = arrayProto.splice, Uint8Array = context.Uint8Array, WeakMap = getNative(context, 'WeakMap');
+      /* Native method references for those with the same name as other `lodash` methods. */
+      var nativeCeil = Math.ceil, nativeCreate = getNative(Object, 'create'), nativeFloor = Math.floor, nativeIsArray = getNative(Array, 'isArray'), nativeIsFinite = context.isFinite, nativeKeys = getNative(Object, 'keys'), nativeMax = Math.max, nativeMin = Math.min, nativeNow = getNative(Date, 'now'), nativeParseInt = context.parseInt, nativeRandom = Math.random;
+      /** Used as references for `-Infinity` and `Infinity`. */
+      var NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY, POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
+      /** Used as references for the maximum length and index of an array. */
+      var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1;
+      /**
+     * Used as the [maximum length](http://ecma-international.org/ecma-262/6.0/#sec-number.max_safe_integer)
+     * of an array-like value.
+     */
+      var MAX_SAFE_INTEGER = 9007199254740991;
+      /** Used to store function metadata. */
+      var metaMap = WeakMap && new WeakMap();
+      /** Used to lookup unminified function names. */
+      var realNames = {};
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a `lodash` object which wraps `value` to enable implicit chaining.
+     * Methods that operate on and return arrays, collections, and functions can
+     * be chained together. Methods that retrieve a single value or may return a
+     * primitive value will automatically end the chain returning the unwrapped
+     * value. Explicit chaining may be enabled using `_.chain`. The execution of
+     * chained methods is lazy, that is, execution is deferred until `_#value`
+     * is implicitly or explicitly called.
+     *
+     * Lazy evaluation allows several methods to support shortcut fusion. Shortcut
+     * fusion is an optimization strategy which merge iteratee calls; this can help
+     * to avoid the creation of intermediate data structures and greatly reduce the
+     * number of iteratee executions.
+     *
+     * Chaining is supported in custom builds as long as the `_#value` method is
+     * directly or indirectly included in the build.
+     *
+     * In addition to lodash methods, wrappers have `Array` and `String` methods.
+     *
+     * The wrapper `Array` methods are:
+     * `concat`, `join`, `pop`, `push`, `reverse`, `shift`, `slice`, `sort`,
+     * `splice`, and `unshift`
+     *
+     * The wrapper `String` methods are:
+     * `replace` and `split`
+     *
+     * The wrapper methods that support shortcut fusion are:
+     * `compact`, `drop`, `dropRight`, `dropRightWhile`, `dropWhile`, `filter`,
+     * `first`, `initial`, `last`, `map`, `pluck`, `reject`, `rest`, `reverse`,
+     * `slice`, `take`, `takeRight`, `takeRightWhile`, `takeWhile`, `toArray`,
+     * and `where`
+     *
+     * The chainable wrapper methods are:
+     * `after`, `ary`, `assign`, `at`, `before`, `bind`, `bindAll`, `bindKey`,
+     * `callback`, `chain`, `chunk`, `commit`, `compact`, `concat`, `constant`,
+     * `countBy`, `create`, `curry`, `debounce`, `defaults`, `defaultsDeep`,
+     * `defer`, `delay`, `difference`, `drop`, `dropRight`, `dropRightWhile`,
+     * `dropWhile`, `fill`, `filter`, `flatten`, `flattenDeep`, `flow`, `flowRight`,
+     * `forEach`, `forEachRight`, `forIn`, `forInRight`, `forOwn`, `forOwnRight`,
+     * `functions`, `groupBy`, `indexBy`, `initial`, `intersection`, `invert`,
+     * `invoke`, `keys`, `keysIn`, `map`, `mapKeys`, `mapValues`, `matches`,
+     * `matchesProperty`, `memoize`, `merge`, `method`, `methodOf`, `mixin`,
+     * `modArgs`, `negate`, `omit`, `once`, `pairs`, `partial`, `partialRight`,
+     * `partition`, `pick`, `plant`, `pluck`, `property`, `propertyOf`, `pull`,
+     * `pullAt`, `push`, `range`, `rearg`, `reject`, `remove`, `rest`, `restParam`,
+     * `reverse`, `set`, `shuffle`, `slice`, `sort`, `sortBy`, `sortByAll`,
+     * `sortByOrder`, `splice`, `spread`, `take`, `takeRight`, `takeRightWhile`,
+     * `takeWhile`, `tap`, `throttle`, `thru`, `times`, `toArray`, `toPlainObject`,
+     * `transform`, `union`, `uniq`, `unshift`, `unzip`, `unzipWith`, `values`,
+     * `valuesIn`, `where`, `without`, `wrap`, `xor`, `zip`, `zipObject`, `zipWith`
+     *
+     * The wrapper methods that are **not** chainable by default are:
+     * `add`, `attempt`, `camelCase`, `capitalize`, `ceil`, `clone`, `cloneDeep`,
+     * `deburr`, `endsWith`, `escape`, `escapeRegExp`, `every`, `find`, `findIndex`,
+     * `findKey`, `findLast`, `findLastIndex`, `findLastKey`, `findWhere`, `first`,
+     * `floor`, `get`, `gt`, `gte`, `has`, `identity`, `includes`, `indexOf`,
+     * `inRange`, `isArguments`, `isArray`, `isBoolean`, `isDate`, `isElement`,
+     * `isEmpty`, `isEqual`, `isError`, `isFinite` `isFunction`, `isMatch`,
+     * `isNative`, `isNaN`, `isNull`, `isNumber`, `isObject`, `isPlainObject`,
+     * `isRegExp`, `isString`, `isUndefined`, `isTypedArray`, `join`, `kebabCase`,
+     * `last`, `lastIndexOf`, `lt`, `lte`, `max`, `min`, `noConflict`, `noop`,
+     * `now`, `pad`, `padLeft`, `padRight`, `parseInt`, `pop`, `random`, `reduce`,
+     * `reduceRight`, `repeat`, `result`, `round`, `runInContext`, `shift`, `size`,
+     * `snakeCase`, `some`, `sortedIndex`, `sortedLastIndex`, `startCase`,
+     * `startsWith`, `sum`, `template`, `trim`, `trimLeft`, `trimRight`, `trunc`,
+     * `unescape`, `uniqueId`, `value`, and `words`
+     *
+     * The wrapper method `sample` will return a wrapped value when `n` is provided,
+     * otherwise an unwrapped value is returned.
+     *
+     * @name _
+     * @constructor
+     * @category Chain
+     * @param {*} value The value to wrap in a `lodash` instance.
+     * @returns {Object} Returns the new `lodash` wrapper instance.
+     * @example
+     *
+     * var wrapped = _([1, 2, 3]);
+     *
+     * // returns an unwrapped value
+     * wrapped.reduce(function(total, n) {
+     *   return total + n;
+     * });
+     * // => 6
+     *
+     * // returns a wrapped value
+     * var squares = wrapped.map(function(n) {
+     *   return n * n;
+     * });
+     *
+     * _.isArray(squares);
+     * // => false
+     *
+     * _.isArray(squares.value());
+     * // => true
+     */
+      function lodash(value) {
+        if (isObjectLike(value) && !isArray(value) && !(value instanceof LazyWrapper)) {
+          if (value instanceof LodashWrapper) {
+            return value;
+          }
+          if (hasOwnProperty.call(value, '__chain__') && hasOwnProperty.call(value, '__wrapped__')) {
+            return wrapperClone(value);
+          }
+        }
+        return new LodashWrapper(value);
+      }
+      /**
+     * The function whose prototype all chaining wrappers inherit from.
+     *
+     * @private
+     */
+      function baseLodash() {
+      }
+      /**
+     * The base constructor for creating `lodash` wrapper objects.
+     *
+     * @private
+     * @param {*} value The value to wrap.
+     * @param {boolean} [chainAll] Enable chaining for all wrapper methods.
+     * @param {Array} [actions=[]] Actions to peform to resolve the unwrapped value.
+     */
+      function LodashWrapper(value, chainAll, actions) {
+        this.__wrapped__ = value;
+        this.__actions__ = actions || [];
+        this.__chain__ = !!chainAll;
+      }
+      /**
+     * An object environment feature flags.
+     *
+     * @static
+     * @memberOf _
+     * @type Object
+     */
+      var support = lodash.support = {};
+      /**
+     * By default, the template delimiters used by lodash are like those in
+     * embedded Ruby (ERB). Change the following template settings to use
+     * alternative delimiters.
+     *
+     * @static
+     * @memberOf _
+     * @type Object
+     */
+      lodash.templateSettings = {
+        'escape': reEscape,
+        'evaluate': reEvaluate,
+        'interpolate': reInterpolate,
+        'variable': '',
+        'imports': { '_': lodash }
+      };
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a lazy wrapper object which wraps `value` to enable lazy evaluation.
+     *
+     * @private
+     * @param {*} value The value to wrap.
+     */
+      function LazyWrapper(value) {
+        this.__wrapped__ = value;
+        this.__actions__ = [];
+        this.__dir__ = 1;
+        this.__filtered__ = false;
+        this.__iteratees__ = [];
+        this.__takeCount__ = POSITIVE_INFINITY;
+        this.__views__ = [];
+      }
+      /**
+     * Creates a clone of the lazy wrapper object.
+     *
+     * @private
+     * @name clone
+     * @memberOf LazyWrapper
+     * @returns {Object} Returns the cloned `LazyWrapper` object.
+     */
+      function lazyClone() {
+        var result = new LazyWrapper(this.__wrapped__);
+        result.__actions__ = arrayCopy(this.__actions__);
+        result.__dir__ = this.__dir__;
+        result.__filtered__ = this.__filtered__;
+        result.__iteratees__ = arrayCopy(this.__iteratees__);
+        result.__takeCount__ = this.__takeCount__;
+        result.__views__ = arrayCopy(this.__views__);
+        return result;
+      }
+      /**
+     * Reverses the direction of lazy iteration.
+     *
+     * @private
+     * @name reverse
+     * @memberOf LazyWrapper
+     * @returns {Object} Returns the new reversed `LazyWrapper` object.
+     */
+      function lazyReverse() {
+        if (this.__filtered__) {
+          var result = new LazyWrapper(this);
+          result.__dir__ = -1;
+          result.__filtered__ = true;
+        } else {
+          result = this.clone();
+          result.__dir__ *= -1;
+        }
+        return result;
+      }
+      /**
+     * Extracts the unwrapped value from its lazy wrapper.
+     *
+     * @private
+     * @name value
+     * @memberOf LazyWrapper
+     * @returns {*} Returns the unwrapped value.
+     */
+      function lazyValue() {
+        var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__);
+        if (!isArr || arrLength < LARGE_ARRAY_SIZE || arrLength == length && takeCount == length) {
+          return baseWrapperValue(array, this.__actions__);
+        }
+        var result = [];
+        outer:
+          while (length-- && resIndex < takeCount) {
+            index += dir;
+            var iterIndex = -1, value = array[index];
+            while (++iterIndex < iterLength) {
+              var data = iteratees[iterIndex], iteratee = data.iteratee, type = data.type, computed = iteratee(value);
+              if (type == LAZY_MAP_FLAG) {
+                value = computed;
+              } else if (!computed) {
+                if (type == LAZY_FILTER_FLAG) {
+                  continue outer;
+                } else {
+                  break outer;
+                }
+              }
+            }
+            result[resIndex++] = value;
+          }
+        return result;
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a cache object to store key/value pairs.
+     *
+     * @private
+     * @static
+     * @name Cache
+     * @memberOf _.memoize
+     */
+      function MapCache() {
+        this.__data__ = {};
+      }
+      /**
+     * Removes `key` and its value from the cache.
+     *
+     * @private
+     * @name delete
+     * @memberOf _.memoize.Cache
+     * @param {string} key The key of the value to remove.
+     * @returns {boolean} Returns `true` if the entry was removed successfully, else `false`.
+     */
+      function mapDelete(key) {
+        return this.has(key) && delete this.__data__[key];
+      }
+      /**
+     * Gets the cached value for `key`.
+     *
+     * @private
+     * @name get
+     * @memberOf _.memoize.Cache
+     * @param {string} key The key of the value to get.
+     * @returns {*} Returns the cached value.
+     */
+      function mapGet(key) {
+        return key == '__proto__' ? undefined : this.__data__[key];
+      }
+      /**
+     * Checks if a cached value for `key` exists.
+     *
+     * @private
+     * @name has
+     * @memberOf _.memoize.Cache
+     * @param {string} key The key of the entry to check.
+     * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
+     */
+      function mapHas(key) {
+        return key != '__proto__' && hasOwnProperty.call(this.__data__, key);
+      }
+      /**
+     * Sets `value` to `key` of the cache.
+     *
+     * @private
+     * @name set
+     * @memberOf _.memoize.Cache
+     * @param {string} key The key of the value to cache.
+     * @param {*} value The value to cache.
+     * @returns {Object} Returns the cache object.
+     */
+      function mapSet(key, value) {
+        if (key != '__proto__') {
+          this.__data__[key] = value;
+        }
+        return this;
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     *
+     * Creates a cache object to store unique values.
+     *
+     * @private
+     * @param {Array} [values] The values to cache.
+     */
+      function SetCache(values) {
+        var length = values ? values.length : 0;
+        this.data = {
+          'hash': nativeCreate(null),
+          'set': new Set()
+        };
+        while (length--) {
+          this.push(values[length]);
+        }
+      }
+      /**
+     * Checks if `value` is in `cache` mimicking the return signature of
+     * `_.indexOf` by returning `0` if the value is found, else `-1`.
+     *
+     * @private
+     * @param {Object} cache The cache to search.
+     * @param {*} value The value to search for.
+     * @returns {number} Returns `0` if `value` is found, else `-1`.
+     */
+      function cacheIndexOf(cache, value) {
+        var data = cache.data, result = typeof value == 'string' || isObject(value) ? data.set.has(value) : data.hash[value];
+        return result ? 0 : -1;
+      }
+      /**
+     * Adds `value` to the cache.
+     *
+     * @private
+     * @name push
+     * @memberOf SetCache
+     * @param {*} value The value to cache.
+     */
+      function cachePush(value) {
+        var data = this.data;
+        if (typeof value == 'string' || isObject(value)) {
+          data.set.add(value);
+        } else {
+          data.hash[value] = true;
+        }
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a new array joining `array` with `other`.
+     *
+     * @private
+     * @param {Array} array The array to join.
+     * @param {Array} other The other array to join.
+     * @returns {Array} Returns the new concatenated array.
+     */
+      function arrayConcat(array, other) {
+        var index = -1, length = array.length, othIndex = -1, othLength = other.length, result = Array(length + othLength);
+        while (++index < length) {
+          result[index] = array[index];
+        }
+        while (++othIndex < othLength) {
+          result[index++] = other[othIndex];
+        }
+        return result;
+      }
+      /**
+     * Copies the values of `source` to `array`.
+     *
+     * @private
+     * @param {Array} source The array to copy values from.
+     * @param {Array} [array=[]] The array to copy values to.
+     * @returns {Array} Returns `array`.
+     */
+      function arrayCopy(source, array) {
+        var index = -1, length = source.length;
+        array || (array = Array(length));
+        while (++index < length) {
+          array[index] = source[index];
+        }
+        return array;
+      }
+      /**
+     * A specialized version of `_.forEach` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array} Returns `array`.
+     */
+      function arrayEach(array, iteratee) {
+        var index = -1, length = array.length;
+        while (++index < length) {
+          if (iteratee(array[index], index, array) === false) {
+            break;
+          }
+        }
+        return array;
+      }
+      /**
+     * A specialized version of `_.forEachRight` for arrays without support for
+     * callback shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array} Returns `array`.
+     */
+      function arrayEachRight(array, iteratee) {
+        var length = array.length;
+        while (length--) {
+          if (iteratee(array[length], length, array) === false) {
+            break;
+          }
+        }
+        return array;
+      }
+      /**
+     * A specialized version of `_.every` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {boolean} Returns `true` if all elements pass the predicate check,
+     *  else `false`.
+     */
+      function arrayEvery(array, predicate) {
+        var index = -1, length = array.length;
+        while (++index < length) {
+          if (!predicate(array[index], index, array)) {
+            return false;
+          }
+        }
+        return true;
+      }
+      /**
+     * A specialized version of `baseExtremum` for arrays which invokes `iteratee`
+     * with one argument: (value).
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {Function} comparator The function used to compare values.
+     * @param {*} exValue The initial extremum value.
+     * @returns {*} Returns the extremum value.
+     */
+      function arrayExtremum(array, iteratee, comparator, exValue) {
+        var index = -1, length = array.length, computed = exValue, result = computed;
+        while (++index < length) {
+          var value = array[index], current = +iteratee(value);
+          if (comparator(current, computed)) {
+            computed = current;
+            result = value;
+          }
+        }
+        return result;
+      }
+      /**
+     * A specialized version of `_.filter` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {Array} Returns the new filtered array.
+     */
+      function arrayFilter(array, predicate) {
+        var index = -1, length = array.length, resIndex = -1, result = [];
+        while (++index < length) {
+          var value = array[index];
+          if (predicate(value, index, array)) {
+            result[++resIndex] = value;
+          }
+        }
+        return result;
+      }
+      /**
+     * A specialized version of `_.map` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array} Returns the new mapped array.
+     */
+      function arrayMap(array, iteratee) {
+        var index = -1, length = array.length, result = Array(length);
+        while (++index < length) {
+          result[index] = iteratee(array[index], index, array);
+        }
+        return result;
+      }
+      /**
+     * Appends the elements of `values` to `array`.
+     *
+     * @private
+     * @param {Array} array The array to modify.
+     * @param {Array} values The values to append.
+     * @returns {Array} Returns `array`.
+     */
+      function arrayPush(array, values) {
+        var index = -1, length = values.length, offset = array.length;
+        while (++index < length) {
+          array[offset + index] = values[index];
+        }
+        return array;
+      }
+      /**
+     * A specialized version of `_.reduce` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {*} [accumulator] The initial value.
+     * @param {boolean} [initFromArray] Specify using the first element of `array`
+     *  as the initial value.
+     * @returns {*} Returns the accumulated value.
+     */
+      function arrayReduce(array, iteratee, accumulator, initFromArray) {
+        var index = -1, length = array.length;
+        if (initFromArray && length) {
+          accumulator = array[++index];
+        }
+        while (++index < length) {
+          accumulator = iteratee(accumulator, array[index], index, array);
+        }
+        return accumulator;
+      }
+      /**
+     * A specialized version of `_.reduceRight` for arrays without support for
+     * callback shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {*} [accumulator] The initial value.
+     * @param {boolean} [initFromArray] Specify using the last element of `array`
+     *  as the initial value.
+     * @returns {*} Returns the accumulated value.
+     */
+      function arrayReduceRight(array, iteratee, accumulator, initFromArray) {
+        var length = array.length;
+        if (initFromArray && length) {
+          accumulator = array[--length];
+        }
+        while (length--) {
+          accumulator = iteratee(accumulator, array[length], length, array);
+        }
+        return accumulator;
+      }
+      /**
+     * A specialized version of `_.some` for arrays without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {boolean} Returns `true` if any element passes the predicate check,
+     *  else `false`.
+     */
+      function arraySome(array, predicate) {
+        var index = -1, length = array.length;
+        while (++index < length) {
+          if (predicate(array[index], index, array)) {
+            return true;
+          }
+        }
+        return false;
+      }
+      /**
+     * A specialized version of `_.sum` for arrays without support for callback
+     * shorthands and `this` binding..
+     *
+     * @private
+     * @param {Array} array The array to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {number} Returns the sum.
+     */
+      function arraySum(array, iteratee) {
+        var length = array.length, result = 0;
+        while (length--) {
+          result += +iteratee(array[length]) || 0;
+        }
+        return result;
+      }
+      /**
+     * Used by `_.defaults` to customize its `_.assign` use.
+     *
+     * @private
+     * @param {*} objectValue The destination object property value.
+     * @param {*} sourceValue The source object property value.
+     * @returns {*} Returns the value to assign to the destination object.
+     */
+      function assignDefaults(objectValue, sourceValue) {
+        return objectValue === undefined ? sourceValue : objectValue;
+      }
+      /**
+     * Used by `_.template` to customize its `_.assign` use.
+     *
+     * **Note:** This function is like `assignDefaults` except that it ignores
+     * inherited property values when checking if a property is `undefined`.
+     *
+     * @private
+     * @param {*} objectValue The destination object property value.
+     * @param {*} sourceValue The source object property value.
+     * @param {string} key The key associated with the object and source values.
+     * @param {Object} object The destination object.
+     * @returns {*} Returns the value to assign to the destination object.
+     */
+      function assignOwnDefaults(objectValue, sourceValue, key, object) {
+        return objectValue === undefined || !hasOwnProperty.call(object, key) ? sourceValue : objectValue;
+      }
+      /**
+     * A specialized version of `_.assign` for customizing assigned values without
+     * support for argument juggling, multiple sources, and `this` binding `customizer`
+     * functions.
+     *
+     * @private
+     * @param {Object} object The destination object.
+     * @param {Object} source The source object.
+     * @param {Function} customizer The function to customize assigned values.
+     * @returns {Object} Returns `object`.
+     */
+      function assignWith(object, source, customizer) {
+        var index = -1, props = keys(source), length = props.length;
+        while (++index < length) {
+          var key = props[index], value = object[key], result = customizer(value, source[key], key, object, source);
+          if ((result === result ? result !== value : value === value) || value === undefined && !(key in object)) {
+            object[key] = result;
+          }
+        }
+        return object;
+      }
+      /**
+     * The base implementation of `_.assign` without support for argument juggling,
+     * multiple sources, and `customizer` functions.
+     *
+     * @private
+     * @param {Object} object The destination object.
+     * @param {Object} source The source object.
+     * @returns {Object} Returns `object`.
+     */
+      function baseAssign(object, source) {
+        return source == null ? object : baseCopy(source, keys(source), object);
+      }
+      /**
+     * The base implementation of `_.at` without support for string collections
+     * and individual key arguments.
+     *
+     * @private
+     * @param {Array|Object} collection The collection to iterate over.
+     * @param {number[]|string[]} props The property names or indexes of elements to pick.
+     * @returns {Array} Returns the new array of picked elements.
+     */
+      function baseAt(collection, props) {
+        var index = -1, isNil = collection == null, isArr = !isNil && isArrayLike(collection), length = isArr ? collection.length : 0, propsLength = props.length, result = Array(propsLength);
+        while (++index < propsLength) {
+          var key = props[index];
+          if (isArr) {
+            result[index] = isIndex(key, length) ? collection[key] : undefined;
+          } else {
+            result[index] = isNil ? undefined : collection[key];
+          }
+        }
+        return result;
+      }
+      /**
+     * Copies properties of `source` to `object`.
+     *
+     * @private
+     * @param {Object} source The object to copy properties from.
+     * @param {Array} props The property names to copy.
+     * @param {Object} [object={}] The object to copy properties to.
+     * @returns {Object} Returns `object`.
+     */
+      function baseCopy(source, props, object) {
+        object || (object = {});
+        var index = -1, length = props.length;
+        while (++index < length) {
+          var key = props[index];
+          object[key] = source[key];
+        }
+        return object;
+      }
+      /**
+     * The base implementation of `_.callback` which supports specifying the
+     * number of arguments to provide to `func`.
+     *
+     * @private
+     * @param {*} [func=_.identity] The value to convert to a callback.
+     * @param {*} [thisArg] The `this` binding of `func`.
+     * @param {number} [argCount] The number of arguments to provide to `func`.
+     * @returns {Function} Returns the callback.
+     */
+      function baseCallback(func, thisArg, argCount) {
+        var type = typeof func;
+        if (type == 'function') {
+          return thisArg === undefined ? func : bindCallback(func, thisArg, argCount);
+        }
+        if (func == null) {
+          return identity;
+        }
+        if (type == 'object') {
+          return baseMatches(func);
+        }
+        return thisArg === undefined ? property(func) : baseMatchesProperty(func, thisArg);
+      }
+      /**
+     * The base implementation of `_.clone` without support for argument juggling
+     * and `this` binding `customizer` functions.
+     *
+     * @private
+     * @param {*} value The value to clone.
+     * @param {boolean} [isDeep] Specify a deep clone.
+     * @param {Function} [customizer] The function to customize cloning values.
+     * @param {string} [key] The key of `value`.
+     * @param {Object} [object] The object `value` belongs to.
+     * @param {Array} [stackA=[]] Tracks traversed source objects.
+     * @param {Array} [stackB=[]] Associates clones with source counterparts.
+     * @returns {*} Returns the cloned value.
+     */
+      function baseClone(value, isDeep, customizer, key, object, stackA, stackB) {
+        var result;
+        if (customizer) {
+          result = object ? customizer(value, key, object) : customizer(value);
+        }
+        if (result !== undefined) {
+          return result;
+        }
+        if (!isObject(value)) {
+          return value;
+        }
+        var isArr = isArray(value);
+        if (isArr) {
+          result = initCloneArray(value);
+          if (!isDeep) {
+            return arrayCopy(value, result);
+          }
+        } else {
+          var tag = objToString.call(value), isFunc = tag == funcTag;
+          if (tag == objectTag || tag == argsTag || isFunc && !object) {
+            result = initCloneObject(isFunc ? {} : value);
+            if (!isDeep) {
+              return baseAssign(result, value);
+            }
+          } else {
+            return cloneableTags[tag] ? initCloneByTag(value, tag, isDeep) : object ? value : {};
+          }
+        }
+        // Check for circular references and return its corresponding clone.
+        stackA || (stackA = []);
+        stackB || (stackB = []);
+        var length = stackA.length;
+        while (length--) {
+          if (stackA[length] == value) {
+            return stackB[length];
+          }
+        }
+        // Add the source value to the stack of traversed objects and associate it with its clone.
+        stackA.push(value);
+        stackB.push(result);
+        // Recursively populate clone (susceptible to call stack limits).
+        (isArr ? arrayEach : baseForOwn)(value, function (subValue, key) {
+          result[key] = baseClone(subValue, isDeep, customizer, key, value, stackA, stackB);
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.create` without support for assigning
+     * properties to the created object.
+     *
+     * @private
+     * @param {Object} prototype The object to inherit from.
+     * @returns {Object} Returns the new object.
+     */
+      var baseCreate = function () {
+          function object() {
+          }
+          return function (prototype) {
+            if (isObject(prototype)) {
+              object.prototype = prototype;
+              var result = new object();
+              object.prototype = undefined;
+            }
+            return result || {};
+          };
+        }();
+      /**
+     * The base implementation of `_.delay` and `_.defer` which accepts an index
+     * of where to slice the arguments to provide to `func`.
+     *
+     * @private
+     * @param {Function} func The function to delay.
+     * @param {number} wait The number of milliseconds to delay invocation.
+     * @param {Object} args The arguments provide to `func`.
+     * @returns {number} Returns the timer id.
+     */
+      function baseDelay(func, wait, args) {
+        if (typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        return setTimeout(function () {
+          func.apply(undefined, args);
+        }, wait);
+      }
+      /**
+     * The base implementation of `_.difference` which accepts a single array
+     * of values to exclude.
+     *
+     * @private
+     * @param {Array} array The array to inspect.
+     * @param {Array} values The values to exclude.
+     * @returns {Array} Returns the new array of filtered values.
+     */
+      function baseDifference(array, values) {
+        var length = array ? array.length : 0, result = [];
+        if (!length) {
+          return result;
+        }
+        var index = -1, indexOf = getIndexOf(), isCommon = indexOf === baseIndexOf, cache = isCommon && values.length >= LARGE_ARRAY_SIZE ? createCache(values) : null, valuesLength = values.length;
+        if (cache) {
+          indexOf = cacheIndexOf;
+          isCommon = false;
+          values = cache;
+        }
+        outer:
+          while (++index < length) {
+            var value = array[index];
+            if (isCommon && value === value) {
+              var valuesIndex = valuesLength;
+              while (valuesIndex--) {
+                if (values[valuesIndex] === value) {
+                  continue outer;
+                }
+              }
+              result.push(value);
+            } else if (indexOf(values, value, 0) < 0) {
+              result.push(value);
+            }
+          }
+        return result;
+      }
+      /**
+     * The base implementation of `_.forEach` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array|Object|string} Returns `collection`.
+     */
+      var baseEach = createBaseEach(baseForOwn);
+      /**
+     * The base implementation of `_.forEachRight` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array|Object|string} Returns `collection`.
+     */
+      var baseEachRight = createBaseEach(baseForOwnRight, true);
+      /**
+     * The base implementation of `_.every` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {boolean} Returns `true` if all elements pass the predicate check,
+     *  else `false`
+     */
+      function baseEvery(collection, predicate) {
+        var result = true;
+        baseEach(collection, function (value, index, collection) {
+          result = !!predicate(value, index, collection);
+          return result;
+        });
+        return result;
+      }
+      /**
+     * Gets the extremum value of `collection` invoking `iteratee` for each value
+     * in `collection` to generate the criterion by which the value is ranked.
+     * The `iteratee` is invoked with three arguments: (value, index|key, collection).
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {Function} comparator The function used to compare values.
+     * @param {*} exValue The initial extremum value.
+     * @returns {*} Returns the extremum value.
+     */
+      function baseExtremum(collection, iteratee, comparator, exValue) {
+        var computed = exValue, result = computed;
+        baseEach(collection, function (value, index, collection) {
+          var current = +iteratee(value, index, collection);
+          if (comparator(current, computed) || current === exValue && current === result) {
+            computed = current;
+            result = value;
+          }
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.fill` without an iteratee call guard.
+     *
+     * @private
+     * @param {Array} array The array to fill.
+     * @param {*} value The value to fill `array` with.
+     * @param {number} [start=0] The start position.
+     * @param {number} [end=array.length] The end position.
+     * @returns {Array} Returns `array`.
+     */
+      function baseFill(array, value, start, end) {
+        var length = array.length;
+        start = start == null ? 0 : +start || 0;
+        if (start < 0) {
+          start = -start > length ? 0 : length + start;
+        }
+        end = end === undefined || end > length ? length : +end || 0;
+        if (end < 0) {
+          end += length;
+        }
+        length = start > end ? 0 : end >>> 0;
+        start >>>= 0;
+        while (start < length) {
+          array[start++] = value;
+        }
+        return array;
+      }
+      /**
+     * The base implementation of `_.filter` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {Array} Returns the new filtered array.
+     */
+      function baseFilter(collection, predicate) {
+        var result = [];
+        baseEach(collection, function (value, index, collection) {
+          if (predicate(value, index, collection)) {
+            result.push(value);
+          }
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.find`, `_.findLast`, `_.findKey`, and `_.findLastKey`,
+     * without support for callback shorthands and `this` binding, which iterates
+     * over `collection` using the provided `eachFunc`.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {Function} predicate The function invoked per iteration.
+     * @param {Function} eachFunc The function to iterate over `collection`.
+     * @param {boolean} [retKey] Specify returning the key of the found element
+     *  instead of the element itself.
+     * @returns {*} Returns the found element or its key, else `undefined`.
+     */
+      function baseFind(collection, predicate, eachFunc, retKey) {
+        var result;
+        eachFunc(collection, function (value, key, collection) {
+          if (predicate(value, key, collection)) {
+            result = retKey ? key : value;
+            return false;
+          }
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.flatten` with added support for restricting
+     * flattening and specifying the start index.
+     *
+     * @private
+     * @param {Array} array The array to flatten.
+     * @param {boolean} [isDeep] Specify a deep flatten.
+     * @param {boolean} [isStrict] Restrict flattening to arrays-like objects.
+     * @param {Array} [result=[]] The initial result value.
+     * @returns {Array} Returns the new flattened array.
+     */
+      function baseFlatten(array, isDeep, isStrict, result) {
+        result || (result = []);
+        var index = -1, length = array.length;
+        while (++index < length) {
+          var value = array[index];
+          if (isObjectLike(value) && isArrayLike(value) && (isStrict || isArray(value) || isArguments(value))) {
+            if (isDeep) {
+              // Recursively flatten arrays (susceptible to call stack limits).
+              baseFlatten(value, isDeep, isStrict, result);
+            } else {
+              arrayPush(result, value);
+            }
+          } else if (!isStrict) {
+            result[result.length] = value;
+          }
+        }
+        return result;
+      }
+      /**
+     * The base implementation of `baseForIn` and `baseForOwn` which iterates
+     * over `object` properties returned by `keysFunc` invoking `iteratee` for
+     * each property. Iteratee functions may exit iteration early by explicitly
+     * returning `false`.
+     *
+     * @private
+     * @param {Object} object The object to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {Function} keysFunc The function to get the keys of `object`.
+     * @returns {Object} Returns `object`.
+     */
+      var baseFor = createBaseFor();
+      /**
+     * This function is like `baseFor` except that it iterates over properties
+     * in the opposite order.
+     *
+     * @private
+     * @param {Object} object The object to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {Function} keysFunc The function to get the keys of `object`.
+     * @returns {Object} Returns `object`.
+     */
+      var baseForRight = createBaseFor(true);
+      /**
+     * The base implementation of `_.forIn` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Object} object The object to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Object} Returns `object`.
+     */
+      function baseForIn(object, iteratee) {
+        return baseFor(object, iteratee, keysIn);
+      }
+      /**
+     * The base implementation of `_.forOwn` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Object} object The object to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Object} Returns `object`.
+     */
+      function baseForOwn(object, iteratee) {
+        return baseFor(object, iteratee, keys);
+      }
+      /**
+     * The base implementation of `_.forOwnRight` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Object} object The object to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Object} Returns `object`.
+     */
+      function baseForOwnRight(object, iteratee) {
+        return baseForRight(object, iteratee, keys);
+      }
+      /**
+     * The base implementation of `_.functions` which creates an array of
+     * `object` function property names filtered from those provided.
+     *
+     * @private
+     * @param {Object} object The object to inspect.
+     * @param {Array} props The property names to filter.
+     * @returns {Array} Returns the new array of filtered property names.
+     */
+      function baseFunctions(object, props) {
+        var index = -1, length = props.length, resIndex = -1, result = [];
+        while (++index < length) {
+          var key = props[index];
+          if (isFunction(object[key])) {
+            result[++resIndex] = key;
+          }
+        }
+        return result;
+      }
+      /**
+     * The base implementation of `get` without support for string paths
+     * and default values.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @param {Array} path The path of the property to get.
+     * @param {string} [pathKey] The key representation of path.
+     * @returns {*} Returns the resolved value.
+     */
+      function baseGet(object, path, pathKey) {
+        if (object == null) {
+          return;
+        }
+        if (pathKey !== undefined && pathKey in toObject(object)) {
+          path = [pathKey];
+        }
+        var index = 0, length = path.length;
+        while (object != null && index < length) {
+          object = object[path[index++]];
+        }
+        return index && index == length ? object : undefined;
+      }
+      /**
+     * The base implementation of `_.isEqual` without support for `this` binding
+     * `customizer` functions.
+     *
+     * @private
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @param {Function} [customizer] The function to customize comparing values.
+     * @param {boolean} [isLoose] Specify performing partial comparisons.
+     * @param {Array} [stackA] Tracks traversed `value` objects.
+     * @param {Array} [stackB] Tracks traversed `other` objects.
+     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+     */
+      function baseIsEqual(value, other, customizer, isLoose, stackA, stackB) {
+        if (value === other) {
+          return true;
+        }
+        if (value == null || other == null || !isObject(value) && !isObjectLike(other)) {
+          return value !== value && other !== other;
+        }
+        return baseIsEqualDeep(value, other, baseIsEqual, customizer, isLoose, stackA, stackB);
+      }
+      /**
+     * A specialized version of `baseIsEqual` for arrays and objects which performs
+     * deep comparisons and tracks traversed objects enabling objects with circular
+     * references to be compared.
+     *
+     * @private
+     * @param {Object} object The object to compare.
+     * @param {Object} other The other object to compare.
+     * @param {Function} equalFunc The function to determine equivalents of values.
+     * @param {Function} [customizer] The function to customize comparing objects.
+     * @param {boolean} [isLoose] Specify performing partial comparisons.
+     * @param {Array} [stackA=[]] Tracks traversed `value` objects.
+     * @param {Array} [stackB=[]] Tracks traversed `other` objects.
+     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+     */
+      function baseIsEqualDeep(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+        var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag;
+        if (!objIsArr) {
+          objTag = objToString.call(object);
+          if (objTag == argsTag) {
+            objTag = objectTag;
+          } else if (objTag != objectTag) {
+            objIsArr = isTypedArray(object);
+          }
+        }
+        if (!othIsArr) {
+          othTag = objToString.call(other);
+          if (othTag == argsTag) {
+            othTag = objectTag;
+          } else if (othTag != objectTag) {
+            othIsArr = isTypedArray(other);
+          }
+        }
+        var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag;
+        if (isSameTag && !(objIsArr || objIsObj)) {
+          return equalByTag(object, other, objTag);
+        }
+        if (!isLoose) {
+          var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'), othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');
+          if (objIsWrapped || othIsWrapped) {
+            return equalFunc(objIsWrapped ? object.value() : object, othIsWrapped ? other.value() : other, customizer, isLoose, stackA, stackB);
+          }
+        }
+        if (!isSameTag) {
+          return false;
+        }
+        // Assume cyclic values are equal.
+        // For more information on detecting circular references see https://es5.github.io/#JO.
+        stackA || (stackA = []);
+        stackB || (stackB = []);
+        var length = stackA.length;
+        while (length--) {
+          if (stackA[length] == object) {
+            return stackB[length] == other;
+          }
+        }
+        // Add `object` and `other` to the stack of traversed objects.
+        stackA.push(object);
+        stackB.push(other);
+        var result = (objIsArr ? equalArrays : equalObjects)(object, other, equalFunc, customizer, isLoose, stackA, stackB);
+        stackA.pop();
+        stackB.pop();
+        return result;
+      }
+      /**
+     * The base implementation of `_.isMatch` without support for callback
+     * shorthands and `this` binding.
+     *
+     * @private
+     * @param {Object} object The object to inspect.
+     * @param {Array} matchData The propery names, values, and compare flags to match.
+     * @param {Function} [customizer] The function to customize comparing objects.
+     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+     */
+      function baseIsMatch(object, matchData, customizer) {
+        var index = matchData.length, length = index, noCustomizer = !customizer;
+        if (object == null) {
+          return !length;
+        }
+        object = toObject(object);
+        while (index--) {
+          var data = matchData[index];
+          if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) {
+            return false;
+          }
+        }
+        while (++index < length) {
+          data = matchData[index];
+          var key = data[0], objValue = object[key], srcValue = data[1];
+          if (noCustomizer && data[2]) {
+            if (objValue === undefined && !(key in object)) {
+              return false;
+            }
+          } else {
+            var result = customizer ? customizer(objValue, srcValue, key) : undefined;
+            if (!(result === undefined ? baseIsEqual(srcValue, objValue, customizer, true) : result)) {
+              return false;
+            }
+          }
+        }
+        return true;
+      }
+      /**
+     * The base implementation of `_.map` without support for callback shorthands
+     * and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {Array} Returns the new mapped array.
+     */
+      function baseMap(collection, iteratee) {
+        var index = -1, result = isArrayLike(collection) ? Array(collection.length) : [];
+        baseEach(collection, function (value, key, collection) {
+          result[++index] = iteratee(value, key, collection);
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.matches` which does not clone `source`.
+     *
+     * @private
+     * @param {Object} source The object of property values to match.
+     * @returns {Function} Returns the new function.
+     */
+      function baseMatches(source) {
+        var matchData = getMatchData(source);
+        if (matchData.length == 1 && matchData[0][2]) {
+          var key = matchData[0][0], value = matchData[0][1];
+          return function (object) {
+            if (object == null) {
+              return false;
+            }
+            return object[key] === value && (value !== undefined || key in toObject(object));
+          };
+        }
+        return function (object) {
+          return baseIsMatch(object, matchData);
+        };
+      }
+      /**
+     * The base implementation of `_.matchesProperty` which does not clone `srcValue`.
+     *
+     * @private
+     * @param {string} path The path of the property to get.
+     * @param {*} srcValue The value to compare.
+     * @returns {Function} Returns the new function.
+     */
+      function baseMatchesProperty(path, srcValue) {
+        var isArr = isArray(path), isCommon = isKey(path) && isStrictComparable(srcValue), pathKey = path + '';
+        path = toPath(path);
+        return function (object) {
+          if (object == null) {
+            return false;
+          }
+          var key = pathKey;
+          object = toObject(object);
+          if ((isArr || !isCommon) && !(key in object)) {
+            object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+            if (object == null) {
+              return false;
+            }
+            key = last(path);
+            object = toObject(object);
+          }
+          return object[key] === srcValue ? srcValue !== undefined || key in object : baseIsEqual(srcValue, object[key], undefined, true);
+        };
+      }
+      /**
+     * The base implementation of `_.merge` without support for argument juggling,
+     * multiple sources, and `this` binding `customizer` functions.
+     *
+     * @private
+     * @param {Object} object The destination object.
+     * @param {Object} source The source object.
+     * @param {Function} [customizer] The function to customize merged values.
+     * @param {Array} [stackA=[]] Tracks traversed source objects.
+     * @param {Array} [stackB=[]] Associates values with source counterparts.
+     * @returns {Object} Returns `object`.
+     */
+      function baseMerge(object, source, customizer, stackA, stackB) {
+        if (!isObject(object)) {
+          return object;
+        }
+        var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)), props = isSrcArr ? undefined : keys(source);
+        arrayEach(props || source, function (srcValue, key) {
+          if (props) {
+            key = srcValue;
+            srcValue = source[key];
+          }
+          if (isObjectLike(srcValue)) {
+            stackA || (stackA = []);
+            stackB || (stackB = []);
+            baseMergeDeep(object, source, key, baseMerge, customizer, stackA, stackB);
+          } else {
+            var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined;
+            if (isCommon) {
+              result = srcValue;
+            }
+            if ((result !== undefined || isSrcArr && !(key in object)) && (isCommon || (result === result ? result !== value : value === value))) {
+              object[key] = result;
+            }
+          }
+        });
+        return object;
+      }
+      /**
+     * A specialized version of `baseMerge` for arrays and objects which performs
+     * deep merges and tracks traversed objects enabling objects with circular
+     * references to be merged.
+     *
+     * @private
+     * @param {Object} object The destination object.
+     * @param {Object} source The source object.
+     * @param {string} key The key of the value to merge.
+     * @param {Function} mergeFunc The function to merge values.
+     * @param {Function} [customizer] The function to customize merged values.
+     * @param {Array} [stackA=[]] Tracks traversed source objects.
+     * @param {Array} [stackB=[]] Associates values with source counterparts.
+     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+     */
+      function baseMergeDeep(object, source, key, mergeFunc, customizer, stackA, stackB) {
+        var length = stackA.length, srcValue = source[key];
+        while (length--) {
+          if (stackA[length] == srcValue) {
+            object[key] = stackB[length];
+            return;
+          }
+        }
+        var value = object[key], result = customizer ? customizer(value, srcValue, key, object, source) : undefined, isCommon = result === undefined;
+        if (isCommon) {
+          result = srcValue;
+          if (isArrayLike(srcValue) && (isArray(srcValue) || isTypedArray(srcValue))) {
+            result = isArray(value) ? value : isArrayLike(value) ? arrayCopy(value) : [];
+          } else if (isPlainObject(srcValue) || isArguments(srcValue)) {
+            result = isArguments(value) ? toPlainObject(value) : isPlainObject(value) ? value : {};
+          } else {
+            isCommon = false;
+          }
+        }
+        // Add the source value to the stack of traversed objects and associate
+        // it with its merged value.
+        stackA.push(srcValue);
+        stackB.push(result);
+        if (isCommon) {
+          // Recursively merge objects and arrays (susceptible to call stack limits).
+          object[key] = mergeFunc(result, srcValue, customizer, stackA, stackB);
+        } else if (result === result ? result !== value : value === value) {
+          object[key] = result;
+        }
+      }
+      /**
+     * The base implementation of `_.property` without support for deep paths.
+     *
+     * @private
+     * @param {string} key The key of the property to get.
+     * @returns {Function} Returns the new function.
+     */
+      function baseProperty(key) {
+        return function (object) {
+          return object == null ? undefined : object[key];
+        };
+      }
+      /**
+     * A specialized version of `baseProperty` which supports deep paths.
+     *
+     * @private
+     * @param {Array|string} path The path of the property to get.
+     * @returns {Function} Returns the new function.
+     */
+      function basePropertyDeep(path) {
+        var pathKey = path + '';
+        path = toPath(path);
+        return function (object) {
+          return baseGet(object, path, pathKey);
+        };
+      }
+      /**
+     * The base implementation of `_.pullAt` without support for individual
+     * index arguments and capturing the removed elements.
+     *
+     * @private
+     * @param {Array} array The array to modify.
+     * @param {number[]} indexes The indexes of elements to remove.
+     * @returns {Array} Returns `array`.
+     */
+      function basePullAt(array, indexes) {
+        var length = array ? indexes.length : 0;
+        while (length--) {
+          var index = indexes[length];
+          if (index != previous && isIndex(index)) {
+            var previous = index;
+            splice.call(array, index, 1);
+          }
+        }
+        return array;
+      }
+      /**
+     * The base implementation of `_.random` without support for argument juggling
+     * and returning floating-point numbers.
+     *
+     * @private
+     * @param {number} min The minimum possible value.
+     * @param {number} max The maximum possible value.
+     * @returns {number} Returns the random number.
+     */
+      function baseRandom(min, max) {
+        return min + nativeFloor(nativeRandom() * (max - min + 1));
+      }
+      /**
+     * The base implementation of `_.reduce` and `_.reduceRight` without support
+     * for callback shorthands and `this` binding, which iterates over `collection`
+     * using the provided `eachFunc`.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {*} accumulator The initial value.
+     * @param {boolean} initFromCollection Specify using the first or last element
+     *  of `collection` as the initial value.
+     * @param {Function} eachFunc The function to iterate over `collection`.
+     * @returns {*} Returns the accumulated value.
+     */
+      function baseReduce(collection, iteratee, accumulator, initFromCollection, eachFunc) {
+        eachFunc(collection, function (value, index, collection) {
+          accumulator = initFromCollection ? (initFromCollection = false, value) : iteratee(accumulator, value, index, collection);
+        });
+        return accumulator;
+      }
+      /**
+     * The base implementation of `setData` without support for hot loop detection.
+     *
+     * @private
+     * @param {Function} func The function to associate metadata with.
+     * @param {*} data The metadata.
+     * @returns {Function} Returns `func`.
+     */
+      var baseSetData = !metaMap ? identity : function (func, data) {
+          metaMap.set(func, data);
+          return func;
+        };
+      /**
+     * The base implementation of `_.slice` without an iteratee call guard.
+     *
+     * @private
+     * @param {Array} array The array to slice.
+     * @param {number} [start=0] The start position.
+     * @param {number} [end=array.length] The end position.
+     * @returns {Array} Returns the slice of `array`.
+     */
+      function baseSlice(array, start, end) {
+        var index = -1, length = array.length;
+        start = start == null ? 0 : +start || 0;
+        if (start < 0) {
+          start = -start > length ? 0 : length + start;
+        }
+        end = end === undefined || end > length ? length : +end || 0;
+        if (end < 0) {
+          end += length;
+        }
+        length = start > end ? 0 : end - start >>> 0;
+        start >>>= 0;
+        var result = Array(length);
+        while (++index < length) {
+          result[index] = array[index + start];
+        }
+        return result;
+      }
+      /**
+     * The base implementation of `_.some` without support for callback shorthands
+     * and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {boolean} Returns `true` if any element passes the predicate check,
+     *  else `false`.
+     */
+      function baseSome(collection, predicate) {
+        var result;
+        baseEach(collection, function (value, index, collection) {
+          result = predicate(value, index, collection);
+          return !result;
+        });
+        return !!result;
+      }
+      /**
+     * The base implementation of `_.sortBy` which uses `comparer` to define
+     * the sort order of `array` and replaces criteria objects with their
+     * corresponding values.
+     *
+     * @private
+     * @param {Array} array The array to sort.
+     * @param {Function} comparer The function to define sort order.
+     * @returns {Array} Returns `array`.
+     */
+      function baseSortBy(array, comparer) {
+        var length = array.length;
+        array.sort(comparer);
+        while (length--) {
+          array[length] = array[length].value;
+        }
+        return array;
+      }
+      /**
+     * The base implementation of `_.sortByOrder` without param guards.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+     * @param {boolean[]} orders The sort orders of `iteratees`.
+     * @returns {Array} Returns the new sorted array.
+     */
+      function baseSortByOrder(collection, iteratees, orders) {
+        var callback = getCallback(), index = -1;
+        iteratees = arrayMap(iteratees, function (iteratee) {
+          return callback(iteratee);
+        });
+        var result = baseMap(collection, function (value) {
+            var criteria = arrayMap(iteratees, function (iteratee) {
+                return iteratee(value);
+              });
+            return {
+              'criteria': criteria,
+              'index': ++index,
+              'value': value
+            };
+          });
+        return baseSortBy(result, function (object, other) {
+          return compareMultiple(object, other, orders);
+        });
+      }
+      /**
+     * The base implementation of `_.sum` without support for callback shorthands
+     * and `this` binding.
+     *
+     * @private
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @returns {number} Returns the sum.
+     */
+      function baseSum(collection, iteratee) {
+        var result = 0;
+        baseEach(collection, function (value, index, collection) {
+          result += +iteratee(value, index, collection) || 0;
+        });
+        return result;
+      }
+      /**
+     * The base implementation of `_.uniq` without support for callback shorthands
+     * and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to inspect.
+     * @param {Function} [iteratee] The function invoked per iteration.
+     * @returns {Array} Returns the new duplicate free array.
+     */
+      function baseUniq(array, iteratee) {
+        var index = -1, indexOf = getIndexOf(), length = array.length, isCommon = indexOf === baseIndexOf, isLarge = isCommon && length >= LARGE_ARRAY_SIZE, seen = isLarge ? createCache() : null, result = [];
+        if (seen) {
+          indexOf = cacheIndexOf;
+          isCommon = false;
+        } else {
+          isLarge = false;
+          seen = iteratee ? [] : result;
+        }
+        outer:
+          while (++index < length) {
+            var value = array[index], computed = iteratee ? iteratee(value, index, array) : value;
+            if (isCommon && value === value) {
+              var seenIndex = seen.length;
+              while (seenIndex--) {
+                if (seen[seenIndex] === computed) {
+                  continue outer;
+                }
+              }
+              if (iteratee) {
+                seen.push(computed);
+              }
+              result.push(value);
+            } else if (indexOf(seen, computed, 0) < 0) {
+              if (iteratee || isLarge) {
+                seen.push(computed);
+              }
+              result.push(value);
+            }
+          }
+        return result;
+      }
+      /**
+     * The base implementation of `_.values` and `_.valuesIn` which creates an
+     * array of `object` property values corresponding to the property names
+     * of `props`.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @param {Array} props The property names to get values for.
+     * @returns {Object} Returns the array of property values.
+     */
+      function baseValues(object, props) {
+        var index = -1, length = props.length, result = Array(length);
+        while (++index < length) {
+          result[index] = object[props[index]];
+        }
+        return result;
+      }
+      /**
+     * The base implementation of `_.dropRightWhile`, `_.dropWhile`, `_.takeRightWhile`,
+     * and `_.takeWhile` without support for callback shorthands and `this` binding.
+     *
+     * @private
+     * @param {Array} array The array to query.
+     * @param {Function} predicate The function invoked per iteration.
+     * @param {boolean} [isDrop] Specify dropping elements instead of taking them.
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Array} Returns the slice of `array`.
+     */
+      function baseWhile(array, predicate, isDrop, fromRight) {
+        var length = array.length, index = fromRight ? length : -1;
+        while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) {
+        }
+        return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index);
+      }
+      /**
+     * The base implementation of `wrapperValue` which returns the result of
+     * performing a sequence of actions on the unwrapped `value`, where each
+     * successive action is supplied the return value of the previous.
+     *
+     * @private
+     * @param {*} value The unwrapped value.
+     * @param {Array} actions Actions to peform to resolve the unwrapped value.
+     * @returns {*} Returns the resolved value.
+     */
+      function baseWrapperValue(value, actions) {
+        var result = value;
+        if (result instanceof LazyWrapper) {
+          result = result.value();
+        }
+        var index = -1, length = actions.length;
+        while (++index < length) {
+          var action = actions[index];
+          result = action.func.apply(action.thisArg, arrayPush([result], action.args));
+        }
+        return result;
+      }
+      /**
+     * Performs a binary search of `array` to determine the index at which `value`
+     * should be inserted into `array` in order to maintain its sort order.
+     *
+     * @private
+     * @param {Array} array The sorted array to inspect.
+     * @param {*} value The value to evaluate.
+     * @param {boolean} [retHighest] Specify returning the highest qualified index.
+     * @returns {number} Returns the index at which `value` should be inserted
+     *  into `array`.
+     */
+      function binaryIndex(array, value, retHighest) {
+        var low = 0, high = array ? array.length : low;
+        if (typeof value == 'number' && value === value && high <= HALF_MAX_ARRAY_LENGTH) {
+          while (low < high) {
+            var mid = low + high >>> 1, computed = array[mid];
+            if ((retHighest ? computed <= value : computed < value) && computed !== null) {
+              low = mid + 1;
+            } else {
+              high = mid;
+            }
+          }
+          return high;
+        }
+        return binaryIndexBy(array, value, identity, retHighest);
+      }
+      /**
+     * This function is like `binaryIndex` except that it invokes `iteratee` for
+     * `value` and each element of `array` to compute their sort ranking. The
+     * iteratee is invoked with one argument; (value).
+     *
+     * @private
+     * @param {Array} array The sorted array to inspect.
+     * @param {*} value The value to evaluate.
+     * @param {Function} iteratee The function invoked per iteration.
+     * @param {boolean} [retHighest] Specify returning the highest qualified index.
+     * @returns {number} Returns the index at which `value` should be inserted
+     *  into `array`.
+     */
+      function binaryIndexBy(array, value, iteratee, retHighest) {
+        value = iteratee(value);
+        var low = 0, high = array ? array.length : 0, valIsNaN = value !== value, valIsNull = value === null, valIsUndef = value === undefined;
+        while (low < high) {
+          var mid = nativeFloor((low + high) / 2), computed = iteratee(array[mid]), isDef = computed !== undefined, isReflexive = computed === computed;
+          if (valIsNaN) {
+            var setLow = isReflexive || retHighest;
+          } else if (valIsNull) {
+            setLow = isReflexive && isDef && (retHighest || computed != null);
+          } else if (valIsUndef) {
+            setLow = isReflexive && (retHighest || isDef);
+          } else if (computed == null) {
+            setLow = false;
+          } else {
+            setLow = retHighest ? computed <= value : computed < value;
+          }
+          if (setLow) {
+            low = mid + 1;
+          } else {
+            high = mid;
+          }
+        }
+        return nativeMin(high, MAX_ARRAY_INDEX);
+      }
+      /**
+     * A specialized version of `baseCallback` which only supports `this` binding
+     * and specifying the number of arguments to provide to `func`.
+     *
+     * @private
+     * @param {Function} func The function to bind.
+     * @param {*} thisArg The `this` binding of `func`.
+     * @param {number} [argCount] The number of arguments to provide to `func`.
+     * @returns {Function} Returns the callback.
+     */
+      function bindCallback(func, thisArg, argCount) {
+        if (typeof func != 'function') {
+          return identity;
+        }
+        if (thisArg === undefined) {
+          return func;
+        }
+        switch (argCount) {
+        case 1:
+          return function (value) {
+            return func.call(thisArg, value);
+          };
+        case 3:
+          return function (value, index, collection) {
+            return func.call(thisArg, value, index, collection);
+          };
+        case 4:
+          return function (accumulator, value, index, collection) {
+            return func.call(thisArg, accumulator, value, index, collection);
+          };
+        case 5:
+          return function (value, other, key, object, source) {
+            return func.call(thisArg, value, other, key, object, source);
+          };
+        }
+        return function () {
+          return func.apply(thisArg, arguments);
+        };
+      }
+      /**
+     * Creates a clone of the given array buffer.
+     *
+     * @private
+     * @param {ArrayBuffer} buffer The array buffer to clone.
+     * @returns {ArrayBuffer} Returns the cloned array buffer.
+     */
+      function bufferClone(buffer) {
+        var result = new ArrayBuffer(buffer.byteLength), view = new Uint8Array(result);
+        view.set(new Uint8Array(buffer));
+        return result;
+      }
+      /**
+     * Creates an array that is the composition of partially applied arguments,
+     * placeholders, and provided arguments into a single array of arguments.
+     *
+     * @private
+     * @param {Array|Object} args The provided arguments.
+     * @param {Array} partials The arguments to prepend to those provided.
+     * @param {Array} holders The `partials` placeholder indexes.
+     * @returns {Array} Returns the new array of composed arguments.
+     */
+      function composeArgs(args, partials, holders) {
+        var holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), leftIndex = -1, leftLength = partials.length, result = Array(leftLength + argsLength);
+        while (++leftIndex < leftLength) {
+          result[leftIndex] = partials[leftIndex];
+        }
+        while (++argsIndex < holdersLength) {
+          result[holders[argsIndex]] = args[argsIndex];
+        }
+        while (argsLength--) {
+          result[leftIndex++] = args[argsIndex++];
+        }
+        return result;
+      }
+      /**
+     * This function is like `composeArgs` except that the arguments composition
+     * is tailored for `_.partialRight`.
+     *
+     * @private
+     * @param {Array|Object} args The provided arguments.
+     * @param {Array} partials The arguments to append to those provided.
+     * @param {Array} holders The `partials` placeholder indexes.
+     * @returns {Array} Returns the new array of composed arguments.
+     */
+      function composeArgsRight(args, partials, holders) {
+        var holdersIndex = -1, holdersLength = holders.length, argsIndex = -1, argsLength = nativeMax(args.length - holdersLength, 0), rightIndex = -1, rightLength = partials.length, result = Array(argsLength + rightLength);
+        while (++argsIndex < argsLength) {
+          result[argsIndex] = args[argsIndex];
+        }
+        var offset = argsIndex;
+        while (++rightIndex < rightLength) {
+          result[offset + rightIndex] = partials[rightIndex];
+        }
+        while (++holdersIndex < holdersLength) {
+          result[offset + holders[holdersIndex]] = args[argsIndex++];
+        }
+        return result;
+      }
+      /**
+     * Creates a `_.countBy`, `_.groupBy`, `_.indexBy`, or `_.partition` function.
+     *
+     * @private
+     * @param {Function} setter The function to set keys and values of the accumulator object.
+     * @param {Function} [initializer] The function to initialize the accumulator object.
+     * @returns {Function} Returns the new aggregator function.
+     */
+      function createAggregator(setter, initializer) {
+        return function (collection, iteratee, thisArg) {
+          var result = initializer ? initializer() : {};
+          iteratee = getCallback(iteratee, thisArg, 3);
+          if (isArray(collection)) {
+            var index = -1, length = collection.length;
+            while (++index < length) {
+              var value = collection[index];
+              setter(result, value, iteratee(value, index, collection), collection);
+            }
+          } else {
+            baseEach(collection, function (value, key, collection) {
+              setter(result, value, iteratee(value, key, collection), collection);
+            });
+          }
+          return result;
+        };
+      }
+      /**
+     * Creates a `_.assign`, `_.defaults`, or `_.merge` function.
+     *
+     * @private
+     * @param {Function} assigner The function to assign values.
+     * @returns {Function} Returns the new assigner function.
+     */
+      function createAssigner(assigner) {
+        return restParam(function (object, sources) {
+          var index = -1, length = object == null ? 0 : sources.length, customizer = length > 2 ? sources[length - 2] : undefined, guard = length > 2 ? sources[2] : undefined, thisArg = length > 1 ? sources[length - 1] : undefined;
+          if (typeof customizer == 'function') {
+            customizer = bindCallback(customizer, thisArg, 5);
+            length -= 2;
+          } else {
+            customizer = typeof thisArg == 'function' ? thisArg : undefined;
+            length -= customizer ? 1 : 0;
+          }
+          if (guard && isIterateeCall(sources[0], sources[1], guard)) {
+            customizer = length < 3 ? undefined : customizer;
+            length = 1;
+          }
+          while (++index < length) {
+            var source = sources[index];
+            if (source) {
+              assigner(object, source, customizer);
+            }
+          }
+          return object;
+        });
+      }
+      /**
+     * Creates a `baseEach` or `baseEachRight` function.
+     *
+     * @private
+     * @param {Function} eachFunc The function to iterate over a collection.
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Function} Returns the new base function.
+     */
+      function createBaseEach(eachFunc, fromRight) {
+        return function (collection, iteratee) {
+          var length = collection ? getLength(collection) : 0;
+          if (!isLength(length)) {
+            return eachFunc(collection, iteratee);
+          }
+          var index = fromRight ? length : -1, iterable = toObject(collection);
+          while (fromRight ? index-- : ++index < length) {
+            if (iteratee(iterable[index], index, iterable) === false) {
+              break;
+            }
+          }
+          return collection;
+        };
+      }
+      /**
+     * Creates a base function for `_.forIn` or `_.forInRight`.
+     *
+     * @private
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Function} Returns the new base function.
+     */
+      function createBaseFor(fromRight) {
+        return function (object, iteratee, keysFunc) {
+          var iterable = toObject(object), props = keysFunc(object), length = props.length, index = fromRight ? length : -1;
+          while (fromRight ? index-- : ++index < length) {
+            var key = props[index];
+            if (iteratee(iterable[key], key, iterable) === false) {
+              break;
+            }
+          }
+          return object;
+        };
+      }
+      /**
+     * Creates a function that wraps `func` and invokes it with the `this`
+     * binding of `thisArg`.
+     *
+     * @private
+     * @param {Function} func The function to bind.
+     * @param {*} [thisArg] The `this` binding of `func`.
+     * @returns {Function} Returns the new bound function.
+     */
+      function createBindWrapper(func, thisArg) {
+        var Ctor = createCtorWrapper(func);
+        function wrapper() {
+          var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
+          return fn.apply(thisArg, arguments);
+        }
+        return wrapper;
+      }
+      /**
+     * Creates a `Set` cache object to optimize linear searches of large arrays.
+     *
+     * @private
+     * @param {Array} [values] The values to cache.
+     * @returns {null|Object} Returns the new cache object if `Set` is supported, else `null`.
+     */
+      function createCache(values) {
+        return nativeCreate && Set ? new SetCache(values) : null;
+      }
+      /**
+     * Creates a function that produces compound words out of the words in a
+     * given string.
+     *
+     * @private
+     * @param {Function} callback The function to combine each word.
+     * @returns {Function} Returns the new compounder function.
+     */
+      function createCompounder(callback) {
+        return function (string) {
+          var index = -1, array = words(deburr(string)), length = array.length, result = '';
+          while (++index < length) {
+            result = callback(result, array[index], index);
+          }
+          return result;
+        };
+      }
+      /**
+     * Creates a function that produces an instance of `Ctor` regardless of
+     * whether it was invoked as part of a `new` expression or by `call` or `apply`.
+     *
+     * @private
+     * @param {Function} Ctor The constructor to wrap.
+     * @returns {Function} Returns the new wrapped function.
+     */
+      function createCtorWrapper(Ctor) {
+        return function () {
+          // Use a `switch` statement to work with class constructors.
+          // See http://ecma-international.org/ecma-262/6.0/#sec-ecmascript-function-objects-call-thisargument-argumentslist
+          // for more details.
+          var args = arguments;
+          switch (args.length) {
+          case 0:
+            return new Ctor();
+          case 1:
+            return new Ctor(args[0]);
+          case 2:
+            return new Ctor(args[0], args[1]);
+          case 3:
+            return new Ctor(args[0], args[1], args[2]);
+          case 4:
+            return new Ctor(args[0], args[1], args[2], args[3]);
+          case 5:
+            return new Ctor(args[0], args[1], args[2], args[3], args[4]);
+          case 6:
+            return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]);
+          case 7:
+            return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]);
+          }
+          var thisBinding = baseCreate(Ctor.prototype), result = Ctor.apply(thisBinding, args);
+          // Mimic the constructor's `return` behavior.
+          // See https://es5.github.io/#x13.2.2 for more details.
+          return isObject(result) ? result : thisBinding;
+        };
+      }
+      /**
+     * Creates a `_.curry` or `_.curryRight` function.
+     *
+     * @private
+     * @param {boolean} flag The curry bit flag.
+     * @returns {Function} Returns the new curry function.
+     */
+      function createCurry(flag) {
+        function curryFunc(func, arity, guard) {
+          if (guard && isIterateeCall(func, arity, guard)) {
+            arity = undefined;
+          }
+          var result = createWrapper(func, flag, undefined, undefined, undefined, undefined, undefined, arity);
+          result.placeholder = curryFunc.placeholder;
+          return result;
+        }
+        return curryFunc;
+      }
+      /**
+     * Creates a `_.defaults` or `_.defaultsDeep` function.
+     *
+     * @private
+     * @param {Function} assigner The function to assign values.
+     * @param {Function} customizer The function to customize assigned values.
+     * @returns {Function} Returns the new defaults function.
+     */
+      function createDefaults(assigner, customizer) {
+        return restParam(function (args) {
+          var object = args[0];
+          if (object == null) {
+            return object;
+          }
+          args.push(customizer);
+          return assigner.apply(undefined, args);
+        });
+      }
+      /**
+     * Creates a `_.max` or `_.min` function.
+     *
+     * @private
+     * @param {Function} comparator The function used to compare values.
+     * @param {*} exValue The initial extremum value.
+     * @returns {Function} Returns the new extremum function.
+     */
+      function createExtremum(comparator, exValue) {
+        return function (collection, iteratee, thisArg) {
+          if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+            iteratee = undefined;
+          }
+          iteratee = getCallback(iteratee, thisArg, 3);
+          if (iteratee.length == 1) {
+            collection = isArray(collection) ? collection : toIterable(collection);
+            var result = arrayExtremum(collection, iteratee, comparator, exValue);
+            if (!(collection.length && result === exValue)) {
+              return result;
+            }
+          }
+          return baseExtremum(collection, iteratee, comparator, exValue);
+        };
+      }
+      /**
+     * Creates a `_.find` or `_.findLast` function.
+     *
+     * @private
+     * @param {Function} eachFunc The function to iterate over a collection.
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Function} Returns the new find function.
+     */
+      function createFind(eachFunc, fromRight) {
+        return function (collection, predicate, thisArg) {
+          predicate = getCallback(predicate, thisArg, 3);
+          if (isArray(collection)) {
+            var index = baseFindIndex(collection, predicate, fromRight);
+            return index > -1 ? collection[index] : undefined;
+          }
+          return baseFind(collection, predicate, eachFunc);
+        };
+      }
+      /**
+     * Creates a `_.findIndex` or `_.findLastIndex` function.
+     *
+     * @private
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Function} Returns the new find function.
+     */
+      function createFindIndex(fromRight) {
+        return function (array, predicate, thisArg) {
+          if (!(array && array.length)) {
+            return -1;
+          }
+          predicate = getCallback(predicate, thisArg, 3);
+          return baseFindIndex(array, predicate, fromRight);
+        };
+      }
+      /**
+     * Creates a `_.findKey` or `_.findLastKey` function.
+     *
+     * @private
+     * @param {Function} objectFunc The function to iterate over an object.
+     * @returns {Function} Returns the new find function.
+     */
+      function createFindKey(objectFunc) {
+        return function (object, predicate, thisArg) {
+          predicate = getCallback(predicate, thisArg, 3);
+          return baseFind(object, predicate, objectFunc, true);
+        };
+      }
+      /**
+     * Creates a `_.flow` or `_.flowRight` function.
+     *
+     * @private
+     * @param {boolean} [fromRight] Specify iterating from right to left.
+     * @returns {Function} Returns the new flow function.
+     */
+      function createFlow(fromRight) {
+        return function () {
+          var wrapper, length = arguments.length, index = fromRight ? length : -1, leftIndex = 0, funcs = Array(length);
+          while (fromRight ? index-- : ++index < length) {
+            var func = funcs[leftIndex++] = arguments[index];
+            if (typeof func != 'function') {
+              throw new TypeError(FUNC_ERROR_TEXT);
+            }
+            if (!wrapper && LodashWrapper.prototype.thru && getFuncName(func) == 'wrapper') {
+              wrapper = new LodashWrapper([], true);
+            }
+          }
+          index = wrapper ? -1 : length;
+          while (++index < length) {
+            func = funcs[index];
+            var funcName = getFuncName(func), data = funcName == 'wrapper' ? getData(func) : undefined;
+            if (data && isLaziable(data[0]) && data[1] == (ARY_FLAG | CURRY_FLAG | PARTIAL_FLAG | REARG_FLAG) && !data[4].length && data[9] == 1) {
+              wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]);
+            } else {
+              wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func);
+            }
+          }
+          return function () {
+            var args = arguments, value = args[0];
+            if (wrapper && args.length == 1 && isArray(value) && value.length >= LARGE_ARRAY_SIZE) {
+              return wrapper.plant(value).value();
+            }
+            var index = 0, result = length ? funcs[index].apply(this, args) : value;
+            while (++index < length) {
+              result = funcs[index].call(this, result);
+            }
+            return result;
+          };
+        };
+      }
+      /**
+     * Creates a function for `_.forEach` or `_.forEachRight`.
+     *
+     * @private
+     * @param {Function} arrayFunc The function to iterate over an array.
+     * @param {Function} eachFunc The function to iterate over a collection.
+     * @returns {Function} Returns the new each function.
+     */
+      function createForEach(arrayFunc, eachFunc) {
+        return function (collection, iteratee, thisArg) {
+          return typeof iteratee == 'function' && thisArg === undefined && isArray(collection) ? arrayFunc(collection, iteratee) : eachFunc(collection, bindCallback(iteratee, thisArg, 3));
+        };
+      }
+      /**
+     * Creates a function for `_.forIn` or `_.forInRight`.
+     *
+     * @private
+     * @param {Function} objectFunc The function to iterate over an object.
+     * @returns {Function} Returns the new each function.
+     */
+      function createForIn(objectFunc) {
+        return function (object, iteratee, thisArg) {
+          if (typeof iteratee != 'function' || thisArg !== undefined) {
+            iteratee = bindCallback(iteratee, thisArg, 3);
+          }
+          return objectFunc(object, iteratee, keysIn);
+        };
+      }
+      /**
+     * Creates a function for `_.forOwn` or `_.forOwnRight`.
+     *
+     * @private
+     * @param {Function} objectFunc The function to iterate over an object.
+     * @returns {Function} Returns the new each function.
+     */
+      function createForOwn(objectFunc) {
+        return function (object, iteratee, thisArg) {
+          if (typeof iteratee != 'function' || thisArg !== undefined) {
+            iteratee = bindCallback(iteratee, thisArg, 3);
+          }
+          return objectFunc(object, iteratee);
+        };
+      }
+      /**
+     * Creates a function for `_.mapKeys` or `_.mapValues`.
+     *
+     * @private
+     * @param {boolean} [isMapKeys] Specify mapping keys instead of values.
+     * @returns {Function} Returns the new map function.
+     */
+      function createObjectMapper(isMapKeys) {
+        return function (object, iteratee, thisArg) {
+          var result = {};
+          iteratee = getCallback(iteratee, thisArg, 3);
+          baseForOwn(object, function (value, key, object) {
+            var mapped = iteratee(value, key, object);
+            key = isMapKeys ? mapped : key;
+            value = isMapKeys ? value : mapped;
+            result[key] = value;
+          });
+          return result;
+        };
+      }
+      /**
+     * Creates a function for `_.padLeft` or `_.padRight`.
+     *
+     * @private
+     * @param {boolean} [fromRight] Specify padding from the right.
+     * @returns {Function} Returns the new pad function.
+     */
+      function createPadDir(fromRight) {
+        return function (string, length, chars) {
+          string = baseToString(string);
+          return (fromRight ? string : '') + createPadding(string, length, chars) + (fromRight ? '' : string);
+        };
+      }
+      /**
+     * Creates a `_.partial` or `_.partialRight` function.
+     *
+     * @private
+     * @param {boolean} flag The partial bit flag.
+     * @returns {Function} Returns the new partial function.
+     */
+      function createPartial(flag) {
+        var partialFunc = restParam(function (func, partials) {
+            var holders = replaceHolders(partials, partialFunc.placeholder);
+            return createWrapper(func, flag, undefined, partials, holders);
+          });
+        return partialFunc;
+      }
+      /**
+     * Creates a function for `_.reduce` or `_.reduceRight`.
+     *
+     * @private
+     * @param {Function} arrayFunc The function to iterate over an array.
+     * @param {Function} eachFunc The function to iterate over a collection.
+     * @returns {Function} Returns the new each function.
+     */
+      function createReduce(arrayFunc, eachFunc) {
+        return function (collection, iteratee, accumulator, thisArg) {
+          var initFromArray = arguments.length < 3;
+          return typeof iteratee == 'function' && thisArg === undefined && isArray(collection) ? arrayFunc(collection, iteratee, accumulator, initFromArray) : baseReduce(collection, getCallback(iteratee, thisArg, 4), accumulator, initFromArray, eachFunc);
+        };
+      }
+      /**
+     * Creates a function that wraps `func` and invokes it with optional `this`
+     * binding of, partial application, and currying.
+     *
+     * @private
+     * @param {Function|string} func The function or method name to reference.
+     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+     * @param {*} [thisArg] The `this` binding of `func`.
+     * @param {Array} [partials] The arguments to prepend to those provided to the new function.
+     * @param {Array} [holders] The `partials` placeholder indexes.
+     * @param {Array} [partialsRight] The arguments to append to those provided to the new function.
+     * @param {Array} [holdersRight] The `partialsRight` placeholder indexes.
+     * @param {Array} [argPos] The argument positions of the new function.
+     * @param {number} [ary] The arity cap of `func`.
+     * @param {number} [arity] The arity of `func`.
+     * @returns {Function} Returns the new wrapped function.
+     */
+      function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
+        var isAry = bitmask & ARY_FLAG, isBind = bitmask & BIND_FLAG, isBindKey = bitmask & BIND_KEY_FLAG, isCurry = bitmask & CURRY_FLAG, isCurryBound = bitmask & CURRY_BOUND_FLAG, isCurryRight = bitmask & CURRY_RIGHT_FLAG, Ctor = isBindKey ? undefined : createCtorWrapper(func);
+        function wrapper() {
+          // Avoid `arguments` object use disqualifying optimizations by
+          // converting it to an array before providing it to other functions.
+          var length = arguments.length, index = length, args = Array(length);
+          while (index--) {
+            args[index] = arguments[index];
+          }
+          if (partials) {
+            args = composeArgs(args, partials, holders);
+          }
+          if (partialsRight) {
+            args = composeArgsRight(args, partialsRight, holdersRight);
+          }
+          if (isCurry || isCurryRight) {
+            var placeholder = wrapper.placeholder, argsHolders = replaceHolders(args, placeholder);
+            length -= argsHolders.length;
+            if (length < arity) {
+              var newArgPos = argPos ? arrayCopy(argPos) : undefined, newArity = nativeMax(arity - length, 0), newsHolders = isCurry ? argsHolders : undefined, newHoldersRight = isCurry ? undefined : argsHolders, newPartials = isCurry ? args : undefined, newPartialsRight = isCurry ? undefined : args;
+              bitmask |= isCurry ? PARTIAL_FLAG : PARTIAL_RIGHT_FLAG;
+              bitmask &= ~(isCurry ? PARTIAL_RIGHT_FLAG : PARTIAL_FLAG);
+              if (!isCurryBound) {
+                bitmask &= ~(BIND_FLAG | BIND_KEY_FLAG);
+              }
+              var newData = [
+                  func,
+                  bitmask,
+                  thisArg,
+                  newPartials,
+                  newsHolders,
+                  newPartialsRight,
+                  newHoldersRight,
+                  newArgPos,
+                  ary,
+                  newArity
+                ], result = createHybridWrapper.apply(undefined, newData);
+              if (isLaziable(func)) {
+                setData(result, newData);
+              }
+              result.placeholder = placeholder;
+              return result;
+            }
+          }
+          var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func;
+          if (argPos) {
+            args = reorder(args, argPos);
+          }
+          if (isAry && ary < args.length) {
+            args.length = ary;
+          }
+          if (this && this !== root && this instanceof wrapper) {
+            fn = Ctor || createCtorWrapper(func);
+          }
+          return fn.apply(thisBinding, args);
+        }
+        return wrapper;
+      }
+      /**
+     * Creates the padding required for `string` based on the given `length`.
+     * The `chars` string is truncated if the number of characters exceeds `length`.
+     *
+     * @private
+     * @param {string} string The string to create padding for.
+     * @param {number} [length=0] The padding length.
+     * @param {string} [chars=' '] The string used as padding.
+     * @returns {string} Returns the pad for `string`.
+     */
+      function createPadding(string, length, chars) {
+        var strLength = string.length;
+        length = +length;
+        if (strLength >= length || !nativeIsFinite(length)) {
+          return '';
+        }
+        var padLength = length - strLength;
+        chars = chars == null ? ' ' : chars + '';
+        return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
+      }
+      /**
+     * Creates a function that wraps `func` and invokes it with the optional `this`
+     * binding of `thisArg` and the `partials` prepended to those provided to
+     * the wrapper.
+     *
+     * @private
+     * @param {Function} func The function to partially apply arguments to.
+     * @param {number} bitmask The bitmask of flags. See `createWrapper` for more details.
+     * @param {*} thisArg The `this` binding of `func`.
+     * @param {Array} partials The arguments to prepend to those provided to the new function.
+     * @returns {Function} Returns the new bound function.
+     */
+      function createPartialWrapper(func, bitmask, thisArg, partials) {
+        var isBind = bitmask & BIND_FLAG, Ctor = createCtorWrapper(func);
+        function wrapper() {
+          // Avoid `arguments` object use disqualifying optimizations by
+          // converting it to an array before providing it `func`.
+          var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array(leftLength + argsLength);
+          while (++leftIndex < leftLength) {
+            args[leftIndex] = partials[leftIndex];
+          }
+          while (argsLength--) {
+            args[leftIndex++] = arguments[++argsIndex];
+          }
+          var fn = this && this !== root && this instanceof wrapper ? Ctor : func;
+          return fn.apply(isBind ? thisArg : this, args);
+        }
+        return wrapper;
+      }
+      /**
+     * Creates a `_.ceil`, `_.floor`, or `_.round` function.
+     *
+     * @private
+     * @param {string} methodName The name of the `Math` method to use when rounding.
+     * @returns {Function} Returns the new round function.
+     */
+      function createRound(methodName) {
+        var func = Math[methodName];
+        return function (number, precision) {
+          precision = precision === undefined ? 0 : +precision || 0;
+          if (precision) {
+            precision = pow(10, precision);
+            return func(number * precision) / precision;
+          }
+          return func(number);
+        };
+      }
+      /**
+     * Creates a `_.sortedIndex` or `_.sortedLastIndex` function.
+     *
+     * @private
+     * @param {boolean} [retHighest] Specify returning the highest qualified index.
+     * @returns {Function} Returns the new index function.
+     */
+      function createSortedIndex(retHighest) {
+        return function (array, value, iteratee, thisArg) {
+          var callback = getCallback(iteratee);
+          return iteratee == null && callback === baseCallback ? binaryIndex(array, value, retHighest) : binaryIndexBy(array, value, callback(iteratee, thisArg, 1), retHighest);
+        };
+      }
+      /**
+     * Creates a function that either curries or invokes `func` with optional
+     * `this` binding and partially applied arguments.
+     *
+     * @private
+     * @param {Function|string} func The function or method name to reference.
+     * @param {number} bitmask The bitmask of flags.
+     *  The bitmask may be composed of the following flags:
+     *     1 - `_.bind`
+     *     2 - `_.bindKey`
+     *     4 - `_.curry` or `_.curryRight` of a bound function
+     *     8 - `_.curry`
+     *    16 - `_.curryRight`
+     *    32 - `_.partial`
+     *    64 - `_.partialRight`
+     *   128 - `_.rearg`
+     *   256 - `_.ary`
+     * @param {*} [thisArg] The `this` binding of `func`.
+     * @param {Array} [partials] The arguments to be partially applied.
+     * @param {Array} [holders] The `partials` placeholder indexes.
+     * @param {Array} [argPos] The argument positions of the new function.
+     * @param {number} [ary] The arity cap of `func`.
+     * @param {number} [arity] The arity of `func`.
+     * @returns {Function} Returns the new wrapped function.
+     */
+      function createWrapper(func, bitmask, thisArg, partials, holders, argPos, ary, arity) {
+        var isBindKey = bitmask & BIND_KEY_FLAG;
+        if (!isBindKey && typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        var length = partials ? partials.length : 0;
+        if (!length) {
+          bitmask &= ~(PARTIAL_FLAG | PARTIAL_RIGHT_FLAG);
+          partials = holders = undefined;
+        }
+        length -= holders ? holders.length : 0;
+        if (bitmask & PARTIAL_RIGHT_FLAG) {
+          var partialsRight = partials, holdersRight = holders;
+          partials = holders = undefined;
+        }
+        var data = isBindKey ? undefined : getData(func), newData = [
+            func,
+            bitmask,
+            thisArg,
+            partials,
+            holders,
+            partialsRight,
+            holdersRight,
+            argPos,
+            ary,
+            arity
+          ];
+        if (data) {
+          mergeData(newData, data);
+          bitmask = newData[1];
+          arity = newData[9];
+        }
+        newData[9] = arity == null ? isBindKey ? 0 : func.length : nativeMax(arity - length, 0) || 0;
+        if (bitmask == BIND_FLAG) {
+          var result = createBindWrapper(newData[0], newData[2]);
+        } else if ((bitmask == PARTIAL_FLAG || bitmask == (BIND_FLAG | PARTIAL_FLAG)) && !newData[4].length) {
+          result = createPartialWrapper.apply(undefined, newData);
+        } else {
+          result = createHybridWrapper.apply(undefined, newData);
+        }
+        var setter = data ? baseSetData : setData;
+        return setter(result, newData);
+      }
+      /**
+     * A specialized version of `baseIsEqualDeep` for arrays with support for
+     * partial deep comparisons.
+     *
+     * @private
+     * @param {Array} array The array to compare.
+     * @param {Array} other The other array to compare.
+     * @param {Function} equalFunc The function to determine equivalents of values.
+     * @param {Function} [customizer] The function to customize comparing arrays.
+     * @param {boolean} [isLoose] Specify performing partial comparisons.
+     * @param {Array} [stackA] Tracks traversed `value` objects.
+     * @param {Array} [stackB] Tracks traversed `other` objects.
+     * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.
+     */
+      function equalArrays(array, other, equalFunc, customizer, isLoose, stackA, stackB) {
+        var index = -1, arrLength = array.length, othLength = other.length;
+        if (arrLength != othLength && !(isLoose && othLength > arrLength)) {
+          return false;
+        }
+        // Ignore non-index properties.
+        while (++index < arrLength) {
+          var arrValue = array[index], othValue = other[index], result = customizer ? customizer(isLoose ? othValue : arrValue, isLoose ? arrValue : othValue, index) : undefined;
+          if (result !== undefined) {
+            if (result) {
+              continue;
+            }
+            return false;
+          }
+          // Recursively compare arrays (susceptible to call stack limits).
+          if (isLoose) {
+            if (!arraySome(other, function (othValue) {
+                return arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB);
+              })) {
+              return false;
+            }
+          } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, isLoose, stackA, stackB))) {
+            return false;
+          }
+        }
+        return true;
+      }
+      /**
+     * A specialized version of `baseIsEqualDeep` for comparing objects of
+     * the same `toStringTag`.
+     *
+     * **Note:** This function only supports comparing values with tags of
+     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+     *
+     * @private
+     * @param {Object} object The object to compare.
+     * @param {Object} other The other object to compare.
+     * @param {string} tag The `toStringTag` of the objects to compare.
+     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+     */
+      function equalByTag(object, other, tag) {
+        switch (tag) {
+        case boolTag:
+        case dateTag:
+          // Coerce dates and booleans to numbers, dates to milliseconds and booleans
+          // to `1` or `0` treating invalid dates coerced to `NaN` as not equal.
+          return +object == +other;
+        case errorTag:
+          return object.name == other.name && object.message == other.message;
+        case numberTag:
+          // Treat `NaN` vs. `NaN` as equal.
+          return object != +object ? other != +other : object == +other;
+        case regexpTag:
+        case stringTag:
+          // Coerce regexes to strings and treat strings primitives and string
+          // objects as equal. See https://es5.github.io/#x15.10.6.4 for more details.
+          return object == other + '';
+        }
+        return false;
+      }
+      /**
+     * A specialized version of `baseIsEqualDeep` for objects with support for
+     * partial deep comparisons.
+     *
+     * @private
+     * @param {Object} object The object to compare.
+     * @param {Object} other The other object to compare.
+     * @param {Function} equalFunc The function to determine equivalents of values.
+     * @param {Function} [customizer] The function to customize comparing values.
+     * @param {boolean} [isLoose] Specify performing partial comparisons.
+     * @param {Array} [stackA] Tracks traversed `value` objects.
+     * @param {Array} [stackB] Tracks traversed `other` objects.
+     * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.
+     */
+      function equalObjects(object, other, equalFunc, customizer, isLoose, stackA, stackB) {
+        var objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length;
+        if (objLength != othLength && !isLoose) {
+          return false;
+        }
+        var index = objLength;
+        while (index--) {
+          var key = objProps[index];
+          if (!(isLoose ? key in other : hasOwnProperty.call(other, key))) {
+            return false;
+          }
+        }
+        var skipCtor = isLoose;
+        while (++index < objLength) {
+          key = objProps[index];
+          var objValue = object[key], othValue = other[key], result = customizer ? customizer(isLoose ? othValue : objValue, isLoose ? objValue : othValue, key) : undefined;
+          // Recursively compare objects (susceptible to call stack limits).
+          if (!(result === undefined ? equalFunc(objValue, othValue, customizer, isLoose, stackA, stackB) : result)) {
+            return false;
+          }
+          skipCtor || (skipCtor = key == 'constructor');
+        }
+        if (!skipCtor) {
+          var objCtor = object.constructor, othCtor = other.constructor;
+          // Non `Object` object instances with different constructors are not equal.
+          if (objCtor != othCtor && ('constructor' in object && 'constructor' in other) && !(typeof objCtor == 'function' && objCtor instanceof objCtor && typeof othCtor == 'function' && othCtor instanceof othCtor)) {
+            return false;
+          }
+        }
+        return true;
+      }
+      /**
+     * Gets the appropriate "callback" function. If the `_.callback` method is
+     * customized this function returns the custom method, otherwise it returns
+     * the `baseCallback` function. If arguments are provided the chosen function
+     * is invoked with them and its result is returned.
+     *
+     * @private
+     * @returns {Function} Returns the chosen function or its result.
+     */
+      function getCallback(func, thisArg, argCount) {
+        var result = lodash.callback || callback;
+        result = result === callback ? baseCallback : result;
+        return argCount ? result(func, thisArg, argCount) : result;
+      }
+      /**
+     * Gets metadata for `func`.
+     *
+     * @private
+     * @param {Function} func The function to query.
+     * @returns {*} Returns the metadata for `func`.
+     */
+      var getData = !metaMap ? noop : function (func) {
+          return metaMap.get(func);
+        };
+      /**
+     * Gets the name of `func`.
+     *
+     * @private
+     * @param {Function} func The function to query.
+     * @returns {string} Returns the function name.
+     */
+      function getFuncName(func) {
+        var result = func.name + '', array = realNames[result], length = array ? array.length : 0;
+        while (length--) {
+          var data = array[length], otherFunc = data.func;
+          if (otherFunc == null || otherFunc == func) {
+            return data.name;
+          }
+        }
+        return result;
+      }
+      /**
+     * Gets the appropriate "indexOf" function. If the `_.indexOf` method is
+     * customized this function returns the custom method, otherwise it returns
+     * the `baseIndexOf` function. If arguments are provided the chosen function
+     * is invoked with them and its result is returned.
+     *
+     * @private
+     * @returns {Function|number} Returns the chosen function or its result.
+     */
+      function getIndexOf(collection, target, fromIndex) {
+        var result = lodash.indexOf || indexOf;
+        result = result === indexOf ? baseIndexOf : result;
+        return collection ? result(collection, target, fromIndex) : result;
+      }
+      /**
+     * Gets the "length" property value of `object`.
+     *
+     * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792)
+     * that affects Safari on at least iOS 8.1-8.3 ARM64.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @returns {*} Returns the "length" value.
+     */
+      var getLength = baseProperty('length');
+      /**
+     * Gets the propery names, values, and compare flags of `object`.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the match data of `object`.
+     */
+      function getMatchData(object) {
+        var result = pairs(object), length = result.length;
+        while (length--) {
+          result[length][2] = isStrictComparable(result[length][1]);
+        }
+        return result;
+      }
+      /**
+     * Gets the native function at `key` of `object`.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @param {string} key The key of the method to get.
+     * @returns {*} Returns the function if it's native, else `undefined`.
+     */
+      function getNative(object, key) {
+        var value = object == null ? undefined : object[key];
+        return isNative(value) ? value : undefined;
+      }
+      /**
+     * Gets the view, applying any `transforms` to the `start` and `end` positions.
+     *
+     * @private
+     * @param {number} start The start of the view.
+     * @param {number} end The end of the view.
+     * @param {Array} transforms The transformations to apply to the view.
+     * @returns {Object} Returns an object containing the `start` and `end`
+     *  positions of the view.
+     */
+      function getView(start, end, transforms) {
+        var index = -1, length = transforms.length;
+        while (++index < length) {
+          var data = transforms[index], size = data.size;
+          switch (data.type) {
+          case 'drop':
+            start += size;
+            break;
+          case 'dropRight':
+            end -= size;
+            break;
+          case 'take':
+            end = nativeMin(end, start + size);
+            break;
+          case 'takeRight':
+            start = nativeMax(start, end - size);
+            break;
+          }
+        }
+        return {
+          'start': start,
+          'end': end
+        };
+      }
+      /**
+     * Initializes an array clone.
+     *
+     * @private
+     * @param {Array} array The array to clone.
+     * @returns {Array} Returns the initialized clone.
+     */
+      function initCloneArray(array) {
+        var length = array.length, result = new array.constructor(length);
+        // Add array properties assigned by `RegExp#exec`.
+        if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) {
+          result.index = array.index;
+          result.input = array.input;
+        }
+        return result;
+      }
+      /**
+     * Initializes an object clone.
+     *
+     * @private
+     * @param {Object} object The object to clone.
+     * @returns {Object} Returns the initialized clone.
+     */
+      function initCloneObject(object) {
+        var Ctor = object.constructor;
+        if (!(typeof Ctor == 'function' && Ctor instanceof Ctor)) {
+          Ctor = Object;
+        }
+        return new Ctor();
+      }
+      /**
+     * Initializes an object clone based on its `toStringTag`.
+     *
+     * **Note:** This function only supports cloning values with tags of
+     * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.
+     *
+     * @private
+     * @param {Object} object The object to clone.
+     * @param {string} tag The `toStringTag` of the object to clone.
+     * @param {boolean} [isDeep] Specify a deep clone.
+     * @returns {Object} Returns the initialized clone.
+     */
+      function initCloneByTag(object, tag, isDeep) {
+        var Ctor = object.constructor;
+        switch (tag) {
+        case arrayBufferTag:
+          return bufferClone(object);
+        case boolTag:
+        case dateTag:
+          return new Ctor(+object);
+        case float32Tag:
+        case float64Tag:
+        case int8Tag:
+        case int16Tag:
+        case int32Tag:
+        case uint8Tag:
+        case uint8ClampedTag:
+        case uint16Tag:
+        case uint32Tag:
+          var buffer = object.buffer;
+          return new Ctor(isDeep ? bufferClone(buffer) : buffer, object.byteOffset, object.length);
+        case numberTag:
+        case stringTag:
+          return new Ctor(object);
+        case regexpTag:
+          var result = new Ctor(object.source, reFlags.exec(object));
+          result.lastIndex = object.lastIndex;
+        }
+        return result;
+      }
+      /**
+     * Invokes the method at `path` on `object`.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @param {Array|string} path The path of the method to invoke.
+     * @param {Array} args The arguments to invoke the method with.
+     * @returns {*} Returns the result of the invoked method.
+     */
+      function invokePath(object, path, args) {
+        if (object != null && !isKey(path, object)) {
+          path = toPath(path);
+          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+          path = last(path);
+        }
+        var func = object == null ? object : object[path];
+        return func == null ? undefined : func.apply(object, args);
+      }
+      /**
+     * Checks if `value` is array-like.
+     *
+     * @private
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is array-like, else `false`.
+     */
+      function isArrayLike(value) {
+        return value != null && isLength(getLength(value));
+      }
+      /**
+     * Checks if `value` is a valid array-like index.
+     *
+     * @private
+     * @param {*} value The value to check.
+     * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
+     * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
+     */
+      function isIndex(value, length) {
+        value = typeof value == 'number' || reIsUint.test(value) ? +value : -1;
+        length = length == null ? MAX_SAFE_INTEGER : length;
+        return value > -1 && value % 1 == 0 && value < length;
+      }
+      /**
+     * Checks if the provided arguments are from an iteratee call.
+     *
+     * @private
+     * @param {*} value The potential iteratee value argument.
+     * @param {*} index The potential iteratee index or key argument.
+     * @param {*} object The potential iteratee object argument.
+     * @returns {boolean} Returns `true` if the arguments are from an iteratee call, else `false`.
+     */
+      function isIterateeCall(value, index, object) {
+        if (!isObject(object)) {
+          return false;
+        }
+        var type = typeof index;
+        if (type == 'number' ? isArrayLike(object) && isIndex(index, object.length) : type == 'string' && index in object) {
+          var other = object[index];
+          return value === value ? value === other : other !== other;
+        }
+        return false;
+      }
+      /**
+     * Checks if `value` is a property name and not a property path.
+     *
+     * @private
+     * @param {*} value The value to check.
+     * @param {Object} [object] The object to query keys on.
+     * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
+     */
+      function isKey(value, object) {
+        var type = typeof value;
+        if (type == 'string' && reIsPlainProp.test(value) || type == 'number') {
+          return true;
+        }
+        if (isArray(value)) {
+          return false;
+        }
+        var result = !reIsDeepProp.test(value);
+        return result || object != null && value in toObject(object);
+      }
+      /**
+     * Checks if `func` has a lazy counterpart.
+     *
+     * @private
+     * @param {Function} func The function to check.
+     * @returns {boolean} Returns `true` if `func` has a lazy counterpart, else `false`.
+     */
+      function isLaziable(func) {
+        var funcName = getFuncName(func), other = lodash[funcName];
+        if (typeof other != 'function' || !(funcName in LazyWrapper.prototype)) {
+          return false;
+        }
+        if (func === other) {
+          return true;
+        }
+        var data = getData(other);
+        return !!data && func === data[0];
+      }
+      /**
+     * Checks if `value` is a valid array-like length.
+     *
+     * **Note:** This function is based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength).
+     *
+     * @private
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.
+     */
+      function isLength(value) {
+        return typeof value == 'number' && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
+      }
+      /**
+     * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.
+     *
+     * @private
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` if suitable for strict
+     *  equality comparisons, else `false`.
+     */
+      function isStrictComparable(value) {
+        return value === value && !isObject(value);
+      }
+      /**
+     * Merges the function metadata of `source` into `data`.
+     *
+     * Merging metadata reduces the number of wrappers required to invoke a function.
+     * This is possible because methods like `_.bind`, `_.curry`, and `_.partial`
+     * may be applied regardless of execution order. Methods like `_.ary` and `_.rearg`
+     * augment function arguments, making the order in which they are executed important,
+     * preventing the merging of metadata. However, we make an exception for a safe
+     * common case where curried functions have `_.ary` and or `_.rearg` applied.
+     *
+     * @private
+     * @param {Array} data The destination metadata.
+     * @param {Array} source The source metadata.
+     * @returns {Array} Returns `data`.
+     */
+      function mergeData(data, source) {
+        var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < ARY_FLAG;
+        var isCombo = srcBitmask == ARY_FLAG && bitmask == CURRY_FLAG || srcBitmask == ARY_FLAG && bitmask == REARG_FLAG && data[7].length <= source[8] || srcBitmask == (ARY_FLAG | REARG_FLAG) && bitmask == CURRY_FLAG;
+        // Exit early if metadata can't be merged.
+        if (!(isCommon || isCombo)) {
+          return data;
+        }
+        // Use source `thisArg` if available.
+        if (srcBitmask & BIND_FLAG) {
+          data[2] = source[2];
+          // Set when currying a bound function.
+          newBitmask |= bitmask & BIND_FLAG ? 0 : CURRY_BOUND_FLAG;
+        }
+        // Compose partial arguments.
+        var value = source[3];
+        if (value) {
+          var partials = data[3];
+          data[3] = partials ? composeArgs(partials, value, source[4]) : arrayCopy(value);
+          data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : arrayCopy(source[4]);
+        }
+        // Compose partial right arguments.
+        value = source[5];
+        if (value) {
+          partials = data[5];
+          data[5] = partials ? composeArgsRight(partials, value, source[6]) : arrayCopy(value);
+          data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : arrayCopy(source[6]);
+        }
+        // Use source `argPos` if available.
+        value = source[7];
+        if (value) {
+          data[7] = arrayCopy(value);
+        }
+        // Use source `ary` if it's smaller.
+        if (srcBitmask & ARY_FLAG) {
+          data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]);
+        }
+        // Use source `arity` if one is not provided.
+        if (data[9] == null) {
+          data[9] = source[9];
+        }
+        // Use source `func` and merge bitmasks.
+        data[0] = source[0];
+        data[1] = newBitmask;
+        return data;
+      }
+      /**
+     * Used by `_.defaultsDeep` to customize its `_.merge` use.
+     *
+     * @private
+     * @param {*} objectValue The destination object property value.
+     * @param {*} sourceValue The source object property value.
+     * @returns {*} Returns the value to assign to the destination object.
+     */
+      function mergeDefaults(objectValue, sourceValue) {
+        return objectValue === undefined ? sourceValue : merge(objectValue, sourceValue, mergeDefaults);
+      }
+      /**
+     * A specialized version of `_.pick` which picks `object` properties specified
+     * by `props`.
+     *
+     * @private
+     * @param {Object} object The source object.
+     * @param {string[]} props The property names to pick.
+     * @returns {Object} Returns the new object.
+     */
+      function pickByArray(object, props) {
+        object = toObject(object);
+        var index = -1, length = props.length, result = {};
+        while (++index < length) {
+          var key = props[index];
+          if (key in object) {
+            result[key] = object[key];
+          }
+        }
+        return result;
+      }
+      /**
+     * A specialized version of `_.pick` which picks `object` properties `predicate`
+     * returns truthy for.
+     *
+     * @private
+     * @param {Object} object The source object.
+     * @param {Function} predicate The function invoked per iteration.
+     * @returns {Object} Returns the new object.
+     */
+      function pickByCallback(object, predicate) {
+        var result = {};
+        baseForIn(object, function (value, key, object) {
+          if (predicate(value, key, object)) {
+            result[key] = value;
+          }
+        });
+        return result;
+      }
+      /**
+     * Reorder `array` according to the specified indexes where the element at
+     * the first index is assigned as the first element, the element at
+     * the second index is assigned as the second element, and so on.
+     *
+     * @private
+     * @param {Array} array The array to reorder.
+     * @param {Array} indexes The arranged array indexes.
+     * @returns {Array} Returns `array`.
+     */
+      function reorder(array, indexes) {
+        var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = arrayCopy(array);
+        while (length--) {
+          var index = indexes[length];
+          array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined;
+        }
+        return array;
+      }
+      /**
+     * Sets metadata for `func`.
+     *
+     * **Note:** If this function becomes hot, i.e. is invoked a lot in a short
+     * period of time, it will trip its breaker and transition to an identity function
+     * to avoid garbage collection pauses in V8. See [V8 issue 2070](https://code.google.com/p/v8/issues/detail?id=2070)
+     * for more details.
+     *
+     * @private
+     * @param {Function} func The function to associate metadata with.
+     * @param {*} data The metadata.
+     * @returns {Function} Returns `func`.
+     */
+      var setData = function () {
+          var count = 0, lastCalled = 0;
+          return function (key, value) {
+            var stamp = now(), remaining = HOT_SPAN - (stamp - lastCalled);
+            lastCalled = stamp;
+            if (remaining > 0) {
+              if (++count >= HOT_COUNT) {
+                return key;
+              }
+            } else {
+              count = 0;
+            }
+            return baseSetData(key, value);
+          };
+        }();
+      /**
+     * A fallback implementation of `Object.keys` which creates an array of the
+     * own enumerable property names of `object`.
+     *
+     * @private
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the array of property names.
+     */
+      function shimKeys(object) {
+        var props = keysIn(object), propsLength = props.length, length = propsLength && object.length;
+        var allowIndexes = !!length && isLength(length) && (isArray(object) || isArguments(object));
+        var index = -1, result = [];
+        while (++index < propsLength) {
+          var key = props[index];
+          if (allowIndexes && isIndex(key, length) || hasOwnProperty.call(object, key)) {
+            result.push(key);
+          }
+        }
+        return result;
+      }
+      /**
+     * Converts `value` to an array-like object if it's not one.
+     *
+     * @private
+     * @param {*} value The value to process.
+     * @returns {Array|Object} Returns the array-like object.
+     */
+      function toIterable(value) {
+        if (value == null) {
+          return [];
+        }
+        if (!isArrayLike(value)) {
+          return values(value);
+        }
+        return isObject(value) ? value : Object(value);
+      }
+      /**
+     * Converts `value` to an object if it's not one.
+     *
+     * @private
+     * @param {*} value The value to process.
+     * @returns {Object} Returns the object.
+     */
+      function toObject(value) {
+        return isObject(value) ? value : Object(value);
+      }
+      /**
+     * Converts `value` to property path array if it's not one.
+     *
+     * @private
+     * @param {*} value The value to process.
+     * @returns {Array} Returns the property path array.
+     */
+      function toPath(value) {
+        if (isArray(value)) {
+          return value;
+        }
+        var result = [];
+        baseToString(value).replace(rePropName, function (match, number, quote, string) {
+          result.push(quote ? string.replace(reEscapeChar, '$1') : number || match);
+        });
+        return result;
+      }
+      /**
+     * Creates a clone of `wrapper`.
+     *
+     * @private
+     * @param {Object} wrapper The wrapper to clone.
+     * @returns {Object} Returns the cloned wrapper.
+     */
+      function wrapperClone(wrapper) {
+        return wrapper instanceof LazyWrapper ? wrapper.clone() : new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__, arrayCopy(wrapper.__actions__));
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates an array of elements split into groups the length of `size`.
+     * If `collection` can't be split evenly, the final chunk will be the remaining
+     * elements.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to process.
+     * @param {number} [size=1] The length of each chunk.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the new array containing chunks.
+     * @example
+     *
+     * _.chunk(['a', 'b', 'c', 'd'], 2);
+     * // => [['a', 'b'], ['c', 'd']]
+     *
+     * _.chunk(['a', 'b', 'c', 'd'], 3);
+     * // => [['a', 'b', 'c'], ['d']]
+     */
+      function chunk(array, size, guard) {
+        if (guard ? isIterateeCall(array, size, guard) : size == null) {
+          size = 1;
+        } else {
+          size = nativeMax(nativeFloor(size) || 1, 1);
+        }
+        var index = 0, length = array ? array.length : 0, resIndex = -1, result = Array(nativeCeil(length / size));
+        while (index < length) {
+          result[++resIndex] = baseSlice(array, index, index += size);
+        }
+        return result;
+      }
+      /**
+     * Creates an array with all falsey values removed. The values `false`, `null`,
+     * `0`, `""`, `undefined`, and `NaN` are falsey.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to compact.
+     * @returns {Array} Returns the new array of filtered values.
+     * @example
+     *
+     * _.compact([0, 1, false, 2, '', 3]);
+     * // => [1, 2, 3]
+     */
+      function compact(array) {
+        var index = -1, length = array ? array.length : 0, resIndex = -1, result = [];
+        while (++index < length) {
+          var value = array[index];
+          if (value) {
+            result[++resIndex] = value;
+          }
+        }
+        return result;
+      }
+      /**
+     * Creates an array of unique `array` values not included in the other
+     * provided arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to inspect.
+     * @param {...Array} [values] The arrays of values to exclude.
+     * @returns {Array} Returns the new array of filtered values.
+     * @example
+     *
+     * _.difference([1, 2, 3], [4, 2]);
+     * // => [1, 3]
+     */
+      var difference = restParam(function (array, values) {
+          return isObjectLike(array) && isArrayLike(array) ? baseDifference(array, baseFlatten(values, false, true)) : [];
+        });
+      /**
+     * Creates a slice of `array` with `n` elements dropped from the beginning.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {number} [n=1] The number of elements to drop.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.drop([1, 2, 3]);
+     * // => [2, 3]
+     *
+     * _.drop([1, 2, 3], 2);
+     * // => [3]
+     *
+     * _.drop([1, 2, 3], 5);
+     * // => []
+     *
+     * _.drop([1, 2, 3], 0);
+     * // => [1, 2, 3]
+     */
+      function drop(array, n, guard) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (guard ? isIterateeCall(array, n, guard) : n == null) {
+          n = 1;
+        }
+        return baseSlice(array, n < 0 ? 0 : n);
+      }
+      /**
+     * Creates a slice of `array` with `n` elements dropped from the end.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {number} [n=1] The number of elements to drop.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.dropRight([1, 2, 3]);
+     * // => [1, 2]
+     *
+     * _.dropRight([1, 2, 3], 2);
+     * // => [1]
+     *
+     * _.dropRight([1, 2, 3], 5);
+     * // => []
+     *
+     * _.dropRight([1, 2, 3], 0);
+     * // => [1, 2, 3]
+     */
+      function dropRight(array, n, guard) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (guard ? isIterateeCall(array, n, guard) : n == null) {
+          n = 1;
+        }
+        n = length - (+n || 0);
+        return baseSlice(array, 0, n < 0 ? 0 : n);
+      }
+      /**
+     * Creates a slice of `array` excluding elements dropped from the end.
+     * Elements are dropped until `predicate` returns falsey. The predicate is
+     * bound to `thisArg` and invoked with three arguments: (value, index, array).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that match the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.dropRightWhile([1, 2, 3], function(n) {
+     *   return n > 1;
+     * });
+     * // => [1]
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': true },
+     *   { 'user': 'fred',    'active': false },
+     *   { 'user': 'pebbles', 'active': false }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.dropRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+     * // => ['barney', 'fred']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.dropRightWhile(users, 'active', false), 'user');
+     * // => ['barney']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.dropRightWhile(users, 'active'), 'user');
+     * // => ['barney', 'fred', 'pebbles']
+     */
+      function dropRightWhile(array, predicate, thisArg) {
+        return array && array.length ? baseWhile(array, getCallback(predicate, thisArg, 3), true, true) : [];
+      }
+      /**
+     * Creates a slice of `array` excluding elements dropped from the beginning.
+     * Elements are dropped until `predicate` returns falsey. The predicate is
+     * bound to `thisArg` and invoked with three arguments: (value, index, array).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.dropWhile([1, 2, 3], function(n) {
+     *   return n < 3;
+     * });
+     * // => [3]
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': false },
+     *   { 'user': 'fred',    'active': false },
+     *   { 'user': 'pebbles', 'active': true }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.dropWhile(users, { 'user': 'barney', 'active': false }), 'user');
+     * // => ['fred', 'pebbles']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.dropWhile(users, 'active', false), 'user');
+     * // => ['pebbles']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.dropWhile(users, 'active'), 'user');
+     * // => ['barney', 'fred', 'pebbles']
+     */
+      function dropWhile(array, predicate, thisArg) {
+        return array && array.length ? baseWhile(array, getCallback(predicate, thisArg, 3), true) : [];
+      }
+      /**
+     * Fills elements of `array` with `value` from `start` up to, but not
+     * including, `end`.
+     *
+     * **Note:** This method mutates `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to fill.
+     * @param {*} value The value to fill `array` with.
+     * @param {number} [start=0] The start position.
+     * @param {number} [end=array.length] The end position.
+     * @returns {Array} Returns `array`.
+     * @example
+     *
+     * var array = [1, 2, 3];
+     *
+     * _.fill(array, 'a');
+     * console.log(array);
+     * // => ['a', 'a', 'a']
+     *
+     * _.fill(Array(3), 2);
+     * // => [2, 2, 2]
+     *
+     * _.fill([4, 6, 8], '*', 1, 2);
+     * // => [4, '*', 8]
+     */
+      function fill(array, value, start, end) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (start && typeof start != 'number' && isIterateeCall(array, value, start)) {
+          start = 0;
+          end = length;
+        }
+        return baseFill(array, value, start, end);
+      }
+      /**
+     * This method is like `_.find` except that it returns the index of the first
+     * element `predicate` returns truthy for instead of the element itself.
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {number} Returns the index of the found element, else `-1`.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': false },
+     *   { 'user': 'fred',    'active': false },
+     *   { 'user': 'pebbles', 'active': true }
+     * ];
+     *
+     * _.findIndex(users, function(chr) {
+     *   return chr.user == 'barney';
+     * });
+     * // => 0
+     *
+     * // using the `_.matches` callback shorthand
+     * _.findIndex(users, { 'user': 'fred', 'active': false });
+     * // => 1
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.findIndex(users, 'active', false);
+     * // => 0
+     *
+     * // using the `_.property` callback shorthand
+     * _.findIndex(users, 'active');
+     * // => 2
+     */
+      var findIndex = createFindIndex();
+      /**
+     * This method is like `_.findIndex` except that it iterates over elements
+     * of `collection` from right to left.
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {number} Returns the index of the found element, else `-1`.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': true },
+     *   { 'user': 'fred',    'active': false },
+     *   { 'user': 'pebbles', 'active': false }
+     * ];
+     *
+     * _.findLastIndex(users, function(chr) {
+     *   return chr.user == 'pebbles';
+     * });
+     * // => 2
+     *
+     * // using the `_.matches` callback shorthand
+     * _.findLastIndex(users, { 'user': 'barney', 'active': true });
+     * // => 0
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.findLastIndex(users, 'active', false);
+     * // => 2
+     *
+     * // using the `_.property` callback shorthand
+     * _.findLastIndex(users, 'active');
+     * // => 0
+     */
+      var findLastIndex = createFindIndex(true);
+      /**
+     * Gets the first element of `array`.
+     *
+     * @static
+     * @memberOf _
+     * @alias head
+     * @category Array
+     * @param {Array} array The array to query.
+     * @returns {*} Returns the first element of `array`.
+     * @example
+     *
+     * _.first([1, 2, 3]);
+     * // => 1
+     *
+     * _.first([]);
+     * // => undefined
+     */
+      function first(array) {
+        return array ? array[0] : undefined;
+      }
+      /**
+     * Flattens a nested array. If `isDeep` is `true` the array is recursively
+     * flattened, otherwise it's only flattened a single level.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to flatten.
+     * @param {boolean} [isDeep] Specify a deep flatten.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the new flattened array.
+     * @example
+     *
+     * _.flatten([1, [2, 3, [4]]]);
+     * // => [1, 2, 3, [4]]
+     *
+     * // using `isDeep`
+     * _.flatten([1, [2, 3, [4]]], true);
+     * // => [1, 2, 3, 4]
+     */
+      function flatten(array, isDeep, guard) {
+        var length = array ? array.length : 0;
+        if (guard && isIterateeCall(array, isDeep, guard)) {
+          isDeep = false;
+        }
+        return length ? baseFlatten(array, isDeep) : [];
+      }
+      /**
+     * Recursively flattens a nested array.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to recursively flatten.
+     * @returns {Array} Returns the new flattened array.
+     * @example
+     *
+     * _.flattenDeep([1, [2, 3, [4]]]);
+     * // => [1, 2, 3, 4]
+     */
+      function flattenDeep(array) {
+        var length = array ? array.length : 0;
+        return length ? baseFlatten(array, true) : [];
+      }
+      /**
+     * Gets the index at which the first occurrence of `value` is found in `array`
+     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons. If `fromIndex` is negative, it's used as the offset
+     * from the end of `array`. If `array` is sorted providing `true` for `fromIndex`
+     * performs a faster binary search.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to search.
+     * @param {*} value The value to search for.
+     * @param {boolean|number} [fromIndex=0] The index to search from or `true`
+     *  to perform a binary search on a sorted array.
+     * @returns {number} Returns the index of the matched value, else `-1`.
+     * @example
+     *
+     * _.indexOf([1, 2, 1, 2], 2);
+     * // => 1
+     *
+     * // using `fromIndex`
+     * _.indexOf([1, 2, 1, 2], 2, 2);
+     * // => 3
+     *
+     * // performing a binary search
+     * _.indexOf([1, 1, 2, 2], 2, true);
+     * // => 2
+     */
+      function indexOf(array, value, fromIndex) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return -1;
+        }
+        if (typeof fromIndex == 'number') {
+          fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex;
+        } else if (fromIndex) {
+          var index = binaryIndex(array, value);
+          if (index < length && (value === value ? value === array[index] : array[index] !== array[index])) {
+            return index;
+          }
+          return -1;
+        }
+        return baseIndexOf(array, value, fromIndex || 0);
+      }
+      /**
+     * Gets all but the last element of `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.initial([1, 2, 3]);
+     * // => [1, 2]
+     */
+      function initial(array) {
+        return dropRight(array, 1);
+      }
+      /**
+     * Creates an array of unique values that are included in all of the provided
+     * arrays using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {...Array} [arrays] The arrays to inspect.
+     * @returns {Array} Returns the new array of shared values.
+     * @example
+     * _.intersection([1, 2], [4, 2], [2, 1]);
+     * // => [2]
+     */
+      var intersection = restParam(function (arrays) {
+          var othLength = arrays.length, othIndex = othLength, caches = Array(length), indexOf = getIndexOf(), isCommon = indexOf === baseIndexOf, result = [];
+          while (othIndex--) {
+            var value = arrays[othIndex] = isArrayLike(value = arrays[othIndex]) ? value : [];
+            caches[othIndex] = isCommon && value.length >= 120 ? createCache(othIndex && value) : null;
+          }
+          var array = arrays[0], index = -1, length = array ? array.length : 0, seen = caches[0];
+          outer:
+            while (++index < length) {
+              value = array[index];
+              if ((seen ? cacheIndexOf(seen, value) : indexOf(result, value, 0)) < 0) {
+                var othIndex = othLength;
+                while (--othIndex) {
+                  var cache = caches[othIndex];
+                  if ((cache ? cacheIndexOf(cache, value) : indexOf(arrays[othIndex], value, 0)) < 0) {
+                    continue outer;
+                  }
+                }
+                if (seen) {
+                  seen.push(value);
+                }
+                result.push(value);
+              }
+            }
+          return result;
+        });
+      /**
+     * Gets the last element of `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @returns {*} Returns the last element of `array`.
+     * @example
+     *
+     * _.last([1, 2, 3]);
+     * // => 3
+     */
+      function last(array) {
+        var length = array ? array.length : 0;
+        return length ? array[length - 1] : undefined;
+      }
+      /**
+     * This method is like `_.indexOf` except that it iterates over elements of
+     * `array` from right to left.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to search.
+     * @param {*} value The value to search for.
+     * @param {boolean|number} [fromIndex=array.length-1] The index to search from
+     *  or `true` to perform a binary search on a sorted array.
+     * @returns {number} Returns the index of the matched value, else `-1`.
+     * @example
+     *
+     * _.lastIndexOf([1, 2, 1, 2], 2);
+     * // => 3
+     *
+     * // using `fromIndex`
+     * _.lastIndexOf([1, 2, 1, 2], 2, 2);
+     * // => 1
+     *
+     * // performing a binary search
+     * _.lastIndexOf([1, 1, 2, 2], 2, true);
+     * // => 3
+     */
+      function lastIndexOf(array, value, fromIndex) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return -1;
+        }
+        var index = length;
+        if (typeof fromIndex == 'number') {
+          index = (fromIndex < 0 ? nativeMax(length + fromIndex, 0) : nativeMin(fromIndex || 0, length - 1)) + 1;
+        } else if (fromIndex) {
+          index = binaryIndex(array, value, true) - 1;
+          var other = array[index];
+          if (value === value ? value === other : other !== other) {
+            return index;
+          }
+          return -1;
+        }
+        if (value !== value) {
+          return indexOfNaN(array, index, true);
+        }
+        while (index--) {
+          if (array[index] === value) {
+            return index;
+          }
+        }
+        return -1;
+      }
+      /**
+     * Removes all provided values from `array` using
+     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons.
+     *
+     * **Note:** Unlike `_.without`, this method mutates `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to modify.
+     * @param {...*} [values] The values to remove.
+     * @returns {Array} Returns `array`.
+     * @example
+     *
+     * var array = [1, 2, 3, 1, 2, 3];
+     *
+     * _.pull(array, 2, 3);
+     * console.log(array);
+     * // => [1, 1]
+     */
+      function pull() {
+        var args = arguments, array = args[0];
+        if (!(array && array.length)) {
+          return array;
+        }
+        var index = 0, indexOf = getIndexOf(), length = args.length;
+        while (++index < length) {
+          var fromIndex = 0, value = args[index];
+          while ((fromIndex = indexOf(array, value, fromIndex)) > -1) {
+            splice.call(array, fromIndex, 1);
+          }
+        }
+        return array;
+      }
+      /**
+     * Removes elements from `array` corresponding to the given indexes and returns
+     * an array of the removed elements. Indexes may be specified as an array of
+     * indexes or as individual arguments.
+     *
+     * **Note:** Unlike `_.at`, this method mutates `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to modify.
+     * @param {...(number|number[])} [indexes] The indexes of elements to remove,
+     *  specified as individual indexes or arrays of indexes.
+     * @returns {Array} Returns the new array of removed elements.
+     * @example
+     *
+     * var array = [5, 10, 15, 20];
+     * var evens = _.pullAt(array, 1, 3);
+     *
+     * console.log(array);
+     * // => [5, 15]
+     *
+     * console.log(evens);
+     * // => [10, 20]
+     */
+      var pullAt = restParam(function (array, indexes) {
+          indexes = baseFlatten(indexes);
+          var result = baseAt(array, indexes);
+          basePullAt(array, indexes.sort(baseCompareAscending));
+          return result;
+        });
+      /**
+     * Removes all elements from `array` that `predicate` returns truthy for
+     * and returns an array of the removed elements. The predicate is bound to
+     * `thisArg` and invoked with three arguments: (value, index, array).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * **Note:** Unlike `_.filter`, this method mutates `array`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to modify.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the new array of removed elements.
+     * @example
+     *
+     * var array = [1, 2, 3, 4];
+     * var evens = _.remove(array, function(n) {
+     *   return n % 2 == 0;
+     * });
+     *
+     * console.log(array);
+     * // => [1, 3]
+     *
+     * console.log(evens);
+     * // => [2, 4]
+     */
+      function remove(array, predicate, thisArg) {
+        var result = [];
+        if (!(array && array.length)) {
+          return result;
+        }
+        var index = -1, indexes = [], length = array.length;
+        predicate = getCallback(predicate, thisArg, 3);
+        while (++index < length) {
+          var value = array[index];
+          if (predicate(value, index, array)) {
+            result.push(value);
+            indexes.push(index);
+          }
+        }
+        basePullAt(array, indexes);
+        return result;
+      }
+      /**
+     * Gets all but the first element of `array`.
+     *
+     * @static
+     * @memberOf _
+     * @alias tail
+     * @category Array
+     * @param {Array} array The array to query.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.rest([1, 2, 3]);
+     * // => [2, 3]
+     */
+      function rest(array) {
+        return drop(array, 1);
+      }
+      /**
+     * Creates a slice of `array` from `start` up to, but not including, `end`.
+     *
+     * **Note:** This method is used instead of `Array#slice` to support node
+     * lists in IE < 9 and to ensure dense arrays are returned.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to slice.
+     * @param {number} [start=0] The start position.
+     * @param {number} [end=array.length] The end position.
+     * @returns {Array} Returns the slice of `array`.
+     */
+      function slice(array, start, end) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (end && typeof end != 'number' && isIterateeCall(array, start, end)) {
+          start = 0;
+          end = length;
+        }
+        return baseSlice(array, start, end);
+      }
+      /**
+     * Uses a binary search to determine the lowest index at which `value` should
+     * be inserted into `array` in order to maintain its sort order. If an iteratee
+     * function is provided it's invoked for `value` and each element of `array`
+     * to compute their sort ranking. The iteratee is bound to `thisArg` and
+     * invoked with one argument; (value).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The sorted array to inspect.
+     * @param {*} value The value to evaluate.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {number} Returns the index at which `value` should be inserted
+     *  into `array`.
+     * @example
+     *
+     * _.sortedIndex([30, 50], 40);
+     * // => 1
+     *
+     * _.sortedIndex([4, 4, 5, 5], 5);
+     * // => 2
+     *
+     * var dict = { 'data': { 'thirty': 30, 'forty': 40, 'fifty': 50 } };
+     *
+     * // using an iteratee function
+     * _.sortedIndex(['thirty', 'fifty'], 'forty', function(word) {
+     *   return this.data[word];
+     * }, dict);
+     * // => 1
+     *
+     * // using the `_.property` callback shorthand
+     * _.sortedIndex([{ 'x': 30 }, { 'x': 50 }], { 'x': 40 }, 'x');
+     * // => 1
+     */
+      var sortedIndex = createSortedIndex();
+      /**
+     * This method is like `_.sortedIndex` except that it returns the highest
+     * index at which `value` should be inserted into `array` in order to
+     * maintain its sort order.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The sorted array to inspect.
+     * @param {*} value The value to evaluate.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {number} Returns the index at which `value` should be inserted
+     *  into `array`.
+     * @example
+     *
+     * _.sortedLastIndex([4, 4, 5, 5], 5);
+     * // => 4
+     */
+      var sortedLastIndex = createSortedIndex(true);
+      /**
+     * Creates a slice of `array` with `n` elements taken from the beginning.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {number} [n=1] The number of elements to take.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.take([1, 2, 3]);
+     * // => [1]
+     *
+     * _.take([1, 2, 3], 2);
+     * // => [1, 2]
+     *
+     * _.take([1, 2, 3], 5);
+     * // => [1, 2, 3]
+     *
+     * _.take([1, 2, 3], 0);
+     * // => []
+     */
+      function take(array, n, guard) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (guard ? isIterateeCall(array, n, guard) : n == null) {
+          n = 1;
+        }
+        return baseSlice(array, 0, n < 0 ? 0 : n);
+      }
+      /**
+     * Creates a slice of `array` with `n` elements taken from the end.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {number} [n=1] The number of elements to take.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.takeRight([1, 2, 3]);
+     * // => [3]
+     *
+     * _.takeRight([1, 2, 3], 2);
+     * // => [2, 3]
+     *
+     * _.takeRight([1, 2, 3], 5);
+     * // => [1, 2, 3]
+     *
+     * _.takeRight([1, 2, 3], 0);
+     * // => []
+     */
+      function takeRight(array, n, guard) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (guard ? isIterateeCall(array, n, guard) : n == null) {
+          n = 1;
+        }
+        n = length - (+n || 0);
+        return baseSlice(array, n < 0 ? 0 : n);
+      }
+      /**
+     * Creates a slice of `array` with elements taken from the end. Elements are
+     * taken until `predicate` returns falsey. The predicate is bound to `thisArg`
+     * and invoked with three arguments: (value, index, array).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.takeRightWhile([1, 2, 3], function(n) {
+     *   return n > 1;
+     * });
+     * // => [2, 3]
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': true },
+     *   { 'user': 'fred',    'active': false },
+     *   { 'user': 'pebbles', 'active': false }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.takeRightWhile(users, { 'user': 'pebbles', 'active': false }), 'user');
+     * // => ['pebbles']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.takeRightWhile(users, 'active', false), 'user');
+     * // => ['fred', 'pebbles']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.takeRightWhile(users, 'active'), 'user');
+     * // => []
+     */
+      function takeRightWhile(array, predicate, thisArg) {
+        return array && array.length ? baseWhile(array, getCallback(predicate, thisArg, 3), false, true) : [];
+      }
+      /**
+     * Creates a slice of `array` with elements taken from the beginning. Elements
+     * are taken until `predicate` returns falsey. The predicate is bound to
+     * `thisArg` and invoked with three arguments: (value, index, array).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to query.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the slice of `array`.
+     * @example
+     *
+     * _.takeWhile([1, 2, 3], function(n) {
+     *   return n < 3;
+     * });
+     * // => [1, 2]
+     *
+     * var users = [
+     *   { 'user': 'barney',  'active': false },
+     *   { 'user': 'fred',    'active': false},
+     *   { 'user': 'pebbles', 'active': true }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.takeWhile(users, { 'user': 'barney', 'active': false }), 'user');
+     * // => ['barney']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.takeWhile(users, 'active', false), 'user');
+     * // => ['barney', 'fred']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.takeWhile(users, 'active'), 'user');
+     * // => []
+     */
+      function takeWhile(array, predicate, thisArg) {
+        return array && array.length ? baseWhile(array, getCallback(predicate, thisArg, 3)) : [];
+      }
+      /**
+     * Creates an array of unique values, in order, from all of the provided arrays
+     * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {...Array} [arrays] The arrays to inspect.
+     * @returns {Array} Returns the new array of combined values.
+     * @example
+     *
+     * _.union([1, 2], [4, 2], [2, 1]);
+     * // => [1, 2, 4]
+     */
+      var union = restParam(function (arrays) {
+          return baseUniq(baseFlatten(arrays, false, true));
+        });
+      /**
+     * Creates a duplicate-free version of an array, using
+     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons, in which only the first occurence of each element
+     * is kept. Providing `true` for `isSorted` performs a faster search algorithm
+     * for sorted arrays. If an iteratee function is provided it's invoked for
+     * each element in the array to generate the criterion by which uniqueness
+     * is computed. The `iteratee` is bound to `thisArg` and invoked with three
+     * arguments: (value, index, array).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias unique
+     * @category Array
+     * @param {Array} array The array to inspect.
+     * @param {boolean} [isSorted] Specify the array is sorted.
+     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the new duplicate-value-free array.
+     * @example
+     *
+     * _.uniq([2, 1, 2]);
+     * // => [2, 1]
+     *
+     * // using `isSorted`
+     * _.uniq([1, 1, 2], true);
+     * // => [1, 2]
+     *
+     * // using an iteratee function
+     * _.uniq([1, 2.5, 1.5, 2], function(n) {
+     *   return this.floor(n);
+     * }, Math);
+     * // => [1, 2.5]
+     *
+     * // using the `_.property` callback shorthand
+     * _.uniq([{ 'x': 1 }, { 'x': 2 }, { 'x': 1 }], 'x');
+     * // => [{ 'x': 1 }, { 'x': 2 }]
+     */
+      function uniq(array, isSorted, iteratee, thisArg) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        if (isSorted != null && typeof isSorted != 'boolean') {
+          thisArg = iteratee;
+          iteratee = isIterateeCall(array, isSorted, thisArg) ? undefined : isSorted;
+          isSorted = false;
+        }
+        var callback = getCallback();
+        if (!(iteratee == null && callback === baseCallback)) {
+          iteratee = callback(iteratee, thisArg, 3);
+        }
+        return isSorted && getIndexOf() === baseIndexOf ? sortedUniq(array, iteratee) : baseUniq(array, iteratee);
+      }
+      /**
+     * This method is like `_.zip` except that it accepts an array of grouped
+     * elements and creates an array regrouping the elements to their pre-zip
+     * configuration.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array of grouped elements to process.
+     * @returns {Array} Returns the new array of regrouped elements.
+     * @example
+     *
+     * var zipped = _.zip(['fred', 'barney'], [30, 40], [true, false]);
+     * // => [['fred', 30, true], ['barney', 40, false]]
+     *
+     * _.unzip(zipped);
+     * // => [['fred', 'barney'], [30, 40], [true, false]]
+     */
+      function unzip(array) {
+        if (!(array && array.length)) {
+          return [];
+        }
+        var index = -1, length = 0;
+        array = arrayFilter(array, function (group) {
+          if (isArrayLike(group)) {
+            length = nativeMax(group.length, length);
+            return true;
+          }
+        });
+        var result = Array(length);
+        while (++index < length) {
+          result[index] = arrayMap(array, baseProperty(index));
+        }
+        return result;
+      }
+      /**
+     * This method is like `_.unzip` except that it accepts an iteratee to specify
+     * how regrouped values should be combined. The `iteratee` is bound to `thisArg`
+     * and invoked with four arguments: (accumulator, value, index, group).
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array of grouped elements to process.
+     * @param {Function} [iteratee] The function to combine regrouped values.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the new array of regrouped elements.
+     * @example
+     *
+     * var zipped = _.zip([1, 2], [10, 20], [100, 200]);
+     * // => [[1, 10, 100], [2, 20, 200]]
+     *
+     * _.unzipWith(zipped, _.add);
+     * // => [3, 30, 300]
+     */
+      function unzipWith(array, iteratee, thisArg) {
+        var length = array ? array.length : 0;
+        if (!length) {
+          return [];
+        }
+        var result = unzip(array);
+        if (iteratee == null) {
+          return result;
+        }
+        iteratee = bindCallback(iteratee, thisArg, 4);
+        return arrayMap(result, function (group) {
+          return arrayReduce(group, iteratee, undefined, true);
+        });
+      }
+      /**
+     * Creates an array excluding all provided values using
+     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {Array} array The array to filter.
+     * @param {...*} [values] The values to exclude.
+     * @returns {Array} Returns the new array of filtered values.
+     * @example
+     *
+     * _.without([1, 2, 1, 3], 1, 2);
+     * // => [3]
+     */
+      var without = restParam(function (array, values) {
+          return isArrayLike(array) ? baseDifference(array, values) : [];
+        });
+      /**
+     * Creates an array of unique values that is the [symmetric difference](https://en.wikipedia.org/wiki/Symmetric_difference)
+     * of the provided arrays.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {...Array} [arrays] The arrays to inspect.
+     * @returns {Array} Returns the new array of values.
+     * @example
+     *
+     * _.xor([1, 2], [4, 2]);
+     * // => [1, 4]
+     */
+      function xor() {
+        var index = -1, length = arguments.length;
+        while (++index < length) {
+          var array = arguments[index];
+          if (isArrayLike(array)) {
+            var result = result ? arrayPush(baseDifference(result, array), baseDifference(array, result)) : array;
+          }
+        }
+        return result ? baseUniq(result) : [];
+      }
+      /**
+     * Creates an array of grouped elements, the first of which contains the first
+     * elements of the given arrays, the second of which contains the second elements
+     * of the given arrays, and so on.
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {...Array} [arrays] The arrays to process.
+     * @returns {Array} Returns the new array of grouped elements.
+     * @example
+     *
+     * _.zip(['fred', 'barney'], [30, 40], [true, false]);
+     * // => [['fred', 30, true], ['barney', 40, false]]
+     */
+      var zip = restParam(unzip);
+      /**
+     * The inverse of `_.pairs`; this method returns an object composed from arrays
+     * of property names and values. Provide either a single two dimensional array,
+     * e.g. `[[key1, value1], [key2, value2]]` or two arrays, one of property names
+     * and one of corresponding values.
+     *
+     * @static
+     * @memberOf _
+     * @alias object
+     * @category Array
+     * @param {Array} props The property names.
+     * @param {Array} [values=[]] The property values.
+     * @returns {Object} Returns the new object.
+     * @example
+     *
+     * _.zipObject([['fred', 30], ['barney', 40]]);
+     * // => { 'fred': 30, 'barney': 40 }
+     *
+     * _.zipObject(['fred', 'barney'], [30, 40]);
+     * // => { 'fred': 30, 'barney': 40 }
+     */
+      function zipObject(props, values) {
+        var index = -1, length = props ? props.length : 0, result = {};
+        if (length && !values && !isArray(props[0])) {
+          values = [];
+        }
+        while (++index < length) {
+          var key = props[index];
+          if (values) {
+            result[key] = values[index];
+          } else if (key) {
+            result[key[0]] = key[1];
+          }
+        }
+        return result;
+      }
+      /**
+     * This method is like `_.zip` except that it accepts an iteratee to specify
+     * how grouped values should be combined. The `iteratee` is bound to `thisArg`
+     * and invoked with four arguments: (accumulator, value, index, group).
+     *
+     * @static
+     * @memberOf _
+     * @category Array
+     * @param {...Array} [arrays] The arrays to process.
+     * @param {Function} [iteratee] The function to combine grouped values.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the new array of grouped elements.
+     * @example
+     *
+     * _.zipWith([1, 2], [10, 20], [100, 200], _.add);
+     * // => [111, 222]
+     */
+      var zipWith = restParam(function (arrays) {
+          var length = arrays.length, iteratee = length > 2 ? arrays[length - 2] : undefined, thisArg = length > 1 ? arrays[length - 1] : undefined;
+          if (length > 2 && typeof iteratee == 'function') {
+            length -= 2;
+          } else {
+            iteratee = length > 1 && typeof thisArg == 'function' ? (--length, thisArg) : undefined;
+            thisArg = undefined;
+          }
+          arrays.length = length;
+          return unzipWith(arrays, iteratee, thisArg);
+        });
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a `lodash` object that wraps `value` with explicit method
+     * chaining enabled.
+     *
+     * @static
+     * @memberOf _
+     * @category Chain
+     * @param {*} value The value to wrap.
+     * @returns {Object} Returns the new `lodash` wrapper instance.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney',  'age': 36 },
+     *   { 'user': 'fred',    'age': 40 },
+     *   { 'user': 'pebbles', 'age': 1 }
+     * ];
+     *
+     * var youngest = _.chain(users)
+     *   .sortBy('age')
+     *   .map(function(chr) {
+     *     return chr.user + ' is ' + chr.age;
+     *   })
+     *   .first()
+     *   .value();
+     * // => 'pebbles is 1'
+     */
+      function chain(value) {
+        var result = lodash(value);
+        result.__chain__ = true;
+        return result;
+      }
+      /**
+     * This method invokes `interceptor` and returns `value`. The interceptor is
+     * bound to `thisArg` and invoked with one argument; (value). The purpose of
+     * this method is to "tap into" a method chain in order to perform operations
+     * on intermediate results within the chain.
+     *
+     * @static
+     * @memberOf _
+     * @category Chain
+     * @param {*} value The value to provide to `interceptor`.
+     * @param {Function} interceptor The function to invoke.
+     * @param {*} [thisArg] The `this` binding of `interceptor`.
+     * @returns {*} Returns `value`.
+     * @example
+     *
+     * _([1, 2, 3])
+     *  .tap(function(array) {
+     *    array.pop();
+     *  })
+     *  .reverse()
+     *  .value();
+     * // => [2, 1]
+     */
+      function tap(value, interceptor, thisArg) {
+        interceptor.call(thisArg, value);
+        return value;
+      }
+      /**
+     * This method is like `_.tap` except that it returns the result of `interceptor`.
+     *
+     * @static
+     * @memberOf _
+     * @category Chain
+     * @param {*} value The value to provide to `interceptor`.
+     * @param {Function} interceptor The function to invoke.
+     * @param {*} [thisArg] The `this` binding of `interceptor`.
+     * @returns {*} Returns the result of `interceptor`.
+     * @example
+     *
+     * _('  abc  ')
+     *  .chain()
+     *  .trim()
+     *  .thru(function(value) {
+     *    return [value];
+     *  })
+     *  .value();
+     * // => ['abc']
+     */
+      function thru(value, interceptor, thisArg) {
+        return interceptor.call(thisArg, value);
+      }
+      /**
+     * Enables explicit method chaining on the wrapper object.
+     *
+     * @name chain
+     * @memberOf _
+     * @category Chain
+     * @returns {Object} Returns the new `lodash` wrapper instance.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 40 }
+     * ];
+     *
+     * // without explicit chaining
+     * _(users).first();
+     * // => { 'user': 'barney', 'age': 36 }
+     *
+     * // with explicit chaining
+     * _(users).chain()
+     *   .first()
+     *   .pick('user')
+     *   .value();
+     * // => { 'user': 'barney' }
+     */
+      function wrapperChain() {
+        return chain(this);
+      }
+      /**
+     * Executes the chained sequence and returns the wrapped result.
+     *
+     * @name commit
+     * @memberOf _
+     * @category Chain
+     * @returns {Object} Returns the new `lodash` wrapper instance.
+     * @example
+     *
+     * var array = [1, 2];
+     * var wrapped = _(array).push(3);
+     *
+     * console.log(array);
+     * // => [1, 2]
+     *
+     * wrapped = wrapped.commit();
+     * console.log(array);
+     * // => [1, 2, 3]
+     *
+     * wrapped.last();
+     * // => 3
+     *
+     * console.log(array);
+     * // => [1, 2, 3]
+     */
+      function wrapperCommit() {
+        return new LodashWrapper(this.value(), this.__chain__);
+      }
+      /**
+     * Creates a new array joining a wrapped array with any additional arrays
+     * and/or values.
+     *
+     * @name concat
+     * @memberOf _
+     * @category Chain
+     * @param {...*} [values] The values to concatenate.
+     * @returns {Array} Returns the new concatenated array.
+     * @example
+     *
+     * var array = [1];
+     * var wrapped = _(array).concat(2, [3], [[4]]);
+     *
+     * console.log(wrapped.value());
+     * // => [1, 2, 3, [4]]
+     *
+     * console.log(array);
+     * // => [1]
+     */
+      var wrapperConcat = restParam(function (values) {
+          values = baseFlatten(values);
+          return this.thru(function (array) {
+            return arrayConcat(isArray(array) ? array : [toObject(array)], values);
+          });
+        });
+      /**
+     * Creates a clone of the chained sequence planting `value` as the wrapped value.
+     *
+     * @name plant
+     * @memberOf _
+     * @category Chain
+     * @returns {Object} Returns the new `lodash` wrapper instance.
+     * @example
+     *
+     * var array = [1, 2];
+     * var wrapped = _(array).map(function(value) {
+     *   return Math.pow(value, 2);
+     * });
+     *
+     * var other = [3, 4];
+     * var otherWrapped = wrapped.plant(other);
+     *
+     * otherWrapped.value();
+     * // => [9, 16]
+     *
+     * wrapped.value();
+     * // => [1, 4]
+     */
+      function wrapperPlant(value) {
+        var result, parent = this;
+        while (parent instanceof baseLodash) {
+          var clone = wrapperClone(parent);
+          if (result) {
+            previous.__wrapped__ = clone;
+          } else {
+            result = clone;
+          }
+          var previous = clone;
+          parent = parent.__wrapped__;
+        }
+        previous.__wrapped__ = value;
+        return result;
+      }
+      /**
+     * Reverses the wrapped array so the first element becomes the last, the
+     * second element becomes the second to last, and so on.
+     *
+     * **Note:** This method mutates the wrapped array.
+     *
+     * @name reverse
+     * @memberOf _
+     * @category Chain
+     * @returns {Object} Returns the new reversed `lodash` wrapper instance.
+     * @example
+     *
+     * var array = [1, 2, 3];
+     *
+     * _(array).reverse().value()
+     * // => [3, 2, 1]
+     *
+     * console.log(array);
+     * // => [3, 2, 1]
+     */
+      function wrapperReverse() {
+        var value = this.__wrapped__;
+        var interceptor = function (value) {
+          return value.reverse();
+        };
+        if (value instanceof LazyWrapper) {
+          var wrapped = value;
+          if (this.__actions__.length) {
+            wrapped = new LazyWrapper(this);
+          }
+          wrapped = wrapped.reverse();
+          wrapped.__actions__.push({
+            'func': thru,
+            'args': [interceptor],
+            'thisArg': undefined
+          });
+          return new LodashWrapper(wrapped, this.__chain__);
+        }
+        return this.thru(interceptor);
+      }
+      /**
+     * Produces the result of coercing the unwrapped value to a string.
+     *
+     * @name toString
+     * @memberOf _
+     * @category Chain
+     * @returns {string} Returns the coerced string value.
+     * @example
+     *
+     * _([1, 2, 3]).toString();
+     * // => '1,2,3'
+     */
+      function wrapperToString() {
+        return this.value() + '';
+      }
+      /**
+     * Executes the chained sequence to extract the unwrapped value.
+     *
+     * @name value
+     * @memberOf _
+     * @alias run, toJSON, valueOf
+     * @category Chain
+     * @returns {*} Returns the resolved unwrapped value.
+     * @example
+     *
+     * _([1, 2, 3]).value();
+     * // => [1, 2, 3]
+     */
+      function wrapperValue() {
+        return baseWrapperValue(this.__wrapped__, this.__actions__);
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates an array of elements corresponding to the given keys, or indexes,
+     * of `collection`. Keys may be specified as individual arguments or as arrays
+     * of keys.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {...(number|number[]|string|string[])} [props] The property names
+     *  or indexes of elements to pick, specified individually or in arrays.
+     * @returns {Array} Returns the new array of picked elements.
+     * @example
+     *
+     * _.at(['a', 'b', 'c'], [0, 2]);
+     * // => ['a', 'c']
+     *
+     * _.at(['barney', 'fred', 'pebbles'], 0, 2);
+     * // => ['barney', 'pebbles']
+     */
+      var at = restParam(function (collection, props) {
+          return baseAt(collection, baseFlatten(props));
+        });
+      /**
+     * Creates an object composed of keys generated from the results of running
+     * each element of `collection` through `iteratee`. The corresponding value
+     * of each key is the number of times the key was returned by `iteratee`.
+     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns the composed aggregate object.
+     * @example
+     *
+     * _.countBy([4.3, 6.1, 6.4], function(n) {
+     *   return Math.floor(n);
+     * });
+     * // => { '4': 1, '6': 2 }
+     *
+     * _.countBy([4.3, 6.1, 6.4], function(n) {
+     *   return this.floor(n);
+     * }, Math);
+     * // => { '4': 1, '6': 2 }
+     *
+     * _.countBy(['one', 'two', 'three'], 'length');
+     * // => { '3': 2, '5': 1 }
+     */
+      var countBy = createAggregator(function (result, value, key) {
+          hasOwnProperty.call(result, key) ? ++result[key] : result[key] = 1;
+        });
+      /**
+     * Checks if `predicate` returns truthy for **all** elements of `collection`.
+     * The predicate is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias all
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {boolean} Returns `true` if all elements pass the predicate check,
+     *  else `false`.
+     * @example
+     *
+     * _.every([true, 1, null, 'yes'], Boolean);
+     * // => false
+     *
+     * var users = [
+     *   { 'user': 'barney', 'active': false },
+     *   { 'user': 'fred',   'active': false }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.every(users, { 'user': 'barney', 'active': false });
+     * // => false
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.every(users, 'active', false);
+     * // => true
+     *
+     * // using the `_.property` callback shorthand
+     * _.every(users, 'active');
+     * // => false
+     */
+      function every(collection, predicate, thisArg) {
+        var func = isArray(collection) ? arrayEvery : baseEvery;
+        if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+          predicate = undefined;
+        }
+        if (typeof predicate != 'function' || thisArg !== undefined) {
+          predicate = getCallback(predicate, thisArg, 3);
+        }
+        return func(collection, predicate);
+      }
+      /**
+     * Iterates over elements of `collection`, returning an array of all elements
+     * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+     * invoked with three arguments: (value, index|key, collection).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias select
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the new filtered array.
+     * @example
+     *
+     * _.filter([4, 5, 6], function(n) {
+     *   return n % 2 == 0;
+     * });
+     * // => [4, 6]
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36, 'active': true },
+     *   { 'user': 'fred',   'age': 40, 'active': false }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.filter(users, { 'age': 36, 'active': true }), 'user');
+     * // => ['barney']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.filter(users, 'active', false), 'user');
+     * // => ['fred']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.filter(users, 'active'), 'user');
+     * // => ['barney']
+     */
+      function filter(collection, predicate, thisArg) {
+        var func = isArray(collection) ? arrayFilter : baseFilter;
+        predicate = getCallback(predicate, thisArg, 3);
+        return func(collection, predicate);
+      }
+      /**
+     * Iterates over elements of `collection`, returning the first element
+     * `predicate` returns truthy for. The predicate is bound to `thisArg` and
+     * invoked with three arguments: (value, index|key, collection).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias detect
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {*} Returns the matched element, else `undefined`.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney',  'age': 36, 'active': true },
+     *   { 'user': 'fred',    'age': 40, 'active': false },
+     *   { 'user': 'pebbles', 'age': 1,  'active': true }
+     * ];
+     *
+     * _.result(_.find(users, function(chr) {
+     *   return chr.age < 40;
+     * }), 'user');
+     * // => 'barney'
+     *
+     * // using the `_.matches` callback shorthand
+     * _.result(_.find(users, { 'age': 1, 'active': true }), 'user');
+     * // => 'pebbles'
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.result(_.find(users, 'active', false), 'user');
+     * // => 'fred'
+     *
+     * // using the `_.property` callback shorthand
+     * _.result(_.find(users, 'active'), 'user');
+     * // => 'barney'
+     */
+      var find = createFind(baseEach);
+      /**
+     * This method is like `_.find` except that it iterates over elements of
+     * `collection` from right to left.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {*} Returns the matched element, else `undefined`.
+     * @example
+     *
+     * _.findLast([1, 2, 3, 4], function(n) {
+     *   return n % 2 == 1;
+     * });
+     * // => 3
+     */
+      var findLast = createFind(baseEachRight, true);
+      /**
+     * Performs a deep comparison between each element in `collection` and the
+     * source object, returning the first element that has equivalent property
+     * values.
+     *
+     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+     * numbers, `Object` objects, regexes, and strings. Objects are compared by
+     * their own, not inherited, enumerable properties. For comparing a single
+     * own or inherited property value see `_.matchesProperty`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {Object} source The object of property values to match.
+     * @returns {*} Returns the matched element, else `undefined`.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36, 'active': true },
+     *   { 'user': 'fred',   'age': 40, 'active': false }
+     * ];
+     *
+     * _.result(_.findWhere(users, { 'age': 36, 'active': true }), 'user');
+     * // => 'barney'
+     *
+     * _.result(_.findWhere(users, { 'age': 40, 'active': false }), 'user');
+     * // => 'fred'
+     */
+      function findWhere(collection, source) {
+        return find(collection, baseMatches(source));
+      }
+      /**
+     * Iterates over elements of `collection` invoking `iteratee` for each element.
+     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection). Iteratee functions may exit iteration early
+     * by explicitly returning `false`.
+     *
+     * **Note:** As with other "Collections" methods, objects with a "length" property
+     * are iterated like arrays. To avoid this behavior `_.forIn` or `_.forOwn`
+     * may be used for object iteration.
+     *
+     * @static
+     * @memberOf _
+     * @alias each
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array|Object|string} Returns `collection`.
+     * @example
+     *
+     * _([1, 2]).forEach(function(n) {
+     *   console.log(n);
+     * }).value();
+     * // => logs each value from left to right and returns the array
+     *
+     * _.forEach({ 'a': 1, 'b': 2 }, function(n, key) {
+     *   console.log(n, key);
+     * });
+     * // => logs each value-key pair and returns the object (iteration order is not guaranteed)
+     */
+      var forEach = createForEach(arrayEach, baseEach);
+      /**
+     * This method is like `_.forEach` except that it iterates over elements of
+     * `collection` from right to left.
+     *
+     * @static
+     * @memberOf _
+     * @alias eachRight
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array|Object|string} Returns `collection`.
+     * @example
+     *
+     * _([1, 2]).forEachRight(function(n) {
+     *   console.log(n);
+     * }).value();
+     * // => logs each value from right to left and returns the array
+     */
+      var forEachRight = createForEach(arrayEachRight, baseEachRight);
+      /**
+     * Creates an object composed of keys generated from the results of running
+     * each element of `collection` through `iteratee`. The corresponding value
+     * of each key is an array of the elements responsible for generating the key.
+     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns the composed aggregate object.
+     * @example
+     *
+     * _.groupBy([4.2, 6.1, 6.4], function(n) {
+     *   return Math.floor(n);
+     * });
+     * // => { '4': [4.2], '6': [6.1, 6.4] }
+     *
+     * _.groupBy([4.2, 6.1, 6.4], function(n) {
+     *   return this.floor(n);
+     * }, Math);
+     * // => { '4': [4.2], '6': [6.1, 6.4] }
+     *
+     * // using the `_.property` callback shorthand
+     * _.groupBy(['one', 'two', 'three'], 'length');
+     * // => { '3': ['one', 'two'], '5': ['three'] }
+     */
+      var groupBy = createAggregator(function (result, value, key) {
+          if (hasOwnProperty.call(result, key)) {
+            result[key].push(value);
+          } else {
+            result[key] = [value];
+          }
+        });
+      /**
+     * Checks if `target` is in `collection` using
+     * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero)
+     * for equality comparisons. If `fromIndex` is negative, it's used as the offset
+     * from the end of `collection`.
+     *
+     * @static
+     * @memberOf _
+     * @alias contains, include
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {*} target The value to search for.
+     * @param {number} [fromIndex=0] The index to search from.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+     * @returns {boolean} Returns `true` if a matching element is found, else `false`.
+     * @example
+     *
+     * _.includes([1, 2, 3], 1);
+     * // => true
+     *
+     * _.includes([1, 2, 3], 1, 2);
+     * // => false
+     *
+     * _.includes({ 'user': 'fred', 'age': 40 }, 'fred');
+     * // => true
+     *
+     * _.includes('pebbles', 'eb');
+     * // => true
+     */
+      function includes(collection, target, fromIndex, guard) {
+        var length = collection ? getLength(collection) : 0;
+        if (!isLength(length)) {
+          collection = values(collection);
+          length = collection.length;
+        }
+        if (typeof fromIndex != 'number' || guard && isIterateeCall(target, fromIndex, guard)) {
+          fromIndex = 0;
+        } else {
+          fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : fromIndex || 0;
+        }
+        return typeof collection == 'string' || !isArray(collection) && isString(collection) ? fromIndex <= length && collection.indexOf(target, fromIndex) > -1 : !!length && getIndexOf(collection, target, fromIndex) > -1;
+      }
+      /**
+     * Creates an object composed of keys generated from the results of running
+     * each element of `collection` through `iteratee`. The corresponding value
+     * of each key is the last element responsible for generating the key. The
+     * iteratee function is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns the composed aggregate object.
+     * @example
+     *
+     * var keyData = [
+     *   { 'dir': 'left', 'code': 97 },
+     *   { 'dir': 'right', 'code': 100 }
+     * ];
+     *
+     * _.indexBy(keyData, 'dir');
+     * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } }
+     *
+     * _.indexBy(keyData, function(object) {
+     *   return String.fromCharCode(object.code);
+     * });
+     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+     *
+     * _.indexBy(keyData, function(object) {
+     *   return this.fromCharCode(object.code);
+     * }, String);
+     * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } }
+     */
+      var indexBy = createAggregator(function (result, value, key) {
+          result[key] = value;
+        });
+      /**
+     * Invokes the method at `path` of each element in `collection`, returning
+     * an array of the results of each invoked method. Any additional arguments
+     * are provided to each invoked method. If `methodName` is a function it's
+     * invoked for, and `this` bound to, each element in `collection`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Array|Function|string} path The path of the method to invoke or
+     *  the function invoked per iteration.
+     * @param {...*} [args] The arguments to invoke the method with.
+     * @returns {Array} Returns the array of results.
+     * @example
+     *
+     * _.invoke([[5, 1, 7], [3, 2, 1]], 'sort');
+     * // => [[1, 5, 7], [1, 2, 3]]
+     *
+     * _.invoke([123, 456], String.prototype.split, '');
+     * // => [['1', '2', '3'], ['4', '5', '6']]
+     */
+      var invoke = restParam(function (collection, path, args) {
+          var index = -1, isFunc = typeof path == 'function', isProp = isKey(path), result = isArrayLike(collection) ? Array(collection.length) : [];
+          baseEach(collection, function (value) {
+            var func = isFunc ? path : isProp && value != null ? value[path] : undefined;
+            result[++index] = func ? func.apply(value, args) : invokePath(value, path, args);
+          });
+          return result;
+        });
+      /**
+     * Creates an array of values by running each element in `collection` through
+     * `iteratee`. The `iteratee` is bound to `thisArg` and invoked with three
+     * arguments: (value, index|key, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * Many lodash methods are guarded to work as iteratees for methods like
+     * `_.every`, `_.filter`, `_.map`, `_.mapValues`, `_.reject`, and `_.some`.
+     *
+     * The guarded methods are:
+     * `ary`, `callback`, `chunk`, `clone`, `create`, `curry`, `curryRight`,
+     * `drop`, `dropRight`, `every`, `fill`, `flatten`, `invert`, `max`, `min`,
+     * `parseInt`, `slice`, `sortBy`, `take`, `takeRight`, `template`, `trim`,
+     * `trimLeft`, `trimRight`, `trunc`, `random`, `range`, `sample`, `some`,
+     * `sum`, `uniq`, and `words`
+     *
+     * @static
+     * @memberOf _
+     * @alias collect
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the new mapped array.
+     * @example
+     *
+     * function timesThree(n) {
+     *   return n * 3;
+     * }
+     *
+     * _.map([1, 2], timesThree);
+     * // => [3, 6]
+     *
+     * _.map({ 'a': 1, 'b': 2 }, timesThree);
+     * // => [3, 6] (iteration order is not guaranteed)
+     *
+     * var users = [
+     *   { 'user': 'barney' },
+     *   { 'user': 'fred' }
+     * ];
+     *
+     * // using the `_.property` callback shorthand
+     * _.map(users, 'user');
+     * // => ['barney', 'fred']
+     */
+      function map(collection, iteratee, thisArg) {
+        var func = isArray(collection) ? arrayMap : baseMap;
+        iteratee = getCallback(iteratee, thisArg, 3);
+        return func(collection, iteratee);
+      }
+      /**
+     * Creates an array of elements split into two groups, the first of which
+     * contains elements `predicate` returns truthy for, while the second of which
+     * contains elements `predicate` returns falsey for. The predicate is bound
+     * to `thisArg` and invoked with three arguments: (value, index|key, collection).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the array of grouped elements.
+     * @example
+     *
+     * _.partition([1, 2, 3], function(n) {
+     *   return n % 2;
+     * });
+     * // => [[1, 3], [2]]
+     *
+     * _.partition([1.2, 2.3, 3.4], function(n) {
+     *   return this.floor(n) % 2;
+     * }, Math);
+     * // => [[1.2, 3.4], [2.3]]
+     *
+     * var users = [
+     *   { 'user': 'barney',  'age': 36, 'active': false },
+     *   { 'user': 'fred',    'age': 40, 'active': true },
+     *   { 'user': 'pebbles', 'age': 1,  'active': false }
+     * ];
+     *
+     * var mapper = function(array) {
+     *   return _.pluck(array, 'user');
+     * };
+     *
+     * // using the `_.matches` callback shorthand
+     * _.map(_.partition(users, { 'age': 1, 'active': false }), mapper);
+     * // => [['pebbles'], ['barney', 'fred']]
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.map(_.partition(users, 'active', false), mapper);
+     * // => [['barney', 'pebbles'], ['fred']]
+     *
+     * // using the `_.property` callback shorthand
+     * _.map(_.partition(users, 'active'), mapper);
+     * // => [['fred'], ['barney', 'pebbles']]
+     */
+      var partition = createAggregator(function (result, value, key) {
+          result[key ? 0 : 1].push(value);
+        }, function () {
+          return [
+            [],
+            []
+          ];
+        });
+      /**
+     * Gets the property value of `path` from all elements in `collection`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Array|string} path The path of the property to pluck.
+     * @returns {Array} Returns the property values.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 40 }
+     * ];
+     *
+     * _.pluck(users, 'user');
+     * // => ['barney', 'fred']
+     *
+     * var userIndex = _.indexBy(users, 'user');
+     * _.pluck(userIndex, 'age');
+     * // => [36, 40] (iteration order is not guaranteed)
+     */
+      function pluck(collection, path) {
+        return map(collection, property(path));
+      }
+      /**
+     * Reduces `collection` to a value which is the accumulated result of running
+     * each element in `collection` through `iteratee`, where each successive
+     * invocation is supplied the return value of the previous. If `accumulator`
+     * is not provided the first element of `collection` is used as the initial
+     * value. The `iteratee` is bound to `thisArg` and invoked with four arguments:
+     * (accumulator, value, index|key, collection).
+     *
+     * Many lodash methods are guarded to work as iteratees for methods like
+     * `_.reduce`, `_.reduceRight`, and `_.transform`.
+     *
+     * The guarded methods are:
+     * `assign`, `defaults`, `defaultsDeep`, `includes`, `merge`, `sortByAll`,
+     * and `sortByOrder`
+     *
+     * @static
+     * @memberOf _
+     * @alias foldl, inject
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [accumulator] The initial value.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {*} Returns the accumulated value.
+     * @example
+     *
+     * _.reduce([1, 2], function(total, n) {
+     *   return total + n;
+     * });
+     * // => 3
+     *
+     * _.reduce({ 'a': 1, 'b': 2 }, function(result, n, key) {
+     *   result[key] = n * 3;
+     *   return result;
+     * }, {});
+     * // => { 'a': 3, 'b': 6 } (iteration order is not guaranteed)
+     */
+      var reduce = createReduce(arrayReduce, baseEach);
+      /**
+     * This method is like `_.reduce` except that it iterates over elements of
+     * `collection` from right to left.
+     *
+     * @static
+     * @memberOf _
+     * @alias foldr
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [accumulator] The initial value.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {*} Returns the accumulated value.
+     * @example
+     *
+     * var array = [[0, 1], [2, 3], [4, 5]];
+     *
+     * _.reduceRight(array, function(flattened, other) {
+     *   return flattened.concat(other);
+     * }, []);
+     * // => [4, 5, 2, 3, 0, 1]
+     */
+      var reduceRight = createReduce(arrayReduceRight, baseEachRight);
+      /**
+     * The opposite of `_.filter`; this method returns the elements of `collection`
+     * that `predicate` does **not** return truthy for.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Array} Returns the new filtered array.
+     * @example
+     *
+     * _.reject([1, 2, 3, 4], function(n) {
+     *   return n % 2 == 0;
+     * });
+     * // => [1, 3]
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36, 'active': false },
+     *   { 'user': 'fred',   'age': 40, 'active': true }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.pluck(_.reject(users, { 'age': 40, 'active': true }), 'user');
+     * // => ['barney']
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.pluck(_.reject(users, 'active', false), 'user');
+     * // => ['fred']
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.reject(users, 'active'), 'user');
+     * // => ['barney']
+     */
+      function reject(collection, predicate, thisArg) {
+        var func = isArray(collection) ? arrayFilter : baseFilter;
+        predicate = getCallback(predicate, thisArg, 3);
+        return func(collection, function (value, index, collection) {
+          return !predicate(value, index, collection);
+        });
+      }
+      /**
+     * Gets a random element or `n` random elements from a collection.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to sample.
+     * @param {number} [n] The number of elements to sample.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {*} Returns the random sample(s).
+     * @example
+     *
+     * _.sample([1, 2, 3, 4]);
+     * // => 2
+     *
+     * _.sample([1, 2, 3, 4], 2);
+     * // => [3, 1]
+     */
+      function sample(collection, n, guard) {
+        if (guard ? isIterateeCall(collection, n, guard) : n == null) {
+          collection = toIterable(collection);
+          var length = collection.length;
+          return length > 0 ? collection[baseRandom(0, length - 1)] : undefined;
+        }
+        var index = -1, result = toArray(collection), length = result.length, lastIndex = length - 1;
+        n = nativeMin(n < 0 ? 0 : +n || 0, length);
+        while (++index < n) {
+          var rand = baseRandom(index, lastIndex), value = result[rand];
+          result[rand] = result[index];
+          result[index] = value;
+        }
+        result.length = n;
+        return result;
+      }
+      /**
+     * Creates an array of shuffled values, using a version of the
+     * [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher-Yates_shuffle).
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to shuffle.
+     * @returns {Array} Returns the new shuffled array.
+     * @example
+     *
+     * _.shuffle([1, 2, 3, 4]);
+     * // => [4, 1, 3, 2]
+     */
+      function shuffle(collection) {
+        return sample(collection, POSITIVE_INFINITY);
+      }
+      /**
+     * Gets the size of `collection` by returning its length for array-like
+     * values or the number of own enumerable properties for objects.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to inspect.
+     * @returns {number} Returns the size of `collection`.
+     * @example
+     *
+     * _.size([1, 2, 3]);
+     * // => 3
+     *
+     * _.size({ 'a': 1, 'b': 2 });
+     * // => 2
+     *
+     * _.size('pebbles');
+     * // => 7
+     */
+      function size(collection) {
+        var length = collection ? getLength(collection) : 0;
+        return isLength(length) ? length : keys(collection).length;
+      }
+      /**
+     * Checks if `predicate` returns truthy for **any** element of `collection`.
+     * The function returns as soon as it finds a passing value and does not iterate
+     * over the entire collection. The predicate is bound to `thisArg` and invoked
+     * with three arguments: (value, index|key, collection).
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias any
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {boolean} Returns `true` if any element passes the predicate check,
+     *  else `false`.
+     * @example
+     *
+     * _.some([null, 0, 'yes', false], Boolean);
+     * // => true
+     *
+     * var users = [
+     *   { 'user': 'barney', 'active': true },
+     *   { 'user': 'fred',   'active': false }
+     * ];
+     *
+     * // using the `_.matches` callback shorthand
+     * _.some(users, { 'user': 'barney', 'active': false });
+     * // => false
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.some(users, 'active', false);
+     * // => true
+     *
+     * // using the `_.property` callback shorthand
+     * _.some(users, 'active');
+     * // => true
+     */
+      function some(collection, predicate, thisArg) {
+        var func = isArray(collection) ? arraySome : baseSome;
+        if (thisArg && isIterateeCall(collection, predicate, thisArg)) {
+          predicate = undefined;
+        }
+        if (typeof predicate != 'function' || thisArg !== undefined) {
+          predicate = getCallback(predicate, thisArg, 3);
+        }
+        return func(collection, predicate);
+      }
+      /**
+     * Creates an array of elements, sorted in ascending order by the results of
+     * running each element in a collection through `iteratee`. This method performs
+     * a stable sort, that is, it preserves the original sort order of equal elements.
+     * The `iteratee` is bound to `thisArg` and invoked with three arguments:
+     * (value, index|key, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the new sorted array.
+     * @example
+     *
+     * _.sortBy([1, 2, 3], function(n) {
+     *   return Math.sin(n);
+     * });
+     * // => [3, 1, 2]
+     *
+     * _.sortBy([1, 2, 3], function(n) {
+     *   return this.sin(n);
+     * }, Math);
+     * // => [3, 1, 2]
+     *
+     * var users = [
+     *   { 'user': 'fred' },
+     *   { 'user': 'pebbles' },
+     *   { 'user': 'barney' }
+     * ];
+     *
+     * // using the `_.property` callback shorthand
+     * _.pluck(_.sortBy(users, 'user'), 'user');
+     * // => ['barney', 'fred', 'pebbles']
+     */
+      function sortBy(collection, iteratee, thisArg) {
+        if (collection == null) {
+          return [];
+        }
+        if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+          iteratee = undefined;
+        }
+        var index = -1;
+        iteratee = getCallback(iteratee, thisArg, 3);
+        var result = baseMap(collection, function (value, key, collection) {
+            return {
+              'criteria': iteratee(value, key, collection),
+              'index': ++index,
+              'value': value
+            };
+          });
+        return baseSortBy(result, compareAscending);
+      }
+      /**
+     * This method is like `_.sortBy` except that it can sort by multiple iteratees
+     * or property names.
+     *
+     * If a property name is provided for an iteratee the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If an object is provided for an iteratee the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {...(Function|Function[]|Object|Object[]|string|string[])} iteratees
+     *  The iteratees to sort by, specified as individual values or arrays of values.
+     * @returns {Array} Returns the new sorted array.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'fred',   'age': 48 },
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 42 },
+     *   { 'user': 'barney', 'age': 34 }
+     * ];
+     *
+     * _.map(_.sortByAll(users, ['user', 'age']), _.values);
+     * // => [['barney', 34], ['barney', 36], ['fred', 42], ['fred', 48]]
+     *
+     * _.map(_.sortByAll(users, 'user', function(chr) {
+     *   return Math.floor(chr.age / 10);
+     * }), _.values);
+     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+     */
+      var sortByAll = restParam(function (collection, iteratees) {
+          if (collection == null) {
+            return [];
+          }
+          var guard = iteratees[2];
+          if (guard && isIterateeCall(iteratees[0], iteratees[1], guard)) {
+            iteratees.length = 1;
+          }
+          return baseSortByOrder(collection, baseFlatten(iteratees), []);
+        });
+      /**
+     * This method is like `_.sortByAll` except that it allows specifying the
+     * sort orders of the iteratees to sort by. If `orders` is unspecified, all
+     * values are sorted in ascending order. Otherwise, a value is sorted in
+     * ascending order if its corresponding order is "asc", and descending if "desc".
+     *
+     * If a property name is provided for an iteratee the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If an object is provided for an iteratee the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function[]|Object[]|string[]} iteratees The iteratees to sort by.
+     * @param {boolean[]} [orders] The sort orders of `iteratees`.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.reduce`.
+     * @returns {Array} Returns the new sorted array.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'fred',   'age': 48 },
+     *   { 'user': 'barney', 'age': 34 },
+     *   { 'user': 'fred',   'age': 42 },
+     *   { 'user': 'barney', 'age': 36 }
+     * ];
+     *
+     * // sort by `user` in ascending order and by `age` in descending order
+     * _.map(_.sortByOrder(users, ['user', 'age'], ['asc', 'desc']), _.values);
+     * // => [['barney', 36], ['barney', 34], ['fred', 48], ['fred', 42]]
+     */
+      function sortByOrder(collection, iteratees, orders, guard) {
+        if (collection == null) {
+          return [];
+        }
+        if (guard && isIterateeCall(iteratees, orders, guard)) {
+          orders = undefined;
+        }
+        if (!isArray(iteratees)) {
+          iteratees = iteratees == null ? [] : [iteratees];
+        }
+        if (!isArray(orders)) {
+          orders = orders == null ? [] : [orders];
+        }
+        return baseSortByOrder(collection, iteratees, orders);
+      }
+      /**
+     * Performs a deep comparison between each element in `collection` and the
+     * source object, returning an array of all elements that have equivalent
+     * property values.
+     *
+     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+     * numbers, `Object` objects, regexes, and strings. Objects are compared by
+     * their own, not inherited, enumerable properties. For comparing a single
+     * own or inherited property value see `_.matchesProperty`.
+     *
+     * @static
+     * @memberOf _
+     * @category Collection
+     * @param {Array|Object|string} collection The collection to search.
+     * @param {Object} source The object of property values to match.
+     * @returns {Array} Returns the new filtered array.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36, 'active': false, 'pets': ['hoppy'] },
+     *   { 'user': 'fred',   'age': 40, 'active': true, 'pets': ['baby puss', 'dino'] }
+     * ];
+     *
+     * _.pluck(_.where(users, { 'age': 36, 'active': false }), 'user');
+     * // => ['barney']
+     *
+     * _.pluck(_.where(users, { 'pets': ['dino'] }), 'user');
+     * // => ['fred']
+     */
+      function where(collection, source) {
+        return filter(collection, baseMatches(source));
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Gets the number of milliseconds that have elapsed since the Unix epoch
+     * (1 January 1970 00:00:00 UTC).
+     *
+     * @static
+     * @memberOf _
+     * @category Date
+     * @example
+     *
+     * _.defer(function(stamp) {
+     *   console.log(_.now() - stamp);
+     * }, _.now());
+     * // => logs the number of milliseconds it took for the deferred function to be invoked
+     */
+      var now = nativeNow || function () {
+          return new Date().getTime();
+        };
+      /*------------------------------------------------------------------------*/
+      /**
+     * The opposite of `_.before`; this method creates a function that invokes
+     * `func` once it's called `n` or more times.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {number} n The number of calls before `func` is invoked.
+     * @param {Function} func The function to restrict.
+     * @returns {Function} Returns the new restricted function.
+     * @example
+     *
+     * var saves = ['profile', 'settings'];
+     *
+     * var done = _.after(saves.length, function() {
+     *   console.log('done saving!');
+     * });
+     *
+     * _.forEach(saves, function(type) {
+     *   asyncSave({ 'type': type, 'complete': done });
+     * });
+     * // => logs 'done saving!' after the two async saves have completed
+     */
+      function after(n, func) {
+        if (typeof func != 'function') {
+          if (typeof n == 'function') {
+            var temp = n;
+            n = func;
+            func = temp;
+          } else {
+            throw new TypeError(FUNC_ERROR_TEXT);
+          }
+        }
+        n = nativeIsFinite(n = +n) ? n : 0;
+        return function () {
+          if (--n < 1) {
+            return func.apply(this, arguments);
+          }
+        };
+      }
+      /**
+     * Creates a function that accepts up to `n` arguments ignoring any
+     * additional arguments.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to cap arguments for.
+     * @param {number} [n=func.length] The arity cap.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * _.map(['6', '8', '10'], _.ary(parseInt, 1));
+     * // => [6, 8, 10]
+     */
+      function ary(func, n, guard) {
+        if (guard && isIterateeCall(func, n, guard)) {
+          n = undefined;
+        }
+        n = func && n == null ? func.length : nativeMax(+n || 0, 0);
+        return createWrapper(func, ARY_FLAG, undefined, undefined, undefined, undefined, n);
+      }
+      /**
+     * Creates a function that invokes `func`, with the `this` binding and arguments
+     * of the created function, while it's called less than `n` times. Subsequent
+     * calls to the created function return the result of the last `func` invocation.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {number} n The number of calls at which `func` is no longer invoked.
+     * @param {Function} func The function to restrict.
+     * @returns {Function} Returns the new restricted function.
+     * @example
+     *
+     * jQuery('#add').on('click', _.before(5, addContactToList));
+     * // => allows adding up to 4 contacts to the list
+     */
+      function before(n, func) {
+        var result;
+        if (typeof func != 'function') {
+          if (typeof n == 'function') {
+            var temp = n;
+            n = func;
+            func = temp;
+          } else {
+            throw new TypeError(FUNC_ERROR_TEXT);
+          }
+        }
+        return function () {
+          if (--n > 0) {
+            result = func.apply(this, arguments);
+          }
+          if (n <= 1) {
+            func = undefined;
+          }
+          return result;
+        };
+      }
+      /**
+     * Creates a function that invokes `func` with the `this` binding of `thisArg`
+     * and prepends any additional `_.bind` arguments to those provided to the
+     * bound function.
+     *
+     * The `_.bind.placeholder` value, which defaults to `_` in monolithic builds,
+     * may be used as a placeholder for partially applied arguments.
+     *
+     * **Note:** Unlike native `Function#bind` this method does not set the "length"
+     * property of bound functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to bind.
+     * @param {*} thisArg The `this` binding of `func`.
+     * @param {...*} [partials] The arguments to be partially applied.
+     * @returns {Function} Returns the new bound function.
+     * @example
+     *
+     * var greet = function(greeting, punctuation) {
+     *   return greeting + ' ' + this.user + punctuation;
+     * };
+     *
+     * var object = { 'user': 'fred' };
+     *
+     * var bound = _.bind(greet, object, 'hi');
+     * bound('!');
+     * // => 'hi fred!'
+     *
+     * // using placeholders
+     * var bound = _.bind(greet, object, _, '!');
+     * bound('hi');
+     * // => 'hi fred!'
+     */
+      var bind = restParam(function (func, thisArg, partials) {
+          var bitmask = BIND_FLAG;
+          if (partials.length) {
+            var holders = replaceHolders(partials, bind.placeholder);
+            bitmask |= PARTIAL_FLAG;
+          }
+          return createWrapper(func, bitmask, thisArg, partials, holders);
+        });
+      /**
+     * Binds methods of an object to the object itself, overwriting the existing
+     * method. Method names may be specified as individual arguments or as arrays
+     * of method names. If no method names are provided all enumerable function
+     * properties, own and inherited, of `object` are bound.
+     *
+     * **Note:** This method does not set the "length" property of bound functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Object} object The object to bind and assign the bound methods to.
+     * @param {...(string|string[])} [methodNames] The object method names to bind,
+     *  specified as individual method names or arrays of method names.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * var view = {
+     *   'label': 'docs',
+     *   'onClick': function() {
+     *     console.log('clicked ' + this.label);
+     *   }
+     * };
+     *
+     * _.bindAll(view);
+     * jQuery('#docs').on('click', view.onClick);
+     * // => logs 'clicked docs' when the element is clicked
+     */
+      var bindAll = restParam(function (object, methodNames) {
+          methodNames = methodNames.length ? baseFlatten(methodNames) : functions(object);
+          var index = -1, length = methodNames.length;
+          while (++index < length) {
+            var key = methodNames[index];
+            object[key] = createWrapper(object[key], BIND_FLAG, object);
+          }
+          return object;
+        });
+      /**
+     * Creates a function that invokes the method at `object[key]` and prepends
+     * any additional `_.bindKey` arguments to those provided to the bound function.
+     *
+     * This method differs from `_.bind` by allowing bound functions to reference
+     * methods that may be redefined or don't yet exist.
+     * See [Peter Michaux's article](http://peter.michaux.ca/articles/lazy-function-definition-pattern)
+     * for more details.
+     *
+     * The `_.bindKey.placeholder` value, which defaults to `_` in monolithic
+     * builds, may be used as a placeholder for partially applied arguments.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Object} object The object the method belongs to.
+     * @param {string} key The key of the method.
+     * @param {...*} [partials] The arguments to be partially applied.
+     * @returns {Function} Returns the new bound function.
+     * @example
+     *
+     * var object = {
+     *   'user': 'fred',
+     *   'greet': function(greeting, punctuation) {
+     *     return greeting + ' ' + this.user + punctuation;
+     *   }
+     * };
+     *
+     * var bound = _.bindKey(object, 'greet', 'hi');
+     * bound('!');
+     * // => 'hi fred!'
+     *
+     * object.greet = function(greeting, punctuation) {
+     *   return greeting + 'ya ' + this.user + punctuation;
+     * };
+     *
+     * bound('!');
+     * // => 'hiya fred!'
+     *
+     * // using placeholders
+     * var bound = _.bindKey(object, 'greet', _, '!');
+     * bound('hi');
+     * // => 'hiya fred!'
+     */
+      var bindKey = restParam(function (object, key, partials) {
+          var bitmask = BIND_FLAG | BIND_KEY_FLAG;
+          if (partials.length) {
+            var holders = replaceHolders(partials, bindKey.placeholder);
+            bitmask |= PARTIAL_FLAG;
+          }
+          return createWrapper(key, bitmask, object, partials, holders);
+        });
+      /**
+     * Creates a function that accepts one or more arguments of `func` that when
+     * called either invokes `func` returning its result, if all `func` arguments
+     * have been provided, or returns a function that accepts one or more of the
+     * remaining `func` arguments, and so on. The arity of `func` may be specified
+     * if `func.length` is not sufficient.
+     *
+     * The `_.curry.placeholder` value, which defaults to `_` in monolithic builds,
+     * may be used as a placeholder for provided arguments.
+     *
+     * **Note:** This method does not set the "length" property of curried functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to curry.
+     * @param {number} [arity=func.length] The arity of `func`.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Function} Returns the new curried function.
+     * @example
+     *
+     * var abc = function(a, b, c) {
+     *   return [a, b, c];
+     * };
+     *
+     * var curried = _.curry(abc);
+     *
+     * curried(1)(2)(3);
+     * // => [1, 2, 3]
+     *
+     * curried(1, 2)(3);
+     * // => [1, 2, 3]
+     *
+     * curried(1, 2, 3);
+     * // => [1, 2, 3]
+     *
+     * // using placeholders
+     * curried(1)(_, 3)(2);
+     * // => [1, 2, 3]
+     */
+      var curry = createCurry(CURRY_FLAG);
+      /**
+     * This method is like `_.curry` except that arguments are applied to `func`
+     * in the manner of `_.partialRight` instead of `_.partial`.
+     *
+     * The `_.curryRight.placeholder` value, which defaults to `_` in monolithic
+     * builds, may be used as a placeholder for provided arguments.
+     *
+     * **Note:** This method does not set the "length" property of curried functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to curry.
+     * @param {number} [arity=func.length] The arity of `func`.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Function} Returns the new curried function.
+     * @example
+     *
+     * var abc = function(a, b, c) {
+     *   return [a, b, c];
+     * };
+     *
+     * var curried = _.curryRight(abc);
+     *
+     * curried(3)(2)(1);
+     * // => [1, 2, 3]
+     *
+     * curried(2, 3)(1);
+     * // => [1, 2, 3]
+     *
+     * curried(1, 2, 3);
+     * // => [1, 2, 3]
+     *
+     * // using placeholders
+     * curried(3)(1, _)(2);
+     * // => [1, 2, 3]
+     */
+      var curryRight = createCurry(CURRY_RIGHT_FLAG);
+      /**
+     * Creates a debounced function that delays invoking `func` until after `wait`
+     * milliseconds have elapsed since the last time the debounced function was
+     * invoked. The debounced function comes with a `cancel` method to cancel
+     * delayed invocations. Provide an options object to indicate that `func`
+     * should be invoked on the leading and/or trailing edge of the `wait` timeout.
+     * Subsequent calls to the debounced function return the result of the last
+     * `func` invocation.
+     *
+     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+     * on the trailing edge of the timeout only if the the debounced function is
+     * invoked more than once during the `wait` timeout.
+     *
+     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+     * for details over the differences between `_.debounce` and `_.throttle`.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to debounce.
+     * @param {number} [wait=0] The number of milliseconds to delay.
+     * @param {Object} [options] The options object.
+     * @param {boolean} [options.leading=false] Specify invoking on the leading
+     *  edge of the timeout.
+     * @param {number} [options.maxWait] The maximum time `func` is allowed to be
+     *  delayed before it's invoked.
+     * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+     *  edge of the timeout.
+     * @returns {Function} Returns the new debounced function.
+     * @example
+     *
+     * // avoid costly calculations while the window size is in flux
+     * jQuery(window).on('resize', _.debounce(calculateLayout, 150));
+     *
+     * // invoke `sendMail` when the click event is fired, debouncing subsequent calls
+     * jQuery('#postbox').on('click', _.debounce(sendMail, 300, {
+     *   'leading': true,
+     *   'trailing': false
+     * }));
+     *
+     * // ensure `batchLog` is invoked once after 1 second of debounced calls
+     * var source = new EventSource('/stream');
+     * jQuery(source).on('message', _.debounce(batchLog, 250, {
+     *   'maxWait': 1000
+     * }));
+     *
+     * // cancel a debounced call
+     * var todoChanges = _.debounce(batchLog, 1000);
+     * Object.observe(models.todo, todoChanges);
+     *
+     * Object.observe(models, function(changes) {
+     *   if (_.find(changes, { 'user': 'todo', 'type': 'delete'})) {
+     *     todoChanges.cancel();
+     *   }
+     * }, ['delete']);
+     *
+     * // ...at some point `models.todo` is changed
+     * models.todo.completed = true;
+     *
+     * // ...before 1 second has passed `models.todo` is deleted
+     * // which cancels the debounced `todoChanges` call
+     * delete models.todo;
+     */
+      function debounce(func, wait, options) {
+        var args, maxTimeoutId, result, stamp, thisArg, timeoutId, trailingCall, lastCalled = 0, maxWait = false, trailing = true;
+        if (typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        wait = wait < 0 ? 0 : +wait || 0;
+        if (options === true) {
+          var leading = true;
+          trailing = false;
+        } else if (isObject(options)) {
+          leading = !!options.leading;
+          maxWait = 'maxWait' in options && nativeMax(+options.maxWait || 0, wait);
+          trailing = 'trailing' in options ? !!options.trailing : trailing;
+        }
+        function cancel() {
+          if (timeoutId) {
+            clearTimeout(timeoutId);
+          }
+          if (maxTimeoutId) {
+            clearTimeout(maxTimeoutId);
+          }
+          lastCalled = 0;
+          maxTimeoutId = timeoutId = trailingCall = undefined;
+        }
+        function complete(isCalled, id) {
+          if (id) {
+            clearTimeout(id);
+          }
+          maxTimeoutId = timeoutId = trailingCall = undefined;
+          if (isCalled) {
+            lastCalled = now();
+            result = func.apply(thisArg, args);
+            if (!timeoutId && !maxTimeoutId) {
+              args = thisArg = undefined;
+            }
+          }
+        }
+        function delayed() {
+          var remaining = wait - (now() - stamp);
+          if (remaining <= 0 || remaining > wait) {
+            complete(trailingCall, maxTimeoutId);
+          } else {
+            timeoutId = setTimeout(delayed, remaining);
+          }
+        }
+        function maxDelayed() {
+          complete(trailing, timeoutId);
+        }
+        function debounced() {
+          args = arguments;
+          stamp = now();
+          thisArg = this;
+          trailingCall = trailing && (timeoutId || !leading);
+          if (maxWait === false) {
+            var leadingCall = leading && !timeoutId;
+          } else {
+            if (!maxTimeoutId && !leading) {
+              lastCalled = stamp;
+            }
+            var remaining = maxWait - (stamp - lastCalled), isCalled = remaining <= 0 || remaining > maxWait;
+            if (isCalled) {
+              if (maxTimeoutId) {
+                maxTimeoutId = clearTimeout(maxTimeoutId);
+              }
+              lastCalled = stamp;
+              result = func.apply(thisArg, args);
+            } else if (!maxTimeoutId) {
+              maxTimeoutId = setTimeout(maxDelayed, remaining);
+            }
+          }
+          if (isCalled && timeoutId) {
+            timeoutId = clearTimeout(timeoutId);
+          } else if (!timeoutId && wait !== maxWait) {
+            timeoutId = setTimeout(delayed, wait);
+          }
+          if (leadingCall) {
+            isCalled = true;
+            result = func.apply(thisArg, args);
+          }
+          if (isCalled && !timeoutId && !maxTimeoutId) {
+            args = thisArg = undefined;
+          }
+          return result;
+        }
+        debounced.cancel = cancel;
+        return debounced;
+      }
+      /**
+     * Defers invoking the `func` until the current call stack has cleared. Any
+     * additional arguments are provided to `func` when it's invoked.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to defer.
+     * @param {...*} [args] The arguments to invoke the function with.
+     * @returns {number} Returns the timer id.
+     * @example
+     *
+     * _.defer(function(text) {
+     *   console.log(text);
+     * }, 'deferred');
+     * // logs 'deferred' after one or more milliseconds
+     */
+      var defer = restParam(function (func, args) {
+          return baseDelay(func, 1, args);
+        });
+      /**
+     * Invokes `func` after `wait` milliseconds. Any additional arguments are
+     * provided to `func` when it's invoked.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to delay.
+     * @param {number} wait The number of milliseconds to delay invocation.
+     * @param {...*} [args] The arguments to invoke the function with.
+     * @returns {number} Returns the timer id.
+     * @example
+     *
+     * _.delay(function(text) {
+     *   console.log(text);
+     * }, 1000, 'later');
+     * // => logs 'later' after one second
+     */
+      var delay = restParam(function (func, wait, args) {
+          return baseDelay(func, wait, args);
+        });
+      /**
+     * Creates a function that returns the result of invoking the provided
+     * functions with the `this` binding of the created function, where each
+     * successive invocation is supplied the return value of the previous.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {...Function} [funcs] Functions to invoke.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * function square(n) {
+     *   return n * n;
+     * }
+     *
+     * var addSquare = _.flow(_.add, square);
+     * addSquare(1, 2);
+     * // => 9
+     */
+      var flow = createFlow();
+      /**
+     * This method is like `_.flow` except that it creates a function that
+     * invokes the provided functions from right to left.
+     *
+     * @static
+     * @memberOf _
+     * @alias backflow, compose
+     * @category Function
+     * @param {...Function} [funcs] Functions to invoke.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * function square(n) {
+     *   return n * n;
+     * }
+     *
+     * var addSquare = _.flowRight(square, _.add);
+     * addSquare(1, 2);
+     * // => 9
+     */
+      var flowRight = createFlow(true);
+      /**
+     * Creates a function that memoizes the result of `func`. If `resolver` is
+     * provided it determines the cache key for storing the result based on the
+     * arguments provided to the memoized function. By default, the first argument
+     * provided to the memoized function is coerced to a string and used as the
+     * cache key. The `func` is invoked with the `this` binding of the memoized
+     * function.
+     *
+     * **Note:** The cache is exposed as the `cache` property on the memoized
+     * function. Its creation may be customized by replacing the `_.memoize.Cache`
+     * constructor with one whose instances implement the [`Map`](http://ecma-international.org/ecma-262/6.0/#sec-properties-of-the-map-prototype-object)
+     * method interface of `get`, `has`, and `set`.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to have its output memoized.
+     * @param {Function} [resolver] The function to resolve the cache key.
+     * @returns {Function} Returns the new memoizing function.
+     * @example
+     *
+     * var upperCase = _.memoize(function(string) {
+     *   return string.toUpperCase();
+     * });
+     *
+     * upperCase('fred');
+     * // => 'FRED'
+     *
+     * // modifying the result cache
+     * upperCase.cache.set('fred', 'BARNEY');
+     * upperCase('fred');
+     * // => 'BARNEY'
+     *
+     * // replacing `_.memoize.Cache`
+     * var object = { 'user': 'fred' };
+     * var other = { 'user': 'barney' };
+     * var identity = _.memoize(_.identity);
+     *
+     * identity(object);
+     * // => { 'user': 'fred' }
+     * identity(other);
+     * // => { 'user': 'fred' }
+     *
+     * _.memoize.Cache = WeakMap;
+     * var identity = _.memoize(_.identity);
+     *
+     * identity(object);
+     * // => { 'user': 'fred' }
+     * identity(other);
+     * // => { 'user': 'barney' }
+     */
+      function memoize(func, resolver) {
+        if (typeof func != 'function' || resolver && typeof resolver != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        var memoized = function () {
+          var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
+          if (cache.has(key)) {
+            return cache.get(key);
+          }
+          var result = func.apply(this, args);
+          memoized.cache = cache.set(key, result);
+          return result;
+        };
+        memoized.cache = new memoize.Cache();
+        return memoized;
+      }
+      /**
+     * Creates a function that runs each argument through a corresponding
+     * transform function.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to wrap.
+     * @param {...(Function|Function[])} [transforms] The functions to transform
+     * arguments, specified as individual functions or arrays of functions.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * function doubled(n) {
+     *   return n * 2;
+     * }
+     *
+     * function square(n) {
+     *   return n * n;
+     * }
+     *
+     * var modded = _.modArgs(function(x, y) {
+     *   return [x, y];
+     * }, square, doubled);
+     *
+     * modded(1, 2);
+     * // => [1, 4]
+     *
+     * modded(5, 10);
+     * // => [25, 20]
+     */
+      var modArgs = restParam(function (func, transforms) {
+          transforms = baseFlatten(transforms);
+          if (typeof func != 'function' || !arrayEvery(transforms, baseIsFunction)) {
+            throw new TypeError(FUNC_ERROR_TEXT);
+          }
+          var length = transforms.length;
+          return restParam(function (args) {
+            var index = nativeMin(args.length, length);
+            while (index--) {
+              args[index] = transforms[index](args[index]);
+            }
+            return func.apply(this, args);
+          });
+        });
+      /**
+     * Creates a function that negates the result of the predicate `func`. The
+     * `func` predicate is invoked with the `this` binding and arguments of the
+     * created function.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} predicate The predicate to negate.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * function isEven(n) {
+     *   return n % 2 == 0;
+     * }
+     *
+     * _.filter([1, 2, 3, 4, 5, 6], _.negate(isEven));
+     * // => [1, 3, 5]
+     */
+      function negate(predicate) {
+        if (typeof predicate != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        return function () {
+          return !predicate.apply(this, arguments);
+        };
+      }
+      /**
+     * Creates a function that is restricted to invoking `func` once. Repeat calls
+     * to the function return the value of the first call. The `func` is invoked
+     * with the `this` binding and arguments of the created function.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to restrict.
+     * @returns {Function} Returns the new restricted function.
+     * @example
+     *
+     * var initialize = _.once(createApplication);
+     * initialize();
+     * initialize();
+     * // `initialize` invokes `createApplication` once
+     */
+      function once(func) {
+        return before(2, func);
+      }
+      /**
+     * Creates a function that invokes `func` with `partial` arguments prepended
+     * to those provided to the new function. This method is like `_.bind` except
+     * it does **not** alter the `this` binding.
+     *
+     * The `_.partial.placeholder` value, which defaults to `_` in monolithic
+     * builds, may be used as a placeholder for partially applied arguments.
+     *
+     * **Note:** This method does not set the "length" property of partially
+     * applied functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to partially apply arguments to.
+     * @param {...*} [partials] The arguments to be partially applied.
+     * @returns {Function} Returns the new partially applied function.
+     * @example
+     *
+     * var greet = function(greeting, name) {
+     *   return greeting + ' ' + name;
+     * };
+     *
+     * var sayHelloTo = _.partial(greet, 'hello');
+     * sayHelloTo('fred');
+     * // => 'hello fred'
+     *
+     * // using placeholders
+     * var greetFred = _.partial(greet, _, 'fred');
+     * greetFred('hi');
+     * // => 'hi fred'
+     */
+      var partial = createPartial(PARTIAL_FLAG);
+      /**
+     * This method is like `_.partial` except that partially applied arguments
+     * are appended to those provided to the new function.
+     *
+     * The `_.partialRight.placeholder` value, which defaults to `_` in monolithic
+     * builds, may be used as a placeholder for partially applied arguments.
+     *
+     * **Note:** This method does not set the "length" property of partially
+     * applied functions.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to partially apply arguments to.
+     * @param {...*} [partials] The arguments to be partially applied.
+     * @returns {Function} Returns the new partially applied function.
+     * @example
+     *
+     * var greet = function(greeting, name) {
+     *   return greeting + ' ' + name;
+     * };
+     *
+     * var greetFred = _.partialRight(greet, 'fred');
+     * greetFred('hi');
+     * // => 'hi fred'
+     *
+     * // using placeholders
+     * var sayHelloTo = _.partialRight(greet, 'hello', _);
+     * sayHelloTo('fred');
+     * // => 'hello fred'
+     */
+      var partialRight = createPartial(PARTIAL_RIGHT_FLAG);
+      /**
+     * Creates a function that invokes `func` with arguments arranged according
+     * to the specified indexes where the argument value at the first index is
+     * provided as the first argument, the argument value at the second index is
+     * provided as the second argument, and so on.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to rearrange arguments for.
+     * @param {...(number|number[])} indexes The arranged argument indexes,
+     *  specified as individual indexes or arrays of indexes.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var rearged = _.rearg(function(a, b, c) {
+     *   return [a, b, c];
+     * }, 2, 0, 1);
+     *
+     * rearged('b', 'c', 'a')
+     * // => ['a', 'b', 'c']
+     *
+     * var map = _.rearg(_.map, [1, 0]);
+     * map(function(n) {
+     *   return n * 3;
+     * }, [1, 2, 3]);
+     * // => [3, 6, 9]
+     */
+      var rearg = restParam(function (func, indexes) {
+          return createWrapper(func, REARG_FLAG, undefined, undefined, undefined, baseFlatten(indexes));
+        });
+      /**
+     * Creates a function that invokes `func` with the `this` binding of the
+     * created function and arguments from `start` and beyond provided as an array.
+     *
+     * **Note:** This method is based on the [rest parameter](https://developer.mozilla.org/Web/JavaScript/Reference/Functions/rest_parameters).
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to apply a rest parameter to.
+     * @param {number} [start=func.length-1] The start position of the rest parameter.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var say = _.restParam(function(what, names) {
+     *   return what + ' ' + _.initial(names).join(', ') +
+     *     (_.size(names) > 1 ? ', & ' : '') + _.last(names);
+     * });
+     *
+     * say('hello', 'fred', 'barney', 'pebbles');
+     * // => 'hello fred, barney, & pebbles'
+     */
+      function restParam(func, start) {
+        if (typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        start = nativeMax(start === undefined ? func.length - 1 : +start || 0, 0);
+        return function () {
+          var args = arguments, index = -1, length = nativeMax(args.length - start, 0), rest = Array(length);
+          while (++index < length) {
+            rest[index] = args[start + index];
+          }
+          switch (start) {
+          case 0:
+            return func.call(this, rest);
+          case 1:
+            return func.call(this, args[0], rest);
+          case 2:
+            return func.call(this, args[0], args[1], rest);
+          }
+          var otherArgs = Array(start + 1);
+          index = -1;
+          while (++index < start) {
+            otherArgs[index] = args[index];
+          }
+          otherArgs[start] = rest;
+          return func.apply(this, otherArgs);
+        };
+      }
+      /**
+     * Creates a function that invokes `func` with the `this` binding of the created
+     * function and an array of arguments much like [`Function#apply`](https://es5.github.io/#x15.3.4.3).
+     *
+     * **Note:** This method is based on the [spread operator](https://developer.mozilla.org/Web/JavaScript/Reference/Operators/Spread_operator).
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to spread arguments over.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var say = _.spread(function(who, what) {
+     *   return who + ' says ' + what;
+     * });
+     *
+     * say(['fred', 'hello']);
+     * // => 'fred says hello'
+     *
+     * // with a Promise
+     * var numbers = Promise.all([
+     *   Promise.resolve(40),
+     *   Promise.resolve(36)
+     * ]);
+     *
+     * numbers.then(_.spread(function(x, y) {
+     *   return x + y;
+     * }));
+     * // => a Promise of 76
+     */
+      function spread(func) {
+        if (typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        return function (array) {
+          return func.apply(this, array);
+        };
+      }
+      /**
+     * Creates a throttled function that only invokes `func` at most once per
+     * every `wait` milliseconds. The throttled function comes with a `cancel`
+     * method to cancel delayed invocations. Provide an options object to indicate
+     * that `func` should be invoked on the leading and/or trailing edge of the
+     * `wait` timeout. Subsequent calls to the throttled function return the
+     * result of the last `func` call.
+     *
+     * **Note:** If `leading` and `trailing` options are `true`, `func` is invoked
+     * on the trailing edge of the timeout only if the the throttled function is
+     * invoked more than once during the `wait` timeout.
+     *
+     * See [David Corbacho's article](http://drupalmotion.com/article/debounce-and-throttle-visual-explanation)
+     * for details over the differences between `_.throttle` and `_.debounce`.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {Function} func The function to throttle.
+     * @param {number} [wait=0] The number of milliseconds to throttle invocations to.
+     * @param {Object} [options] The options object.
+     * @param {boolean} [options.leading=true] Specify invoking on the leading
+     *  edge of the timeout.
+     * @param {boolean} [options.trailing=true] Specify invoking on the trailing
+     *  edge of the timeout.
+     * @returns {Function} Returns the new throttled function.
+     * @example
+     *
+     * // avoid excessively updating the position while scrolling
+     * jQuery(window).on('scroll', _.throttle(updatePosition, 100));
+     *
+     * // invoke `renewToken` when the click event is fired, but not more than once every 5 minutes
+     * jQuery('.interactive').on('click', _.throttle(renewToken, 300000, {
+     *   'trailing': false
+     * }));
+     *
+     * // cancel a trailing throttled call
+     * jQuery(window).on('popstate', throttled.cancel);
+     */
+      function throttle(func, wait, options) {
+        var leading = true, trailing = true;
+        if (typeof func != 'function') {
+          throw new TypeError(FUNC_ERROR_TEXT);
+        }
+        if (options === false) {
+          leading = false;
+        } else if (isObject(options)) {
+          leading = 'leading' in options ? !!options.leading : leading;
+          trailing = 'trailing' in options ? !!options.trailing : trailing;
+        }
+        return debounce(func, wait, {
+          'leading': leading,
+          'maxWait': +wait,
+          'trailing': trailing
+        });
+      }
+      /**
+     * Creates a function that provides `value` to the wrapper function as its
+     * first argument. Any additional arguments provided to the function are
+     * appended to those provided to the wrapper function. The wrapper is invoked
+     * with the `this` binding of the created function.
+     *
+     * @static
+     * @memberOf _
+     * @category Function
+     * @param {*} value The value to wrap.
+     * @param {Function} wrapper The wrapper function.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var p = _.wrap(_.escape, function(func, text) {
+     *   return '<p>' + func(text) + '</p>';
+     * });
+     *
+     * p('fred, barney, & pebbles');
+     * // => '<p>fred, barney, &amp; pebbles</p>'
+     */
+      function wrap(value, wrapper) {
+        wrapper = wrapper == null ? identity : wrapper;
+        return createWrapper(wrapper, PARTIAL_FLAG, undefined, [value], []);
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Creates a clone of `value`. If `isDeep` is `true` nested objects are cloned,
+     * otherwise they are assigned by reference. If `customizer` is provided it's
+     * invoked to produce the cloned values. If `customizer` returns `undefined`
+     * cloning is handled by the method instead. The `customizer` is bound to
+     * `thisArg` and invoked with up to three argument; (value [, index|key, object]).
+     *
+     * **Note:** This method is loosely based on the
+     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+     * The enumerable properties of `arguments` objects and objects created by
+     * constructors other than `Object` are cloned to plain `Object` objects. An
+     * empty object is returned for uncloneable values such as functions, DOM nodes,
+     * Maps, Sets, and WeakMaps.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to clone.
+     * @param {boolean} [isDeep] Specify a deep clone.
+     * @param {Function} [customizer] The function to customize cloning values.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {*} Returns the cloned value.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney' },
+     *   { 'user': 'fred' }
+     * ];
+     *
+     * var shallow = _.clone(users);
+     * shallow[0] === users[0];
+     * // => true
+     *
+     * var deep = _.clone(users, true);
+     * deep[0] === users[0];
+     * // => false
+     *
+     * // using a customizer callback
+     * var el = _.clone(document.body, function(value) {
+     *   if (_.isElement(value)) {
+     *     return value.cloneNode(false);
+     *   }
+     * });
+     *
+     * el === document.body
+     * // => false
+     * el.nodeName
+     * // => BODY
+     * el.childNodes.length;
+     * // => 0
+     */
+      function clone(value, isDeep, customizer, thisArg) {
+        if (isDeep && typeof isDeep != 'boolean' && isIterateeCall(value, isDeep, customizer)) {
+          isDeep = false;
+        } else if (typeof isDeep == 'function') {
+          thisArg = customizer;
+          customizer = isDeep;
+          isDeep = false;
+        }
+        return typeof customizer == 'function' ? baseClone(value, isDeep, bindCallback(customizer, thisArg, 3)) : baseClone(value, isDeep);
+      }
+      /**
+     * Creates a deep clone of `value`. If `customizer` is provided it's invoked
+     * to produce the cloned values. If `customizer` returns `undefined` cloning
+     * is handled by the method instead. The `customizer` is bound to `thisArg`
+     * and invoked with up to three argument; (value [, index|key, object]).
+     *
+     * **Note:** This method is loosely based on the
+     * [structured clone algorithm](http://www.w3.org/TR/html5/infrastructure.html#internal-structured-cloning-algorithm).
+     * The enumerable properties of `arguments` objects and objects created by
+     * constructors other than `Object` are cloned to plain `Object` objects. An
+     * empty object is returned for uncloneable values such as functions, DOM nodes,
+     * Maps, Sets, and WeakMaps.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to deep clone.
+     * @param {Function} [customizer] The function to customize cloning values.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {*} Returns the deep cloned value.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney' },
+     *   { 'user': 'fred' }
+     * ];
+     *
+     * var deep = _.cloneDeep(users);
+     * deep[0] === users[0];
+     * // => false
+     *
+     * // using a customizer callback
+     * var el = _.cloneDeep(document.body, function(value) {
+     *   if (_.isElement(value)) {
+     *     return value.cloneNode(true);
+     *   }
+     * });
+     *
+     * el === document.body
+     * // => false
+     * el.nodeName
+     * // => BODY
+     * el.childNodes.length;
+     * // => 20
+     */
+      function cloneDeep(value, customizer, thisArg) {
+        return typeof customizer == 'function' ? baseClone(value, true, bindCallback(customizer, thisArg, 3)) : baseClone(value, true);
+      }
+      /**
+     * Checks if `value` is greater than `other`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @returns {boolean} Returns `true` if `value` is greater than `other`, else `false`.
+     * @example
+     *
+     * _.gt(3, 1);
+     * // => true
+     *
+     * _.gt(3, 3);
+     * // => false
+     *
+     * _.gt(1, 3);
+     * // => false
+     */
+      function gt(value, other) {
+        return value > other;
+      }
+      /**
+     * Checks if `value` is greater than or equal to `other`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @returns {boolean} Returns `true` if `value` is greater than or equal to `other`, else `false`.
+     * @example
+     *
+     * _.gte(3, 1);
+     * // => true
+     *
+     * _.gte(3, 3);
+     * // => true
+     *
+     * _.gte(1, 3);
+     * // => false
+     */
+      function gte(value, other) {
+        return value >= other;
+      }
+      /**
+     * Checks if `value` is classified as an `arguments` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isArguments(function() { return arguments; }());
+     * // => true
+     *
+     * _.isArguments([1, 2, 3]);
+     * // => false
+     */
+      function isArguments(value) {
+        return isObjectLike(value) && isArrayLike(value) && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee');
+      }
+      /**
+     * Checks if `value` is classified as an `Array` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isArray([1, 2, 3]);
+     * // => true
+     *
+     * _.isArray(function() { return arguments; }());
+     * // => false
+     */
+      var isArray = nativeIsArray || function (value) {
+          return isObjectLike(value) && isLength(value.length) && objToString.call(value) == arrayTag;
+        };
+      /**
+     * Checks if `value` is classified as a boolean primitive or object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isBoolean(false);
+     * // => true
+     *
+     * _.isBoolean(null);
+     * // => false
+     */
+      function isBoolean(value) {
+        return value === true || value === false || isObjectLike(value) && objToString.call(value) == boolTag;
+      }
+      /**
+     * Checks if `value` is classified as a `Date` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isDate(new Date);
+     * // => true
+     *
+     * _.isDate('Mon April 23 2012');
+     * // => false
+     */
+      function isDate(value) {
+        return isObjectLike(value) && objToString.call(value) == dateTag;
+      }
+      /**
+     * Checks if `value` is a DOM element.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is a DOM element, else `false`.
+     * @example
+     *
+     * _.isElement(document.body);
+     * // => true
+     *
+     * _.isElement('<body>');
+     * // => false
+     */
+      function isElement(value) {
+        return !!value && value.nodeType === 1 && isObjectLike(value) && !isPlainObject(value);
+      }
+      /**
+     * Checks if `value` is empty. A value is considered empty unless it's an
+     * `arguments` object, array, string, or jQuery-like collection with a length
+     * greater than `0` or an object with own enumerable properties.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {Array|Object|string} value The value to inspect.
+     * @returns {boolean} Returns `true` if `value` is empty, else `false`.
+     * @example
+     *
+     * _.isEmpty(null);
+     * // => true
+     *
+     * _.isEmpty(true);
+     * // => true
+     *
+     * _.isEmpty(1);
+     * // => true
+     *
+     * _.isEmpty([1, 2, 3]);
+     * // => false
+     *
+     * _.isEmpty({ 'a': 1 });
+     * // => false
+     */
+      function isEmpty(value) {
+        if (value == null) {
+          return true;
+        }
+        if (isArrayLike(value) && (isArray(value) || isString(value) || isArguments(value) || isObjectLike(value) && isFunction(value.splice))) {
+          return !value.length;
+        }
+        return !keys(value).length;
+      }
+      /**
+     * Performs a deep comparison between two values to determine if they are
+     * equivalent. If `customizer` is provided it's invoked to compare values.
+     * If `customizer` returns `undefined` comparisons are handled by the method
+     * instead. The `customizer` is bound to `thisArg` and invoked with up to
+     * three arguments: (value, other [, index|key]).
+     *
+     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+     * numbers, `Object` objects, regexes, and strings. Objects are compared by
+     * their own, not inherited, enumerable properties. Functions and DOM nodes
+     * are **not** supported. Provide a customizer function to extend support
+     * for comparing other values.
+     *
+     * @static
+     * @memberOf _
+     * @alias eq
+     * @category Lang
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @param {Function} [customizer] The function to customize value comparisons.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
+     * @example
+     *
+     * var object = { 'user': 'fred' };
+     * var other = { 'user': 'fred' };
+     *
+     * object == other;
+     * // => false
+     *
+     * _.isEqual(object, other);
+     * // => true
+     *
+     * // using a customizer callback
+     * var array = ['hello', 'goodbye'];
+     * var other = ['hi', 'goodbye'];
+     *
+     * _.isEqual(array, other, function(value, other) {
+     *   if (_.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/)) {
+     *     return true;
+     *   }
+     * });
+     * // => true
+     */
+      function isEqual(value, other, customizer, thisArg) {
+        customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+        var result = customizer ? customizer(value, other) : undefined;
+        return result === undefined ? baseIsEqual(value, other, customizer) : !!result;
+      }
+      /**
+     * Checks if `value` is an `Error`, `EvalError`, `RangeError`, `ReferenceError`,
+     * `SyntaxError`, `TypeError`, or `URIError` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is an error object, else `false`.
+     * @example
+     *
+     * _.isError(new Error);
+     * // => true
+     *
+     * _.isError(Error);
+     * // => false
+     */
+      function isError(value) {
+        return isObjectLike(value) && typeof value.message == 'string' && objToString.call(value) == errorTag;
+      }
+      /**
+     * Checks if `value` is a finite primitive number.
+     *
+     * **Note:** This method is based on [`Number.isFinite`](http://ecma-international.org/ecma-262/6.0/#sec-number.isfinite).
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is a finite number, else `false`.
+     * @example
+     *
+     * _.isFinite(10);
+     * // => true
+     *
+     * _.isFinite('10');
+     * // => false
+     *
+     * _.isFinite(true);
+     * // => false
+     *
+     * _.isFinite(Object(10));
+     * // => false
+     *
+     * _.isFinite(Infinity);
+     * // => false
+     */
+      function isFinite(value) {
+        return typeof value == 'number' && nativeIsFinite(value);
+      }
+      /**
+     * Checks if `value` is classified as a `Function` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isFunction(_);
+     * // => true
+     *
+     * _.isFunction(/abc/);
+     * // => false
+     */
+      function isFunction(value) {
+        // The use of `Object#toString` avoids issues with the `typeof` operator
+        // in older versions of Chrome and Safari which return 'function' for regexes
+        // and Safari 8 which returns 'object' for typed array constructors.
+        return isObject(value) && objToString.call(value) == funcTag;
+      }
+      /**
+     * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+     * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+     * @example
+     *
+     * _.isObject({});
+     * // => true
+     *
+     * _.isObject([1, 2, 3]);
+     * // => true
+     *
+     * _.isObject(1);
+     * // => false
+     */
+      function isObject(value) {
+        // Avoid a V8 JIT bug in Chrome 19-20.
+        // See https://code.google.com/p/v8/issues/detail?id=2291 for more details.
+        var type = typeof value;
+        return !!value && (type == 'object' || type == 'function');
+      }
+      /**
+     * Performs a deep comparison between `object` and `source` to determine if
+     * `object` contains equivalent property values. If `customizer` is provided
+     * it's invoked to compare values. If `customizer` returns `undefined`
+     * comparisons are handled by the method instead. The `customizer` is bound
+     * to `thisArg` and invoked with three arguments: (value, other, index|key).
+     *
+     * **Note:** This method supports comparing properties of arrays, booleans,
+     * `Date` objects, numbers, `Object` objects, regexes, and strings. Functions
+     * and DOM nodes are **not** supported. Provide a customizer function to extend
+     * support for comparing other values.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {Object} object The object to inspect.
+     * @param {Object} source The object of property values to match.
+     * @param {Function} [customizer] The function to customize value comparisons.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {boolean} Returns `true` if `object` is a match, else `false`.
+     * @example
+     *
+     * var object = { 'user': 'fred', 'age': 40 };
+     *
+     * _.isMatch(object, { 'age': 40 });
+     * // => true
+     *
+     * _.isMatch(object, { 'age': 36 });
+     * // => false
+     *
+     * // using a customizer callback
+     * var object = { 'greeting': 'hello' };
+     * var source = { 'greeting': 'hi' };
+     *
+     * _.isMatch(object, source, function(value, other) {
+     *   return _.every([value, other], RegExp.prototype.test, /^h(?:i|ello)$/) || undefined;
+     * });
+     * // => true
+     */
+      function isMatch(object, source, customizer, thisArg) {
+        customizer = typeof customizer == 'function' ? bindCallback(customizer, thisArg, 3) : undefined;
+        return baseIsMatch(object, getMatchData(source), customizer);
+      }
+      /**
+     * Checks if `value` is `NaN`.
+     *
+     * **Note:** This method is not the same as [`isNaN`](https://es5.github.io/#x15.1.2.4)
+     * which returns `true` for `undefined` and other non-numeric values.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
+     * @example
+     *
+     * _.isNaN(NaN);
+     * // => true
+     *
+     * _.isNaN(new Number(NaN));
+     * // => true
+     *
+     * isNaN(undefined);
+     * // => true
+     *
+     * _.isNaN(undefined);
+     * // => false
+     */
+      function isNaN(value) {
+        // An `NaN` primitive is the only value that is not equal to itself.
+        // Perform the `toStringTag` check first to avoid errors with some host objects in IE.
+        return isNumber(value) && value != +value;
+      }
+      /**
+     * Checks if `value` is a native function.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is a native function, else `false`.
+     * @example
+     *
+     * _.isNative(Array.prototype.push);
+     * // => true
+     *
+     * _.isNative(_);
+     * // => false
+     */
+      function isNative(value) {
+        if (value == null) {
+          return false;
+        }
+        if (isFunction(value)) {
+          return reIsNative.test(fnToString.call(value));
+        }
+        return isObjectLike(value) && reIsHostCtor.test(value);
+      }
+      /**
+     * Checks if `value` is `null`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is `null`, else `false`.
+     * @example
+     *
+     * _.isNull(null);
+     * // => true
+     *
+     * _.isNull(void 0);
+     * // => false
+     */
+      function isNull(value) {
+        return value === null;
+      }
+      /**
+     * Checks if `value` is classified as a `Number` primitive or object.
+     *
+     * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are classified
+     * as numbers, use the `_.isFinite` method.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isNumber(8.4);
+     * // => true
+     *
+     * _.isNumber(NaN);
+     * // => true
+     *
+     * _.isNumber('8.4');
+     * // => false
+     */
+      function isNumber(value) {
+        return typeof value == 'number' || isObjectLike(value) && objToString.call(value) == numberTag;
+      }
+      /**
+     * Checks if `value` is a plain object, that is, an object created by the
+     * `Object` constructor or one with a `[[Prototype]]` of `null`.
+     *
+     * **Note:** This method assumes objects created by the `Object` constructor
+     * have no inherited enumerable properties.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     * }
+     *
+     * _.isPlainObject(new Foo);
+     * // => false
+     *
+     * _.isPlainObject([1, 2, 3]);
+     * // => false
+     *
+     * _.isPlainObject({ 'x': 0, 'y': 0 });
+     * // => true
+     *
+     * _.isPlainObject(Object.create(null));
+     * // => true
+     */
+      function isPlainObject(value) {
+        var Ctor;
+        // Exit early for non `Object` objects.
+        if (!(isObjectLike(value) && objToString.call(value) == objectTag && !isArguments(value)) || !hasOwnProperty.call(value, 'constructor') && (Ctor = value.constructor, typeof Ctor == 'function' && !(Ctor instanceof Ctor))) {
+          return false;
+        }
+        // IE < 9 iterates inherited properties before own properties. If the first
+        // iterated property is an object's own property then there are no inherited
+        // enumerable properties.
+        var result;
+        // In most environments an object's own properties are iterated before
+        // its inherited properties. If the last iterated property is an object's
+        // own property then there are no inherited enumerable properties.
+        baseForIn(value, function (subValue, key) {
+          result = key;
+        });
+        return result === undefined || hasOwnProperty.call(value, result);
+      }
+      /**
+     * Checks if `value` is classified as a `RegExp` object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isRegExp(/abc/);
+     * // => true
+     *
+     * _.isRegExp('/abc/');
+     * // => false
+     */
+      function isRegExp(value) {
+        return isObject(value) && objToString.call(value) == regexpTag;
+      }
+      /**
+     * Checks if `value` is classified as a `String` primitive or object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isString('abc');
+     * // => true
+     *
+     * _.isString(1);
+     * // => false
+     */
+      function isString(value) {
+        return typeof value == 'string' || isObjectLike(value) && objToString.call(value) == stringTag;
+      }
+      /**
+     * Checks if `value` is classified as a typed array.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+     * @example
+     *
+     * _.isTypedArray(new Uint8Array);
+     * // => true
+     *
+     * _.isTypedArray([]);
+     * // => false
+     */
+      function isTypedArray(value) {
+        return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objToString.call(value)];
+      }
+      /**
+     * Checks if `value` is `undefined`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to check.
+     * @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
+     * @example
+     *
+     * _.isUndefined(void 0);
+     * // => true
+     *
+     * _.isUndefined(null);
+     * // => false
+     */
+      function isUndefined(value) {
+        return value === undefined;
+      }
+      /**
+     * Checks if `value` is less than `other`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @returns {boolean} Returns `true` if `value` is less than `other`, else `false`.
+     * @example
+     *
+     * _.lt(1, 3);
+     * // => true
+     *
+     * _.lt(3, 3);
+     * // => false
+     *
+     * _.lt(3, 1);
+     * // => false
+     */
+      function lt(value, other) {
+        return value < other;
+      }
+      /**
+     * Checks if `value` is less than or equal to `other`.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to compare.
+     * @param {*} other The other value to compare.
+     * @returns {boolean} Returns `true` if `value` is less than or equal to `other`, else `false`.
+     * @example
+     *
+     * _.lte(1, 3);
+     * // => true
+     *
+     * _.lte(3, 3);
+     * // => true
+     *
+     * _.lte(3, 1);
+     * // => false
+     */
+      function lte(value, other) {
+        return value <= other;
+      }
+      /**
+     * Converts `value` to an array.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to convert.
+     * @returns {Array} Returns the converted array.
+     * @example
+     *
+     * (function() {
+     *   return _.toArray(arguments).slice(1);
+     * }(1, 2, 3));
+     * // => [2, 3]
+     */
+      function toArray(value) {
+        var length = value ? getLength(value) : 0;
+        if (!isLength(length)) {
+          return values(value);
+        }
+        if (!length) {
+          return [];
+        }
+        return arrayCopy(value);
+      }
+      /**
+     * Converts `value` to a plain object flattening inherited enumerable
+     * properties of `value` to own properties of the plain object.
+     *
+     * @static
+     * @memberOf _
+     * @category Lang
+     * @param {*} value The value to convert.
+     * @returns {Object} Returns the converted plain object.
+     * @example
+     *
+     * function Foo() {
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.assign({ 'a': 1 }, new Foo);
+     * // => { 'a': 1, 'b': 2 }
+     *
+     * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));
+     * // => { 'a': 1, 'b': 2, 'c': 3 }
+     */
+      function toPlainObject(value) {
+        return baseCopy(value, keysIn(value));
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Recursively merges own enumerable properties of the source object(s), that
+     * don't resolve to `undefined` into the destination object. Subsequent sources
+     * overwrite property assignments of previous sources. If `customizer` is
+     * provided it's invoked to produce the merged values of the destination and
+     * source properties. If `customizer` returns `undefined` merging is handled
+     * by the method instead. The `customizer` is bound to `thisArg` and invoked
+     * with five arguments: (objectValue, sourceValue, key, object, source).
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The destination object.
+     * @param {...Object} [sources] The source objects.
+     * @param {Function} [customizer] The function to customize assigned values.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * var users = {
+     *   'data': [{ 'user': 'barney' }, { 'user': 'fred' }]
+     * };
+     *
+     * var ages = {
+     *   'data': [{ 'age': 36 }, { 'age': 40 }]
+     * };
+     *
+     * _.merge(users, ages);
+     * // => { 'data': [{ 'user': 'barney', 'age': 36 }, { 'user': 'fred', 'age': 40 }] }
+     *
+     * // using a customizer callback
+     * var object = {
+     *   'fruits': ['apple'],
+     *   'vegetables': ['beet']
+     * };
+     *
+     * var other = {
+     *   'fruits': ['banana'],
+     *   'vegetables': ['carrot']
+     * };
+     *
+     * _.merge(object, other, function(a, b) {
+     *   if (_.isArray(a)) {
+     *     return a.concat(b);
+     *   }
+     * });
+     * // => { 'fruits': ['apple', 'banana'], 'vegetables': ['beet', 'carrot'] }
+     */
+      var merge = createAssigner(baseMerge);
+      /**
+     * Assigns own enumerable properties of source object(s) to the destination
+     * object. Subsequent sources overwrite property assignments of previous sources.
+     * If `customizer` is provided it's invoked to produce the assigned values.
+     * The `customizer` is bound to `thisArg` and invoked with five arguments:
+     * (objectValue, sourceValue, key, object, source).
+     *
+     * **Note:** This method mutates `object` and is based on
+     * [`Object.assign`](http://ecma-international.org/ecma-262/6.0/#sec-object.assign).
+     *
+     * @static
+     * @memberOf _
+     * @alias extend
+     * @category Object
+     * @param {Object} object The destination object.
+     * @param {...Object} [sources] The source objects.
+     * @param {Function} [customizer] The function to customize assigned values.
+     * @param {*} [thisArg] The `this` binding of `customizer`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * _.assign({ 'user': 'barney' }, { 'age': 40 }, { 'user': 'fred' });
+     * // => { 'user': 'fred', 'age': 40 }
+     *
+     * // using a customizer callback
+     * var defaults = _.partialRight(_.assign, function(value, other) {
+     *   return _.isUndefined(value) ? other : value;
+     * });
+     *
+     * defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+     * // => { 'user': 'barney', 'age': 36 }
+     */
+      var assign = createAssigner(function (object, source, customizer) {
+          return customizer ? assignWith(object, source, customizer) : baseAssign(object, source);
+        });
+      /**
+     * Creates an object that inherits from the given `prototype` object. If a
+     * `properties` object is provided its own enumerable properties are assigned
+     * to the created object.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} prototype The object to inherit from.
+     * @param {Object} [properties] The properties to assign to the object.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Object} Returns the new object.
+     * @example
+     *
+     * function Shape() {
+     *   this.x = 0;
+     *   this.y = 0;
+     * }
+     *
+     * function Circle() {
+     *   Shape.call(this);
+     * }
+     *
+     * Circle.prototype = _.create(Shape.prototype, {
+     *   'constructor': Circle
+     * });
+     *
+     * var circle = new Circle;
+     * circle instanceof Circle;
+     * // => true
+     *
+     * circle instanceof Shape;
+     * // => true
+     */
+      function create(prototype, properties, guard) {
+        var result = baseCreate(prototype);
+        if (guard && isIterateeCall(prototype, properties, guard)) {
+          properties = undefined;
+        }
+        return properties ? baseAssign(result, properties) : result;
+      }
+      /**
+     * Assigns own enumerable properties of source object(s) to the destination
+     * object for all destination properties that resolve to `undefined`. Once a
+     * property is set, additional values of the same property are ignored.
+     *
+     * **Note:** This method mutates `object`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The destination object.
+     * @param {...Object} [sources] The source objects.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * _.defaults({ 'user': 'barney' }, { 'age': 36 }, { 'user': 'fred' });
+     * // => { 'user': 'barney', 'age': 36 }
+     */
+      var defaults = createDefaults(assign, assignDefaults);
+      /**
+     * This method is like `_.defaults` except that it recursively assigns
+     * default properties.
+     *
+     * **Note:** This method mutates `object`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The destination object.
+     * @param {...Object} [sources] The source objects.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * _.defaultsDeep({ 'user': { 'name': 'barney' } }, { 'user': { 'name': 'fred', 'age': 36 } });
+     * // => { 'user': { 'name': 'barney', 'age': 36 } }
+     *
+     */
+      var defaultsDeep = createDefaults(merge, mergeDefaults);
+      /**
+     * This method is like `_.find` except that it returns the key of the first
+     * element `predicate` returns truthy for instead of the element itself.
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+     * @example
+     *
+     * var users = {
+     *   'barney':  { 'age': 36, 'active': true },
+     *   'fred':    { 'age': 40, 'active': false },
+     *   'pebbles': { 'age': 1,  'active': true }
+     * };
+     *
+     * _.findKey(users, function(chr) {
+     *   return chr.age < 40;
+     * });
+     * // => 'barney' (iteration order is not guaranteed)
+     *
+     * // using the `_.matches` callback shorthand
+     * _.findKey(users, { 'age': 1, 'active': true });
+     * // => 'pebbles'
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.findKey(users, 'active', false);
+     * // => 'fred'
+     *
+     * // using the `_.property` callback shorthand
+     * _.findKey(users, 'active');
+     * // => 'barney'
+     */
+      var findKey = createFindKey(baseForOwn);
+      /**
+     * This method is like `_.findKey` except that it iterates over elements of
+     * a collection in the opposite order.
+     *
+     * If a property name is provided for `predicate` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `predicate` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to search.
+     * @param {Function|Object|string} [predicate=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {string|undefined} Returns the key of the matched element, else `undefined`.
+     * @example
+     *
+     * var users = {
+     *   'barney':  { 'age': 36, 'active': true },
+     *   'fred':    { 'age': 40, 'active': false },
+     *   'pebbles': { 'age': 1,  'active': true }
+     * };
+     *
+     * _.findLastKey(users, function(chr) {
+     *   return chr.age < 40;
+     * });
+     * // => returns `pebbles` assuming `_.findKey` returns `barney`
+     *
+     * // using the `_.matches` callback shorthand
+     * _.findLastKey(users, { 'age': 36, 'active': true });
+     * // => 'barney'
+     *
+     * // using the `_.matchesProperty` callback shorthand
+     * _.findLastKey(users, 'active', false);
+     * // => 'fred'
+     *
+     * // using the `_.property` callback shorthand
+     * _.findLastKey(users, 'active');
+     * // => 'pebbles'
+     */
+      var findLastKey = createFindKey(baseForOwnRight);
+      /**
+     * Iterates over own and inherited enumerable properties of an object invoking
+     * `iteratee` for each property. The `iteratee` is bound to `thisArg` and invoked
+     * with three arguments: (value, key, object). Iteratee functions may exit
+     * iteration early by explicitly returning `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.forIn(new Foo, function(value, key) {
+     *   console.log(key);
+     * });
+     * // => logs 'a', 'b', and 'c' (iteration order is not guaranteed)
+     */
+      var forIn = createForIn(baseFor);
+      /**
+     * This method is like `_.forIn` except that it iterates over properties of
+     * `object` in the opposite order.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.forInRight(new Foo, function(value, key) {
+     *   console.log(key);
+     * });
+     * // => logs 'c', 'b', and 'a' assuming `_.forIn ` logs 'a', 'b', and 'c'
+     */
+      var forInRight = createForIn(baseForRight);
+      /**
+     * Iterates over own enumerable properties of an object invoking `iteratee`
+     * for each property. The `iteratee` is bound to `thisArg` and invoked with
+     * three arguments: (value, key, object). Iteratee functions may exit iteration
+     * early by explicitly returning `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.forOwn(new Foo, function(value, key) {
+     *   console.log(key);
+     * });
+     * // => logs 'a' and 'b' (iteration order is not guaranteed)
+     */
+      var forOwn = createForOwn(baseForOwn);
+      /**
+     * This method is like `_.forOwn` except that it iterates over properties of
+     * `object` in the opposite order.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.forOwnRight(new Foo, function(value, key) {
+     *   console.log(key);
+     * });
+     * // => logs 'b' and 'a' assuming `_.forOwn` logs 'a' and 'b'
+     */
+      var forOwnRight = createForOwn(baseForOwnRight);
+      /**
+     * Creates an array of function property names from all enumerable properties,
+     * own and inherited, of `object`.
+     *
+     * @static
+     * @memberOf _
+     * @alias methods
+     * @category Object
+     * @param {Object} object The object to inspect.
+     * @returns {Array} Returns the new array of property names.
+     * @example
+     *
+     * _.functions(_);
+     * // => ['after', 'ary', 'assign', ...]
+     */
+      function functions(object) {
+        return baseFunctions(object, keysIn(object));
+      }
+      /**
+     * Gets the property value at `path` of `object`. If the resolved value is
+     * `undefined` the `defaultValue` is used in its place.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @param {Array|string} path The path of the property to get.
+     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+     * @returns {*} Returns the resolved value.
+     * @example
+     *
+     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+     *
+     * _.get(object, 'a[0].b.c');
+     * // => 3
+     *
+     * _.get(object, ['a', '0', 'b', 'c']);
+     * // => 3
+     *
+     * _.get(object, 'a.b.c', 'default');
+     * // => 'default'
+     */
+      function get(object, path, defaultValue) {
+        var result = object == null ? undefined : baseGet(object, toPath(path), path + '');
+        return result === undefined ? defaultValue : result;
+      }
+      /**
+     * Checks if `path` is a direct property.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @param {Array|string} path The path to check.
+     * @returns {boolean} Returns `true` if `path` is a direct property, else `false`.
+     * @example
+     *
+     * var object = { 'a': { 'b': { 'c': 3 } } };
+     *
+     * _.has(object, 'a');
+     * // => true
+     *
+     * _.has(object, 'a.b.c');
+     * // => true
+     *
+     * _.has(object, ['a', 'b', 'c']);
+     * // => true
+     */
+      function has(object, path) {
+        if (object == null) {
+          return false;
+        }
+        var result = hasOwnProperty.call(object, path);
+        if (!result && !isKey(path)) {
+          path = toPath(path);
+          object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+          if (object == null) {
+            return false;
+          }
+          path = last(path);
+          result = hasOwnProperty.call(object, path);
+        }
+        return result || isLength(object.length) && isIndex(path, object.length) && (isArray(object) || isArguments(object));
+      }
+      /**
+     * Creates an object composed of the inverted keys and values of `object`.
+     * If `object` contains duplicate values, subsequent values overwrite property
+     * assignments of previous values unless `multiValue` is `true`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to invert.
+     * @param {boolean} [multiValue] Allow multiple values per key.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Object} Returns the new inverted object.
+     * @example
+     *
+     * var object = { 'a': 1, 'b': 2, 'c': 1 };
+     *
+     * _.invert(object);
+     * // => { '1': 'c', '2': 'b' }
+     *
+     * // with `multiValue`
+     * _.invert(object, true);
+     * // => { '1': ['a', 'c'], '2': ['b'] }
+     */
+      function invert(object, multiValue, guard) {
+        if (guard && isIterateeCall(object, multiValue, guard)) {
+          multiValue = undefined;
+        }
+        var index = -1, props = keys(object), length = props.length, result = {};
+        while (++index < length) {
+          var key = props[index], value = object[key];
+          if (multiValue) {
+            if (hasOwnProperty.call(result, value)) {
+              result[value].push(key);
+            } else {
+              result[value] = [key];
+            }
+          } else {
+            result[value] = key;
+          }
+        }
+        return result;
+      }
+      /**
+     * Creates an array of the own enumerable property names of `object`.
+     *
+     * **Note:** Non-object values are coerced to objects. See the
+     * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys)
+     * for more details.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the array of property names.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.keys(new Foo);
+     * // => ['a', 'b'] (iteration order is not guaranteed)
+     *
+     * _.keys('hi');
+     * // => ['0', '1']
+     */
+      var keys = !nativeKeys ? shimKeys : function (object) {
+          var Ctor = object == null ? undefined : object.constructor;
+          if (typeof Ctor == 'function' && Ctor.prototype === object || typeof object != 'function' && isArrayLike(object)) {
+            return shimKeys(object);
+          }
+          return isObject(object) ? nativeKeys(object) : [];
+        };
+      /**
+     * Creates an array of the own and inherited enumerable property names of `object`.
+     *
+     * **Note:** Non-object values are coerced to objects.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the array of property names.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.keysIn(new Foo);
+     * // => ['a', 'b', 'c'] (iteration order is not guaranteed)
+     */
+      function keysIn(object) {
+        if (object == null) {
+          return [];
+        }
+        if (!isObject(object)) {
+          object = Object(object);
+        }
+        var length = object.length;
+        length = length && isLength(length) && (isArray(object) || isArguments(object)) && length || 0;
+        var Ctor = object.constructor, index = -1, isProto = typeof Ctor == 'function' && Ctor.prototype === object, result = Array(length), skipIndexes = length > 0;
+        while (++index < length) {
+          result[index] = index + '';
+        }
+        for (var key in object) {
+          if (!(skipIndexes && isIndex(key, length)) && !(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
+            result.push(key);
+          }
+        }
+        return result;
+      }
+      /**
+     * The opposite of `_.mapValues`; this method creates an object with the
+     * same values as `object` and keys generated by running each own enumerable
+     * property of `object` through `iteratee`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns the new mapped object.
+     * @example
+     *
+     * _.mapKeys({ 'a': 1, 'b': 2 }, function(value, key) {
+     *   return key + value;
+     * });
+     * // => { 'a1': 1, 'b2': 2 }
+     */
+      var mapKeys = createObjectMapper(true);
+      /**
+     * Creates an object with the same keys as `object` and values generated by
+     * running each own enumerable property of `object` through `iteratee`. The
+     * iteratee function is bound to `thisArg` and invoked with three arguments:
+     * (value, key, object).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to iterate over.
+     * @param {Function|Object|string} [iteratee=_.identity] The function invoked
+     *  per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Object} Returns the new mapped object.
+     * @example
+     *
+     * _.mapValues({ 'a': 1, 'b': 2 }, function(n) {
+     *   return n * 3;
+     * });
+     * // => { 'a': 3, 'b': 6 }
+     *
+     * var users = {
+     *   'fred':    { 'user': 'fred',    'age': 40 },
+     *   'pebbles': { 'user': 'pebbles', 'age': 1 }
+     * };
+     *
+     * // using the `_.property` callback shorthand
+     * _.mapValues(users, 'age');
+     * // => { 'fred': 40, 'pebbles': 1 } (iteration order is not guaranteed)
+     */
+      var mapValues = createObjectMapper();
+      /**
+     * The opposite of `_.pick`; this method creates an object composed of the
+     * own and inherited enumerable properties of `object` that are not omitted.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The source object.
+     * @param {Function|...(string|string[])} [predicate] The function invoked per
+     *  iteration or property names to omit, specified as individual property
+     *  names or arrays of property names.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Object} Returns the new object.
+     * @example
+     *
+     * var object = { 'user': 'fred', 'age': 40 };
+     *
+     * _.omit(object, 'age');
+     * // => { 'user': 'fred' }
+     *
+     * _.omit(object, _.isNumber);
+     * // => { 'user': 'fred' }
+     */
+      var omit = restParam(function (object, props) {
+          if (object == null) {
+            return {};
+          }
+          if (typeof props[0] != 'function') {
+            var props = arrayMap(baseFlatten(props), String);
+            return pickByArray(object, baseDifference(keysIn(object), props));
+          }
+          var predicate = bindCallback(props[0], props[1], 3);
+          return pickByCallback(object, function (value, key, object) {
+            return !predicate(value, key, object);
+          });
+        });
+      /**
+     * Creates a two dimensional array of the key-value pairs for `object`,
+     * e.g. `[[key1, value1], [key2, value2]]`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the new array of key-value pairs.
+     * @example
+     *
+     * _.pairs({ 'barney': 36, 'fred': 40 });
+     * // => [['barney', 36], ['fred', 40]] (iteration order is not guaranteed)
+     */
+      function pairs(object) {
+        object = toObject(object);
+        var index = -1, props = keys(object), length = props.length, result = Array(length);
+        while (++index < length) {
+          var key = props[index];
+          result[index] = [
+            key,
+            object[key]
+          ];
+        }
+        return result;
+      }
+      /**
+     * Creates an object composed of the picked `object` properties. Property
+     * names may be specified as individual arguments or as arrays of property
+     * names. If `predicate` is provided it's invoked for each property of `object`
+     * picking the properties `predicate` returns truthy for. The predicate is
+     * bound to `thisArg` and invoked with three arguments: (value, key, object).
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The source object.
+     * @param {Function|...(string|string[])} [predicate] The function invoked per
+     *  iteration or property names to pick, specified as individual property
+     *  names or arrays of property names.
+     * @param {*} [thisArg] The `this` binding of `predicate`.
+     * @returns {Object} Returns the new object.
+     * @example
+     *
+     * var object = { 'user': 'fred', 'age': 40 };
+     *
+     * _.pick(object, 'user');
+     * // => { 'user': 'fred' }
+     *
+     * _.pick(object, _.isString);
+     * // => { 'user': 'fred' }
+     */
+      var pick = restParam(function (object, props) {
+          if (object == null) {
+            return {};
+          }
+          return typeof props[0] == 'function' ? pickByCallback(object, bindCallback(props[0], props[1], 3)) : pickByArray(object, baseFlatten(props));
+        });
+      /**
+     * This method is like `_.get` except that if the resolved value is a function
+     * it's invoked with the `this` binding of its parent object and its result
+     * is returned.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @param {Array|string} path The path of the property to resolve.
+     * @param {*} [defaultValue] The value returned if the resolved value is `undefined`.
+     * @returns {*} Returns the resolved value.
+     * @example
+     *
+     * var object = { 'a': [{ 'b': { 'c1': 3, 'c2': _.constant(4) } }] };
+     *
+     * _.result(object, 'a[0].b.c1');
+     * // => 3
+     *
+     * _.result(object, 'a[0].b.c2');
+     * // => 4
+     *
+     * _.result(object, 'a.b.c', 'default');
+     * // => 'default'
+     *
+     * _.result(object, 'a.b.c', _.constant('default'));
+     * // => 'default'
+     */
+      function result(object, path, defaultValue) {
+        var result = object == null ? undefined : object[path];
+        if (result === undefined) {
+          if (object != null && !isKey(path, object)) {
+            path = toPath(path);
+            object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
+            result = object == null ? undefined : object[last(path)];
+          }
+          result = result === undefined ? defaultValue : result;
+        }
+        return isFunction(result) ? result.call(object) : result;
+      }
+      /**
+     * Sets the property value of `path` on `object`. If a portion of `path`
+     * does not exist it's created.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to augment.
+     * @param {Array|string} path The path of the property to set.
+     * @param {*} value The value to set.
+     * @returns {Object} Returns `object`.
+     * @example
+     *
+     * var object = { 'a': [{ 'b': { 'c': 3 } }] };
+     *
+     * _.set(object, 'a[0].b.c', 4);
+     * console.log(object.a[0].b.c);
+     * // => 4
+     *
+     * _.set(object, 'x[0].y.z', 5);
+     * console.log(object.x[0].y.z);
+     * // => 5
+     */
+      function set(object, path, value) {
+        if (object == null) {
+          return object;
+        }
+        var pathKey = path + '';
+        path = object[pathKey] != null || isKey(path, object) ? [pathKey] : toPath(path);
+        var index = -1, length = path.length, lastIndex = length - 1, nested = object;
+        while (nested != null && ++index < length) {
+          var key = path[index];
+          if (isObject(nested)) {
+            if (index == lastIndex) {
+              nested[key] = value;
+            } else if (nested[key] == null) {
+              nested[key] = isIndex(path[index + 1]) ? [] : {};
+            }
+          }
+          nested = nested[key];
+        }
+        return object;
+      }
+      /**
+     * An alternative to `_.reduce`; this method transforms `object` to a new
+     * `accumulator` object which is the result of running each of its own enumerable
+     * properties through `iteratee`, with each invocation potentially mutating
+     * the `accumulator` object. The `iteratee` is bound to `thisArg` and invoked
+     * with four arguments: (accumulator, value, key, object). Iteratee functions
+     * may exit iteration early by explicitly returning `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Array|Object} object The object to iterate over.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [accumulator] The custom accumulator value.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {*} Returns the accumulated value.
+     * @example
+     *
+     * _.transform([2, 3, 4], function(result, n) {
+     *   result.push(n *= n);
+     *   return n % 2 == 0;
+     * });
+     * // => [4, 9]
+     *
+     * _.transform({ 'a': 1, 'b': 2 }, function(result, n, key) {
+     *   result[key] = n * 3;
+     * });
+     * // => { 'a': 3, 'b': 6 }
+     */
+      function transform(object, iteratee, accumulator, thisArg) {
+        var isArr = isArray(object) || isTypedArray(object);
+        iteratee = getCallback(iteratee, thisArg, 4);
+        if (accumulator == null) {
+          if (isArr || isObject(object)) {
+            var Ctor = object.constructor;
+            if (isArr) {
+              accumulator = isArray(object) ? new Ctor() : [];
+            } else {
+              accumulator = baseCreate(isFunction(Ctor) ? Ctor.prototype : undefined);
+            }
+          } else {
+            accumulator = {};
+          }
+        }
+        (isArr ? arrayEach : baseForOwn)(object, function (value, index, object) {
+          return iteratee(accumulator, value, index, object);
+        });
+        return accumulator;
+      }
+      /**
+     * Creates an array of the own enumerable property values of `object`.
+     *
+     * **Note:** Non-object values are coerced to objects.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the array of property values.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.values(new Foo);
+     * // => [1, 2] (iteration order is not guaranteed)
+     *
+     * _.values('hi');
+     * // => ['h', 'i']
+     */
+      function values(object) {
+        return baseValues(object, keys(object));
+      }
+      /**
+     * Creates an array of the own and inherited enumerable property values
+     * of `object`.
+     *
+     * **Note:** Non-object values are coerced to objects.
+     *
+     * @static
+     * @memberOf _
+     * @category Object
+     * @param {Object} object The object to query.
+     * @returns {Array} Returns the array of property values.
+     * @example
+     *
+     * function Foo() {
+     *   this.a = 1;
+     *   this.b = 2;
+     * }
+     *
+     * Foo.prototype.c = 3;
+     *
+     * _.valuesIn(new Foo);
+     * // => [1, 2, 3] (iteration order is not guaranteed)
+     */
+      function valuesIn(object) {
+        return baseValues(object, keysIn(object));
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Checks if `n` is between `start` and up to but not including, `end`. If
+     * `end` is not specified it's set to `start` with `start` then set to `0`.
+     *
+     * @static
+     * @memberOf _
+     * @category Number
+     * @param {number} n The number to check.
+     * @param {number} [start=0] The start of the range.
+     * @param {number} end The end of the range.
+     * @returns {boolean} Returns `true` if `n` is in the range, else `false`.
+     * @example
+     *
+     * _.inRange(3, 2, 4);
+     * // => true
+     *
+     * _.inRange(4, 8);
+     * // => true
+     *
+     * _.inRange(4, 2);
+     * // => false
+     *
+     * _.inRange(2, 2);
+     * // => false
+     *
+     * _.inRange(1.2, 2);
+     * // => true
+     *
+     * _.inRange(5.2, 4);
+     * // => false
+     */
+      function inRange(value, start, end) {
+        start = +start || 0;
+        if (end === undefined) {
+          end = start;
+          start = 0;
+        } else {
+          end = +end || 0;
+        }
+        return value >= nativeMin(start, end) && value < nativeMax(start, end);
+      }
+      /**
+     * Produces a random number between `min` and `max` (inclusive). If only one
+     * argument is provided a number between `0` and the given number is returned.
+     * If `floating` is `true`, or either `min` or `max` are floats, a floating-point
+     * number is returned instead of an integer.
+     *
+     * @static
+     * @memberOf _
+     * @category Number
+     * @param {number} [min=0] The minimum possible value.
+     * @param {number} [max=1] The maximum possible value.
+     * @param {boolean} [floating] Specify returning a floating-point number.
+     * @returns {number} Returns the random number.
+     * @example
+     *
+     * _.random(0, 5);
+     * // => an integer between 0 and 5
+     *
+     * _.random(5);
+     * // => also an integer between 0 and 5
+     *
+     * _.random(5, true);
+     * // => a floating-point number between 0 and 5
+     *
+     * _.random(1.2, 5.2);
+     * // => a floating-point number between 1.2 and 5.2
+     */
+      function random(min, max, floating) {
+        if (floating && isIterateeCall(min, max, floating)) {
+          max = floating = undefined;
+        }
+        var noMin = min == null, noMax = max == null;
+        if (floating == null) {
+          if (noMax && typeof min == 'boolean') {
+            floating = min;
+            min = 1;
+          } else if (typeof max == 'boolean') {
+            floating = max;
+            noMax = true;
+          }
+        }
+        if (noMin && noMax) {
+          max = 1;
+          noMax = false;
+        }
+        min = +min || 0;
+        if (noMax) {
+          max = min;
+          min = 0;
+        } else {
+          max = +max || 0;
+        }
+        if (floating || min % 1 || max % 1) {
+          var rand = nativeRandom();
+          return nativeMin(min + rand * (max - min + parseFloat('1e-' + ((rand + '').length - 1))), max);
+        }
+        return baseRandom(min, max);
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Converts `string` to [camel case](https://en.wikipedia.org/wiki/CamelCase).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to convert.
+     * @returns {string} Returns the camel cased string.
+     * @example
+     *
+     * _.camelCase('Foo Bar');
+     * // => 'fooBar'
+     *
+     * _.camelCase('--foo-bar');
+     * // => 'fooBar'
+     *
+     * _.camelCase('__foo_bar__');
+     * // => 'fooBar'
+     */
+      var camelCase = createCompounder(function (result, word, index) {
+          word = word.toLowerCase();
+          return result + (index ? word.charAt(0).toUpperCase() + word.slice(1) : word);
+        });
+      /**
+     * Capitalizes the first character of `string`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to capitalize.
+     * @returns {string} Returns the capitalized string.
+     * @example
+     *
+     * _.capitalize('fred');
+     * // => 'Fred'
+     */
+      function capitalize(string) {
+        string = baseToString(string);
+        return string && string.charAt(0).toUpperCase() + string.slice(1);
+      }
+      /**
+     * Deburrs `string` by converting [latin-1 supplementary letters](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)
+     * to basic latin letters and removing [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to deburr.
+     * @returns {string} Returns the deburred string.
+     * @example
+     *
+     * _.deburr('déjà vu');
+     * // => 'deja vu'
+     */
+      function deburr(string) {
+        string = baseToString(string);
+        return string && string.replace(reLatin1, deburrLetter).replace(reComboMark, '');
+      }
+      /**
+     * Checks if `string` ends with the given target string.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to search.
+     * @param {string} [target] The string to search for.
+     * @param {number} [position=string.length] The position to search from.
+     * @returns {boolean} Returns `true` if `string` ends with `target`, else `false`.
+     * @example
+     *
+     * _.endsWith('abc', 'c');
+     * // => true
+     *
+     * _.endsWith('abc', 'b');
+     * // => false
+     *
+     * _.endsWith('abc', 'b', 2);
+     * // => true
+     */
+      function endsWith(string, target, position) {
+        string = baseToString(string);
+        target = target + '';
+        var length = string.length;
+        position = position === undefined ? length : nativeMin(position < 0 ? 0 : +position || 0, length);
+        position -= target.length;
+        return position >= 0 && string.indexOf(target, position) == position;
+      }
+      /**
+     * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to
+     * their corresponding HTML entities.
+     *
+     * **Note:** No other characters are escaped. To escape additional characters
+     * use a third-party library like [_he_](https://mths.be/he).
+     *
+     * Though the ">" character is escaped for symmetry, characters like
+     * ">" and "/" don't need escaping in HTML and have no special meaning
+     * unless they're part of a tag or unquoted attribute value.
+     * See [Mathias Bynens's article](https://mathiasbynens.be/notes/ambiguous-ampersands)
+     * (under "semi-related fun fact") for more details.
+     *
+     * Backticks are escaped because in Internet Explorer < 9, they can break out
+     * of attribute values or HTML comments. See [#59](https://html5sec.org/#59),
+     * [#102](https://html5sec.org/#102), [#108](https://html5sec.org/#108), and
+     * [#133](https://html5sec.org/#133) of the [HTML5 Security Cheatsheet](https://html5sec.org/)
+     * for more details.
+     *
+     * When working with HTML you should always [quote attribute values](http://wonko.com/post/html-escaping)
+     * to reduce XSS vectors.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to escape.
+     * @returns {string} Returns the escaped string.
+     * @example
+     *
+     * _.escape('fred, barney, & pebbles');
+     * // => 'fred, barney, &amp; pebbles'
+     */
+      function escape(string) {
+        // Reset `lastIndex` because in IE < 9 `String#replace` does not.
+        string = baseToString(string);
+        return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string;
+      }
+      /**
+     * Escapes the `RegExp` special characters "\", "/", "^", "$", ".", "|", "?",
+     * "*", "+", "(", ")", "[", "]", "{" and "}" in `string`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to escape.
+     * @returns {string} Returns the escaped string.
+     * @example
+     *
+     * _.escapeRegExp('[lodash](https://lodash.com/)');
+     * // => '\[lodash\]\(https:\/\/lodash\.com\/\)'
+     */
+      function escapeRegExp(string) {
+        string = baseToString(string);
+        return string && reHasRegExpChars.test(string) ? string.replace(reRegExpChars, escapeRegExpChar) : string || '(?:)';
+      }
+      /**
+     * Converts `string` to [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to convert.
+     * @returns {string} Returns the kebab cased string.
+     * @example
+     *
+     * _.kebabCase('Foo Bar');
+     * // => 'foo-bar'
+     *
+     * _.kebabCase('fooBar');
+     * // => 'foo-bar'
+     *
+     * _.kebabCase('__foo_bar__');
+     * // => 'foo-bar'
+     */
+      var kebabCase = createCompounder(function (result, word, index) {
+          return result + (index ? '-' : '') + word.toLowerCase();
+        });
+      /**
+     * Pads `string` on the left and right sides if it's shorter than `length`.
+     * Padding characters are truncated if they can't be evenly divided by `length`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to pad.
+     * @param {number} [length=0] The padding length.
+     * @param {string} [chars=' '] The string used as padding.
+     * @returns {string} Returns the padded string.
+     * @example
+     *
+     * _.pad('abc', 8);
+     * // => '  abc   '
+     *
+     * _.pad('abc', 8, '_-');
+     * // => '_-abc_-_'
+     *
+     * _.pad('abc', 3);
+     * // => 'abc'
+     */
+      function pad(string, length, chars) {
+        string = baseToString(string);
+        length = +length;
+        var strLength = string.length;
+        if (strLength >= length || !nativeIsFinite(length)) {
+          return string;
+        }
+        var mid = (length - strLength) / 2, leftLength = nativeFloor(mid), rightLength = nativeCeil(mid);
+        chars = createPadding('', rightLength, chars);
+        return chars.slice(0, leftLength) + string + chars;
+      }
+      /**
+     * Pads `string` on the left side if it's shorter than `length`. Padding
+     * characters are truncated if they exceed `length`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to pad.
+     * @param {number} [length=0] The padding length.
+     * @param {string} [chars=' '] The string used as padding.
+     * @returns {string} Returns the padded string.
+     * @example
+     *
+     * _.padLeft('abc', 6);
+     * // => '   abc'
+     *
+     * _.padLeft('abc', 6, '_-');
+     * // => '_-_abc'
+     *
+     * _.padLeft('abc', 3);
+     * // => 'abc'
+     */
+      var padLeft = createPadDir();
+      /**
+     * Pads `string` on the right side if it's shorter than `length`. Padding
+     * characters are truncated if they exceed `length`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to pad.
+     * @param {number} [length=0] The padding length.
+     * @param {string} [chars=' '] The string used as padding.
+     * @returns {string} Returns the padded string.
+     * @example
+     *
+     * _.padRight('abc', 6);
+     * // => 'abc   '
+     *
+     * _.padRight('abc', 6, '_-');
+     * // => 'abc_-_'
+     *
+     * _.padRight('abc', 3);
+     * // => 'abc'
+     */
+      var padRight = createPadDir(true);
+      /**
+     * Converts `string` to an integer of the specified radix. If `radix` is
+     * `undefined` or `0`, a `radix` of `10` is used unless `value` is a hexadecimal,
+     * in which case a `radix` of `16` is used.
+     *
+     * **Note:** This method aligns with the [ES5 implementation](https://es5.github.io/#E)
+     * of `parseInt`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} string The string to convert.
+     * @param {number} [radix] The radix to interpret `value` by.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {number} Returns the converted integer.
+     * @example
+     *
+     * _.parseInt('08');
+     * // => 8
+     *
+     * _.map(['6', '08', '10'], _.parseInt);
+     * // => [6, 8, 10]
+     */
+      function parseInt(string, radix, guard) {
+        // Firefox < 21 and Opera < 15 follow ES3 for `parseInt`.
+        // Chrome fails to trim leading <BOM> whitespace characters.
+        // See https://code.google.com/p/v8/issues/detail?id=3109 for more details.
+        if (guard ? isIterateeCall(string, radix, guard) : radix == null) {
+          radix = 0;
+        } else if (radix) {
+          radix = +radix;
+        }
+        string = trim(string);
+        return nativeParseInt(string, radix || (reHasHexPrefix.test(string) ? 16 : 10));
+      }
+      /**
+     * Repeats the given string `n` times.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to repeat.
+     * @param {number} [n=0] The number of times to repeat the string.
+     * @returns {string} Returns the repeated string.
+     * @example
+     *
+     * _.repeat('*', 3);
+     * // => '***'
+     *
+     * _.repeat('abc', 2);
+     * // => 'abcabc'
+     *
+     * _.repeat('abc', 0);
+     * // => ''
+     */
+      function repeat(string, n) {
+        var result = '';
+        string = baseToString(string);
+        n = +n;
+        if (n < 1 || !string || !nativeIsFinite(n)) {
+          return result;
+        }
+        // Leverage the exponentiation by squaring algorithm for a faster repeat.
+        // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+        do {
+          if (n % 2) {
+            result += string;
+          }
+          n = nativeFloor(n / 2);
+          string += string;
+        } while (n);
+        return result;
+      }
+      /**
+     * Converts `string` to [snake case](https://en.wikipedia.org/wiki/Snake_case).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to convert.
+     * @returns {string} Returns the snake cased string.
+     * @example
+     *
+     * _.snakeCase('Foo Bar');
+     * // => 'foo_bar'
+     *
+     * _.snakeCase('fooBar');
+     * // => 'foo_bar'
+     *
+     * _.snakeCase('--foo-bar');
+     * // => 'foo_bar'
+     */
+      var snakeCase = createCompounder(function (result, word, index) {
+          return result + (index ? '_' : '') + word.toLowerCase();
+        });
+      /**
+     * Converts `string` to [start case](https://en.wikipedia.org/wiki/Letter_case#Stylistic_or_specialised_usage).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to convert.
+     * @returns {string} Returns the start cased string.
+     * @example
+     *
+     * _.startCase('--foo-bar');
+     * // => 'Foo Bar'
+     *
+     * _.startCase('fooBar');
+     * // => 'Foo Bar'
+     *
+     * _.startCase('__foo_bar__');
+     * // => 'Foo Bar'
+     */
+      var startCase = createCompounder(function (result, word, index) {
+          return result + (index ? ' ' : '') + (word.charAt(0).toUpperCase() + word.slice(1));
+        });
+      /**
+     * Checks if `string` starts with the given target string.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to search.
+     * @param {string} [target] The string to search for.
+     * @param {number} [position=0] The position to search from.
+     * @returns {boolean} Returns `true` if `string` starts with `target`, else `false`.
+     * @example
+     *
+     * _.startsWith('abc', 'a');
+     * // => true
+     *
+     * _.startsWith('abc', 'b');
+     * // => false
+     *
+     * _.startsWith('abc', 'b', 1);
+     * // => true
+     */
+      function startsWith(string, target, position) {
+        string = baseToString(string);
+        position = position == null ? 0 : nativeMin(position < 0 ? 0 : +position || 0, string.length);
+        return string.lastIndexOf(target, position) == position;
+      }
+      /**
+     * Creates a compiled template function that can interpolate data properties
+     * in "interpolate" delimiters, HTML-escape interpolated data properties in
+     * "escape" delimiters, and execute JavaScript in "evaluate" delimiters. Data
+     * properties may be accessed as free variables in the template. If a setting
+     * object is provided it takes precedence over `_.templateSettings` values.
+     *
+     * **Note:** In the development build `_.template` utilizes
+     * [sourceURLs](http://www.html5rocks.com/en/tutorials/developertools/sourcemaps/#toc-sourceurl)
+     * for easier debugging.
+     *
+     * For more information on precompiling templates see
+     * [lodash's custom builds documentation](https://lodash.com/custom-builds).
+     *
+     * For more information on Chrome extension sandboxes see
+     * [Chrome's extensions documentation](https://developer.chrome.com/extensions/sandboxingEval).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The template string.
+     * @param {Object} [options] The options object.
+     * @param {RegExp} [options.escape] The HTML "escape" delimiter.
+     * @param {RegExp} [options.evaluate] The "evaluate" delimiter.
+     * @param {Object} [options.imports] An object to import into the template as free variables.
+     * @param {RegExp} [options.interpolate] The "interpolate" delimiter.
+     * @param {string} [options.sourceURL] The sourceURL of the template's compiled source.
+     * @param {string} [options.variable] The data object variable name.
+     * @param- {Object} [otherOptions] Enables the legacy `options` param signature.
+     * @returns {Function} Returns the compiled template function.
+     * @example
+     *
+     * // using the "interpolate" delimiter to create a compiled template
+     * var compiled = _.template('hello <%= user %>!');
+     * compiled({ 'user': 'fred' });
+     * // => 'hello fred!'
+     *
+     * // using the HTML "escape" delimiter to escape data property values
+     * var compiled = _.template('<b><%- value %></b>');
+     * compiled({ 'value': '<script>' });
+     * // => '<b>&lt;script&gt;</b>'
+     *
+     * // using the "evaluate" delimiter to execute JavaScript and generate HTML
+     * var compiled = _.template('<% _.forEach(users, function(user) { %><li><%- user %></li><% }); %>');
+     * compiled({ 'users': ['fred', 'barney'] });
+     * // => '<li>fred</li><li>barney</li>'
+     *
+     * // using the internal `print` function in "evaluate" delimiters
+     * var compiled = _.template('<% print("hello " + user); %>!');
+     * compiled({ 'user': 'barney' });
+     * // => 'hello barney!'
+     *
+     * // using the ES delimiter as an alternative to the default "interpolate" delimiter
+     * var compiled = _.template('hello ${ user }!');
+     * compiled({ 'user': 'pebbles' });
+     * // => 'hello pebbles!'
+     *
+     * // using custom template delimiters
+     * _.templateSettings.interpolate = /{{([\s\S]+?)}}/g;
+     * var compiled = _.template('hello {{ user }}!');
+     * compiled({ 'user': 'mustache' });
+     * // => 'hello mustache!'
+     *
+     * // using backslashes to treat delimiters as plain text
+     * var compiled = _.template('<%= "\\<%- value %\\>" %>');
+     * compiled({ 'value': 'ignored' });
+     * // => '<%- value %>'
+     *
+     * // using the `imports` option to import `jQuery` as `jq`
+     * var text = '<% jq.each(users, function(user) { %><li><%- user %></li><% }); %>';
+     * var compiled = _.template(text, { 'imports': { 'jq': jQuery } });
+     * compiled({ 'users': ['fred', 'barney'] });
+     * // => '<li>fred</li><li>barney</li>'
+     *
+     * // using the `sourceURL` option to specify a custom sourceURL for the template
+     * var compiled = _.template('hello <%= user %>!', { 'sourceURL': '/basic/greeting.jst' });
+     * compiled(data);
+     * // => find the source of "greeting.jst" under the Sources tab or Resources panel of the web inspector
+     *
+     * // using the `variable` option to ensure a with-statement isn't used in the compiled template
+     * var compiled = _.template('hi <%= data.user %>!', { 'variable': 'data' });
+     * compiled.source;
+     * // => function(data) {
+     * //   var __t, __p = '';
+     * //   __p += 'hi ' + ((__t = ( data.user )) == null ? '' : __t) + '!';
+     * //   return __p;
+     * // }
+     *
+     * // using the `source` property to inline compiled templates for meaningful
+     * // line numbers in error messages and a stack trace
+     * fs.writeFileSync(path.join(cwd, 'jst.js'), '\
+     *   var JST = {\
+     *     "main": ' + _.template(mainText).source + '\
+     *   };\
+     * ');
+     */
+      function template(string, options, otherOptions) {
+        // Based on John Resig's `tmpl` implementation (http://ejohn.org/blog/javascript-micro-templating/)
+        // and Laura Doktorova's doT.js (https://github.com/olado/doT).
+        var settings = lodash.templateSettings;
+        if (otherOptions && isIterateeCall(string, options, otherOptions)) {
+          options = otherOptions = undefined;
+        }
+        string = baseToString(string);
+        options = assignWith(baseAssign({}, otherOptions || options), settings, assignOwnDefaults);
+        var imports = assignWith(baseAssign({}, options.imports), settings.imports, assignOwnDefaults), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys);
+        var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = '__p += \'';
+        // Compile the regexp to match each delimiter.
+        var reDelimiters = RegExp((options.escape || reNoMatch).source + '|' + interpolate.source + '|' + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + '|' + (options.evaluate || reNoMatch).source + '|$', 'g');
+        // Use a sourceURL for easier debugging.
+        var sourceURL = '//# sourceURL=' + ('sourceURL' in options ? options.sourceURL : 'lodash.templateSources[' + ++templateCounter + ']') + '\n';
+        string.replace(reDelimiters, function (match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) {
+          interpolateValue || (interpolateValue = esTemplateValue);
+          // Escape characters that can't be included in string literals.
+          source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar);
+          // Replace delimiters with snippets.
+          if (escapeValue) {
+            isEscaping = true;
+            source += '\' +\n__e(' + escapeValue + ') +\n\'';
+          }
+          if (evaluateValue) {
+            isEvaluating = true;
+            source += '\';\n' + evaluateValue + ';\n__p += \'';
+          }
+          if (interpolateValue) {
+            source += '\' +\n((__t = (' + interpolateValue + ')) == null ? \'\' : __t) +\n\'';
+          }
+          index = offset + match.length;
+          // The JS engine embedded in Adobe products requires returning the `match`
+          // string in order to produce the correct `offset` value.
+          return match;
+        });
+        source += '\';\n';
+        // If `variable` is not specified wrap a with-statement around the generated
+        // code to add the data object to the top of the scope chain.
+        var variable = options.variable;
+        if (!variable) {
+          source = 'with (obj) {\n' + source + '\n}\n';
+        }
+        // Cleanup code by stripping empty strings.
+        source = (isEvaluating ? source.replace(reEmptyStringLeading, '') : source).replace(reEmptyStringMiddle, '$1').replace(reEmptyStringTrailing, '$1;');
+        // Frame code as the function body.
+        source = 'function(' + (variable || 'obj') + ') {\n' + (variable ? '' : 'obj || (obj = {});\n') + 'var __t, __p = \'\'' + (isEscaping ? ', __e = _.escape' : '') + (isEvaluating ? ', __j = Array.prototype.join;\n' + 'function print() { __p += __j.call(arguments, \'\') }\n' : ';\n') + source + 'return __p\n}';
+        var result = attempt(function () {
+            return Function(importsKeys, sourceURL + 'return ' + source).apply(undefined, importsValues);
+          });
+        // Provide the compiled function's source by its `toString` method or
+        // the `source` property as a convenience for inlining compiled templates.
+        result.source = source;
+        if (isError(result)) {
+          throw result;
+        }
+        return result;
+      }
+      /**
+     * Removes leading and trailing whitespace or specified characters from `string`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to trim.
+     * @param {string} [chars=whitespace] The characters to trim.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {string} Returns the trimmed string.
+     * @example
+     *
+     * _.trim('  abc  ');
+     * // => 'abc'
+     *
+     * _.trim('-_-abc-_-', '_-');
+     * // => 'abc'
+     *
+     * _.map(['  foo  ', '  bar  '], _.trim);
+     * // => ['foo', 'bar']
+     */
+      function trim(string, chars, guard) {
+        var value = string;
+        string = baseToString(string);
+        if (!string) {
+          return string;
+        }
+        if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+          return string.slice(trimmedLeftIndex(string), trimmedRightIndex(string) + 1);
+        }
+        chars = chars + '';
+        return string.slice(charsLeftIndex(string, chars), charsRightIndex(string, chars) + 1);
+      }
+      /**
+     * Removes leading whitespace or specified characters from `string`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to trim.
+     * @param {string} [chars=whitespace] The characters to trim.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {string} Returns the trimmed string.
+     * @example
+     *
+     * _.trimLeft('  abc  ');
+     * // => 'abc  '
+     *
+     * _.trimLeft('-_-abc-_-', '_-');
+     * // => 'abc-_-'
+     */
+      function trimLeft(string, chars, guard) {
+        var value = string;
+        string = baseToString(string);
+        if (!string) {
+          return string;
+        }
+        if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+          return string.slice(trimmedLeftIndex(string));
+        }
+        return string.slice(charsLeftIndex(string, chars + ''));
+      }
+      /**
+     * Removes trailing whitespace or specified characters from `string`.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to trim.
+     * @param {string} [chars=whitespace] The characters to trim.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {string} Returns the trimmed string.
+     * @example
+     *
+     * _.trimRight('  abc  ');
+     * // => '  abc'
+     *
+     * _.trimRight('-_-abc-_-', '_-');
+     * // => '-_-abc'
+     */
+      function trimRight(string, chars, guard) {
+        var value = string;
+        string = baseToString(string);
+        if (!string) {
+          return string;
+        }
+        if (guard ? isIterateeCall(value, chars, guard) : chars == null) {
+          return string.slice(0, trimmedRightIndex(string) + 1);
+        }
+        return string.slice(0, charsRightIndex(string, chars + '') + 1);
+      }
+      /**
+     * Truncates `string` if it's longer than the given maximum string length.
+     * The last characters of the truncated string are replaced with the omission
+     * string which defaults to "...".
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to truncate.
+     * @param {Object|number} [options] The options object or maximum string length.
+     * @param {number} [options.length=30] The maximum string length.
+     * @param {string} [options.omission='...'] The string to indicate text is omitted.
+     * @param {RegExp|string} [options.separator] The separator pattern to truncate to.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {string} Returns the truncated string.
+     * @example
+     *
+     * _.trunc('hi-diddly-ho there, neighborino');
+     * // => 'hi-diddly-ho there, neighbo...'
+     *
+     * _.trunc('hi-diddly-ho there, neighborino', 24);
+     * // => 'hi-diddly-ho there, n...'
+     *
+     * _.trunc('hi-diddly-ho there, neighborino', {
+     *   'length': 24,
+     *   'separator': ' '
+     * });
+     * // => 'hi-diddly-ho there,...'
+     *
+     * _.trunc('hi-diddly-ho there, neighborino', {
+     *   'length': 24,
+     *   'separator': /,? +/
+     * });
+     * // => 'hi-diddly-ho there...'
+     *
+     * _.trunc('hi-diddly-ho there, neighborino', {
+     *   'omission': ' [...]'
+     * });
+     * // => 'hi-diddly-ho there, neig [...]'
+     */
+      function trunc(string, options, guard) {
+        if (guard && isIterateeCall(string, options, guard)) {
+          options = undefined;
+        }
+        var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION;
+        if (options != null) {
+          if (isObject(options)) {
+            var separator = 'separator' in options ? options.separator : separator;
+            length = 'length' in options ? +options.length || 0 : length;
+            omission = 'omission' in options ? baseToString(options.omission) : omission;
+          } else {
+            length = +options || 0;
+          }
+        }
+        string = baseToString(string);
+        if (length >= string.length) {
+          return string;
+        }
+        var end = length - omission.length;
+        if (end < 1) {
+          return omission;
+        }
+        var result = string.slice(0, end);
+        if (separator == null) {
+          return result + omission;
+        }
+        if (isRegExp(separator)) {
+          if (string.slice(end).search(separator)) {
+            var match, newEnd, substring = string.slice(0, end);
+            if (!separator.global) {
+              separator = RegExp(separator.source, (reFlags.exec(separator) || '') + 'g');
+            }
+            separator.lastIndex = 0;
+            while (match = separator.exec(substring)) {
+              newEnd = match.index;
+            }
+            result = result.slice(0, newEnd == null ? end : newEnd);
+          }
+        } else if (string.indexOf(separator, end) != end) {
+          var index = result.lastIndexOf(separator);
+          if (index > -1) {
+            result = result.slice(0, index);
+          }
+        }
+        return result + omission;
+      }
+      /**
+     * The inverse of `_.escape`; this method converts the HTML entities
+     * `&amp;`, `&lt;`, `&gt;`, `&quot;`, `&#39;`, and `&#96;` in `string` to their
+     * corresponding characters.
+     *
+     * **Note:** No other HTML entities are unescaped. To unescape additional HTML
+     * entities use a third-party library like [_he_](https://mths.be/he).
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to unescape.
+     * @returns {string} Returns the unescaped string.
+     * @example
+     *
+     * _.unescape('fred, barney, &amp; pebbles');
+     * // => 'fred, barney, & pebbles'
+     */
+      function unescape(string) {
+        string = baseToString(string);
+        return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string;
+      }
+      /**
+     * Splits `string` into an array of its words.
+     *
+     * @static
+     * @memberOf _
+     * @category String
+     * @param {string} [string=''] The string to inspect.
+     * @param {RegExp|string} [pattern] The pattern to match words.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Array} Returns the words of `string`.
+     * @example
+     *
+     * _.words('fred, barney, & pebbles');
+     * // => ['fred', 'barney', 'pebbles']
+     *
+     * _.words('fred, barney, & pebbles', /[^, ]+/g);
+     * // => ['fred', 'barney', '&', 'pebbles']
+     */
+      function words(string, pattern, guard) {
+        if (guard && isIterateeCall(string, pattern, guard)) {
+          pattern = undefined;
+        }
+        string = baseToString(string);
+        return string.match(pattern || reWords) || [];
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Attempts to invoke `func`, returning either the result or the caught error
+     * object. Any additional arguments are provided to `func` when it's invoked.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Function} func The function to attempt.
+     * @returns {*} Returns the `func` result or error object.
+     * @example
+     *
+     * // avoid throwing errors for invalid selectors
+     * var elements = _.attempt(function(selector) {
+     *   return document.querySelectorAll(selector);
+     * }, '>_>');
+     *
+     * if (_.isError(elements)) {
+     *   elements = [];
+     * }
+     */
+      var attempt = restParam(function (func, args) {
+          try {
+            return func.apply(undefined, args);
+          } catch (e) {
+            return isError(e) ? e : new Error(e);
+          }
+        });
+      /**
+     * Creates a function that invokes `func` with the `this` binding of `thisArg`
+     * and arguments of the created function. If `func` is a property name the
+     * created callback returns the property value for a given element. If `func`
+     * is an object the created callback returns `true` for elements that contain
+     * the equivalent object properties, otherwise it returns `false`.
+     *
+     * @static
+     * @memberOf _
+     * @alias iteratee
+     * @category Utility
+     * @param {*} [func=_.identity] The value to convert to a callback.
+     * @param {*} [thisArg] The `this` binding of `func`.
+     * @param- {Object} [guard] Enables use as a callback for functions like `_.map`.
+     * @returns {Function} Returns the callback.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 40 }
+     * ];
+     *
+     * // wrap to create custom callback shorthands
+     * _.callback = _.wrap(_.callback, function(callback, func, thisArg) {
+     *   var match = /^(.+?)__([gl]t)(.+)$/.exec(func);
+     *   if (!match) {
+     *     return callback(func, thisArg);
+     *   }
+     *   return function(object) {
+     *     return match[2] == 'gt'
+     *       ? object[match[1]] > match[3]
+     *       : object[match[1]] < match[3];
+     *   };
+     * });
+     *
+     * _.filter(users, 'age__gt36');
+     * // => [{ 'user': 'fred', 'age': 40 }]
+     */
+      function callback(func, thisArg, guard) {
+        if (guard && isIterateeCall(func, thisArg, guard)) {
+          thisArg = undefined;
+        }
+        return isObjectLike(func) ? matches(func) : baseCallback(func, thisArg);
+      }
+      /**
+     * Creates a function that returns `value`.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {*} value The value to return from the new function.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var object = { 'user': 'fred' };
+     * var getter = _.constant(object);
+     *
+     * getter() === object;
+     * // => true
+     */
+      function constant(value) {
+        return function () {
+          return value;
+        };
+      }
+      /**
+     * This method returns the first argument provided to it.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {*} value Any value.
+     * @returns {*} Returns `value`.
+     * @example
+     *
+     * var object = { 'user': 'fred' };
+     *
+     * _.identity(object) === object;
+     * // => true
+     */
+      function identity(value) {
+        return value;
+      }
+      /**
+     * Creates a function that performs a deep comparison between a given object
+     * and `source`, returning `true` if the given object has equivalent property
+     * values, else `false`.
+     *
+     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+     * numbers, `Object` objects, regexes, and strings. Objects are compared by
+     * their own, not inherited, enumerable properties. For comparing a single
+     * own or inherited property value see `_.matchesProperty`.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Object} source The object of property values to match.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36, 'active': true },
+     *   { 'user': 'fred',   'age': 40, 'active': false }
+     * ];
+     *
+     * _.filter(users, _.matches({ 'age': 40, 'active': false }));
+     * // => [{ 'user': 'fred', 'age': 40, 'active': false }]
+     */
+      function matches(source) {
+        return baseMatches(baseClone(source, true));
+      }
+      /**
+     * Creates a function that compares the property value of `path` on a given
+     * object to `value`.
+     *
+     * **Note:** This method supports comparing arrays, booleans, `Date` objects,
+     * numbers, `Object` objects, regexes, and strings. Objects are compared by
+     * their own, not inherited, enumerable properties.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Array|string} path The path of the property to get.
+     * @param {*} srcValue The value to match.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var users = [
+     *   { 'user': 'barney' },
+     *   { 'user': 'fred' }
+     * ];
+     *
+     * _.find(users, _.matchesProperty('user', 'fred'));
+     * // => { 'user': 'fred' }
+     */
+      function matchesProperty(path, srcValue) {
+        return baseMatchesProperty(path, baseClone(srcValue, true));
+      }
+      /**
+     * Creates a function that invokes the method at `path` on a given object.
+     * Any additional arguments are provided to the invoked method.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Array|string} path The path of the method to invoke.
+     * @param {...*} [args] The arguments to invoke the method with.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var objects = [
+     *   { 'a': { 'b': { 'c': _.constant(2) } } },
+     *   { 'a': { 'b': { 'c': _.constant(1) } } }
+     * ];
+     *
+     * _.map(objects, _.method('a.b.c'));
+     * // => [2, 1]
+     *
+     * _.invoke(_.sortBy(objects, _.method(['a', 'b', 'c'])), 'a.b.c');
+     * // => [1, 2]
+     */
+      var method = restParam(function (path, args) {
+          return function (object) {
+            return invokePath(object, path, args);
+          };
+        });
+      /**
+     * The opposite of `_.method`; this method creates a function that invokes
+     * the method at a given path on `object`. Any additional arguments are
+     * provided to the invoked method.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Object} object The object to query.
+     * @param {...*} [args] The arguments to invoke the method with.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var array = _.times(3, _.constant),
+     *     object = { 'a': array, 'b': array, 'c': array };
+     *
+     * _.map(['a[2]', 'c[0]'], _.methodOf(object));
+     * // => [2, 0]
+     *
+     * _.map([['a', '2'], ['c', '0']], _.methodOf(object));
+     * // => [2, 0]
+     */
+      var methodOf = restParam(function (object, args) {
+          return function (path) {
+            return invokePath(object, path, args);
+          };
+        });
+      /**
+     * Adds all own enumerable function properties of a source object to the
+     * destination object. If `object` is a function then methods are added to
+     * its prototype as well.
+     *
+     * **Note:** Use `_.runInContext` to create a pristine `lodash` function to
+     * avoid conflicts caused by modifying the original.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Function|Object} [object=lodash] The destination object.
+     * @param {Object} source The object of functions to add.
+     * @param {Object} [options] The options object.
+     * @param {boolean} [options.chain=true] Specify whether the functions added
+     *  are chainable.
+     * @returns {Function|Object} Returns `object`.
+     * @example
+     *
+     * function vowels(string) {
+     *   return _.filter(string, function(v) {
+     *     return /[aeiou]/i.test(v);
+     *   });
+     * }
+     *
+     * _.mixin({ 'vowels': vowels });
+     * _.vowels('fred');
+     * // => ['e']
+     *
+     * _('fred').vowels().value();
+     * // => ['e']
+     *
+     * _.mixin({ 'vowels': vowels }, { 'chain': false });
+     * _('fred').vowels();
+     * // => ['e']
+     */
+      function mixin(object, source, options) {
+        if (options == null) {
+          var isObj = isObject(source), props = isObj ? keys(source) : undefined, methodNames = props && props.length ? baseFunctions(source, props) : undefined;
+          if (!(methodNames ? methodNames.length : isObj)) {
+            methodNames = false;
+            options = source;
+            source = object;
+            object = this;
+          }
+        }
+        if (!methodNames) {
+          methodNames = baseFunctions(source, keys(source));
+        }
+        var chain = true, index = -1, isFunc = isFunction(object), length = methodNames.length;
+        if (options === false) {
+          chain = false;
+        } else if (isObject(options) && 'chain' in options) {
+          chain = options.chain;
+        }
+        while (++index < length) {
+          var methodName = methodNames[index], func = source[methodName];
+          object[methodName] = func;
+          if (isFunc) {
+            object.prototype[methodName] = function (func) {
+              return function () {
+                var chainAll = this.__chain__;
+                if (chain || chainAll) {
+                  var result = object(this.__wrapped__), actions = result.__actions__ = arrayCopy(this.__actions__);
+                  actions.push({
+                    'func': func,
+                    'args': arguments,
+                    'thisArg': object
+                  });
+                  result.__chain__ = chainAll;
+                  return result;
+                }
+                return func.apply(object, arrayPush([this.value()], arguments));
+              };
+            }(func);
+          }
+        }
+        return object;
+      }
+      /**
+     * Reverts the `_` variable to its previous value and returns a reference to
+     * the `lodash` function.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @returns {Function} Returns the `lodash` function.
+     * @example
+     *
+     * var lodash = _.noConflict();
+     */
+      function noConflict() {
+        root._ = oldDash;
+        return this;
+      }
+      /**
+     * A no-operation function that returns `undefined` regardless of the
+     * arguments it receives.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @example
+     *
+     * var object = { 'user': 'fred' };
+     *
+     * _.noop(object) === undefined;
+     * // => true
+     */
+      function noop() {
+      }
+      /**
+     * Creates a function that returns the property value at `path` on a
+     * given object.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Array|string} path The path of the property to get.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var objects = [
+     *   { 'a': { 'b': { 'c': 2 } } },
+     *   { 'a': { 'b': { 'c': 1 } } }
+     * ];
+     *
+     * _.map(objects, _.property('a.b.c'));
+     * // => [2, 1]
+     *
+     * _.pluck(_.sortBy(objects, _.property(['a', 'b', 'c'])), 'a.b.c');
+     * // => [1, 2]
+     */
+      function property(path) {
+        return isKey(path) ? baseProperty(path) : basePropertyDeep(path);
+      }
+      /**
+     * The opposite of `_.property`; this method creates a function that returns
+     * the property value at a given path on `object`.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {Object} object The object to query.
+     * @returns {Function} Returns the new function.
+     * @example
+     *
+     * var array = [0, 1, 2],
+     *     object = { 'a': array, 'b': array, 'c': array };
+     *
+     * _.map(['a[2]', 'c[0]'], _.propertyOf(object));
+     * // => [2, 0]
+     *
+     * _.map([['a', '2'], ['c', '0']], _.propertyOf(object));
+     * // => [2, 0]
+     */
+      function propertyOf(object) {
+        return function (path) {
+          return baseGet(object, toPath(path), path + '');
+        };
+      }
+      /**
+     * Creates an array of numbers (positive and/or negative) progressing from
+     * `start` up to, but not including, `end`. If `end` is not specified it's
+     * set to `start` with `start` then set to `0`. If `end` is less than `start`
+     * a zero-length range is created unless a negative `step` is specified.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {number} [start=0] The start of the range.
+     * @param {number} end The end of the range.
+     * @param {number} [step=1] The value to increment or decrement by.
+     * @returns {Array} Returns the new array of numbers.
+     * @example
+     *
+     * _.range(4);
+     * // => [0, 1, 2, 3]
+     *
+     * _.range(1, 5);
+     * // => [1, 2, 3, 4]
+     *
+     * _.range(0, 20, 5);
+     * // => [0, 5, 10, 15]
+     *
+     * _.range(0, -4, -1);
+     * // => [0, -1, -2, -3]
+     *
+     * _.range(1, 4, 0);
+     * // => [1, 1, 1]
+     *
+     * _.range(0);
+     * // => []
+     */
+      function range(start, end, step) {
+        if (step && isIterateeCall(start, end, step)) {
+          end = step = undefined;
+        }
+        start = +start || 0;
+        step = step == null ? 1 : +step || 0;
+        if (end == null) {
+          end = start;
+          start = 0;
+        } else {
+          end = +end || 0;
+        }
+        // Use `Array(length)` so engines like Chakra and V8 avoid slower modes.
+        // See https://youtu.be/XAqIpGU8ZZk#t=17m25s for more details.
+        var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result = Array(length);
+        while (++index < length) {
+          result[index] = start;
+          start += step;
+        }
+        return result;
+      }
+      /**
+     * Invokes the iteratee function `n` times, returning an array of the results
+     * of each invocation. The `iteratee` is bound to `thisArg` and invoked with
+     * one argument; (index).
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {number} n The number of times to invoke `iteratee`.
+     * @param {Function} [iteratee=_.identity] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {Array} Returns the array of results.
+     * @example
+     *
+     * var diceRolls = _.times(3, _.partial(_.random, 1, 6, false));
+     * // => [3, 6, 4]
+     *
+     * _.times(3, function(n) {
+     *   mage.castSpell(n);
+     * });
+     * // => invokes `mage.castSpell(n)` three times with `n` of `0`, `1`, and `2`
+     *
+     * _.times(3, function(n) {
+     *   this.cast(n);
+     * }, mage);
+     * // => also invokes `mage.castSpell(n)` three times
+     */
+      function times(n, iteratee, thisArg) {
+        n = nativeFloor(n);
+        // Exit early to avoid a JSC JIT bug in Safari 8
+        // where `Array(0)` is treated as `Array(1)`.
+        if (n < 1 || !nativeIsFinite(n)) {
+          return [];
+        }
+        var index = -1, result = Array(nativeMin(n, MAX_ARRAY_LENGTH));
+        iteratee = bindCallback(iteratee, thisArg, 1);
+        while (++index < n) {
+          if (index < MAX_ARRAY_LENGTH) {
+            result[index] = iteratee(index);
+          } else {
+            iteratee(index);
+          }
+        }
+        return result;
+      }
+      /**
+     * Generates a unique ID. If `prefix` is provided the ID is appended to it.
+     *
+     * @static
+     * @memberOf _
+     * @category Utility
+     * @param {string} [prefix] The value to prefix the ID with.
+     * @returns {string} Returns the unique ID.
+     * @example
+     *
+     * _.uniqueId('contact_');
+     * // => 'contact_104'
+     *
+     * _.uniqueId();
+     * // => '105'
+     */
+      function uniqueId(prefix) {
+        var id = ++idCounter;
+        return baseToString(prefix) + id;
+      }
+      /*------------------------------------------------------------------------*/
+      /**
+     * Adds two numbers.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {number} augend The first number to add.
+     * @param {number} addend The second number to add.
+     * @returns {number} Returns the sum.
+     * @example
+     *
+     * _.add(6, 4);
+     * // => 10
+     */
+      function add(augend, addend) {
+        return (+augend || 0) + (+addend || 0);
+      }
+      /**
+     * Calculates `n` rounded up to `precision`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {number} n The number to round up.
+     * @param {number} [precision=0] The precision to round up to.
+     * @returns {number} Returns the rounded up number.
+     * @example
+     *
+     * _.ceil(4.006);
+     * // => 5
+     *
+     * _.ceil(6.004, 2);
+     * // => 6.01
+     *
+     * _.ceil(6040, -2);
+     * // => 6100
+     */
+      var ceil = createRound('ceil');
+      /**
+     * Calculates `n` rounded down to `precision`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {number} n The number to round down.
+     * @param {number} [precision=0] The precision to round down to.
+     * @returns {number} Returns the rounded down number.
+     * @example
+     *
+     * _.floor(4.006);
+     * // => 4
+     *
+     * _.floor(0.046, 2);
+     * // => 0.04
+     *
+     * _.floor(4060, -2);
+     * // => 4000
+     */
+      var floor = createRound('floor');
+      /**
+     * Gets the maximum value of `collection`. If `collection` is empty or falsey
+     * `-Infinity` is returned. If an iteratee function is provided it's invoked
+     * for each value in `collection` to generate the criterion by which the value
+     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+     * arguments: (value, index, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {*} Returns the maximum value.
+     * @example
+     *
+     * _.max([4, 2, 8, 6]);
+     * // => 8
+     *
+     * _.max([]);
+     * // => -Infinity
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 40 }
+     * ];
+     *
+     * _.max(users, function(chr) {
+     *   return chr.age;
+     * });
+     * // => { 'user': 'fred', 'age': 40 }
+     *
+     * // using the `_.property` callback shorthand
+     * _.max(users, 'age');
+     * // => { 'user': 'fred', 'age': 40 }
+     */
+      var max = createExtremum(gt, NEGATIVE_INFINITY);
+      /**
+     * Gets the minimum value of `collection`. If `collection` is empty or falsey
+     * `Infinity` is returned. If an iteratee function is provided it's invoked
+     * for each value in `collection` to generate the criterion by which the value
+     * is ranked. The `iteratee` is bound to `thisArg` and invoked with three
+     * arguments: (value, index, collection).
+     *
+     * If a property name is provided for `iteratee` the created `_.property`
+     * style callback returns the property value of the given element.
+     *
+     * If a value is also provided for `thisArg` the created `_.matchesProperty`
+     * style callback returns `true` for elements that have a matching property
+     * value, else `false`.
+     *
+     * If an object is provided for `iteratee` the created `_.matches` style
+     * callback returns `true` for elements that have the properties of the given
+     * object, else `false`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {*} Returns the minimum value.
+     * @example
+     *
+     * _.min([4, 2, 8, 6]);
+     * // => 2
+     *
+     * _.min([]);
+     * // => Infinity
+     *
+     * var users = [
+     *   { 'user': 'barney', 'age': 36 },
+     *   { 'user': 'fred',   'age': 40 }
+     * ];
+     *
+     * _.min(users, function(chr) {
+     *   return chr.age;
+     * });
+     * // => { 'user': 'barney', 'age': 36 }
+     *
+     * // using the `_.property` callback shorthand
+     * _.min(users, 'age');
+     * // => { 'user': 'barney', 'age': 36 }
+     */
+      var min = createExtremum(lt, POSITIVE_INFINITY);
+      /**
+     * Calculates `n` rounded to `precision`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {number} n The number to round.
+     * @param {number} [precision=0] The precision to round to.
+     * @returns {number} Returns the rounded number.
+     * @example
+     *
+     * _.round(4.006);
+     * // => 4
+     *
+     * _.round(4.006, 2);
+     * // => 4.01
+     *
+     * _.round(4060, -2);
+     * // => 4100
+     */
+      var round = createRound('round');
+      /**
+     * Gets the sum of the values in `collection`.
+     *
+     * @static
+     * @memberOf _
+     * @category Math
+     * @param {Array|Object|string} collection The collection to iterate over.
+     * @param {Function|Object|string} [iteratee] The function invoked per iteration.
+     * @param {*} [thisArg] The `this` binding of `iteratee`.
+     * @returns {number} Returns the sum.
+     * @example
+     *
+     * _.sum([4, 6]);
+     * // => 10
+     *
+     * _.sum({ 'a': 4, 'b': 6 });
+     * // => 10
+     *
+     * var objects = [
+     *   { 'n': 4 },
+     *   { 'n': 6 }
+     * ];
+     *
+     * _.sum(objects, function(object) {
+     *   return object.n;
+     * });
+     * // => 10
+     *
+     * // using the `_.property` callback shorthand
+     * _.sum(objects, 'n');
+     * // => 10
+     */
+      function sum(collection, iteratee, thisArg) {
+        if (thisArg && isIterateeCall(collection, iteratee, thisArg)) {
+          iteratee = undefined;
+        }
+        iteratee = getCallback(iteratee, thisArg, 3);
+        return iteratee.length == 1 ? arraySum(isArray(collection) ? collection : toIterable(collection), iteratee) : baseSum(collection, iteratee);
+      }
+      /*------------------------------------------------------------------------*/
+      // Ensure wrappers are instances of `baseLodash`.
+      lodash.prototype = baseLodash.prototype;
+      LodashWrapper.prototype = baseCreate(baseLodash.prototype);
+      LodashWrapper.prototype.constructor = LodashWrapper;
+      LazyWrapper.prototype = baseCreate(baseLodash.prototype);
+      LazyWrapper.prototype.constructor = LazyWrapper;
+      // Add functions to the `Map` cache.
+      MapCache.prototype['delete'] = mapDelete;
+      MapCache.prototype.get = mapGet;
+      MapCache.prototype.has = mapHas;
+      MapCache.prototype.set = mapSet;
+      // Add functions to the `Set` cache.
+      SetCache.prototype.push = cachePush;
+      // Assign cache to `_.memoize`.
+      memoize.Cache = MapCache;
+      // Add functions that return wrapped values when chaining.
+      lodash.after = after;
+      lodash.ary = ary;
+      lodash.assign = assign;
+      lodash.at = at;
+      lodash.before = before;
+      lodash.bind = bind;
+      lodash.bindAll = bindAll;
+      lodash.bindKey = bindKey;
+      lodash.callback = callback;
+      lodash.chain = chain;
+      lodash.chunk = chunk;
+      lodash.compact = compact;
+      lodash.constant = constant;
+      lodash.countBy = countBy;
+      lodash.create = create;
+      lodash.curry = curry;
+      lodash.curryRight = curryRight;
+      lodash.debounce = debounce;
+      lodash.defaults = defaults;
+      lodash.defaultsDeep = defaultsDeep;
+      lodash.defer = defer;
+      lodash.delay = delay;
+      lodash.difference = difference;
+      lodash.drop = drop;
+      lodash.dropRight = dropRight;
+      lodash.dropRightWhile = dropRightWhile;
+      lodash.dropWhile = dropWhile;
+      lodash.fill = fill;
+      lodash.filter = filter;
+      lodash.flatten = flatten;
+      lodash.flattenDeep = flattenDeep;
+      lodash.flow = flow;
+      lodash.flowRight = flowRight;
+      lodash.forEach = forEach;
+      lodash.forEachRight = forEachRight;
+      lodash.forIn = forIn;
+      lodash.forInRight = forInRight;
+      lodash.forOwn = forOwn;
+      lodash.forOwnRight = forOwnRight;
+      lodash.functions = functions;
+      lodash.groupBy = groupBy;
+      lodash.indexBy = indexBy;
+      lodash.initial = initial;
+      lodash.intersection = intersection;
+      lodash.invert = invert;
+      lodash.invoke = invoke;
+      lodash.keys = keys;
+      lodash.keysIn = keysIn;
+      lodash.map = map;
+      lodash.mapKeys = mapKeys;
+      lodash.mapValues = mapValues;
+      lodash.matches = matches;
+      lodash.matchesProperty = matchesProperty;
+      lodash.memoize = memoize;
+      lodash.merge = merge;
+      lodash.method = method;
+      lodash.methodOf = methodOf;
+      lodash.mixin = mixin;
+      lodash.modArgs = modArgs;
+      lodash.negate = negate;
+      lodash.omit = omit;
+      lodash.once = once;
+      lodash.pairs = pairs;
+      lodash.partial = partial;
+      lodash.partialRight = partialRight;
+      lodash.partition = partition;
+      lodash.pick = pick;
+      lodash.pluck = pluck;
+      lodash.property = property;
+      lodash.propertyOf = propertyOf;
+      lodash.pull = pull;
+      lodash.pullAt = pullAt;
+      lodash.range = range;
+      lodash.rearg = rearg;
+      lodash.reject = reject;
+      lodash.remove = remove;
+      lodash.rest = rest;
+      lodash.restParam = restParam;
+      lodash.set = set;
+      lodash.shuffle = shuffle;
+      lodash.slice = slice;
+      lodash.sortBy = sortBy;
+      lodash.sortByAll = sortByAll;
+      lodash.sortByOrder = sortByOrder;
+      lodash.spread = spread;
+      lodash.take = take;
+      lodash.takeRight = takeRight;
+      lodash.takeRightWhile = takeRightWhile;
+      lodash.takeWhile = takeWhile;
+      lodash.tap = tap;
+      lodash.throttle = throttle;
+      lodash.thru = thru;
+      lodash.times = times;
+      lodash.toArray = toArray;
+      lodash.toPlainObject = toPlainObject;
+      lodash.transform = transform;
+      lodash.union = union;
+      lodash.uniq = uniq;
+      lodash.unzip = unzip;
+      lodash.unzipWith = unzipWith;
+      lodash.values = values;
+      lodash.valuesIn = valuesIn;
+      lodash.where = where;
+      lodash.without = without;
+      lodash.wrap = wrap;
+      lodash.xor = xor;
+      lodash.zip = zip;
+      lodash.zipObject = zipObject;
+      lodash.zipWith = zipWith;
+      // Add aliases.
+      lodash.backflow = flowRight;
+      lodash.collect = map;
+      lodash.compose = flowRight;
+      lodash.each = forEach;
+      lodash.eachRight = forEachRight;
+      lodash.extend = assign;
+      lodash.iteratee = callback;
+      lodash.methods = functions;
+      lodash.object = zipObject;
+      lodash.select = filter;
+      lodash.tail = rest;
+      lodash.unique = uniq;
+      // Add functions to `lodash.prototype`.
+      mixin(lodash, lodash);
+      /*------------------------------------------------------------------------*/
+      // Add functions that return unwrapped values when chaining.
+      lodash.add = add;
+      lodash.attempt = attempt;
+      lodash.camelCase = camelCase;
+      lodash.capitalize = capitalize;
+      lodash.ceil = ceil;
+      lodash.clone = clone;
+      lodash.cloneDeep = cloneDeep;
+      lodash.deburr = deburr;
+      lodash.endsWith = endsWith;
+      lodash.escape = escape;
+      lodash.escapeRegExp = escapeRegExp;
+      lodash.every = every;
+      lodash.find = find;
+      lodash.findIndex = findIndex;
+      lodash.findKey = findKey;
+      lodash.findLast = findLast;
+      lodash.findLastIndex = findLastIndex;
+      lodash.findLastKey = findLastKey;
+      lodash.findWhere = findWhere;
+      lodash.first = first;
+      lodash.floor = floor;
+      lodash.get = get;
+      lodash.gt = gt;
+      lodash.gte = gte;
+      lodash.has = has;
+      lodash.identity = identity;
+      lodash.includes = includes;
+      lodash.indexOf = indexOf;
+      lodash.inRange = inRange;
+      lodash.isArguments = isArguments;
+      lodash.isArray = isArray;
+      lodash.isBoolean = isBoolean;
+      lodash.isDate = isDate;
+      lodash.isElement = isElement;
+      lodash.isEmpty = isEmpty;
+      lodash.isEqual = isEqual;
+      lodash.isError = isError;
+      lodash.isFinite = isFinite;
+      lodash.isFunction = isFunction;
+      lodash.isMatch = isMatch;
+      lodash.isNaN = isNaN;
+      lodash.isNative = isNative;
+      lodash.isNull = isNull;
+      lodash.isNumber = isNumber;
+      lodash.isObject = isObject;
+      lodash.isPlainObject = isPlainObject;
+      lodash.isRegExp = isRegExp;
+      lodash.isString = isString;
+      lodash.isTypedArray = isTypedArray;
+      lodash.isUndefined = isUndefined;
+      lodash.kebabCase = kebabCase;
+      lodash.last = last;
+      lodash.lastIndexOf = lastIndexOf;
+      lodash.lt = lt;
+      lodash.lte = lte;
+      lodash.max = max;
+      lodash.min = min;
+      lodash.noConflict = noConflict;
+      lodash.noop = noop;
+      lodash.now = now;
+      lodash.pad = pad;
+      lodash.padLeft = padLeft;
+      lodash.padRight = padRight;
+      lodash.parseInt = parseInt;
+      lodash.random = random;
+      lodash.reduce = reduce;
+      lodash.reduceRight = reduceRight;
+      lodash.repeat = repeat;
+      lodash.result = result;
+      lodash.round = round;
+      lodash.runInContext = runInContext;
+      lodash.size = size;
+      lodash.snakeCase = snakeCase;
+      lodash.some = some;
+      lodash.sortedIndex = sortedIndex;
+      lodash.sortedLastIndex = sortedLastIndex;
+      lodash.startCase = startCase;
+      lodash.startsWith = startsWith;
+      lodash.sum = sum;
+      lodash.template = template;
+      lodash.trim = trim;
+      lodash.trimLeft = trimLeft;
+      lodash.trimRight = trimRight;
+      lodash.trunc = trunc;
+      lodash.unescape = unescape;
+      lodash.uniqueId = uniqueId;
+      lodash.words = words;
+      // Add aliases.
+      lodash.all = every;
+      lodash.any = some;
+      lodash.contains = includes;
+      lodash.eq = isEqual;
+      lodash.detect = find;
+      lodash.foldl = reduce;
+      lodash.foldr = reduceRight;
+      lodash.head = first;
+      lodash.include = includes;
+      lodash.inject = reduce;
+      mixin(lodash, function () {
+        var source = {};
+        baseForOwn(lodash, function (func, methodName) {
+          if (!lodash.prototype[methodName]) {
+            source[methodName] = func;
+          }
+        });
+        return source;
+      }(), false);
+      /*------------------------------------------------------------------------*/
+      // Add functions capable of returning wrapped and unwrapped values when chaining.
+      lodash.sample = sample;
+      lodash.prototype.sample = function (n) {
+        if (!this.__chain__ && n == null) {
+          return sample(this.value());
+        }
+        return this.thru(function (value) {
+          return sample(value, n);
+        });
+      };
+      /*------------------------------------------------------------------------*/
+      /**
+     * The semantic version number.
+     *
+     * @static
+     * @memberOf _
+     * @type string
+     */
+      lodash.VERSION = VERSION;
+      // Assign default placeholders.
+      arrayEach([
+        'bind',
+        'bindKey',
+        'curry',
+        'curryRight',
+        'partial',
+        'partialRight'
+      ], function (methodName) {
+        lodash[methodName].placeholder = lodash;
+      });
+      // Add `LazyWrapper` methods for `_.drop` and `_.take` variants.
+      arrayEach([
+        'drop',
+        'take'
+      ], function (methodName, index) {
+        LazyWrapper.prototype[methodName] = function (n) {
+          var filtered = this.__filtered__;
+          if (filtered && !index) {
+            return new LazyWrapper(this);
+          }
+          n = n == null ? 1 : nativeMax(nativeFloor(n) || 0, 0);
+          var result = this.clone();
+          if (filtered) {
+            result.__takeCount__ = nativeMin(result.__takeCount__, n);
+          } else {
+            result.__views__.push({
+              'size': n,
+              'type': methodName + (result.__dir__ < 0 ? 'Right' : '')
+            });
+          }
+          return result;
+        };
+        LazyWrapper.prototype[methodName + 'Right'] = function (n) {
+          return this.reverse()[methodName](n).reverse();
+        };
+      });
+      // Add `LazyWrapper` methods that accept an `iteratee` value.
+      arrayEach([
+        'filter',
+        'map',
+        'takeWhile'
+      ], function (methodName, index) {
+        var type = index + 1, isFilter = type != LAZY_MAP_FLAG;
+        LazyWrapper.prototype[methodName] = function (iteratee, thisArg) {
+          var result = this.clone();
+          result.__iteratees__.push({
+            'iteratee': getCallback(iteratee, thisArg, 1),
+            'type': type
+          });
+          result.__filtered__ = result.__filtered__ || isFilter;
+          return result;
+        };
+      });
+      // Add `LazyWrapper` methods for `_.first` and `_.last`.
+      arrayEach([
+        'first',
+        'last'
+      ], function (methodName, index) {
+        var takeName = 'take' + (index ? 'Right' : '');
+        LazyWrapper.prototype[methodName] = function () {
+          return this[takeName](1).value()[0];
+        };
+      });
+      // Add `LazyWrapper` methods for `_.initial` and `_.rest`.
+      arrayEach([
+        'initial',
+        'rest'
+      ], function (methodName, index) {
+        var dropName = 'drop' + (index ? '' : 'Right');
+        LazyWrapper.prototype[methodName] = function () {
+          return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1);
+        };
+      });
+      // Add `LazyWrapper` methods for `_.pluck` and `_.where`.
+      arrayEach([
+        'pluck',
+        'where'
+      ], function (methodName, index) {
+        var operationName = index ? 'filter' : 'map', createCallback = index ? baseMatches : property;
+        LazyWrapper.prototype[methodName] = function (value) {
+          return this[operationName](createCallback(value));
+        };
+      });
+      LazyWrapper.prototype.compact = function () {
+        return this.filter(identity);
+      };
+      LazyWrapper.prototype.reject = function (predicate, thisArg) {
+        predicate = getCallback(predicate, thisArg, 1);
+        return this.filter(function (value) {
+          return !predicate(value);
+        });
+      };
+      LazyWrapper.prototype.slice = function (start, end) {
+        start = start == null ? 0 : +start || 0;
+        var result = this;
+        if (result.__filtered__ && (start > 0 || end < 0)) {
+          return new LazyWrapper(result);
+        }
+        if (start < 0) {
+          result = result.takeRight(-start);
+        } else if (start) {
+          result = result.drop(start);
+        }
+        if (end !== undefined) {
+          end = +end || 0;
+          result = end < 0 ? result.dropRight(-end) : result.take(end - start);
+        }
+        return result;
+      };
+      LazyWrapper.prototype.takeRightWhile = function (predicate, thisArg) {
+        return this.reverse().takeWhile(predicate, thisArg).reverse();
+      };
+      LazyWrapper.prototype.toArray = function () {
+        return this.take(POSITIVE_INFINITY);
+      };
+      // Add `LazyWrapper` methods to `lodash.prototype`.
+      baseForOwn(LazyWrapper.prototype, function (func, methodName) {
+        var checkIteratee = /^(?:filter|map|reject)|While$/.test(methodName), retUnwrapped = /^(?:first|last)$/.test(methodName), lodashFunc = lodash[retUnwrapped ? 'take' + (methodName == 'last' ? 'Right' : '') : methodName];
+        if (!lodashFunc) {
+          return;
+        }
+        lodash.prototype[methodName] = function () {
+          var args = retUnwrapped ? [1] : arguments, chainAll = this.__chain__, value = this.__wrapped__, isHybrid = !!this.__actions__.length, isLazy = value instanceof LazyWrapper, iteratee = args[0], useLazy = isLazy || isArray(value);
+          if (useLazy && checkIteratee && typeof iteratee == 'function' && iteratee.length != 1) {
+            // Avoid lazy use if the iteratee has a "length" value other than `1`.
+            isLazy = useLazy = false;
+          }
+          var interceptor = function (value) {
+            return retUnwrapped && chainAll ? lodashFunc(value, 1)[0] : lodashFunc.apply(undefined, arrayPush([value], args));
+          };
+          var action = {
+              'func': thru,
+              'args': [interceptor],
+              'thisArg': undefined
+            }, onlyLazy = isLazy && !isHybrid;
+          if (retUnwrapped && !chainAll) {
+            if (onlyLazy) {
+              value = value.clone();
+              value.__actions__.push(action);
+              return func.call(value);
+            }
+            return lodashFunc.call(undefined, this.value())[0];
+          }
+          if (!retUnwrapped && useLazy) {
+            value = onlyLazy ? value : new LazyWrapper(this);
+            var result = func.apply(value, args);
+            result.__actions__.push(action);
+            return new LodashWrapper(result, chainAll);
+          }
+          return this.thru(interceptor);
+        };
+      });
+      // Add `Array` and `String` methods to `lodash.prototype`.
+      arrayEach([
+        'join',
+        'pop',
+        'push',
+        'replace',
+        'shift',
+        'sort',
+        'splice',
+        'split',
+        'unshift'
+      ], function (methodName) {
+        var func = (/^(?:replace|split)$/.test(methodName) ? stringProto : arrayProto)[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? 'tap' : 'thru', retUnwrapped = /^(?:join|pop|replace|shift)$/.test(methodName);
+        lodash.prototype[methodName] = function () {
+          var args = arguments;
+          if (retUnwrapped && !this.__chain__) {
+            return func.apply(this.value(), args);
+          }
+          return this[chainName](function (value) {
+            return func.apply(value, args);
+          });
+        };
+      });
+      // Map minified function names to their real names.
+      baseForOwn(LazyWrapper.prototype, function (func, methodName) {
+        var lodashFunc = lodash[methodName];
+        if (lodashFunc) {
+          var key = lodashFunc.name + '', names = realNames[key] || (realNames[key] = []);
+          names.push({
+            'name': methodName,
+            'func': lodashFunc
+          });
+        }
+      });
+      realNames[createHybridWrapper(undefined, BIND_KEY_FLAG).name] = [{
+          'name': 'wrapper',
+          'func': undefined
+        }];
+      // Add functions to the lazy wrapper.
+      LazyWrapper.prototype.clone = lazyClone;
+      LazyWrapper.prototype.reverse = lazyReverse;
+      LazyWrapper.prototype.value = lazyValue;
+      // Add chaining functions to the `lodash` wrapper.
+      lodash.prototype.chain = wrapperChain;
+      lodash.prototype.commit = wrapperCommit;
+      lodash.prototype.concat = wrapperConcat;
+      lodash.prototype.plant = wrapperPlant;
+      lodash.prototype.reverse = wrapperReverse;
+      lodash.prototype.toString = wrapperToString;
+      lodash.prototype.run = lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue;
+      // Add function aliases to the `lodash` wrapper.
+      lodash.prototype.collect = lodash.prototype.map;
+      lodash.prototype.head = lodash.prototype.first;
+      lodash.prototype.select = lodash.prototype.filter;
+      lodash.prototype.tail = lodash.prototype.rest;
+      return lodash;
+    }
+    /*--------------------------------------------------------------------------*/
+    // Export lodash.
+    var _ = runInContext();
+    // Some AMD build optimizers like r.js check for condition patterns like the following:
+    if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) {
+      // Define as an anonymous module so, through path mapping, it can be
+      // referenced as the "underscore" module.
+      define(function () {
+        return _;
+      });
+    }  // Check for `exports` after `define` in case a build optimizer adds an `exports` object.
+    else if (freeExports && freeModule) {
+      // Export for Node.js or RingoJS.
+      if (moduleExports) {
+        (freeModule.exports = _)._ = _;
+      }  // Export for Rhino with CommonJS support.
+      else {
+        freeExports._ = _;
+      }
+    }
+    $provide.constant('lodash', _);
+  }
+]);
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.min.js b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.min.js
new file mode 100644
index 0000000..4989a9e
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/build/ng-lodash.min.js
@@ -0,0 +1,11 @@
+/**
+ * @license
+ * lodash 3.10.1 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modern exports="amd,commonjs,node" iife="angular.module('ngLodash', []).constant('lodash', null).config(function ($provide) { %output% $provide.constant('lodash', _);});" --output build/ng-lodash.js`
+ * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
+ * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license <https://lodash.com/license>
+ */
+angular.module("ngLodash",[]).constant("lodash",null).config(["$provide",function(a){function b(a,b){if(a!==b){var c=null===a,d=a===x,e=a===a,f=null===b,g=b===x,h=b===b;if(a>b&&!f||!e||c&&!g&&h||d&&h)return 1;if(b>a&&!c||!h||f&&!d&&e||g&&e)return-1}return 0}function c(a,b,c){for(var d=a.length,e=c?d:-1;c?e--:++e<d;)if(b(a[e],e,a))return e;return-1}function d(a,b,c){if(b!==b)return o(a,c);for(var d=c-1,e=a.length;++d<e;)if(a[d]===b)return d;return-1}function e(a){return"function"==typeof a||!1}function f(a){return null==a?"":a+""}function g(a,b){for(var c=-1,d=a.length;++c<d&&b.indexOf(a.charAt(c))>-1;);return c}function h(a,b){for(var c=a.length;c--&&b.indexOf(a.charAt(c))>-1;);return c}function i(a,c){return b(a.criteria,c.criteria)||a.index-c.index}function j(a,c,d){for(var e=-1,f=a.criteria,g=c.criteria,h=f.length,i=d.length;++e<h;){var j=b(f[e],g[e]);if(j){if(e>=i)return j;var k=d[e];return j*("asc"===k||k===!0?1:-1)}}return a.index-c.index}function k(a){return Qa[a]}function l(a){return Ra[a]}function m(a,b,c){return b?a=Ua[a]:c&&(a=Va[a]),"\\"+a}function n(a){return"\\"+Va[a]}function o(a,b,c){for(var d=a.length,e=b+(c?0:-1);c?e--:++e<d;){var f=a[e];if(f!==f)return e}return-1}function p(a){return!!a&&"object"==typeof a}function q(a){return 160>=a&&a>=9&&13>=a||32==a||160==a||5760==a||6158==a||a>=8192&&(8202>=a||8232==a||8233==a||8239==a||8287==a||12288==a||65279==a)}function r(a,b){for(var c=-1,d=a.length,e=-1,f=[];++c<d;)a[c]===b&&(a[c]=Q,f[++e]=c);return f}function s(a,b){for(var c,d=-1,e=a.length,f=-1,g=[];++d<e;){var h=a[d],i=b?b(h,d,a):h;d&&c===i||(c=i,g[++f]=h)}return g}function t(a){for(var b=-1,c=a.length;++b<c&&q(a.charCodeAt(b)););return b}function u(a){for(var b=a.length;b--&&q(a.charCodeAt(b)););return b}function v(a){return Sa[a]}function w(a){function q(a){if(p(a)&&!Dh(a)&&!(a instanceof ba)){if(a instanceof _)return a;if(ag.call(a,"__chain__")&&ag.call(a,"__wrapped__"))return md(a)}return new _(a)}function X(){}function _(a,b,c){this.__wrapped__=a,this.__actions__=c||[],this.__chain__=!!b}function ba(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Bg,this.__views__=[]}function Qa(){var a=new ba(this.__wrapped__);return a.__actions__=cb(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=cb(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=cb(this.__views__),a}function Ra(){if(this.__filtered__){var a=new ba(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function Sa(){var a=this.__wrapped__.value(),b=this.__dir__,c=Dh(a),d=0>b,e=c?a.length:0,f=Tc(0,e,this.__views__),g=f.start,h=f.end,i=h-g,j=d?h:g-1,k=this.__iteratees__,l=k.length,m=0,n=wg(i,this.__takeCount__);if(!c||M>e||e==i&&n==i)return cc(a,this.__actions__);var o=[];a:for(;i--&&n>m;){j+=b;for(var p=-1,q=a[j];++p<l;){var r=k[p],s=r.iteratee,t=r.type,u=s(q);if(t==O)q=u;else if(!u){if(t==N)continue a;break a}}o[m++]=q}return o}function Ta(){this.__data__={}}function Ua(a){return this.has(a)&&delete this.__data__[a]}function Va(a){return"__proto__"==a?x:this.__data__[a]}function Wa(a){return"__proto__"!=a&&ag.call(this.__data__,a)}function Xa(a,b){return"__proto__"!=a&&(this.__data__[a]=b),this}function Ya(a){var b=a?a.length:0;for(this.data={hash:qg(null),set:new kg};b--;)this.push(a[b])}function Za(a,b){var c=a.data,d="string"==typeof b||He(b)?c.set.has(b):c.hash[b];return d?0:-1}function $a(a){var b=this.data;"string"==typeof a||He(a)?b.set.add(a):b.hash[a]=!0}function _a(a,b){for(var c=-1,d=a.length,e=-1,f=b.length,g=Of(d+f);++c<d;)g[c]=a[c];for(;++e<f;)g[c++]=b[e];return g}function cb(a,b){var c=-1,d=a.length;for(b||(b=Of(d));++c<d;)b[c]=a[c];return b}function db(a,b){for(var c=-1,d=a.length;++c<d&&b(a[c],c,a)!==!1;);return a}function eb(a,b){for(var c=a.length;c--&&b(a[c],c,a)!==!1;);return a}function fb(a,b){for(var c=-1,d=a.length;++c<d;)if(!b(a[c],c,a))return!1;return!0}function gb(a,b,c,d){for(var e=-1,f=a.length,g=d,h=g;++e<f;){var i=a[e],j=+b(i);c(j,g)&&(g=j,h=i)}return h}function hb(a,b){for(var c=-1,d=a.length,e=-1,f=[];++c<d;){var g=a[c];b(g,c,a)&&(f[++e]=g)}return f}function ib(a,b){for(var c=-1,d=a.length,e=Of(d);++c<d;)e[c]=b(a[c],c,a);return e}function jb(a,b){for(var c=-1,d=b.length,e=a.length;++c<d;)a[e+c]=b[c];return a}function kb(a,b,c,d){var e=-1,f=a.length;for(d&&f&&(c=a[++e]);++e<f;)c=b(c,a[e],e,a);return c}function lb(a,b,c,d){var e=a.length;for(d&&e&&(c=a[--e]);e--;)c=b(c,a[e],e,a);return c}function mb(a,b){for(var c=-1,d=a.length;++c<d;)if(b(a[c],c,a))return!0;return!1}function nb(a,b){for(var c=a.length,d=0;c--;)d+=+b(a[c])||0;return d}function ob(a,b){return a===x?b:a}function pb(a,b,c,d){return a!==x&&ag.call(d,c)?a:b}function qb(a,b,c){for(var d=-1,e=Oh(b),f=e.length;++d<f;){var g=e[d],h=a[g],i=c(h,b[g],g,a,b);(i===i?i===h:h!==h)&&(h!==x||g in a)||(a[g]=i)}return a}function rb(a,b){return null==b?a:tb(b,Oh(b),a)}function sb(a,b){for(var c=-1,d=null==a,e=!d&&Yc(a),f=e?a.length:0,g=b.length,h=Of(g);++c<g;){var i=b[c];e?h[c]=Zc(i,f)?a[i]:x:h[c]=d?x:a[i]}return h}function tb(a,b,c){c||(c={});for(var d=-1,e=b.length;++d<e;){var f=b[d];c[f]=a[f]}return c}function ub(a,b,c){var d=typeof a;return"function"==d?b===x?a:fc(a,b,c):null==a?Bf:"object"==d?Nb(a):b===x?Hf(a):Ob(a,b)}function vb(a,b,c,d,e,f,g){var h;if(c&&(h=e?c(a,d,e):c(a)),h!==x)return h;if(!He(a))return a;var i=Dh(a);if(i){if(h=Uc(a),!b)return cb(a,h)}else{var j=cg.call(a),k=j==W;if(j!=Z&&j!=R&&(!k||e))return Pa[j]?Wc(a,j,b):e?a:{};if(h=Vc(k?{}:a),!b)return rb(h,a)}f||(f=[]),g||(g=[]);for(var l=f.length;l--;)if(f[l]==a)return g[l];return f.push(a),g.push(h),(i?db:Fb)(a,function(d,e){h[e]=vb(d,b,c,e,a,f,g)}),h}function wb(a,b,c){if("function"!=typeof a)throw new Xf(P);return lg(function(){a.apply(x,c)},b)}function xb(a,b){var c=a?a.length:0,e=[];if(!c)return e;var f=-1,g=Qc(),h=g===d,i=h&&b.length>=M?oc(b):null,j=b.length;i&&(g=Za,h=!1,b=i);a:for(;++f<c;){var k=a[f];if(h&&k===k){for(var l=j;l--;)if(b[l]===k)continue a;e.push(k)}else g(b,k,0)<0&&e.push(k)}return e}function yb(a,b){var c=!0;return Kg(a,function(a,d,e){return c=!!b(a,d,e)}),c}function zb(a,b,c,d){var e=d,f=e;return Kg(a,function(a,g,h){var i=+b(a,g,h);(c(i,e)||i===d&&i===f)&&(e=i,f=a)}),f}function Ab(a,b,c,d){var e=a.length;for(c=null==c?0:+c||0,0>c&&(c=-c>e?0:e+c),d=d===x||d>e?e:+d||0,0>d&&(d+=e),e=c>d?0:d>>>0,c>>>=0;e>c;)a[c++]=b;return a}function Bb(a,b){var c=[];return Kg(a,function(a,d,e){b(a,d,e)&&c.push(a)}),c}function Cb(a,b,c,d){var e;return c(a,function(a,c,f){return b(a,c,f)?(e=d?c:a,!1):void 0}),e}function Db(a,b,c,d){d||(d=[]);for(var e=-1,f=a.length;++e<f;){var g=a[e];p(g)&&Yc(g)&&(c||Dh(g)||ye(g))?b?Db(g,b,c,d):jb(d,g):c||(d[d.length]=g)}return d}function Eb(a,b){return Mg(a,b,_e)}function Fb(a,b){return Mg(a,b,Oh)}function Gb(a,b){return Ng(a,b,Oh)}function Hb(a,b){for(var c=-1,d=b.length,e=-1,f=[];++c<d;){var g=b[c];Ge(a[g])&&(f[++e]=g)}return f}function Ib(a,b,c){if(null!=a){c!==x&&c in kd(a)&&(b=[c]);for(var d=0,e=b.length;null!=a&&e>d;)a=a[b[d++]];return d&&d==e?a:x}}function Jb(a,b,c,d,e,f){return a===b?!0:null==a||null==b||!He(a)&&!p(b)?a!==a&&b!==b:Kb(a,b,Jb,c,d,e,f)}function Kb(a,b,c,d,e,f,g){var h=Dh(a),i=Dh(b),j=S,k=S;h||(j=cg.call(a),j==R?j=Z:j!=Z&&(h=Qe(a))),i||(k=cg.call(b),k==R?k=Z:k!=Z&&(i=Qe(b)));var l=j==Z,m=k==Z,n=j==k;if(n&&!h&&!l)return Mc(a,b,j);if(!e){var o=l&&ag.call(a,"__wrapped__"),p=m&&ag.call(b,"__wrapped__");if(o||p)return c(o?a.value():a,p?b.value():b,d,e,f,g)}if(!n)return!1;f||(f=[]),g||(g=[]);for(var q=f.length;q--;)if(f[q]==a)return g[q]==b;f.push(a),g.push(b);var r=(h?Lc:Nc)(a,b,c,d,e,f,g);return f.pop(),g.pop(),r}function Lb(a,b,c){var d=b.length,e=d,f=!c;if(null==a)return!e;for(a=kd(a);d--;){var g=b[d];if(f&&g[2]?g[1]!==a[g[0]]:!(g[0]in a))return!1}for(;++d<e;){g=b[d];var h=g[0],i=a[h],j=g[1];if(f&&g[2]){if(i===x&&!(h in a))return!1}else{var k=c?c(i,j,h):x;if(!(k===x?Jb(j,i,c,!0):k))return!1}}return!0}function Mb(a,b){var c=-1,d=Yc(a)?Of(a.length):[];return Kg(a,function(a,e,f){d[++c]=b(a,e,f)}),d}function Nb(a){var b=Rc(a);if(1==b.length&&b[0][2]){var c=b[0][0],d=b[0][1];return function(a){return null==a?!1:a[c]===d&&(d!==x||c in kd(a))}}return function(a){return Lb(a,b)}}function Ob(a,b){var c=Dh(a),d=_c(a)&&cd(b),e=a+"";return a=ld(a),function(f){if(null==f)return!1;var g=e;if(f=kd(f),(c||!d)&&!(g in f)){if(f=1==a.length?f:Ib(f,Wb(a,0,-1)),null==f)return!1;g=zd(a),f=kd(f)}return f[g]===b?b!==x||g in f:Jb(b,f[g],x,!0)}}function Pb(a,b,c,d,e){if(!He(a))return a;var f=Yc(b)&&(Dh(b)||Qe(b)),g=f?x:Oh(b);return db(g||b,function(h,i){if(g&&(i=h,h=b[i]),p(h))d||(d=[]),e||(e=[]),Qb(a,b,i,Pb,c,d,e);else{var j=a[i],k=c?c(j,h,i,a,b):x,l=k===x;l&&(k=h),k===x&&(!f||i in a)||!l&&(k===k?k===j:j!==j)||(a[i]=k)}}),a}function Qb(a,b,c,d,e,f,g){for(var h=f.length,i=b[c];h--;)if(f[h]==i)return void(a[c]=g[h]);var j=a[c],k=e?e(j,i,c,a,b):x,l=k===x;l&&(k=i,Yc(i)&&(Dh(i)||Qe(i))?k=Dh(j)?j:Yc(j)?cb(j):[]:Ne(i)||ye(i)?k=ye(j)?Ve(j):Ne(j)?j:{}:l=!1),f.push(i),g.push(k),l?a[c]=d(k,i,e,f,g):(k===k?k!==j:j===j)&&(a[c]=k)}function Rb(a){return function(b){return null==b?x:b[a]}}function Sb(a){var b=a+"";return a=ld(a),function(c){return Ib(c,a,b)}}function Tb(a,b){for(var c=a?b.length:0;c--;){var d=b[c];if(d!=e&&Zc(d)){var e=d;mg.call(a,d,1)}}return a}function Ub(a,b){return a+rg(zg()*(b-a+1))}function Vb(a,b,c,d,e){return e(a,function(a,e,f){c=d?(d=!1,a):b(c,a,e,f)}),c}function Wb(a,b,c){var d=-1,e=a.length;b=null==b?0:+b||0,0>b&&(b=-b>e?0:e+b),c=c===x||c>e?e:+c||0,0>c&&(c+=e),e=b>c?0:c-b>>>0,b>>>=0;for(var f=Of(e);++d<e;)f[d]=a[d+b];return f}function Xb(a,b){var c;return Kg(a,function(a,d,e){return c=b(a,d,e),!c}),!!c}function Yb(a,b){var c=a.length;for(a.sort(b);c--;)a[c]=a[c].value;return a}function Zb(a,b,c){var d=Oc(),e=-1;b=ib(b,function(a){return d(a)});var f=Mb(a,function(a){var c=ib(b,function(b){return b(a)});return{criteria:c,index:++e,value:a}});return Yb(f,function(a,b){return j(a,b,c)})}function $b(a,b){var c=0;return Kg(a,function(a,d,e){c+=+b(a,d,e)||0}),c}function _b(a,b){var c=-1,e=Qc(),f=a.length,g=e===d,h=g&&f>=M,i=h?oc():null,j=[];i?(e=Za,g=!1):(h=!1,i=b?[]:j);a:for(;++c<f;){var k=a[c],l=b?b(k,c,a):k;if(g&&k===k){for(var m=i.length;m--;)if(i[m]===l)continue a;b&&i.push(l),j.push(k)}else e(i,l,0)<0&&((b||h)&&i.push(l),j.push(k))}return j}function ac(a,b){for(var c=-1,d=b.length,e=Of(d);++c<d;)e[c]=a[b[c]];return e}function bc(a,b,c,d){for(var e=a.length,f=d?e:-1;(d?f--:++f<e)&&b(a[f],f,a););return c?Wb(a,d?0:f,d?f+1:e):Wb(a,d?f+1:0,d?e:f)}function cc(a,b){var c=a;c instanceof ba&&(c=c.value());for(var d=-1,e=b.length;++d<e;){var f=b[d];c=f.func.apply(f.thisArg,jb([c],f.args))}return c}function dc(a,b,c){var d=0,e=a?a.length:d;if("number"==typeof b&&b===b&&Eg>=e){for(;e>d;){var f=d+e>>>1,g=a[f];(c?b>=g:b>g)&&null!==g?d=f+1:e=f}return e}return ec(a,b,Bf,c)}function ec(a,b,c,d){b=c(b);for(var e=0,f=a?a.length:0,g=b!==b,h=null===b,i=b===x;f>e;){var j=rg((e+f)/2),k=c(a[j]),l=k!==x,m=k===k;if(g)var n=m||d;else n=h?m&&l&&(d||null!=k):i?m&&(d||l):null==k?!1:d?b>=k:b>k;n?e=j+1:f=j}return wg(f,Dg)}function fc(a,b,c){if("function"!=typeof a)return Bf;if(b===x)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 3:return function(c,d,e){return a.call(b,c,d,e)};case 4:return function(c,d,e,f){return a.call(b,c,d,e,f)};case 5:return function(c,d,e,f,g){return a.call(b,c,d,e,f,g)}}return function(){return a.apply(b,arguments)}}function gc(a){var b=new fg(a.byteLength),c=new ng(b);return c.set(new ng(a)),b}function hc(a,b,c){for(var d=c.length,e=-1,f=vg(a.length-d,0),g=-1,h=b.length,i=Of(h+f);++g<h;)i[g]=b[g];for(;++e<d;)i[c[e]]=a[e];for(;f--;)i[g++]=a[e++];return i}function ic(a,b,c){for(var d=-1,e=c.length,f=-1,g=vg(a.length-e,0),h=-1,i=b.length,j=Of(g+i);++f<g;)j[f]=a[f];for(var k=f;++h<i;)j[k+h]=b[h];for(;++d<e;)j[k+c[d]]=a[f++];return j}function jc(a,b){return function(c,d,e){var f=b?b():{};if(d=Oc(d,e,3),Dh(c))for(var g=-1,h=c.length;++g<h;){var i=c[g];a(f,i,d(i,g,c),c)}else Kg(c,function(b,c,e){a(f,b,d(b,c,e),e)});return f}}function kc(a){return qe(function(b,c){var d=-1,e=null==b?0:c.length,f=e>2?c[e-2]:x,g=e>2?c[2]:x,h=e>1?c[e-1]:x;for("function"==typeof f?(f=fc(f,h,5),e-=2):(f="function"==typeof h?h:x,e-=f?1:0),g&&$c(c[0],c[1],g)&&(f=3>e?x:f,e=1);++d<e;){var i=c[d];i&&a(b,i,f)}return b})}function lc(a,b){return function(c,d){var e=c?Qg(c):0;if(!bd(e))return a(c,d);for(var f=b?e:-1,g=kd(c);(b?f--:++f<e)&&d(g[f],f,g)!==!1;);return c}}function mc(a){return function(b,c,d){for(var e=kd(b),f=d(b),g=f.length,h=a?g:-1;a?h--:++h<g;){var i=f[h];if(c(e[i],i,e)===!1)break}return b}}function nc(a,b){function c(){var e=this&&this!==ab&&this instanceof c?d:a;return e.apply(b,arguments)}var d=qc(a);return c}function oc(a){return qg&&kg?new Ya(a):null}function pc(a){return function(b){for(var c=-1,d=yf(kf(b)),e=d.length,f="";++c<e;)f=a(f,d[c],c);return f}}function qc(a){return function(){var b=arguments;switch(b.length){case 0:return new a;case 1:return new a(b[0]);case 2:return new a(b[0],b[1]);case 3:return new a(b[0],b[1],b[2]);case 4:return new a(b[0],b[1],b[2],b[3]);case 5:return new a(b[0],b[1],b[2],b[3],b[4]);case 6:return new a(b[0],b[1],b[2],b[3],b[4],b[5]);case 7:return new a(b[0],b[1],b[2],b[3],b[4],b[5],b[6])}var c=Jg(a.prototype),d=a.apply(c,b);return He(d)?d:c}}function rc(a){function b(c,d,e){e&&$c(c,d,e)&&(d=x);var f=Kc(c,a,x,x,x,x,x,d);return f.placeholder=b.placeholder,f}return b}function sc(a,b){return qe(function(c){var d=c[0];return null==d?d:(c.push(b),a.apply(x,c))})}function tc(a,b){return function(c,d,e){if(e&&$c(c,d,e)&&(d=x),d=Oc(d,e,3),1==d.length){c=Dh(c)?c:jd(c);var f=gb(c,d,a,b);if(!c.length||f!==b)return f}return zb(c,d,a,b)}}function uc(a,b){return function(d,e,f){if(e=Oc(e,f,3),Dh(d)){var g=c(d,e,b);return g>-1?d[g]:x}return Cb(d,e,a)}}function vc(a){return function(b,d,e){return b&&b.length?(d=Oc(d,e,3),c(b,d,a)):-1}}function wc(a){return function(b,c,d){return c=Oc(c,d,3),Cb(b,c,a,!0)}}function xc(a){return function(){for(var b,c=arguments.length,d=a?c:-1,e=0,f=Of(c);a?d--:++d<c;){var g=f[e++]=arguments[d];if("function"!=typeof g)throw new Xf(P);!b&&_.prototype.thru&&"wrapper"==Pc(g)&&(b=new _([],!0))}for(d=b?-1:c;++d<c;){g=f[d];var h=Pc(g),i="wrapper"==h?Pg(g):x;b=i&&ad(i[0])&&i[1]==(G|C|E|H)&&!i[4].length&&1==i[9]?b[Pc(i[0])].apply(b,i[3]):1==g.length&&ad(g)?b[h]():b.thru(g)}return function(){var a=arguments,d=a[0];if(b&&1==a.length&&Dh(d)&&d.length>=M)return b.plant(d).value();for(var e=0,g=c?f[e].apply(this,a):d;++e<c;)g=f[e].call(this,g);return g}}}function yc(a,b){return function(c,d,e){return"function"==typeof d&&e===x&&Dh(c)?a(c,d):b(c,fc(d,e,3))}}function zc(a){return function(b,c,d){return("function"!=typeof c||d!==x)&&(c=fc(c,d,3)),a(b,c,_e)}}function Ac(a){return function(b,c,d){return("function"!=typeof c||d!==x)&&(c=fc(c,d,3)),a(b,c)}}function Bc(a){return function(b,c,d){var e={};return c=Oc(c,d,3),Fb(b,function(b,d,f){var g=c(b,d,f);d=a?g:d,b=a?b:g,e[d]=b}),e}}function Cc(a){return function(b,c,d){return b=f(b),(a?b:"")+Gc(b,c,d)+(a?"":b)}}function Dc(a){var b=qe(function(c,d){var e=r(d,b.placeholder);return Kc(c,a,x,d,e)});return b}function Ec(a,b){return function(c,d,e,f){var g=arguments.length<3;return"function"==typeof d&&f===x&&Dh(c)?a(c,d,e,g):Vb(c,Oc(d,f,4),e,g,b)}}function Fc(a,b,c,d,e,f,g,h,i,j){function k(){for(var t=arguments.length,u=t,v=Of(t);u--;)v[u]=arguments[u];if(d&&(v=hc(v,d,e)),f&&(v=ic(v,f,g)),o||q){var w=k.placeholder,y=r(v,w);if(t-=y.length,j>t){var B=h?cb(h):x,C=vg(j-t,0),D=o?y:x,G=o?x:y,H=o?v:x,I=o?x:v;b|=o?E:F,b&=~(o?F:E),p||(b&=~(z|A));var J=[a,b,c,H,D,I,G,B,i,C],K=Fc.apply(x,J);return ad(a)&&Rg(K,J),K.placeholder=w,K}}var L=m?c:this,M=n?L[a]:a;return h&&(v=hd(v,h)),l&&i<v.length&&(v.length=i),this&&this!==ab&&this instanceof k&&(M=s||qc(a)),M.apply(L,v)}var l=b&G,m=b&z,n=b&A,o=b&C,p=b&B,q=b&D,s=n?x:qc(a);return k}function Gc(a,b,c){var d=a.length;if(b=+b,d>=b||!tg(b))return"";var e=b-d;return c=null==c?" ":c+"",qf(c,pg(e/c.length)).slice(0,e)}function Hc(a,b,c,d){function e(){for(var b=-1,h=arguments.length,i=-1,j=d.length,k=Of(j+h);++i<j;)k[i]=d[i];for(;h--;)k[i++]=arguments[++b];var l=this&&this!==ab&&this instanceof e?g:a;return l.apply(f?c:this,k)}var f=b&z,g=qc(a);return e}function Ic(a){var b=Sf[a];return function(a,c){return c=c===x?0:+c||0,c?(c=ig(10,c),b(a*c)/c):b(a)}}function Jc(a){return function(b,c,d,e){var f=Oc(d);return null==d&&f===ub?dc(b,c,a):ec(b,c,f(d,e,1),a)}}function Kc(a,b,c,d,e,f,g,h){var i=b&A;if(!i&&"function"!=typeof a)throw new Xf(P);var j=d?d.length:0;if(j||(b&=~(E|F),d=e=x),j-=e?e.length:0,b&F){var k=d,l=e;d=e=x}var m=i?x:Pg(a),n=[a,b,c,d,e,k,l,f,g,h];if(m&&(dd(n,m),b=n[1],h=n[9]),n[9]=null==h?i?0:a.length:vg(h-j,0)||0,b==z)var o=nc(n[0],n[2]);else o=b!=E&&b!=(z|E)||n[4].length?Fc.apply(x,n):Hc.apply(x,n);var p=m?Og:Rg;return p(o,n)}function Lc(a,b,c,d,e,f,g){var h=-1,i=a.length,j=b.length;if(i!=j&&!(e&&j>i))return!1;for(;++h<i;){var k=a[h],l=b[h],m=d?d(e?l:k,e?k:l,h):x;if(m!==x){if(m)continue;return!1}if(e){if(!mb(b,function(a){return k===a||c(k,a,d,e,f,g)}))return!1}else if(k!==l&&!c(k,l,d,e,f,g))return!1}return!0}function Mc(a,b,c){switch(c){case T:case U:return+a==+b;case V:return a.name==b.name&&a.message==b.message;case Y:return a!=+a?b!=+b:a==+b;case $:case aa:return a==b+""}return!1}function Nc(a,b,c,d,e,f,g){var h=Oh(a),i=h.length,j=Oh(b),k=j.length;if(i!=k&&!e)return!1;for(var l=i;l--;){var m=h[l];if(!(e?m in b:ag.call(b,m)))return!1}for(var n=e;++l<i;){m=h[l];var o=a[m],p=b[m],q=d?d(e?p:o,e?o:p,m):x;if(!(q===x?c(o,p,d,e,f,g):q))return!1;n||(n="constructor"==m)}if(!n){var r=a.constructor,s=b.constructor;if(r!=s&&"constructor"in a&&"constructor"in b&&!("function"==typeof r&&r instanceof r&&"function"==typeof s&&s instanceof s))return!1}return!0}function Oc(a,b,c){var d=q.callback||zf;return d=d===zf?ub:d,c?d(a,b,c):d}function Pc(a){for(var b=a.name+"",c=Hg[b],d=c?c.length:0;d--;){var e=c[d],f=e.func;if(null==f||f==a)return e.name}return b}function Qc(a,b,c){var e=q.indexOf||xd;return e=e===xd?d:e,a?e(a,b,c):e}function Rc(a){for(var b=af(a),c=b.length;c--;)b[c][2]=cd(b[c][1]);return b}function Sc(a,b){var c=null==a?x:a[b];return Ke(c)?c:x}function Tc(a,b,c){for(var d=-1,e=c.length;++d<e;){var f=c[d],g=f.size;switch(f.type){case"drop":a+=g;break;case"dropRight":b-=g;break;case"take":b=wg(b,a+g);break;case"takeRight":a=vg(a,b-g)}}return{start:a,end:b}}function Uc(a){var b=a.length,c=new a.constructor(b);return b&&"string"==typeof a[0]&&ag.call(a,"index")&&(c.index=a.index,c.input=a.input),c}function Vc(a){var b=a.constructor;return"function"==typeof b&&b instanceof b||(b=Uf),new b}function Wc(a,b,c){var d=a.constructor;switch(b){case ca:return gc(a);case T:case U:return new d(+a);case da:case ea:case fa:case ga:case ha:case ia:case ja:case ka:case la:var e=a.buffer;return new d(c?gc(e):e,a.byteOffset,a.length);case Y:case aa:return new d(a);case $:var f=new d(a.source,Ea.exec(a));f.lastIndex=a.lastIndex}return f}function Xc(a,b,c){null==a||_c(b,a)||(b=ld(b),a=1==b.length?a:Ib(a,Wb(b,0,-1)),b=zd(b));var d=null==a?a:a[b];return null==d?x:d.apply(a,c)}function Yc(a){return null!=a&&bd(Qg(a))}function Zc(a,b){return a="number"==typeof a||Ha.test(a)?+a:-1,b=null==b?Fg:b,a>-1&&a%1==0&&b>a}function $c(a,b,c){if(!He(c))return!1;var d=typeof b;if("number"==d?Yc(c)&&Zc(b,c.length):"string"==d&&b in c){var e=c[b];return a===a?a===e:e!==e}return!1}function _c(a,b){var c=typeof a;if("string"==c&&xa.test(a)||"number"==c)return!0;if(Dh(a))return!1;var d=!wa.test(a);return d||null!=b&&a in kd(b)}function ad(a){var b=Pc(a),c=q[b];if("function"!=typeof c||!(b in ba.prototype))return!1;if(a===c)return!0;var d=Pg(c);return!!d&&a===d[0]}function bd(a){return"number"==typeof a&&a>-1&&a%1==0&&Fg>=a}function cd(a){return a===a&&!He(a)}function dd(a,b){var c=a[1],d=b[1],e=c|d,f=G>e,g=d==G&&c==C||d==G&&c==H&&a[7].length<=b[8]||d==(G|H)&&c==C;if(!f&&!g)return a;d&z&&(a[2]=b[2],e|=c&z?0:B);var h=b[3];if(h){var i=a[3];a[3]=i?hc(i,h,b[4]):cb(h),a[4]=i?r(a[3],Q):cb(b[4])}return h=b[5],h&&(i=a[5],a[5]=i?ic(i,h,b[6]):cb(h),a[6]=i?r(a[5],Q):cb(b[6])),h=b[7],h&&(a[7]=cb(h)),d&G&&(a[8]=null==a[8]?b[8]:wg(a[8],b[8])),null==a[9]&&(a[9]=b[9]),a[0]=b[0],a[1]=e,a}function ed(a,b){return a===x?b:Eh(a,b,ed)}function fd(a,b){a=kd(a);for(var c=-1,d=b.length,e={};++c<d;){var f=b[c];f in a&&(e[f]=a[f])}return e}function gd(a,b){var c={};return Eb(a,function(a,d,e){b(a,d,e)&&(c[d]=a)}),c}function hd(a,b){for(var c=a.length,d=wg(b.length,c),e=cb(a);d--;){var f=b[d];a[d]=Zc(f,c)?e[f]:x}return a}function id(a){for(var b=_e(a),c=b.length,d=c&&a.length,e=!!d&&bd(d)&&(Dh(a)||ye(a)),f=-1,g=[];++f<c;){var h=b[f];(e&&Zc(h,d)||ag.call(a,h))&&g.push(h)}return g}function jd(a){return null==a?[]:Yc(a)?He(a)?a:Uf(a):ef(a)}function kd(a){return He(a)?a:Uf(a)}function ld(a){if(Dh(a))return a;var b=[];return f(a).replace(ya,function(a,c,d,e){b.push(d?e.replace(Ca,"$1"):c||a)}),b}function md(a){return a instanceof ba?a.clone():new _(a.__wrapped__,a.__chain__,cb(a.__actions__))}function nd(a,b,c){b=(c?$c(a,b,c):null==b)?1:vg(rg(b)||1,1);for(var d=0,e=a?a.length:0,f=-1,g=Of(pg(e/b));e>d;)g[++f]=Wb(a,d,d+=b);return g}function od(a){for(var b=-1,c=a?a.length:0,d=-1,e=[];++b<c;){var f=a[b];f&&(e[++d]=f)}return e}function pd(a,b,c){var d=a?a.length:0;return d?((c?$c(a,b,c):null==b)&&(b=1),Wb(a,0>b?0:b)):[]}function qd(a,b,c){var d=a?a.length:0;return d?((c?$c(a,b,c):null==b)&&(b=1),b=d-(+b||0),Wb(a,0,0>b?0:b)):[]}function rd(a,b,c){return a&&a.length?bc(a,Oc(b,c,3),!0,!0):[]}function sd(a,b,c){return a&&a.length?bc(a,Oc(b,c,3),!0):[]}function td(a,b,c,d){var e=a?a.length:0;return e?(c&&"number"!=typeof c&&$c(a,b,c)&&(c=0,d=e),Ab(a,b,c,d)):[]}function ud(a){return a?a[0]:x}function vd(a,b,c){var d=a?a.length:0;return c&&$c(a,b,c)&&(b=!1),d?Db(a,b):[]}function wd(a){var b=a?a.length:0;return b?Db(a,!0):[]}function xd(a,b,c){var e=a?a.length:0;if(!e)return-1;if("number"==typeof c)c=0>c?vg(e+c,0):c;else if(c){var f=dc(a,b);return e>f&&(b===b?b===a[f]:a[f]!==a[f])?f:-1}return d(a,b,c||0)}function yd(a){return qd(a,1)}function zd(a){var b=a?a.length:0;return b?a[b-1]:x}function Ad(a,b,c){var d=a?a.length:0;if(!d)return-1;var e=d;if("number"==typeof c)e=(0>c?vg(d+c,0):wg(c||0,d-1))+1;else if(c){e=dc(a,b,!0)-1;var f=a[e];return(b===b?b===f:f!==f)?e:-1}if(b!==b)return o(a,e,!0);for(;e--;)if(a[e]===b)return e;return-1}function Bd(){var a=arguments,b=a[0];if(!b||!b.length)return b;for(var c=0,d=Qc(),e=a.length;++c<e;)for(var f=0,g=a[c];(f=d(b,g,f))>-1;)mg.call(b,f,1);return b}function Cd(a,b,c){var d=[];if(!a||!a.length)return d;var e=-1,f=[],g=a.length;for(b=Oc(b,c,3);++e<g;){var h=a[e];b(h,e,a)&&(d.push(h),f.push(e))}return Tb(a,f),d}function Dd(a){return pd(a,1)}function Ed(a,b,c){var d=a?a.length:0;return d?(c&&"number"!=typeof c&&$c(a,b,c)&&(b=0,c=d),Wb(a,b,c)):[]}function Fd(a,b,c){var d=a?a.length:0;return d?((c?$c(a,b,c):null==b)&&(b=1),Wb(a,0,0>b?0:b)):[]}function Gd(a,b,c){var d=a?a.length:0;return d?((c?$c(a,b,c):null==b)&&(b=1),b=d-(+b||0),Wb(a,0>b?0:b)):[]}function Hd(a,b,c){return a&&a.length?bc(a,Oc(b,c,3),!1,!0):[]}function Id(a,b,c){return a&&a.length?bc(a,Oc(b,c,3)):[]}function Jd(a,b,c,e){var f=a?a.length:0;if(!f)return[];null!=b&&"boolean"!=typeof b&&(e=c,c=$c(a,b,e)?x:b,b=!1);var g=Oc();return(null!=c||g!==ub)&&(c=g(c,e,3)),b&&Qc()===d?s(a,c):_b(a,c)}function Kd(a){if(!a||!a.length)return[];var b=-1,c=0;a=hb(a,function(a){return Yc(a)?(c=vg(a.length,c),!0):void 0});for(var d=Of(c);++b<c;)d[b]=ib(a,Rb(b));return d}function Ld(a,b,c){var d=a?a.length:0;if(!d)return[];var e=Kd(a);return null==b?e:(b=fc(b,c,4),ib(e,function(a){return kb(a,b,x,!0)}))}function Md(){for(var a=-1,b=arguments.length;++a<b;){var c=arguments[a];if(Yc(c))var d=d?jb(xb(d,c),xb(c,d)):c}return d?_b(d):[]}function Nd(a,b){var c=-1,d=a?a.length:0,e={};for(!d||b||Dh(a[0])||(b=[]);++c<d;){var f=a[c];b?e[f]=b[c]:f&&(e[f[0]]=f[1])}return e}function Od(a){var b=q(a);return b.__chain__=!0,b}function Pd(a,b,c){return b.call(c,a),a}function Qd(a,b,c){return b.call(c,a)}function Rd(){return Od(this)}function Sd(){return new _(this.value(),this.__chain__)}function Td(a){for(var b,c=this;c instanceof X;){var d=md(c);b?e.__wrapped__=d:b=d;var e=d;c=c.__wrapped__}return e.__wrapped__=a,b}function Ud(){var a=this.__wrapped__,b=function(a){return a.reverse()};if(a instanceof ba){var c=a;return this.__actions__.length&&(c=new ba(this)),c=c.reverse(),c.__actions__.push({func:Qd,args:[b],thisArg:x}),new _(c,this.__chain__)}return this.thru(b)}function Vd(){return this.value()+""}function Wd(){return cc(this.__wrapped__,this.__actions__)}function Xd(a,b,c){var d=Dh(a)?fb:yb;return c&&$c(a,b,c)&&(b=x),("function"!=typeof b||c!==x)&&(b=Oc(b,c,3)),d(a,b)}function Yd(a,b,c){var d=Dh(a)?hb:Bb;return b=Oc(b,c,3),d(a,b)}function Zd(a,b){return eh(a,Nb(b))}function $d(a,b,c,d){var e=a?Qg(a):0;return bd(e)||(a=ef(a),e=a.length),c="number"!=typeof c||d&&$c(b,c,d)?0:0>c?vg(e+c,0):c||0,"string"==typeof a||!Dh(a)&&Pe(a)?e>=c&&a.indexOf(b,c)>-1:!!e&&Qc(a,b,c)>-1}function _d(a,b,c){var d=Dh(a)?ib:Mb;return b=Oc(b,c,3),d(a,b)}function ae(a,b){return _d(a,Hf(b))}function be(a,b,c){var d=Dh(a)?hb:Bb;return b=Oc(b,c,3),d(a,function(a,c,d){return!b(a,c,d)})}function ce(a,b,c){if(c?$c(a,b,c):null==b){a=jd(a);var d=a.length;return d>0?a[Ub(0,d-1)]:x}var e=-1,f=Ue(a),d=f.length,g=d-1;for(b=wg(0>b?0:+b||0,d);++e<b;){var h=Ub(e,g),i=f[h];f[h]=f[e],f[e]=i}return f.length=b,f}function de(a){return ce(a,Bg)}function ee(a){var b=a?Qg(a):0;return bd(b)?b:Oh(a).length}function fe(a,b,c){var d=Dh(a)?mb:Xb;return c&&$c(a,b,c)&&(b=x),("function"!=typeof b||c!==x)&&(b=Oc(b,c,3)),d(a,b)}function ge(a,b,c){if(null==a)return[];c&&$c(a,b,c)&&(b=x);var d=-1;b=Oc(b,c,3);var e=Mb(a,function(a,c,e){return{criteria:b(a,c,e),index:++d,value:a}});return Yb(e,i)}function he(a,b,c,d){return null==a?[]:(d&&$c(b,c,d)&&(c=x),Dh(b)||(b=null==b?[]:[b]),Dh(c)||(c=null==c?[]:[c]),Zb(a,b,c))}function ie(a,b){return Yd(a,Nb(b))}function je(a,b){if("function"!=typeof b){if("function"!=typeof a)throw new Xf(P);var c=a;a=b,b=c}return a=tg(a=+a)?a:0,function(){return--a<1?b.apply(this,arguments):void 0}}function ke(a,b,c){return c&&$c(a,b,c)&&(b=x),b=a&&null==b?a.length:vg(+b||0,0),Kc(a,G,x,x,x,x,b)}function le(a,b){var c;if("function"!=typeof b){if("function"!=typeof a)throw new Xf(P);var d=a;a=b,b=d}return function(){return--a>0&&(c=b.apply(this,arguments)),1>=a&&(b=x),c}}function me(a,b,c){function d(){n&&gg(n),j&&gg(j),p=0,j=n=o=x}function e(b,c){c&&gg(c),j=n=o=x,b&&(p=ph(),k=a.apply(m,i),n||j||(i=m=x))}function f(){var a=b-(ph()-l);0>=a||a>b?e(o,j):n=lg(f,a)}function g(){e(r,n)}function h(){if(i=arguments,l=ph(),m=this,o=r&&(n||!s),q===!1)var c=s&&!n;else{j||s||(p=l);var d=q-(l-p),e=0>=d||d>q;e?(j&&(j=gg(j)),p=l,k=a.apply(m,i)):j||(j=lg(g,d))}return e&&n?n=gg(n):n||b===q||(n=lg(f,b)),c&&(e=!0,k=a.apply(m,i)),!e||n||j||(i=m=x),k}var i,j,k,l,m,n,o,p=0,q=!1,r=!0;if("function"!=typeof a)throw new Xf(P);if(b=0>b?0:+b||0,c===!0){var s=!0;r=!1}else He(c)&&(s=!!c.leading,q="maxWait"in c&&vg(+c.maxWait||0,b),r="trailing"in c?!!c.trailing:r);return h.cancel=d,h}function ne(a,b){if("function"!=typeof a||b&&"function"!=typeof b)throw new Xf(P);var c=function(){var d=arguments,e=b?b.apply(this,d):d[0],f=c.cache;if(f.has(e))return f.get(e);var g=a.apply(this,d);return c.cache=f.set(e,g),g};return c.cache=new ne.Cache,c}function oe(a){if("function"!=typeof a)throw new Xf(P);return function(){return!a.apply(this,arguments)}}function pe(a){return le(2,a)}function qe(a,b){if("function"!=typeof a)throw new Xf(P);return b=vg(b===x?a.length-1:+b||0,0),function(){for(var c=arguments,d=-1,e=vg(c.length-b,0),f=Of(e);++d<e;)f[d]=c[b+d];switch(b){case 0:return a.call(this,f);case 1:return a.call(this,c[0],f);case 2:return a.call(this,c[0],c[1],f)}var g=Of(b+1);for(d=-1;++d<b;)g[d]=c[d];return g[b]=f,a.apply(this,g)}}function re(a){if("function"!=typeof a)throw new Xf(P);return function(b){return a.apply(this,b)}}function se(a,b,c){var d=!0,e=!0;if("function"!=typeof a)throw new Xf(P);return c===!1?d=!1:He(c)&&(d="leading"in c?!!c.leading:d,e="trailing"in c?!!c.trailing:e),me(a,b,{leading:d,maxWait:+b,trailing:e})}function te(a,b){return b=null==b?Bf:b,Kc(b,E,x,[a],[])}function ue(a,b,c,d){return b&&"boolean"!=typeof b&&$c(a,b,c)?b=!1:"function"==typeof b&&(d=c,c=b,b=!1),"function"==typeof c?vb(a,b,fc(c,d,3)):vb(a,b)}function ve(a,b,c){return"function"==typeof b?vb(a,!0,fc(b,c,3)):vb(a,!0)}function we(a,b){return a>b}function xe(a,b){return a>=b}function ye(a){return p(a)&&Yc(a)&&ag.call(a,"callee")&&!jg.call(a,"callee")}function ze(a){return a===!0||a===!1||p(a)&&cg.call(a)==T}function Ae(a){return p(a)&&cg.call(a)==U}function Be(a){return!!a&&1===a.nodeType&&p(a)&&!Ne(a)}function Ce(a){return null==a?!0:Yc(a)&&(Dh(a)||Pe(a)||ye(a)||p(a)&&Ge(a.splice))?!a.length:!Oh(a).length}function De(a,b,c,d){c="function"==typeof c?fc(c,d,3):x;var e=c?c(a,b):x;return e===x?Jb(a,b,c):!!e}function Ee(a){return p(a)&&"string"==typeof a.message&&cg.call(a)==V}function Fe(a){return"number"==typeof a&&tg(a)}function Ge(a){return He(a)&&cg.call(a)==W}function He(a){var b=typeof a;return!!a&&("object"==b||"function"==b)}function Ie(a,b,c,d){return c="function"==typeof c?fc(c,d,3):x,Lb(a,Rc(b),c)}function Je(a){return Me(a)&&a!=+a}function Ke(a){return null==a?!1:Ge(a)?eg.test(_f.call(a)):p(a)&&Ga.test(a)}function Le(a){return null===a}function Me(a){return"number"==typeof a||p(a)&&cg.call(a)==Y}function Ne(a){var b;if(!p(a)||cg.call(a)!=Z||ye(a)||!ag.call(a,"constructor")&&(b=a.constructor,"function"==typeof b&&!(b instanceof b)))return!1;var c;return Eb(a,function(a,b){c=b}),c===x||ag.call(a,c)}function Oe(a){return He(a)&&cg.call(a)==$}function Pe(a){return"string"==typeof a||p(a)&&cg.call(a)==aa}function Qe(a){return p(a)&&bd(a.length)&&!!Oa[cg.call(a)]}function Re(a){return a===x}function Se(a,b){return b>a}function Te(a,b){return b>=a}function Ue(a){var b=a?Qg(a):0;return bd(b)?b?cb(a):[]:ef(a)}function Ve(a){return tb(a,_e(a))}function We(a,b,c){var d=Jg(a);return c&&$c(a,b,c)&&(b=x),b?rb(d,b):d}function Xe(a){return Hb(a,_e(a))}function Ye(a,b,c){var d=null==a?x:Ib(a,ld(b),b+"");return d===x?c:d}function Ze(a,b){if(null==a)return!1;var c=ag.call(a,b);if(!c&&!_c(b)){if(b=ld(b),a=1==b.length?a:Ib(a,Wb(b,0,-1)),null==a)return!1;b=zd(b),c=ag.call(a,b)}return c||bd(a.length)&&Zc(b,a.length)&&(Dh(a)||ye(a))}function $e(a,b,c){c&&$c(a,b,c)&&(b=x);for(var d=-1,e=Oh(a),f=e.length,g={};++d<f;){var h=e[d],i=a[h];b?ag.call(g,i)?g[i].push(h):g[i]=[h]:g[i]=h}return g}function _e(a){if(null==a)return[];He(a)||(a=Uf(a));var b=a.length;b=b&&bd(b)&&(Dh(a)||ye(a))&&b||0;for(var c=a.constructor,d=-1,e="function"==typeof c&&c.prototype===a,f=Of(b),g=b>0;++d<b;)f[d]=d+"";for(var h in a)g&&Zc(h,b)||"constructor"==h&&(e||!ag.call(a,h))||f.push(h);return f}function af(a){a=kd(a);for(var b=-1,c=Oh(a),d=c.length,e=Of(d);++b<d;){var f=c[b];e[b]=[f,a[f]]}return e}function bf(a,b,c){var d=null==a?x:a[b];return d===x&&(null==a||_c(b,a)||(b=ld(b),a=1==b.length?a:Ib(a,Wb(b,0,-1)),d=null==a?x:a[zd(b)]),d=d===x?c:d),Ge(d)?d.call(a):d}function cf(a,b,c){if(null==a)return a;var d=b+"";b=null!=a[d]||_c(b,a)?[d]:ld(b);for(var e=-1,f=b.length,g=f-1,h=a;null!=h&&++e<f;){var i=b[e];He(h)&&(e==g?h[i]=c:null==h[i]&&(h[i]=Zc(b[e+1])?[]:{})),h=h[i]}return a}function df(a,b,c,d){var e=Dh(a)||Qe(a);if(b=Oc(b,d,4),null==c)if(e||He(a)){var f=a.constructor;c=e?Dh(a)?new f:[]:Jg(Ge(f)?f.prototype:x)}else c={};return(e?db:Fb)(a,function(a,d,e){return b(c,a,d,e)}),c}function ef(a){return ac(a,Oh(a))}function ff(a){return ac(a,_e(a))}function gf(a,b,c){return b=+b||0,c===x?(c=b,b=0):c=+c||0,a>=wg(b,c)&&a<vg(b,c)}function hf(a,b,c){c&&$c(a,b,c)&&(b=c=x);var d=null==a,e=null==b;if(null==c&&(e&&"boolean"==typeof a?(c=a,a=1):"boolean"==typeof b&&(c=b,e=!0)),d&&e&&(b=1,e=!1),a=+a||0,e?(b=a,a=0):b=+b||0,c||a%1||b%1){var f=zg();return wg(a+f*(b-a+hg("1e-"+((f+"").length-1))),b)}return Ub(a,b)}function jf(a){return a=f(a),
+a&&a.charAt(0).toUpperCase()+a.slice(1)}function kf(a){return a=f(a),a&&a.replace(Ia,k).replace(Ba,"")}function lf(a,b,c){a=f(a),b+="";var d=a.length;return c=c===x?d:wg(0>c?0:+c||0,d),c-=b.length,c>=0&&a.indexOf(b,c)==c}function mf(a){return a=f(a),a&&sa.test(a)?a.replace(qa,l):a}function nf(a){return a=f(a),a&&Aa.test(a)?a.replace(za,m):a||"(?:)"}function of(a,b,c){a=f(a),b=+b;var d=a.length;if(d>=b||!tg(b))return a;var e=(b-d)/2,g=rg(e),h=pg(e);return c=Gc("",h,c),c.slice(0,g)+a+c}function pf(a,b,c){return(c?$c(a,b,c):null==b)?b=0:b&&(b=+b),a=tf(a),yg(a,b||(Fa.test(a)?16:10))}function qf(a,b){var c="";if(a=f(a),b=+b,1>b||!a||!tg(b))return c;do b%2&&(c+=a),b=rg(b/2),a+=a;while(b);return c}function rf(a,b,c){return a=f(a),c=null==c?0:wg(0>c?0:+c||0,a.length),a.lastIndexOf(b,c)==c}function sf(a,b,c){var d=q.templateSettings;c&&$c(a,b,c)&&(b=c=x),a=f(a),b=qb(rb({},c||b),d,pb);var e=qb(rb({},b.imports),d.imports,pb),g=Oh(e),h=ac(e,g),i,j,k=0,l=b.interpolate||Ja,m="__p += '",o=Vf((b.escape||Ja).source+"|"+l.source+"|"+(l===va?Da:Ja).source+"|"+(b.evaluate||Ja).source+"|$","g"),p="//# sourceURL="+("sourceURL"in b?b.sourceURL:"lodash.templateSources["+ ++Na+"]")+"\n";a.replace(o,function(b,c,d,e,f,g){return d||(d=e),m+=a.slice(k,g).replace(Ka,n),c&&(i=!0,m+="' +\n__e("+c+") +\n'"),f&&(j=!0,m+="';\n"+f+";\n__p += '"),d&&(m+="' +\n((__t = ("+d+")) == null ? '' : __t) +\n'"),k=g+b.length,b}),m+="';\n";var r=b.variable;r||(m="with (obj) {\n"+m+"\n}\n"),m=(j?m.replace(ma,""):m).replace(na,"$1").replace(oa,"$1;"),m="function("+(r||"obj")+") {\n"+(r?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(j?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+m+"return __p\n}";var s=Zh(function(){return Rf(g,p+"return "+m).apply(x,h)});if(s.source=m,Ee(s))throw s;return s}function tf(a,b,c){var d=a;return(a=f(a))?(c?$c(d,b,c):null==b)?a.slice(t(a),u(a)+1):(b+="",a.slice(g(a,b),h(a,b)+1)):a}function uf(a,b,c){var d=a;return a=f(a),a?(c?$c(d,b,c):null==b)?a.slice(t(a)):a.slice(g(a,b+"")):a}function vf(a,b,c){var d=a;return a=f(a),a?(c?$c(d,b,c):null==b)?a.slice(0,u(a)+1):a.slice(0,h(a,b+"")+1):a}function wf(a,b,c){c&&$c(a,b,c)&&(b=x);var d=I,e=J;if(null!=b)if(He(b)){var g="separator"in b?b.separator:g;d="length"in b?+b.length||0:d,e="omission"in b?f(b.omission):e}else d=+b||0;if(a=f(a),d>=a.length)return a;var h=d-e.length;if(1>h)return e;var i=a.slice(0,h);if(null==g)return i+e;if(Oe(g)){if(a.slice(h).search(g)){var j,k,l=a.slice(0,h);for(g.global||(g=Vf(g.source,(Ea.exec(g)||"")+"g")),g.lastIndex=0;j=g.exec(l);)k=j.index;i=i.slice(0,null==k?h:k)}}else if(a.indexOf(g,h)!=h){var m=i.lastIndexOf(g);m>-1&&(i=i.slice(0,m))}return i+e}function xf(a){return a=f(a),a&&ra.test(a)?a.replace(pa,v):a}function yf(a,b,c){return c&&$c(a,b,c)&&(b=x),a=f(a),a.match(b||La)||[]}function zf(a,b,c){return c&&$c(a,b,c)&&(b=x),p(a)?Cf(a):ub(a,b)}function Af(a){return function(){return a}}function Bf(a){return a}function Cf(a){return Nb(vb(a,!0))}function Df(a,b){return Ob(a,vb(b,!0))}function Ef(a,b,c){if(null==c){var d=He(b),e=d?Oh(b):x,f=e&&e.length?Hb(b,e):x;(f?f.length:d)||(f=!1,c=b,b=a,a=this)}f||(f=Hb(b,Oh(b)));var g=!0,h=-1,i=Ge(a),j=f.length;c===!1?g=!1:He(c)&&"chain"in c&&(g=c.chain);for(;++h<j;){var k=f[h],l=b[k];a[k]=l,i&&(a.prototype[k]=function(b){return function(){var c=this.__chain__;if(g||c){var d=a(this.__wrapped__),e=d.__actions__=cb(this.__actions__);return e.push({func:b,args:arguments,thisArg:a}),d.__chain__=c,d}return b.apply(a,jb([this.value()],arguments))}}(l))}return a}function Ff(){return ab._=dg,this}function Gf(){}function Hf(a){return _c(a)?Rb(a):Sb(a)}function If(a){return function(b){return Ib(a,ld(b),b+"")}}function Jf(a,b,c){c&&$c(a,b,c)&&(b=c=x),a=+a||0,c=null==c?1:+c||0,null==b?(b=a,a=0):b=+b||0;for(var d=-1,e=vg(pg((b-a)/(c||1)),0),f=Of(e);++d<e;)f[d]=a,a+=c;return f}function Kf(a,b,c){if(a=rg(a),1>a||!tg(a))return[];var d=-1,e=Of(wg(a,Cg));for(b=fc(b,c,1);++d<a;)Cg>d?e[d]=b(d):b(d);return e}function Lf(a){var b=++bg;return f(a)+b}function Mf(a,b){return(+a||0)+(+b||0)}function Nf(a,b,c){return c&&$c(a,b,c)&&(b=x),b=Oc(b,c,3),1==b.length?nb(Dh(a)?a:jd(a),b):$b(a,b)}a=a?bb.defaults(ab.Object(),a,bb.pick(ab,Ma)):ab;var Of=a.Array,Pf=a.Date,Qf=a.Error,Rf=a.Function,Sf=a.Math,Tf=a.Number,Uf=a.Object,Vf=a.RegExp,Wf=a.String,Xf=a.TypeError,Yf=Of.prototype,Zf=Uf.prototype,$f=Wf.prototype,_f=Rf.prototype.toString,ag=Zf.hasOwnProperty,bg=0,cg=Zf.toString,dg=ab._,eg=Vf("^"+_f.call(ag).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),fg=a.ArrayBuffer,gg=a.clearTimeout,hg=a.parseFloat,ig=Sf.pow,jg=Zf.propertyIsEnumerable,kg=Sc(a,"Set"),lg=a.setTimeout,mg=Yf.splice,ng=a.Uint8Array,og=Sc(a,"WeakMap"),pg=Sf.ceil,qg=Sc(Uf,"create"),rg=Sf.floor,sg=Sc(Of,"isArray"),tg=a.isFinite,ug=Sc(Uf,"keys"),vg=Sf.max,wg=Sf.min,xg=Sc(Pf,"now"),yg=a.parseInt,zg=Sf.random,Ag=Tf.NEGATIVE_INFINITY,Bg=Tf.POSITIVE_INFINITY,Cg=4294967295,Dg=Cg-1,Eg=Cg>>>1,Fg=9007199254740991,Gg=og&&new og,Hg={},Ig=q.support={};q.templateSettings={escape:ta,evaluate:ua,interpolate:va,variable:"",imports:{_:q}};var Jg=function(){function a(){}return function(b){if(He(b)){a.prototype=b;var c=new a;a.prototype=x}return c||{}}}(),Kg=lc(Fb),Lg=lc(Gb,!0),Mg=mc(),Ng=mc(!0),Og=Gg?function(a,b){return Gg.set(a,b),a}:Bf,Pg=Gg?function(a){return Gg.get(a)}:Gf,Qg=Rb("length"),Rg=function(){var a=0,b=0;return function(c,d){var e=ph(),f=L-(e-b);if(b=e,f>0){if(++a>=K)return c}else a=0;return Og(c,d)}}(),Sg=qe(function(a,b){return p(a)&&Yc(a)?xb(a,Db(b,!1,!0)):[]}),Tg=vc(),Ug=vc(!0),Vg=qe(function(a){for(var b=a.length,c=b,e=Of(l),f=Qc(),g=f===d,h=[];c--;){var i=a[c]=Yc(i=a[c])?i:[];e[c]=g&&i.length>=120?oc(c&&i):null}var j=a[0],k=-1,l=j?j.length:0,m=e[0];a:for(;++k<l;)if(i=j[k],(m?Za(m,i):f(h,i,0))<0){for(var c=b;--c;){var n=e[c];if((n?Za(n,i):f(a[c],i,0))<0)continue a}m&&m.push(i),h.push(i)}return h}),Wg=qe(function(a,c){c=Db(c);var d=sb(a,c);return Tb(a,c.sort(b)),d}),Xg=Jc(),Yg=Jc(!0),Zg=qe(function(a){return _b(Db(a,!1,!0))}),$g=qe(function(a,b){return Yc(a)?xb(a,b):[]}),_g=qe(Kd),ah=qe(function(a){var b=a.length,c=b>2?a[b-2]:x,d=b>1?a[b-1]:x;return b>2&&"function"==typeof c?b-=2:(c=b>1&&"function"==typeof d?(--b,d):x,d=x),a.length=b,Ld(a,c,d)}),bh=qe(function(a){return a=Db(a),this.thru(function(b){return _a(Dh(b)?b:[kd(b)],a)})}),ch=qe(function(a,b){return sb(a,Db(b))}),dh=jc(function(a,b,c){ag.call(a,c)?++a[c]:a[c]=1}),eh=uc(Kg),fh=uc(Lg,!0),gh=yc(db,Kg),hh=yc(eb,Lg),ih=jc(function(a,b,c){ag.call(a,c)?a[c].push(b):a[c]=[b]}),jh=jc(function(a,b,c){a[c]=b}),kh=qe(function(a,b,c){var d=-1,e="function"==typeof b,f=_c(b),g=Yc(a)?Of(a.length):[];return Kg(a,function(a){var h=e?b:f&&null!=a?a[b]:x;g[++d]=h?h.apply(a,c):Xc(a,b,c)}),g}),lh=jc(function(a,b,c){a[c?0:1].push(b)},function(){return[[],[]]}),mh=Ec(kb,Kg),nh=Ec(lb,Lg),oh=qe(function(a,b){if(null==a)return[];var c=b[2];return c&&$c(b[0],b[1],c)&&(b.length=1),Zb(a,Db(b),[])}),ph=xg||function(){return(new Pf).getTime()},qh=qe(function(a,b,c){var d=z;if(c.length){var e=r(c,qh.placeholder);d|=E}return Kc(a,d,b,c,e)}),rh=qe(function(a,b){b=b.length?Db(b):Xe(a);for(var c=-1,d=b.length;++c<d;){var e=b[c];a[e]=Kc(a[e],z,a)}return a}),sh=qe(function(a,b,c){var d=z|A;if(c.length){var e=r(c,sh.placeholder);d|=E}return Kc(b,d,a,c,e)}),th=rc(C),uh=rc(D),vh=qe(function(a,b){return wb(a,1,b)}),wh=qe(function(a,b,c){return wb(a,b,c)}),xh=xc(),yh=xc(!0),zh=qe(function(a,b){if(b=Db(b),"function"!=typeof a||!fb(b,e))throw new Xf(P);var c=b.length;return qe(function(d){for(var e=wg(d.length,c);e--;)d[e]=b[e](d[e]);return a.apply(this,d)})}),Ah=Dc(E),Bh=Dc(F),Ch=qe(function(a,b){return Kc(a,H,x,x,x,Db(b))}),Dh=sg||function(a){return p(a)&&bd(a.length)&&cg.call(a)==S},Eh=kc(Pb),Fh=kc(function(a,b,c){return c?qb(a,b,c):rb(a,b)}),Gh=sc(Fh,ob),Hh=sc(Eh,ed),Ih=wc(Fb),Jh=wc(Gb),Kh=zc(Mg),Lh=zc(Ng),Mh=Ac(Fb),Nh=Ac(Gb),Oh=ug?function(a){var b=null==a?x:a.constructor;return"function"==typeof b&&b.prototype===a||"function"!=typeof a&&Yc(a)?id(a):He(a)?ug(a):[]}:id,Ph=Bc(!0),Qh=Bc(),Rh=qe(function(a,b){if(null==a)return{};if("function"!=typeof b[0]){var b=ib(Db(b),Wf);return fd(a,xb(_e(a),b))}var c=fc(b[0],b[1],3);return gd(a,function(a,b,d){return!c(a,b,d)})}),Sh=qe(function(a,b){return null==a?{}:"function"==typeof b[0]?gd(a,fc(b[0],b[1],3)):fd(a,Db(b))}),Th=pc(function(a,b,c){return b=b.toLowerCase(),a+(c?b.charAt(0).toUpperCase()+b.slice(1):b)}),Uh=pc(function(a,b,c){return a+(c?"-":"")+b.toLowerCase()}),Vh=Cc(),Wh=Cc(!0),Xh=pc(function(a,b,c){return a+(c?"_":"")+b.toLowerCase()}),Yh=pc(function(a,b,c){return a+(c?" ":"")+(b.charAt(0).toUpperCase()+b.slice(1))}),Zh=qe(function(a,b){try{return a.apply(x,b)}catch(c){return Ee(c)?c:new Qf(c)}}),$h=qe(function(a,b){return function(c){return Xc(c,a,b)}}),_h=qe(function(a,b){return function(c){return Xc(a,c,b)}}),ai=Ic("ceil"),bi=Ic("floor"),ci=tc(we,Ag),di=tc(Se,Bg),ei=Ic("round");return q.prototype=X.prototype,_.prototype=Jg(X.prototype),_.prototype.constructor=_,ba.prototype=Jg(X.prototype),ba.prototype.constructor=ba,Ta.prototype["delete"]=Ua,Ta.prototype.get=Va,Ta.prototype.has=Wa,Ta.prototype.set=Xa,Ya.prototype.push=$a,ne.Cache=Ta,q.after=je,q.ary=ke,q.assign=Fh,q.at=ch,q.before=le,q.bind=qh,q.bindAll=rh,q.bindKey=sh,q.callback=zf,q.chain=Od,q.chunk=nd,q.compact=od,q.constant=Af,q.countBy=dh,q.create=We,q.curry=th,q.curryRight=uh,q.debounce=me,q.defaults=Gh,q.defaultsDeep=Hh,q.defer=vh,q.delay=wh,q.difference=Sg,q.drop=pd,q.dropRight=qd,q.dropRightWhile=rd,q.dropWhile=sd,q.fill=td,q.filter=Yd,q.flatten=vd,q.flattenDeep=wd,q.flow=xh,q.flowRight=yh,q.forEach=gh,q.forEachRight=hh,q.forIn=Kh,q.forInRight=Lh,q.forOwn=Mh,q.forOwnRight=Nh,q.functions=Xe,q.groupBy=ih,q.indexBy=jh,q.initial=yd,q.intersection=Vg,q.invert=$e,q.invoke=kh,q.keys=Oh,q.keysIn=_e,q.map=_d,q.mapKeys=Ph,q.mapValues=Qh,q.matches=Cf,q.matchesProperty=Df,q.memoize=ne,q.merge=Eh,q.method=$h,q.methodOf=_h,q.mixin=Ef,q.modArgs=zh,q.negate=oe,q.omit=Rh,q.once=pe,q.pairs=af,q.partial=Ah,q.partialRight=Bh,q.partition=lh,q.pick=Sh,q.pluck=ae,q.property=Hf,q.propertyOf=If,q.pull=Bd,q.pullAt=Wg,q.range=Jf,q.rearg=Ch,q.reject=be,q.remove=Cd,q.rest=Dd,q.restParam=qe,q.set=cf,q.shuffle=de,q.slice=Ed,q.sortBy=ge,q.sortByAll=oh,q.sortByOrder=he,q.spread=re,q.take=Fd,q.takeRight=Gd,q.takeRightWhile=Hd,q.takeWhile=Id,q.tap=Pd,q.throttle=se,q.thru=Qd,q.times=Kf,q.toArray=Ue,q.toPlainObject=Ve,q.transform=df,q.union=Zg,q.uniq=Jd,q.unzip=Kd,q.unzipWith=Ld,q.values=ef,q.valuesIn=ff,q.where=ie,q.without=$g,q.wrap=te,q.xor=Md,q.zip=_g,q.zipObject=Nd,q.zipWith=ah,q.backflow=yh,q.collect=_d,q.compose=yh,q.each=gh,q.eachRight=hh,q.extend=Fh,q.iteratee=zf,q.methods=Xe,q.object=Nd,q.select=Yd,q.tail=Dd,q.unique=Jd,Ef(q,q),q.add=Mf,q.attempt=Zh,q.camelCase=Th,q.capitalize=jf,q.ceil=ai,q.clone=ue,q.cloneDeep=ve,q.deburr=kf,q.endsWith=lf,q.escape=mf,q.escapeRegExp=nf,q.every=Xd,q.find=eh,q.findIndex=Tg,q.findKey=Ih,q.findLast=fh,q.findLastIndex=Ug,q.findLastKey=Jh,q.findWhere=Zd,q.first=ud,q.floor=bi,q.get=Ye,q.gt=we,q.gte=xe,q.has=Ze,q.identity=Bf,q.includes=$d,q.indexOf=xd,q.inRange=gf,q.isArguments=ye,q.isArray=Dh,q.isBoolean=ze,q.isDate=Ae,q.isElement=Be,q.isEmpty=Ce,q.isEqual=De,q.isError=Ee,q.isFinite=Fe,q.isFunction=Ge,q.isMatch=Ie,q.isNaN=Je,q.isNative=Ke,q.isNull=Le,q.isNumber=Me,q.isObject=He,q.isPlainObject=Ne,q.isRegExp=Oe,q.isString=Pe,q.isTypedArray=Qe,q.isUndefined=Re,q.kebabCase=Uh,q.last=zd,q.lastIndexOf=Ad,q.lt=Se,q.lte=Te,q.max=ci,q.min=di,q.noConflict=Ff,q.noop=Gf,q.now=ph,q.pad=of,q.padLeft=Vh,q.padRight=Wh,q.parseInt=pf,q.random=hf,q.reduce=mh,q.reduceRight=nh,q.repeat=qf,q.result=bf,q.round=ei,q.runInContext=w,q.size=ee,q.snakeCase=Xh,q.some=fe,q.sortedIndex=Xg,q.sortedLastIndex=Yg,q.startCase=Yh,q.startsWith=rf,q.sum=Nf,q.template=sf,q.trim=tf,q.trimLeft=uf,q.trimRight=vf,q.trunc=wf,q.unescape=xf,q.uniqueId=Lf,q.words=yf,q.all=Xd,q.any=fe,q.contains=$d,q.eq=De,q.detect=eh,q.foldl=mh,q.foldr=nh,q.head=ud,q.include=$d,q.inject=mh,Ef(q,function(){var a={};return Fb(q,function(b,c){q.prototype[c]||(a[c]=b)}),a}(),!1),q.sample=ce,q.prototype.sample=function(a){return this.__chain__||null!=a?this.thru(function(b){return ce(b,a)}):ce(this.value())},q.VERSION=y,db(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){q[a].placeholder=q}),db(["drop","take"],function(a,b){ba.prototype[a]=function(c){var d=this.__filtered__;if(d&&!b)return new ba(this);c=null==c?1:vg(rg(c)||0,0);var e=this.clone();return d?e.__takeCount__=wg(e.__takeCount__,c):e.__views__.push({size:c,type:a+(e.__dir__<0?"Right":"")}),e},ba.prototype[a+"Right"]=function(b){return this.reverse()[a](b).reverse()}}),db(["filter","map","takeWhile"],function(a,b){var c=b+1,d=c!=O;ba.prototype[a]=function(a,b){var e=this.clone();return e.__iteratees__.push({iteratee:Oc(a,b,1),type:c}),e.__filtered__=e.__filtered__||d,e}}),db(["first","last"],function(a,b){var c="take"+(b?"Right":"");ba.prototype[a]=function(){return this[c](1).value()[0]}}),db(["initial","rest"],function(a,b){var c="drop"+(b?"":"Right");ba.prototype[a]=function(){return this.__filtered__?new ba(this):this[c](1)}}),db(["pluck","where"],function(a,b){var c=b?"filter":"map",d=b?Nb:Hf;ba.prototype[a]=function(a){return this[c](d(a))}}),ba.prototype.compact=function(){return this.filter(Bf)},ba.prototype.reject=function(a,b){return a=Oc(a,b,1),this.filter(function(b){return!a(b)})},ba.prototype.slice=function(a,b){a=null==a?0:+a||0;var c=this;return c.__filtered__&&(a>0||0>b)?new ba(c):(0>a?c=c.takeRight(-a):a&&(c=c.drop(a)),b!==x&&(b=+b||0,c=0>b?c.dropRight(-b):c.take(b-a)),c)},ba.prototype.takeRightWhile=function(a,b){return this.reverse().takeWhile(a,b).reverse()},ba.prototype.toArray=function(){return this.take(Bg)},Fb(ba.prototype,function(a,b){var c=/^(?:filter|map|reject)|While$/.test(b),d=/^(?:first|last)$/.test(b),e=q[d?"take"+("last"==b?"Right":""):b];e&&(q.prototype[b]=function(){var b=d?[1]:arguments,f=this.__chain__,g=this.__wrapped__,h=!!this.__actions__.length,i=g instanceof ba,j=b[0],k=i||Dh(g);k&&c&&"function"==typeof j&&1!=j.length&&(i=k=!1);var l=function(a){return d&&f?e(a,1)[0]:e.apply(x,jb([a],b))},m={func:Qd,args:[l],thisArg:x},n=i&&!h;if(d&&!f)return n?(g=g.clone(),g.__actions__.push(m),a.call(g)):e.call(x,this.value())[0];if(!d&&k){g=n?g:new ba(this);var o=a.apply(g,b);return o.__actions__.push(m),new _(o,f)}return this.thru(l)})}),db(["join","pop","push","replace","shift","sort","splice","split","unshift"],function(a){var b=(/^(?:replace|split)$/.test(a)?$f:Yf)[a],c=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",d=/^(?:join|pop|replace|shift)$/.test(a);q.prototype[a]=function(){var a=arguments;return d&&!this.__chain__?b.apply(this.value(),a):this[c](function(c){return b.apply(c,a)})}}),Fb(ba.prototype,function(a,b){var c=q[b];if(c){var d=c.name+"",e=Hg[d]||(Hg[d]=[]);e.push({name:b,func:c})}}),Hg[Fc(x,A).name]=[{name:"wrapper",func:x}],ba.prototype.clone=Qa,ba.prototype.reverse=Ra,ba.prototype.value=Sa,q.prototype.chain=Rd,q.prototype.commit=Sd,q.prototype.concat=bh,q.prototype.plant=Td,q.prototype.reverse=Ud,q.prototype.toString=Vd,q.prototype.run=q.prototype.toJSON=q.prototype.valueOf=q.prototype.value=Wd,q.prototype.collect=q.prototype.map,q.prototype.head=q.prototype.first,q.prototype.select=q.prototype.filter,q.prototype.tail=q.prototype.rest,q}var x,y="3.10.1",z=1,A=2,B=4,C=8,D=16,E=32,F=64,G=128,H=256,I=30,J="...",K=150,L=16,M=200,N=1,O=2,P="Expected a function",Q="__lodash_placeholder__",R="[object Arguments]",S="[object Array]",T="[object Boolean]",U="[object Date]",V="[object Error]",W="[object Function]",X="[object Map]",Y="[object Number]",Z="[object Object]",$="[object RegExp]",_="[object Set]",aa="[object String]",ba="[object WeakMap]",ca="[object ArrayBuffer]",da="[object Float32Array]",ea="[object Float64Array]",fa="[object Int8Array]",ga="[object Int16Array]",ha="[object Int32Array]",ia="[object Uint8Array]",ja="[object Uint8ClampedArray]",ka="[object Uint16Array]",la="[object Uint32Array]",ma=/\b__p \+= '';/g,na=/\b(__p \+=) '' \+/g,oa=/(__e\(.*?\)|\b__t\)) \+\n'';/g,pa=/&(?:amp|lt|gt|quot|#39|#96);/g,qa=/[&<>"'`]/g,ra=RegExp(pa.source),sa=RegExp(qa.source),ta=/<%-([\s\S]+?)%>/g,ua=/<%([\s\S]+?)%>/g,va=/<%=([\s\S]+?)%>/g,wa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\n\\]|\\.)*?\1)\]/,xa=/^\w*$/,ya=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\n\\]|\\.)*?)\2)\]/g,za=/^[:!,]|[\\^$.*+?()[\]{}|\/]|(^[0-9a-fA-Fnrtuvx])|([\n\r\u2028\u2029])/g,Aa=RegExp(za.source),Ba=/[\u0300-\u036f\ufe20-\ufe23]/g,Ca=/\\(\\)?/g,Da=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ea=/\w*$/,Fa=/^0[xX]/,Ga=/^\[object .+?Constructor\]$/,Ha=/^\d+$/,Ia=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Ja=/($^)/,Ka=/['\n\r\u2028\u2029\\]/g,La=function(){var a="[A-Z\\xc0-\\xd6\\xd8-\\xde]",b="[a-z\\xdf-\\xf6\\xf8-\\xff]+";return RegExp(a+"+(?="+a+b+")|"+a+"?"+b+"|"+a+"+|[0-9]+","g")}(),Ma=["Array","ArrayBuffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Math","Number","Object","RegExp","Set","String","_","clearTimeout","isFinite","parseFloat","parseInt","setTimeout","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap"],Na=-1,Oa={};Oa[da]=Oa[ea]=Oa[fa]=Oa[ga]=Oa[ha]=Oa[ia]=Oa[ja]=Oa[ka]=Oa[la]=!0,Oa[R]=Oa[S]=Oa[ca]=Oa[T]=Oa[U]=Oa[V]=Oa[W]=Oa[X]=Oa[Y]=Oa[Z]=Oa[$]=Oa[_]=Oa[aa]=Oa[ba]=!1;var Pa={};Pa[R]=Pa[S]=Pa[ca]=Pa[T]=Pa[U]=Pa[da]=Pa[ea]=Pa[fa]=Pa[ga]=Pa[ha]=Pa[Y]=Pa[Z]=Pa[$]=Pa[aa]=Pa[ia]=Pa[ja]=Pa[ka]=Pa[la]=!0,Pa[V]=Pa[W]=Pa[X]=Pa[_]=Pa[ba]=!1;var Qa={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},Ra={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","`":"&#96;"},Sa={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'","&#96;":"`"},Ta={"function":!0,object:!0},Ua={0:"x30",1:"x31",2:"x32",3:"x33",4:"x34",5:"x35",6:"x36",7:"x37",8:"x38",9:"x39",A:"x41",B:"x42",C:"x43",D:"x44",E:"x45",F:"x46",a:"x61",b:"x62",c:"x63",d:"x64",e:"x65",f:"x66",n:"x6e",r:"x72",t:"x74",u:"x75",v:"x76",x:"x78"},Va={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Wa=Ta[typeof exports]&&exports&&!exports.nodeType&&exports,Xa=Ta[typeof module]&&module&&!module.nodeType&&module,Ya=Wa&&Xa&&"object"==typeof global&&global&&global.Object&&global,Za=Ta[typeof self]&&self&&self.Object&&self,$a=Ta[typeof window]&&window&&window.Object&&window,_a=Xa&&Xa.exports===Wa&&Wa,ab=Ya||$a!==(this&&this.window)&&$a||Za||this,bb=w();"function"==typeof define&&"object"==typeof define.amd&&define.amd?define(function(){return bb}):Wa&&Xa&&(_a?(Xa.exports=bb)._=bb:Wa._=bb),a.constant("lodash",bb)}]);
\ No newline at end of file
diff --git a/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/package.json b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/package.json
new file mode 100644
index 0000000..3de6f34
--- /dev/null
+++ b/xos/core/xoslib/ui_src/contentProvider/src/vendor/ng-lodash/package.json
@@ -0,0 +1,46 @@
+{
+  "name": "ng-lodash",
+  "version": "0.3.0",
+  "description": "An Angular module wrapper for lodash",
+  "main": "build/ng-lodash.js",
+  "scripts": {
+    "test": "grunt dist"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/rockabox/ng-lodash.git"
+  },
+  "keywords": [
+    "nglodash",
+    "angular",
+    "lodash"
+  ],
+  "author": [
+    "Rockabox <tech@rockabox.com> (http://rockabox.com)"
+  ],
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/rockabox/ng-lodash/issues"
+  },
+  "homepage": "https://github.com/rockabox/ng-lodash",
+  "devDependencies": {
+    "grunt": "~0.4.5",
+    "grunt-bower-task": "~0.4.0",
+    "grunt-cli": "~0.1.13",
+    "grunt-contrib-jshint": "~0.11.0",
+    "grunt-contrib-uglify": "~0.7.0",
+    "grunt-jscs": "~1.5.0",
+    "grunt-karma": "~0.10.1",
+    "grunt-lodash": "~0.5.0",
+    "lodash-cli": "~3.10.1",
+    "grunt-ngmin": "~0.0.3",
+    "jasmine-core": "~2.2.0",
+    "karma": "~0.12.16",
+    "karma-jasmine": "~0.3.1",
+    "karma-phantomjs-launcher": "~0.1.4",
+    "load-grunt-tasks": "~3.1.0"
+  },
+  "engines": {
+    "node": "~0.10.0"
+  }
+}
