From f6322427cb500b8783649982da1e76e5ccea85df Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Fri, 17 Apr 2015 23:16:22 -0600 Subject: [PATCH 1/9] Stable Version 3.0.0-beta.1. --- .gitignore | 2 + CHANGELOG.md | 2 + Gruntfile.js | 10 +- bower.json | 6 +- build_examples/r.js/README.md | 3 + build_examples/r.js/app.js | 9 + build_examples/r.js/index.html | 14 + build_examples/r.js/main.js | 24 + build_examples/r.js/require.config.js | 6 + dist/js-data-angular.js | 687 +++++++++--------- dist/js-data-angular.min.js | 4 +- dist/js-data-angular.min.map | 2 +- karma.conf.js | 2 +- karma.start.js | 2 +- package.json | 21 +- src/index.js | 351 +-------- test/datastore/async_methods/create.test.js | 7 +- .../async_methods/loadRelations.test.js | 18 +- 18 files changed, 489 insertions(+), 681 deletions(-) create mode 100644 build_examples/r.js/README.md create mode 100644 build_examples/r.js/app.js create mode 100644 build_examples/r.js/index.html create mode 100644 build_examples/r.js/main.js create mode 100644 build_examples/r.js/require.config.js diff --git a/.gitignore b/.gitignore index c311dea..e2c404a 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ bower_components/ *.iml .idea/ + +build_examples/r.js/bundle.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 93f0c37..7b2c6e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +##### 3.0.0-beta.1 - 17 April 2015 + ##### 2.4.0 - 15 April 2015 ###### Backwards compatible API changes diff --git a/Gruntfile.js b/Gruntfile.js index 260ac9a..cd74a22 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -72,7 +72,7 @@ module.exports = function (grunt) { files: [ 'bower_components/angular-1.3.2/angular.js', 'bower_components/angular-mocks-1.3.2/angular-mocks.js', - 'bower_components/js-data/dist/js-data.js', + 'node_modules/js-data/dist/js-data.js', 'dist/js-data-angular.min.js', 'karma.start.js', 'test/**/*.js' @@ -87,24 +87,26 @@ module.exports = function (grunt) { }, webpack: { dist: { + debug: true, entry: './src/index.js', output: { filename: './dist/js-data-angular.js', - libraryTarget: 'umd', + libraryTarget: 'umd2', library: 'jsDataAngularModuleName' }, externals: { 'js-data': { - amd: 'js-data', + amd: 'JSData', commonjs: 'js-data', commonjs2: 'js-data', root: 'JSData' }, + 'axios': 'axios', 'angular': 'angular' }, module: { loaders: [ - { test: /(.+)\.js$/, exclude: /node_modules/, loader: 'babel-loader?blacklist=useStrict' } + { test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' } ], preLoaders: [ { diff --git a/bower.json b/bower.json index 4c785fa..ce47a82 100644 --- a/bower.json +++ b/bower.json @@ -25,10 +25,12 @@ "angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5", "angular-mocks-1.2.16": "angular-mocks#1.2.16", "angular-mocks-1.2.25": "angular-mocks#1.2.25", - "angular-mocks-1.3.2": "angular-mocks#1.3.2" + "angular-mocks-1.3.2": "angular-mocks#1.3.2", + "requirejs": "~2.1.17" }, "dependencies": { - "js-data": ">=1.5.7", + "js-data": "2.0.0-beta.3", + "js-data-http": "2.0.0-beta.3", "angular": ">=1.1.0" }, "resolutions": { diff --git a/build_examples/r.js/README.md b/build_examples/r.js/README.md new file mode 100644 index 0000000..f72e67f --- /dev/null +++ b/build_examples/r.js/README.md @@ -0,0 +1,3 @@ +`r.js -o require.config.js` will produce `bundle.js` + +In `index.html` switch `script/main` between `main` (load scripts dynamically) and `bundle` (load bundled scripts) diff --git a/build_examples/r.js/app.js b/build_examples/r.js/app.js new file mode 100644 index 0000000..6ead9cf --- /dev/null +++ b/build_examples/r.js/app.js @@ -0,0 +1,9 @@ +define('app', [ + 'angular', + 'js-data-angular' +], function (angular, jsDataModuleName) { + return angular.module('app', [jsDataModuleName]) + .run(function (DS, DSVersion, $rootScope) { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; + }); +}); diff --git a/build_examples/r.js/index.html b/build_examples/r.js/index.html new file mode 100644 index 0000000..582dbb7 --- /dev/null +++ b/build_examples/r.js/index.html @@ -0,0 +1,14 @@ + + + + My App + + + + + + + +

{{ test }}

+ + diff --git a/build_examples/r.js/main.js b/build_examples/r.js/main.js new file mode 100644 index 0000000..6e87465 --- /dev/null +++ b/build_examples/r.js/main.js @@ -0,0 +1,24 @@ +require.config({ + paths: { + angular: '../../bower_components/angular/angular', + 'js-data-angular': '../../dist/js-data-angular', + 'JSData': '../../bower_components/js-data/dist/js-data' + }, + shim: { + 'angular': { + exports: 'angular' + } + } +}); + +require([ + 'angular', + 'app', + 'JSData' + ], function (angular, app) { + angular.element(document.getElementsByTagName('html')[0]).ready(function () { + // bootstrap the app manually + angular.bootstrap(document, ['app']); + }); + } +); diff --git a/build_examples/r.js/require.config.js b/build_examples/r.js/require.config.js new file mode 100644 index 0000000..a89ae0f --- /dev/null +++ b/build_examples/r.js/require.config.js @@ -0,0 +1,6 @@ +({ + name: 'main', + mainConfigFile: 'main.js', + out: 'bundle.js', + optimize: 'none' +}) diff --git a/dist/js-data-angular.js b/dist/js-data-angular.js index bf234d3..3db2b58 100644 --- a/dist/js-data-angular.js +++ b/dist/js-data-angular.js @@ -1,6 +1,6 @@ /*! * js-data-angular - * @version 2.4.0 - Homepage + * @version 3.0.0-beta.1 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -9,14 +9,16 @@ */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') - module.exports = factory((function webpackLoadOptionalExternalModule() { try { return require("js-data"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("angular"); } catch(e) {} }())); + module.exports = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }())); else if(typeof define === 'function' && define.amd) - define(["js-data", "angular"], factory); + define(["JSData", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { + return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root["axios"]); + }); else if(typeof exports === 'object') - exports["jsDataAngularModuleName"] = factory((function webpackLoadOptionalExternalModule() { try { return require("js-data"); } catch(e) {} }()), (function webpackLoadOptionalExternalModule() { try { return require("angular"); } catch(e) {} }())); + exports["jsDataAngularModuleName"] = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }())); else - root["jsDataAngularModuleName"] = factory(root["JSData"], root["angular"]); -})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { + root["jsDataAngularModuleName"] = factory(root["JSData"], root["angular"], root["axios"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; @@ -63,7 +65,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports, __webpack_require__) { - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; @@ -71,48 +73,28 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); /*jshint loopfunc:true*/ - var angular = undefined, - JSData = undefined; - try { - JSData = __webpack_require__(1); - } catch (e) {} - if (!JSData) { - try { - JSData = window.JSData; - } catch (e) {} - } - if (!JSData) { - throw new Error('js-data must be loaded!'); - } - try { - angular = __webpack_require__(2); - } catch (e) {} + var _JSData = __webpack_require__(1); - if (!angular) { - try { - angular = window.angular; - } catch (e) {} - } - if (!angular) { - throw new Error('angular must be loaded!'); - } + var _JSData2 = _interopRequireWildcard(_JSData); - var DSUtils = JSData.DSUtils; - var DSErrors = JSData.DSErrors; - var deepMixIn = DSUtils.deepMixIn; - var copy = DSUtils.copy; - var removeCircular = DSUtils.removeCircular; + var _DSHttpAdapter = __webpack_require__(4); + + var _DSHttpAdapter2 = _interopRequireWildcard(_DSHttpAdapter); + + var _angular = __webpack_require__(2); + + var _angular2 = _interopRequireWildcard(_angular); + + var DSUtils = _JSData2['default'].DSUtils; + var DSErrors = _JSData2['default'].DSErrors; var isString = DSUtils.isString; var isNumber = DSUtils.isNumber; - var makePath = DSUtils.makePath; - var httpLoaded = false; + var isObject = DSUtils.isObject; + var set = DSUtils.set; + var resolveId = DSUtils.resolveId; var adapters = [{ - project: 'js-data-http', - name: 'http', - 'class': 'DSHttpAdapter' - }, { project: 'js-data-localstorage', name: 'localstorage', 'class': 'DSLocalStorageAdapter' @@ -130,7 +112,7 @@ return /******/ (function(modules) { // webpackBootstrap 'class': 'DSSqlAdapter' }]; - var functionsToWrap = ['compute', 'digest', 'eject', 'inject', 'link', 'linkAll', 'linkInverse', 'unlinkInverse']; + var functionsToWrap = ['compute', 'digest', 'eject', 'inject']; function registerAdapter(adapter) { var Adapter = undefined; @@ -144,11 +126,8 @@ return /******/ (function(modules) { // webpackBootstrap } if (Adapter) { - if (adapter.name === 'http') { - httpLoaded = true; - } adapter.loaded = true; - angular.module('js-data').provider(adapter['class'], function () { + _angular2['default'].module('js-data').provider(adapter['class'], function () { var _this = this; _this.defaults = {}; _this.$get = [function () { @@ -158,6 +137,20 @@ return /******/ (function(modules) { // webpackBootstrap } } + var DSHttpAdapterProvider = function DSHttpAdapterProvider() { + _classCallCheck(this, DSHttpAdapterProvider); + + var defaults = {}; + this.defaults = defaults; + + this.$get = ['$http', 'DS', function ($http, DS) { + defaults.http = defaults.http || $http; + var adapter = new _DSHttpAdapter2['default'](defaults); + DS.registerAdapter('http', adapter, { 'default': true }); + return adapter; + }]; + }; + var DSProvider = function DSProvider() { _classCallCheck(this, DSProvider); @@ -172,18 +165,18 @@ return /******/ (function(modules) { // webpackBootstrap _this.defaults = {}; - JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { + _JSData2['default'].DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { var _this = this; params = params || {}; if (!_this.definitions[resourceName]) { throw new DSErrors.NER(resourceName); - } else if (!DSUtils.isObject(params)) { + } else if (!isObject(params)) { throw new DSErrors.IA('"params" must be an object!'); - } else if (!DSUtils.isObject(scope)) { + } else if (!isObject(scope)) { throw new DSErrors.IA('"scope" must be an object!'); - } else if (!DSUtils.isString(expr)) { + } else if (!isString(expr)) { throw new DSErrors.IA('"expr" must be a string!'); } @@ -192,7 +185,7 @@ return /******/ (function(modules) { // webpackBootstrap return _this.lastModified(resourceName); }, function () { var items = _this.filter(resourceName, params); - DSUtils.set(scope, expr, items); + set(scope, expr, items); if (cb) { cb(null, items); } @@ -206,17 +199,17 @@ return /******/ (function(modules) { // webpackBootstrap } }; - JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { + _JSData2['default'].DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { var _this = this; - id = DSUtils.resolveId(_this.definitions[resourceName], id); + id = resolveId(_this.definitions[resourceName], id); if (!_this.definitions[resourceName]) { throw new DSErrors.NER(resourceName); - } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { + } else if (!isString(id) && !isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); - } else if (!DSUtils.isObject(scope)) { + } else if (!isObject(scope)) { throw new DSErrors.IA('"scope" must be an object!'); - } else if (!DSUtils.isString(expr)) { + } else if (!isString(expr)) { throw new DSErrors.IA('"expr" must be a string!'); } @@ -228,7 +221,7 @@ return /******/ (function(modules) { // webpackBootstrap if (item) { _this.compute(resourceName, id); } - DSUtils.set(scope, expr, item); + set(scope, expr, item); if (cb) { cb(null, item); } @@ -249,14 +242,14 @@ return /******/ (function(modules) { // webpackBootstrap var $rootScope = args[args.length - 2]; var $q = args[args.length - 1]; - var store = new JSData.DS(_this.defaults); + var store = new _JSData2['default'].DS(_this.defaults); var originals = {}; function QPromise(executor) { var deferred = $q.defer(); try { - executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); + executor.call(undefined, _angular2['default'].bind(deferred, deferred.resolve), _angular2['default'].bind(deferred, deferred.reject)); } catch (err) { deferred.reject(err); } @@ -322,284 +315,14 @@ return /******/ (function(modules) { // webpackBootstrap _this.$get = deps; }; - angular.module('js-data', ['ng']).value('DSUtils', JSData.DSUtils).value('DSErrors', JSData.DSErrors).provider('DS', DSProvider); + _angular2['default'].module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', _JSData2['default'].version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { + DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); + }]); for (var i = 0; i < adapters.length; i++) { registerAdapter(adapters[i]); } - if (!httpLoaded) { - (function () { - var Defaults = (function () { - function Defaults() { - _classCallCheck(this, Defaults); - } - - _createClass(Defaults, [{ - key: 'queryTransform', - value: function queryTransform(resourceConfig, params) { - return params; - } - }, { - key: 'deserialize', - value: function deserialize(resourceConfig, data) { - return data ? 'data' in data ? data.data : data : data; - } - }, { - key: 'serialize', - value: function serialize(resourceConfig, data) { - return data; - } - }, { - key: 'log', - value: function log() {} - }, { - key: 'error', - value: function error() {} - }]); - - return Defaults; - })(); - - var defaultsPrototype = Defaults.prototype; - - defaultsPrototype.basePath = ''; - - defaultsPrototype.forceTrailingSlash = ''; - - defaultsPrototype.httpConfig = {}; - - var DSHttpAdapter = (function () { - function DSHttpAdapter(options) { - _classCallCheck(this, DSHttpAdapter); - - this.defaults = new Defaults(); - if (console) { - this.defaults.log = function (a, b) { - return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); - }; - } - if (console) { - this.defaults.error = function (a, b) { - return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); - }; - } - deepMixIn(this.defaults, options); - } - - _createClass(DSHttpAdapter, [{ - key: 'getPath', - value: function getPath(method, resourceConfig, id, options) { - var _this = this; - options = options || {}; - var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, resourceConfig.getEndpoint(isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; - if (method === 'find' || method === 'update' || method === 'destroy') { - args.push(id); - } - return makePath.apply(DSUtils, args); - } - }, { - key: 'GET', - value: function GET(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'get'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'POST', - value: function POST(url, attrs, config) { - config = config || {}; - config = DSUtils.copy(config); - if (!('method' in config)) { - config.method = 'post'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs - })); - } - }, { - key: 'PUT', - value: function PUT(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'put'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs || {} - })); - } - }, { - key: 'DEL', - value: function DEL(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'delete'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'find', - value: function find(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { - var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - return !item ? JSData.DSUtils.Promise.reject(new Error('Not Found!')) : item; - }); - } - }, { - key: 'findAll', - value: function findAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'create', - value: function create(resourceConfig, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.POST(_this.getPath('create', resourceConfig, attrs, options), (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'update', - value: function update(resourceConfig, id, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.PUT(_this.getPath('update', resourceConfig, id, options), (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'updateAll', - value: function updateAll(resourceConfig, attrs, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroy', - value: function destroy(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroyAll', - value: function destroyAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }]); - - return DSHttpAdapter; - })(); - - var dsHttpAdapterPrototype = DSHttpAdapter.prototype; - - var DSHttpAdapterProvider = function DSHttpAdapterProvider() { - _classCallCheck(this, DSHttpAdapterProvider); - - var _this = this; - _this.defaults = {}; - _this.$get = ['$http', 'DS', '$q', function ($http, DS, $q) { - dsHttpAdapterPrototype.HTTP = function (config) { - var _this = this; - var start = new Date(); - config = copy(config); - config = deepMixIn(config, _this.defaults.httpConfig); - if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { - config.url += '/'; - } - config.method = config.method.toUpperCase(); - if (typeof config.data === 'object') { - config.data = removeCircular(config.data); - } - var suffix = config.suffix || _this.defaults.suffix; - if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { - config.url += suffix; - } - - function logResponse(data) { - var str = '' + start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; - if (data.status >= 200 && data.status < 300) { - if (_this.defaults.log) { - _this.defaults.log(str, data); - } - return data; - } else { - if (_this.defaults.error) { - _this.defaults.error('FAILED: ' + str, data); - } - return $q.reject(data); - } - } - - return $http(config).then(logResponse, logResponse); - }; - - var adapter = new DSHttpAdapter(_this.defaults); - DS.registerAdapter('http', adapter, { 'default': true }); - return adapter; - }]; - }; - - angular.module('js-data').provider('DSHttpAdapter', DSHttpAdapterProvider); - })(); - } - angular.module('js-data').run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { - return DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); - }]); - // return the module name exports['default'] = 'js-data'; module.exports = exports['default']; @@ -608,14 +331,12 @@ return /******/ (function(modules) { // webpackBootstrap /* 1 */ /***/ function(module, exports, __webpack_require__) { - if(typeof __WEBPACK_EXTERNAL_MODULE_1__ === 'undefined') {var e = new Error("Cannot find module \"undefined\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_1__; /***/ }, /* 2 */ /***/ function(module, exports, __webpack_require__) { - if(typeof __WEBPACK_EXTERNAL_MODULE_2__ === 'undefined') {var e = new Error("Cannot find module \"angular\""); e.code = 'MODULE_NOT_FOUND'; throw e;} module.exports = __WEBPACK_EXTERNAL_MODULE_2__; /***/ }, @@ -637,6 +358,302 @@ return /******/ (function(modules) { // webpackBootstrap webpackContext.id = 3; +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + + var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; + + var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); + + Object.defineProperty(exports, '__esModule', { + value: true + }); + + var _JSData = __webpack_require__(1); + + var _JSData2 = _interopRequireWildcard(_JSData); + + var axios = null; + + try { + axios = __webpack_require__(5); + } catch (e) {} + + var DSUtils = _JSData2['default'].DSUtils; + var deepMixIn = DSUtils.deepMixIn; + var removeCircular = DSUtils.removeCircular; + var copy = DSUtils.copy; + var makePath = DSUtils.makePath; + var isString = DSUtils.isString; + var isNumber = DSUtils.isNumber; + + var Defaults = (function () { + function Defaults() { + _classCallCheck(this, Defaults); + } + + _createClass(Defaults, [{ + key: 'queryTransform', + value: function queryTransform(resourceConfig, params) { + return params; + } + }, { + key: 'deserialize', + value: function deserialize(resourceConfig, data) { + return data ? 'data' in data ? data.data : data : data; + } + }, { + key: 'serialize', + value: function serialize(resourceConfig, data) { + return data; + } + }, { + key: 'log', + value: function log() {} + }, { + key: 'error', + value: function error() {} + }]); + + return Defaults; + })(); + + var defaultsPrototype = Defaults.prototype; + + defaultsPrototype.basePath = ''; + + defaultsPrototype.forceTrailingSlash = ''; + + defaultsPrototype.httpConfig = {}; + + var DSHttpAdapter = (function () { + function DSHttpAdapter(options) { + _classCallCheck(this, DSHttpAdapter); + + this.defaults = new Defaults(); + if (console) { + this.defaults.log = function (a, b) { + return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); + }; + } + if (console) { + this.defaults.error = function (a, b) { + return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); + }; + } + deepMixIn(this.defaults, options); + this.http = options.http || axios; + } + + _createClass(DSHttpAdapter, [{ + key: 'getPath', + value: function getPath(method, resourceConfig, id, options) { + var _this = this; + options = options || {}; + var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, resourceConfig.getEndpoint(isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; + if (method === 'find' || method === 'update' || method === 'destroy') { + args.push(id); + } + return makePath.apply(DSUtils, args); + } + }, { + key: 'HTTP', + value: function HTTP(config) { + var _this = this; + var start = new Date(); + config = copy(config); + config = deepMixIn(config, _this.defaults.httpConfig); + if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { + config.url += '/'; + } + if (typeof config.data === 'object') { + config.data = removeCircular(config.data); + } + config.method = config.method.toUpperCase(); + var suffix = config.suffix || _this.defaults.suffix; + if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { + config.url += suffix; + } + + function logResponse(data) { + var str = '' + start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; + if (data.status >= 200 && data.status < 300) { + if (_this.defaults.log) { + _this.defaults.log(str, data); + } + return data; + } else { + if (_this.defaults.error) { + _this.defaults.error('\'FAILED: ' + str, data); + } + return DSUtils.Promise.reject(data); + } + } + + if (!this.http) { + throw new Error('You have not configured this adapter with an http library!'); + } + + return this.http(config).then(logResponse, logResponse); + } + }, { + key: 'GET', + value: function GET(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'get'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'POST', + value: function POST(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'post'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs + })); + } + }, { + key: 'PUT', + value: function PUT(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'put'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs || {} + })); + } + }, { + key: 'DEL', + value: function DEL(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'delete'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'find', + value: function find(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { + var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + return !item ? DSUtils.Promise.reject(new Error('Not Found!')) : item; + }); + } + }, { + key: 'findAll', + value: function findAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'create', + value: function create(resourceConfig, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.POST(_this.getPath('create', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'update', + value: function update(resourceConfig, id, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.PUT(_this.getPath('update', resourceConfig, id, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'updateAll', + value: function updateAll(resourceConfig, attrs, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroy', + value: function destroy(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroyAll', + value: function destroyAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }]); + + return DSHttpAdapter; + })(); + + exports['default'] = DSHttpAdapter; + module.exports = exports['default']; + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + if(typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + module.exports = __WEBPACK_EXTERNAL_MODULE_5__; + /***/ } /******/ ]) }); diff --git a/dist/js-data-angular.min.js b/dist/js-data-angular.min.js index e88c1b2..907995d 100644 --- a/dist/js-data-angular.min.js +++ b/dist/js-data-angular.min.js @@ -1,6 +1,6 @@ /*! * js-data-angular -* @version 2.4.0 - Homepage +* @version 3.0.0-beta.1 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -8,5 +8,5 @@ * @overview Angular wrapper for js-data. */ -!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(function(){try{return require("js-data")}catch(a){}}(),function(){try{return require("angular")}catch(a){}}()):"function"==typeof define&&define.amd?define(["js-data","angular"],b):"object"==typeof exports?exports.jsDataAngularModuleName=b(function(){try{return require("js-data")}catch(a){}}(),function(){try{return require("angular")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular)}(this,function(a,b){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&("http"===a.name&&(r=!0),a.loaded=!0,g.module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var e=function(){function a(a,b){for(var c=0;ce;e++)d[e]=arguments[e];var f=d[d.length-2],i=d[d.length-1],k=new h.DS(b.defaults),l={};if(a.all=i.all,a.when=i.when,a.reject=i.reject,j.Promise=a,d.length)for(var m=0;md;d++)c[d]=arguments[d];return f.$$phase?l[a].apply(k,c):f.$apply(function(){return l[a].apply(k,c)})}},p=0;p=200&&a.status<300?(d.defaults.log&&d.defaults.log(b,a),a):(d.defaults.error&&d.defaults.error("FAILED: "+b,a),f.reject(a))}var d=this,e=new Date;a=m(a),a=l(a,d.defaults.httpConfig),d.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),a.method=a.method.toUpperCase(),"object"==typeof a.data&&(a.data=n(a.data));var g=a.suffix||d.defaults.suffix;return g&&a.url.substr(a.url.length-g.length)!==g&&(a.url+=g),b(a).then(c,c)};var g=new c(a.defaults);return e.registerAdapter("http",g,{"default":!0}),g}]};g.module("js-data").provider("DSHttpAdapter",i)}(),g.module("js-data").run(["DS","DSHttpAdapter",function(a,b){return a.registerAdapter("http",b,{"default":!0})}]),b["default"]="js-data",a.exports=b["default"]},function(b,c,d){if("undefined"==typeof a){var e=new Error('Cannot find module "undefined"');throw e.code="MODULE_NOT_FOUND",e}b.exports=a},function(a,c,d){if("undefined"==typeof b){var e=new Error('Cannot find module "angular"');throw e.code="MODULE_NOT_FOUND",e}a.exports=b},function(a,b,c){function d(a){return c(e(a))}function e(a){return f[a]||function(){throw new Error("Cannot find module '"+a+"'.")}()}var f={};d.keys=function(){return Object.keys(f)},d.resolve=e,a.exports=d,d.id=3}])}); +!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):"function"==typeof define&&define.amd?define(["JSData","angular"],function(c,d){return b(c,d,a.axios)}):"object"==typeof exports?exports.jsDataAngularModuleName=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular,a.axios)}(this,function(a,b,c){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&(a.loaded=!0,l["default"].module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var e=function(a){return a&&a.__esModule?a:{"default":a}},f=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var g=c(1),h=e(g),i=c(4),j=e(i),k=c(2),l=e(k),m=h["default"].DSUtils,n=h["default"].DSErrors,o=m.isString,p=m.isNumber,q=m.isObject,r=m.set,s=m.resolveId,t=[{project:"js-data-localstorage",name:"localstorage","class":"DSLocalStorageAdapter"},{project:"js-data-localforage",name:"localforage","class":"DSLocalForageAdapter"},{project:"js-data-firebase",name:"firebase","class":"DSFirebaseAdapter"},{project:"js-data-sql",name:"sql","class":"DSSqlAdapter"}],u=["compute","digest","eject","inject"],v=function y(){f(this,y);var a={};this.defaults=a,this.$get=["$http","DS",function(b,c){a.http=a.http||b;var d=new j["default"](a);return c.registerAdapter("http",d,{"default":!0}),d}]},w=function z(){function a(){function a(a){var b=g.defer();try{a.call(void 0,l["default"].bind(b,b.resolve),l["default"].bind(b,b.reject))}catch(c){b.reject(c)}return b.promise}for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var f=d[d.length-2],g=d[d.length-1],i=new h["default"].DS(b.defaults),j={};if(a.all=g.all,a.when=g.when,a.reject=g.reject,m.Promise=a,d.length)for(var k=0;kd;d++)c[d]=arguments[d];return f.$$phase?j[a].apply(i,c):f.$apply(function(){return j[a].apply(i,c)})}},p=0;p=200&&a.status<300?(c.defaults.log&&c.defaults.log(b,a),a):(c.defaults.error&&c.defaults.error("'FAILED: "+b,a),k.Promise.reject(a))}var c=this,d=new Date;a=n(a),a=l(a,c.defaults.httpConfig),c.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),"object"==typeof a.data&&(a.data=m(a.data)),a.method=a.method.toUpperCase();var e=a.suffix||c.defaults.suffix;if(e&&a.url.substr(a.url.length-e.length)!==e&&(a.url+=e),!this.http)throw new Error("You have not configured this adapter with an http library!");return this.http(a).then(b,b)}},{key:"GET",value:function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(l(b,{url:a}))}},{key:"POST",value:function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(l(c,{url:a,data:b}))}},{key:"PUT",value:function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(l(c,{url:a,data:b||{}}))}},{key:"DEL",value:function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(l(b,{url:a}))}},{key:"find",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.GET(d.getPath("find",a,b,c),c).then(function(b){var e=(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b);return e?e:k.Promise.reject(new Error("Not Found!"))})}},{key:"findAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),d.GET(d.getPath("findAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"create",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.POST(d.getPath("create",a,b,c),c.serialize?c.serialize(a,b):d.defaults.serialize(a,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"update",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},d.params=e.defaults.queryTransform(a,d.params),e.PUT(e.getPath("update",a,b,d),d.serialize?d.serialize(a,c):e.defaults.serialize(a,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},c&&(c=e.defaults.queryTransform(a,c),l(d.params,c)),this.PUT(e.getPath("updateAll",a,b,d),d.serialize?d.serialize(a,b):e.defaults.serialize(a,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"destroy",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.DEL(d.getPath("destroy",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"destroyAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),this.DEL(d.getPath("destroyAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}}]),a}();b["default"]=t,a.exports=b["default"]},function(a,b,d){if("undefined"==typeof c){var e=new Error('Cannot find module "axios"');throw e.code="MODULE_NOT_FOUND",e}a.exports=c}])}); //# sourceMappingURL=js-data-angular.min.map \ No newline at end of file diff --git a/dist/js-data-angular.min.map b/dist/js-data-angular.min.map index b182301..ef1338d 100644 --- a/dist/js-data-angular.min.map +++ b/dist/js-data-angular.min.map @@ -1 +1 @@ -{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","this","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","registerAdapter","adapter","Adapter","undefined","project","window","name","httpLoaded","angular","provider","_this","defaults","$get","_createClass","defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","key","Constructor","protoProps","staticProps","prototype","_classCallCheck","instance","TypeError","value","JSData","Error","DSUtils","DSErrors","deepMixIn","copy","removeCircular","isString","isNumber","makePath","adapters","class","functionsToWrap","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","args","Array","_key","$rootScope","store","DS","originals","all","when","Promise","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","bindAll","resourceName","params","scope","expr","cb","definitions","NER","isObject","IA","lastModified","items","filter","set","bindOne","resolveId","item","get","compute","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","DSHttpAdapter","options","console","log","a","b","info","error","method","getEndpoint","url","config","HTTP","attrs","suffix","queryTransform","GET","getPath","then","deserialize","POST","serialize","PUT","DEL","dsHttpAdapterPrototype","DSHttpAdapterProvider","$http","logResponse","str","start","toUTCString","toUpperCase","status","Date","getTime","substr","default","run","code","webpackContext","req","webpackContextResolve","map","keys"],"mappings":";;;;;;;;;;CASA,SAA2CA,EAAMC,GAC1B,gBAAZC,UAA0C,gBAAXC,QACxCA,OAAOD,QAAUD,EAAS,WAA+C,IAAM,MAAOG,SAAQ,WAAc,MAAMC,QAAa,WAA+C,IAAM,MAAOD,SAAQ,WAAc,MAAMC,SAC9L,kBAAXC,SAAyBA,OAAOC,IAC9CD,QAAQ,UAAW,WAAYL,GACL,gBAAZC,SACdA,QAAiC,wBAAID,EAAS,WAA+C,IAAM,MAAOG,SAAQ,WAAc,MAAMC,QAAa,WAA+C,IAAM,MAAOD,SAAQ,WAAc,MAAMC,SAE3OL,EAA8B,wBAAIC,EAAQD,EAAa,OAAGA,EAAc,UACvEQ,KAAM,SAASC,EAA+BC,GACjD,MAAgB,UAAUC,GAKhB,QAASC,GAAoBC,GAG5B,GAAGC,EAAiBD,GACnB,MAAOC,GAAiBD,GAAUX,OAGnC,IAAIC,GAASW,EAAiBD,IAC7BX,WACAa,GAAIF,EACJG,QAAQ,EAUT,OANAL,GAAQE,GAAUI,KAAKd,EAAOD,QAASC,EAAQA,EAAOD,QAASU,GAG/DT,EAAOa,QAAS,EAGTb,EAAOD,QAvBf,GAAIY,KAqCJ,OATAF,GAAoBM,EAAIP,EAGxBC,EAAoBO,EAAIL,EAGxBF,EAAoBQ,EAAI,GAGjBR,EAAoB,KAK/B,SAAST,EAAQD,EAASU,GAuE/B,QAASS,GAAgBC,GACvB,GAAIC,GAAUC,MAEd,KACED,EAAUX,EAAoB,GAAGU,EAAQG,SACzC,MAAOpB,IAEJkB,IACHA,EAAUG,OAAOJ,EAAQ,WAGvBC,IACmB,SAAjBD,EAAQK,OACVC,GAAa,GAEfN,EAAQN,QAAS,EACjBa,EAAQ1B,OAAO,WAAW2B,SAASR,EAAQ,SAAU,WACnD,GAAIS,GAAQvB,IACZuB,GAAMC,YACND,EAAME,MAAQ,WACZ,MAAO,IAAIV,GAAQQ,EAAMC,eAzFjC,GAAIE,GAAe,WAAe,QAASC,GAAiBC,EAAQC,GAAS,IAAK,GAAIC,GAAI,EAAGA,EAAID,EAAME,OAAQD,IAAK,CAAE,GAAIE,GAAaH,EAAMC,EAAIE,GAAWC,WAAaD,EAAWC,aAAc,EAAOD,EAAWE,cAAe,EAAU,SAAWF,KAAYA,EAAWG,UAAW,GAAMC,OAAOC,eAAeT,EAAQI,EAAWM,IAAKN,IAAiB,MAAO,UAAUO,EAAaC,EAAYC,GAAiJ,MAA9HD,IAAYb,EAAiBY,EAAYG,UAAWF,GAAiBC,GAAad,EAAiBY,EAAaE,GAAqBF,MAE7hBI,EAAkB,SAAUC,EAAUL,GAAe,KAAMK,YAAoBL,IAAgB,KAAM,IAAIM,WAAU,qCAEvHT,QAAOC,eAAe3C,EAAS,cAC7BoD,OAAO,GAGT,IAAIzB,GAAUL,OACV+B,EAAS/B,MACb,KACE+B,EAAS3C,EAAoB,GAC7B,MAAOP,IAET,IAAKkD,EACH,IACEA,EAAS7B,OAAO6B,OAChB,MAAOlD,IAEX,IAAKkD,EACH,KAAM,IAAIC,OAAM,0BAElB,KACE3B,EAAUjB,EAAoB,GAC9B,MAAOP,IAET,IAAKwB,EACH,IACEA,EAAUH,OAAOG,QACjB,MAAOxB,IAEX,IAAKwB,EACH,KAAM,IAAI2B,OAAM,0BAGlB,IAAIC,GAAUF,EAAOE,QACjBC,EAAWH,EAAOG,SAClBC,EAAYF,EAAQE,UACpBC,EAAOH,EAAQG,KACfC,EAAiBJ,EAAQI,eACzBC,EAAWL,EAAQK,SACnBC,EAAWN,EAAQM,SACnBC,EAAWP,EAAQO,SACnBpC,GAAa,EAEbqC,IACFxC,QAAS,eACTE,KAAM,OACNuC,QAAS,kBAETzC,QAAS,uBACTE,KAAM,eACNuC,QAAS,0BAETzC,QAAS,sBACTE,KAAM,cACNuC,QAAS,yBAETzC,QAAS,mBACTE,KAAM,WACNuC,QAAS,sBAETzC,QAAS,cACTE,KAAM,MACNuC,QAAS,iBAGPC,GAAmB,UAAW,SAAU,QAAS,SAAU,OAAQ,UAAW,cAAe,iBA4B7FC,EAAa,QAASA,KAoFxB,QAASC,KAUP,QAASC,GAASC,GAChB,GAAIC,GAAWC,EAAGC,OAElB,KACEH,EAAStD,KAAKO,OAAWK,EAAQ8C,KAAKH,EAAUA,EAASI,SAAU/C,EAAQ8C,KAAKH,EAAUA,EAASK,SACnG,MAAOC,GACPN,EAASK,OAAOC,GAGlB,MAAON,GAASO,QAlBlB,IAAK,GAAIC,GAAOC,UAAU1C,OAAQ2C,EAAOC,MAAMH,GAAOI,EAAO,EAAUJ,EAAPI,EAAaA,IAC3EF,EAAKE,GAAQH,UAAUG,EAGzB,IAAIC,GAAaH,EAAKA,EAAK3C,OAAS,GAChCkC,EAAKS,EAAKA,EAAK3C,OAAS,GACxB+C,EAAQ,GAAI/B,GAAOgC,GAAGxD,EAAMC,UAC5BwD,IAqBJ,IAPAlB,EAASmB,IAAMhB,EAAGgB,IAClBnB,EAASoB,KAAOjB,EAAGiB,KACnBpB,EAASO,OAASJ,EAAGI,OAErBpB,EAAQkC,QAAUrB,EAGdY,EAAK3C,OACP,IAAK,GAAID,GAAI,EAAGA,EAAI4C,EAAK3C,OAAQD,IAC/B,IAAK,GAAIsD,GAAI,EAAGA,EAAI3B,EAAS1B,OAAQqD,IACnC,GAAI3B,EAAS2B,GAAG5E,SAAWiD,EAAS2B,GAAGC,WAAY,CACjD5B,EAAS2B,GAAGC,YAAa,EACzBP,EAAMjE,gBAAgB4C,EAAS2B,GAAGjE,KAAMuD,EAAK5C,GAC7C,OAwBR,IAAK,GAlBDwD,GAAQ,WACV,GAAInE,GAAOwC,EAAgB4B,EAC3BP,GAAU7D,GAAQ2D,EAAM3D,GACxB2D,EAAM3D,GAAQ,WACZ,IAAK,GAAIqE,GAAQf,UAAU1C,OAAQ2C,EAAOC,MAAMa,GAAQC,EAAQ,EAAWD,EAARC,EAAeA,IAChFf,EAAKe,GAAShB,UAAUgB,EAG1B,OAAKZ,GAAWa,QAKTV,EAAU7D,GAAMwE,MAAMb,EAAOJ,GAJ3BG,EAAWe,OAAO,WACvB,MAAOZ,GAAU7D,GAAMwE,MAAMb,EAAOJ,OAQnCa,EAAI,EAAGA,EAAI5B,EAAgB5B,OAAQwD,IAC1CD,GAUF,QAN8B,kBAAnBlD,QAAOyD,SAAmD,kBAAlBlB,OAAMkB,UACvDhB,EAAWiB,OAAO,WAChB,MAAOhB,GAAMe,QAAQE,SAASC,+BAI3BlB,EAzJTnC,EAAgB3C,KAAM4D,EAKtB,KAAK,GAHDrC,GAAQvB,KACRiG,KAEKnE,EAAI,EAAGA,EAAI2B,EAAS1B,OAAQD,IAC/B2B,EAAS3B,GAAGtB,QACdyF,EAAKC,KAAKzC,EAAS3B,GAAG,SAI1BP,GAAMC,YAENuB,EAAOgC,GAAGrC,UAAUyD,QAAU,SAAUC,EAAcC,EAAQC,EAAOC,EAAMC,GACzE,GAAIjF,GAAQvB,IAIZ,IAFAqG,EAASA,OAEJ9E,EAAMkF,YAAYL,GACrB,KAAM,IAAIlD,GAASwD,IAAIN,EAClB,KAAKnD,EAAQ0D,SAASN,GAC3B,KAAM,IAAInD,GAAS0D,GAAG,8BACjB,KAAK3D,EAAQ0D,SAASL,GAC3B,KAAM,IAAIpD,GAAS0D,GAAG,6BACjB,KAAK3D,EAAQK,SAASiD,GAC3B,KAAM,IAAIrD,GAAS0D,GAAG,2BAGxB,KACE,MAAON,GAAMR,OAAO,WAClB,MAAOvE,GAAMsF,aAAaT,IACzB,WACD,GAAIU,GAAQvF,EAAMwF,OAAOX,EAAcC,EACvCpD,GAAQ+D,IAAIV,EAAOC,EAAMO,GACrBN,GACFA,EAAG,KAAMM,KAGb,MAAOxC,GACP,IAAIkC,EAGF,KAAMlC,EAFNkC,GAAGlC,KAOTvB,EAAOgC,GAAGrC,UAAUuE,QAAU,SAAUb,EAAc7F,EAAI+F,EAAOC,EAAMC,GACrE,GAAIjF,GAAQvB,IAGZ,IADAO,EAAK0C,EAAQiE,UAAU3F,EAAMkF,YAAYL,GAAe7F,IACnDgB,EAAMkF,YAAYL,GACrB,KAAM,IAAIlD,GAASwD,IAAIN,EAClB,KAAKnD,EAAQK,SAAS/C,KAAQ0C,EAAQM,SAAShD,GACpD,KAAM,IAAI2C,GAAS0D,GAAG,qCACjB,KAAK3D,EAAQ0D,SAASL,GAC3B,KAAM,IAAIpD,GAAS0D,GAAG,6BACjB,KAAK3D,EAAQK,SAASiD,GAC3B,KAAM,IAAIrD,GAAS0D,GAAG,2BAGxB,KACE,MAAON,GAAMR,OAAO,WAClB,MAAOvE,GAAMsF,aAAaT,EAAc7F,IACvC,WACD,GAAI4G,GAAO5F,EAAM6F,IAAIhB,EAAc7F,EAC/B4G,IACF5F,EAAM8F,QAAQjB,EAAc7F,GAE9B0C,EAAQ+D,IAAIV,EAAOC,EAAMY,GACrBX,GACFA,EAAG,KAAMW,KAGb,MAAO7C,GACP,IAAIkC,EAGF,KAAMlC,EAFNkC,GAAGlC,KAgFT2B,EAAKC,KAAK,cACVD,EAAKC,KAAK,MACVD,EAAKC,KAAKrC,GAEVtC,EAAME,KAAOwE,EAGf5E,GAAQ1B,OAAO,WAAY,OAAOmD,MAAM,UAAWC,EAAOE,SAASH,MAAM,WAAYC,EAAOG,UAAU5B,SAAS,KAAMsC,EAErH,KAAK,GAAI9B,GAAI,EAAGA,EAAI2B,EAAS1B,OAAQD,IACnCjB,EAAgB4C,EAAS3B,GAGtBV,KACH,WACE,GAAIkG,GAAW,WACb,QAASA,KACP3E,EAAgB3C,KAAMsH,GA0BxB,MAvBA5F,GAAa4F,IACXhF,IAAK,iBACLQ,MAAO,SAAwByE,EAAgBlB,GAC7C,MAAOA,MAGT/D,IAAK,cACLQ,MAAO,SAAqByE,EAAgBC,GAC1C,MAAOA,IAAO,QAAUA,GAAOA,EAAKA,KAAcA,KAGpDlF,IAAK,YACLQ,MAAO,SAAmByE,EAAgBC,GACxC,MAAOA,MAGTlF,IAAK,MACLQ,MAAO,eAEPR,IAAK,QACLQ,MAAO,gBAGFwE,KAGLG,EAAoBH,EAAS5E,SAEjC+E,GAAkBC,SAAW,GAE7BD,EAAkBE,mBAAqB,GAEvCF,EAAkBG,aAElB,IAAIC,GAAgB,WAClB,QAASA,GAAcC,GACrBnF,EAAgB3C,KAAM6H,GAEtB7H,KAAKwB,SAAW,GAAI8F,GAChBS,UACF/H,KAAKwB,SAASwG,IAAM,SAAUC,EAAGC,GAC/B,MAAOH,SAAgC,kBAAjBA,SAAQI,KAAsB,OAAS,OAAOF,EAAGC,KAGvEH,UACF/H,KAAKwB,SAAS4G,MAAQ,SAAUH,EAAGC,GACjC,MAAOH,SAAiC,kBAAlBA,SAAQK,MAAuB,QAAU,OAAOH,EAAGC,KAG7E/E,EAAUnD,KAAKwB,SAAUsG,GA6J3B,MA1JApG,GAAamG,IACXvF,IAAK,UACLQ,MAAO,SAAiBuF,EAAQd,EAAgBhH,EAAIuH,GAClD,GAAIvG,GAAQvB,IACZ8H,GAAUA,KACV,IAAIpD,IAAQoD,EAAQJ,UAAYnG,EAAMC,SAASkG,UAAYH,EAAeG,SAAUH,EAAee,YAAYhF,EAAS/C,IAAOgD,EAAShD,IAAkB,WAAX8H,EAAsB9H,EAAK,KAAMuH,GAIhL,QAHe,SAAXO,GAAgC,WAAXA,GAAkC,YAAXA,IAC9C3D,EAAKwB,KAAK3F,GAELiD,EAASmC,MAAM1C,EAASyB,MAGjCpC,IAAK,MACLQ,MAAO,SAAayF,EAAKC,GAKvB,MAJAA,GAASA,MACH,UAAYA,KAChBA,EAAOH,OAAS,OAEXrI,KAAKyI,KAAKtF,EAAUqF,GACzBD,IAAKA,QAITjG,IAAK,OACLQ,MAAO,SAAcyF,EAAKG,EAAOF,GAM/B,MALAA,GAASA,MACTA,EAASvF,EAAQG,KAAKoF,GAChB,UAAYA,KAChBA,EAAOH,OAAS,QAEXrI,KAAKyI,KAAKtF,EAAUqF,GACzBD,IAAKA,EACLf,KAAMkB,QAIVpG,IAAK,MACLQ,MAAO,SAAayF,EAAKG,EAAOF,GAK9B,MAJAA,GAASA,MACH,UAAYA,KAChBA,EAAOH,OAAS,OAEXrI,KAAKyI,KAAKtF,EAAUqF,GACzBD,IAAKA,EACLf,KAAMkB,YAIVpG,IAAK,MACLQ,MAAO,SAAayF,EAAKC,GAKvB,MAJAA,GAASA,MACH,UAAYA,KAChBA,EAAOH,OAAS,UAEXrI,KAAKyI,KAAKtF,EAAUqF,GACzBD,IAAKA,QAITjG,IAAK,OACLQ,MAAO,SAAcyE,EAAgBhH,EAAIuH,GACvC,GAAIvG,GAAQvB,IAKZ,OAJA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACzByB,EAAQzB,OAAS9E,EAAMC,SAASoH,eAAerB,EAAgBO,EAAQzB,QAChE9E,EAAMsH,IAAItH,EAAMuH,QAAQ,OAAQvB,EAAgBhH,EAAIuH,GAAUA,GAASiB,KAAK,SAAUvB,GAC3F,GAAIL,IAAQW,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,EACpG,OAAQL,GAAgEA,EAAzDpE,EAAOE,QAAQkC,QAAQd,OAAO,GAAIrB,OAAM,oBAI3DV,IAAK,UACLQ,MAAO,SAAiByE,EAAgBlB,EAAQyB,GAC9C,GAAIvG,GAAQvB,IAQZ,OAPA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACrBA,IACFA,EAAS9E,EAAMC,SAASoH,eAAerB,EAAgBlB,GACvDlD,EAAU2E,EAAQzB,OAAQA,IAErB9E,EAAMsH,IAAItH,EAAMuH,QAAQ,UAAWvB,EAAgBlB,EAAQyB,GAAUA,GAASiB,KAAK,SAAUvB,GAClG,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,QAIpGlF,IAAK,SACLQ,MAAO,SAAgByE,EAAgBmB,EAAOZ,GAC5C,GAAIvG,GAAQvB,IAKZ,OAJA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACzByB,EAAQzB,OAAS9E,EAAMC,SAASoH,eAAerB,EAAgBO,EAAQzB,QAChE9E,EAAM0H,KAAK1H,EAAMuH,QAAQ,SAAUvB,EAAgBmB,EAAOZ,IAAWA,EAAQoB,UAAYpB,EAAQoB,UAAY3H,EAAMC,SAAS0H,WAAW3B,EAAgBmB,GAAQZ,GAASiB,KAAK,SAAUvB,GAC5L,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,QAIpGlF,IAAK,SACLQ,MAAO,SAAgByE,EAAgBhH,EAAImI,EAAOZ,GAChD,GAAIvG,GAAQvB,IAKZ,OAJA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACzByB,EAAQzB,OAAS9E,EAAMC,SAASoH,eAAerB,EAAgBO,EAAQzB,QAChE9E,EAAM4H,IAAI5H,EAAMuH,QAAQ,SAAUvB,EAAgBhH,EAAIuH,IAAWA,EAAQoB,UAAYpB,EAAQoB,UAAY3H,EAAMC,SAAS0H,WAAW3B,EAAgBmB,GAAQZ,GAASiB,KAAK,SAAUvB,GACxL,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,QAIpGlF,IAAK,YACLQ,MAAO,SAAmByE,EAAgBmB,EAAOrC,EAAQyB,GACvD,GAAIvG,GAAQvB,IAQZ,OAPA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACrBA,IACFA,EAAS9E,EAAMC,SAASoH,eAAerB,EAAgBlB,GACvDlD,EAAU2E,EAAQzB,OAAQA,IAErBrG,KAAKmJ,IAAI5H,EAAMuH,QAAQ,YAAavB,EAAgBmB,EAAOZ,IAAWA,EAAQoB,UAAYpB,EAAQoB,UAAY3H,EAAMC,SAAS0H,WAAW3B,EAAgBmB,GAAQZ,GAASiB,KAAK,SAAUvB,GAC7L,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,QAIpGlF,IAAK,UACLQ,MAAO,SAAiByE,EAAgBhH,EAAIuH,GAC1C,GAAIvG,GAAQvB,IAKZ,OAJA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACzByB,EAAQzB,OAAS9E,EAAMC,SAASoH,eAAerB,EAAgBO,EAAQzB,QAChE9E,EAAM6H,IAAI7H,EAAMuH,QAAQ,UAAWvB,EAAgBhH,EAAIuH,GAAUA,GAASiB,KAAK,SAAUvB,GAC9F,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,QAIpGlF,IAAK,aACLQ,MAAO,SAAoByE,EAAgBlB,EAAQyB,GACjD,GAAIvG,GAAQvB,IAQZ,OAPA8H,GAAUA,EAAU1E,EAAK0E,MACzBA,EAAQa,OAASb,EAAQa,QAAUpB,EAAeoB,OAClDb,EAAQzB,OAASyB,EAAQzB,WACrBA,IACFA,EAAS9E,EAAMC,SAASoH,eAAerB,EAAgBlB,GACvDlD,EAAU2E,EAAQzB,OAAQA,IAErBrG,KAAKoJ,IAAI7H,EAAMuH,QAAQ,aAAcvB,EAAgBlB,EAAQyB,GAAUA,GAASiB,KAAK,SAAUvB,GACpG,OAAQM,EAAQkB,YAAclB,EAAQkB,YAAczH,EAAMC,SAASwH,aAAazB,EAAgBC,SAK/FK,KAGLwB,EAAyBxB,EAAcnF,UAEvC4G,EAAwB,QAASA,KACnC3G,EAAgB3C,KAAMsJ,EAEtB,IAAI/H,GAAQvB,IACZuB,GAAMC,YACND,EAAME,MAAQ,QAAS,KAAM,KAAM,SAAU8H,EAAOxE,EAAId,GACtDoF,EAAuBZ,KAAO,SAAUD,GAiBtC,QAASgB,GAAYhC,GACnB,GAAIiC,GAAM,GAAKC,EAAMC,cAAgB,MAAQnC,EAAKgB,OAAOH,OAAOuB,cAAgB,IAAMpC,EAAKgB,OAAOD,IAAM,MAAQf,EAAKqC,OAAS,MAAO,GAAIC,OAAOC,UAAYL,EAAMK,WAAa,IAC/K,OAAIvC,GAAKqC,QAAU,KAAOrC,EAAKqC,OAAS,KAClCtI,EAAMC,SAASwG,KACjBzG,EAAMC,SAASwG,IAAIyB,EAAKjC,GAEnBA,IAEHjG,EAAMC,SAAS4G,OACjB7G,EAAMC,SAAS4G,MAAM,WAAaqB,EAAKjC,GAElCvD,EAAGI,OAAOmD,IA3BrB,GAAIjG,GAAQvB,KACR0J,EAAQ,GAAII,KAChBtB,GAASpF,EAAKoF,GACdA,EAASrF,EAAUqF,EAAQjH,EAAMC,SAASoG,YACtCrG,EAAMC,SAASmG,oBAA4D,MAAtCa,EAAOD,IAAIC,EAAOD,IAAIxG,OAAS,KACtEyG,EAAOD,KAAO,KAEhBC,EAAOH,OAASG,EAAOH,OAAOuB,cACH,gBAAhBpB,GAAOhB,OAChBgB,EAAOhB,KAAOnE,EAAemF,EAAOhB,MAEtC,IAAImB,GAASH,EAAOG,QAAUpH,EAAMC,SAASmH,MAoB7C,OAnBIA,IAAUH,EAAOD,IAAIyB,OAAOxB,EAAOD,IAAIxG,OAAS4G,EAAO5G,UAAY4G,IACrEH,EAAOD,KAAOI,GAkBTY,EAAMf,GAAQO,KAAKS,EAAaA,GAGzC,IAAI1I,GAAU,GAAI+G,GAActG,EAAMC,SAEtC,OADAuD,GAAGlE,gBAAgB,OAAQC,GAAWmJ,WAAW,IAC1CnJ,IAIXO,GAAQ1B,OAAO,WAAW2B,SAAS,gBAAiBgI,MAGxDjI,EAAQ1B,OAAO,WAAWuK,KAAK,KAAM,gBAAiB,SAAUnF,EAAI8C,GAClE,MAAO9C,GAAGlE,gBAAgB,OAAQgH,GAAiBoC,WAAW,OAIhEvK,EAAQ,WAAa,UACrBC,EAAOD,QAAUA,EAAQ,YAIpB,SAASC,EAAQD,EAASU,GAE/B,GAA4C,mBAAlCH,GAA+C,CAAC,GAAIJ,GAAI,GAAImD,OAAM,iCAAkE,MAA7BnD,GAAEsK,KAAO,mBAA0BtK,EACpJF,EAAOD,QAAUO,GAIZ,SAASN,EAAQD,EAASU,GAE/B,GAA4C,mBAAlCF,GAA+C,CAAC,GAAIL,GAAI,GAAImD,OAAM,+BAAgE,MAA7BnD,GAAEsK,KAAO,mBAA0BtK,EAClJF,EAAOD,QAAUQ,GAIZ,SAASP,EAAQD,EAASU,GAG/B,QAASgK,GAAeC,GACvB,MAAOjK,GAAoBkK,EAAsBD,IAElD,QAASC,GAAsBD,GAC9B,MAAOE,GAAIF,IAAS,WAAa,KAAM,IAAIrH,OAAM,uBAAyBqH,EAAM,SALjF,GAAIE,KAOJH,GAAeI,KAAO,WACrB,MAAOpI,QAAOoI,KAAKD,IAEpBH,EAAehG,QAAUkG,EACzB3K,EAAOD,QAAU0K,EACjBA,EAAe7J,GAAK"} \ No newline at end of file +{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","this","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","registerAdapter","adapter","Adapter","undefined","project","window","_angular2","provider","_this","defaults","$get","_interopRequireWildcard","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_JSData","_JSData2","_DSHttpAdapter","_DSHttpAdapter2","_angular","DSUtils","DSErrors","isString","isNumber","isObject","set","resolveId","adapters","name","class","functionsToWrap","DSHttpAdapterProvider","$http","DS","http","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","length","args","Array","_key","$rootScope","store","originals","all","when","Promise","i","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","prototype","bindAll","resourceName","params","scope","expr","cb","definitions","NER","IA","lastModified","items","filter","bindOne","item","get","compute","version","run","DSHttpAdapter","webpackContext","req","webpackContextResolve","map","Error","keys","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","axios","deepMixIn","removeCircular","copy","makePath","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","options","console","log","a","b","info","error","method","getEndpoint","config","logResponse","str","start","toUTCString","toUpperCase","url","status","Date","getTime","suffix","substr","then","HTTP","attrs","queryTransform","GET","getPath","deserialize","POST","serialize","PUT","DEL","code"],"mappings":"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"} \ No newline at end of file diff --git a/karma.conf.js b/karma.conf.js index 6e57fb6..43b6ffc 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -23,7 +23,7 @@ module.exports = function (config) { files: [ 'bower_components/angular-1.3.2/angular.js', 'bower_components/angular-mocks-1.3.2/angular-mocks.js', - 'bower_components/js-data/dist/js-data.js', + 'node_modules/js-data/dist/js-data.js', 'dist/js-data-angular.js', 'karma.start.js', 'test/**/*.js' diff --git a/karma.start.js b/karma.start.js index 7e9176c..1054600 100644 --- a/karma.start.js +++ b/karma.start.js @@ -80,7 +80,7 @@ beforeEach(function () { lifecycle.beforeInject = function () { lifecycle.beforeInject.callCount += 1; }; - lifecycle.afterInject = function () { + lifecycle.afterInject = function (resource, data) { lifecycle.afterInject.callCount += 1; }; lifecycle.serialize = function (resourceName, data) { diff --git a/package.json b/package.json index 7103743..8027dbf 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-data-angular", "description": "Angular wrapper for js-data.", - "version": "2.4.0", + "version": "3.0.0-beta.1", "homepage": "http://www.js-data.io/docs/js-data-angular", "repository": { "type": "git", @@ -20,7 +20,7 @@ ], "main": "dist/js-data-angular.js", "devDependencies": { - "babel-core": "5.1.9", + "babel-core": "5.1.10", "babel-loader": "5.0.0", "grunt": "0.4.5", "grunt-contrib-clean": "0.6.0", @@ -30,27 +30,28 @@ "grunt-karma-coveralls": "2.5.3", "grunt-webpack": "1.0.8", "jit-grunt": "0.9.1", - "jshint": "2.7.0", "jshint-loader": "0.8.3", "karma": "0.12.31", "karma-chai": "0.1.0", - "karma-chrome-launcher": "0.1.7", - "karma-coverage": "0.2.7", + "karma-chrome-launcher": "0.1.8", + "karma-coverage": "0.3.1", "karma-firefox-launcher": "0.1.4", "karma-mocha": "0.1.10", "karma-phantomjs-launcher": "0.1.4", "karma-script-launcher": "0.1.0", "karma-sinon": "1.0.4", - "karma-spec-reporter": "0.0.18", - "time-grunt": "1.1.0", - "webpack": "1.8.4", + "karma-spec-reporter": "0.0.19", + "time-grunt": "1.1.1", "webpack-dev-server": "1.8.0" }, "scripts": { "test": "grunt test" }, "peerDependencies": { - "angular": ">=1.1.0", - "js-data": ">=1.5.7" + "angular": ">=1.1.0" + }, + "dependencies": { + "js-data": ">=2.0.0-beta.3", + "js-data-http": ">=2.0.0-beta.3" } } diff --git a/src/index.js b/src/index.js index c8ab825..4ca1d07 100644 --- a/src/index.js +++ b/src/index.js @@ -1,50 +1,12 @@ /*jshint loopfunc:true*/ -let angular, JSData; -try { - JSData = require('js-data'); -} catch (e) { -} +import JSData from 'js-data'; +import DSHttpAdapter from '../node_modules/js-data-http/src/index.js'; +import angular from 'angular'; -if (!JSData) { - try { - JSData = window.JSData; - } catch (e) { - } -} -if (!JSData) { - throw new Error('js-data must be loaded!'); -} -try { - angular = require('angular'); -} catch (e) { -} - -if (!angular) { - try { - angular = window.angular; - } catch (e) { - } -} -if (!angular) { - throw new Error('angular must be loaded!'); -} - -let DSUtils = JSData.DSUtils; -let DSErrors = JSData.DSErrors; -let deepMixIn = DSUtils.deepMixIn; -let copy = DSUtils.copy; -let removeCircular = DSUtils.removeCircular; -let isString = DSUtils.isString; -let isNumber = DSUtils.isNumber; -let makePath = DSUtils.makePath; -let httpLoaded = false; +let { DSUtils, DSErrors } = JSData; +let { isString, isNumber, isObject, set, resolveId } = DSUtils; let adapters = [ - { - project: 'js-data-http', - name: 'http', - 'class': 'DSHttpAdapter' - }, { project: 'js-data-localstorage', name: 'localstorage', @@ -71,11 +33,7 @@ let functionsToWrap = [ 'compute', 'digest', 'eject', - 'inject', - 'link', - 'linkAll', - 'linkInverse', - 'unlinkInverse' + 'inject' ]; function registerAdapter(adapter) { @@ -92,9 +50,6 @@ function registerAdapter(adapter) { } if (Adapter) { - if (adapter.name === 'http') { - httpLoaded = true; - } adapter.loaded = true; angular.module('js-data').provider(adapter.class, function () { let _this = this; @@ -104,6 +59,20 @@ function registerAdapter(adapter) { } } +class DSHttpAdapterProvider { + constructor() { + let defaults = {}; + this.defaults = defaults; + + this.$get = ['$http', 'DS', ($http, DS) => { + defaults.http = defaults.http || $http; + let adapter = new DSHttpAdapter(defaults); + DS.registerAdapter('http', adapter, { 'default': true }); + return adapter; + }]; + } +} + class DSProvider { constructor() { let _this = this; @@ -124,18 +93,18 @@ class DSProvider { if (!_this.definitions[resourceName]) { throw new DSErrors.NER(resourceName); - } else if (!DSUtils.isObject(params)) { + } else if (!isObject(params)) { throw new DSErrors.IA('"params" must be an object!'); - } else if (!DSUtils.isObject(scope)) { + } else if (!isObject(scope)) { throw new DSErrors.IA('"scope" must be an object!'); - } else if (!DSUtils.isString(expr)) { + } else if (!isString(expr)) { throw new DSErrors.IA('"expr" must be a string!'); } try { return scope.$watch(() => _this.lastModified(resourceName), () => { let items = _this.filter(resourceName, params); - DSUtils.set(scope, expr, items); + set(scope, expr, items); if (cb) { cb(null, items); } @@ -152,14 +121,14 @@ class DSProvider { JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { let _this = this; - id = DSUtils.resolveId(_this.definitions[resourceName], id); + id = resolveId(_this.definitions[resourceName], id); if (!_this.definitions[resourceName]) { throw new DSErrors.NER(resourceName); - } else if (!DSUtils.isString(id) && !DSUtils.isNumber(id)) { + } else if (!isString(id) && !isNumber(id)) { throw new DSErrors.IA('"id" must be a string or a number!'); - } else if (!DSUtils.isObject(scope)) { + } else if (!isObject(scope)) { throw new DSErrors.IA('"scope" must be an object!'); - } else if (!DSUtils.isString(expr)) { + } else if (!isString(expr)) { throw new DSErrors.IA('"expr" must be a string!'); } @@ -169,7 +138,7 @@ class DSProvider { if (item) { _this.compute(resourceName, id); } - DSUtils.set(scope, expr, item); + set(scope, expr, item); if (cb) { cb(null, item); } @@ -250,265 +219,19 @@ class DSProvider { } } angular.module('js-data', ['ng']) - .value('DSUtils', JSData.DSUtils) - .value('DSErrors', JSData.DSErrors) - .provider('DS', DSProvider); + .value('DSUtils', DSUtils) + .value('DSErrors', DSErrors) + .value('DSVersion', JSData.version) + .provider('DS', DSProvider) + .provider('DSHttpAdapter', DSHttpAdapterProvider) + .run(['DS', 'DSHttpAdapter', (DS, DSHttpAdapter) => { + DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); + }]); for (var i = 0; i < adapters.length; i++) { registerAdapter(adapters[i]); } -if (!httpLoaded) { - - class Defaults { - queryTransform(resourceConfig, params) { - return params; - } - - deserialize(resourceConfig, data) { - return data ? ('data' in data ? data.data : data) : data; - } - - serialize(resourceConfig, data) { - return data; - } - - log() { - - } - - error() { - - } - } - let defaultsPrototype = Defaults.prototype; - - defaultsPrototype.basePath = ''; - - defaultsPrototype.forceTrailingSlash = ''; - - defaultsPrototype.httpConfig = {}; - - class DSHttpAdapter { - constructor(options) { - this.defaults = new Defaults(); - if (console) { - this.defaults.log = (a, b) => console[typeof console.info === 'function' ? 'info' : 'log'](a, b); - } - if (console) { - this.defaults.error = (a, b) => console[typeof console.error === 'function' ? 'error' : 'log'](a, b); - } - deepMixIn(this.defaults, options); - } - - getPath(method, resourceConfig, id, options) { - let _this = this; - options = options || {}; - let args = [ - options.basePath || _this.defaults.basePath || resourceConfig.basePath, - resourceConfig.getEndpoint((isString(id) || isNumber(id) || method === 'create') ? id : null, options) - ]; - if (method === 'find' || method === 'update' || method === 'destroy') { - args.push(id); - } - return makePath.apply(DSUtils, args); - } - - GET(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'get'; - } - return this.HTTP(deepMixIn(config, { - url - })); - } - - POST(url, attrs, config) { - config = config || {}; - config = DSUtils.copy(config); - if (!('method' in config)) { - config.method = 'post'; - } - return this.HTTP(deepMixIn(config, { - url, - data: attrs - })); - } - - PUT(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'put'; - } - return this.HTTP(deepMixIn(config, { - url, - data: attrs || {} - })); - } - - DEL(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'delete'; - } - return this.HTTP(deepMixIn(config, { - url - })); - } - - find(resourceConfig, id, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.GET( - _this.getPath('find', resourceConfig, id, options), - options - ).then(data => { - let item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - return !item ? JSData.DSUtils.Promise.reject(new Error('Not Found!')) : item; - }); - } - - findAll(resourceConfig, params, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return _this.GET( - _this.getPath('findAll', resourceConfig, params, options), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - - create(resourceConfig, attrs, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.POST( - _this.getPath('create', resourceConfig, attrs, options), - (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - - update(resourceConfig, id, attrs, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.PUT( - _this.getPath('update', resourceConfig, id, options), - (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - - updateAll(resourceConfig, attrs, params, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.PUT( - _this.getPath('updateAll', resourceConfig, attrs, options), - (options.serialize ? options.serialize : _this.defaults.serialize)(resourceConfig, attrs), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - - destroy(resourceConfig, id, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.DEL( - _this.getPath('destroy', resourceConfig, id, options), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - - destroyAll(resourceConfig, params, options) { - let _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.DEL( - _this.getPath('destroyAll', resourceConfig, params, options), - options - ).then(data => (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data)); - } - } - - let dsHttpAdapterPrototype = DSHttpAdapter.prototype; - - class DSHttpAdapterProvider { - constructor() { - let _this = this; - _this.defaults = {}; - _this.$get = ['$http', 'DS', '$q', ($http, DS, $q) => { - dsHttpAdapterPrototype.HTTP = function (config) { - let _this = this; - let start = new Date(); - config = copy(config); - config = deepMixIn(config, _this.defaults.httpConfig); - if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { - config.url += '/'; - } - config.method = config.method.toUpperCase(); - if (typeof config.data === 'object') { - config.data = removeCircular(config.data); - } - let suffix = config.suffix || _this.defaults.suffix; - if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { - config.url += suffix; - } - - function logResponse(data) { - let str = `${start.toUTCString()} - ${data.config.method.toUpperCase()} ${data.config.url} - ${data.status} ${(new Date().getTime() - start.getTime())}ms`; - if (data.status >= 200 && data.status < 300) { - if (_this.defaults.log) { - _this.defaults.log(str, data); - } - return data; - } else { - if (_this.defaults.error) { - _this.defaults.error(`FAILED: ${str}`, data); - } - return $q.reject(data); - } - } - - return $http(config).then(logResponse, logResponse); - }; - - let adapter = new DSHttpAdapter(_this.defaults); - DS.registerAdapter('http', adapter, { 'default': true }); - return adapter; - }]; - } - } - angular.module('js-data').provider('DSHttpAdapter', DSHttpAdapterProvider); -} -angular.module('js-data').run(['DS', 'DSHttpAdapter', (DS, DSHttpAdapter) => DS.registerAdapter('http', DSHttpAdapter, { 'default': true })]); - // return the module name export default 'js-data'; diff --git a/test/datastore/async_methods/create.test.js b/test/datastore/async_methods/create.test.js index 0564ef3..8679fc2 100644 --- a/test/datastore/async_methods/create.test.js +++ b/test/datastore/async_methods/create.test.js @@ -177,7 +177,7 @@ describe('DS.create', function () { $httpBackend.flush(); }); it('should find inverse links', function () { - DS.inject('organization', { + var organization = DS.inject('organization', { id: 77 }); @@ -189,15 +189,14 @@ describe('DS.create', function () { DS.create('user', { organizationId: 77, id: 88 - }, { upsert: false, findBelongsTo: true }).then(function (user) { - var organization = DS.link('organization', 77, ['user']); + }, { upsert: false }).then(function (user) { assert.isArray(organization.users); assert.equal(1, organization.users.length); assert.isObject(user.organization); assert.isTrue(user.organization === organization); assert.isTrue(user === organization.users[0]); }, function () { - fail('Should not have succeeded!'); + fail('Should not have failed!'); }); $httpBackend.flush(); diff --git a/test/datastore/async_methods/loadRelations.test.js b/test/datastore/async_methods/loadRelations.test.js index 459cdd6..d6f2abb 100644 --- a/test/datastore/async_methods/loadRelations.test.js +++ b/test/datastore/async_methods/loadRelations.test.js @@ -12,7 +12,7 @@ describe('DS.loadRelations', function () { $httpBackend.expectGET('http://test.angular-cache.com/profile?approvedBy=10&userId=10').respond(200, [profile15]); $httpBackend.expectGET('http://test.angular-cache.com/organization/14?approvedBy=10').respond(200, organization14); - DS.loadRelations('user', 10, ['comment', 'profile', 'organization'], { params: { approvedBy: 10 } }).then(function (user) { + DS.loadRelations('user', 10, ['comment', 'profile', 'organization'], { params: { approvedBy: 10 }, findStrictCache: true }).then(function (user) { try { assert.deepEqual(user.comments[0].id, DS.get('comment', user.comments[0].id).id); assert.deepEqual(user.comments[0].user, DS.get('comment', user.comments[0].id).user); @@ -26,7 +26,7 @@ describe('DS.loadRelations', function () { DS.inject('comment', comment19); $httpBackend.expectGET('http://test.angular-cache.com/user/20').respond(200, user20); $httpBackend.expectGET('http://test.angular-cache.com/user/19').respond(200, user19); - DS.loadRelations('comment', 19, ['user']).then(function (comment) { + DS.loadRelations('comment', 19, ['user'], { findStrictCache: true }).then(function (comment) { try { assert.isObject(comment.user); assert.equal(comment.user.id, user20.id); @@ -49,7 +49,9 @@ describe('DS.loadRelations', function () { fail(err); }); - $httpBackend.flush(); + setTimeout(function () { + $httpBackend.flush(); + }, 30); }); it('should get an item from the server but not store it if cacheResponse is false', function () { DS.inject('user', { @@ -66,7 +68,7 @@ describe('DS.loadRelations', function () { $httpBackend.expectGET('http://test.angular-cache.com/profile?userId=10').respond(200, [profile15]); $httpBackend.expectGET('http://test.angular-cache.com/organization/14').respond(200, organization14); - DS.loadRelations('user', 10, ['comment', 'profile', 'organization'], { cacheResponse: false }).then(function (user) { + DS.loadRelations('user', 10, ['comment', 'profile', 'organization'], { cacheResponse: false, findStrictCache: true }).then(function (user) { assert.deepEqual(angular.toJson(user.comments), angular.toJson([ comment11, comment12, @@ -80,11 +82,13 @@ describe('DS.loadRelations', function () { assert.isUndefined(DS.get('comment', 13)); assert.isUndefined(DS.get('organization', 14)); assert.isUndefined(DS.get('profile', 15)); - }, function () { + }).catch(function (e) { fail('should not have failed!'); }); - $httpBackend.flush(); + setTimeout(function () { + $httpBackend.flush(); + }, 30); }); it('should correctly propagate errors', function () { DS.inject('user', { @@ -117,7 +121,7 @@ describe('DS.loadRelations', function () { $httpBackend.expectGET('http://test.angular-cache.com/organization/14/user').respond(200, [copy]); - DS.loadRelations('organization', organization, ['user']).then(function (organization) { + DS.loadRelations('organization', organization, ['user'], { findStrictCache: true }).then(function (organization) { assert.equal(organization.users[0].id, 10); $httpBackend.expectGET('http://test.angular-cache.com/organization/14/user/10/comment').respond(200, [comment11, comment12]); From ab5575c5c1b05b26f66c3a83851e9650d79be165 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sun, 19 Apr 2015 20:07:04 -0600 Subject: [PATCH 2/9] Stable Version 3.0.0-beta.2. --- .gitignore | 2 ++ CHANGELOG.md | 10 ++++++++++ Gruntfile.js | 2 +- bower.json | 3 +-- build_examples/browserify/README.md | 3 +++ build_examples/browserify/app.js | 17 +++++++++++++++++ build_examples/browserify/index.html | 11 +++++++++++ build_examples/r.js/index.html | 4 ++-- build_examples/r.js/main.js | 5 ++--- build_examples/webpack/README.md | 3 +++ build_examples/webpack/app.js | 17 +++++++++++++++++ build_examples/webpack/index.html | 11 +++++++++++ build_examples/webpack/webpack.config.js | 12 ++++++++++++ dist/js-data-angular.js | 4 ++-- dist/js-data-angular.min.js | 4 ++-- dist/js-data-angular.min.map | 2 +- package.json | 2 +- 17 files changed, 98 insertions(+), 14 deletions(-) create mode 100644 build_examples/browserify/README.md create mode 100644 build_examples/browserify/app.js create mode 100644 build_examples/browserify/index.html create mode 100644 build_examples/webpack/README.md create mode 100644 build_examples/webpack/app.js create mode 100644 build_examples/webpack/index.html create mode 100644 build_examples/webpack/webpack.config.js diff --git a/.gitignore b/.gitignore index e2c404a..1a7da08 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ bower_components/ .idea/ build_examples/r.js/bundle.js +build_examples/browserify/bundle.js +build_examples/webpack/bundle.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b2c6e8..3de7929 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ +##### 3.0.0-beta.2 - 19 April 2015 + +Added examples of various build setups `./build_examples/` + ##### 3.0.0-beta.1 - 17 April 2015 +###### Backwards compatible API changes +- #306 - Keep it DRY + +###### Other +- #314 - Switch to using peerDependencies + ##### 2.4.0 - 15 April 2015 ###### Backwards compatible API changes diff --git a/Gruntfile.js b/Gruntfile.js index cd74a22..7e41652 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -96,7 +96,7 @@ module.exports = function (grunt) { }, externals: { 'js-data': { - amd: 'JSData', + amd: 'js-data', commonjs: 'js-data', commonjs2: 'js-data', root: 'JSData' diff --git a/bower.json b/bower.json index ce47a82..3d95803 100644 --- a/bower.json +++ b/bower.json @@ -25,8 +25,7 @@ "angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5", "angular-mocks-1.2.16": "angular-mocks#1.2.16", "angular-mocks-1.2.25": "angular-mocks#1.2.25", - "angular-mocks-1.3.2": "angular-mocks#1.3.2", - "requirejs": "~2.1.17" + "angular-mocks-1.3.2": "angular-mocks#1.3.2" }, "dependencies": { "js-data": "2.0.0-beta.3", diff --git a/build_examples/browserify/README.md b/build_examples/browserify/README.md new file mode 100644 index 0000000..2fd013c --- /dev/null +++ b/build_examples/browserify/README.md @@ -0,0 +1,3 @@ +`browserify -x axios app.js > bundle.js` will produce `bundle.js` + +Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/build_examples/browserify/app.js b/build_examples/browserify/app.js new file mode 100644 index 0000000..542325e --- /dev/null +++ b/build_examples/browserify/app.js @@ -0,0 +1,17 @@ +// this is what you would do in a real app +// var angular = require('angular'); + +// for the example to work +var angular = require('../../node_modules/angular'); + +console.log(angular); + +angular.module('app', [ + // this is what you would do in a real app + // require('js-data-angular') + + // for the example to work + require('../../dist/js-data-angular.js') +]).run(function (DS, DSVersion, $rootScope) { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; +}); diff --git a/build_examples/browserify/index.html b/build_examples/browserify/index.html new file mode 100644 index 0000000..9769ccd --- /dev/null +++ b/build_examples/browserify/index.html @@ -0,0 +1,11 @@ + + + + My App + + + + +

{{ test }}

+ + diff --git a/build_examples/r.js/index.html b/build_examples/r.js/index.html index 582dbb7..781e49d 100644 --- a/build_examples/r.js/index.html +++ b/build_examples/r.js/index.html @@ -3,10 +3,10 @@ My App - + - +

{{ test }}

diff --git a/build_examples/r.js/main.js b/build_examples/r.js/main.js index 6e87465..f3e8fb5 100644 --- a/build_examples/r.js/main.js +++ b/build_examples/r.js/main.js @@ -2,7 +2,7 @@ require.config({ paths: { angular: '../../bower_components/angular/angular', 'js-data-angular': '../../dist/js-data-angular', - 'JSData': '../../bower_components/js-data/dist/js-data' + 'js-data': '../../bower_components/js-data/dist/js-data' }, shim: { 'angular': { @@ -13,8 +13,7 @@ require.config({ require([ 'angular', - 'app', - 'JSData' + 'app' ], function (angular, app) { angular.element(document.getElementsByTagName('html')[0]).ready(function () { // bootstrap the app manually diff --git a/build_examples/webpack/README.md b/build_examples/webpack/README.md new file mode 100644 index 0000000..2fd013c --- /dev/null +++ b/build_examples/webpack/README.md @@ -0,0 +1,3 @@ +`browserify -x axios app.js > bundle.js` will produce `bundle.js` + +Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/build_examples/webpack/app.js b/build_examples/webpack/app.js new file mode 100644 index 0000000..542325e --- /dev/null +++ b/build_examples/webpack/app.js @@ -0,0 +1,17 @@ +// this is what you would do in a real app +// var angular = require('angular'); + +// for the example to work +var angular = require('../../node_modules/angular'); + +console.log(angular); + +angular.module('app', [ + // this is what you would do in a real app + // require('js-data-angular') + + // for the example to work + require('../../dist/js-data-angular.js') +]).run(function (DS, DSVersion, $rootScope) { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; +}); diff --git a/build_examples/webpack/index.html b/build_examples/webpack/index.html new file mode 100644 index 0000000..9769ccd --- /dev/null +++ b/build_examples/webpack/index.html @@ -0,0 +1,11 @@ + + + + My App + + + + +

{{ test }}

+ + diff --git a/build_examples/webpack/webpack.config.js b/build_examples/webpack/webpack.config.js new file mode 100644 index 0000000..fc1fbc3 --- /dev/null +++ b/build_examples/webpack/webpack.config.js @@ -0,0 +1,12 @@ +module.exports = { + entry: './app.js', + output: { + filename: 'bundle.js' + }, + externals: ['axios'], + resolve: { + alias: { + 'js-data-angular': '../dist/js-data-angular.js' + } + } +}; diff --git a/dist/js-data-angular.js b/dist/js-data-angular.js index 3db2b58..99c2696 100644 --- a/dist/js-data-angular.js +++ b/dist/js-data-angular.js @@ -1,6 +1,6 @@ /*! * js-data-angular - * @version 3.0.0-beta.1 - Homepage + * @version 3.0.0-beta.2 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -11,7 +11,7 @@ if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }())); else if(typeof define === 'function' && define.amd) - define(["JSData", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { + define(["js-data", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root["axios"]); }); else if(typeof exports === 'object') diff --git a/dist/js-data-angular.min.js b/dist/js-data-angular.min.js index 907995d..a8107e4 100644 --- a/dist/js-data-angular.min.js +++ b/dist/js-data-angular.min.js @@ -1,6 +1,6 @@ /*! * js-data-angular -* @version 3.0.0-beta.1 - Homepage +* @version 3.0.0-beta.2 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -8,5 +8,5 @@ * @overview Angular wrapper for js-data. */ -!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):"function"==typeof define&&define.amd?define(["JSData","angular"],function(c,d){return b(c,d,a.axios)}):"object"==typeof exports?exports.jsDataAngularModuleName=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular,a.axios)}(this,function(a,b,c){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&(a.loaded=!0,l["default"].module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var e=function(a){return a&&a.__esModule?a:{"default":a}},f=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var g=c(1),h=e(g),i=c(4),j=e(i),k=c(2),l=e(k),m=h["default"].DSUtils,n=h["default"].DSErrors,o=m.isString,p=m.isNumber,q=m.isObject,r=m.set,s=m.resolveId,t=[{project:"js-data-localstorage",name:"localstorage","class":"DSLocalStorageAdapter"},{project:"js-data-localforage",name:"localforage","class":"DSLocalForageAdapter"},{project:"js-data-firebase",name:"firebase","class":"DSFirebaseAdapter"},{project:"js-data-sql",name:"sql","class":"DSSqlAdapter"}],u=["compute","digest","eject","inject"],v=function y(){f(this,y);var a={};this.defaults=a,this.$get=["$http","DS",function(b,c){a.http=a.http||b;var d=new j["default"](a);return c.registerAdapter("http",d,{"default":!0}),d}]},w=function z(){function a(){function a(a){var b=g.defer();try{a.call(void 0,l["default"].bind(b,b.resolve),l["default"].bind(b,b.reject))}catch(c){b.reject(c)}return b.promise}for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var f=d[d.length-2],g=d[d.length-1],i=new h["default"].DS(b.defaults),j={};if(a.all=g.all,a.when=g.when,a.reject=g.reject,m.Promise=a,d.length)for(var k=0;kd;d++)c[d]=arguments[d];return f.$$phase?j[a].apply(i,c):f.$apply(function(){return j[a].apply(i,c)})}},p=0;p=200&&a.status<300?(c.defaults.log&&c.defaults.log(b,a),a):(c.defaults.error&&c.defaults.error("'FAILED: "+b,a),k.Promise.reject(a))}var c=this,d=new Date;a=n(a),a=l(a,c.defaults.httpConfig),c.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),"object"==typeof a.data&&(a.data=m(a.data)),a.method=a.method.toUpperCase();var e=a.suffix||c.defaults.suffix;if(e&&a.url.substr(a.url.length-e.length)!==e&&(a.url+=e),!this.http)throw new Error("You have not configured this adapter with an http library!");return this.http(a).then(b,b)}},{key:"GET",value:function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(l(b,{url:a}))}},{key:"POST",value:function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(l(c,{url:a,data:b}))}},{key:"PUT",value:function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(l(c,{url:a,data:b||{}}))}},{key:"DEL",value:function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(l(b,{url:a}))}},{key:"find",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.GET(d.getPath("find",a,b,c),c).then(function(b){var e=(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b);return e?e:k.Promise.reject(new Error("Not Found!"))})}},{key:"findAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),d.GET(d.getPath("findAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"create",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.POST(d.getPath("create",a,b,c),c.serialize?c.serialize(a,b):d.defaults.serialize(a,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"update",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},d.params=e.defaults.queryTransform(a,d.params),e.PUT(e.getPath("update",a,b,d),d.serialize?d.serialize(a,c):e.defaults.serialize(a,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},c&&(c=e.defaults.queryTransform(a,c),l(d.params,c)),this.PUT(e.getPath("updateAll",a,b,d),d.serialize?d.serialize(a,b):e.defaults.serialize(a,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"destroy",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.DEL(d.getPath("destroy",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"destroyAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),this.DEL(d.getPath("destroyAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}}]),a}();b["default"]=t,a.exports=b["default"]},function(a,b,d){if("undefined"==typeof c){var e=new Error('Cannot find module "axios"');throw e.code="MODULE_NOT_FOUND",e}a.exports=c}])}); +!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):"function"==typeof define&&define.amd?define(["js-data","angular"],function(c,d){return b(c,d,a.axios)}):"object"==typeof exports?exports.jsDataAngularModuleName=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular,a.axios)}(this,function(a,b,c){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&(a.loaded=!0,l["default"].module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var e=function(a){return a&&a.__esModule?a:{"default":a}},f=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var g=c(1),h=e(g),i=c(4),j=e(i),k=c(2),l=e(k),m=h["default"].DSUtils,n=h["default"].DSErrors,o=m.isString,p=m.isNumber,q=m.isObject,r=m.set,s=m.resolveId,t=[{project:"js-data-localstorage",name:"localstorage","class":"DSLocalStorageAdapter"},{project:"js-data-localforage",name:"localforage","class":"DSLocalForageAdapter"},{project:"js-data-firebase",name:"firebase","class":"DSFirebaseAdapter"},{project:"js-data-sql",name:"sql","class":"DSSqlAdapter"}],u=["compute","digest","eject","inject"],v=function y(){f(this,y);var a={};this.defaults=a,this.$get=["$http","DS",function(b,c){a.http=a.http||b;var d=new j["default"](a);return c.registerAdapter("http",d,{"default":!0}),d}]},w=function z(){function a(){function a(a){var b=g.defer();try{a.call(void 0,l["default"].bind(b,b.resolve),l["default"].bind(b,b.reject))}catch(c){b.reject(c)}return b.promise}for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var f=d[d.length-2],g=d[d.length-1],i=new h["default"].DS(b.defaults),j={};if(a.all=g.all,a.when=g.when,a.reject=g.reject,m.Promise=a,d.length)for(var k=0;kd;d++)c[d]=arguments[d];return f.$$phase?j[a].apply(i,c):f.$apply(function(){return j[a].apply(i,c)})}},p=0;p=200&&a.status<300?(c.defaults.log&&c.defaults.log(b,a),a):(c.defaults.error&&c.defaults.error("'FAILED: "+b,a),k.Promise.reject(a))}var c=this,d=new Date;a=n(a),a=l(a,c.defaults.httpConfig),c.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),"object"==typeof a.data&&(a.data=m(a.data)),a.method=a.method.toUpperCase();var e=a.suffix||c.defaults.suffix;if(e&&a.url.substr(a.url.length-e.length)!==e&&(a.url+=e),!this.http)throw new Error("You have not configured this adapter with an http library!");return this.http(a).then(b,b)}},{key:"GET",value:function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(l(b,{url:a}))}},{key:"POST",value:function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(l(c,{url:a,data:b}))}},{key:"PUT",value:function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(l(c,{url:a,data:b||{}}))}},{key:"DEL",value:function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(l(b,{url:a}))}},{key:"find",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.GET(d.getPath("find",a,b,c),c).then(function(b){var e=(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b);return e?e:k.Promise.reject(new Error("Not Found!"))})}},{key:"findAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),d.GET(d.getPath("findAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"create",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.POST(d.getPath("create",a,b,c),c.serialize?c.serialize(a,b):d.defaults.serialize(a,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"update",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},d.params=e.defaults.queryTransform(a,d.params),e.PUT(e.getPath("update",a,b,d),d.serialize?d.serialize(a,c):e.defaults.serialize(a,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},c&&(c=e.defaults.queryTransform(a,c),l(d.params,c)),this.PUT(e.getPath("updateAll",a,b,d),d.serialize?d.serialize(a,b):e.defaults.serialize(a,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"destroy",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.DEL(d.getPath("destroy",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"destroyAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),this.DEL(d.getPath("destroyAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}}]),a}();b["default"]=t,a.exports=b["default"]},function(a,b,d){if("undefined"==typeof c){var e=new Error('Cannot find module "axios"');throw e.code="MODULE_NOT_FOUND",e}a.exports=c}])}); //# sourceMappingURL=js-data-angular.min.map \ No newline at end of file diff --git a/dist/js-data-angular.min.map b/dist/js-data-angular.min.map index ef1338d..d4373a4 100644 --- a/dist/js-data-angular.min.map +++ b/dist/js-data-angular.min.map @@ -1 +1 @@ -{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","this","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","registerAdapter","adapter","Adapter","undefined","project","window","_angular2","provider","_this","defaults","$get","_interopRequireWildcard","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_JSData","_JSData2","_DSHttpAdapter","_DSHttpAdapter2","_angular","DSUtils","DSErrors","isString","isNumber","isObject","set","resolveId","adapters","name","class","functionsToWrap","DSHttpAdapterProvider","$http","DS","http","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","length","args","Array","_key","$rootScope","store","originals","all","when","Promise","i","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","prototype","bindAll","resourceName","params","scope","expr","cb","definitions","NER","IA","lastModified","items","filter","bindOne","item","get","compute","version","run","DSHttpAdapter","webpackContext","req","webpackContextResolve","map","Error","keys","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","axios","deepMixIn","removeCircular","copy","makePath","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","options","console","log","a","b","info","error","method","getEndpoint","config","logResponse","str","start","toUTCString","toUpperCase","url","status","Date","getTime","suffix","substr","then","HTTP","attrs","queryTransform","GET","getPath","deserialize","POST","serialize","PUT","DEL","code"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","this","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","registerAdapter","adapter","Adapter","undefined","project","window","_angular2","provider","_this","defaults","$get","_interopRequireWildcard","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_JSData","_JSData2","_DSHttpAdapter","_DSHttpAdapter2","_angular","DSUtils","DSErrors","isString","isNumber","isObject","set","resolveId","adapters","name","class","functionsToWrap","DSHttpAdapterProvider","$http","DS","http","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","length","args","Array","_key","$rootScope","store","originals","all","when","Promise","i","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","prototype","bindAll","resourceName","params","scope","expr","cb","definitions","NER","IA","lastModified","items","filter","bindOne","item","get","compute","version","run","DSHttpAdapter","webpackContext","req","webpackContextResolve","map","Error","keys","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","axios","deepMixIn","removeCircular","copy","makePath","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","options","console","log","a","b","info","error","method","getEndpoint","config","logResponse","str","start","toUTCString","toUpperCase","url","status","Date","getTime","suffix","substr","then","HTTP","attrs","queryTransform","GET","getPath","deserialize","POST","serialize","PUT","DEL","code"],"mappings":"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"} \ No newline at end of file diff --git a/package.json b/package.json index 8027dbf..cab54fd 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-data-angular", "description": "Angular wrapper for js-data.", - "version": "3.0.0-beta.1", + "version": "3.0.0-beta.2", "homepage": "http://www.js-data.io/docs/js-data-angular", "repository": { "type": "git", From c083e7ed43d51c949777eedf2f737781297667a2 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sun, 28 Jun 2015 15:15:07 -0400 Subject: [PATCH 3/9] Stable Version 3.0.0-rc.1. --- CHANGELOG.md | 4 + README.md | 4 +- bower.json | 7 +- build_examples/browserify/README.md | 2 +- build_examples/r.js/README.md | 2 +- build_examples/webpack/README.md | 2 +- dist/js-data-angular.js | 119 +++++++++++++++++----------- dist/js-data-angular.min.js | 4 +- dist/js-data-angular.min.map | 2 +- package.json | 32 ++++---- src/index.js | 9 ++- 11 files changed, 108 insertions(+), 79 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3de7929..c1652ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##### 3.0.0-rc.1 - 28 June 2015 + +Stable Version 3.0.0-rc.1 + ##### 3.0.0-beta.2 - 19 April 2015 Added examples of various build setups `./build_examples/` diff --git a/README.md b/README.md index c71a740..caf9d4d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Angular wrapper for [js-data](http://www.js-data.io). #### What happened Angular-data? -Js-data-angular is Angular-data 2.0, with [js-data](http://www.js-data.io) as the framework-agnostic core. Documentation for Angular-data 1.x can be found at [angular-data.pseudobry.com](http://angular-data.pseudobry.com). +Angular-data is deprecated. js-data + js-data-angular is the new hotness. ### Guides - [Angular + JSData (js-data-angular)](http://www.js-data.io/docs/js-data-angular) @@ -41,7 +41,7 @@ __Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js- __Status:__ -[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-angular.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-angular) [![Coverage Status](https://img.shields.io/coveralls/js-data/js-data-angular/master.svg?style=flat-square)](https://coveralls.io/r/js-data/js-data-angular?branch=master) [![Codacity](https://img.shields.io/codacy/e7690b906dfa471ebcc8b2bdc52e9662.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-angular/dashboard) +[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-angular.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-angular) [![Coverage Status](https://img.shields.io/coveralls/js-data/js-data-angular/master.svg?style=flat-square)](https://coveralls.io/r/js-data/js-data-angular?branch=master) [![Codacity](https://img.shields.io/codacy/e7690b906dfa471ebcc8b2bdc52e9662.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-angular/dashboard) __Supported Platforms:__ diff --git a/bower.json b/bower.json index 3d95803..f0f7b25 100644 --- a/bower.json +++ b/bower.json @@ -28,11 +28,8 @@ "angular-mocks-1.3.2": "angular-mocks#1.3.2" }, "dependencies": { - "js-data": "2.0.0-beta.3", - "js-data-http": "2.0.0-beta.3", + "js-data": "2.0.0-rc.1", + "js-data-http": "2.0.0-rc.1", "angular": ">=1.1.0" - }, - "resolutions": { - "angular": "1.3.2" } } diff --git a/build_examples/browserify/README.md b/build_examples/browserify/README.md index 2fd013c..bac593a 100644 --- a/build_examples/browserify/README.md +++ b/build_examples/browserify/README.md @@ -1,3 +1,3 @@ -`browserify -x axios app.js > bundle.js` will produce `bundle.js` +Running `browserify -x axios app.js > bundle.js` in this directory will produce `bundle.js` Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/build_examples/r.js/README.md b/build_examples/r.js/README.md index f72e67f..0632f37 100644 --- a/build_examples/r.js/README.md +++ b/build_examples/r.js/README.md @@ -1,3 +1,3 @@ -`r.js -o require.config.js` will produce `bundle.js` +Running `r.js -o require.config.js` in this directory will produce `bundle.js` In `index.html` switch `script/main` between `main` (load scripts dynamically) and `bundle` (load bundled scripts) diff --git a/build_examples/webpack/README.md b/build_examples/webpack/README.md index 2fd013c..14fa7b9 100644 --- a/build_examples/webpack/README.md +++ b/build_examples/webpack/README.md @@ -1,3 +1,3 @@ -`browserify -x axios app.js > bundle.js` will produce `bundle.js` +Running `webpack` in this directory will produce `bundle.js` Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/dist/js-data-angular.js b/dist/js-data-angular.js index 99c2696..c8d910f 100644 --- a/dist/js-data-angular.js +++ b/dist/js-data-angular.js @@ -1,6 +1,6 @@ /*! * js-data-angular - * @version 3.0.0-beta.2 - Homepage + * @version 3.0.0-rc.1 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -65,29 +65,15 @@ return /******/ (function(modules) { // webpackBootstrap /* 0 */ /***/ function(module, exports, __webpack_require__) { - var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - - Object.defineProperty(exports, '__esModule', { - value: true - }); /*jshint loopfunc:true*/ + var JSData = __webpack_require__(1); + var DSHttpAdapter = __webpack_require__(4); + var angular = __webpack_require__(2); - var _JSData = __webpack_require__(1); - - var _JSData2 = _interopRequireWildcard(_JSData); - - var _DSHttpAdapter = __webpack_require__(4); - - var _DSHttpAdapter2 = _interopRequireWildcard(_DSHttpAdapter); - - var _angular = __webpack_require__(2); - - var _angular2 = _interopRequireWildcard(_angular); - - var DSUtils = _JSData2['default'].DSUtils; - var DSErrors = _JSData2['default'].DSErrors; + var DSUtils = JSData.DSUtils; + var DSErrors = JSData.DSErrors; var isString = DSUtils.isString; var isNumber = DSUtils.isNumber; var isObject = DSUtils.isObject; @@ -127,7 +113,7 @@ return /******/ (function(modules) { // webpackBootstrap if (Adapter) { adapter.loaded = true; - _angular2['default'].module('js-data').provider(adapter['class'], function () { + angular.module('js-data').provider(adapter['class'], function () { var _this = this; _this.defaults = {}; _this.$get = [function () { @@ -145,7 +131,7 @@ return /******/ (function(modules) { // webpackBootstrap this.$get = ['$http', 'DS', function ($http, DS) { defaults.http = defaults.http || $http; - var adapter = new _DSHttpAdapter2['default'](defaults); + var adapter = new DSHttpAdapter(defaults); DS.registerAdapter('http', adapter, { 'default': true }); return adapter; }]; @@ -165,7 +151,7 @@ return /******/ (function(modules) { // webpackBootstrap _this.defaults = {}; - _JSData2['default'].DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { + JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { var _this = this; params = params || {}; @@ -199,7 +185,7 @@ return /******/ (function(modules) { // webpackBootstrap } }; - _JSData2['default'].DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { + JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { var _this = this; id = resolveId(_this.definitions[resourceName], id); @@ -242,14 +228,14 @@ return /******/ (function(modules) { // webpackBootstrap var $rootScope = args[args.length - 2]; var $q = args[args.length - 1]; - var store = new _JSData2['default'].DS(_this.defaults); + var store = new JSData.DS(_this.defaults); var originals = {}; function QPromise(executor) { var deferred = $q.defer(); try { - executor.call(undefined, _angular2['default'].bind(deferred, deferred.resolve), _angular2['default'].bind(deferred, deferred.reject)); + executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); } catch (err) { deferred.reject(err); } @@ -315,7 +301,7 @@ return /******/ (function(modules) { // webpackBootstrap _this.$get = deps; }; - _angular2['default'].module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', _JSData2['default'].version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { + angular.module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', JSData.version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); }]); @@ -324,8 +310,8 @@ return /******/ (function(modules) { // webpackBootstrap } // return the module name - exports['default'] = 'js-data'; - module.exports = exports['default']; + module.exports = 'js-data'; + module.exports.name = 'js-data'; /***/ }, /* 1 */ @@ -362,27 +348,18 @@ return /******/ (function(modules) { // webpackBootstrap /* 4 */ /***/ function(module, exports, __webpack_require__) { - var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }; - - var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }; - var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - Object.defineProperty(exports, '__esModule', { - value: true - }); - - var _JSData = __webpack_require__(1); - - var _JSData2 = _interopRequireWildcard(_JSData); + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } + var JSData = __webpack_require__(1); var axios = null; try { axios = __webpack_require__(5); } catch (e) {} - var DSUtils = _JSData2['default'].DSUtils; + var DSUtils = JSData.DSUtils; var deepMixIn = DSUtils.deepMixIn; var removeCircular = DSUtils.removeCircular; var copy = DSUtils.copy; @@ -449,11 +426,62 @@ return /******/ (function(modules) { // webpackBootstrap } _createClass(DSHttpAdapter, [{ + key: 'getEndpoint', + value: function getEndpoint(resourceConfig, id, options) { + var _this2 = this; + + options = options || {}; + options.params = options.params || {}; + + var item = undefined; + var parentKey = resourceConfig.parentKey; + var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : resourceConfig.endpoint; + var parentField = resourceConfig.parentField; + var parentDef = resourceConfig.getResource(resourceConfig.parent); + var parentId = options.params[parentKey]; + + if (parentId === false || !parentKey || !parentDef) { + if (parentId === false) { + delete options.params[parentKey]; + } + return endpoint; + } else { + delete options.params[parentKey]; + + if (DSUtils._sn(id)) { + item = resourceConfig.get(id); + } else if (DSUtils._o(id)) { + item = id; + } + + if (item) { + parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); + } + + if (parentId) { + var _ret = (function () { + delete options.endpoint; + var _options = {}; + DSUtils.forOwn(options, function (value, key) { + _options[key] = value; + }); + return { + v: DSUtils.makePath(_this2.getEndpoint(parentDef, parentId, DSUtils._(parentDef, _options)), parentId, endpoint) + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + return endpoint; + } + } + } + }, { key: 'getPath', value: function getPath(method, resourceConfig, id, options) { var _this = this; options = options || {}; - var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, resourceConfig.getEndpoint(isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; + var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, this.getEndpoint(resourceConfig, isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; if (method === 'find' || method === 'update' || method === 'destroy') { args.push(id); } @@ -479,7 +507,7 @@ return /******/ (function(modules) { // webpackBootstrap } function logResponse(data) { - var str = '' + start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; + var str = start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; if (data.status >= 200 && data.status < 300) { if (_this.defaults.log) { _this.defaults.log(str, data); @@ -644,8 +672,7 @@ return /******/ (function(modules) { // webpackBootstrap return DSHttpAdapter; })(); - exports['default'] = DSHttpAdapter; - module.exports = exports['default']; + module.exports = DSHttpAdapter; /***/ }, /* 5 */ diff --git a/dist/js-data-angular.min.js b/dist/js-data-angular.min.js index a8107e4..6930ad8 100644 --- a/dist/js-data-angular.min.js +++ b/dist/js-data-angular.min.js @@ -1,6 +1,6 @@ /*! * js-data-angular -* @version 3.0.0-beta.2 - Homepage +* @version 3.0.0-rc.1 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT @@ -8,5 +8,5 @@ * @overview Angular wrapper for js-data. */ -!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):"function"==typeof define&&define.amd?define(["js-data","angular"],function(c,d){return b(c,d,a.axios)}):"object"==typeof exports?exports.jsDataAngularModuleName=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular,a.axios)}(this,function(a,b,c){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&(a.loaded=!0,l["default"].module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var e=function(a){return a&&a.__esModule?a:{"default":a}},f=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")};Object.defineProperty(b,"__esModule",{value:!0});var g=c(1),h=e(g),i=c(4),j=e(i),k=c(2),l=e(k),m=h["default"].DSUtils,n=h["default"].DSErrors,o=m.isString,p=m.isNumber,q=m.isObject,r=m.set,s=m.resolveId,t=[{project:"js-data-localstorage",name:"localstorage","class":"DSLocalStorageAdapter"},{project:"js-data-localforage",name:"localforage","class":"DSLocalForageAdapter"},{project:"js-data-firebase",name:"firebase","class":"DSFirebaseAdapter"},{project:"js-data-sql",name:"sql","class":"DSSqlAdapter"}],u=["compute","digest","eject","inject"],v=function y(){f(this,y);var a={};this.defaults=a,this.$get=["$http","DS",function(b,c){a.http=a.http||b;var d=new j["default"](a);return c.registerAdapter("http",d,{"default":!0}),d}]},w=function z(){function a(){function a(a){var b=g.defer();try{a.call(void 0,l["default"].bind(b,b.resolve),l["default"].bind(b,b.reject))}catch(c){b.reject(c)}return b.promise}for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var f=d[d.length-2],g=d[d.length-1],i=new h["default"].DS(b.defaults),j={};if(a.all=g.all,a.when=g.when,a.reject=g.reject,m.Promise=a,d.length)for(var k=0;kd;d++)c[d]=arguments[d];return f.$$phase?j[a].apply(i,c):f.$apply(function(){return j[a].apply(i,c)})}},p=0;p=200&&a.status<300?(c.defaults.log&&c.defaults.log(b,a),a):(c.defaults.error&&c.defaults.error("'FAILED: "+b,a),k.Promise.reject(a))}var c=this,d=new Date;a=n(a),a=l(a,c.defaults.httpConfig),c.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),"object"==typeof a.data&&(a.data=m(a.data)),a.method=a.method.toUpperCase();var e=a.suffix||c.defaults.suffix;if(e&&a.url.substr(a.url.length-e.length)!==e&&(a.url+=e),!this.http)throw new Error("You have not configured this adapter with an http library!");return this.http(a).then(b,b)}},{key:"GET",value:function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(l(b,{url:a}))}},{key:"POST",value:function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(l(c,{url:a,data:b}))}},{key:"PUT",value:function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(l(c,{url:a,data:b||{}}))}},{key:"DEL",value:function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(l(b,{url:a}))}},{key:"find",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.GET(d.getPath("find",a,b,c),c).then(function(b){var e=(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b);return e?e:k.Promise.reject(new Error("Not Found!"))})}},{key:"findAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),d.GET(d.getPath("findAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"create",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.POST(d.getPath("create",a,b,c),c.serialize?c.serialize(a,b):d.defaults.serialize(a,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"update",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},d.params=e.defaults.queryTransform(a,d.params),e.PUT(e.getPath("update",a,b,d),d.serialize?d.serialize(a,c):e.defaults.serialize(a,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return d=d?n(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},c&&(c=e.defaults.queryTransform(a,c),l(d.params,c)),this.PUT(e.getPath("updateAll",a,b,d),d.serialize?d.serialize(a,b):e.defaults.serialize(a,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"destroy",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.DEL(d.getPath("destroy",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"destroyAll",value:function(a,b,c){var d=this;return c=c?n(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),l(c.params,b)),this.DEL(d.getPath("destroyAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}}]),a}();b["default"]=t,a.exports=b["default"]},function(a,b,d){if("undefined"==typeof c){var e=new Error('Cannot find module "axios"');throw e.code="MODULE_NOT_FOUND",e}a.exports=c}])}); +!function(a,b){"object"==typeof exports&&"object"==typeof module?module.exports=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):"function"==typeof define&&define.amd?define(["js-data","angular"],function(c,d){return b(c,d,a.axios)}):"object"==typeof exports?exports.jsDataAngularModuleName=b(require("js-data"),require("angular"),function(){try{return require("axios")}catch(a){}}()):a.jsDataAngularModuleName=b(a.JSData,a.angular,a.axios)}(this,function(a,b,c){return function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,c){function d(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function e(a){var b=void 0;try{b=c(3)(a.project)}catch(d){}b||(b=window[a["class"]]),b&&(a.loaded=!0,h.module("js-data").provider(a["class"],function(){var a=this;a.defaults={},a.$get=[function(){return new b(a.defaults)}]}))}var f=c(1),g=c(4),h=c(2),i=f.DSUtils,j=f.DSErrors,k=i.isString,l=i.isNumber,m=i.isObject,n=i.set,o=i.resolveId,p=[{project:"js-data-localstorage",name:"localstorage","class":"DSLocalStorageAdapter"},{project:"js-data-localforage",name:"localforage","class":"DSLocalForageAdapter"},{project:"js-data-firebase",name:"firebase","class":"DSFirebaseAdapter"},{project:"js-data-sql",name:"sql","class":"DSSqlAdapter"}],q=["compute","digest","eject","inject"],r=function u(){d(this,u);var a={};this.defaults=a,this.$get=["$http","DS",function(b,c){a.http=a.http||b;var d=new g(a);return c.registerAdapter("http",d,{"default":!0}),d}]},s=function v(){function a(){function a(a){var b=j.defer();try{a.call(void 0,h.bind(b,b.resolve),h.bind(b,b.reject))}catch(c){b.reject(c)}return b.promise}for(var c=arguments.length,d=Array(c),e=0;c>e;e++)d[e]=arguments[e];var g=d[d.length-2],j=d[d.length-1],k=new f.DS(b.defaults),l={};if(a.all=j.all,a.when=j.when,a.reject=j.reject,i.Promise=a,d.length)for(var m=0;md;d++)c[d]=arguments[d];return g.$$phase?l[a].apply(k,c):g.$apply(function(){return l[a].apply(k,c)})}},r=0;r=200&&a.status<300?(c.defaults.log&&c.defaults.log(b,a),a):(c.defaults.error&&c.defaults.error("'FAILED: "+b,a),i.Promise.reject(a))}var c=this,d=new Date;a=l(a),a=j(a,c.defaults.httpConfig),c.defaults.forceTrailingSlash&&"/"!==a.url[a.url.length-1]&&(a.url+="/"),"object"==typeof a.data&&(a.data=k(a.data)),a.method=a.method.toUpperCase();var e=a.suffix||c.defaults.suffix;if(e&&a.url.substr(a.url.length-e.length)!==e&&(a.url+=e),!this.http)throw new Error("You have not configured this adapter with an http library!");return this.http(a).then(b,b)}},{key:"GET",value:function(a,b){return b=b||{},"method"in b||(b.method="get"),this.HTTP(j(b,{url:a}))}},{key:"POST",value:function(a,b,c){return c=c||{},"method"in c||(c.method="post"),this.HTTP(j(c,{url:a,data:b}))}},{key:"PUT",value:function(a,b,c){return c=c||{},"method"in c||(c.method="put"),this.HTTP(j(c,{url:a,data:b||{}}))}},{key:"DEL",value:function(a,b){return b=b||{},"method"in b||(b.method="delete"),this.HTTP(j(b,{url:a}))}},{key:"find",value:function(a,b,c){var d=this;return c=c?l(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.GET(d.getPath("find",a,b,c),c).then(function(b){var e=(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b);return e?e:i.Promise.reject(new Error("Not Found!"))})}},{key:"findAll",value:function(a,b,c){var d=this;return c=c?l(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),j(c.params,b)),d.GET(d.getPath("findAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"create",value:function(a,b,c){var d=this;return c=c?l(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.POST(d.getPath("create",a,b,c),c.serialize?c.serialize(a,b):d.defaults.serialize(a,b),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"update",value:function(a,b,c,d){var e=this;return d=d?l(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},d.params=e.defaults.queryTransform(a,d.params),e.PUT(e.getPath("update",a,b,d),d.serialize?d.serialize(a,c):e.defaults.serialize(a,c),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"updateAll",value:function(a,b,c,d){var e=this;return d=d?l(d):{},d.suffix=d.suffix||a.suffix,d.params=d.params||{},c&&(c=e.defaults.queryTransform(a,c),j(d.params,c)),this.PUT(e.getPath("updateAll",a,b,d),d.serialize?d.serialize(a,b):e.defaults.serialize(a,b),d).then(function(b){return(d.deserialize?d.deserialize:e.defaults.deserialize)(a,b)})}},{key:"destroy",value:function(a,b,c){var d=this;return c=c?l(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},c.params=d.defaults.queryTransform(a,c.params),d.DEL(d.getPath("destroy",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}},{key:"destroyAll",value:function(a,b,c){var d=this;return c=c?l(c):{},c.suffix=c.suffix||a.suffix,c.params=c.params||{},b&&(b=d.defaults.queryTransform(a,b),j(c.params,b)),this.DEL(d.getPath("destroyAll",a,b,c),c).then(function(b){return(c.deserialize?c.deserialize:d.defaults.deserialize)(a,b)})}}]),a}();a.exports=r},function(a,b,d){if("undefined"==typeof c){var e=new Error('Cannot find module "axios"');throw e.code="MODULE_NOT_FOUND",e}a.exports=c}])}); //# sourceMappingURL=js-data-angular.min.map \ No newline at end of file diff --git a/dist/js-data-angular.min.map b/dist/js-data-angular.min.map index d4373a4..5a5833b 100644 --- a/dist/js-data-angular.min.map +++ b/dist/js-data-angular.min.map @@ -1 +1 @@ -{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","this","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","registerAdapter","adapter","Adapter","undefined","project","window","_angular2","provider","_this","defaults","$get","_interopRequireWildcard","obj","__esModule","default","_classCallCheck","instance","Constructor","TypeError","Object","defineProperty","value","_JSData","_JSData2","_DSHttpAdapter","_DSHttpAdapter2","_angular","DSUtils","DSErrors","isString","isNumber","isObject","set","resolveId","adapters","name","class","functionsToWrap","DSHttpAdapterProvider","$http","DS","http","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","length","args","Array","_key","$rootScope","store","originals","all","when","Promise","i","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","prototype","bindAll","resourceName","params","scope","expr","cb","definitions","NER","IA","lastModified","items","filter","bindOne","item","get","compute","version","run","DSHttpAdapter","webpackContext","req","webpackContextResolve","map","Error","keys","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","axios","deepMixIn","removeCircular","copy","makePath","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","options","console","log","a","b","info","error","method","getEndpoint","config","logResponse","str","start","toUTCString","toUpperCase","url","status","Date","getTime","suffix","substr","then","HTTP","attrs","queryTransform","GET","getPath","deserialize","POST","serialize","PUT","DEL","code"],"mappings":"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"} \ No newline at end of file +{"version":3,"file":"js-data-angular.min.js","sources":["js-data-angular.js"],"names":["root","factory","exports","module","require","e","define","amd","__WEBPACK_EXTERNAL_MODULE_1__","__WEBPACK_EXTERNAL_MODULE_2__","this","__WEBPACK_EXTERNAL_MODULE_5__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","_classCallCheck","instance","Constructor","TypeError","registerAdapter","adapter","Adapter","undefined","project","window","angular","provider","_this","defaults","$get","JSData","DSHttpAdapter","DSUtils","DSErrors","isString","isNumber","isObject","set","resolveId","adapters","name","class","functionsToWrap","DSHttpAdapterProvider","$http","DS","http","default","DSProvider","load","QPromise","executor","deferred","$q","defer","bind","resolve","reject","err","promise","_len","arguments","length","args","Array","_key","$rootScope","store","originals","all","when","Promise","i","j","registered","_loop","k","_len2","_key2","$$phase","apply","$apply","Object","observe","$watch","Platform","performMicrotaskCheckpoint","deps","push","prototype","bindAll","resourceName","params","scope","expr","cb","definitions","NER","IA","lastModified","items","filter","bindOne","item","get","compute","value","version","run","webpackContext","req","webpackContextResolve","map","Error","keys","_createClass","defineProperties","target","props","descriptor","enumerable","configurable","writable","defineProperty","key","protoProps","staticProps","axios","deepMixIn","removeCircular","copy","makePath","Defaults","resourceConfig","data","defaultsPrototype","basePath","forceTrailingSlash","httpConfig","options","console","log","a","b","info","error","_this2","parentKey","endpoint","hasOwnProperty","parentField","parentDef","getResource","parent","parentId","_sn","_o","idAttribute","_ret","_options","forOwn","v","getEndpoint","_","method","config","logResponse","str","start","toUTCString","toUpperCase","url","status","Date","getTime","suffix","substr","then","HTTP","attrs","queryTransform","GET","getPath","deserialize","POST","serialize","PUT","DEL","code"],"mappings":"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"} \ No newline at end of file diff --git a/package.json b/package.json index cab54fd..fed3d8b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-data-angular", "description": "Angular wrapper for js-data.", - "version": "3.0.0-beta.2", + "version": "3.0.0-rc.1", "homepage": "http://www.js-data.io/docs/js-data-angular", "repository": { "type": "git", @@ -20,38 +20,38 @@ ], "main": "dist/js-data-angular.js", "devDependencies": { - "babel-core": "5.1.10", - "babel-loader": "5.0.0", + "babel-core": "5.6.15", + "babel-loader": "5.2.2", "grunt": "0.4.5", "grunt-contrib-clean": "0.6.0", "grunt-contrib-uglify": "0.9.1", "grunt-contrib-watch": "0.6.1", - "grunt-karma": "0.10.1", + "grunt-karma": "0.11.1", "grunt-karma-coveralls": "2.5.3", - "grunt-webpack": "1.0.8", + "grunt-webpack": "1.0.10", "jit-grunt": "0.9.1", "jshint-loader": "0.8.3", - "karma": "0.12.31", + "karma": "0.12.37", "karma-chai": "0.1.0", - "karma-chrome-launcher": "0.1.8", - "karma-coverage": "0.3.1", - "karma-firefox-launcher": "0.1.4", - "karma-mocha": "0.1.10", - "karma-phantomjs-launcher": "0.1.4", + "karma-chrome-launcher": "0.2.0", + "karma-coverage": "0.4.2", + "karma-firefox-launcher": "0.1.6", + "karma-mocha": "0.2.0", + "karma-phantomjs-launcher": "0.2.0", "karma-script-launcher": "0.1.0", "karma-sinon": "1.0.4", "karma-spec-reporter": "0.0.19", - "time-grunt": "1.1.1", - "webpack-dev-server": "1.8.0" + "time-grunt": "1.2.1", + "webpack-dev-server": "1.10.1" }, "scripts": { "test": "grunt test" }, "peerDependencies": { - "angular": ">=1.1.0" + "angular": ">=1.1.0", + "js-data": "2.0.0-rc.1" }, "dependencies": { - "js-data": ">=2.0.0-beta.3", - "js-data-http": ">=2.0.0-beta.3" + "js-data-http": "2.0.0-rc.1" } } diff --git a/src/index.js b/src/index.js index 4ca1d07..b8040b6 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ /*jshint loopfunc:true*/ -import JSData from 'js-data'; -import DSHttpAdapter from '../node_modules/js-data-http/src/index.js'; -import angular from 'angular'; +let JSData = require('js-data'); +let DSHttpAdapter = require('../node_modules/js-data-http/src/index.js'); +let angular = require('angular'); let { DSUtils, DSErrors } = JSData; let { isString, isNumber, isObject, set, resolveId } = DSUtils; @@ -234,4 +234,5 @@ for (var i = 0; i < adapters.length; i++) { } // return the module name -export default 'js-data'; +module.exports = 'js-data'; +module.exports.name = 'js-data'; From f272b603dbd71c187d155beee47a5c5a4d790a53 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Sun, 28 Jun 2015 15:36:43 -0400 Subject: [PATCH 4/9] Remove unused versions of angular from bower.json --- Gruntfile.js | 2 +- bower.json | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index 7e41652..4966178 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -72,7 +72,7 @@ module.exports = function (grunt) { files: [ 'bower_components/angular-1.3.2/angular.js', 'bower_components/angular-mocks-1.3.2/angular-mocks.js', - 'node_modules/js-data/dist/js-data.js', + 'node_modules/js-data/dist/js-data.min.js', 'dist/js-data-angular.min.js', 'karma.start.js', 'test/**/*.js' diff --git a/bower.json b/bower.json index f0f7b25..c5ea6fd 100644 --- a/bower.json +++ b/bower.json @@ -18,13 +18,7 @@ "package.json" ], "devDependencies": { - "angular-1.1.5": "angular-unstable#1.1.5", - "angular-1.2.16": "angular#1.2.16", - "angular-1.2.25": "angular#1.2.25", "angular-1.3.2": "angular#1.3.2", - "angular-mocks-1.1.5": "angular-mocks-unstable#1.1.5", - "angular-mocks-1.2.16": "angular-mocks#1.2.16", - "angular-mocks-1.2.25": "angular-mocks#1.2.25", "angular-mocks-1.3.2": "angular-mocks#1.3.2" }, "dependencies": { From 95ef554b299e7b09081b905014919d2da75341c8 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 1 Jul 2015 10:12:39 -0400 Subject: [PATCH 5/9] Added Webpack ES6 build example. #338 --- build_examples/webpack_es6/README.md | 3 + build_examples/webpack_es6/app.js | 8 + build_examples/webpack_es6/bundle.js | 810 +++++++++++++++++++ build_examples/webpack_es6/index.html | 11 + build_examples/webpack_es6/webpack.config.js | 17 + 5 files changed, 849 insertions(+) create mode 100644 build_examples/webpack_es6/README.md create mode 100644 build_examples/webpack_es6/app.js create mode 100644 build_examples/webpack_es6/bundle.js create mode 100644 build_examples/webpack_es6/index.html create mode 100644 build_examples/webpack_es6/webpack.config.js diff --git a/build_examples/webpack_es6/README.md b/build_examples/webpack_es6/README.md new file mode 100644 index 0000000..14fa7b9 --- /dev/null +++ b/build_examples/webpack_es6/README.md @@ -0,0 +1,3 @@ +Running `webpack` in this directory will produce `bundle.js` + +Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/build_examples/webpack_es6/app.js b/build_examples/webpack_es6/app.js new file mode 100644 index 0000000..40c0f8c --- /dev/null +++ b/build_examples/webpack_es6/app.js @@ -0,0 +1,8 @@ +import angular from 'angular'; +import jsDataModuleName from 'js-data-angular'; + +angular.module('app', [ + jsDataModuleName +]).run((DS, DSVersion, $rootScope) => { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; +}); diff --git a/build_examples/webpack_es6/bundle.js b/build_examples/webpack_es6/bundle.js new file mode 100644 index 0000000..63a7168 --- /dev/null +++ b/build_examples/webpack_es6/bundle.js @@ -0,0 +1,810 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } + + var _angular = __webpack_require__(2); + + var _angular2 = _interopRequireDefault(_angular); + + var _jsDataAngular = __webpack_require__(1); + + var _jsDataAngular2 = _interopRequireDefault(_jsDataAngular); + + _angular2['default'].module('app', [_jsDataAngular2['default']]).run(function (DS, DSVersion, $rootScope) { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; + }); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + /*! + * js-data-angular + * @version 3.0.0-rc.1 - Homepage + * @author Jason Dobry + * @copyright (c) 2014-2015 Jason Dobry + * @license MIT + * + * @overview Angular wrapper for js-data. + */ + (function webpackUniversalModuleDefinition(root, factory) { + if (true) module.exports = factory(__webpack_require__(5), __webpack_require__(2), (function webpackLoadOptionalExternalModule() { + try { + return __webpack_require__(3); + } catch (e) {} + })());else if (typeof define === 'function' && define.amd) define(['js-data', 'angular'], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { + return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root['axios']); + });else if (typeof exports === 'object') exports['jsDataAngularModuleName'] = factory(require('js-data'), require('angular'), (function webpackLoadOptionalExternalModule() { + try { + return require('axios'); + } catch (e) {} + })());else root['jsDataAngularModuleName'] = factory(root['JSData'], root['angular'], root['axios']); + })(this, function (__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) { + return ( /******/(function (modules) { + // webpackBootstrap + /******/ // The module cache + /******/var installedModules = {}; + + /******/ // The require function + /******/function __webpack_require__(moduleId) { + + /******/ // Check if module is in cache + /******/if (installedModules[moduleId]) + /******/return installedModules[moduleId].exports; + + /******/ // Create a new module (and put it into the cache) + /******/var module = installedModules[moduleId] = { + /******/exports: {}, + /******/id: moduleId, + /******/loaded: false + /******/ }; + + /******/ // Execute the module function + /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + + /******/ // Flag the module as loaded + /******/module.loaded = true; + + /******/ // Return the exports of the module + /******/return module.exports; + /******/ + } + + /******/ // expose the modules object (__webpack_modules__) + /******/__webpack_require__.m = modules; + + /******/ // expose the module cache + /******/__webpack_require__.c = installedModules; + + /******/ // __webpack_public_path__ + /******/__webpack_require__.p = ''; + + /******/ // Load entry module and return exports + /******/return __webpack_require__(0); + /******/ + })([ + /* 0 */ + /***/function (module, exports, __webpack_require__) { + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + /*jshint loopfunc:true*/ + var JSData = __webpack_require__(1); + var DSHttpAdapter = __webpack_require__(4); + var angular = __webpack_require__(2); + + var DSUtils = JSData.DSUtils; + var DSErrors = JSData.DSErrors; + var isString = DSUtils.isString; + var isNumber = DSUtils.isNumber; + var isObject = DSUtils.isObject; + var set = DSUtils.set; + var resolveId = DSUtils.resolveId; + + var adapters = [{ + project: 'js-data-localstorage', + name: 'localstorage', + 'class': 'DSLocalStorageAdapter' + }, { + project: 'js-data-localforage', + name: 'localforage', + 'class': 'DSLocalForageAdapter' + }, { + project: 'js-data-firebase', + name: 'firebase', + 'class': 'DSFirebaseAdapter' + }, { + project: 'js-data-sql', + name: 'sql', + 'class': 'DSSqlAdapter' + }]; + + var functionsToWrap = ['compute', 'digest', 'eject', 'inject']; + + function registerAdapter(adapter) { + var Adapter = undefined; + + try { + Adapter = __webpack_require__(3)(adapter.project); + } catch (e) {} + + if (!Adapter) { + Adapter = window[adapter['class']]; + } + + if (Adapter) { + adapter.loaded = true; + angular.module('js-data').provider(adapter['class'], function () { + var _this = this; + _this.defaults = {}; + _this.$get = [function () { + return new Adapter(_this.defaults); + }]; + }); + } + } + + var DSHttpAdapterProvider = function DSHttpAdapterProvider() { + _classCallCheck(this, DSHttpAdapterProvider); + + var defaults = {}; + this.defaults = defaults; + + this.$get = ['$http', 'DS', function ($http, DS) { + defaults.http = defaults.http || $http; + var adapter = new DSHttpAdapter(defaults); + DS.registerAdapter('http', adapter, { 'default': true }); + return adapter; + }]; + }; + + var DSProvider = function DSProvider() { + _classCallCheck(this, DSProvider); + + var _this = this; + var deps = []; + + for (var i = 0; i < adapters.length; i++) { + if (adapters[i].loaded) { + deps.push(adapters[i]['class']); + } + } + + _this.defaults = {}; + + JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { + var _this = this; + + params = params || {}; + + if (!_this.definitions[resourceName]) { + throw new DSErrors.NER(resourceName); + } else if (!isObject(params)) { + throw new DSErrors.IA('"params" must be an object!'); + } else if (!isObject(scope)) { + throw new DSErrors.IA('"scope" must be an object!'); + } else if (!isString(expr)) { + throw new DSErrors.IA('"expr" must be a string!'); + } + + try { + return scope.$watch(function () { + return _this.lastModified(resourceName); + }, function () { + var items = _this.filter(resourceName, params); + set(scope, expr, items); + if (cb) { + cb(null, items); + } + }); + } catch (err) { + if (cb) { + cb(err); + } else { + throw err; + } + } + }; + + JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { + var _this = this; + + id = resolveId(_this.definitions[resourceName], id); + if (!_this.definitions[resourceName]) { + throw new DSErrors.NER(resourceName); + } else if (!isString(id) && !isNumber(id)) { + throw new DSErrors.IA('"id" must be a string or a number!'); + } else if (!isObject(scope)) { + throw new DSErrors.IA('"scope" must be an object!'); + } else if (!isString(expr)) { + throw new DSErrors.IA('"expr" must be a string!'); + } + + try { + return scope.$watch(function () { + return _this.lastModified(resourceName, id); + }, function () { + var item = _this.get(resourceName, id); + if (item) { + _this.compute(resourceName, id); + } + set(scope, expr, item); + if (cb) { + cb(null, item); + } + }); + } catch (err) { + if (cb) { + cb(err); + } else { + throw err; + } + } + }; + + function load() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var $rootScope = args[args.length - 2]; + var $q = args[args.length - 1]; + var store = new JSData.DS(_this.defaults); + var originals = {}; + + function QPromise(executor) { + var deferred = $q.defer(); + + try { + executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); + } catch (err) { + deferred.reject(err); + } + + return deferred.promise; + } + + QPromise.all = $q.all; + QPromise.when = $q.when; + QPromise.reject = $q.reject; + + DSUtils.Promise = QPromise; + + // Register any adapters that have been loaded + if (args.length) { + for (var i = 0; i < args.length; i++) { + for (var j = 0; j < adapters.length; j++) { + if (adapters[j].loaded && !adapters[j].registered) { + adapters[j].registered = true; + store.registerAdapter(adapters[j].name, args[i]); + break; + } + } + } + } + + var _loop = function _loop() { + var name = functionsToWrap[k]; + originals[name] = store[name]; + store[name] = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (!$rootScope.$$phase) { + return $rootScope.$apply(function () { + return originals[name].apply(store, args); + }); + } + return originals[name].apply(store, args); + }; + }; + + // Wrap certain sync functions with $apply + for (var k = 0; k < functionsToWrap.length; k++) { + _loop(); + } + + // Hook into the digest loop + if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { + $rootScope.$watch(function () { + return store.observe.Platform.performMicrotaskCheckpoint(); + }); + } + + return store; + } + + deps.push('$rootScope'); + deps.push('$q'); + deps.push(load); + + _this.$get = deps; + }; + + angular.module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', JSData.version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { + DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); + }]); + + for (var i = 0; i < adapters.length; i++) { + registerAdapter(adapters[i]); + } + + // return the module name + module.exports = 'js-data'; + module.exports.name = 'js-data'; + + /***/ + }, + /* 1 */ + /***/function (module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_1__; + + /***/ + }, + /* 2 */ + /***/function (module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + + /***/ + }, + /* 3 */ + /***/function (module, exports, __webpack_require__) { + + var map = {}; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function () { + throw new Error('Cannot find module \'' + req + '\'.'); + })(); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 3; + + /***/ + }, + /* 4 */ + /***/function (module, exports, __webpack_require__) { + + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + var JSData = __webpack_require__(1); + var axios = null; + + try { + axios = __webpack_require__(5); + } catch (e) {} + + var DSUtils = JSData.DSUtils; + var deepMixIn = DSUtils.deepMixIn; + var removeCircular = DSUtils.removeCircular; + var copy = DSUtils.copy; + var makePath = DSUtils.makePath; + var isString = DSUtils.isString; + var isNumber = DSUtils.isNumber; + + var Defaults = (function () { + function Defaults() { + _classCallCheck(this, Defaults); + } + + _createClass(Defaults, [{ + key: 'queryTransform', + value: function queryTransform(resourceConfig, params) { + return params; + } + }, { + key: 'deserialize', + value: function deserialize(resourceConfig, data) { + return data ? 'data' in data ? data.data : data : data; + } + }, { + key: 'serialize', + value: function serialize(resourceConfig, data) { + return data; + } + }, { + key: 'log', + value: function log() {} + }, { + key: 'error', + value: function error() {} + }]); + + return Defaults; + })(); + + var defaultsPrototype = Defaults.prototype; + + defaultsPrototype.basePath = ''; + + defaultsPrototype.forceTrailingSlash = ''; + + defaultsPrototype.httpConfig = {}; + + var DSHttpAdapter = (function () { + function DSHttpAdapter(options) { + _classCallCheck(this, DSHttpAdapter); + + this.defaults = new Defaults(); + if (console) { + this.defaults.log = function (a, b) { + return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); + }; + } + if (console) { + this.defaults.error = function (a, b) { + return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); + }; + } + deepMixIn(this.defaults, options); + this.http = options.http || axios; + } + + _createClass(DSHttpAdapter, [{ + key: 'getEndpoint', + value: function getEndpoint(resourceConfig, id, options) { + var _this2 = this; + + options = options || {}; + options.params = options.params || {}; + + var item = undefined; + var parentKey = resourceConfig.parentKey; + var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : resourceConfig.endpoint; + var parentField = resourceConfig.parentField; + var parentDef = resourceConfig.getResource(resourceConfig.parent); + var parentId = options.params[parentKey]; + + if (parentId === false || !parentKey || !parentDef) { + if (parentId === false) { + delete options.params[parentKey]; + } + return endpoint; + } else { + delete options.params[parentKey]; + + if (DSUtils._sn(id)) { + item = resourceConfig.get(id); + } else if (DSUtils._o(id)) { + item = id; + } + + if (item) { + parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); + } + + if (parentId) { + var _ret = (function () { + delete options.endpoint; + var _options = {}; + DSUtils.forOwn(options, function (value, key) { + _options[key] = value; + }); + return { + v: DSUtils.makePath(_this2.getEndpoint(parentDef, parentId, DSUtils._(parentDef, _options)), parentId, endpoint) + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + return endpoint; + } + } + } + }, { + key: 'getPath', + value: function getPath(method, resourceConfig, id, options) { + var _this = this; + options = options || {}; + var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, this.getEndpoint(resourceConfig, isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; + if (method === 'find' || method === 'update' || method === 'destroy') { + args.push(id); + } + return makePath.apply(DSUtils, args); + } + }, { + key: 'HTTP', + value: function HTTP(config) { + var _this = this; + var start = new Date(); + config = copy(config); + config = deepMixIn(config, _this.defaults.httpConfig); + if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { + config.url += '/'; + } + if (typeof config.data === 'object') { + config.data = removeCircular(config.data); + } + config.method = config.method.toUpperCase(); + var suffix = config.suffix || _this.defaults.suffix; + if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { + config.url += suffix; + } + + function logResponse(data) { + var str = start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; + if (data.status >= 200 && data.status < 300) { + if (_this.defaults.log) { + _this.defaults.log(str, data); + } + return data; + } else { + if (_this.defaults.error) { + _this.defaults.error('\'FAILED: ' + str, data); + } + return DSUtils.Promise.reject(data); + } + } + + if (!this.http) { + throw new Error('You have not configured this adapter with an http library!'); + } + + return this.http(config).then(logResponse, logResponse); + } + }, { + key: 'GET', + value: function GET(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'get'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'POST', + value: function POST(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'post'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs + })); + } + }, { + key: 'PUT', + value: function PUT(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'put'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs || {} + })); + } + }, { + key: 'DEL', + value: function DEL(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'delete'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'find', + value: function find(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { + var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + return !item ? DSUtils.Promise.reject(new Error('Not Found!')) : item; + }); + } + }, { + key: 'findAll', + value: function findAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'create', + value: function create(resourceConfig, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.POST(_this.getPath('create', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'update', + value: function update(resourceConfig, id, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.PUT(_this.getPath('update', resourceConfig, id, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'updateAll', + value: function updateAll(resourceConfig, attrs, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroy', + value: function destroy(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroyAll', + value: function destroyAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }]); + + return DSHttpAdapter; + })(); + + module.exports = DSHttpAdapter; + + /***/ + }, + /* 5 */ + /***/function (module, exports, __webpack_require__) { + + if (typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') { + var e = new Error('Cannot find module "axios"');e.code = 'MODULE_NOT_FOUND';throw e; + } + module.exports = __WEBPACK_EXTERNAL_MODULE_5__; + + /***/ + } + /******/]) + ); + }); + ; + + /************************************************************************/ + /******/ + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(4); + module.exports = angular; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + if(typeof axios === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + module.exports = axios; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + var require;(function(window,document,undefined){'use strict';function minErr(module,ErrorConstructor){ErrorConstructor = ErrorConstructor || Error;return function(){var code=arguments[0],prefix='[' + (module?module + ':':'') + code + '] ',template=arguments[1],templateArgs=arguments,message,i;message = prefix + template.replace(/\{\d+\}/g,function(match){var index=+match.slice(1,-1),arg;if(index + 2 < templateArgs.length){return toDebugString(templateArgs[index + 2]);}return match;});message = message + '\nhttp://errors.angularjs.org/1.3.15/' + (module?module + '/':'') + code;for(i = 2;i < arguments.length;i++) {message = message + (i == 2?'?':'&') + 'p' + (i - 2) + '=' + encodeURIComponent(toDebugString(arguments[i]));}return new ErrorConstructor(message);};}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/;var VALIDITY_STATE_PROPERTY='validity';var lowercase=function lowercase(string){return isString(string)?string.toLowerCase():string;};var hasOwnProperty=Object.prototype.hasOwnProperty;var uppercase=function uppercase(string){return isString(string)?string.toUpperCase():string;};var manualLowercase=function manualLowercase(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) | 32);}):s;};var manualUppercase=function manualUppercase(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) & ~32);}):s;};if('i' !== 'I'.toLowerCase()){lowercase = manualLowercase;uppercase = manualUppercase;}var msie,jqLite,jQuery,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,ngMinErr=minErr('ng'),angular=window.angular || (window.angular = {}),angularModule,uid=0;msie = document.documentMode;function isArrayLike(obj){if(obj == null || isWindow(obj)){return false;}var length=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;}function forEach(obj,iterator,context){var key,length;if(obj){if(isFunction(obj)){for(key in obj) {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 {for(key in obj) {if(obj.hasOwnProperty(key)){iterator.call(context,obj[key],key,obj);}}}}return obj;}function sortedKeys(obj){return Object.keys(obj).sort();}function forEachSorted(obj,iterator,context){var keys=sortedKeys(obj);for(var i=0;i < keys.length;i++) {iterator.call(context,obj[keys[i]],keys[i]);}return keys;}function reverseParams(iteratorFn){return function(value,key){iteratorFn(key,value);};}function nextUid(){return ++uid;}function setHashKey(obj,h){if(h){obj.$$hashKey = h;}else {delete obj.$$hashKey;}}function extend(dst){var h=dst.$$hashKey;for(var i=1,ii=arguments.length;i < ii;i++) {var obj=arguments[i];if(obj){var keys=Object.keys(obj);for(var j=0,jj=keys.length;j < jj;j++) {var key=keys[j];dst[key] = obj[key];}}}setHashKey(dst,h);return dst;}function int(str){return parseInt(str,10);}function inherit(parent,extra){return extend(Object.create(parent),extra);}function noop(){}noop.$inject = [];function identity($){return $;}identity.$inject = [];function valueFn(value){return function(){return value;};}function isUndefined(value){return typeof value === 'undefined';}function isDefined(value){return typeof value !== 'undefined';}function isObject(value){return value !== null && typeof value === 'object';}function isString(value){return typeof value === 'string';}function isNumber(value){return typeof value === 'number';}function isDate(value){return toString.call(value) === '[object Date]';}var isArray=Array.isArray;function isFunction(value){return typeof value === 'function';}function isRegExp(value){return toString.call(value) === '[object RegExp]';}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 trim=function trim(value){return isString(value)?value.trim():value;};var escapeForRegexp=function escapeForRegexp(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0)array.splice(index,1);return value;}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(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest);}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(isObject(source)){var emptyObject=Object.create(Object.getPrototypeOf(source));destination = copy(source,emptyObject,stackSource,stackDest);}}}else {if(source === destination)throw ngMinErr('cpi','Can\'t copy! Source and destination are identical.');stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1)return stackDest[index];stackSource.push(source);stackDest.push(destination);}var result;if(isArray(source)){destination.length = 0;for(var i=0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {var h=destination.$$hashKey;if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){result = copy(source[key],null,stackSource,stackDest);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}setHashKey(destination,h);}}return destination;}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;}function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2)return true;if(o1 === null || o2 === null)return false;if(o1 !== o1 && o2 !== o2)return true;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;_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}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 = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key]))return false;}return true;}}}return false;}}var csp=function csp(){if(isDefined(csp.isActive_))return csp.isActive_;var active=!!(document.querySelector('[ng-csp]') || document.querySelector('[data-ng-csp]'));if(!active){try{new Function('');}catch(e) {active = true;}}return csp.isActive_ = active;};function concat(array1,array2,index){return array1.concat(slice.call(array2,index));}function sliceArgs(args,startIndex){return slice.call(args,startIndex || 0);}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 {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;}function toJson(obj,pretty){if(typeof obj === 'undefined')return undefined;if(!isNumber(pretty)){pretty = pretty?2:null;}return JSON.stringify(obj,toJsonReplacer,pretty);}function fromJson(json){return isString(json)?JSON.parse(json):json;}function startingTag(element){element = jqLite(element).clone();try{element.empty();}catch(e) {}var elemHtml=jqLite('
').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);}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value);}catch(e) {}}function parseKeyValue(keyValue){var obj={},key_value,key;forEach((keyValue || '').split('&'),function(keyValue){if(keyValue){key_value = keyValue.replace(/\+/g,'%20').split('=');key = tryDecodeURIComponent(key_value[0]);if(isDefined(key)){var val=isDefined(key_value[1])?tryDecodeURIComponent(key_value[1]):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('&'):'';}function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}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;element = jqLite(element);for(i = 0;i < ii;++i) {attr = ngAttrPrefixes[i] + ngAttr;if(isString(attr = element.attr(attr))){return attr;}}return null;}function angularInit(element,bootstrap){var appElement,module,config={};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);}}function bootstrap(element,modules,config){if(!isObject(config))config = {};var defaultConfig={strictDi:false};config = extend(defaultConfig,config);var doBootstrap=function doBootstrap(){element = jqLite(element);if(element.injector()){var tag=element[0] === document?'document':startingTag(element);throw ngMinErr('btstrpd','App Already Bootstrapped with this Element \'{0}\'',tag.replace(//,'>'));}modules = modules || [];modules.unshift(['$provide',function($provide){$provide.value('$rootElement',element);}]);if(config.debugInfoEnabled){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();}}function reloadWithDebugInfo(){window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;window.location.reload();}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;}jQuery = window.jQuery;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});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;bindJQueryFired = true;}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;}function assertNotHasOwnProperty(name,context){if(name === 'hasOwnProperty'){throw ngMinErr('badname','hasOwnProperty is not a valid {0} name',context);}}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;}function getBlockNodes(nodes){var node=nodes[0];var endNode=nodes[nodes.length - 1];var blockNodes=[node];do {node = node.nextSibling;if(!node)break;blockNodes.push(node);}while(node !== endNode);return jqLite(blockNodes);}function createMap(){return Object.create(null);}var NODE_TYPE_ELEMENT=1;var NODE_TYPE_TEXT=3;var NODE_TYPE_COMMENT=8;var NODE_TYPE_DOCUMENT=9;var NODE_TYPE_DOCUMENT_FRAGMENT=11;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);angular.$$minErr = angular.$$minErr || minErr;return ensure(angular,'module',function(){var modules={};return function module(name,requires,configFn){var assertNotHasOwnProperty=function assertNotHasOwnProperty(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);}var invokeQueue=[];var configBlocks=[];var runBlocks=[];var config=invokeLater('$injector','invoke','push',configBlocks);var moduleInstance={_invokeQueue:invokeQueue,_configBlocks:configBlocks,_runBlocks:runBlocks,requires:requires,name:name,provider:invokeLater('$provide','provider'),factory:invokeLater('$provide','factory'),service:invokeLater('$provide','service'),value:invokeLater('$provide','value'),constant:invokeLater('$provide','constant','unshift'),animation:invokeLater('$animateProvider','register'),filter:invokeLater('$filterProvider','register'),controller:invokeLater('$controllerProvider','register'),directive:invokeLater('$compileProvider','directive'),config:config,run:function run(block){runBlocks.push(block);return this;}};if(configFn){config(configFn);}return moduleInstance;function invokeLater(provider,method,insertMethod,queue){if(!queue)queue = invokeQueue;return function(){queue[insertMethod || 'push']([provider,method,arguments]);return moduleInstance;};}});};});}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(typeof obj === 'undefined'){return 'undefined';}else if(typeof obj !== 'string'){return serializeObject(obj);}return obj;}var version={full:'1.3.15',major:1,minor:3,dot:15,codeName:'locality-filtration'};function publishExternalAPI(angular){extend(angular,{'bootstrap':bootstrap,'copy':copy,'extend':extend,'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);try{angularModule('ngLocale');}catch(e) {angularModule('ngLocale',[]).provider('$locale',$LocaleProvider);}angularModule('ng',['ngLocale'],['$provide',function ngModule($provide){$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,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpBackend:$HttpBackendProvider,$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,$$asyncCallback:$$AsyncCallbackProvider,$$jqLite:$$jqLiteProvider});}]);}JQLite.expando = 'ng339';var jqCache=JQLite.cache = {},jqId=1,addEventListenerFn=function addEventListenerFn(element,type,fn){element.addEventListener(type,fn,false);},removeEventListenerFn=function removeEventListenerFn(element,type,fn){element.removeEventListener(type,fn,false);};JQLite._data = function(node){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');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,''],'thead':[1,'','
'],'col':[2,'','
'],'tr':[2,'','
'],'td':[3,'','
'],'_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){var nodeType=node.nodeType;return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,fragment=context.createDocumentFragment(),nodes=[],i;if(jqLiteIsTextNode(html)){nodes.push(context.createTextNode(html));}else {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>') + wrap[2];i = wrap[0];while(i--) {tmp = tmp.lastChild;}nodes = concat(nodes,tmp.childNodes);tmp = fragment.firstChild;tmp.textContent = '';}fragment.textContent = '';fragment.innerHTML = '';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;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;}}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;}else {if(massGetter){return data;}else {if(isSimpleGetter){return data && data[key];}else {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){if(elements){if(elements.nodeType){root[root.length++] = elements;}else {var length=elements.length;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.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((value = jqLite.data(element,names[i])) !== undefined)return value;}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'){win.setTimeout(action);}else {jqLite(win).on('load',action);}}var JQLitePrototype=JQLite.prototype = {ready:function ready(fn){var fired=false;function trigger(){if(fired)return;fired = true;fn();}if(document.readyState === 'complete'){setTimeout(trigger);}else {this.on('DOMContentLoaded',trigger);JQLite(window).on('load',trigger);}},toString:function toString(){var value=[];forEach(this,function(e){value.push('' + e);});return '[' + value.join(', ') + ']';},eq:function eq(index){return index >= 0?jqLite(this[index]):jqLite(this[this.length + index]);},length:0,push:push,sort:[].sort,splice:[].splice};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){var booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;}function getAliasedAttrName(element,name){var nodeName=element.nodeName;return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];}forEach({data:jqLiteData,removeData:jqLiteRemoveData},function(fn,name){JQLite[name] = fn;});forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function scope(element){return jqLite.data(element,'$scope') || jqLiteInheritedData(element.parentNode || element,['$isolateScope','$scope']);},isolateScope:function isolateScope(element){return jqLite.data(element,'$isolateScope') || jqLite.data(element,'$isolateScopeNoTemplate');},controller:jqLiteController,injector:function injector(element){return jqLiteInheritedData(element,'$injector');},removeAttr:function removeAttr(element,name){element.removeAttribute(name);},hasClass:jqLiteHasClass,css:function css(element,name,value){name = camelCase(name);if(isDefined(value)){element.style[name] = value;}else {return element.style[name];}},attr:function attr(element,name,value){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){var ret=element.getAttribute(name,2);return ret === null?undefined:ret;}},prop:function prop(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 val(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 html(element,value){if(isUndefined(value)){return element.innerHTML;}jqLiteDealoc(element,true);element.innerHTML = value;},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name] = function(arg1,arg2){var i,key;var nodeCount=this.length;if(fn !== jqLiteEmpty && (fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)?arg1:arg2) === undefined){if(isObject(arg1)){for(i = 0;i < nodeCount;i++) {if(fn === jqLiteData){fn(this[i],arg1);}else {for(key in arg1) {fn(this[i],key,arg1[key]);}}}return this;}else {var value=fn.$dv;var jj=value === undefined?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 {for(i = 0;i < nodeCount;i++) {fn(this[i],arg1,arg2);}return this;}};});function createEventHandler(element,events){var eventHandler=function eventHandler(event,type){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;};if(eventFnsLength > 1){eventFns = shallowCopy(eventFns);}for(var i=0;i < eventFnsLength;i++) {if(!event.isImmediatePropagationStopped()){eventFns[i].call(element,event);}}};eventHandler.elem = element;return eventHandler;}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');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);}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'){jqLiteOn(element,MOUSE_EVENT_MAP[type],function(event){var target=this,related=event.relatedTarget;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 one(element,type,fn){element = jqLite(element);element.on(type,function onFn(){element.off(type,fn);element.off(type,onFn);});element.on(type,fn);},replaceWith:function replaceWith(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 children(element){var children=[];forEach(element.childNodes,function(element){if(element.nodeType === NODE_TYPE_ELEMENT)children.push(element);});return children;},contents:function contents(element){return element.contentDocument || element.childNodes || [];},append:function append(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 prepend(element,node){if(element.nodeType === NODE_TYPE_ELEMENT){var index=element.firstChild;forEach(new JQLite(node),function(child){element.insertBefore(child,index);});}},wrap:function wrap(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 detach(element){jqLiteRemove(element,true);},after:function after(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 toggleClass(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 parent(element){var parent=element.parentNode;return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT?parent:null;},next:function next(element){return element.nextElementSibling;},find:function find(element,selector){if(element.getElementsByTagName){return element.getElementsByTagName(selector);}else {return [];}},clone:jqLiteClone,triggerHandler:function triggerHandler(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){dummyEvent = {preventDefault:function preventDefault(){this.defaultPrevented = true;},isDefaultPrevented:function isDefaultPrevented(){return this.defaultPrevented === true;},stopImmediatePropagation:function stopImmediatePropagation(){this.immediatePropagationStopped = true;},isImmediatePropagationStopped:function isImmediatePropagationStopped(){return this.immediatePropagationStopped === true;},stopPropagation:noop,type:eventName,target:element};if(event.type){dummyEvent = extend(dummyEvent,event);}eventFnsCopy = shallowCopy(eventFns);handlerArgs = extraParameters?[dummyEvent].concat(extraParameters):[dummyEvent];forEach(eventFnsCopy,function(fn){if(!dummyEvent.isImmediatePropagationStopped()){fn.apply(element,handlerArgs);}});}}},function(fn,name){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)){value = jqLite(value);}}else {jqLiteAddNodes(value,fn(this[i],arg1,arg2,arg3));}}return isDefined(value)?value:this;};JQLite.prototype.bind = JQLite.prototype.on;JQLite.prototype.unbind = JQLite.prototype.off;});function $$jqLiteProvider(){this.$get = function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node = node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node = node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node = node[0];return jqLiteRemoveClass(node,classes);}});};}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;}function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid = function(){return ++uid;};}forEach(array,this.put,this);}HashMap.prototype = {put:function put(key,value){this[hashKey(key,this.nextUid)] = value;},get:function get(key){return this[hashKey(key,this.nextUid)];},remove:function remove(key){var value=this[key = hashKey(key,this.nextUid)];delete this[key];return value;}};var FN_ARGS=/^function\s*[^\(]*\(\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){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;}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){instanceInjector.invoke(fn || noop);});return instanceInjector;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});};}function loadModules(modulesToLoad){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){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;}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];}return fn.apply(self,args);}function instantiate(Type,locals,serviceName){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 has(name){return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);}};}}createInjector.$$annotate = annotate;function $AnchorScrollProvider(){var autoScrollingEnabled=true;this.disableAutoScrolling = function(){autoScrollingEnabled = false;};this.$get = ['$window','$location','$rootScope',function($window,$location,$rootScope){var document=$window.document;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){var elemTop=elem.getBoundingClientRect().top;$window.scrollBy(0,elemTop - offset);}}else {$window.scrollTo(0,0);}}function scroll(){var hash=$location.hash(),elm;if(!hash)scrollTo(null);else if(elm = document.getElementById(hash))scrollTo(elm);else if(elm = getFirstAnchor(document.getElementsByName(hash)))scrollTo(elm);else if(hash === 'top')scrollTo(null);}if(autoScrollingEnabled){$rootScope.$watch(function autoScrollWatch(){return $location.hash();},function autoScrollWatchAction(newVal,oldVal){if(newVal === oldVal && newVal === '')return;jqLiteDocumentLoaded(function(){$rootScope.$evalAsync(scroll);});});}return scroll;}];}var $animateMinErr=minErr('$animate');var $AnimateProvider=['$provide',function($provide){this.$$selectors = {};this.register = function(name,factory){var key=name + '-animation';if(name && name.charAt(0) != '.')throw $animateMinErr('notcsel','Expecting class selector starting with \'.\' got \'{0}\'.',name);this.$$selectors[name.substr(1)] = key;$provide.factory(key,factory);};this.classNameFilter = function(expression){if(arguments.length === 1){this.$$classNameFilter = expression instanceof RegExp?expression:null;}return this.$$classNameFilter;};this.$get = ['$$q','$$asyncCallback','$rootScope',function($$q,$$asyncCallback,$rootScope){var currentDefer;function runAnimationPostDigest(fn){var cancelFn,defer=$$q.defer();defer.promise.$$cancelFn = function ngAnimateMaybeCancel(){cancelFn && cancelFn();};$rootScope.$$postDigest(function ngAnimatePostDigest(){cancelFn = fn(function ngAnimateNotifyComplete(){defer.resolve();});});return defer.promise;}function resolveElementClasses(element,classes){var toAdd=[],toRemove=[];var hasClasses=createMap();forEach((element.attr('class') || '').split(/\s+/),function(className){hasClasses[className] = true;});forEach(classes,function(status,className){var hasClass=hasClasses[className];if(status === false && hasClass){toRemove.push(className);}else if(status === true && !hasClass){toAdd.push(className);}});return toAdd.length + toRemove.length > 0 && [toAdd.length?toAdd:null,toRemove.length?toRemove:null];}function cachedClassManipulation(cache,classes,op){for(var i=0,ii=classes.length;i < ii;++i) {var className=classes[i];cache[className] = op;}}function asyncPromise(){if(!currentDefer){currentDefer = $$q.defer();$$asyncCallback(function(){currentDefer.resolve();currentDefer = null;});}return currentDefer.promise;}function applyStyles(element,options){if(angular.isObject(options)){var styles=extend(options.from || {},options.to || {});element.css(styles);}}return {animate:function animate(element,from,to){applyStyles(element,{from:from,to:to});return asyncPromise();},enter:function enter(element,parent,after,options){applyStyles(element,options);after?after.after(element):parent.prepend(element);return asyncPromise();},leave:function leave(element,options){applyStyles(element,options);element.remove();return asyncPromise();},move:function move(element,parent,after,options){return this.enter(element,parent,after,options);},addClass:function addClass(element,className,options){return this.setClass(element,className,[],options);},$$addClassImmediately:function $$addClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteAddClass(element,className);});applyStyles(element,options);return asyncPromise();},removeClass:function removeClass(element,className,options){return this.setClass(element,[],className,options);},$$removeClassImmediately:function $$removeClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteRemoveClass(element,className);});applyStyles(element,options);return asyncPromise();},setClass:function setClass(element,add,remove,options){var self=this;var STORAGE_KEY='$$animateClasses';var createdCache=false;element = jqLite(element);var cache=element.data(STORAGE_KEY);if(!cache){cache = {classes:{},options:options};createdCache = true;}else if(options && cache.options){cache.options = angular.extend(cache.options || {},options);}var classes=cache.classes;add = isArray(add)?add:add.split(' ');remove = isArray(remove)?remove:remove.split(' ');cachedClassManipulation(classes,add,true);cachedClassManipulation(classes,remove,false);if(createdCache){cache.promise = runAnimationPostDigest(function(done){var cache=element.data(STORAGE_KEY);element.removeData(STORAGE_KEY);if(cache){var classes=resolveElementClasses(element,cache.classes);if(classes){self.$$setClassImmediately(element,classes[0],classes[1],cache.options);}}done();});element.data(STORAGE_KEY,cache);}return cache.promise;},$$setClassImmediately:function $$setClassImmediately(element,add,remove,options){add && this.$$addClassImmediately(element,add);remove && this.$$removeClassImmediately(element,remove);applyStyles(element,options);return asyncPromise();},enabled:noop,cancel:noop};}];}];function $$AsyncCallbackProvider(){this.$get = ['$$rAF','$timeout',function($$rAF,$timeout){return $$rAF.supported?function(fn){return $$rAF(fn);}:function(fn){return $timeout(fn,0,false);};}];}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=[];self.$$completeOutstandingRequest = completeOutstandingRequest;self.$$incOutstandingRequestCount = function(){outstandingRequestCount++;};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 + 1);}self.notifyWhenNoOutstandingRequests = function(callback){forEach(pollFns,function(pollFn){pollFn();});if(outstandingRequestCount === 0){callback();}else {outstandingRequestCallbacks.push(callback);}};var pollFns=[],pollTimeout;self.addPollFn = function(fn){if(isUndefined(pollTimeout))startPoller(100,setTimeout);pollFns.push(fn);return fn;};function startPoller(interval,setTimeout){(function check(){forEach(pollFns,function(pollFn){pollFn();});pollTimeout = setTimeout(check,interval);})();}var cachedState,lastHistoryState,lastBrowserUrl=location.href,baseElement=document.find('base'),reloadLocation=null;cacheState();lastHistoryState = cachedState;self.url = function(url,replace,state){if(isUndefined(state)){state = null;}if(location !== window.location)location = window.location;if(history !== window.history)history = window.history;if(url){var sameState=lastHistoryState === state;if(lastBrowserUrl === url && (!$sniffer.history || sameState)){return self;}var sameBase=lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);lastBrowserUrl = url;lastHistoryState = state;if($sniffer.history && (!sameBase || !sameState)){history[replace?'replaceState':'pushState'](state,'',url);cacheState();lastHistoryState = cachedState;}else {if(!sameBase){reloadLocation = url;}if(replace){location.replace(url);}else if(!sameBase){location.href = url;}else {location.hash = getHash(url);}}return self;}else {return reloadLocation || location.href.replace(/%27/g,'\'');}};self.state = function(){return cachedState;};var urlChangeListeners=[],urlChangeInit=false;function cacheStateAndFireUrlChange(){cacheState();fireUrlChange();}function getCurrentState(){try{return history.state;}catch(e) {}}var lastCachedState=null;function cacheState(){cachedState = getCurrentState();cachedState = isUndefined(cachedState)?null:cachedState;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);});}self.onUrlChange = function(callback){if(!urlChangeInit){if($sniffer.history)jqLite(window).on('popstate',cacheStateAndFireUrlChange);jqLite(window).on('hashchange',cacheStateAndFireUrlChange);urlChangeInit = true;}urlChangeListeners.push(callback);return callback;};self.$$checkUrlChange = fireUrlChange;self.baseHref = function(){var href=baseElement.attr('href');return href?href.replace(/^(https?\:)?\/\/[^\/]*/,''):'';};var lastCookies={};var lastCookieString='';var cookiePath=self.baseHref();function safeDecodeURIComponent(str){try{return decodeURIComponent(str);}catch(e) {return str;}}self.cookies = function(name,value){var cookieLength,cookieArray,cookie,i,index;if(name){if(value === undefined){rawDocument.cookie = encodeURIComponent(name) + '=;path=' + cookiePath + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';}else {if(isString(value)){cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=' + cookiePath).length + 1;if(cookieLength > 4096){$log.warn('Cookie \'' + name + '\' possibly not set or overflowed because it was too large (' + cookieLength + ' > 4096 bytes)!');}}}}else {if(rawDocument.cookie !== lastCookieString){lastCookieString = rawDocument.cookie;cookieArray = lastCookieString.split('; ');lastCookies = {};for(i = 0;i < cookieArray.length;i++) {cookie = cookieArray[i];index = cookie.indexOf('=');if(index > 0){name = safeDecodeURIComponent(cookie.substring(0,index));if(lastCookies[name] === undefined){lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));}}}}return lastCookies;}};self.defer = function(fn,delay){var timeoutId;outstandingRequestCount++;timeoutId = setTimeout(function(){delete pendingDeferIds[timeoutId];completeOutstandingRequest(fn);},delay || 0);pendingDeferIds[timeoutId] = true;return timeoutId;};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);}];}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;return caches[cacheId] = {put:function put(key,value){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key] || (lruHash[key] = {key:key});refresh(lruEntry);}if(isUndefined(value))return;if(!(key in data))size++;data[key] = value;if(size > capacity){this.remove(staleEnd.key);}return value;},get:function get(key){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;refresh(lruEntry);}return data[key];},remove:function remove(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--;},removeAll:function removeAll(){data = {};size = 0;lruHash = {};freshEnd = staleEnd = null;},destroy:function destroy(){data = null;stats = null;lruHash = null;delete caches[cacheId];},info:function info(){return extend({},stats,{size:size});}};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;}}function link(nextEntry,prevEntry){if(nextEntry != prevEntry){if(nextEntry)nextEntry.p = prevEntry;if(prevEntry)prevEntry.n = nextEntry;}}}cacheFactory.info = function(){var info={};forEach(caches,function(cache,cacheId){info[cacheId] = cache.info();});return info;};cacheFactory.get = function(cacheId){return caches[cacheId];};return cacheFactory;};}function $TemplateCacheProvider(){this.$get = ['$cacheFactory',function($cacheFactory){return $cacheFactory('templates');}];}var $compileMinErr=minErr('$compile');$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=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/;var EVENT_HANDLER_ATTR_REGEXP=/^(on[a-z]+|formaction)$/;function parseIsolateBindings(scope,directiveName){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 isolate scope definition for directive \'{0}\'.' + ' Definition: {... {1}: \'{2}\' ...}',directiveName,scopeName,definition);}bindings[scopeName] = {mode:match[1][0],collection:match[2] === '*',optional:match[3] === '?',attrName:match[4] || scopeName};});return bindings;}this.directive = function registerDirective(name,directiveFactory){assertNotHasOwnProperty(name,'directive');if(isString(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';if(isObject(directive.scope)){directive.$$isolateBindings = parseIsolateBindings(directive.scope,directive.name);}directives.push(directive);}catch(e) {$exceptionHandler(e);}});return directives;}]);}hasDirectives[name].push(directiveFactory);}else {forEach(name,reverseParams(registerDirective));}return this;};this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.aHrefSanitizationWhitelist();}};this.imgSrcSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();}};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 Attributes(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 = {$normalize:directiveNormalize,$addClass:function $addClass(classVal){if(classVal && classVal.length > 0){$animate.addClass(this.$$element,classVal);}},$removeClass:function $removeClass(classVal){if(classVal && classVal.length > 0){$animate.removeClass(this.$$element,classVal);}},$updateClass:function $updateClass(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:function $set(key,value,writeAttr,attrName){var node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(node,key),observer=key,nodeName;if(booleanKey){this.$$element.prop(key,value);attrName = booleanKey;}else if(aliasedKey){this[aliasedKey] = value;observer = aliasedKey;}this[key] = value;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'){this[key] = value = $$sanitizeUri(value,key === 'src');}else if(nodeName === 'img' && key === 'srcset'){var result='';var trimmedSrcset=trim(value);var srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;var pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/;var rawUris=trimmedSrcset.split(pattern);var nbrUrisWith2parts=Math.floor(rawUris.length / 2);for(var i=0;i < nbrUrisWith2parts;i++) {var innerIdx=i * 2;result += $$sanitizeUri(trim(rawUris[innerIdx]),true);result += ' ' + trim(rawUris[innerIdx + 1]);}var lastTuple=trim(rawUris[i * 2]).split(/\s/);result += $$sanitizeUri(trim(lastTuple[0]),true);if(lastTuple.length === 2){result += ' ' + trim(lastTuple[1]);}this[key] = value = result;}if(writeAttr !== false){if(value === null || value === undefined){this.$$element.removeAttr(attrName);}else {this.$$element.attr(attrName,value);}}var $$observers=this.$$observers;$$observers && forEach($$observers[observer],function(fn){try{fn(value);}catch(e) {$exceptionHandler(e);}});},$observe:function $observe(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)){fn(attrs[key]);}});return function(){arrayRemove(listeners,fn);};}};function safeAddClass($element,className){try{$element.addClass(className);}catch(e) {}}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)){$compileNodes = jqLite($compileNodes);}forEach($compileNodes,function(node,index){if(node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/)){$compileNodes[index] = jqLite(node).wrap('').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;if(parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude){parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;}if(!namespace){namespace = detectNamespaceForChildElements(futureParentElement);}var $linkNode;if(namespace !== 'html'){$linkNode = jqLite(wrapTemplate(namespace,jqLite('
').append($compileNodes).html()));}else if(cloneConnectFn){$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){var node=parentElement && parentElement[0];if(!node){return 'html';}else {return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/)?'svg':'html';}}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();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;}previousCompileContext = null;}return linkFnFound?compositeLinkFn:null;function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn;var stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;stableNodeList = new Array(nodeListLength);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);}else {childScope = scope;}if(nodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,nodeLinkFn.transclude,parentBoundTranscludeFn,nodeLinkFn.elementTranscludeOnThisElement);}else if(!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn){childBoundTranscludeFn = parentBoundTranscludeFn;}else if(!parentBoundTranscludeFn && transcludeFn){childBoundTranscludeFn = createBoundTranscludeFn(scope,transcludeFn);}else {childBoundTranscludeFn = null;}nodeLinkFn(childLinkFn,childScope,node,$rootElement,childBoundTranscludeFn);}else if(childLinkFn){childLinkFn(scope,node.childNodes,undefined,parentBoundTranscludeFn);}}}}function createBoundTranscludeFn(scope,transcludeFn,previousBoundTranscludeFn,elementTransclusion){var boundTranscludeFn=function boundTranscludeFn(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;}function collectDirectives(node,directives,attrs,maxPriority,ignoreDirective){var nodeType=node.nodeType,attrsMap=attrs.$attr,match,className;switch(nodeType){case NODE_TYPE_ELEMENT:addDirective(directives,directiveNormalize(nodeName_(node)),'E',maxPriority,ignoreDirective);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);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;}}addAttrInterpolateDirective(node,directives,value,nName,isNgAttr);addDirective(directives,nName,'A',maxPriority,ignoreDirective,attrStartName,attrEndName);}className = node.className;if(isObject(className)){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:addTextInterpolateDirective(directives,node.nodeValue);break;case NODE_TYPE_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) {}break;}directives.sort(byPriority);return directives;}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);}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);};}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){previousCompileContext = previousCompileContext || {};var terminalPriority=-Number.MAX_VALUE,newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,controllers,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;for(var i=0,ii=directives.length;i < ii;i++) {directive = directives[i];var attrStart=directive.$$start;var attrEnd=directive.$$end;if(attrStart){$compileNode = groupScan(compileNode,attrStart,attrEnd);}$template = undefined;if(terminalPriority > directive.priority){break;}if(directiveValue = directive.scope){if(!directive.templateUrl){if(isObject(directiveValue)){assertNoDuplicate('new/isolated scope',newIsolateScopeDirective || newScopeDirective,directive,$compileNode);newIsolateScopeDirective = directive;}else {assertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);}}newScopeDirective = newScopeDirective || directive;}directiveName = directive.name;if(!directive.templateUrl && directive.controller){directiveValue = directive.controller;controllerDirectives = controllerDirectives || {};assertNoDuplicate('\'' + directiveName + '\' controller',controllerDirectives[directiveName],directive,$compileNode);controllerDirectives[directiveName] = directive;}if(directiveValue = directive.transclude){hasTranscludeDirective = true;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,{nonTlbTranscludeDirective:nonTlbTranscludeDirective});}else {$template = jqLite(jqLiteClone(compileNode)).contents();$compileNode.empty();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:{}};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,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.elementTranscludeOnThisElement = hasElementTranscludeDirective;nodeLinkFn.templateOnThisElement = hasTemplate;nodeLinkFn.transclude = childTranscludeFn;previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;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,retrievalMethod='data',optional=false;var $searchElement=$element;var match;if(isString(require)){match = require.match(REQUIRE_PREFIX_REGEXP);require = require.substring(match[0].length);if(match[3]){if(match[1])match[3] = null;else match[1] = match[3];}if(match[1] === '^'){retrievalMethod = 'inheritedData';}else if(match[1] === '^^'){retrievalMethod = 'inheritedData';$searchElement = $element.parent();}if(match[2] === '?'){optional = true;}value = null;if(elementControllers && retrievalMethod === 'data'){if(value = elementControllers[require]){value = value.instance;}}value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');if(!value && !optional){throw $compileMinErr('ctreq','Controller \'{0}\', required by directive \'{1}\', can\'t be found!',require,directiveName);}return value || null;}else if(isArray(require)){value = [];forEach(require,function(require){value.push(getControllers(directiveName,require,$element,elementControllers));});}return value;}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){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){transcludeFn = controllersBoundTransclude;transcludeFn.$$boundTransclude = boundTranscludeFn;}if(controllerDirectives){controllers = {};elementControllers = {};forEach(controllerDirectives,function(directive){var locals={$scope:directive === newIsolateScopeDirective || directive.$$isolateScope?isolateScope:scope,$element:$element,$attrs:attrs,$transclude:transcludeFn},controllerInstance;controller = directive.controller;if(controller == '@'){controller = attrs[directive.name];}controllerInstance = $controller(controller,locals,true,directive.controllerAs);elementControllers[directive.name] = controllerInstance;if(!hasElementTranscludeDirective){$element.data('$' + directive.name + 'Controller',controllerInstance.instance);}controllers[directive.name] = controllerInstance;});}if(newIsolateScopeDirective){compile.$$addScopeInfo($element,isolateScope,true,!(templateDirective && (templateDirective === newIsolateScopeDirective || templateDirective === newIsolateScopeDirective.$$originalDirective)));compile.$$addScopeClass($element,true);var isolateScopeController=controllers && controllers[newIsolateScopeDirective.name];var isolateBindingContext=isolateScope;if(isolateScopeController && isolateScopeController.identifier && newIsolateScopeDirective.bindToController === true){isolateBindingContext = isolateScopeController.instance;}forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings,function(definition,scopeName){var attrName=definition.attrName,optional=definition.optional,mode=definition.mode,lastValue,parentGet,parentSet,compare;switch(mode){case '@':attrs.$observe(attrName,function(value){isolateBindingContext[scopeName] = value;});attrs.$$observers[attrName].$$scope = scope;if(attrs[attrName]){isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);}break;case '=':if(optional && !attrs[attrName]){return;}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(){lastValue = isolateBindingContext[scopeName] = parentGet(scope);throw $compileMinErr('nonassign','Expression \'{0}\' used with directive \'{1}\' is non-assignable!',attrs[attrName],newIsolateScopeDirective.name);};lastValue = isolateBindingContext[scopeName] = parentGet(scope);var parentValueWatch=function parentValueWatch(parentValue){if(!compare(parentValue,isolateBindingContext[scopeName])){if(!compare(parentValue,lastValue)){isolateBindingContext[scopeName] = parentValue;}else {parentSet(scope,parentValue = isolateBindingContext[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);}isolateScope.$on('$destroy',unwatch);break;case '&':parentGet = $parse(attrs[attrName]);isolateBindingContext[scopeName] = function(locals){return parentGet(scope,locals);};break;}});}if(controllers){forEach(controllers,function(controller){controller();});controllers = null;}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);}var scopeToChild=scope;if(newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)){scopeToChild = isolateScope;}childLinkFn && childLinkFn(scopeToChild,linkNode.childNodes,undefined,boundTranscludeFn);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);}function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement){var transcludeControllers;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){for(var j=0,jj=directives.length;j < jj;j++) {directives[j] = inherit(directives[j],{$$isolateScope:true});}}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((maxPriority === undefined || 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;}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;}function mergeTemplateAttributes(dst,src){var srcAttr=src.$attr,dstAttr=dst.$attr,$element=dst.$$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]);}});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;}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($sce.getTrustedResourceUrl(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)){linkNode = jqLiteClone(compileNode);}replaceWith(linkRootElement,jqLite(beforeTemplateLinkNode),linkNode);safeAddClass(jqLite(linkNode),oldClasses);}if(afterTemplateNodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn);}else {childBoundTranscludeFn = boundTranscludeFn;}afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,linkNode,$rootElement,childBoundTranscludeFn);}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);}};}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){if(previousDirective){throw $compileMinErr('multidir','Multiple directives [{0}, {1}] asking for {2} on: {3}',previousDirective.name,directive.name,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;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 + '';return wrapper.childNodes[0].childNodes;default:return template;}}function getTrustedContext(node,attrNormalizedName){if(attrNormalizedName == 'srcdoc'){return $sce.HTML;}var tag=nodeName_(node);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);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 compile(){return {pre:function attrInterpolatePreLinkFn(scope,element,attr){var $$observers=attr.$$observers || (attr.$$observers = {});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.');}var newValue=attr[name];if(newValue !== value){interpolateFn = newValue && $interpolate(newValue,true,trustedContext,allOrNothing);value = newValue;}if(!interpolateFn)return;attr[name] = interpolateFn(scope);($$observers[name] || ($$observers[name] = [])).$$inter = true;(attr.$$observers && attr.$$observers[name].$$scope || scope).$watch(interpolateFn,function interpolateFnWatchAction(newValue,oldValue){if(name === 'class' && newValue != oldValue){attr.$updateClass(newValue,oldValue);}else {attr.$set(name,newValue);}});}};}});}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($rootElement.context === firstElementToRemove){$rootElement.context = newNode;}break;}}}if(parent){parent.replaceChild(newNode,firstElementToRemove);}var fragment=document.createDocumentFragment();fragment.appendChild(firstElementToRemove);jqLite(newNode).data(jqLite(firstElementToRemove).data());if(!jQuery){delete jqLite.cache[firstElementToRemove[jqLite.expando]];}else {skipDestroyOnNextJQueryCleanData = true;jQuery.cleanData([firstElementToRemove]);}for(var k=1,kk=elementsToRemove.length;k < kk;k++) {var element=elementsToRemove[k];jqLite(element).remove();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));}}}];}var PREFIX_REGEXP=/^((?:x|data)[\:\-_])/i;function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}function nodesetLinkingFn(scope,nodeList,rootElement,boundTranscludeFn){}function directiveLinkingFn(nodesetLinkingFn,scope,node,rootElement,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');function $ControllerProvider(){var controllers={},globals=false,CNTRL_REG=/^(\S+)(\s+as\s+(\w+))?$/;this.register = function(name,constructor){assertNotHasOwnProperty(name,'controller');if(isObject(name)){extend(controllers,name);}else {controllers[name] = constructor;}};this.allowGlobals = function(){globals = true;};this.$get = ['$injector','$window',function($injector,$window){return function(expression,locals,later,ident){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){var controllerPrototype=(isArray(expression)?expression[expression.length - 1]:expression).prototype;instance = Object.create(controllerPrototype || null);if(identifier){addIdentifier(locals,identifier,instance,constructor || expression.name);}return extend(function(){$injector.invoke(expression,instance,locals,constructor);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;}}];}function $DocumentProvider(){this.$get = ['$window',function(window){return jqLite(window.document);}];}function $ExceptionHandlerProvider(){this.$get = ['$log',function($log){return function(exception,cause){$log.error.apply($log,arguments);};}];}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/;function defaultHttpResponseTransform(data,headers){if(isString(data)){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);}function parseHeaders(headers){var parsed=createMap(),key,val,i;if(!headers)return parsed;forEach(headers.split('\n'),function(line){i = line.indexOf(':');key = lowercase(trim(line.substr(0,i)));val = trim(line.substr(i + 1));if(key){parsed[key] = parsed[key]?parsed[key] + ', ' + val:val;}});return parsed;}function headersGetter(headers){var headersObj=isObject(headers)?headers:undefined;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;};}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;}function $HttpProvider(){var defaults=this.defaults = {transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d)?toJson(d):d;}],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'};var useApplyAsync=false;this.useApplyAsync = function(value){if(isDefined(value)){useApplyAsync = !!value;return this;}return useApplyAsync;};var interceptorFactories=this.interceptors = [];this.$get = ['$httpBackend','$browser','$cacheFactory','$rootScope','$q','$injector',function($httpBackend,$browser,$cacheFactory,$rootScope,$q,$injector){var defaultCache=$cacheFactory('$http');var reversedInterceptors=[];forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory));});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},requestConfig);config.headers = mergeHeaders(requestConfig);config.method = uppercase(config.method);var serverRequest=function serverRequest(config){var headers=config.headers;var reqData=transformData(config.data,headersGetter(headers),undefined,config.transformRequest);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;}return sendReq(config,reqData).then(transformResponse,transformResponse);};var chain=[serverRequest,undefined];var promise=$q.when(config);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);}promise.success = function(fn){promise.then(function(response){fn(response.data,response.status,response.headers,config);});return promise;};promise.error = function(fn){promise.then(null,function(response){fn(response.data,response.status,response.headers,config);});return promise;};return promise;function transformResponse(response){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){var headerContent,processedHeaders={};forEach(headers,function(headerFn,header){if(isFunction(headerFn)){headerContent = headerFn();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)]);defaultHeadersIteration: for(defHeaderName in defHeaders) {lowercaseDefHeaderName = lowercase(defHeaderName);for(reqHeaderName in reqHeaders) {if(lowercase(reqHeaderName) === lowercaseDefHeaderName){continue defaultHeadersIteration;}}reqHeaders[defHeaderName] = defHeaders[defHeaderName];}return executeHeaderFns(reqHeaders);}}$http.pendingRequests = [];createShortMethods('get','delete','head','jsonp');createShortMethodsWithData('post','put','patch');$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}));};});}function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,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)){cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else {if(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else {resolvePromise(cachedResp,200,{},'OK');}}}else {cache.put(url,promise);}}if(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$browser.cookies()[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;function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else {cache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else {resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}function resolvePromise(response,status,headers,statusText){status = Math.max(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,params){if(!params)return url;var parts=[];forEachSorted(params,function(value,key){if(value === null || isUndefined(value))return;if(!isArray(value))value = [value];forEach(value,function(v){if(isObject(v)){if(isDate(v)){v = v.toISOString();}else {v = toJson(v);}}parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));});});if(parts.length > 0){url += (url.indexOf('?') == -1?'?':'&') + parts.join('&');}return url;}}];}function createXhr(){return new window.XMLHttpRequest();}function $HttpBackendProvider(){this.$get = ['$browser','$window','$document',function($browser,$window,$document){return createHttpBackend($browser,createXhr,$browser.defer,$window.angular.callbacks,$document[0]);}];}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){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();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 || '';var response='response' in xhr?xhr.response:xhr.responseText;var status=xhr.status === 1223?204:xhr.status;if(status === 0){status = response?200:urlResolve(url).protocol == 'file'?404:0;}completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText);};var requestError=function requestError(){completeRequest(callback,-1,null,null,'');};xhr.onerror = requestError;xhr.onabort = requestError;if(withCredentials){xhr.withCredentials = true;}if(responseType){try{xhr.responseType = responseType;}catch(e) {if(responseType !== 'json'){throw e;}}}xhr.send(post || null);}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){if(timeoutId !== undefined){$browserDefer.cancel(timeoutId);}jsonpDone = xhr = null;callback(status,response,headersString,statusText);$browser.$$completeOutstandingRequest(noop);}};function jsonpReq(url,callbackId,done){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=minErr('$interpolate');function $InterpolateProvider(){var startSymbol='{{';var endSymbol='}}';this.startSymbol = function(value){if(value){startSymbol = value;return this;}else {return startSymbol;}};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 $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 {if(index !== textLength){concat.push(unescapeText(text.substring(index)));}break;}}if(trustedContext && concat.length > 1){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);}if(!mustHaveExpression || expressions.length){var compute=function compute(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 getValue(value){return trustedContext?$sce.getTrusted(trustedContext,value):$sce.valueOf(value);};var stringify=function stringify(value){if(value == null){return '';}switch(typeof value){case 'string':break;case 'number':value = '' + value;break;default:value = toJson(value);}return 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) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}},{exp:text,expressions:expressions,$$watchDelegate:function $$watchDelegate(scope,listener,objectEquality){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;},objectEquality);}});}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol);}function parseStringifyInterceptor(value){try{value = getValue(value);return allOrNothing && !isDefined(value)?value:stringify(value);}catch(err) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}}}$interpolate.startSymbol = function(){return startSymbol;};$interpolate.endSymbol = function(){return endSymbol;};return $interpolate;}];}function $IntervalProvider(){this.$get = ['$rootScope','$window','$q','$$q',function($rootScope,$window,$q,$$q){var intervals={};function interval(fn,delay,count,invokeApply){var 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,fn);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;}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;}];}function $LocaleProvider(){this.$get = function(){return {id:'en-us',NUMBER_FORMATS:{DECIMAL_SEP:'.',GROUP_SEP:',',PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:'',posSuf:'',negPre:'-',negSuf:'',gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:'¤',posSuf:'',negPre:'(¤',negSuf:')',gSize:3,lgSize:3}],CURRENCY_SYM:'$'},DATETIME_FORMATS:{MONTH:'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),SHORTMONTH:'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),DAY:'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),SHORTDAY:'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),AMPMS:['AM','PM'],medium:'MMM d, y h:mm:ss a','short':'M/d/yy h:mm a',fullDate:'EEEE, MMMM d, y',longDate:'MMMM d, y',mediumDate:'MMM d, y',shortDate:'M/d/yy',mediumTime:'h:mm:ss a',shortTime:'h:mm a',ERANAMES:['Before Christ','Anno Domini'],ERAS:['BC','AD']},pluralCat:function pluralCat(num){if(num === 1){return 'one';}return 'other';}};};}var PATH_MATCH=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={'http':80,'https':443,'ftp':21};var $locationMinErr=minErr('$location');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 = int(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);if(locationObj.$$path && locationObj.$$path.charAt(0) != '/'){locationObj.$$path = '/' + locationObj.$$path;}}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);}function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//') + 2));}function LocationHtml5Url(appBase,basePrefix){this.$$html5 = true;basePrefix = basePrefix || '';var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);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();};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);};this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){this.hash(relHref.slice(1));return true;}var appUrl,prevAppUrl;var rewrittenUrl;if((appUrl = beginsWith(appBase,url)) !== undefined){prevAppUrl = appUrl;if((appUrl = beginsWith(basePrefix,appUrl)) !== undefined){rewrittenUrl = appBaseNoFile + (beginsWith('/',appUrl) || appUrl);}else {rewrittenUrl = appBase + prevAppUrl;}}else if((appUrl = beginsWith(appBaseNoFile,url)) !== undefined){rewrittenUrl = appBaseNoFile + appUrl;}else if(appBaseNoFile == url + '/'){rewrittenUrl = appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};}function LocationHashbangUrl(appBase,hashPrefix){var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);this.$$parse = function(url){var withoutBaseUrl=beginsWith(appBase,url) || beginsWith(appBaseNoFile,url);var withoutHashUrl;if(withoutBaseUrl.charAt(0) === '#'){withoutHashUrl = beginsWith(hashPrefix,withoutBaseUrl);if(isUndefined(withoutHashUrl)){withoutHashUrl = withoutBaseUrl;}}else {withoutHashUrl = this.$$html5?withoutBaseUrl:'';}parseAppUrl(withoutHashUrl,this);this.$$path = removeWindowsDriveName(this.$$path,withoutHashUrl,appBase);this.$$compose();function removeWindowsDriveName(path,url,base){var windowsFilePathExp=/^\/[A-Z]:(\/.*)/;var firstPathSegmentMatch;if(url.indexOf(base) === 0){url = url.replace(base,'');}if(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch = windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}};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;};}function LocationHashbangInHtml5Url(appBase,hashPrefix){this.$$html5 = true;LocationHashbangUrl.apply(this,arguments);var appBaseNoFile=stripFile(appBase);this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){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;this.$$absUrl = appBase + hashPrefix + this.$$url;};}var locationPrototype={$$html5:false,$$replace:false,absUrl:locationGetter('$$absUrl'),url:function url(_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;},protocol:locationGetter('$$protocol'),host:locationGetter('$$host'),port:locationGetter('$$port'),path:locationGetterSetter('$$path',function(path){path = path !== null?path.toString():'';return path.charAt(0) == '/'?path:'/' + path;}),search:function search(_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,{});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;},hash:locationGetterSetter('$$hash',function(hash){return hash !== null?hash.toString():'';}),replace:function replace(){this.$$replace = true;return this;}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype = Object.create(locationPrototype);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');}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;};}function $LocationProvider(){var hashPrefix='',html5Mode={enabled:false,requireBase:true,rewriteLinks:true};this.hashPrefix = function(prefix){if(isDefined(prefix)){hashPrefix = prefix;return this;}else {return hashPrefix;}};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;}};this.$get = ['$rootScope','$browser','$sniffer','$rootElement','$window',function($rootScope,$browser,$sniffer,$rootElement,$window){var $location,LocationMode,baseHref=$browser.baseHref(),initialUrl=$browser.url(),appBase;if(html5Mode.enabled){if(!baseHref && html5Mode.requireBase){throw $locationMinErr('nobase','$location in HTML5 mode requires a tag to be present!');}appBase = serverBase(initialUrl) + (baseHref || '/');LocationMode = $sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url;}else {appBase = stripHash(initialUrl);LocationMode = LocationHashbangUrl;}$location = new LocationMode(appBase,'#' + 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);$location.$$state = $browser.state();}catch(e) {$location.url(oldUrl);$location.$$state = oldState;throw e;}}$rootElement.on('click',function(event){if(!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2)return;var elm=jqLite(event.target);while(nodeName_(elm[0]) !== 'a') {if(elm[0] === $rootElement[0] || !(elm = elm.parent())[0])return;}var absHref=elm.prop('href');var relHref=elm.attr('href') || elm.attr('xlink:href');if(isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]'){absHref = urlResolve(absHref.animVal).href;}if(IGNORE_URI_REGEXP.test(absHref))return;if(absHref && !elm.attr('target') && !event.isDefaultPrevented()){if($location.$$parseLinkUrl(absHref,relHref)){event.preventDefault();if($location.absUrl() != $browser.url()){$rootScope.$apply();$window.angular['ff-684208-preventDefault'] = true;}}}});if(trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)){$browser.url($location.absUrl(),true);}var initializing=true;$browser.onUrlChange(function(newUrl,newState){$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($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();});$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($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;});return $location;function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast('$locationChangeSuccess',$location.absUrl(),oldUrl,$location.$$state,oldState);}}];}function $LogProvider(){var debug=true,self=this;this.debugEnabled = function(flag){if(isDefined(flag)){debug = flag;return this;}else {return debug;}};this.$get = ['$window',function($window){return {log:consoleLog('log'),info:consoleLog('info'),warn:consoleLog('warn'),error:consoleLog('error'),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;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);};}return function(arg1,arg2){logFn(arg1,arg2 == null?'':arg2);};}}];}var $parseMinErr=minErr('$parse');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 ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor === obj){throw $parseMinErr('isecfn','Referencing Function in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(obj.window === obj){throw $parseMinErr('isecwindow','Referencing the Window in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(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(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);}}}var CONSTANTS=createMap();forEach({'null':function _null(){return null;},'true':function _true(){return true;},'false':function _false(){return false;},'undefined':function undefined(){}},function(constantGetter,name){constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;CONSTANTS[name] = constantGetter;});CONSTANTS['this'] = function(self){return self;};CONSTANTS['this'].sharedGetter = true;var OPERATORS=extend(createMap(),{'+':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);if(isDefined(a)){if(isDefined(b)){return a + b;}return a;}return isDefined(b)?b:undefined;},'-':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);return (isDefined(a)?a:0) - (isDefined(b)?b:0);},'*':function _(self,locals,a,b){return a(self,locals) * b(self,locals);},'/':function _(self,locals,a,b){return a(self,locals) / b(self,locals);},'%':function _(self,locals,a,b){return a(self,locals) % b(self,locals);},'===':function _(self,locals,a,b){return a(self,locals) === b(self,locals);},'!==':function _(self,locals,a,b){return a(self,locals) !== b(self,locals);},'==':function _(self,locals,a,b){return a(self,locals) == b(self,locals);},'!=':function _(self,locals,a,b){return a(self,locals) != b(self,locals);},'<':function _(self,locals,a,b){return a(self,locals) < b(self,locals);},'>':function _(self,locals,a,b){return a(self,locals) > b(self,locals);},'<=':function _(self,locals,a,b){return a(self,locals) <= b(self,locals);},'>=':function _(self,locals,a,b){return a(self,locals) >= b(self,locals);},'&&':function _(self,locals,a,b){return a(self,locals) && b(self,locals);},'||':function _(self,locals,a,b){return a(self,locals) || b(self,locals);},'!':function _(self,locals,a){return !a(self,locals);},'=':true,'|':true});var ESCAPE={'n':'\n','f':'\f','r':'\r','t':'\t','v':'\u000b','\'':'\'','"':'"'};var Lexer=function Lexer(options){this.options = options;};Lexer.prototype = {constructor:Lexer,lex:function lex(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 is(ch,chars){return chars.indexOf(ch) !== -1;},peek:function peek(i){var num=i || 1;return this.index + num < this.text.length?this.text.charAt(this.index + num):false;},isNumber:function isNumber(ch){return '0' <= ch && ch <= '9' && typeof ch === 'string';},isWhitespace:function isWhitespace(ch){return ch === ' ' || ch === '\r' || ch === '\t' || ch === '\n' || ch === '\u000b' || ch === ' ';},isIdent:function isIdent(ch){return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || '_' === ch || ch === '$';},isExpOperator:function isExpOperator(ch){return ch === '-' || ch === '+' || this.isNumber(ch);},throwError:function throwError(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 readNumber(){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 readIdent(){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 readString(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);}};function isConstant(exp){return exp.constant;}var Parser=function Parser(lexer,$filter,options){this.lexer = lexer;this.$filter = $filter;this.options = options;};Parser.ZERO = extend(function(){return 0;},{sharedGetter:true,constant:true});Parser.prototype = {constructor:Parser,parse:function parse(text){this.text = text;this.tokens = this.lexer.lex(text);var value=this.statements();if(this.tokens.length !== 0){this.throwError('is an unexpected token',this.tokens[0]);}value.literal = !!value.literal;value.constant = !!value.constant;return value;},primary:function primary(){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.peek().identifier && this.peek().text in CONSTANTS){primary = 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,context;while(next = this.expect('(','[','.')) {if(next.text === '('){primary = this.functionCall(primary,context);context = null;}else if(next.text === '['){context = primary;primary = this.objectIndex(primary);}else if(next.text === '.'){context = primary;primary = this.fieldAccess(primary);}else {this.throwError('IMPOSSIBLE');}}return primary;},throwError:function throwError(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));},peekToken:function peekToken(){if(this.tokens.length === 0)throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);return this.tokens[0];},peek:function peek(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4);},peekAhead:function peekAhead(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 expect(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);if(token){this.tokens.shift();return token;}return false;},consume:function consume(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;},unaryFn:function unaryFn(op,right){var fn=OPERATORS[op];return extend(function $parseUnaryFn(self,locals){return fn(self,locals,right);},{constant:right.constant,inputs:[right]});},binaryFn:function binaryFn(left,op,right,isBranching){var fn=OPERATORS[op];return extend(function $parseBinaryFn(self,locals){return fn(self,locals,left,right);},{constant:left.constant && right.constant,inputs:!isBranching && [left,right]});},identifier:function identifier(){var id=this.consume().text;while(this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2,'(')) {id += this.consume().text + this.consume().text;}return getterFn(id,this.options,this.text);},constant:function constant(){var value=this.consume().value;return extend(function $parseConstant(){return value;},{constant:true,literal:true});},statements:function statements(){var statements=[];while(true) {if(this.tokens.length > 0 && !this.peek('}',')',';',']'))statements.push(this.filterChain());if(!this.expect(';')){return statements.length === 1?statements[0]:function $parseStatements(self,locals){var value;for(var i=0,ii=statements.length;i < ii;i++) {value = statements[i](self,locals);}return value;};}}},filterChain:function filterChain(){var left=this.expression();var token;while(token = this.expect('|')) {left = this.filter(left);}return left;},filter:function filter(inputFn){var fn=this.$filter(this.consume().text);var argsFn;var args;if(this.peek(':')){argsFn = [];args = [];while(this.expect(':')) {argsFn.push(this.expression());}}var inputs=[inputFn].concat(argsFn || []);return extend(function $parseFilter(self,locals){var input=inputFn(self,locals);if(args){args[0] = input;var i=argsFn.length;while(i--) {args[i + 1] = argsFn[i](self,locals);}return fn.apply(undefined,args);}return fn(input);},{constant:!fn.$stateful && inputs.every(isConstant),inputs:!fn.$stateful && inputs});},expression:function expression(){return this.assignment();},assignment:function assignment(){var left=this.ternary();var right;var token;if(token = this.expect('=')){if(!left.assign){this.throwError('implies assignment but [' + this.text.substring(0,token.index) + '] can not be assigned to',token);}right = this.ternary();return extend(function $parseAssignment(scope,locals){return left.assign(scope,right(scope,locals),locals);},{inputs:[left,right]});}return left;},ternary:function ternary(){var left=this.logicalOR();var middle;var token;if(token = this.expect('?')){middle = this.assignment();if(this.consume(':')){var right=this.assignment();return extend(function $parseTernary(self,locals){return left(self,locals)?middle(self,locals):right(self,locals);},{constant:left.constant && middle.constant && right.constant});}}return left;},logicalOR:function logicalOR(){var left=this.logicalAND();var token;while(token = this.expect('||')) {left = this.binaryFn(left,token.text,this.logicalAND(),true);}return left;},logicalAND:function logicalAND(){var left=this.equality();var token;while(token = this.expect('&&')) {left = this.binaryFn(left,token.text,this.equality(),true);}return left;},equality:function equality(){var left=this.relational();var token;while(token = this.expect('==','!=','===','!==')) {left = this.binaryFn(left,token.text,this.relational());}return left;},relational:function relational(){var left=this.additive();var token;while(token = this.expect('<','>','<=','>=')) {left = this.binaryFn(left,token.text,this.additive());}return left;},additive:function additive(){var left=this.multiplicative();var token;while(token = this.expect('+','-')) {left = this.binaryFn(left,token.text,this.multiplicative());}return left;},multiplicative:function multiplicative(){var left=this.unary();var token;while(token = this.expect('*','/','%')) {left = this.binaryFn(left,token.text,this.unary());}return left;},unary:function unary(){var token;if(this.expect('+')){return this.primary();}else if(token = this.expect('-')){return this.binaryFn(Parser.ZERO,token.text,this.unary());}else if(token = this.expect('!')){return this.unaryFn(token.text,this.unary());}else {return this.primary();}},fieldAccess:function fieldAccess(object){var getter=this.identifier();return extend(function $parseFieldAccess(scope,locals,self){var o=self || object(scope,locals);return o == null?undefined:getter(o);},{assign:function assign(scope,value,locals){var o=object(scope,locals);if(!o)object.assign(scope,o = {},locals);return getter.assign(o,value);}});},objectIndex:function objectIndex(obj){var expression=this.text;var indexFn=this.expression();this.consume(']');return extend(function $parseObjectIndex(self,locals){var o=obj(self,locals),i=indexFn(self,locals),v;ensureSafeMemberName(i,expression);if(!o)return undefined;v = ensureSafeObject(o[i],expression);return v;},{assign:function assign(self,value,locals){var key=ensureSafeMemberName(indexFn(self,locals),expression);var o=ensureSafeObject(obj(self,locals),expression);if(!o)obj.assign(self,o = {},locals);return o[key] = value;}});},functionCall:function functionCall(fnGetter,contextGetter){var argsFn=[];if(this.peekToken().text !== ')'){do {argsFn.push(this.expression());}while(this.expect(','));}this.consume(')');var expressionText=this.text;var args=argsFn.length?[]:null;return function $parseFunctionCall(scope,locals){var context=contextGetter?contextGetter(scope,locals):isDefined(contextGetter)?undefined:scope;var fn=fnGetter(scope,locals,context) || noop;if(args){var i=argsFn.length;while(i--) {args[i] = ensureSafeObject(argsFn[i](scope,locals),expressionText);}}ensureSafeObject(context,expressionText);ensureSafeFunction(fn,expressionText);var v=fn.apply?fn.apply(context,args):fn(args[0],args[1],args[2],args[3],args[4]);if(args){args.length = 0;}return ensureSafeObject(v,expressionText);};},arrayDeclaration:function arrayDeclaration(){var elementFns=[];if(this.peekToken().text !== ']'){do {if(this.peek(']')){break;}elementFns.push(this.expression());}while(this.expect(','));}this.consume(']');return extend(function $parseArrayLiteral(self,locals){var array=[];for(var i=0,ii=elementFns.length;i < ii;i++) {array.push(elementFns[i](self,locals));}return array;},{literal:true,constant:elementFns.every(isConstant),inputs:elementFns});},object:function object(){var keys=[],valueFns=[];if(this.peekToken().text !== '}'){do {if(this.peek('}')){break;}var token=this.consume();if(token.constant){keys.push(token.value);}else if(token.identifier){keys.push(token.text);}else {this.throwError('invalid key',token);}this.consume(':');valueFns.push(this.expression());}while(this.expect(','));}this.consume('}');return extend(function $parseObjectLiteral(self,locals){var object={};for(var i=0,ii=valueFns.length;i < ii;i++) {object[keys[i]] = valueFns[i](self,locals);}return object;},{literal:true,constant:valueFns.every(isConstant),inputs:valueFns});}};function setter(obj,locals,path,setValue,fullExp){ensureSafeObject(obj,fullExp);ensureSafeObject(locals,fullExp);var element=path.split('.'),key;for(var i=0;element.length > 1;i++) {key = ensureSafeMemberName(element.shift(),fullExp);var propertyObj=i === 0 && locals && locals[key] || obj[key];if(!propertyObj){propertyObj = {};obj[key] = propertyObj;}obj = ensureSafeObject(propertyObj,fullExp);}key = ensureSafeMemberName(element.shift(),fullExp);ensureSafeObject(obj[key],fullExp);obj[key] = setValue;return setValue;}var getterFnCacheDefault=createMap();var getterFnCacheExpensive=createMap();function isPossiblyDangerousMemberName(name){return name == 'constructor';}function cspSafeGetterFn(key0,key1,key2,key3,key4,fullExp,expensiveChecks){ensureSafeMemberName(key0,fullExp);ensureSafeMemberName(key1,fullExp);ensureSafeMemberName(key2,fullExp);ensureSafeMemberName(key3,fullExp);ensureSafeMemberName(key4,fullExp);var eso=function eso(o){return ensureSafeObject(o,fullExp);};var eso0=expensiveChecks || isPossiblyDangerousMemberName(key0)?eso:identity;var eso1=expensiveChecks || isPossiblyDangerousMemberName(key1)?eso:identity;var eso2=expensiveChecks || isPossiblyDangerousMemberName(key2)?eso:identity;var eso3=expensiveChecks || isPossiblyDangerousMemberName(key3)?eso:identity;var eso4=expensiveChecks || isPossiblyDangerousMemberName(key4)?eso:identity;return function cspSafeGetter(scope,locals){var pathVal=locals && locals.hasOwnProperty(key0)?locals:scope;if(pathVal == null)return pathVal;pathVal = eso0(pathVal[key0]);if(!key1)return pathVal;if(pathVal == null)return undefined;pathVal = eso1(pathVal[key1]);if(!key2)return pathVal;if(pathVal == null)return undefined;pathVal = eso2(pathVal[key2]);if(!key3)return pathVal;if(pathVal == null)return undefined;pathVal = eso3(pathVal[key3]);if(!key4)return pathVal;if(pathVal == null)return undefined;pathVal = eso4(pathVal[key4]);return pathVal;};}function getterFnWithEnsureSafeObject(fn,fullExpression){return function(s,l){return fn(s,l,ensureSafeObject,fullExpression);};}function getterFn(path,options,fullExp){var expensiveChecks=options.expensiveChecks;var getterFnCache=expensiveChecks?getterFnCacheExpensive:getterFnCacheDefault;var fn=getterFnCache[path];if(fn)return fn;var pathKeys=path.split('.'),pathKeysLength=pathKeys.length;if(options.csp){if(pathKeysLength < 6){fn = cspSafeGetterFn(pathKeys[0],pathKeys[1],pathKeys[2],pathKeys[3],pathKeys[4],fullExp,expensiveChecks);}else {fn = function cspSafeGetter(scope,locals){var i=0,val;do {val = cspSafeGetterFn(pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],fullExp,expensiveChecks)(scope,locals);locals = undefined;scope = val;}while(i < pathKeysLength);return val;};}}else {var code='';if(expensiveChecks){code += 's = eso(s, fe);\nl = eso(l, fe);\n';}var needsEnsureSafeObject=expensiveChecks;forEach(pathKeys,function(key,index){ensureSafeMemberName(key,fullExp);var lookupJs=(index?'s':'((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key;if(expensiveChecks || isPossiblyDangerousMemberName(key)){lookupJs = 'eso(' + lookupJs + ', fe)';needsEnsureSafeObject = true;}code += 'if(s == null) return undefined;\n' + 's=' + lookupJs + ';\n';});code += 'return s;';var evaledFnGetter=new Function('s','l','eso','fe',code);evaledFnGetter.toString = valueFn(code);if(needsEnsureSafeObject){evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter,fullExp);}fn = evaledFnGetter;}fn.sharedGetter = true;fn.assign = function(self,value,locals){return setter(self,locals,path,value,path);};getterFnCache[path] = fn;return fn;}var objectValueOf=Object.prototype.valueOf;function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value);}function $ParseProvider(){var cacheDefault=createMap();var cacheExpensive=createMap();this.$get = ['$filter','$sniffer',function($filter,$sniffer){var $parseOptions={csp:$sniffer.csp,expensiveChecks:false},$parseOptionsExpensive={csp:$sniffer.csp,expensiveChecks:true};function wrapSharedExpression(exp){var wrapped=exp;if(exp.sharedGetter){wrapped = function $parseWrapper(self,locals){return exp(self,locals);};wrapped.literal = exp.literal;wrapped.constant = exp.constant;wrapped.assign = exp.assign;}return wrapped;}return function $parse(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(typeof exp){case 'string':cacheKey = exp = exp.trim();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 = wrapSharedExpression(parsedExpression);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 addInterceptor(noop,interceptorFn);}};function collectExpressionInputs(inputs,list){for(var i=0,ii=inputs.length;i < ii;i++) {var input=inputs[i];if(!input.constant){if(input.inputs){collectExpressionInputs(input.inputs,list);}else if(list.indexOf(input) === -1){list.push(input);}}}return list;}function expressionInputDirtyCheck(newValue,oldValueOfValue){if(newValue == null || oldValueOfValue == null){return newValue === oldValueOfValue;}if(typeof newValue === 'object'){newValue = getValueOf(newValue);if(typeof newValue === 'object'){return false;}}return newValue === oldValueOfValue || newValue !== newValue && oldValueOfValue !== oldValueOfValue;}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression){var inputExpressions=parsedExpression.$$inputs || (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs,[]));var lastResult;if(inputExpressions.length === 1){var oldInputValue=expressionInputDirtyCheck;inputExpressions = inputExpressions[0];return scope.$watch(function expressionInputWatch(scope){var newInputValue=inputExpressions(scope);if(!expressionInputDirtyCheck(newInputValue,oldInputValue)){lastResult = parsedExpression(scope);oldInputValue = newInputValue && getValueOf(newInputValue);}return lastResult;},listener,objectEquality);}var oldInputValueOfValues=[];for(var i=0,ii=inputExpressions.length;i < ii;i++) {oldInputValueOfValues[i] = expressionInputDirtyCheck;}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]))){oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);}}if(changed){lastResult = parsedExpression(scope);}return lastResult;},listener,objectEquality);}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){var value=parsedExpression(scope,locals);return interceptorFn(value,scope,locals);}:function oneTimeInterceptedExpression(scope,locals){var value=parsedExpression(scope,locals);var result=interceptorFn(value,scope,locals);return isDefined(value)?result:value;};if(parsedExpression.$$watchDelegate && parsedExpression.$$watchDelegate !== inputsWatchDelegate){fn.$$watchDelegate = parsedExpression.$$watchDelegate;}else if(!interceptorFn.$stateful){fn.$$watchDelegate = inputsWatchDelegate;fn.inputs = [parsedExpression];}return fn;}}];}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);}];}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)];}var defer=function defer(){return new Deferred();};function Promise(){this.$$state = {status:0};}Promise.prototype = {then:function then(onFulfilled,onRejected,progressBack){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 _catch(callback){return this.then(null,callback);},'finally':function _finally(callback,progressBack){return this.then(function(value){return handleCallback(value,true,callback);},function(error){return handleCallback(error,false,callback);},progressBack);}};function simpleBind(context,fn){return function(value){fn.call(context,value);};}function processQueue(state){var fn,promise,pending;pending = state.pending;state.processScheduled = false;state.pending = undefined;for(var i=0,ii=pending.length;i < ii;++i) {promise = pending[i][0];fn = pending[i][state.status];try{if(isFunction(fn)){promise.resolve(fn(state.value));}else if(state.status === 1){promise.resolve(state.value);}else {promise.reject(state.value);}}catch(e) {promise.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();this.resolve = simpleBind(this,this.resolve);this.reject = simpleBind(this,this.reject);this.notify = simpleBind(this,this.notify);}Deferred.prototype = {resolve:function resolve(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 $$resolve(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 reject(reason){if(this.promise.$$state.status)return;this.$$reject(reason);},$$reject:function $$reject(reason){this.promise.$$state.value = reason;this.promise.$$state.status = 2;scheduleProcessQueue(this.promise.$$state);},notify:function notify(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);}}});}}};var reject=function reject(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);}};var when=function when(value,callback,errback,progressBack){var result=new Deferred();result.resolve(value);return result.promise.then(callback,errback,progressBack);};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)){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.all = all;return $Q;}function $$RAFProvider(){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);return function(){$timeout.cancel(timer);};};raf.supported = rafSupported;return raf;}];}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;}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.$$isolateBindings = null;}Scope.prototype = {constructor:Scope,$new:function $new(isolate,parent){var child;parent = parent || this;if(isolate){child = new Scope();child.$root = this.$root;}else {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;}if(isolate || parent != this)child.$on('$destroy',destroyChildScope);return child;},$watch:function $watch(watchExp,listener,objectEquality){var get=$parse(watchExp);if(get.$$watchDelegate){return get.$$watchDelegate(this,listener,objectEquality,get);}var scope=this,array=scope.$$watchers,watcher={fn:listener,last:initWatchVal,get:get,exp:watchExp,eq:!!objectEquality};lastDirtyWatch = null;if(!isFunction(listener)){watcher.fn = noop;}if(!array){array = scope.$$watchers = [];}array.unshift(watcher);return function deregisterWatch(){arrayRemove(array,watcher);lastDirtyWatch = null;};},$watchGroup:function $watchGroup(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){var shouldCall=true;self.$evalAsync(function(){if(shouldCall)listener(newValues,newValues,self);});return function deregisterWatchGroup(){shouldCall = false;};}if(watchExpressions.length === 1){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()();}};},$watchCollection:function $watchCollection(obj,listener){$watchCollectionInterceptor.$stateful = true;var self=this;var newValue;var oldValue;var veryOldValue;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(isUndefined(newValue))return;if(!isObject(newValue)){if(oldValue !== newValue){oldValue = newValue;changeDetected++;}}else if(isArrayLike(newValue)){if(oldValue !== internalArray){oldValue = internalArray;oldLength = oldValue.length = 0;changeDetected++;}newLength = newValue.length;if(oldLength !== newLength){changeDetected++;oldValue.length = oldLength = newLength;}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){oldValue = internalObject = {};oldLength = 0;changeDetected++;}newLength = 0;for(key in newValue) {if(newValue.hasOwnProperty(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){changeDetected++;for(key in oldValue) {if(!newValue.hasOwnProperty(key)){oldLength--;delete oldValue[key];}}}}return changeDetected;}function $watchCollectionAction(){if(initRun){initRun = false;listener(newValue,newValue,self);}else {listener(newValue,veryOldValue,self);}if(trackVeryOldValue){if(!isObject(newValue)){veryOldValue = newValue;}else if(isArrayLike(newValue)){veryOldValue = new Array(newValue.length);for(var i=0;i < newValue.length;i++) {veryOldValue[i] = newValue[i];}}else {veryOldValue = {};for(var key in newValue) {if(hasOwnProperty.call(newValue,key)){veryOldValue[key] = newValue[key];}}}}}return this.$watch(changeDetector,$watchCollectionAction);},$digest:function $digest(){var watch,value,last,watchers,length,dirty,ttl=TTL,next,current,target=this,watchLog=[],logIdx,logMsg,asyncTask;beginPhase('$digest');$browser.$$checkUrlChange();if(this === $rootScope && applyAsyncId !== null){$browser.defer.cancel(applyAsyncId);flushApplyAsync();}lastDirtyWatch = null;do {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 {if(watchers = current.$$watchers){length = watchers.length;while(length--) {try{watch = watchers[length];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){dirty = false;break traverseScopesLoop;}}}catch(e) {$exceptionHandler(e);}}}if(!(next = current.$$childHead || current !== target && current.$$nextSibling)){while(current !== target && !(next = current.$$nextSibling)) {current = current.$parent;}}}while(current = next);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);}}},$destroy:function $destroy(){if(this.$$destroyed)return;var parent=this.$parent;this.$broadcast('$destroy');this.$$destroyed = true;if(this === $rootScope)return;for(var eventName in this.$$listenerCount) {decrementListenerCount(this,this.$$listenerCount[eventName],eventName);}if(parent.$$childHead == this)parent.$$childHead = this.$$nextSibling;if(parent.$$childTail == this)parent.$$childTail = this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling = this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling = this.$$prevSibling;this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;this.$on = this.$watch = this.$watchGroup = function(){return noop;};this.$$listeners = {};this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = this.$$watchers = null;},$eval:function $eval(expr,locals){return $parse(expr)(this,locals);},$evalAsync:function $evalAsync(expr,locals){if(!$rootScope.$$phase && !asyncQueue.length){$browser.defer(function(){if(asyncQueue.length){$rootScope.$digest();}});}asyncQueue.push({scope:this,expression:expr,locals:locals});},$$postDigest:function $$postDigest(fn){postDigestQueue.push(fn);},$apply:function $apply(expr){try{beginPhase('$apply');return this.$eval(expr);}catch(e) {$exceptionHandler(e);}finally {clearPhase();try{$rootScope.$digest();}catch(e) {$exceptionHandler(e);throw e;}}},$applyAsync:function $applyAsync(expr){var scope=this;expr && applyAsyncQueue.push($applyAsyncExpression);scheduleApplyAsync();function $applyAsyncExpression(){scope.$eval(expr);}},$on:function $on(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);}};},$emit:function $emit(name,args){var empty=[],namedListeners,scope=this,_stopPropagation=false,event={name:name,targetScope:scope,stopPropagation:function stopPropagation(){_stopPropagation = true;},preventDefault:function preventDefault(){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(!namedListeners[i]){namedListeners.splice(i,1);i--;length--;continue;}try{namedListeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}if(_stopPropagation){event.currentScope = null;return event;}scope = scope.$parent;}while(scope);event.currentScope = null;return event;},$broadcast:function $broadcast(name,args){var target=this,current=target,next=target,event={name:name,targetScope:target,preventDefault:function preventDefault(){event.defaultPrevented = true;},defaultPrevented:false};if(!target.$$listenerCount[name])return event;var listenerArgs=concat([event],arguments,1),listeners,i,length;while(current = next) {event.currentScope = current;listeners = current.$$listeners[name] || [];for(i = 0,length = listeners.length;i < length;i++) {if(!listeners[i]){listeners.splice(i,1);i--;length--;continue;}try{listeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}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();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 decrementListenerCount(current,count,name){do {current.$$listenerCount[name] -= count;if(current.$$listenerCount[name] === 0){delete current.$$listenerCount[name];}}while(current = current.$parent);}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);});}}}];}function $$SanitizeUriProvider(){var aHrefSanitizationWhitelist=/^\s*(https?|ftp|mailto|tel|file):/,imgSrcSanitizationWhitelist=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){aHrefSanitizationWhitelist = regexp;return this;}return aHrefSanitizationWhitelist;};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;};};}var $sceMinErr=minErr('$sce');var SCE_CONTEXTS={HTML:'html',CSS:'css',URL:'url',RESOURCE_URL:'resourceUrl',JS:'js'};function adjustMatcher(matcher){if(matcher === 'self'){return matcher;}else if(isString(matcher)){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)){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;}function $SceDelegateProvider(){this.SCE_CONTEXTS = SCE_CONTEXTS;var resourceUrlWhitelist=['self'],resourceUrlBlacklist=[];this.resourceUrlWhitelist = function(value){if(arguments.length){resourceUrlWhitelist = adjustMatchers(value);}return resourceUrlWhitelist;};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 {return !!matcher.exec(parsedUrl.href);}}function isResourceUrlAllowedByPolicy(url){var parsedUrl=urlResolve(url.toString());var i,n,allowed=false;for(i = 0,n = resourceUrlWhitelist.length;i < n;i++) {if(matchUrl(resourceUrlWhitelist[i],parsedUrl)){allowed = true;break;}}if(allowed){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]);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 || trustedValue === undefined || trustedValue === ''){return trustedValue;}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);}function valueOf(maybeTrusted){if(maybeTrusted instanceof trustedValueHolderBase){return maybeTrusted.$$unwrapTrustedValue();}else {return maybeTrusted;}}function getTrusted(type,maybeTrusted){if(maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === ''){return maybeTrusted;}var constructor=byType.hasOwnProperty(type)?byType[type]:null;if(constructor && maybeTrusted instanceof constructor){return maybeTrusted.$$unwrapTrustedValue();}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};}];}function $SceProvider(){var enabled=true;this.enabled = function(value){if(arguments.length){enabled = !!value;}return enabled;};this.$get = ['$parse','$sceDelegate',function($parse,$sceDelegate){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 to the top of your HTML ' + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');}var sce=shallowCopy(SCE_CONTEXTS);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;}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);});}};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;}];}function $SnifferProvider(){this.$get = ['$window','$document',function($window,$document){var eventSupport={},android=int((/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(document.body.style.webkitTransition);animations = isString(document.body.style.webkitAnimation);}}return {history:!!($window.history && $window.history.pushState && !(android < 4) && !boxee),hasEvent:function hasEvent(event){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');function $TemplateRequestProvider(){this.$get = ['$templateCache','$http','$q',function($templateCache,$http,$q){function handleRequestFn(tpl,ignoreRequestError){handleRequestFn.totalPendingRequests++;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){return response.data;},handleError);function handleError(resp){if(!ignoreRequestError){throw $compileMinErr('tpload','Failed to load template: {0}',tpl);}return $q.reject(resp);}}handleRequestFn.totalPendingRequests = 0;return handleRequestFn;}];}function $$TestabilityProvider(){this.$get = ['$rootScope','$browser','$location',function($rootScope,$browser,$location){var testability={};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;};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;}}};testability.getLocation = function(){return $location.url();};testability.setLocation = function(url){if(url !== $location.url()){$location.url(url);$rootScope.$digest();}};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={};function timeout(fn,delay,invokeApply){var skipApply=isDefined(invokeApply) && !invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise,timeoutId;timeoutId = $browser.defer(function(){try{deferred.resolve(fn());}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;}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;}];}var urlParsingNode=document.createElement('a');var originUrl=urlResolve(window.location.href);function urlResolve(url){var href=url;if(msie){urlParsingNode.setAttribute('href',href);href = urlParsingNode.href;}urlParsingNode.setAttribute('href',href);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};}function urlIsSameOrigin(requestUrl){var parsed=isString(requestUrl)?urlResolve(requestUrl):requestUrl;return parsed.protocol === originUrl.protocol && parsed.host === originUrl.host;}function $WindowProvider(){this.$get = valueFn(window);}$FilterProvider.$inject = ['$provide'];function $FilterProvider($provide){var suffix='Filter';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);};}];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);}function filterFilter(){return function(array,expression,comparator){if(!isArray(array))return array;var predicateFn;var matchAgainstAnyProp;switch(typeof expression){case 'function':predicateFn = expression;break;case 'boolean':case 'number':case 'string':matchAgainstAnyProp = true;case 'object':predicateFn = createPredicateFn(expression,comparator,matchAgainstAnyProp);break;default:return array;}return array.filter(predicateFn);};}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(isObject(actual) || isObject(expected)){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(_x3,_x4,_x5,_x6,_x7){var _again2=true;_function2: while(_again2) {var actual=_x3,expected=_x4,comparator=_x5,matchAgainstAnyProp=_x6,dontMatchWholeObject=_x7;actualType = expectedType = key = expectedVal = matchAnyProperty = actualVal = undefined;_again2 = false;var actualType=actual !== null?typeof actual:'null';var expectedType=expected !== null?typeof expected:'null';if(expectedType === 'string' && expected.charAt(0) === '!'){return !deepCompare(actual,expected.substring(1),comparator,matchAgainstAnyProp);}else if(isArray(actual)){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;}}if(dontMatchWholeObject){return false;}else {_x3 = actual;_x4 = expected;_x5 = comparator;_x6 = false;_again2 = true;continue _function2;}}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);}}}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;}return amount == null?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol);};}numberFilter.$inject = ['$locale'];function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){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(!isFinite(number) || isObject(number))return '';var isNegative=number < 0;number = Math.abs(number);var numStr=number + '',formatedText='',parts=[];var hasExponent=false;if(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(!hasExponent){var fractionLen=(numStr.split(DECIMAL_SEP)[1] || '').length;if(isUndefined(fractionSize)){fractionSize = Math.min(Math.max(pattern.minFrac,fractionLen),pattern.maxFrac);}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);}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);}}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){var zone=-1 * date.getTimezoneOffset();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){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(dayOfWeekOnFirst <= 4?5:12) - dayOfWeekOnFirst);}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),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);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),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+$/;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))?)?$/;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 = int(match[9] + match[10]);tzMin = int(match[9] + match[11]);}dateSetter.call(date,int(match[1]),int(match[2]) - 1,int(match[3]));var h=int(match[4] || 0) - tzHour;var m=int(match[5] || 0) - tzMin;var s=int(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)?int(date):jsonStringToDate(date);}if(isNumber(date)){date = new Date(date);}if(!isDate(date)){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;}}if(timezone && timezone === 'UTC'){date = new Date(date.getTime());date.setMinutes(date.getMinutes() + date.getTimezoneOffset());}forEach(parts,function(value){fn = DATE_FORMATS[value];text += fn?fn(date,$locale.DATETIME_FORMATS):value.replace(/(^'|'$)/g,'').replace(/''/g,'\'');});return text;};}function jsonFilter(){return function(object,spacing){if(isUndefined(spacing)){spacing = 2;}return toJson(object,spacing);};}var lowercaseFilter=valueFn(lowercase);var uppercaseFilter=valueFn(uppercase);function limitToFilter(){return function(input,limit){if(isNumber(input))input = input.toString();if(!isArray(input) && !isString(input))return input;if(Math.abs(Number(limit)) === Infinity){limit = Number(limit);}else {limit = int(limit);}if(limit){return limit > 0?input.slice(0,limit):input.slice(limit);}else {return isString(input)?'':[];}};}orderByFilter.$inject = ['$parse'];function orderByFilter($parse){return function(array,sortPredicate,reverseOrder){if(!isArrayLike(array))return array;sortPredicate = isArray(sortPredicate)?sortPredicate:[sortPredicate];if(sortPredicate.length === 0){sortPredicate = ['+'];}sortPredicate = sortPredicate.map(function(predicate){var descending=false,get=predicate || identity;if(isString(predicate)){if(predicate.charAt(0) == '+' || predicate.charAt(0) == '-'){descending = predicate.charAt(0) == '-';predicate = predicate.substring(1);}if(predicate === ''){return reverseComparator(compare,descending);}get = $parse(predicate);if(get.constant){var key=get();return reverseComparator(function(a,b){return compare(a[key],b[key]);},descending);}}return reverseComparator(function(a,b){return compare(get(a),get(b));},descending);});return slice.call(array).sort(reverseComparator(comparator,reverseOrder));function comparator(o1,o2){for(var i=0;i < sortPredicate.length;i++) {var comp=sortPredicate[i](o1,o2);if(comp !== 0)return comp;}return 0;}function reverseComparator(comp,descending){return descending?function(a,b){return comp(b,a);}:comp;}function isPrimitive(value){switch(typeof value){case 'number':case 'boolean':case 'string':return true;default:return false;}}function objectToString(value){if(value === null)return 'null';if(typeof value.valueOf === 'function'){value = value.valueOf();if(isPrimitive(value))return value;}if(typeof value.toString === 'function'){value = value.toString();if(isPrimitive(value))return value;}return '';}function compare(v1,v2){var t1=typeof v1;var t2=typeof v2;if(t1 === t2 && t1 === 'object'){v1 = objectToString(v1);v2 = objectToString(v2);}if(t1 === t2){if(t1 === 'string'){v1 = v1.toLowerCase();v2 = v2.toLowerCase();}if(v1 === v2)return 0;return v1 < v2?-1:1;}else {return t1 < t2?-1:1;}}};}function ngDirective(directive){if(isFunction(directive)){directive = {link:directive};}directive.restrict = directive.restrict || 'AC';return valueFn(directive);}var htmlAnchorDirective=valueFn({restrict:'E',compile:function compile(element,attr){if(!attr.href && !attr.xlinkHref && !attr.name){return function(scope,element){if(element[0].nodeName.toLowerCase() !== 'a')return;var href=toString.call(element.prop('href')) === '[object SVGAnimatedString]'?'xlink:href':'href';element.on('click',function(event){if(!element.attr(href)){event.preventDefault();}});};}}});var ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){if(propName == 'multiple')return;var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {restrict:'A',priority:100,link:function link(scope,element,attr){scope.$watch(attr[normalized],function ngBooleanAttrWatchAction(value){attr.$set(attrName,!!value);});}};};});forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr] = function(){return {priority:100,link:function link(scope,element,attr){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);});}};};});forEach(['src','srcset','href'],function(attrName){var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {priority:99,link:function link(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);if(msie && propName)element.prop(propName,attr[name]);});}};};});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;}FormController.$inject = ['$element','$attrs','$scope','$animate','$interpolate'];function FormController(element,attrs,$scope,$animate,$interpolate){var form=this,controls=[];var parentForm=form.$$parentForm = element.parent().controller('form') || nullFormCtrl;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;parentForm.$addControl(form);form.$rollbackViewValue = function(){forEach(controls,function(control){control.$rollbackViewValue();});};form.$commitViewValue = function(){forEach(controls,function(control){control.$commitViewValue();});};form.$addControl = function(control){assertNotHasOwnProperty(control.$name,'input');controls.push(control);if(control.$name){form[control.$name] = control;}};form.$$renameControl = function(control,newName){var oldName=control.$name;if(form[oldName] === control){delete form[oldName];}form[newName] = control;control.$name = newName;};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);};addSetValidityMethod({ctrl:this,$element:element,set:function set(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 unset(object,property,controller){var list=object[property];if(!list){return;}arrayRemove(list,controller);if(list.length === 0){delete object[property];}},parentForm:parentForm,$animate:$animate});form.$setDirty = function(){$animate.removeClass(element,PRISTINE_CLASS);$animate.addClass(element,DIRTY_CLASS);form.$dirty = true;form.$pristine = false;parentForm.$setDirty();};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();});};form.$setUntouched = function(){forEach(controls,function(control){control.$setUntouched();});};form.$setSubmitted = function(){$animate.addClass(element,SUBMITTED_CLASS);form.$submitted = true;parentForm.$setSubmitted();};}var formDirectiveFactory=function formDirectiveFactory(isNgForm){return ['$timeout',function($timeout){var formDirective={name:'form',restrict:isNgForm?'EAC':'E',controller:FormController,compile:function ngFormCompile(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?'name':isNgForm && attr.ngForm?'ngForm':false;return {pre:function ngFormPreLink(scope,formElement,attr,controller){if(!('action' in attr)){var handleFormSubmission=function handleFormSubmission(event){scope.$apply(function(){controller.$commitViewValue();controller.$setSubmitted();});event.preventDefault();};addEventListenerFn(formElement[0],'submit',handleFormSubmission);formElement.on('$destroy',function(){$timeout(function(){removeEventListenerFn(formElement[0],'submit',handleFormSubmission);},0,false);});}var parentFormCtrl=controller.$$parentForm;if(nameAttr){setter(scope,null,controller.$name,controller,controller.$name);attr.$observe(nameAttr,function(newValue){if(controller.$name === newValue)return;setter(scope,null,controller.$name,undefined,controller.$name);parentFormCtrl.$$renameControl(controller,newValue);setter(scope,null,controller.$name,controller,controller.$name);});}formElement.on('$destroy',function(){parentFormCtrl.$removeControl(controller);if(nameAttr){setter(scope,null,attr[nameAttr],undefined,controller.$name);}extend(controller,nullFormCtrl);});}};}};return formDirective;}];};var formDirective=formDirectiveFactory();var ngFormDirective=formDirectiveFactory(true);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*)))\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={'text':textInputType,'date':createDateInputType('date',DATE_REGEXP,createDateParser(DATE_REGEXP,['yyyy','MM','dd']),'yyyy-MM-dd'),'datetime-local':createDateInputType('datetimelocal',DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,['yyyy','MM','dd','HH','mm','ss','sss']),'yyyy-MM-ddTHH:mm:ss.sss'),'time':createDateInputType('time',TIME_REGEXP,createDateParser(TIME_REGEXP,['HH','mm','ss','sss']),'HH:mm:ss.sss'),'week':createDateInputType('week',WEEK_REGEXP,weekParser,'yyyy-Www'),'month':createDateInputType('month',MONTH_REGEXP,createDateParser(MONTH_REGEXP,['yyyy','MM']),'yyyy-MM'),'number':numberInputType,'url':urlInputType,'email':emailInputType,'radio':radioInputType,'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);if(!$sniffer.android){var composing=false;element.on('compositionstart',function(data){composing = true;});element.on('compositionend',function(){composing = false;listener();});}var listener=function listener(ev){if(timeout){$browser.defer.cancel(timeout);timeout = null;}if(composing)return;var value=element.val(),event=ev && ev.type;if(type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')){value = trim(value);}if(ctrl.$viewValue !== value || value === '' && ctrl.$$hasNativeValidators){ctrl.$setViewValue(value,event);}};if($sniffer.hasEvent('input')){element.on('input',listener);}else {var timeout;var deferListener=function deferListener(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;if(key === 91 || 15 < key && key < 19 || 37 <= key && key <= 40)return;deferListener(event,this,this.value);});if($sniffer.hasEvent('paste')){element.on('paste cut',deferListener);}}element.on('change',listener);ctrl.$render = function(){element.val(ctrl.$isEmpty(ctrl.$viewValue)?'':ctrl.$viewValue);};}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)){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)){var parsedDate=parseDate(value,previousDate);if(timezone === 'UTC'){parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());}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 === 'UTC'){var timezoneOffset=60000 * previousDate.getTimezoneOffset();previousDate = new Date(previousDate.getTime() + timezoneOffset);}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){return value && !(value.getTime && value.getTime() !== value.getTime());}function parseObservedDateValue(val){return isDefined(val)?isDate(val)?val:parseDate(val):undefined;}};}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) || {};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;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;ctrl.$validate();});}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){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){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){if(isUndefined(attr.name)){element.attr('name',nextUid());}var listener=function listener(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 minErr('ngModel')('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 listener(ev){ctrl.$setViewValue(element[0].checked,ev && ev.type);};element.on('click',listener);ctrl.$render = function(){element[0].checked = ctrl.$viewValue;};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;});}var inputDirective=['$browser','$sniffer','$filter','$parse',function($browser,$sniffer,$filter,$parse){return {restrict:'E',require:['?ngModel'],link:{pre:function pre(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+)$/;var ngValueDirective=function ngValueDirective(){return {restrict:'A',priority:100,compile:function compile(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);});};}}};};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 = value === undefined?'':value;});};}};}];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 = value === undefined?'':value;});};}};}];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(){element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');});};}};}];var ngChangeDirective=valueFn({restrict:'A',require:'ngModel',link:function link(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 link(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){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){var classCounts=element.data('$classCounts') || {};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){if(isArray(classVal)){return classVal;}else if(isString(classVal)){return classVal.split(' ');}else if(isObject(classVal)){var classes=[];forEach(classVal,function(v,k){if(v){classes = classes.concat(k.split(' '));}});return classes;}return classVal;}}];}var ngClassDirective=classDirective('',true);var ngClassOddDirective=classDirective('Odd',0);var ngClassEvenDirective=classDirective('Even',1);var ngCloakDirective=ngDirective({compile:function compile(element,attr){attr.$set('ngCloak',undefined);element.removeClass('ng-cloak');}});var ngControllerDirective=[function(){return {restrict:'A',scope:true,controller:'@',priority:500};}];var ngEventDirectives={};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 compile($element,attr){var fn=$parse(attr[directiveName],null,true);return function ngEventHandler(scope,element){element.on(eventName,function(event){var callback=function callback(){fn(scope,{$event:event});};if(forceAsyncEvents[eventName] && $rootScope.$$phase){scope.$evalAsync(callback);}else {scope.$apply(callback);}});};}};}];});var ngIfDirective=['$animate',function($animate){return {multiElement:true,transclude:'element',priority:600,terminal:true,restrict:'A',$$tlb:true,link:function link($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 + ' ');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;}}});}};}];var ngIncludeDirective=['$templateRequest','$anchorScroll','$animate','$sce',function($templateRequest,$anchorScroll,$animate,$sce){return {restrict:'ECA',priority:400,terminal:true,transclude:'element',controller:angular.noop,compile:function compile(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 cleanupLastIncludeContent(){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($sce.parseAsResourceUrl(srcExp),function ngIncludeWatchAction(src){var afterAnimation=function afterAnimation(){if(isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))){$anchorScroll();}};var thisChangeId=++changeCounter;if(src){$templateRequest(src,true).then(function(response){if(thisChangeId !== changeCounter)return;var newScope=scope.$new();ctrl.template = response;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;}});};}};}];var ngIncludeFillContentDirective=['$compile',function($compile){return {restrict:'ECA',priority:-400,require:'ngInclude',link:function link(scope,$element,$attr,ctrl){if(/SVG/.test($element[0].toString())){$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);}};}];var ngInitDirective=ngDirective({priority:450,compile:function compile(){return {pre:function pre(scope,element,attrs){scope.$eval(attrs.ngInit);}};}});var ngListDirective=function ngListDirective(){return {restrict:'A',priority:100,require:'ngModel',link:function link(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList) || ', ';var trimValues=attr.ngTrim !== 'false';var separator=trimValues?trim(ngList):ngList;var parse=function parse(viewValue){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;});ctrl.$isEmpty = function(value){return !value || !value.length;};}};};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=new minErr('ngModel');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;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 = {};this.$$success = {};this.$pending = undefined;this.$name = $interpolate($attr.name || '',false)($scope);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));}};this.$render = noop;this.$isEmpty = function(value){return isUndefined(value) || value === '' || value === null || value !== value;};var parentForm=$element.inheritedData('$formController') || nullFormCtrl,currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function set(object,property){object[property] = true;},unset:function unset(object,property){delete object[property];},parentForm:parentForm,$animate:$animate});this.$setPristine = function(){ctrl.$dirty = false;ctrl.$pristine = true;$animate.removeClass($element,DIRTY_CLASS);$animate.addClass($element,PRISTINE_CLASS);};this.$setDirty = function(){ctrl.$dirty = true;ctrl.$pristine = false;$animate.removeClass($element,PRISTINE_CLASS);$animate.addClass($element,DIRTY_CLASS);parentForm.$setDirty();};this.$setUntouched = function(){ctrl.$touched = false;ctrl.$untouched = true;$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS);};this.$setTouched = function(){ctrl.$touched = true;ctrl.$untouched = false;$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS);};this.$rollbackViewValue = function(){$timeout.cancel(pendingDebounce);ctrl.$viewValue = ctrl.$$lastCommittedViewValue;ctrl.$render();};this.$validate = function(){if(isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)){return;}var viewValue=ctrl.$$lastCommittedViewValue;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(!allowInvalid && prevValid !== allValid){ctrl.$modelValue = allValid?modelValue:undefined;if(ctrl.$modelValue !== prevModelValue){ctrl.$$writeModelToScope();}}});};this.$$runValidators = function(modelValue,viewValue,doneCallback){currentValidationRunId++;var localValidationRunId=currentValidationRunId;if(!processParseErrors()){validationDone(false);return;}if(!processSyncValidators()){validationDone(false);return;}processAsyncValidators();function processParseErrors(){var errorKey=ctrl.$$parserName || 'parse';if(parserValid === undefined){setValidity(errorKey,null);}else {if(!parserValid){forEach(ctrl.$validators,function(v,name){setValidity(name,null);});forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null);});}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);}}};this.$commitViewValue = function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce);if(ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)){return;}ctrl.$$lastCommittedViewValue = viewValue;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 = ngModelGet($scope);}var prevModelValue=ctrl.$modelValue;var allowInvalid=ctrl.$options && ctrl.$options.allowInvalid;ctrl.$$rawModelValue = modelValue;if(allowInvalid){ctrl.$modelValue = modelValue;writeToModelIfNeeded();}ctrl.$$runValidators(modelValue,ctrl.$$lastCommittedViewValue,function(allValid){if(!allowInvalid){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);}});};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();});}};$scope.$watch(function ngModelWatch(){var modelValue=ngModelGet($scope);if(modelValue !== ctrl.$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;});}];var ngModelDirective=['$rootScope',function($rootScope){return {restrict:'A',require:['ngModel','^?form','^?ngModelOptions'],controller:NgModelController,priority:1,compile:function ngModelCompile(element){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] || nullFormCtrl;modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);formCtrl.$addControl(modelCtrl);attr.$observe('name',function(newValue){if(modelCtrl.$name !== newValue){formCtrl.$$renameControl(modelCtrl,newValue);}});scope.$on('$destroy',function(){formCtrl.$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+|$)/;var ngModelOptionsDirective=function ngModelOptionsDirective(){return {restrict:'A',controller:['$scope','$attrs',function($scope,$attrs){var that=this;this.$options = $scope.$eval($attrs.ngModelOptions);if(this.$options.updateOn !== undefined){this.$options.updateOnDefault = false;this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP,function(){that.$options.updateOnDefault = true;return ' ';}));}else {this.$options.updateOnDefault = true;}}]};};function addSetValidityMethod(context){var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,parentForm=context.parentForm,$animate=context.$animate;classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));ctrl.$setValidity = setValidity;function setValidity(validationErrorKey,state,controller){if(state === undefined){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);}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);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) {return false;}}return true;}var ngNonBindableDirective=ngDirective({terminal:true,priority:1000});var ngPluralizeDirective=['$locale','$interpolate',function($locale,$interpolate){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return {restrict:'EA',link:function link(scope,element,attr){var numberExp=attr.count,whenExp=attr.$attr.when && element.attr(attr.$attr.when),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)){count = $locale.pluralCat(count - offset);}if(count !== lastCount && !(countIsNaN && isNaN(lastCount))){watchRemover();watchRemover = scope.$watch(whensExpFns[count],updateElementText);lastCount = count;}});function updateElementText(newText){element.text(newText || '');}}};}];var ngRepeatDirective=['$parse','$animate',function($parse,$animate){var NG_REMOVED='$$NG_REMOVED';var ngRepeatMinErr=minErr('ngRepeat');var updateScope=function updateScope(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){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);scope.$odd = !(scope.$even = (index & 1) === 0);};var getBlockStart=function getBlockStart(block){return block.clone[0];};var getBlockEnd=function getBlockEnd(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){if(keyIdentifier)hashFnLocals[keyIdentifier] = key;hashFnLocals[valueIdentifier] = value;hashFnLocals.$index = index;return trackByExpGetter($scope,hashFnLocals);};}var lastBlockMap=createMap();$scope.$watchCollection(rhs,function ngRepeatAction(collection){var index,length,previousNode=$element[0],nextNode,nextBlockMap=createMap(),collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove;if(aliasAs){$scope[aliasAs] = collection;}if(isArrayLike(collection)){collectionKeys = collection;trackByIdFn = trackByIdExpFn || trackByIdArrayFn;}else {trackByIdFn = trackByIdExpFn || trackByIdObjFn;collectionKeys = [];for(var itemKey in collection) {if(collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$'){collectionKeys.push(itemKey);}}collectionKeys.sort();}collectionLength = collectionKeys.length;nextBlockOrder = new Array(collectionLength);for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];trackById = trackByIdFn(key,value,index);if(lastBlockMap[trackById]){block = lastBlockMap[trackById];delete lastBlockMap[trackById];nextBlockMap[trackById] = block;nextBlockOrder[index] = block;}else if(nextBlockMap[trackById]){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 {nextBlockOrder[index] = {id:trackById,scope:undefined,clone:undefined};nextBlockMap[trackById] = true;}}for(var blockKey in lastBlockMap) {block = lastBlockMap[blockKey];elementsToRemove = getBlockNodes(block.clone);$animate.leave(elementsToRemove);if(elementsToRemove[0].parentNode){for(index = 0,length = elementsToRemove.length;index < length;index++) {elementsToRemove[index][NG_REMOVED] = true;}}block.scope.$destroy();}for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];block = nextBlockOrder[index];if(block.scope){nextNode = previousNode;do {nextNode = nextNode.nextSibling;}while(nextNode && nextNode[NG_REMOVED]);if(getBlockStart(block) != nextNode){$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode));}previousNode = getBlockEnd(block);updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength);}else {$transclude(function ngRepeatTransclude(clone,scope){block.scope = scope;var endNode=ngRepeatEndComment.cloneNode(false);clone[clone.length++] = endNode;$animate.enter(clone,null,jqLite(previousNode));previousNode = endNode;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';var ngShowDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngShow,function ngShowWatchAction(value){$animate[value?'removeClass':'addClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngHideDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngHide,function ngHideWatchAction(value){$animate[value?'addClass':'removeClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngStyleDirective=ngDirective(function(scope,element,attr){scope.$watchCollection(attr.ngStyle,function ngStyleWatchAction(newStyles,oldStyles){if(oldStyles && newStyles !== oldStyles){forEach(oldStyles,function(val,style){element.css(style,'');});}if(newStyles)element.css(newStyles);});});var ngSwitchDirective=['$animate',function($animate){return {restrict:'EA',require:'ngSwitch',controller:['$scope',function ngSwitchController(){this.cases = {};}],link:function link(scope,element,attr,ngSwitchController){var watchExpr=attr.ngSwitch || attr.on,selectedTranscludes=[],selectedElements=[],previousLeaveAnimations=[],selectedScopes=[];var spliceFactory=function spliceFactory(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 link(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 link(scope,element,attr,ctrl,$transclude){ctrl.cases['?'] = ctrl.cases['?'] || [];ctrl.cases['?'].push({transclude:$transclude,element:element});}});var ngTranscludeDirective=ngDirective({restrict:'EAC',link:function link($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);});}});var scriptDirective=['$templateCache',function($templateCache){return {restrict:'E',terminal:true,compile:function compile(element,attr){if(attr.type == 'text/ng-template'){var templateUrl=attr.id,text=element[0].text;$templateCache.put(templateUrl,text);}}};}];var ngOptionsMinErr=minErr('ngOptions');var ngOptionsDirective=valueFn({restrict:'A',terminal:true});var selectDirective=['$compile','$parse',function($compile,$parse){var NG_OPTIONS_REGEXP=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,nullModelCtrl={$setViewValue:noop};return {restrict:'E',require:['select','?ngModel'],controller:['$element','$scope','$attrs',function($element,$scope,$attrs){var self=this,optionsMap={},ngModelCtrl=nullModelCtrl,nullOption,unknownOption;self.databound = $attrs.ngModel;self.init = function(ngModelCtrl_,nullOption_,unknownOption_){ngModelCtrl = ngModelCtrl_;nullOption = nullOption_;unknownOption = unknownOption_;};self.addOption = function(value,element){assertNotHasOwnProperty(value,'"option value"');optionsMap[value] = true;if(ngModelCtrl.$viewValue == value){$element.val(value);if(unknownOption.parent())unknownOption.remove();}if(element && element[0].hasAttribute('selected')){element[0].selected = true;}};self.removeOption = function(value){if(this.hasOption(value)){delete optionsMap[value];if(ngModelCtrl.$viewValue === value){this.renderUnknownOption(value);}}};self.renderUnknownOption = function(val){var unknownVal='? ' + hashKey(val) + ' ?';unknownOption.val(unknownVal);$element.prepend(unknownOption);$element.val(unknownVal);unknownOption.prop('selected',true);};self.hasOption = function(value){return optionsMap.hasOwnProperty(value);};$scope.$on('$destroy',function(){self.renderUnknownOption = noop;});}],link:function link(scope,element,attr,ctrls){if(!ctrls[1])return;var selectCtrl=ctrls[0],ngModelCtrl=ctrls[1],multiple=attr.multiple,optionsExp=attr.ngOptions,nullOption=false,emptyOption,renderScheduled=false,optionTemplate=jqLite(document.createElement('option')),optGroupTemplate=jqLite(document.createElement('optgroup')),unknownOption=optionTemplate.clone();for(var i=0,children=element.children(),ii=children.length;i < ii;i++) {if(children[i].value === ''){emptyOption = nullOption = children.eq(i);break;}}selectCtrl.init(ngModelCtrl,nullOption,unknownOption);if(multiple){ngModelCtrl.$isEmpty = function(value){return !value || value.length === 0;};}if(optionsExp)setupAsOptions(scope,element,ngModelCtrl);else if(multiple)setupAsMultiple(scope,element,ngModelCtrl);else setupAsSingle(scope,element,ngModelCtrl,selectCtrl);function setupAsSingle(scope,selectElement,ngModelCtrl,selectCtrl){ngModelCtrl.$render = function(){var viewValue=ngModelCtrl.$viewValue;if(selectCtrl.hasOption(viewValue)){if(unknownOption.parent())unknownOption.remove();selectElement.val(viewValue);if(viewValue === '')emptyOption.prop('selected',true);}else {if(isUndefined(viewValue) && emptyOption){selectElement.val('');}else {selectCtrl.renderUnknownOption(viewValue);}}};selectElement.on('change',function(){scope.$apply(function(){if(unknownOption.parent())unknownOption.remove();ngModelCtrl.$setViewValue(selectElement.val());});});}function setupAsMultiple(scope,selectElement,ctrl){var lastView;ctrl.$render = function(){var items=new HashMap(ctrl.$viewValue);forEach(selectElement.find('option'),function(option){option.selected = isDefined(items.get(option.value));});};scope.$watch(function selectMultipleWatch(){if(!equals(lastView,ctrl.$viewValue)){lastView = shallowCopy(ctrl.$viewValue);ctrl.$render();}});selectElement.on('change',function(){scope.$apply(function(){var array=[];forEach(selectElement.find('option'),function(option){if(option.selected){array.push(option.value);}});ctrl.$setViewValue(array);});});}function setupAsOptions(scope,selectElement,ctrl){var match;if(!(match = optionsExp.match(NG_OPTIONS_REGEXP))){throw ngOptionsMinErr('iexp','Expected expression in form of ' + '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' + ' but got \'{0}\'. Element: {1}',optionsExp,startingTag(selectElement));}var displayFn=$parse(match[2] || match[1]),valueName=match[4] || match[6],selectAs=/ as /.test(match[0]) && match[1],selectAsFn=selectAs?$parse(selectAs):null,keyName=match[5],groupByFn=$parse(match[3] || ''),valueFn=$parse(match[2]?match[1]:valueName),valuesFn=$parse(match[7]),track=match[8],trackFn=track?$parse(match[8]):null,trackKeysCache={},optionGroupsCache=[[{element:selectElement,label:''}]],locals={};if(nullOption){$compile(nullOption)(scope);nullOption.removeClass('ng-scope');nullOption.remove();}selectElement.empty();selectElement.on('change',selectionChanged);ctrl.$render = render;scope.$watchCollection(valuesFn,scheduleRendering);scope.$watchCollection(getLabels,scheduleRendering);if(multiple){scope.$watchCollection(function(){return ctrl.$modelValue;},scheduleRendering);}function callExpression(exprFn,key,value){locals[valueName] = value;if(keyName)locals[keyName] = key;return exprFn(scope,locals);}function selectionChanged(){scope.$apply(function(){var collection=valuesFn(scope) || [];var viewValue;if(multiple){viewValue = [];forEach(selectElement.val(),function(selectedKey){selectedKey = trackFn?trackKeysCache[selectedKey]:selectedKey;viewValue.push(getViewValue(selectedKey,collection[selectedKey]));});}else {var selectedKey=trackFn?trackKeysCache[selectElement.val()]:selectElement.val();viewValue = getViewValue(selectedKey,collection[selectedKey]);}ctrl.$setViewValue(viewValue);render();});}function getViewValue(key,value){if(key === '?'){return undefined;}else if(key === ''){return null;}else {var viewValueFn=selectAsFn?selectAsFn:valueFn;return callExpression(viewValueFn,key,value);}}function getLabels(){var values=valuesFn(scope);var toDisplay;if(values && isArray(values)){toDisplay = new Array(values.length);for(var i=0,ii=values.length;i < ii;i++) {toDisplay[i] = callExpression(displayFn,i,values[i]);}return toDisplay;}else if(values){toDisplay = {};for(var prop in values) {if(values.hasOwnProperty(prop)){toDisplay[prop] = callExpression(displayFn,prop,values[prop]);}}}return toDisplay;}function createIsSelectedFn(viewValue){var selectedSet;if(multiple){if(trackFn && isArray(viewValue)){selectedSet = new HashMap([]);for(var trackIndex=0;trackIndex < viewValue.length;trackIndex++) {selectedSet.put(callExpression(trackFn,null,viewValue[trackIndex]),true);}}else {selectedSet = new HashMap(viewValue);}}else if(trackFn){viewValue = callExpression(trackFn,null,viewValue);}return function isSelected(key,value){var compareValueFn;if(trackFn){compareValueFn = trackFn;}else if(selectAsFn){compareValueFn = selectAsFn;}else {compareValueFn = valueFn;}if(multiple){return isDefined(selectedSet.remove(callExpression(compareValueFn,key,value)));}else {return viewValue === callExpression(compareValueFn,key,value);}};}function scheduleRendering(){if(!renderScheduled){scope.$$postDigest(render);renderScheduled = true;}}function updateLabelMap(labelMap,label,added){labelMap[label] = labelMap[label] || 0;labelMap[label] += added?1:-1;}function render(){renderScheduled = false;var optionGroups={'':[]},optionGroupNames=[''],optionGroupName,optionGroup,option,existingParent,existingOptions,existingOption,viewValue=ctrl.$viewValue,values=valuesFn(scope) || [],keys=keyName?sortedKeys(values):values,key,value,groupLength,length,groupIndex,index,labelMap={},selected,isSelected=createIsSelectedFn(viewValue),anySelected=false,lastElement,element,label,optionId;trackKeysCache = {};for(index = 0;length = keys.length,index < length;index++) {key = index;if(keyName){key = keys[index];if(key.charAt(0) === '$')continue;}value = values[key];optionGroupName = callExpression(groupByFn,key,value) || '';if(!(optionGroup = optionGroups[optionGroupName])){optionGroup = optionGroups[optionGroupName] = [];optionGroupNames.push(optionGroupName);}selected = isSelected(key,value);anySelected = anySelected || selected;label = callExpression(displayFn,key,value);label = isDefined(label)?label:'';optionId = trackFn?trackFn(scope,locals):keyName?keys[index]:index;if(trackFn){trackKeysCache[optionId] = key;}optionGroup.push({id:optionId,label:label,selected:selected});}if(!multiple){if(nullOption || viewValue === null){optionGroups[''].unshift({id:'',label:'',selected:!anySelected});}else if(!anySelected){optionGroups[''].unshift({id:'?',label:'',selected:true});}}for(groupIndex = 0,groupLength = optionGroupNames.length;groupIndex < groupLength;groupIndex++) {optionGroupName = optionGroupNames[groupIndex];optionGroup = optionGroups[optionGroupName];if(optionGroupsCache.length <= groupIndex){existingParent = {element:optGroupTemplate.clone().attr('label',optionGroupName),label:optionGroup.label};existingOptions = [existingParent];optionGroupsCache.push(existingOptions);selectElement.append(existingParent.element);}else {existingOptions = optionGroupsCache[groupIndex];existingParent = existingOptions[0];if(existingParent.label != optionGroupName){existingParent.element.attr('label',existingParent.label = optionGroupName);}}lastElement = null;for(index = 0,length = optionGroup.length;index < length;index++) {option = optionGroup[index];if(existingOption = existingOptions[index + 1]){lastElement = existingOption.element;if(existingOption.label !== option.label){updateLabelMap(labelMap,existingOption.label,false);updateLabelMap(labelMap,option.label,true);lastElement.text(existingOption.label = option.label);lastElement.prop('label',existingOption.label);}if(existingOption.id !== option.id){lastElement.val(existingOption.id = option.id);}if(lastElement[0].selected !== option.selected){lastElement.prop('selected',existingOption.selected = option.selected);if(msie){lastElement.prop('selected',existingOption.selected);}}}else {if(option.id === '' && nullOption){element = nullOption;}else {(element = optionTemplate.clone()).val(option.id).prop('selected',option.selected).attr('selected',option.selected).prop('label',option.label).text(option.label);}existingOptions.push(existingOption = {element:element,label:option.label,id:option.id,selected:option.selected});updateLabelMap(labelMap,option.label,true);if(lastElement){lastElement.after(element);}else {existingParent.element.append(element);}lastElement = element;}}index++;while(existingOptions.length > index) {option = existingOptions.pop();updateLabelMap(labelMap,option.label,false);option.element.remove();}}while(optionGroupsCache.length > groupIndex) {optionGroup = optionGroupsCache.pop();for(index = 1;index < optionGroup.length;++index) {updateLabelMap(labelMap,optionGroup[index].label,false);}optionGroup[0].element.remove();}forEach(labelMap,function(count,label){if(count > 0){selectCtrl.addOption(label);}else if(count < 0){selectCtrl.removeOption(label);}});}}}};}];var optionDirective=['$interpolate',function($interpolate){var nullSelectCtrl={addOption:noop,removeOption:noop};return {restrict:'E',priority:100,compile:function compile(element,attr){if(isUndefined(attr.value)){var interpolateFn=$interpolate(element.text(),true);if(!interpolateFn){attr.$set('value',element.text());}}return function(scope,element,attr){var selectCtrlName='$selectController',parent=element.parent(),selectCtrl=parent.data(selectCtrlName) || parent.parent().data(selectCtrlName);if(!selectCtrl || !selectCtrl.databound){selectCtrl = nullSelectCtrl;}if(interpolateFn){scope.$watch(interpolateFn,function interpolateWatchAction(newVal,oldVal){attr.$set('value',newVal);if(oldVal !== newVal){selectCtrl.removeOption(oldVal);}selectCtrl.addOption(newVal,element);});}else {selectCtrl.addOption(attr.value,element);}element.on('$destroy',function(){selectCtrl.removeOption(attr.value);});};}};}];var styleDirective=valueFn({restrict:'E',terminal:false});var requiredDirective=function requiredDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;attr.required = true;ctrl.$validators.required = function(modelValue,viewValue){return !attr.required || !ctrl.$isEmpty(viewValue);};attr.$observe('required',function(){ctrl.$validate();});}};};var patternDirective=function patternDirective(){return {restrict:'A',require:'?ngModel',link:function link(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(value){return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);};}};};var maxlengthDirective=function maxlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var maxlength=-1;attr.$observe('maxlength',function(value){var intVal=int(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 minlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var minlength=0;attr.$observe('minlength',function(value){minlength = int(value) || 0;ctrl.$validate();});ctrl.$validators.minlength = function(modelValue,viewValue){return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;};}};};if(window.angular.bootstrap){console.log('WARNING: Tried to load angular more than once.');return;}bindJQuery();publishExternalAPI(angular);jqLite(document).ready(function(){angularInit(document,bootstrap);});})(window,document);!window.angular.$$csp() && window.angular.element(document).find('head').prepend(''); + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + (function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define(factory);else if(typeof exports === 'object')exports['JSData'] = factory();else root['JSData'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _datastoreIndex=__webpack_require__(1);var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);module.exports = {DS:_datastoreIndex['default'],DSUtils:_utils['default'],DSErrors:_errors['default'],createStore:function createStore(options){return new _datastoreIndex['default'](options);},version:{full:'2.0.0-rc.1',major:parseInt('2',10),minor:parseInt('0',10),patch:parseInt('0',10),alpha:true?'false':false,beta:true?'false':false}};},function(module,exports,__webpack_require__){var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _sync_methodsIndex=__webpack_require__(4);var _async_methodsIndex=__webpack_require__(5);function lifecycleNoopCb(resource,attrs,cb){cb(null,attrs);}function lifecycleNoop(resource,attrs){return attrs;}function compare(_x,_x2,_x3,_x4){var _again=true;_function: while(_again) {var orderBy=_x,index=_x2,a=_x3,b=_x4;def = cA = cB = undefined;_again = false;var def=orderBy[index];var cA=_utils['default'].get(a,def[0]),cB=_utils['default'].get(b,def[0]);if(_utils['default']._s(cA)){cA = _utils['default'].upperCase(cA);}if(_utils['default']._s(cB)){cB = _utils['default'].upperCase(cB);}if(def[1] === 'DESC'){if(cB < cA){return -1;}else if(cB > cA){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}else {if(cA < cB){return -1;}else if(cA > cB){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}}}var Defaults=(function(){function Defaults(){_classCallCheck(this,Defaults);}_createClass(Defaults,[{key:'errorFn',value:function errorFn(a,b){if(this.error && typeof this.error === 'function'){try{if(typeof a === 'string'){throw new Error(a);}else {throw a;}}catch(err) {a = err;}this.error(this.name || null,a || null,b || null);}}}]);return Defaults;})();var defaultsPrototype=Defaults.prototype;defaultsPrototype.actions = {};defaultsPrototype.afterCreate = lifecycleNoopCb;defaultsPrototype.afterCreateCollection = lifecycleNoop;defaultsPrototype.afterCreateInstance = lifecycleNoop;defaultsPrototype.afterDestroy = lifecycleNoopCb;defaultsPrototype.afterEject = lifecycleNoop;defaultsPrototype.afterInject = lifecycleNoop;defaultsPrototype.afterReap = lifecycleNoop;defaultsPrototype.afterUpdate = lifecycleNoopCb;defaultsPrototype.afterValidate = lifecycleNoopCb;defaultsPrototype.allowSimpleWhere = true;defaultsPrototype.basePath = '';defaultsPrototype.beforeCreate = lifecycleNoopCb;defaultsPrototype.beforeCreateCollection = lifecycleNoop;defaultsPrototype.beforeCreateInstance = lifecycleNoop;defaultsPrototype.beforeDestroy = lifecycleNoopCb;defaultsPrototype.beforeEject = lifecycleNoop;defaultsPrototype.beforeInject = lifecycleNoop;defaultsPrototype.beforeReap = lifecycleNoop;defaultsPrototype.beforeUpdate = lifecycleNoopCb;defaultsPrototype.beforeValidate = lifecycleNoopCb;defaultsPrototype.bypassCache = false;defaultsPrototype.cacheResponse = !!_utils['default'].w;defaultsPrototype.clearEmptyQueries = true;defaultsPrototype.computed = {};defaultsPrototype.defaultAdapter = 'http';defaultsPrototype.debug = false;defaultsPrototype.defaultValues = {};defaultsPrototype.eagerEject = false;defaultsPrototype.eagerInject = false;defaultsPrototype.endpoint = '';defaultsPrototype.error = console?function(a,b,c){return console[typeof console.error === 'function'?'error':'log'](a,b,c);}:false;defaultsPrototype.instanceEvents = !!_utils['default'].w;defaultsPrototype.fallbackAdapters = ['http'];defaultsPrototype.findStrictCache = false;defaultsPrototype.idAttribute = 'id';defaultsPrototype.ignoredChanges = [/\$/];defaultsPrototype.ignoreMissing = false;defaultsPrototype.keepChangeHistory = false;defaultsPrototype.linkRelations = true;defaultsPrototype.log = console?function(a,b,c,d,e){return console[typeof console.info === 'function'?'info':'log'](a,b,c,d,e);}:false;defaultsPrototype.logFn = function(a,b,c,d){var _this=this;if(_this.debug && _this.log && typeof _this.log === 'function'){_this.log(_this.name || null,a || null,b || null,c || null,d || null);}};defaultsPrototype.maxAge = false;defaultsPrototype.methods = {};defaultsPrototype.notify = !!_utils['default'].w;defaultsPrototype.omit = [];defaultsPrototype.onConflict = 'merge';defaultsPrototype.reapAction = !!_utils['default'].w?'inject':'none';defaultsPrototype.reapInterval = !!_utils['default'].w?30000:false;defaultsPrototype.relationsEnumerable = false;defaultsPrototype.returnMeta = false;defaultsPrototype.resetHistoryOnInject = true;defaultsPrototype.strategy = 'single';defaultsPrototype.upsert = !!_utils['default'].w;defaultsPrototype.useClass = true;defaultsPrototype.useFilter = false;defaultsPrototype.validate = lifecycleNoopCb;defaultsPrototype.defaultFilter = function(collection,resourceName,params,options){var filtered=collection;var where=null;var reserved={skip:'',offset:'',where:'',limit:'',orderBy:'',sort:''};params = params || {};options = options || {};if(_utils['default']._o(params.where)){where = params.where;}else {where = {};}if(options.allowSimpleWhere){_utils['default'].forOwn(params,function(value,key){if(!(key in reserved) && !(key in where)){where[key] = {'==':value};}});}if(_utils['default'].isEmpty(where)){where = null;}if(where){filtered = _utils['default'].filter(filtered,function(attrs){var first=true;var keep=true;_utils['default'].forOwn(where,function(clause,field){if(!_utils['default']._o(clause)){clause = {'==':clause};}_utils['default'].forOwn(clause,function(term,op){var expr=undefined;var isOr=op[0] === '|';var val=_utils['default'].get(attrs,field);op = isOr?op.substr(1):op;if(op === '=='){expr = val == term;}else if(op === '==='){expr = val === term;}else if(op === '!='){expr = val != term;}else if(op === '!=='){expr = val !== term;}else if(op === '>'){expr = val > term;}else if(op === '>='){expr = val >= term;}else if(op === '<'){expr = val < term;}else if(op === '<='){expr = val <= term;}else if(op === 'isectEmpty'){expr = !_utils['default'].intersection(val || [],term || []).length;}else if(op === 'isectNotEmpty'){expr = _utils['default'].intersection(val || [],term || []).length;}else if(op === 'in'){if(_utils['default']._s(term)){expr = term.indexOf(val) !== -1;}else {expr = _utils['default'].contains(term,val);}}else if(op === 'notIn'){if(_utils['default']._s(term)){expr = term.indexOf(val) === -1;}else {expr = !_utils['default'].contains(term,val);}}else if(op === 'contains'){if(_utils['default']._s(val)){expr = val.indexOf(term) !== -1;}else {expr = _utils['default'].contains(val,term);}}else if(op === 'notContains'){if(_utils['default']._s(val)){expr = val.indexOf(term) === -1;}else {expr = !_utils['default'].contains(val,term);}}if(expr !== undefined){keep = first?expr:isOr?keep || expr:keep && expr;}first = false;});});return keep;});}var orderBy=null;if(_utils['default']._s(params.orderBy)){orderBy = [[params.orderBy,'ASC']];}else if(_utils['default']._a(params.orderBy)){orderBy = params.orderBy;}if(!orderBy && _utils['default']._s(params.sort)){orderBy = [[params.sort,'ASC']];}else if(!orderBy && _utils['default']._a(params.sort)){orderBy = params.sort;}if(orderBy){(function(){var index=0;_utils['default'].forEach(orderBy,function(def,i){if(_utils['default']._s(def)){orderBy[i] = [def,'ASC'];}else if(!_utils['default']._a(def)){throw new _errors['default'].IA('DS.filter("' + resourceName + '"[, params][, options]): ' + _utils['default'].toJson(def) + ': Must be a string or an array!',{params:{'orderBy[i]':{actual:typeof def,expected:'string|array'}}});}});filtered = _utils['default'].sort(filtered,function(a,b){return compare(orderBy,index,a,b);});})();}var limit=_utils['default']._n(params.limit)?params.limit:null;var skip=null;if(_utils['default']._n(params.skip)){skip = params.skip;}else if(_utils['default']._n(params.offset)){skip = params.offset;}if(limit && skip){filtered = _utils['default'].slice(filtered,skip,Math.min(filtered.length,skip + limit));}else if(_utils['default']._n(limit)){filtered = _utils['default'].slice(filtered,0,Math.min(filtered.length,limit));}else if(_utils['default']._n(skip)){if(skip < filtered.length){filtered = _utils['default'].slice(filtered,skip);}else {filtered = [];}}return filtered;};var DS=(function(){function DS(options){_classCallCheck(this,DS);var _this=this;options = options || {};_this.store = {};_this.s = _this.store;_this.definitions = {};_this.defs = _this.definitions;_this.adapters = {};_this.defaults = new Defaults();_this.observe = _utils['default'].observe;_utils['default'].forOwn(options,function(v,k){if(k === 'omit'){_this.defaults.omit = v.concat(Defaults.prototype.omit);}else {_this.defaults[k] = v;}});_this.defaults.logFn('new data store created',_this.defaults);var P=_utils['default'].Promise;if(P && !P.prototype.spread){P.prototype.spread = function(cb){return this.then(function(arr){return cb.apply(this,arr);});};}}_createClass(DS,[{key:'getAdapterName',value:function getAdapterName(options){var errorIfNotExist=false;options = options || {};this.defaults.logFn('getAdapterName',options);if(_utils['default']._s(options)){errorIfNotExist = true;options = {adapter:options};}if(this.adapters[options.adapter]){return options.adapter;}else if(errorIfNotExist){throw new Error(options.adapter + ' is not a registered adapter!');}else {return options.defaultAdapter;}}},{key:'getAdapter',value:function getAdapter(options){options = options || {};this.defaults.logFn('getAdapter',options);return this.adapters[this.getAdapterName(options)];}},{key:'registerAdapter',value:function registerAdapter(name,Adapter,options){var _this=this;options = options || {};_this.defaults.logFn('registerAdapter',name,Adapter,options);if(_utils['default'].isFunction(Adapter)){_this.adapters[name] = new Adapter(options);}else {_this.adapters[name] = Adapter;}if(options['default']){_this.defaults.defaultAdapter = name;}_this.defaults.logFn('default adapter is ' + _this.defaults.defaultAdapter);}},{key:'is',value:function is(resourceName,instance){var definition=this.defs[resourceName];if(!definition){throw new _errors['default'].NER(resourceName);}return instance instanceof definition[definition['class']];}}]);return DS;})();var dsPrototype=DS.prototype;dsPrototype.getAdapterName.shorthand = false;dsPrototype.getAdapter.shorthand = false;dsPrototype.registerAdapter.shorthand = false;dsPrototype.errors = _errors['default'];dsPrototype.utils = _utils['default'];function addMethods(target,obj){_utils['default'].forOwn(obj,function(v,k){target[k] = v;target[k].before = function(fn){var orig=target[k];target[k] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}return orig.apply(this,fn.apply(this,args) || args);};};});}addMethods(dsPrototype,_sync_methodsIndex['default']);addMethods(dsPrototype,_async_methodsIndex['default']);exports['default'] = DS;},function(module,exports,__webpack_require__){function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}var _errors=__webpack_require__(3);var BinaryHeap=__webpack_require__(7);var forEach=__webpack_require__(8);var slice=__webpack_require__(9);var forOwn=__webpack_require__(13);var contains=__webpack_require__(10);var deepMixIn=__webpack_require__(14);var pascalCase=__webpack_require__(18);var remove=__webpack_require__(11);var pick=__webpack_require__(15);var sort=__webpack_require__(12);var upperCase=__webpack_require__(19);var get=__webpack_require__(16);var set=__webpack_require__(17);var observe=__webpack_require__(6);var w=undefined;var objectProto=Object.prototype;var toString=objectProto.toString;var P=undefined;try{P = Promise;}catch(err) {console.error('js-data requires a global Promise constructor!');}var isArray=Array.isArray || function isArray(value){return toString.call(value) == '[object Array]' || false;};var isRegExp=function isRegExp(value){return toString.call(value) == '[object RegExp]' || false;};var isString=function isString(value){return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == '[object String]' || false;};var isObject=function isObject(value){return toString.call(value) == '[object Object]' || false;};var isDate=function isDate(value){return value && typeof value == 'object' && toString.call(value) == '[object Date]' || false;};var isNumber=function isNumber(value){var type=typeof value;return type == 'number' || value && type == 'object' && toString.call(value) == '[object Number]' || false;};var isFunction=function isFunction(value){return typeof value == 'function' || value && toString.call(value) === '[object Function]' || false;};var isStringOrNumber=function isStringOrNumber(value){return isString(value) || isNumber(value);};var isStringOrNumberErr=function isStringOrNumberErr(field){return new _errors['default'].IA('"' + field + '" must be a string or a number!');};var isObjectErr=function isObjectErr(field){return new _errors['default'].IA('"' + field + '" must be an object!');};var isArrayErr=function isArrayErr(field){return new _errors['default'].IA('"' + field + '" must be an array!');};var isEmpty=function isEmpty(val){if(val == null){return true;}else if(typeof val === 'string' || isArray(val)){return !val.length;}else if(typeof val === 'object'){var result=true;forOwn(val,function(){result = false;return false;});return result;}else {return true;}};var intersection=function intersection(array1,array2){if(!array1 || !array2){return [];}var result=[];var item=undefined;for(var i=0,_length=array1.length;i < _length;i++) {item = array1[i];if(contains(result,item)){continue;}if(contains(array2,item)){result.push(item);}}return result;};var filter=function filter(array,cb,thisObj){var results=[];forEach(array,function(value,key,arr){if(cb(value,key,arr)){results.push(value);}},thisObj);return results;};try{w = window;w = {};}catch(e) {w = null;}function Events(target){var events={};target = target || this;target.on = function(type,func,ctx){events[type] = events[type] || [];events[type].push({f:func,c:ctx});};target.off = function(type,func){var listeners=events[type];if(!listeners){events = {};}else if(func){for(var i=0;i < listeners.length;i++) {if(listeners[i] === func){listeners.splice(i,1);break;}}}else {listeners.splice(0,listeners.length);}};target.emit = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}var listeners=events[args.shift()] || [];if(listeners){for(var i=0;i < listeners.length;i++) {listeners[i].f.apply(listeners[i].c,args);}}};}var toPromisify=['beforeValidate','validate','afterValidate','beforeCreate','afterCreate','beforeUpdate','afterUpdate','beforeDestroy','afterDestroy'];var isBlacklisted=observe.isBlacklisted;var copy=function copy(source,destination,stackSource,stackDest,blacklist){if(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest,blacklist);}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(isObject(source)){destination = copy(source,Object.create(Object.getPrototypeOf(source)),stackSource,stackDest,blacklist);}}}else {if(source === destination){throw new Error('Cannot copy! Source and destination are identical.');}stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1){return stackDest[index];}stackSource.push(source);stackDest.push(destination);}var result=undefined;if(isArray(source)){var i=undefined;destination.length = 0;for(i = 0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest,blacklist);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){if(isBlacklisted(key,blacklist)){continue;}result = copy(source[key],null,stackSource,stackDest,blacklist);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}}}return destination;};var equals=function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2){return true;}if(o1 === null || o2 === null){return false;}if(o1 !== o1 && o2 !== o2){return true;}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;}_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}else if(isRegExp(o1) && isRegExp(o2)){return o1.toString() == o2.toString();}else {if(isArray(o2)){return false;}keySet = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key])){return false;}}return true;}}}return false;}};var resolveId=function resolveId(definition,idOrInstance){if(isString(idOrInstance) || isNumber(idOrInstance)){return idOrInstance;}else if(idOrInstance && definition){return idOrInstance[definition.idAttribute] || idOrInstance;}else {return idOrInstance;}};var resolveItem=function resolveItem(resource,idOrInstance){if(resource && (isString(idOrInstance) || isNumber(idOrInstance))){return resource.index[idOrInstance] || idOrInstance;}else {return idOrInstance;}};var isValidString=function isValidString(val){return val != null && val !== '';};var join=function join(items,separator){separator = separator || '';return filter(items,isValidString).join(separator);};var makePath=function makePath(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}var result=join(args,'/');return result.replace(/([^:\/]|^)\/{2,}/g,'$1/');};exports['default'] = {Promise:P,_:function _(parent,options){var _this=this;options = options || {};if(options && options.constructor === parent.constructor){return options;}else if(!isObject(options)){throw new _errors['default'].IA('"options" must be an object!');}forEach(toPromisify,function(name){if(typeof options[name] === 'function' && options[name].toString().indexOf('for (var _len = arg') === -1){options[name] = _this.promisify(options[name]);}});var O=function Options(attrs){var self=this;forOwn(attrs,function(value,key){self[key] = value;});};O.prototype = parent;O.prototype.orig = function(){var orig={};forOwn(this,function(value,key){orig[key] = value;});return orig;};return new O(options);},_n:isNumber,_s:isString,_sn:isStringOrNumber,_snErr:isStringOrNumberErr,_o:isObject,_oErr:isObjectErr,_a:isArray,_aErr:isArrayErr,compute:function compute(fn,field){var _this=this;var args=[];forEach(fn.deps,function(dep){args.push(get(_this,dep));});set(_this,field,fn[fn.length - 1].apply(_this,args));},contains:contains,copy:copy,deepMixIn:deepMixIn,diffObjectFromOldObject:observe.diffObjectFromOldObject,BinaryHeap:BinaryHeap,equals:equals,Events:Events,filter:filter,fillIn:function fillIn(target,obj){forOwn(obj,function(v,k){if(!(k in target)){target[k] = v;}});return target;},forEach:forEach,forOwn:forOwn,fromJson:function fromJson(json){return isString(json)?JSON.parse(json):json;},get:get,intersection:intersection,isArray:isArray,isBlacklisted:isBlacklisted,isEmpty:isEmpty,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isString:isString,makePath:makePath,observe:observe,omit:function omit(obj,bl){var toRemove=[];forOwn(obj,function(v,k){if(isBlacklisted(k,bl)){toRemove.push(k);}});forEach(toRemove,function(k){delete obj[k];});return obj;},pascalCase:pascalCase,pick:pick,promisify:function promisify(fn,target){var _this=this;if(!fn){return;}else if(typeof fn !== 'function'){throw new Error('Can only promisify functions!');}return function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}return new _this.Promise(function(resolve,reject){args.push(function(err,result){if(err){reject(err);}else {resolve(result);}});try{var promise=fn.apply(target || this,args);if(promise && promise.then){promise.then(resolve,reject);}}catch(err) {reject(err);}});};},remove:remove,set:set,slice:slice,sort:sort,toJson:JSON.stringify,updateTimestamp:function updateTimestamp(timestamp){var newTimestamp=typeof Date.now === 'function'?Date.now():new Date().getTime();if(timestamp && newTimestamp <= timestamp){return timestamp + 1;}else {return newTimestamp;}},upperCase:upperCase,removeCircular:function removeCircular(object){return (function rmCirc(value,ctx){var i=undefined;var nu=undefined;if(typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)){var cur=ctx.cur;var parent=ctx.ctx;while(parent) {if(parent.cur === cur){return undefined;}parent = parent.ctx;}if(isArray(value)){nu = [];for(i = 0;i < value.length;i += 1) {nu[i] = rmCirc(value[i],{ctx:ctx,cur:value[i]});}}else {nu = {};forOwn(value,function(v,k){nu[k] = rmCirc(value[k],{ctx:ctx,cur:value[k]});});}return nu;}return value;})(object,{ctx:null,cur:object});},resolveItem:resolveItem,resolveId:resolveId,respond:function respond(response,meta,options){if(options.returnMeta === 'array'){return [response,meta];}else if(options.returnMeta === 'object'){return {response:response,meta:meta};}else {return response;}},w:w,applyRelationGettersToTarget:function applyRelationGettersToTarget(store,definition,target){this.forEach(definition.relationList,function(def){var relationName=def.relation;var enumerable=typeof def.enumerable === 'boolean'?def.enumerable:!!definition.relationsEnumerable;if(typeof def.link === 'boolean'?def.link:!!definition.linkRelations){delete target[def.localField];if(def.type === 'belongsTo'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else if(def.type === 'hasMany'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};if(def.foreignKey){params[def.foreignKey] = this[definition.idAttribute];return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true});}else if(def.localKeys){params.where = _defineProperty({},definition.getResource(relationName).idAttribute,{'in':this[def.localKeys]});return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params);}return undefined;},set:function set(){}});}else if(def.type === 'hasOne'){if(def.localKey){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else {Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};params[def.foreignKey] = this[definition.idAttribute];var items=params[def.foreignKey]?definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true}):[];if(items.length){return items[0];}return undefined;},set:function set(){}});}}}});}};},function(module,exports,__webpack_require__){var _get=function get(_x,_x2,_x3){var _again=true;_function: while(_again) {var object=_x,property=_x2,receiver=_x3;desc = parent = getter = undefined;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x = parent;_x2 = property;_x3 = receiver;_again = true;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)subClass.__proto__ = superClass;}var IllegalArgumentError=(function(_Error){function IllegalArgumentError(message){_classCallCheck(this,IllegalArgumentError);_get(Object.getPrototypeOf(IllegalArgumentError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(IllegalArgumentError,_Error);return IllegalArgumentError;})(Error);var RuntimeError=(function(_Error2){function RuntimeError(message){_classCallCheck(this,RuntimeError);_get(Object.getPrototypeOf(RuntimeError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(RuntimeError,_Error2);return RuntimeError;})(Error);var NonexistentResourceError=(function(_Error3){function NonexistentResourceError(resourceName){_classCallCheck(this,NonexistentResourceError);_get(Object.getPrototypeOf(NonexistentResourceError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = resourceName + ' is not a registered resource!';}_inherits(NonexistentResourceError,_Error3);return NonexistentResourceError;})(Error);exports['default'] = {IllegalArgumentError:IllegalArgumentError,IA:IllegalArgumentError,RuntimeError:RuntimeError,R:RuntimeError,NonexistentResourceError:NonexistentResourceError,NER:NonexistentResourceError};},function(module,exports,__webpack_require__){var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _defineResource=__webpack_require__(28);var _eject=__webpack_require__(29);var _ejectAll=__webpack_require__(30);var _filter=__webpack_require__(31);var _inject=__webpack_require__(32);var NER=_errors['default'].NER;var IA=_errors['default'].IA;var R=_errors['default'].R;function diffIsEmpty(diff){return !(_utils['default'].isEmpty(diff.added) && _utils['default'].isEmpty(diff.removed) && _utils['default'].isEmpty(diff.changed));}exports['default'] = {changes:function changes(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];options = options || {};id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('changes',id,options);var item=definition.get(id);if(item){var _ret=(function(){if(_utils['default'].w){_this.s[resourceName].observers[id].deliver();}var ignoredChanges=options.ignoredChanges || [];_utils['default'].forEach(definition.relationFields,function(field){if(!_utils['default'].contains(ignoredChanges,field)){ignoredChanges.push(field);}});var diff=_utils['default'].diffObjectFromOldObject(item,_this.s[resourceName].previousAttributes[id],_utils['default'].equals,ignoredChanges);_utils['default'].forOwn(diff,function(changeset,name){var toKeep=[];_utils['default'].forOwn(changeset,function(value,field){if(!_utils['default'].isFunction(value)){toKeep.push(field);}});diff[name] = _utils['default'].pick(diff[name],toKeep);});_utils['default'].forEach(definition.relationFields,function(field){delete diff.added[field];delete diff.removed[field];delete diff.changed[field];});return {v:diff};})();if(typeof _ret === 'object')return _ret.v;}},changeHistory:function changeHistory(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(resourceName && !_this.defs[resourceName]){throw new NER(resourceName);}else if(id && !_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('changeHistory',id);if(!definition.keepChangeHistory){definition.errorFn('changeHistory is disabled for this resource!');}else {if(resourceName){var item=definition.get(id);if(item){return resource.changeHistories[id];}}else {return resource.changeHistory;}}},compute:function compute(resourceName,instance){var _this=this;var definition=_this.defs[resourceName];instance = _utils['default'].resolveItem(_this.s[resourceName],instance);if(!definition){throw new NER(resourceName);}else if(!instance){throw new R('Item not in the store!');}else if(!_utils['default']._o(instance) && !_utils['default']._sn(instance)){throw new IA('"instance" must be an object, string or number!');}definition.logFn('compute',instance);_utils['default'].forOwn(definition.computed,function(fn,field){_utils['default'].compute.call(instance,fn,field);});return instance;},createInstance:function createInstance(resourceName,attrs,options){var definition=this.defs[resourceName];var item=undefined;attrs = attrs || {};if(!definition){throw new NER(resourceName);}else if(attrs && !_utils['default'].isObject(attrs)){throw new IA('"attrs" must be an object!');}options = _utils['default']._(definition,options);options.logFn('createInstance',attrs,options);options.beforeCreateInstance(options,attrs);var Constructor=definition[definition['class']];item = new Constructor();if(options.defaultValues){_utils['default'].deepMixIn(item,options.defaultValues);}_utils['default'].deepMixIn(item,attrs);if(definition.computed){definition.compute(item);}options.afterCreateInstance(options,item);return item;},createCollection:function createCollection(resourceName,arr,params,options){var _this=this;var definition=_this.defs[resourceName];arr = arr || [];params = params || {};if(!definition){throw new NER(resourceName);}else if(arr && !_utils['default'].isArray(arr)){throw new IA('"arr" must be an array!');}options = _utils['default']._(definition,options);options.logFn('createCollection',arr,options);options.beforeCreateCollection(options,arr);Object.defineProperties(arr,{fetch:{value:function value(params,options){var __this=this;__this.params = params || __this.params;return definition.findAll(__this.params,options).then(function(data){if(data === __this){return __this;}data.unshift(__this.length);data.unshift(0);__this.splice.apply(__this,data);data.shift();data.shift();if(data.$$injected){_this.s[resourceName].queryData[_utils['default'].toJson(__this.params)] = __this;__this.$$injected = true;}return __this;});}},params:{value:params,writable:true},resourceName:{value:resourceName}});options.afterCreateCollection(options,arr);return arr;},defineResource:_defineResource['default'],digest:function digest(){this.observe.Platform.performMicrotaskCheckpoint();},eject:_eject['default'],ejectAll:_ejectAll['default'],filter:_filter['default'],get:function get(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('get',id,options);return _this.s[resourceName].index[id];},getAll:function getAll(resourceName,ids){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var collection=[];if(!definition){throw new NER(resourceName);}else if(ids && !_utils['default']._a(ids)){throw _utils['default']._aErr('ids');}definition.logFn('getAll',ids);if(_utils['default']._a(ids)){var _length=ids.length;for(var i=0;i < _length;i++) {if(resource.index[ids[i]]){collection.push(resource.index[ids[i]]);}}}else {collection = resource.collection.slice();}return collection;},hasChanges:function hasChanges(resourceName,id){var _this=this;var definition=_this.defs[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('hasChanges',id);return definition.get(id)?diffIsEmpty(definition.changes(id)):false;},inject:_inject['default'],lastModified:function lastModified(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastModified',id);if(id){if(!(id in resource.modified)){resource.modified[id] = 0;}return resource.modified[id];}return resource.collectionModified;},lastSaved:function lastSaved(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastSaved',id);if(!(id in resource.saved)){resource.saved[id] = 0;}return resource.saved[id];},previous:function previous(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('previous',id);return resource.previousAttributes[id]?_utils['default'].copy(resource.previousAttributes[id]):undefined;}};},function(module,exports,__webpack_require__){var _create=__webpack_require__(33);var _destroy=__webpack_require__(34);var _destroyAll=__webpack_require__(35);var _find=__webpack_require__(36);var _findAll=__webpack_require__(37);var _loadRelations=__webpack_require__(38);var _reap=__webpack_require__(39);var _save=__webpack_require__(40);var _update=__webpack_require__(41);var _updateAll=__webpack_require__(42);exports['default'] = {create:_create['default'],destroy:_destroy['default'],destroyAll:_destroyAll['default'],find:_find['default'],findAll:_findAll['default'],loadRelations:_loadRelations['default'],reap:_reap['default'],refresh:function refresh(resourceName,id,options){var _this=this;var DSUtils=_this.utils;return new DSUtils.Promise(function(resolve,reject){var definition=_this.defs[resourceName];id = DSUtils.resolveId(_this.defs[resourceName],id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refresh',id,options);resolve(_this.get(resourceName,id));}}).then(function(item){return item?_this.find(resourceName,id,options):item;});},refreshAll:function refreshAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refreshAll',params,options);resolve(_this.filter(resourceName,params,options));}}).then(function(existing){options.bypassCache = true;return _this.findAll(resourceName,params,options).then(function(found){DSUtils.forEach(existing,function(item){if(found.indexOf(item) === -1){definition.eject(item);}});return found;});});},save:_save['default'],update:_update['default'],updateAll:_updateAll['default']};},function(module,exports,__webpack_require__){(function(global){var testingExposeCycleCount=global.testingExposeCycleCount;function detectObjectObserve(){if(typeof Object.observe !== 'function' || typeof Array.observe !== 'function'){return false;}var records=[];function callback(recs){records = recs;}var test={};var arr=[];Object.observe(test,callback);Array.observe(arr,callback);test.id = 1;test.id = 2;delete test.id;arr.push(1,2);arr.length = 0;Object.deliverChangeRecords(callback);if(records.length !== 5)return false;if(records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice'){return false;}Object.unobserve(test,callback);Array.unobserve(arr,callback);return true;}var hasObserve=detectObjectObserve();var createObject='__proto__' in {}?function(obj){return obj;}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name));});return newObject;};var MAX_DIRTY_CHECK_CYCLES=1000;function dirtyCheck(observer){var cycles=0;while(cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {cycles++;}if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;return cycles > 0;}function objectIsEmpty(object){for(var prop in object) return false;return true;}function diffIsEmpty(diff){return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed);}function isBlacklisted(prop,bl){if(!bl || !bl.length){return false;}var matches;for(var i=0;i < bl.length;i++) {if(Object.prototype.toString.call(bl[i]) === '[object RegExp]' && bl[i].test(prop) || bl[i] === prop){return matches = prop;}}return !!matches;}function diffObjectFromOldObject(object,oldObject,equals,bl){var added={};var removed={};var changed={};for(var prop in oldObject) {var newValue=object[prop];if(isBlacklisted(prop,bl))continue;if(newValue !== undefined && (equals?equals(newValue,oldObject[prop]):newValue === oldObject[prop]))continue;if(!(prop in object)){removed[prop] = undefined;continue;}if(equals?!equals(newValue,oldObject[prop]):newValue !== oldObject[prop])changed[prop] = newValue;}for(var prop in object) {if(prop in oldObject)continue;if(isBlacklisted(prop,bl))continue;added[prop] = object[prop];}if(Array.isArray(object) && object.length !== oldObject.length)changed.length = object.length;return {added:added,removed:removed,changed:changed};}var eomTasks=[];function runEOMTasks(){if(!eomTasks.length)return false;for(var i=0;i < eomTasks.length;i++) {eomTasks[i]();}eomTasks.length = 0;return true;}var runEOM=hasObserve?(function(){return function(fn){return Promise.resolve().then(fn);};})():(function(){return function(fn){eomTasks.push(fn);};})();var observedObjectCache=[];function newObservedObject(){var observer;var object;var discardRecords=false;var first=true;function callback(records){if(observer && observer.state_ === OPENED && !discardRecords)observer.check_(records);}return {open:function open(obs){if(observer)throw Error('ObservedObject in use');if(!first)Object.deliverChangeRecords(callback);observer = obs;first = false;},observe:function observe(obj,arrayObserve){object = obj;if(arrayObserve)Array.observe(object,callback);else Object.observe(object,callback);},deliver:function deliver(discard){discardRecords = discard;Object.deliverChangeRecords(callback);discardRecords = false;},close:function close(){observer = undefined;Object.unobserve(object,callback);observedObjectCache.push(this);}};}function getObservedObject(observer,object,arrayObserve){var dir=observedObjectCache.pop() || newObservedObject();dir.open(observer);dir.observe(object,arrayObserve);return dir;}var UNOPENED=0;var OPENED=1;var CLOSED=2;var nextObserverId=1;function Observer(){this.state_ = UNOPENED;this.callback_ = undefined;this.target_ = undefined;this.directObserver_ = undefined;this.value_ = undefined;this.id_ = nextObserverId++;}Observer.prototype = {open:function open(callback,target){if(this.state_ != UNOPENED)throw Error('Observer has already been opened.');addToAll(this);this.callback_ = callback;this.target_ = target;this.connect_();this.state_ = OPENED;return this.value_;},close:function close(){if(this.state_ != OPENED)return;removeFromAll(this);this.disconnect_();this.value_ = undefined;this.callback_ = undefined;this.target_ = undefined;this.state_ = CLOSED;},deliver:function deliver(){if(this.state_ != OPENED)return;dirtyCheck(this);},report_:function report_(changes){try{this.callback_.apply(this.target_,changes);}catch(ex) {Observer._errorThrownDuringCallback = true;console.error('Exception caught during observer callback: ' + (ex.stack || ex));}},discardChanges:function discardChanges(){this.check_(undefined,true);return this.value_;}};var collectObservers=!hasObserve;var allObservers;Observer._allObserversCount = 0;if(collectObservers){allObservers = [];}function addToAll(observer){Observer._allObserversCount++;if(!collectObservers)return;allObservers.push(observer);}function removeFromAll(observer){Observer._allObserversCount--;}var runningMicrotaskCheckpoint=false;global.Platform = global.Platform || {};global.Platform.performMicrotaskCheckpoint = function(){if(runningMicrotaskCheckpoint)return;if(!collectObservers)return;runningMicrotaskCheckpoint = true;var cycles=0;var anyChanged,toCheck;do {cycles++;toCheck = allObservers;allObservers = [];anyChanged = false;for(var i=0;i < toCheck.length;i++) {var observer=toCheck[i];if(observer.state_ != OPENED)continue;if(observer.check_())anyChanged = true;allObservers.push(observer);}if(runEOMTasks())anyChanged = true;}while(cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;runningMicrotaskCheckpoint = false;};if(collectObservers){global.Platform.clearObservers = function(){allObservers = [];};}function ObjectObserver(object){Observer.call(this);this.value_ = object;this.oldObject_ = undefined;}ObjectObserver.prototype = createObject({__proto__:Observer.prototype,arrayObserve:false,connect_:function connect_(callback,target){if(hasObserve){this.directObserver_ = getObservedObject(this,this.value_,this.arrayObserve);}else {this.oldObject_ = this.copyObject(this.value_);}},copyObject:function copyObject(object){var copy=Array.isArray(object)?[]:{};for(var prop in object) {copy[prop] = object[prop];};if(Array.isArray(object))copy.length = object.length;return copy;},check_:function check_(changeRecords,skipChanges){var diff;var oldValues;if(hasObserve){if(!changeRecords)return false;oldValues = {};diff = diffObjectFromChangeRecords(this.value_,changeRecords,oldValues);}else {oldValues = this.oldObject_;diff = diffObjectFromOldObject(this.value_,this.oldObject_);}if(diffIsEmpty(diff))return false;if(!hasObserve)this.oldObject_ = this.copyObject(this.value_);this.report_([diff.added || {},diff.removed || {},diff.changed || {},function(property){return oldValues[property];}]);return true;},disconnect_:function disconnect_(){if(hasObserve){this.directObserver_.close();this.directObserver_ = undefined;}else {this.oldObject_ = undefined;}},deliver:function deliver(){if(this.state_ != OPENED)return;if(hasObserve)this.directObserver_.deliver(false);else dirtyCheck(this);},discardChanges:function discardChanges(){if(this.directObserver_)this.directObserver_.deliver(true);else this.oldObject_ = this.copyObject(this.value_);return this.value_;}});var observerSentinel={};var expectedRecordTypes={add:true,update:true,'delete':true};function diffObjectFromChangeRecords(object,changeRecords,oldValues){var added={};var removed={};for(var i=0;i < changeRecords.length;i++) {var record=changeRecords[i];if(!expectedRecordTypes[record.type]){console.error('Unknown changeRecord type: ' + record.type);console.error(record);continue;}if(!(record.name in oldValues))oldValues[record.name] = record.oldValue;if(record.type == 'update')continue;if(record.type == 'add'){if(record.name in removed)delete removed[record.name];else added[record.name] = true;continue;}if(record.name in added){delete added[record.name];delete oldValues[record.name];}else {removed[record.name] = true;}}for(var prop in added) added[prop] = object[prop];for(var prop in removed) removed[prop] = undefined;var changed={};for(var prop in oldValues) {if(prop in added || prop in removed)continue;var newValue=object[prop];if(oldValues[prop] !== newValue)changed[prop] = newValue;}return {added:added,removed:removed,changed:changed};}global.Observer = Observer;global.isBlacklisted = isBlacklisted;global.Observer.runEOM_ = runEOM;global.Observer.observerSentinel_ = observerSentinel;global.Observer.hasObjectObserve = hasObserve;global.diffObjectFromOldObject = diffObjectFromOldObject;global.ObjectObserver = ObjectObserver;})(exports);},function(module,exports,__webpack_require__){(function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define('yabh',factory);else if(typeof exports === 'object')exports['BinaryHeap'] = factory();else root['BinaryHeap'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _classCallCheck=function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}};var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();Object.defineProperty(exports,'__esModule',{value:true});function bubbleUp(heap,weightFunc,n){var element=heap[n];var weight=weightFunc(element);while(n > 0) {var parentN=Math.floor((n + 1) / 2) - 1;var _parent=heap[parentN];if(weight >= weightFunc(_parent)){break;}else {heap[parentN] = element;heap[n] = _parent;n = parentN;}}}var bubbleDown=function bubbleDown(heap,weightFunc,n){var length=heap.length;var node=heap[n];var nodeWeight=weightFunc(node);while(true) {var child2N=(n + 1) * 2,child1N=child2N - 1;var swap=null;if(child1N < length){var child1=heap[child1N],child1Weight=weightFunc(child1);if(child1Weight < nodeWeight){swap = child1N;}}if(child2N < length){var child2=heap[child2N],child2Weight=weightFunc(child2);if(child2Weight < (swap === null?nodeWeight:weightFunc(heap[child1N]))){swap = child2N;}}if(swap === null){break;}else {heap[n] = heap[swap];heap[swap] = node;n = swap;}}};var BinaryHeap=(function(){function BinaryHeap(weightFunc,compareFunc){_classCallCheck(this,BinaryHeap);if(!weightFunc){weightFunc = function(x){return x;};}if(!compareFunc){compareFunc = function(x,y){return x === y;};}if(typeof weightFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');}if(typeof compareFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');}this.weightFunc = weightFunc;this.compareFunc = compareFunc;this.heap = [];}_createClass(BinaryHeap,[{key:'push',value:function push(node){this.heap.push(node);bubbleUp(this.heap,this.weightFunc,this.heap.length - 1);}},{key:'peek',value:function peek(){return this.heap[0];}},{key:'pop',value:function pop(){var front=this.heap[0];var end=this.heap.pop();if(this.heap.length > 0){this.heap[0] = end;bubbleDown(this.heap,this.weightFunc,0);}return front;}},{key:'remove',value:function remove(node){var length=this.heap.length;for(var i=0;i < length;i++) {if(this.compareFunc(this.heap[i],node)){var removed=this.heap[i];var end=this.heap.pop();if(i !== length - 1){this.heap[i] = end;bubbleUp(this.heap,this.weightFunc,i);bubbleDown(this.heap,this.weightFunc,i);}return removed;}}return null;}},{key:'removeAll',value:function removeAll(){this.heap = [];}},{key:'size',value:function size(){return this.heap.length;}}]);return BinaryHeap;})();exports['default'] = BinaryHeap;module.exports = exports['default'];}]));});;},function(module,exports,__webpack_require__){function forEach(arr,callback,thisObj){if(arr == null){return;}var i=-1,len=arr.length;while(++i < len) {if(callback.call(thisObj,arr[i],i,arr) === false){break;}}}module.exports = forEach;},function(module,exports,__webpack_require__){function slice(arr,start,end){var len=arr.length;if(start == null){start = 0;}else if(start < 0){start = Math.max(len + start,0);}else {start = Math.min(start,len);}if(end == null){end = len;}else if(end < 0){end = Math.max(len + end,0);}else {end = Math.min(end,len);}var result=[];while(start < end) {result.push(arr[start++]);}return result;}module.exports = slice;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function contains(arr,val){return indexOf(arr,val) !== -1;}module.exports = contains;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function remove(arr,item){var idx=indexOf(arr,item);if(idx !== -1)arr.splice(idx,1);}module.exports = remove;},function(module,exports,__webpack_require__){function mergeSort(arr,compareFn){if(arr == null){return [];}else if(arr.length < 2){return arr;}if(compareFn == null){compareFn = defaultCompare;}var mid,left,right;mid = ~ ~(arr.length / 2);left = mergeSort(arr.slice(0,mid),compareFn);right = mergeSort(arr.slice(mid,arr.length),compareFn);return merge(left,right,compareFn);}function defaultCompare(a,b){return a < b?-1:a > b?1:0;}function merge(left,right,compareFn){var result=[];while(left.length && right.length) {if(compareFn(left[0],right[0]) <= 0){result.push(left.shift());}else {result.push(right.shift());}}if(left.length){result.push.apply(result,left);}if(right.length){result.push.apply(result,right);}return result;}module.exports = mergeSort;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var forIn=__webpack_require__(22);function forOwn(obj,fn,thisObj){forIn(obj,function(val,key){if(hasOwn(obj,key)){return fn.call(thisObj,obj[key],key,obj);}});}module.exports = forOwn;},function(module,exports,__webpack_require__){var forOwn=__webpack_require__(13);var isPlainObject=__webpack_require__(23);function deepMixIn(target,objects){var i=0,n=arguments.length,obj;while(++i < n) {obj = arguments[i];if(obj){forOwn(obj,copyProp,target);}}return target;}function copyProp(val,key){var existing=this[key];if(isPlainObject(val) && isPlainObject(existing)){deepMixIn(existing,val);}else {this[key] = val;}}module.exports = deepMixIn;},function(module,exports,__webpack_require__){var slice=__webpack_require__(9);function pick(obj,var_keys){var keys=typeof arguments[1] !== 'string'?arguments[1]:slice(arguments,1),out={},i=0,key;while(key = keys[i++]) {out[key] = obj[key];}return out;}module.exports = pick;},function(module,exports,__webpack_require__){var isPrimitive=__webpack_require__(24);function get(obj,prop){var parts=prop.split('.'),last=parts.pop();while(prop = parts.shift()) {obj = obj[prop];if(obj == null)return;}return obj[last];}module.exports = get;},function(module,exports,__webpack_require__){var namespace=__webpack_require__(25);function set(obj,prop,val){var parts=/^(.+)\.(.+)$/.exec(prop);if(parts){namespace(obj,parts[1])[parts[2]] = val;}else {obj[prop] = val;}}module.exports = set;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var camelCase=__webpack_require__(27);var upperCase=__webpack_require__(19);function pascalCase(str){str = toString(str);return camelCase(str).replace(/^[a-z]/,upperCase);}module.exports = pascalCase;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function upperCase(str){str = toString(str);return str.toUpperCase();}module.exports = upperCase;},function(module,exports,__webpack_require__){function indexOf(arr,item,fromIndex){fromIndex = fromIndex || 0;if(arr == null){return -1;}var len=arr.length,i=fromIndex < 0?len + fromIndex:fromIndex;while(i < len) {if(arr[i] === item){return i;}i++;}return -1;}module.exports = indexOf;},function(module,exports,__webpack_require__){function hasOwn(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports = hasOwn;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var _hasDontEnumBug,_dontEnums;function checkDontEnum(){_dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'];_hasDontEnumBug = true;for(var key in {'toString':null}) {_hasDontEnumBug = false;}}function forIn(obj,fn,thisObj){var key,i=0;if(_hasDontEnumBug == null)checkDontEnum();for(key in obj) {if(exec(fn,obj,key,thisObj) === false){break;}}if(_hasDontEnumBug){var ctor=obj.constructor,isProto=!!ctor && obj === ctor.prototype;while(key = _dontEnums[i++]) {if((key !== 'constructor' || !isProto && hasOwn(obj,key)) && obj[key] !== Object.prototype[key]){if(exec(fn,obj,key,thisObj) === false){break;}}}}}function exec(fn,obj,key,thisObj){return fn.call(thisObj,obj[key],key,obj);}module.exports = forIn;},function(module,exports,__webpack_require__){function isPlainObject(value){return !!value && typeof value === 'object' && value.constructor === Object;}module.exports = isPlainObject;},function(module,exports,__webpack_require__){function isPrimitive(value){switch(typeof value){case 'string':case 'number':case 'boolean':return true;}return value == null;}module.exports = isPrimitive;},function(module,exports,__webpack_require__){var forEach=__webpack_require__(8);function namespace(obj,path){if(!path)return obj;forEach(path.split('.'),function(key){if(!obj[key]){obj[key] = {};}obj = obj[key];});return obj;}module.exports = namespace;},function(module,exports,__webpack_require__){function toString(val){return val == null?'':val.toString();}module.exports = toString;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var replaceAccents=__webpack_require__(43);var removeNonWord=__webpack_require__(44);var upperCase=__webpack_require__(19);var lowerCase=__webpack_require__(45);function camelCase(str){str = toString(str);str = replaceAccents(str);str = removeNonWord(str).replace(/[\-_]/g,' ').replace(/\s[a-z]/g,upperCase).replace(/\s+/g,'').replace(/^[A-Z]/g,lowerCase);return str;}module.exports = camelCase;},function(module,exports,__webpack_require__){exports['default'] = defineResource;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var instanceMethods=['compute','eject','refresh','save','update','destroy','loadRelations','changeHistory','changes','hasChanges','lastModified','lastSaved','previous'];function defineResource(definition){var _this=this;var definitions=_this.defs;if(_utils['default']._s(definition)){definition = {name:definition.replace(/\s/gi,'')};}if(!_utils['default']._o(definition)){throw _utils['default']._oErr('definition');}else if(!_utils['default']._s(definition.name)){throw new _errors['default'].IA('"name" must be a string!');}else if(definitions[definition.name]){throw new _errors['default'].R(definition.name + ' is already registered!');}function Resource(options){this.defaultValues = {};this.methods = {};this.computed = {};_utils['default'].deepMixIn(this,options);var parent=_this.defaults;if(definition['extends'] && definitions[definition['extends']]){parent = definitions[definition['extends']];}_utils['default'].fillIn(this.defaultValues,parent.defaultValues);_utils['default'].fillIn(this.methods,parent.methods);_utils['default'].fillIn(this.computed,parent.computed);this.endpoint = 'endpoint' in options?options.endpoint:this.name;}try{var def;var _class;var _ret=(function(){if(definition['extends'] && definitions[definition['extends']]){Resource.prototype = definitions[definition['extends']];}else {Resource.prototype = _this.defaults;}definitions[definition.name] = new Resource(definition);def = definitions[definition.name];def.getResource = function(resourceName){return _this.defs[resourceName];};def.logFn('Preparing resource.');if(!_utils['default']._s(def.idAttribute)){throw new _errors['default'].IA('"idAttribute" must be a string!');}if(def.relations){def.relationList = [];def.relationFields = [];_utils['default'].forOwn(def.relations,function(relatedModels,type){_utils['default'].forOwn(relatedModels,function(defs,relationName){if(!_utils['default']._a(defs)){relatedModels[relationName] = [defs];}_utils['default'].forEach(relatedModels[relationName],function(d){d.type = type;d.relation = relationName;d.name = def.name;def.relationList.push(d);if(d.localField){def.relationFields.push(d.localField);}});});});if(def.relations.belongsTo){_utils['default'].forOwn(def.relations.belongsTo,function(relatedModel,modelName){_utils['default'].forEach(relatedModel,function(relation){if(relation.parent){def.parent = modelName;def.parentKey = relation.localKey;def.parentField = relation.localField;}});});}if(typeof Object.freeze === 'function'){Object.freeze(def.relations);Object.freeze(def.relationList);}}_class = def['class'] = _utils['default'].pascalCase(def.name);try{if(typeof def.useClass === 'function'){eval('function ' + _class + '() { def.useClass.call(this); }');def[_class] = eval(_class);def[_class].prototype = (function(proto){function Ctor(){}Ctor.prototype = proto;return new Ctor();})(def.useClass.prototype);}else {eval('function ' + _class + '() {}');def[_class] = eval(_class);}}catch(e) {def[_class] = function(){};}_utils['default'].forOwn(def.methods,function(fn,m){def[_class].prototype[m] = fn;});def[_class].prototype.set = function(key,value){var _this2=this;_utils['default'].set(this,key,value);def.compute(this);if(def.instanceEvents){setTimeout(function(){_this2.emit('DS.change',def,_this2);},0);}def.handleChange(this);return this;};def[_class].prototype.get = function(key){return _utils['default'].get(this,key);};if(def.instanceEvents){_utils['default'].Events(def[_class].prototype);}_utils['default'].applyRelationGettersToTarget(_this,def,def[_class].prototype);var parentOmit=null;if(!def.hasOwnProperty('omit')){parentOmit = def.omit;def.omit = [];}else {parentOmit = _this.defaults.omit;}def.omit = def.omit.concat(parentOmit || []);_utils['default'].forOwn(def.computed,function(fn,field){if(_utils['default'].isFunction(fn)){def.computed[field] = [fn];fn = def.computed[field];}if(def.methods && field in def.methods){def.errorFn('Computed property "' + field + '" conflicts with previously defined prototype method!');}def.omit.push(field);var deps;if(fn.length === 1){var match=fn[0].toString().match(/function.*?\(([\s\S]*?)\)/);deps = match[1].split(',');def.computed[field] = deps.concat(fn);fn = def.computed[field];if(deps.length){def.errorFn('Use the computed property array syntax for compatibility with minified code!');}}deps = fn.slice(0,fn.length - 1);_utils['default'].forEach(deps,function(val,index){deps[index] = val.trim();});fn.deps = _utils['default'].filter(deps,function(dep){return !!dep;});});_utils['default'].forEach(instanceMethods,function(name){def[_class].prototype['DS' + _utils['default'].pascalCase(name)] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}args.unshift(this[def.idAttribute] || this);args.unshift(def.name);return _this[name].apply(_this,args);};});def[_class].prototype.DSCreate = function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}args.unshift(this);args.unshift(def.name);return _this.create.apply(_this,args);};_this.s[def.name] = {collection:[],expiresHeap:new _utils['default'].BinaryHeap(function(x){return x.expires;},function(x,y){return x.item === y;}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var resource=_this.s[def.name];if(def.reapInterval){setInterval(function(){return def.reap();},def.reapInterval);}var fns=['registerAdapter','getAdapterName','getAdapter','is'];for(var key in _this) {if(typeof _this[key] === 'function'){fns.push(key);}}_utils['default'].forEach(fns,function(key){var k=key;if(_this[k].shorthand !== false){def[k] = function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}args.unshift(def.name);return _this[k].apply(_this,args);};def[k].before = function(fn){var orig=def[k];def[k] = function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4 < _len4;_key4++) {args[_key4] = arguments[_key4];}return orig.apply(def,fn.apply(def,args) || args);};};}else {def[k] = function(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5 < _len5;_key5++) {args[_key5] = arguments[_key5];}return _this[k].apply(_this,args);};}});def.beforeValidate = _utils['default'].promisify(def.beforeValidate);def.validate = _utils['default'].promisify(def.validate);def.afterValidate = _utils['default'].promisify(def.afterValidate);def.beforeCreate = _utils['default'].promisify(def.beforeCreate);def.afterCreate = _utils['default'].promisify(def.afterCreate);def.beforeUpdate = _utils['default'].promisify(def.beforeUpdate);def.afterUpdate = _utils['default'].promisify(def.afterUpdate);def.beforeDestroy = _utils['default'].promisify(def.beforeDestroy);def.afterDestroy = _utils['default'].promisify(def.afterDestroy);var defaultAdapter=undefined;if(def.hasOwnProperty('defaultAdapter')){defaultAdapter = def.defaultAdapter;}_utils['default'].forOwn(def.actions,function(action,name){if(def[name] && !def.actions[name]){throw new Error('Cannot override existing method "' + name + '"!');}action.request = action.request || function(config){return config;};action.response = action.response || function(response){return response;};action.responseError = action.responseError || function(err){return _utils['default'].Promise.reject(err);};def[name] = function(id,options){if(_utils['default']._o(id)){options = id;}options = options || {};var adapter=def.getAdapter(action.adapter || defaultAdapter || 'http');var config=_utils['default'].deepMixIn({},action);if(!options.hasOwnProperty('endpoint') && config.endpoint){options.endpoint = config.endpoint;}if(typeof options.getEndpoint === 'function'){config.url = options.getEndpoint(def,options);}else {var args=[options.basePath || adapter.defaults.basePath || def.basePath,adapter.getEndpoint(def,_utils['default']._sn(id)?id:null,options)];if(_utils['default']._sn(id)){args.push(id);}args.push(action.pathname || name);config.url = _utils['default'].makePath.apply(null,args);}config.method = config.method || 'GET';_utils['default'].deepMixIn(config,options);return new _utils['default'].Promise(function(r){return r(config);}).then(options.request || action.request).then(function(config){return adapter.HTTP(config);}).then(options.response || action.response,options.responseError || action.responseError);};});_utils['default'].Events(def);def.handleChange = function(data){resource.collectionModified = _utils['default'].updateTimestamp(resource.collectionModified);if(def.notify){setTimeout(function(){def.emit('DS.change',def,data);},0);}};def.logFn('Done preparing resource.');return {v:def};})();if(typeof _ret === 'object')return _ret.v;}catch(err) {_this.defaults.errorFn(err);delete definitions[definition.name];delete _this.s[definition.name];throw err;}}},function(module,exports,__webpack_require__){exports['default'] = eject;function eject(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined;var found=false;id = DSUtils.resolveId(definition,id);if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._sn(id)){throw DSUtils._snErr('id');}options = DSUtils._(definition,options);options.logFn('eject',id,options);for(var i=0;i < resource.collection.length;i++) {if(resource.collection[i][definition.idAttribute] == id){item = resource.collection[i];resource.expiresHeap.remove(item);found = true;break;}}if(found){var _ret=(function(){definition.beforeEject(options,item);if(options.notify){definition.emit('DS.beforeEject',definition,item);}var toRemove=[];DSUtils.forOwn(resource.queryData,function(items,queryHash){if(items.$$injected){DSUtils.remove(items,item);}if(!items.length && options.clearEmptyQueries){toRemove.push(queryHash);}});DSUtils.forEach(resource.changeHistories[id],function(changeRecord){DSUtils.remove(resource.changeHistory,changeRecord);});DSUtils.forEach(toRemove,function(queryHash){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];});if(DSUtils.w){resource.observers[id].close();}delete resource.observers[id];delete resource.index[id];delete resource.previousAttributes[id];delete resource.completedQueries[id];delete resource.pendingQueries[id];delete resource.changeHistories[id];delete resource.modified[id];delete resource.saved[id];resource.collection.splice(i,1);definition.handleChange(item);definition.afterEject(options,item);if(options.notify){definition.emit('DS.afterEject',definition,item);}return {v:item};})();if(typeof _ret === 'object')return _ret.v;}}},function(module,exports,__webpack_require__){exports['default'] = ejectAll;function ejectAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._o(params)){throw DSUtils._oErr('params');}definition.logFn('ejectAll',params,options);var resource=_this.s[resourceName];var queryHash=DSUtils.toJson(params);var items=definition.filter(params);var ids=[];if(DSUtils.isEmpty(params)){resource.completedQueries = {};}else {delete resource.completedQueries[queryHash];}DSUtils.forEach(items,function(item){if(item && item[definition.idAttribute]){ids.push(item[definition.idAttribute]);}});DSUtils.forEach(ids,function(id){definition.eject(id,options);});definition.handleChange(items);return items;}},function(module,exports,__webpack_require__){exports['default'] = filter;function filter(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];if(!definition){throw new _this.errors.NER(resourceName);}else if(params && !DSUtils._o(params)){throw DSUtils._oErr('params');}params = params || {};options = DSUtils._(definition,options);options.logFn('filter',params,options);return definition.defaultFilter.call(_this,_this.s[resourceName].collection,resourceName,params,options);}},function(module,exports,__webpack_require__){exports['default'] = inject;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);function makeObserverHandler(definition,resource){var DS=this;var name=definition.name;return function _react(added,removed,changed,oldValueFn,firstTime){var target=this;var item=undefined;var innerId=oldValueFn && oldValueFn(definition.idAttribute)?oldValueFn(definition.idAttribute):target[definition.idAttribute];_utils['default'].forEach(definition.relationFields,function(field){delete added[field];delete removed[field];delete changed[field];});if(!_utils['default'].isEmpty(added) || !_utils['default'].isEmpty(removed) || !_utils['default'].isEmpty(changed) || firstTime){item = DS.get(name,innerId);resource.modified[innerId] = _utils['default'].updateTimestamp(resource.modified[innerId]);if(item && definition.instanceEvents){setTimeout(function(){item.emit('DS.change',definition,item);},0);}definition.handleChange(item);if(definition.keepChangeHistory){var changeRecord={resourceName:name,target:item,added:added,removed:removed,changed:changed,timestamp:resource.modified[innerId]};resource.changeHistories[innerId].push(changeRecord);resource.changeHistory.push(changeRecord);}}if(definition.computed){item = item || DS.get(name,innerId);_utils['default'].forOwn(definition.computed,function(fn,field){var compute=false;_utils['default'].forEach(fn.deps,function(dep){if(dep in added || dep in removed || dep in changed || !(field in item)){compute = true;}});compute = compute || !fn.deps.length;if(compute){_utils['default'].compute.call(item,fn,field);}});}if(definition.idAttribute in changed){definition.errorFn('Doh! You just changed the primary key of an object! Your data for the "' + name + '" resource is now in an undefined (probably broken) state.');}};}function _inject(definition,resource,attrs,options){var _this=this;var injected=undefined;if(_utils['default']._a(attrs)){injected = [];for(var i=0;i < attrs.length;i++) {injected.push(_inject.call(_this,definition,resource,attrs[i],options));}}else {var _react=makeObserverHandler.call(_this,definition,resource);var c=definition.computed;var idA=definition.idAttribute;if(c && c[idA]){(function(){var args=[];_utils['default'].forEach(c[idA].deps,function(dep){args.push(attrs[dep]);});attrs[idA] = c[idA][c[idA].length - 1].apply(attrs,args);})();}if(!(idA in attrs)){var error=new _errors['default'].R(definition.name + '.inject: "attrs" must contain the property specified by "idAttribute"!');options.errorFn(error);throw error;}else {try{(function(){_utils['default'].forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=_this.defs[relationName];var toInject=attrs[def.localField];if(toInject){if(!relationDef){throw new _errors['default'].R(definition.name + ' relation is defined but the resource is not!');}if(_utils['default']._a(toInject)){(function(){var items=[];_utils['default'].forEach(toInject,function(toInjectItem){if(toInjectItem !== _this.s[relationName].index[toInjectItem[relationDef.idAttribute]]){try{var injectedItem=relationDef.inject(toInjectItem,options.orig());if(def.foreignKey){injectedItem[def.foreignKey] = attrs[definition.idAttribute];}items.push(injectedItem);}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}});})();}else {if(toInject !== _this.s[relationName].index[toInject[relationDef.idAttribute]]){try{var _injected=relationDef.inject(attrs[def.localField],options.orig());if(def.foreignKey){_injected[def.foreignKey] = attrs[definition.idAttribute];}}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}}}});var id=attrs[idA];var item=definition.get(id);var initialLastModified=item?resource.modified[id]:0;if(!item){if(attrs instanceof definition[definition['class']]){item = attrs;}else {item = new definition[definition['class']]();}_utils['default'].forEach(definition.relationList,function(def){delete attrs[def.localField];});_utils['default'].deepMixIn(item,attrs);resource.collection.push(item);resource.changeHistories[id] = [];if(_utils['default'].w){resource.observers[id] = new _this.observe.ObjectObserver(item);resource.observers[id].open(_react,item);}resource.index[id] = item;_react.call(item,{},{},{},null,true);resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);}else {if(options.onConflict === 'merge'){_utils['default'].deepMixIn(item,attrs);}else if(options.onConflict === 'replace'){_utils['default'].forOwn(item,function(v,k){if(k !== definition.idAttribute){if(!attrs.hasOwnProperty(k)){delete item[k];}}});_utils['default'].forOwn(attrs,function(v,k){if(k !== definition.idAttribute){item[k] = v;}});}if(definition.resetHistoryOnInject){resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);if(resource.changeHistories[id].length){_utils['default'].forEach(resource.changeHistories[id],function(changeRecord){_utils['default'].remove(resource.changeHistory,changeRecord);});resource.changeHistories[id].splice(0,resource.changeHistories[id].length);}}if(_utils['default'].w){resource.observers[id].deliver();}}resource.modified[id] = initialLastModified && resource.modified[id] === initialLastModified?_utils['default'].updateTimestamp(resource.modified[id]):resource.modified[id];resource.expiresHeap.remove(item);var timestamp=new Date().getTime();resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});injected = item;})();}catch(err) {options.errorFn(err,attrs);}}}return injected;}function inject(resourceName,attrs,options){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var injected=undefined;if(!definition){throw new _errors['default'].NER(resourceName);}else if(!_utils['default']._o(attrs) && !_utils['default']._a(attrs)){throw new _errors['default'].IA(resourceName + '.inject: "attrs" must be an object or an array!');}options = _utils['default']._(definition,options);options.logFn('inject',attrs,options);options.beforeInject(options,attrs);if(options.notify){definition.emit('DS.beforeInject',definition,attrs);}injected = _inject.call(_this,definition,resource,attrs,options);definition.handleChange(injected);options.afterInject(options,injected);if(options.notify){definition.emit('DS.afterInject',definition,injected);}return injected;}},function(module,exports,__webpack_require__){exports['default'] = create;function create(resourceName,attrs,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var adapter=undefined;options = options || {};attrs = attrs || {};var rejectionError=undefined;if(!definition){rejectionError = new _this.errors.NER(resourceName);}else if(!DSUtils._o(attrs)){rejectionError = DSUtils._oErr('attrs');}else {options = DSUtils._(definition,options);if(options.upsert && DSUtils._sn(attrs[definition.idAttribute])){return _this.update(resourceName,attrs[definition.idAttribute],attrs,options);}options.logFn('create',attrs,options);}return new DSUtils.Promise(function(resolve,reject){if(rejectionError){reject(rejectionError);}else {resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeCreate',definition,attrs);}adapter = _this.getAdapterName(options);return _this.adapters[adapter].create(definition,DSUtils.omit(attrs,options.omit),options);}).then(function(attrs){return options.afterCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.afterCreate',definition,attrs);}if(options.cacheResponse){var created=_this.inject(definition.name,attrs,options.orig());var id=created[definition.idAttribute];var resource=_this.s[resourceName];resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return created;}else {return _this.createInstance(resourceName,attrs,options);}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = destroy;function destroy(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var item=undefined;var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {item = definition.get(id) || {id:id};options = DSUtils._(definition,options);options.logFn('destroy',id,options);resolve(item);}}).then(function(attrs){return options.beforeDestroy.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeDestroy',definition,attrs);}if(options.eagerEject){definition.eject(id);}adapter = definition.getAdapter(options);return adapter.destroy(definition,id,options);}).then(function(){return options.afterDestroy.call(item,options,item);}).then(function(item){if(options.notify){definition.emit('DS.afterDestroy',definition,item);}definition.eject(id);return DSUtils.respond(id,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && item){definition.inject(item,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = destroyAll;function destroyAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var ejected=undefined,toEject=undefined,adapter=undefined;params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('attrs'));}else {options = DSUtils._(definition,options);options.logFn('destroyAll',params,options);resolve();}}).then(function(){toEject = definition.defaultFilter.call(_this,resourceName,params);return options.beforeDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.beforeDestroy',definition,toEject);}if(options.eagerEject){ejected = definition.ejectAll(params);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].destroyAll(definition,params,options);}).then(function(){return options.afterDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.afterDestroy',definition,toEject);}return ejected || definition.ejectAll(params);}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && ejected){definition.inject(ejected,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = find;function find(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('find',id,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[id];}if((!options.findStrictCache || id in resource.completedQueries) && definition.get(id) && !options.bypassCache){resolve(definition.get(id));}else {delete resource.completedQueries[id];resolve();}}}).then(function(item){if(!item){if(!(id in resource.pendingQueries)){var promise=undefined;var strategy=options.findStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].find(definition,id,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].find(definition,id,options);}resource.pendingQueries[id] = promise.then(function(data){delete resource.pendingQueries[id];if(options.cacheResponse){var injected=definition.inject(data,options.orig());resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return injected;}else {return definition.createInstance(data,options.orig());}});}return resource.pendingQueries[id];}else {return item;}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[id];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = findAll;function processResults(data,resourceName,queryHash,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var idAttribute=_this.defs[resourceName].idAttribute;var date=new Date().getTime();data = data || [];delete resource.pendingQueries[queryHash];resource.completedQueries[queryHash] = date;var injected=definition.inject(data,options.orig());if(DSUtils._a(injected)){DSUtils.forEach(injected,function(item){if(item){var id=item[idAttribute];if(id){resource.completedQueries[id] = date;resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);}}});}else {options.errorFn('response is expected to be an array!');resource.completedQueries[injected[idAttribute]] = date;}return injected;}function findAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var queryHash=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){params = params || {};if(!_this.defs[resourceName]){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);queryHash = DSUtils.toJson(params);options.logFn('findAll',params,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];}if(queryHash in resource.completedQueries){if(options.useFilter){resolve(definition.filter(params,options.orig()));}else {resolve(resource.queryData[queryHash]);}}else {resolve();}}}).then(function(items){if(!(queryHash in resource.completedQueries)){if(!(queryHash in resource.pendingQueries)){var promise=undefined;var strategy=options.findAllStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findAllFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].findAll(definition,params,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].findAll(definition,params,options);}resource.pendingQueries[queryHash] = promise.then(function(data){delete resource.pendingQueries[queryHash];if(options.cacheResponse){resource.queryData[queryHash] = processResults.call(_this,data,resourceName,queryHash,options);resource.queryData[queryHash].$$injected = true;return resource.queryData[queryHash];}else {DSUtils.forEach(data,function(item,i){data[i] = definition.createInstance(item,options.orig());});return data;}});}return resource.pendingQueries[queryHash];}else {return items;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[queryHash];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = loadRelations;function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}function loadRelations(resourceName,instance,relations,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];return new DSUtils.Promise(function(resolve,reject){if(DSUtils._sn(instance)){instance = definition.get(instance);}if(DSUtils._s(relations)){relations = [relations];}relations = relations || [];if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._o(instance)){reject(new DSErrors.IA('"instance(id)" must be a string, number or object!'));}else if(!DSUtils._a(relations)){reject(new DSErrors.IA('"relations" must be a string or an array!'));}else {(function(){var _options=DSUtils._(definition,options);_options.logFn('loadRelations',instance,relations,_options);var tasks=[];DSUtils.forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=definition.getResource(relationName);var __options=DSUtils._(relationDef,options);if(!relations.length || DSUtils.contains(relations,relationName) || DSUtils.contains(relations,def.localField)){var task=undefined;var params={};if(__options.allowSimpleWhere){params[def.foreignKey] = instance[definition.idAttribute];}else {params.where = {};params.where[def.foreignKey] = {'==':instance[definition.idAttribute]};}if(def.type === 'hasMany'){if(def.localKeys){delete params[def.foreignKey];params.where = _defineProperty({},relationDef.idAttribute,{'in':instance[def.localKeys]});}task = relationDef.findAll(params,__options.orig());}else if(def.type === 'hasOne'){if(def.localKey && instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}else if(def.foreignKey){task = relationDef.findAll(params,__options.orig()).then(function(hasOnes){return hasOnes.length?hasOnes[0]:null;});}}else if(instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}if(task){tasks.push(task);}}});resolve(tasks);})();}}).then(function(tasks){return DSUtils.Promise.all(tasks);}).then(function(){return instance;});}},function(module,exports,__webpack_require__){exports['default'] = reap;function reap(resourceName,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else {options = DSUtils._(definition,options);if(!options.hasOwnProperty('notify')){options.notify = false;}options.logFn('reap',options);var items=[];var now=new Date().getTime();var expiredItem=undefined;while((expiredItem = resource.expiresHeap.peek()) && expiredItem.expires < now) {items.push(expiredItem.item);delete expiredItem.item;resource.expiresHeap.pop();}resolve(items);}}).then(function(items){if(items.length){definition.beforeReap(options,items);if(options.notify){definition.emit('DS.beforeReap',definition,items);}}if(options.reapAction === 'inject'){(function(){var timestamp=new Date().getTime();DSUtils.forEach(items,function(item){resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});});})();}else if(options.reapAction === 'eject'){DSUtils.forEach(items,function(item){definition.eject(item[definition.idAttribute]);});}else if(options.reapAction === 'refresh'){var _ret2=(function(){var tasks=[];DSUtils.forEach(items,function(item){tasks.push(definition.refresh(item[definition.idAttribute]));});return {v:DSUtils.Promise.all(tasks)};})();if(typeof _ret2 === 'object')return _ret2.v;}return items;}).then(function(items){if(items.length){definition.afterReap(options,items);if(options.notify){definition.emit('DS.afterReap',definition,items);}}return items;});}},function(module,exports,__webpack_require__){exports['default'] = save;function save(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined,noChanges=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else if(!definition.get(id)){reject(new DSErrors.R('id "' + id + '" not found in cache!'));}else {item = definition.get(id);options = DSUtils._(definition,options);options.logFn('save',id,options);resolve(item);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}if(options.changesOnly){if(DSUtils.w){resource.observers[id].deliver();}var toKeep=[];var changes=definition.changes(id);for(var key in changes.added) {toKeep.push(key);}for(key in changes.changed) {toKeep.push(key);}changes = DSUtils.pick(attrs,toKeep);if(DSUtils.isEmpty(changes)){options.logFn('save - no changes',id,options);noChanges = true;return attrs;}else {attrs = changes;}}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(noChanges){return attrs;}else if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = update;function update(resourceName,id,attrs,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('update',id,attrs,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var resource=_this.s[resourceName];var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = updateAll;function updateAll(resourceName,attrs,params,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new DSErrors.NER(resourceName));}else {options = DSUtils._(definition,options);options.logFn('updateAll',attrs,params,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].updateAll(definition,DSUtils.omit(attrs,options.omit),params,options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(data){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}var origOptions=options.orig();if(options.cacheResponse){var _ret=(function(){var injected=definition.inject(data,origOptions);var resource=_this.s[resourceName];DSUtils.forEach(injected,function(i){var id=i[definition.idAttribute];resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[id] = DSUtils.copy(i,null,null,null,definition.relationFields);}});return {v:injected};})();if(typeof _ret === 'object')return _ret.v;}else {var _ret2=(function(){var instances=[];DSUtils.forEach(data,function(item){instances.push(definition.createInstance(item,origOptions));});return {v:instances};})();if(typeof _ret2 === 'object')return _ret2.v;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function replaceAccents(str){str = toString(str);if(str.search(/[\xC0-\xFF]/g) > -1){str = str.replace(/[\xC0-\xC5]/g,'A').replace(/[\xC6]/g,'AE').replace(/[\xC7]/g,'C').replace(/[\xC8-\xCB]/g,'E').replace(/[\xCC-\xCF]/g,'I').replace(/[\xD0]/g,'D').replace(/[\xD1]/g,'N').replace(/[\xD2-\xD6\xD8]/g,'O').replace(/[\xD9-\xDC]/g,'U').replace(/[\xDD]/g,'Y').replace(/[\xDE]/g,'P').replace(/[\xE0-\xE5]/g,'a').replace(/[\xE6]/g,'ae').replace(/[\xE7]/g,'c').replace(/[\xE8-\xEB]/g,'e').replace(/[\xEC-\xEF]/g,'i').replace(/[\xF1]/g,'n').replace(/[\xF2-\xF6\xF8]/g,'o').replace(/[\xF9-\xFC]/g,'u').replace(/[\xFE]/g,'p').replace(/[\xFD\xFF]/g,'y');}return str;}module.exports = replaceAccents;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var PATTERN=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;function removeNonWord(str){str = toString(str);return str.replace(PATTERN,'');}module.exports = removeNonWord;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function lowerCase(str){str = toString(str);return str.toLowerCase();}module.exports = lowerCase;}]));}); + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/build_examples/webpack_es6/index.html b/build_examples/webpack_es6/index.html new file mode 100644 index 0000000..9769ccd --- /dev/null +++ b/build_examples/webpack_es6/index.html @@ -0,0 +1,11 @@ + + + + My App + + + + +

{{ test }}

+ + diff --git a/build_examples/webpack_es6/webpack.config.js b/build_examples/webpack_es6/webpack.config.js new file mode 100644 index 0000000..a645ef2 --- /dev/null +++ b/build_examples/webpack_es6/webpack.config.js @@ -0,0 +1,17 @@ +module.exports = { + entry: './app.js', + output: { + filename: 'bundle.js' + }, + externals: ['axios'], + resolve: { + alias: { + 'js-data-angular': '../../dist/js-data-angular.js' + } + }, + module: { + loaders: [ + { test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' } + ] + } +}; From 329869cf31faf7ba9070ca0d3f8dcf82aaabc937 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 1 Jul 2015 10:15:53 -0400 Subject: [PATCH 6/9] Added another Webpack ES6 build example. --- build_examples/webpack_es6_2/README.md | 3 + build_examples/webpack_es6_2/app.js | 8 + build_examples/webpack_es6_2/bundle.js | 804 ++++++++++++++++++ build_examples/webpack_es6_2/index.html | 11 + .../webpack_es6_2/webpack.config.js | 17 + 5 files changed, 843 insertions(+) create mode 100644 build_examples/webpack_es6_2/README.md create mode 100644 build_examples/webpack_es6_2/app.js create mode 100644 build_examples/webpack_es6_2/bundle.js create mode 100644 build_examples/webpack_es6_2/index.html create mode 100644 build_examples/webpack_es6_2/webpack.config.js diff --git a/build_examples/webpack_es6_2/README.md b/build_examples/webpack_es6_2/README.md new file mode 100644 index 0000000..14fa7b9 --- /dev/null +++ b/build_examples/webpack_es6_2/README.md @@ -0,0 +1,3 @@ +Running `webpack` in this directory will produce `bundle.js` + +Note the external dependency "axios" that is excluded from the build (it's not needed when using js-data-angular). diff --git a/build_examples/webpack_es6_2/app.js b/build_examples/webpack_es6_2/app.js new file mode 100644 index 0000000..ec74833 --- /dev/null +++ b/build_examples/webpack_es6_2/app.js @@ -0,0 +1,8 @@ +import 'angular'; +import 'js-data-angular'; + +angular.module('app', [ + 'js-data' +]).run((DS, DSVersion, $rootScope) => { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; +}); diff --git a/build_examples/webpack_es6_2/bundle.js b/build_examples/webpack_es6_2/bundle.js new file mode 100644 index 0000000..4198430 --- /dev/null +++ b/build_examples/webpack_es6_2/bundle.js @@ -0,0 +1,804 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; + +/******/ // The require function +/******/ function __webpack_require__(moduleId) { + +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; + +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; + +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + +/******/ // Flag the module as loaded +/******/ module.loaded = true; + +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } + + +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; + +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; + +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; + +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(2); + + __webpack_require__(1); + + angular.module('app', ['js-data']).run(function (DS, DSVersion, $rootScope) { + $rootScope.test = 'It works! Using js-data ' + DSVersion.full; + }); + +/***/ }, +/* 1 */ +/***/ function(module, exports, __webpack_require__) { + + /*! + * js-data-angular + * @version 3.0.0-rc.1 - Homepage + * @author Jason Dobry + * @copyright (c) 2014-2015 Jason Dobry + * @license MIT + * + * @overview Angular wrapper for js-data. + */ + (function webpackUniversalModuleDefinition(root, factory) { + if (true) module.exports = factory(__webpack_require__(5), __webpack_require__(2), (function webpackLoadOptionalExternalModule() { + try { + return __webpack_require__(3); + } catch (e) {} + })());else if (typeof define === 'function' && define.amd) define(['js-data', 'angular'], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { + return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root['axios']); + });else if (typeof exports === 'object') exports['jsDataAngularModuleName'] = factory(require('js-data'), require('angular'), (function webpackLoadOptionalExternalModule() { + try { + return require('axios'); + } catch (e) {} + })());else root['jsDataAngularModuleName'] = factory(root['JSData'], root['angular'], root['axios']); + })(this, function (__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) { + return ( /******/(function (modules) { + // webpackBootstrap + /******/ // The module cache + /******/var installedModules = {}; + + /******/ // The require function + /******/function __webpack_require__(moduleId) { + + /******/ // Check if module is in cache + /******/if (installedModules[moduleId]) + /******/return installedModules[moduleId].exports; + + /******/ // Create a new module (and put it into the cache) + /******/var module = installedModules[moduleId] = { + /******/exports: {}, + /******/id: moduleId, + /******/loaded: false + /******/ }; + + /******/ // Execute the module function + /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); + + /******/ // Flag the module as loaded + /******/module.loaded = true; + + /******/ // Return the exports of the module + /******/return module.exports; + /******/ + } + + /******/ // expose the modules object (__webpack_modules__) + /******/__webpack_require__.m = modules; + + /******/ // expose the module cache + /******/__webpack_require__.c = installedModules; + + /******/ // __webpack_public_path__ + /******/__webpack_require__.p = ''; + + /******/ // Load entry module and return exports + /******/return __webpack_require__(0); + /******/ + })([ + /* 0 */ + /***/function (module, exports, __webpack_require__) { + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + /*jshint loopfunc:true*/ + var JSData = __webpack_require__(1); + var DSHttpAdapter = __webpack_require__(4); + var angular = __webpack_require__(2); + + var DSUtils = JSData.DSUtils; + var DSErrors = JSData.DSErrors; + var isString = DSUtils.isString; + var isNumber = DSUtils.isNumber; + var isObject = DSUtils.isObject; + var set = DSUtils.set; + var resolveId = DSUtils.resolveId; + + var adapters = [{ + project: 'js-data-localstorage', + name: 'localstorage', + 'class': 'DSLocalStorageAdapter' + }, { + project: 'js-data-localforage', + name: 'localforage', + 'class': 'DSLocalForageAdapter' + }, { + project: 'js-data-firebase', + name: 'firebase', + 'class': 'DSFirebaseAdapter' + }, { + project: 'js-data-sql', + name: 'sql', + 'class': 'DSSqlAdapter' + }]; + + var functionsToWrap = ['compute', 'digest', 'eject', 'inject']; + + function registerAdapter(adapter) { + var Adapter = undefined; + + try { + Adapter = __webpack_require__(3)(adapter.project); + } catch (e) {} + + if (!Adapter) { + Adapter = window[adapter['class']]; + } + + if (Adapter) { + adapter.loaded = true; + angular.module('js-data').provider(adapter['class'], function () { + var _this = this; + _this.defaults = {}; + _this.$get = [function () { + return new Adapter(_this.defaults); + }]; + }); + } + } + + var DSHttpAdapterProvider = function DSHttpAdapterProvider() { + _classCallCheck(this, DSHttpAdapterProvider); + + var defaults = {}; + this.defaults = defaults; + + this.$get = ['$http', 'DS', function ($http, DS) { + defaults.http = defaults.http || $http; + var adapter = new DSHttpAdapter(defaults); + DS.registerAdapter('http', adapter, { 'default': true }); + return adapter; + }]; + }; + + var DSProvider = function DSProvider() { + _classCallCheck(this, DSProvider); + + var _this = this; + var deps = []; + + for (var i = 0; i < adapters.length; i++) { + if (adapters[i].loaded) { + deps.push(adapters[i]['class']); + } + } + + _this.defaults = {}; + + JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { + var _this = this; + + params = params || {}; + + if (!_this.definitions[resourceName]) { + throw new DSErrors.NER(resourceName); + } else if (!isObject(params)) { + throw new DSErrors.IA('"params" must be an object!'); + } else if (!isObject(scope)) { + throw new DSErrors.IA('"scope" must be an object!'); + } else if (!isString(expr)) { + throw new DSErrors.IA('"expr" must be a string!'); + } + + try { + return scope.$watch(function () { + return _this.lastModified(resourceName); + }, function () { + var items = _this.filter(resourceName, params); + set(scope, expr, items); + if (cb) { + cb(null, items); + } + }); + } catch (err) { + if (cb) { + cb(err); + } else { + throw err; + } + } + }; + + JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { + var _this = this; + + id = resolveId(_this.definitions[resourceName], id); + if (!_this.definitions[resourceName]) { + throw new DSErrors.NER(resourceName); + } else if (!isString(id) && !isNumber(id)) { + throw new DSErrors.IA('"id" must be a string or a number!'); + } else if (!isObject(scope)) { + throw new DSErrors.IA('"scope" must be an object!'); + } else if (!isString(expr)) { + throw new DSErrors.IA('"expr" must be a string!'); + } + + try { + return scope.$watch(function () { + return _this.lastModified(resourceName, id); + }, function () { + var item = _this.get(resourceName, id); + if (item) { + _this.compute(resourceName, id); + } + set(scope, expr, item); + if (cb) { + cb(null, item); + } + }); + } catch (err) { + if (cb) { + cb(err); + } else { + throw err; + } + } + }; + + function load() { + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + var $rootScope = args[args.length - 2]; + var $q = args[args.length - 1]; + var store = new JSData.DS(_this.defaults); + var originals = {}; + + function QPromise(executor) { + var deferred = $q.defer(); + + try { + executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); + } catch (err) { + deferred.reject(err); + } + + return deferred.promise; + } + + QPromise.all = $q.all; + QPromise.when = $q.when; + QPromise.reject = $q.reject; + + DSUtils.Promise = QPromise; + + // Register any adapters that have been loaded + if (args.length) { + for (var i = 0; i < args.length; i++) { + for (var j = 0; j < adapters.length; j++) { + if (adapters[j].loaded && !adapters[j].registered) { + adapters[j].registered = true; + store.registerAdapter(adapters[j].name, args[i]); + break; + } + } + } + } + + var _loop = function _loop() { + var name = functionsToWrap[k]; + originals[name] = store[name]; + store[name] = function () { + for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { + args[_key2] = arguments[_key2]; + } + + if (!$rootScope.$$phase) { + return $rootScope.$apply(function () { + return originals[name].apply(store, args); + }); + } + return originals[name].apply(store, args); + }; + }; + + // Wrap certain sync functions with $apply + for (var k = 0; k < functionsToWrap.length; k++) { + _loop(); + } + + // Hook into the digest loop + if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { + $rootScope.$watch(function () { + return store.observe.Platform.performMicrotaskCheckpoint(); + }); + } + + return store; + } + + deps.push('$rootScope'); + deps.push('$q'); + deps.push(load); + + _this.$get = deps; + }; + + angular.module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', JSData.version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { + DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); + }]); + + for (var i = 0; i < adapters.length; i++) { + registerAdapter(adapters[i]); + } + + // return the module name + module.exports = 'js-data'; + module.exports.name = 'js-data'; + + /***/ + }, + /* 1 */ + /***/function (module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_1__; + + /***/ + }, + /* 2 */ + /***/function (module, exports, __webpack_require__) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + + /***/ + }, + /* 3 */ + /***/function (module, exports, __webpack_require__) { + + var map = {}; + function webpackContext(req) { + return __webpack_require__(webpackContextResolve(req)); + }; + function webpackContextResolve(req) { + return map[req] || (function () { + throw new Error('Cannot find module \'' + req + '\'.'); + })(); + }; + webpackContext.keys = function webpackContextKeys() { + return Object.keys(map); + }; + webpackContext.resolve = webpackContextResolve; + module.exports = webpackContext; + webpackContext.id = 3; + + /***/ + }, + /* 4 */ + /***/function (module, exports, __webpack_require__) { + + var _createClass = (function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); + } + }return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; + }; + })(); + + function _classCallCheck(instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError('Cannot call a class as a function'); + } + } + + var JSData = __webpack_require__(1); + var axios = null; + + try { + axios = __webpack_require__(5); + } catch (e) {} + + var DSUtils = JSData.DSUtils; + var deepMixIn = DSUtils.deepMixIn; + var removeCircular = DSUtils.removeCircular; + var copy = DSUtils.copy; + var makePath = DSUtils.makePath; + var isString = DSUtils.isString; + var isNumber = DSUtils.isNumber; + + var Defaults = (function () { + function Defaults() { + _classCallCheck(this, Defaults); + } + + _createClass(Defaults, [{ + key: 'queryTransform', + value: function queryTransform(resourceConfig, params) { + return params; + } + }, { + key: 'deserialize', + value: function deserialize(resourceConfig, data) { + return data ? 'data' in data ? data.data : data : data; + } + }, { + key: 'serialize', + value: function serialize(resourceConfig, data) { + return data; + } + }, { + key: 'log', + value: function log() {} + }, { + key: 'error', + value: function error() {} + }]); + + return Defaults; + })(); + + var defaultsPrototype = Defaults.prototype; + + defaultsPrototype.basePath = ''; + + defaultsPrototype.forceTrailingSlash = ''; + + defaultsPrototype.httpConfig = {}; + + var DSHttpAdapter = (function () { + function DSHttpAdapter(options) { + _classCallCheck(this, DSHttpAdapter); + + this.defaults = new Defaults(); + if (console) { + this.defaults.log = function (a, b) { + return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); + }; + } + if (console) { + this.defaults.error = function (a, b) { + return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); + }; + } + deepMixIn(this.defaults, options); + this.http = options.http || axios; + } + + _createClass(DSHttpAdapter, [{ + key: 'getEndpoint', + value: function getEndpoint(resourceConfig, id, options) { + var _this2 = this; + + options = options || {}; + options.params = options.params || {}; + + var item = undefined; + var parentKey = resourceConfig.parentKey; + var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : resourceConfig.endpoint; + var parentField = resourceConfig.parentField; + var parentDef = resourceConfig.getResource(resourceConfig.parent); + var parentId = options.params[parentKey]; + + if (parentId === false || !parentKey || !parentDef) { + if (parentId === false) { + delete options.params[parentKey]; + } + return endpoint; + } else { + delete options.params[parentKey]; + + if (DSUtils._sn(id)) { + item = resourceConfig.get(id); + } else if (DSUtils._o(id)) { + item = id; + } + + if (item) { + parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); + } + + if (parentId) { + var _ret = (function () { + delete options.endpoint; + var _options = {}; + DSUtils.forOwn(options, function (value, key) { + _options[key] = value; + }); + return { + v: DSUtils.makePath(_this2.getEndpoint(parentDef, parentId, DSUtils._(parentDef, _options)), parentId, endpoint) + }; + })(); + + if (typeof _ret === 'object') return _ret.v; + } else { + return endpoint; + } + } + } + }, { + key: 'getPath', + value: function getPath(method, resourceConfig, id, options) { + var _this = this; + options = options || {}; + var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, this.getEndpoint(resourceConfig, isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; + if (method === 'find' || method === 'update' || method === 'destroy') { + args.push(id); + } + return makePath.apply(DSUtils, args); + } + }, { + key: 'HTTP', + value: function HTTP(config) { + var _this = this; + var start = new Date(); + config = copy(config); + config = deepMixIn(config, _this.defaults.httpConfig); + if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { + config.url += '/'; + } + if (typeof config.data === 'object') { + config.data = removeCircular(config.data); + } + config.method = config.method.toUpperCase(); + var suffix = config.suffix || _this.defaults.suffix; + if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { + config.url += suffix; + } + + function logResponse(data) { + var str = start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; + if (data.status >= 200 && data.status < 300) { + if (_this.defaults.log) { + _this.defaults.log(str, data); + } + return data; + } else { + if (_this.defaults.error) { + _this.defaults.error('\'FAILED: ' + str, data); + } + return DSUtils.Promise.reject(data); + } + } + + if (!this.http) { + throw new Error('You have not configured this adapter with an http library!'); + } + + return this.http(config).then(logResponse, logResponse); + } + }, { + key: 'GET', + value: function GET(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'get'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'POST', + value: function POST(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'post'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs + })); + } + }, { + key: 'PUT', + value: function PUT(url, attrs, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'put'; + } + return this.HTTP(deepMixIn(config, { + url: url, + data: attrs || {} + })); + } + }, { + key: 'DEL', + value: function DEL(url, config) { + config = config || {}; + if (!('method' in config)) { + config.method = 'delete'; + } + return this.HTTP(deepMixIn(config, { + url: url + })); + } + }, { + key: 'find', + value: function find(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { + var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + return !item ? DSUtils.Promise.reject(new Error('Not Found!')) : item; + }); + } + }, { + key: 'findAll', + value: function findAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'create', + value: function create(resourceConfig, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.POST(_this.getPath('create', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'update', + value: function update(resourceConfig, id, attrs, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.PUT(_this.getPath('update', resourceConfig, id, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'updateAll', + value: function updateAll(resourceConfig, attrs, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroy', + value: function destroy(resourceConfig, id, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + options.params = _this.defaults.queryTransform(resourceConfig, options.params); + return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }, { + key: 'destroyAll', + value: function destroyAll(resourceConfig, params, options) { + var _this = this; + options = options ? copy(options) : {}; + options.suffix = options.suffix || resourceConfig.suffix; + options.params = options.params || {}; + if (params) { + params = _this.defaults.queryTransform(resourceConfig, params); + deepMixIn(options.params, params); + } + return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { + return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); + }); + } + }]); + + return DSHttpAdapter; + })(); + + module.exports = DSHttpAdapter; + + /***/ + }, + /* 5 */ + /***/function (module, exports, __webpack_require__) { + + if (typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') { + var e = new Error('Cannot find module "axios"');e.code = 'MODULE_NOT_FOUND';throw e; + } + module.exports = __WEBPACK_EXTERNAL_MODULE_5__; + + /***/ + } + /******/]) + ); + }); + ; + + /************************************************************************/ + /******/ + +/***/ }, +/* 2 */ +/***/ function(module, exports, __webpack_require__) { + + __webpack_require__(4); + module.exports = angular; + +/***/ }, +/* 3 */ +/***/ function(module, exports, __webpack_require__) { + + if(typeof axios === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;} + module.exports = axios; + +/***/ }, +/* 4 */ +/***/ function(module, exports, __webpack_require__) { + + var require;(function(window,document,undefined){'use strict';function minErr(module,ErrorConstructor){ErrorConstructor = ErrorConstructor || Error;return function(){var code=arguments[0],prefix='[' + (module?module + ':':'') + code + '] ',template=arguments[1],templateArgs=arguments,message,i;message = prefix + template.replace(/\{\d+\}/g,function(match){var index=+match.slice(1,-1),arg;if(index + 2 < templateArgs.length){return toDebugString(templateArgs[index + 2]);}return match;});message = message + '\nhttp://errors.angularjs.org/1.3.15/' + (module?module + '/':'') + code;for(i = 2;i < arguments.length;i++) {message = message + (i == 2?'?':'&') + 'p' + (i - 2) + '=' + encodeURIComponent(toDebugString(arguments[i]));}return new ErrorConstructor(message);};}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/;var VALIDITY_STATE_PROPERTY='validity';var lowercase=function lowercase(string){return isString(string)?string.toLowerCase():string;};var hasOwnProperty=Object.prototype.hasOwnProperty;var uppercase=function uppercase(string){return isString(string)?string.toUpperCase():string;};var manualLowercase=function manualLowercase(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) | 32);}):s;};var manualUppercase=function manualUppercase(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) & ~32);}):s;};if('i' !== 'I'.toLowerCase()){lowercase = manualLowercase;uppercase = manualUppercase;}var msie,jqLite,jQuery,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,ngMinErr=minErr('ng'),angular=window.angular || (window.angular = {}),angularModule,uid=0;msie = document.documentMode;function isArrayLike(obj){if(obj == null || isWindow(obj)){return false;}var length=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;}function forEach(obj,iterator,context){var key,length;if(obj){if(isFunction(obj)){for(key in obj) {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 {for(key in obj) {if(obj.hasOwnProperty(key)){iterator.call(context,obj[key],key,obj);}}}}return obj;}function sortedKeys(obj){return Object.keys(obj).sort();}function forEachSorted(obj,iterator,context){var keys=sortedKeys(obj);for(var i=0;i < keys.length;i++) {iterator.call(context,obj[keys[i]],keys[i]);}return keys;}function reverseParams(iteratorFn){return function(value,key){iteratorFn(key,value);};}function nextUid(){return ++uid;}function setHashKey(obj,h){if(h){obj.$$hashKey = h;}else {delete obj.$$hashKey;}}function extend(dst){var h=dst.$$hashKey;for(var i=1,ii=arguments.length;i < ii;i++) {var obj=arguments[i];if(obj){var keys=Object.keys(obj);for(var j=0,jj=keys.length;j < jj;j++) {var key=keys[j];dst[key] = obj[key];}}}setHashKey(dst,h);return dst;}function int(str){return parseInt(str,10);}function inherit(parent,extra){return extend(Object.create(parent),extra);}function noop(){}noop.$inject = [];function identity($){return $;}identity.$inject = [];function valueFn(value){return function(){return value;};}function isUndefined(value){return typeof value === 'undefined';}function isDefined(value){return typeof value !== 'undefined';}function isObject(value){return value !== null && typeof value === 'object';}function isString(value){return typeof value === 'string';}function isNumber(value){return typeof value === 'number';}function isDate(value){return toString.call(value) === '[object Date]';}var isArray=Array.isArray;function isFunction(value){return typeof value === 'function';}function isRegExp(value){return toString.call(value) === '[object RegExp]';}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 trim=function trim(value){return isString(value)?value.trim():value;};var escapeForRegexp=function escapeForRegexp(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0)array.splice(index,1);return value;}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(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest);}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(isObject(source)){var emptyObject=Object.create(Object.getPrototypeOf(source));destination = copy(source,emptyObject,stackSource,stackDest);}}}else {if(source === destination)throw ngMinErr('cpi','Can\'t copy! Source and destination are identical.');stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1)return stackDest[index];stackSource.push(source);stackDest.push(destination);}var result;if(isArray(source)){destination.length = 0;for(var i=0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {var h=destination.$$hashKey;if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){result = copy(source[key],null,stackSource,stackDest);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}setHashKey(destination,h);}}return destination;}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;}function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2)return true;if(o1 === null || o2 === null)return false;if(o1 !== o1 && o2 !== o2)return true;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;_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}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 = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key]))return false;}return true;}}}return false;}}var csp=function csp(){if(isDefined(csp.isActive_))return csp.isActive_;var active=!!(document.querySelector('[ng-csp]') || document.querySelector('[data-ng-csp]'));if(!active){try{new Function('');}catch(e) {active = true;}}return csp.isActive_ = active;};function concat(array1,array2,index){return array1.concat(slice.call(array2,index));}function sliceArgs(args,startIndex){return slice.call(args,startIndex || 0);}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 {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;}function toJson(obj,pretty){if(typeof obj === 'undefined')return undefined;if(!isNumber(pretty)){pretty = pretty?2:null;}return JSON.stringify(obj,toJsonReplacer,pretty);}function fromJson(json){return isString(json)?JSON.parse(json):json;}function startingTag(element){element = jqLite(element).clone();try{element.empty();}catch(e) {}var elemHtml=jqLite('
').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);}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value);}catch(e) {}}function parseKeyValue(keyValue){var obj={},key_value,key;forEach((keyValue || '').split('&'),function(keyValue){if(keyValue){key_value = keyValue.replace(/\+/g,'%20').split('=');key = tryDecodeURIComponent(key_value[0]);if(isDefined(key)){var val=isDefined(key_value[1])?tryDecodeURIComponent(key_value[1]):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('&'):'';}function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}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;element = jqLite(element);for(i = 0;i < ii;++i) {attr = ngAttrPrefixes[i] + ngAttr;if(isString(attr = element.attr(attr))){return attr;}}return null;}function angularInit(element,bootstrap){var appElement,module,config={};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);}}function bootstrap(element,modules,config){if(!isObject(config))config = {};var defaultConfig={strictDi:false};config = extend(defaultConfig,config);var doBootstrap=function doBootstrap(){element = jqLite(element);if(element.injector()){var tag=element[0] === document?'document':startingTag(element);throw ngMinErr('btstrpd','App Already Bootstrapped with this Element \'{0}\'',tag.replace(//,'>'));}modules = modules || [];modules.unshift(['$provide',function($provide){$provide.value('$rootElement',element);}]);if(config.debugInfoEnabled){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();}}function reloadWithDebugInfo(){window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;window.location.reload();}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;}jQuery = window.jQuery;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});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;bindJQueryFired = true;}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;}function assertNotHasOwnProperty(name,context){if(name === 'hasOwnProperty'){throw ngMinErr('badname','hasOwnProperty is not a valid {0} name',context);}}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;}function getBlockNodes(nodes){var node=nodes[0];var endNode=nodes[nodes.length - 1];var blockNodes=[node];do {node = node.nextSibling;if(!node)break;blockNodes.push(node);}while(node !== endNode);return jqLite(blockNodes);}function createMap(){return Object.create(null);}var NODE_TYPE_ELEMENT=1;var NODE_TYPE_TEXT=3;var NODE_TYPE_COMMENT=8;var NODE_TYPE_DOCUMENT=9;var NODE_TYPE_DOCUMENT_FRAGMENT=11;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);angular.$$minErr = angular.$$minErr || minErr;return ensure(angular,'module',function(){var modules={};return function module(name,requires,configFn){var assertNotHasOwnProperty=function assertNotHasOwnProperty(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);}var invokeQueue=[];var configBlocks=[];var runBlocks=[];var config=invokeLater('$injector','invoke','push',configBlocks);var moduleInstance={_invokeQueue:invokeQueue,_configBlocks:configBlocks,_runBlocks:runBlocks,requires:requires,name:name,provider:invokeLater('$provide','provider'),factory:invokeLater('$provide','factory'),service:invokeLater('$provide','service'),value:invokeLater('$provide','value'),constant:invokeLater('$provide','constant','unshift'),animation:invokeLater('$animateProvider','register'),filter:invokeLater('$filterProvider','register'),controller:invokeLater('$controllerProvider','register'),directive:invokeLater('$compileProvider','directive'),config:config,run:function run(block){runBlocks.push(block);return this;}};if(configFn){config(configFn);}return moduleInstance;function invokeLater(provider,method,insertMethod,queue){if(!queue)queue = invokeQueue;return function(){queue[insertMethod || 'push']([provider,method,arguments]);return moduleInstance;};}});};});}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(typeof obj === 'undefined'){return 'undefined';}else if(typeof obj !== 'string'){return serializeObject(obj);}return obj;}var version={full:'1.3.15',major:1,minor:3,dot:15,codeName:'locality-filtration'};function publishExternalAPI(angular){extend(angular,{'bootstrap':bootstrap,'copy':copy,'extend':extend,'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);try{angularModule('ngLocale');}catch(e) {angularModule('ngLocale',[]).provider('$locale',$LocaleProvider);}angularModule('ng',['ngLocale'],['$provide',function ngModule($provide){$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,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpBackend:$HttpBackendProvider,$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,$$asyncCallback:$$AsyncCallbackProvider,$$jqLite:$$jqLiteProvider});}]);}JQLite.expando = 'ng339';var jqCache=JQLite.cache = {},jqId=1,addEventListenerFn=function addEventListenerFn(element,type,fn){element.addEventListener(type,fn,false);},removeEventListenerFn=function removeEventListenerFn(element,type,fn){element.removeEventListener(type,fn,false);};JQLite._data = function(node){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');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,''],'thead':[1,'','
'],'col':[2,'','
'],'tr':[2,'','
'],'td':[3,'','
'],'_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){var nodeType=node.nodeType;return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,fragment=context.createDocumentFragment(),nodes=[],i;if(jqLiteIsTextNode(html)){nodes.push(context.createTextNode(html));}else {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>') + wrap[2];i = wrap[0];while(i--) {tmp = tmp.lastChild;}nodes = concat(nodes,tmp.childNodes);tmp = fragment.firstChild;tmp.textContent = '';}fragment.textContent = '';fragment.innerHTML = '';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;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;}}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;}else {if(massGetter){return data;}else {if(isSimpleGetter){return data && data[key];}else {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){if(elements){if(elements.nodeType){root[root.length++] = elements;}else {var length=elements.length;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.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((value = jqLite.data(element,names[i])) !== undefined)return value;}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'){win.setTimeout(action);}else {jqLite(win).on('load',action);}}var JQLitePrototype=JQLite.prototype = {ready:function ready(fn){var fired=false;function trigger(){if(fired)return;fired = true;fn();}if(document.readyState === 'complete'){setTimeout(trigger);}else {this.on('DOMContentLoaded',trigger);JQLite(window).on('load',trigger);}},toString:function toString(){var value=[];forEach(this,function(e){value.push('' + e);});return '[' + value.join(', ') + ']';},eq:function eq(index){return index >= 0?jqLite(this[index]):jqLite(this[this.length + index]);},length:0,push:push,sort:[].sort,splice:[].splice};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){var booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;}function getAliasedAttrName(element,name){var nodeName=element.nodeName;return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];}forEach({data:jqLiteData,removeData:jqLiteRemoveData},function(fn,name){JQLite[name] = fn;});forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function scope(element){return jqLite.data(element,'$scope') || jqLiteInheritedData(element.parentNode || element,['$isolateScope','$scope']);},isolateScope:function isolateScope(element){return jqLite.data(element,'$isolateScope') || jqLite.data(element,'$isolateScopeNoTemplate');},controller:jqLiteController,injector:function injector(element){return jqLiteInheritedData(element,'$injector');},removeAttr:function removeAttr(element,name){element.removeAttribute(name);},hasClass:jqLiteHasClass,css:function css(element,name,value){name = camelCase(name);if(isDefined(value)){element.style[name] = value;}else {return element.style[name];}},attr:function attr(element,name,value){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){var ret=element.getAttribute(name,2);return ret === null?undefined:ret;}},prop:function prop(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 val(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 html(element,value){if(isUndefined(value)){return element.innerHTML;}jqLiteDealoc(element,true);element.innerHTML = value;},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name] = function(arg1,arg2){var i,key;var nodeCount=this.length;if(fn !== jqLiteEmpty && (fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)?arg1:arg2) === undefined){if(isObject(arg1)){for(i = 0;i < nodeCount;i++) {if(fn === jqLiteData){fn(this[i],arg1);}else {for(key in arg1) {fn(this[i],key,arg1[key]);}}}return this;}else {var value=fn.$dv;var jj=value === undefined?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 {for(i = 0;i < nodeCount;i++) {fn(this[i],arg1,arg2);}return this;}};});function createEventHandler(element,events){var eventHandler=function eventHandler(event,type){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;};if(eventFnsLength > 1){eventFns = shallowCopy(eventFns);}for(var i=0;i < eventFnsLength;i++) {if(!event.isImmediatePropagationStopped()){eventFns[i].call(element,event);}}};eventHandler.elem = element;return eventHandler;}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');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);}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'){jqLiteOn(element,MOUSE_EVENT_MAP[type],function(event){var target=this,related=event.relatedTarget;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 one(element,type,fn){element = jqLite(element);element.on(type,function onFn(){element.off(type,fn);element.off(type,onFn);});element.on(type,fn);},replaceWith:function replaceWith(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 children(element){var children=[];forEach(element.childNodes,function(element){if(element.nodeType === NODE_TYPE_ELEMENT)children.push(element);});return children;},contents:function contents(element){return element.contentDocument || element.childNodes || [];},append:function append(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 prepend(element,node){if(element.nodeType === NODE_TYPE_ELEMENT){var index=element.firstChild;forEach(new JQLite(node),function(child){element.insertBefore(child,index);});}},wrap:function wrap(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 detach(element){jqLiteRemove(element,true);},after:function after(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 toggleClass(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 parent(element){var parent=element.parentNode;return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT?parent:null;},next:function next(element){return element.nextElementSibling;},find:function find(element,selector){if(element.getElementsByTagName){return element.getElementsByTagName(selector);}else {return [];}},clone:jqLiteClone,triggerHandler:function triggerHandler(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){dummyEvent = {preventDefault:function preventDefault(){this.defaultPrevented = true;},isDefaultPrevented:function isDefaultPrevented(){return this.defaultPrevented === true;},stopImmediatePropagation:function stopImmediatePropagation(){this.immediatePropagationStopped = true;},isImmediatePropagationStopped:function isImmediatePropagationStopped(){return this.immediatePropagationStopped === true;},stopPropagation:noop,type:eventName,target:element};if(event.type){dummyEvent = extend(dummyEvent,event);}eventFnsCopy = shallowCopy(eventFns);handlerArgs = extraParameters?[dummyEvent].concat(extraParameters):[dummyEvent];forEach(eventFnsCopy,function(fn){if(!dummyEvent.isImmediatePropagationStopped()){fn.apply(element,handlerArgs);}});}}},function(fn,name){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)){value = jqLite(value);}}else {jqLiteAddNodes(value,fn(this[i],arg1,arg2,arg3));}}return isDefined(value)?value:this;};JQLite.prototype.bind = JQLite.prototype.on;JQLite.prototype.unbind = JQLite.prototype.off;});function $$jqLiteProvider(){this.$get = function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node = node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node = node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node = node[0];return jqLiteRemoveClass(node,classes);}});};}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;}function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid = function(){return ++uid;};}forEach(array,this.put,this);}HashMap.prototype = {put:function put(key,value){this[hashKey(key,this.nextUid)] = value;},get:function get(key){return this[hashKey(key,this.nextUid)];},remove:function remove(key){var value=this[key = hashKey(key,this.nextUid)];delete this[key];return value;}};var FN_ARGS=/^function\s*[^\(]*\(\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){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;}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){instanceInjector.invoke(fn || noop);});return instanceInjector;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});};}function loadModules(modulesToLoad){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){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;}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];}return fn.apply(self,args);}function instantiate(Type,locals,serviceName){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 has(name){return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);}};}}createInjector.$$annotate = annotate;function $AnchorScrollProvider(){var autoScrollingEnabled=true;this.disableAutoScrolling = function(){autoScrollingEnabled = false;};this.$get = ['$window','$location','$rootScope',function($window,$location,$rootScope){var document=$window.document;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){var elemTop=elem.getBoundingClientRect().top;$window.scrollBy(0,elemTop - offset);}}else {$window.scrollTo(0,0);}}function scroll(){var hash=$location.hash(),elm;if(!hash)scrollTo(null);else if(elm = document.getElementById(hash))scrollTo(elm);else if(elm = getFirstAnchor(document.getElementsByName(hash)))scrollTo(elm);else if(hash === 'top')scrollTo(null);}if(autoScrollingEnabled){$rootScope.$watch(function autoScrollWatch(){return $location.hash();},function autoScrollWatchAction(newVal,oldVal){if(newVal === oldVal && newVal === '')return;jqLiteDocumentLoaded(function(){$rootScope.$evalAsync(scroll);});});}return scroll;}];}var $animateMinErr=minErr('$animate');var $AnimateProvider=['$provide',function($provide){this.$$selectors = {};this.register = function(name,factory){var key=name + '-animation';if(name && name.charAt(0) != '.')throw $animateMinErr('notcsel','Expecting class selector starting with \'.\' got \'{0}\'.',name);this.$$selectors[name.substr(1)] = key;$provide.factory(key,factory);};this.classNameFilter = function(expression){if(arguments.length === 1){this.$$classNameFilter = expression instanceof RegExp?expression:null;}return this.$$classNameFilter;};this.$get = ['$$q','$$asyncCallback','$rootScope',function($$q,$$asyncCallback,$rootScope){var currentDefer;function runAnimationPostDigest(fn){var cancelFn,defer=$$q.defer();defer.promise.$$cancelFn = function ngAnimateMaybeCancel(){cancelFn && cancelFn();};$rootScope.$$postDigest(function ngAnimatePostDigest(){cancelFn = fn(function ngAnimateNotifyComplete(){defer.resolve();});});return defer.promise;}function resolveElementClasses(element,classes){var toAdd=[],toRemove=[];var hasClasses=createMap();forEach((element.attr('class') || '').split(/\s+/),function(className){hasClasses[className] = true;});forEach(classes,function(status,className){var hasClass=hasClasses[className];if(status === false && hasClass){toRemove.push(className);}else if(status === true && !hasClass){toAdd.push(className);}});return toAdd.length + toRemove.length > 0 && [toAdd.length?toAdd:null,toRemove.length?toRemove:null];}function cachedClassManipulation(cache,classes,op){for(var i=0,ii=classes.length;i < ii;++i) {var className=classes[i];cache[className] = op;}}function asyncPromise(){if(!currentDefer){currentDefer = $$q.defer();$$asyncCallback(function(){currentDefer.resolve();currentDefer = null;});}return currentDefer.promise;}function applyStyles(element,options){if(angular.isObject(options)){var styles=extend(options.from || {},options.to || {});element.css(styles);}}return {animate:function animate(element,from,to){applyStyles(element,{from:from,to:to});return asyncPromise();},enter:function enter(element,parent,after,options){applyStyles(element,options);after?after.after(element):parent.prepend(element);return asyncPromise();},leave:function leave(element,options){applyStyles(element,options);element.remove();return asyncPromise();},move:function move(element,parent,after,options){return this.enter(element,parent,after,options);},addClass:function addClass(element,className,options){return this.setClass(element,className,[],options);},$$addClassImmediately:function $$addClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteAddClass(element,className);});applyStyles(element,options);return asyncPromise();},removeClass:function removeClass(element,className,options){return this.setClass(element,[],className,options);},$$removeClassImmediately:function $$removeClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteRemoveClass(element,className);});applyStyles(element,options);return asyncPromise();},setClass:function setClass(element,add,remove,options){var self=this;var STORAGE_KEY='$$animateClasses';var createdCache=false;element = jqLite(element);var cache=element.data(STORAGE_KEY);if(!cache){cache = {classes:{},options:options};createdCache = true;}else if(options && cache.options){cache.options = angular.extend(cache.options || {},options);}var classes=cache.classes;add = isArray(add)?add:add.split(' ');remove = isArray(remove)?remove:remove.split(' ');cachedClassManipulation(classes,add,true);cachedClassManipulation(classes,remove,false);if(createdCache){cache.promise = runAnimationPostDigest(function(done){var cache=element.data(STORAGE_KEY);element.removeData(STORAGE_KEY);if(cache){var classes=resolveElementClasses(element,cache.classes);if(classes){self.$$setClassImmediately(element,classes[0],classes[1],cache.options);}}done();});element.data(STORAGE_KEY,cache);}return cache.promise;},$$setClassImmediately:function $$setClassImmediately(element,add,remove,options){add && this.$$addClassImmediately(element,add);remove && this.$$removeClassImmediately(element,remove);applyStyles(element,options);return asyncPromise();},enabled:noop,cancel:noop};}];}];function $$AsyncCallbackProvider(){this.$get = ['$$rAF','$timeout',function($$rAF,$timeout){return $$rAF.supported?function(fn){return $$rAF(fn);}:function(fn){return $timeout(fn,0,false);};}];}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=[];self.$$completeOutstandingRequest = completeOutstandingRequest;self.$$incOutstandingRequestCount = function(){outstandingRequestCount++;};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 + 1);}self.notifyWhenNoOutstandingRequests = function(callback){forEach(pollFns,function(pollFn){pollFn();});if(outstandingRequestCount === 0){callback();}else {outstandingRequestCallbacks.push(callback);}};var pollFns=[],pollTimeout;self.addPollFn = function(fn){if(isUndefined(pollTimeout))startPoller(100,setTimeout);pollFns.push(fn);return fn;};function startPoller(interval,setTimeout){(function check(){forEach(pollFns,function(pollFn){pollFn();});pollTimeout = setTimeout(check,interval);})();}var cachedState,lastHistoryState,lastBrowserUrl=location.href,baseElement=document.find('base'),reloadLocation=null;cacheState();lastHistoryState = cachedState;self.url = function(url,replace,state){if(isUndefined(state)){state = null;}if(location !== window.location)location = window.location;if(history !== window.history)history = window.history;if(url){var sameState=lastHistoryState === state;if(lastBrowserUrl === url && (!$sniffer.history || sameState)){return self;}var sameBase=lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);lastBrowserUrl = url;lastHistoryState = state;if($sniffer.history && (!sameBase || !sameState)){history[replace?'replaceState':'pushState'](state,'',url);cacheState();lastHistoryState = cachedState;}else {if(!sameBase){reloadLocation = url;}if(replace){location.replace(url);}else if(!sameBase){location.href = url;}else {location.hash = getHash(url);}}return self;}else {return reloadLocation || location.href.replace(/%27/g,'\'');}};self.state = function(){return cachedState;};var urlChangeListeners=[],urlChangeInit=false;function cacheStateAndFireUrlChange(){cacheState();fireUrlChange();}function getCurrentState(){try{return history.state;}catch(e) {}}var lastCachedState=null;function cacheState(){cachedState = getCurrentState();cachedState = isUndefined(cachedState)?null:cachedState;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);});}self.onUrlChange = function(callback){if(!urlChangeInit){if($sniffer.history)jqLite(window).on('popstate',cacheStateAndFireUrlChange);jqLite(window).on('hashchange',cacheStateAndFireUrlChange);urlChangeInit = true;}urlChangeListeners.push(callback);return callback;};self.$$checkUrlChange = fireUrlChange;self.baseHref = function(){var href=baseElement.attr('href');return href?href.replace(/^(https?\:)?\/\/[^\/]*/,''):'';};var lastCookies={};var lastCookieString='';var cookiePath=self.baseHref();function safeDecodeURIComponent(str){try{return decodeURIComponent(str);}catch(e) {return str;}}self.cookies = function(name,value){var cookieLength,cookieArray,cookie,i,index;if(name){if(value === undefined){rawDocument.cookie = encodeURIComponent(name) + '=;path=' + cookiePath + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';}else {if(isString(value)){cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=' + cookiePath).length + 1;if(cookieLength > 4096){$log.warn('Cookie \'' + name + '\' possibly not set or overflowed because it was too large (' + cookieLength + ' > 4096 bytes)!');}}}}else {if(rawDocument.cookie !== lastCookieString){lastCookieString = rawDocument.cookie;cookieArray = lastCookieString.split('; ');lastCookies = {};for(i = 0;i < cookieArray.length;i++) {cookie = cookieArray[i];index = cookie.indexOf('=');if(index > 0){name = safeDecodeURIComponent(cookie.substring(0,index));if(lastCookies[name] === undefined){lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));}}}}return lastCookies;}};self.defer = function(fn,delay){var timeoutId;outstandingRequestCount++;timeoutId = setTimeout(function(){delete pendingDeferIds[timeoutId];completeOutstandingRequest(fn);},delay || 0);pendingDeferIds[timeoutId] = true;return timeoutId;};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);}];}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;return caches[cacheId] = {put:function put(key,value){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key] || (lruHash[key] = {key:key});refresh(lruEntry);}if(isUndefined(value))return;if(!(key in data))size++;data[key] = value;if(size > capacity){this.remove(staleEnd.key);}return value;},get:function get(key){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;refresh(lruEntry);}return data[key];},remove:function remove(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--;},removeAll:function removeAll(){data = {};size = 0;lruHash = {};freshEnd = staleEnd = null;},destroy:function destroy(){data = null;stats = null;lruHash = null;delete caches[cacheId];},info:function info(){return extend({},stats,{size:size});}};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;}}function link(nextEntry,prevEntry){if(nextEntry != prevEntry){if(nextEntry)nextEntry.p = prevEntry;if(prevEntry)prevEntry.n = nextEntry;}}}cacheFactory.info = function(){var info={};forEach(caches,function(cache,cacheId){info[cacheId] = cache.info();});return info;};cacheFactory.get = function(cacheId){return caches[cacheId];};return cacheFactory;};}function $TemplateCacheProvider(){this.$get = ['$cacheFactory',function($cacheFactory){return $cacheFactory('templates');}];}var $compileMinErr=minErr('$compile');$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=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/;var EVENT_HANDLER_ATTR_REGEXP=/^(on[a-z]+|formaction)$/;function parseIsolateBindings(scope,directiveName){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 isolate scope definition for directive \'{0}\'.' + ' Definition: {... {1}: \'{2}\' ...}',directiveName,scopeName,definition);}bindings[scopeName] = {mode:match[1][0],collection:match[2] === '*',optional:match[3] === '?',attrName:match[4] || scopeName};});return bindings;}this.directive = function registerDirective(name,directiveFactory){assertNotHasOwnProperty(name,'directive');if(isString(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';if(isObject(directive.scope)){directive.$$isolateBindings = parseIsolateBindings(directive.scope,directive.name);}directives.push(directive);}catch(e) {$exceptionHandler(e);}});return directives;}]);}hasDirectives[name].push(directiveFactory);}else {forEach(name,reverseParams(registerDirective));}return this;};this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.aHrefSanitizationWhitelist();}};this.imgSrcSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();}};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 Attributes(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 = {$normalize:directiveNormalize,$addClass:function $addClass(classVal){if(classVal && classVal.length > 0){$animate.addClass(this.$$element,classVal);}},$removeClass:function $removeClass(classVal){if(classVal && classVal.length > 0){$animate.removeClass(this.$$element,classVal);}},$updateClass:function $updateClass(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:function $set(key,value,writeAttr,attrName){var node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(node,key),observer=key,nodeName;if(booleanKey){this.$$element.prop(key,value);attrName = booleanKey;}else if(aliasedKey){this[aliasedKey] = value;observer = aliasedKey;}this[key] = value;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'){this[key] = value = $$sanitizeUri(value,key === 'src');}else if(nodeName === 'img' && key === 'srcset'){var result='';var trimmedSrcset=trim(value);var srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;var pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/;var rawUris=trimmedSrcset.split(pattern);var nbrUrisWith2parts=Math.floor(rawUris.length / 2);for(var i=0;i < nbrUrisWith2parts;i++) {var innerIdx=i * 2;result += $$sanitizeUri(trim(rawUris[innerIdx]),true);result += ' ' + trim(rawUris[innerIdx + 1]);}var lastTuple=trim(rawUris[i * 2]).split(/\s/);result += $$sanitizeUri(trim(lastTuple[0]),true);if(lastTuple.length === 2){result += ' ' + trim(lastTuple[1]);}this[key] = value = result;}if(writeAttr !== false){if(value === null || value === undefined){this.$$element.removeAttr(attrName);}else {this.$$element.attr(attrName,value);}}var $$observers=this.$$observers;$$observers && forEach($$observers[observer],function(fn){try{fn(value);}catch(e) {$exceptionHandler(e);}});},$observe:function $observe(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)){fn(attrs[key]);}});return function(){arrayRemove(listeners,fn);};}};function safeAddClass($element,className){try{$element.addClass(className);}catch(e) {}}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)){$compileNodes = jqLite($compileNodes);}forEach($compileNodes,function(node,index){if(node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/)){$compileNodes[index] = jqLite(node).wrap('').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;if(parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude){parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;}if(!namespace){namespace = detectNamespaceForChildElements(futureParentElement);}var $linkNode;if(namespace !== 'html'){$linkNode = jqLite(wrapTemplate(namespace,jqLite('
').append($compileNodes).html()));}else if(cloneConnectFn){$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){var node=parentElement && parentElement[0];if(!node){return 'html';}else {return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/)?'svg':'html';}}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();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;}previousCompileContext = null;}return linkFnFound?compositeLinkFn:null;function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn;var stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;stableNodeList = new Array(nodeListLength);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);}else {childScope = scope;}if(nodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,nodeLinkFn.transclude,parentBoundTranscludeFn,nodeLinkFn.elementTranscludeOnThisElement);}else if(!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn){childBoundTranscludeFn = parentBoundTranscludeFn;}else if(!parentBoundTranscludeFn && transcludeFn){childBoundTranscludeFn = createBoundTranscludeFn(scope,transcludeFn);}else {childBoundTranscludeFn = null;}nodeLinkFn(childLinkFn,childScope,node,$rootElement,childBoundTranscludeFn);}else if(childLinkFn){childLinkFn(scope,node.childNodes,undefined,parentBoundTranscludeFn);}}}}function createBoundTranscludeFn(scope,transcludeFn,previousBoundTranscludeFn,elementTransclusion){var boundTranscludeFn=function boundTranscludeFn(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;}function collectDirectives(node,directives,attrs,maxPriority,ignoreDirective){var nodeType=node.nodeType,attrsMap=attrs.$attr,match,className;switch(nodeType){case NODE_TYPE_ELEMENT:addDirective(directives,directiveNormalize(nodeName_(node)),'E',maxPriority,ignoreDirective);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);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;}}addAttrInterpolateDirective(node,directives,value,nName,isNgAttr);addDirective(directives,nName,'A',maxPriority,ignoreDirective,attrStartName,attrEndName);}className = node.className;if(isObject(className)){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:addTextInterpolateDirective(directives,node.nodeValue);break;case NODE_TYPE_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) {}break;}directives.sort(byPriority);return directives;}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);}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);};}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){previousCompileContext = previousCompileContext || {};var terminalPriority=-Number.MAX_VALUE,newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,controllers,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;for(var i=0,ii=directives.length;i < ii;i++) {directive = directives[i];var attrStart=directive.$$start;var attrEnd=directive.$$end;if(attrStart){$compileNode = groupScan(compileNode,attrStart,attrEnd);}$template = undefined;if(terminalPriority > directive.priority){break;}if(directiveValue = directive.scope){if(!directive.templateUrl){if(isObject(directiveValue)){assertNoDuplicate('new/isolated scope',newIsolateScopeDirective || newScopeDirective,directive,$compileNode);newIsolateScopeDirective = directive;}else {assertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);}}newScopeDirective = newScopeDirective || directive;}directiveName = directive.name;if(!directive.templateUrl && directive.controller){directiveValue = directive.controller;controllerDirectives = controllerDirectives || {};assertNoDuplicate('\'' + directiveName + '\' controller',controllerDirectives[directiveName],directive,$compileNode);controllerDirectives[directiveName] = directive;}if(directiveValue = directive.transclude){hasTranscludeDirective = true;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,{nonTlbTranscludeDirective:nonTlbTranscludeDirective});}else {$template = jqLite(jqLiteClone(compileNode)).contents();$compileNode.empty();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:{}};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,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.elementTranscludeOnThisElement = hasElementTranscludeDirective;nodeLinkFn.templateOnThisElement = hasTemplate;nodeLinkFn.transclude = childTranscludeFn;previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;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,retrievalMethod='data',optional=false;var $searchElement=$element;var match;if(isString(require)){match = require.match(REQUIRE_PREFIX_REGEXP);require = require.substring(match[0].length);if(match[3]){if(match[1])match[3] = null;else match[1] = match[3];}if(match[1] === '^'){retrievalMethod = 'inheritedData';}else if(match[1] === '^^'){retrievalMethod = 'inheritedData';$searchElement = $element.parent();}if(match[2] === '?'){optional = true;}value = null;if(elementControllers && retrievalMethod === 'data'){if(value = elementControllers[require]){value = value.instance;}}value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');if(!value && !optional){throw $compileMinErr('ctreq','Controller \'{0}\', required by directive \'{1}\', can\'t be found!',require,directiveName);}return value || null;}else if(isArray(require)){value = [];forEach(require,function(require){value.push(getControllers(directiveName,require,$element,elementControllers));});}return value;}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){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){transcludeFn = controllersBoundTransclude;transcludeFn.$$boundTransclude = boundTranscludeFn;}if(controllerDirectives){controllers = {};elementControllers = {};forEach(controllerDirectives,function(directive){var locals={$scope:directive === newIsolateScopeDirective || directive.$$isolateScope?isolateScope:scope,$element:$element,$attrs:attrs,$transclude:transcludeFn},controllerInstance;controller = directive.controller;if(controller == '@'){controller = attrs[directive.name];}controllerInstance = $controller(controller,locals,true,directive.controllerAs);elementControllers[directive.name] = controllerInstance;if(!hasElementTranscludeDirective){$element.data('$' + directive.name + 'Controller',controllerInstance.instance);}controllers[directive.name] = controllerInstance;});}if(newIsolateScopeDirective){compile.$$addScopeInfo($element,isolateScope,true,!(templateDirective && (templateDirective === newIsolateScopeDirective || templateDirective === newIsolateScopeDirective.$$originalDirective)));compile.$$addScopeClass($element,true);var isolateScopeController=controllers && controllers[newIsolateScopeDirective.name];var isolateBindingContext=isolateScope;if(isolateScopeController && isolateScopeController.identifier && newIsolateScopeDirective.bindToController === true){isolateBindingContext = isolateScopeController.instance;}forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings,function(definition,scopeName){var attrName=definition.attrName,optional=definition.optional,mode=definition.mode,lastValue,parentGet,parentSet,compare;switch(mode){case '@':attrs.$observe(attrName,function(value){isolateBindingContext[scopeName] = value;});attrs.$$observers[attrName].$$scope = scope;if(attrs[attrName]){isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);}break;case '=':if(optional && !attrs[attrName]){return;}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(){lastValue = isolateBindingContext[scopeName] = parentGet(scope);throw $compileMinErr('nonassign','Expression \'{0}\' used with directive \'{1}\' is non-assignable!',attrs[attrName],newIsolateScopeDirective.name);};lastValue = isolateBindingContext[scopeName] = parentGet(scope);var parentValueWatch=function parentValueWatch(parentValue){if(!compare(parentValue,isolateBindingContext[scopeName])){if(!compare(parentValue,lastValue)){isolateBindingContext[scopeName] = parentValue;}else {parentSet(scope,parentValue = isolateBindingContext[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);}isolateScope.$on('$destroy',unwatch);break;case '&':parentGet = $parse(attrs[attrName]);isolateBindingContext[scopeName] = function(locals){return parentGet(scope,locals);};break;}});}if(controllers){forEach(controllers,function(controller){controller();});controllers = null;}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);}var scopeToChild=scope;if(newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)){scopeToChild = isolateScope;}childLinkFn && childLinkFn(scopeToChild,linkNode.childNodes,undefined,boundTranscludeFn);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);}function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement){var transcludeControllers;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){for(var j=0,jj=directives.length;j < jj;j++) {directives[j] = inherit(directives[j],{$$isolateScope:true});}}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((maxPriority === undefined || 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;}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;}function mergeTemplateAttributes(dst,src){var srcAttr=src.$attr,dstAttr=dst.$attr,$element=dst.$$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]);}});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;}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($sce.getTrustedResourceUrl(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)){linkNode = jqLiteClone(compileNode);}replaceWith(linkRootElement,jqLite(beforeTemplateLinkNode),linkNode);safeAddClass(jqLite(linkNode),oldClasses);}if(afterTemplateNodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn);}else {childBoundTranscludeFn = boundTranscludeFn;}afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,linkNode,$rootElement,childBoundTranscludeFn);}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);}};}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){if(previousDirective){throw $compileMinErr('multidir','Multiple directives [{0}, {1}] asking for {2} on: {3}',previousDirective.name,directive.name,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;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 + '';return wrapper.childNodes[0].childNodes;default:return template;}}function getTrustedContext(node,attrNormalizedName){if(attrNormalizedName == 'srcdoc'){return $sce.HTML;}var tag=nodeName_(node);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);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 compile(){return {pre:function attrInterpolatePreLinkFn(scope,element,attr){var $$observers=attr.$$observers || (attr.$$observers = {});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.');}var newValue=attr[name];if(newValue !== value){interpolateFn = newValue && $interpolate(newValue,true,trustedContext,allOrNothing);value = newValue;}if(!interpolateFn)return;attr[name] = interpolateFn(scope);($$observers[name] || ($$observers[name] = [])).$$inter = true;(attr.$$observers && attr.$$observers[name].$$scope || scope).$watch(interpolateFn,function interpolateFnWatchAction(newValue,oldValue){if(name === 'class' && newValue != oldValue){attr.$updateClass(newValue,oldValue);}else {attr.$set(name,newValue);}});}};}});}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($rootElement.context === firstElementToRemove){$rootElement.context = newNode;}break;}}}if(parent){parent.replaceChild(newNode,firstElementToRemove);}var fragment=document.createDocumentFragment();fragment.appendChild(firstElementToRemove);jqLite(newNode).data(jqLite(firstElementToRemove).data());if(!jQuery){delete jqLite.cache[firstElementToRemove[jqLite.expando]];}else {skipDestroyOnNextJQueryCleanData = true;jQuery.cleanData([firstElementToRemove]);}for(var k=1,kk=elementsToRemove.length;k < kk;k++) {var element=elementsToRemove[k];jqLite(element).remove();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));}}}];}var PREFIX_REGEXP=/^((?:x|data)[\:\-_])/i;function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}function nodesetLinkingFn(scope,nodeList,rootElement,boundTranscludeFn){}function directiveLinkingFn(nodesetLinkingFn,scope,node,rootElement,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');function $ControllerProvider(){var controllers={},globals=false,CNTRL_REG=/^(\S+)(\s+as\s+(\w+))?$/;this.register = function(name,constructor){assertNotHasOwnProperty(name,'controller');if(isObject(name)){extend(controllers,name);}else {controllers[name] = constructor;}};this.allowGlobals = function(){globals = true;};this.$get = ['$injector','$window',function($injector,$window){return function(expression,locals,later,ident){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){var controllerPrototype=(isArray(expression)?expression[expression.length - 1]:expression).prototype;instance = Object.create(controllerPrototype || null);if(identifier){addIdentifier(locals,identifier,instance,constructor || expression.name);}return extend(function(){$injector.invoke(expression,instance,locals,constructor);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;}}];}function $DocumentProvider(){this.$get = ['$window',function(window){return jqLite(window.document);}];}function $ExceptionHandlerProvider(){this.$get = ['$log',function($log){return function(exception,cause){$log.error.apply($log,arguments);};}];}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/;function defaultHttpResponseTransform(data,headers){if(isString(data)){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);}function parseHeaders(headers){var parsed=createMap(),key,val,i;if(!headers)return parsed;forEach(headers.split('\n'),function(line){i = line.indexOf(':');key = lowercase(trim(line.substr(0,i)));val = trim(line.substr(i + 1));if(key){parsed[key] = parsed[key]?parsed[key] + ', ' + val:val;}});return parsed;}function headersGetter(headers){var headersObj=isObject(headers)?headers:undefined;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;};}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;}function $HttpProvider(){var defaults=this.defaults = {transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d)?toJson(d):d;}],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'};var useApplyAsync=false;this.useApplyAsync = function(value){if(isDefined(value)){useApplyAsync = !!value;return this;}return useApplyAsync;};var interceptorFactories=this.interceptors = [];this.$get = ['$httpBackend','$browser','$cacheFactory','$rootScope','$q','$injector',function($httpBackend,$browser,$cacheFactory,$rootScope,$q,$injector){var defaultCache=$cacheFactory('$http');var reversedInterceptors=[];forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory));});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},requestConfig);config.headers = mergeHeaders(requestConfig);config.method = uppercase(config.method);var serverRequest=function serverRequest(config){var headers=config.headers;var reqData=transformData(config.data,headersGetter(headers),undefined,config.transformRequest);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;}return sendReq(config,reqData).then(transformResponse,transformResponse);};var chain=[serverRequest,undefined];var promise=$q.when(config);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);}promise.success = function(fn){promise.then(function(response){fn(response.data,response.status,response.headers,config);});return promise;};promise.error = function(fn){promise.then(null,function(response){fn(response.data,response.status,response.headers,config);});return promise;};return promise;function transformResponse(response){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){var headerContent,processedHeaders={};forEach(headers,function(headerFn,header){if(isFunction(headerFn)){headerContent = headerFn();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)]);defaultHeadersIteration: for(defHeaderName in defHeaders) {lowercaseDefHeaderName = lowercase(defHeaderName);for(reqHeaderName in reqHeaders) {if(lowercase(reqHeaderName) === lowercaseDefHeaderName){continue defaultHeadersIteration;}}reqHeaders[defHeaderName] = defHeaders[defHeaderName];}return executeHeaderFns(reqHeaders);}}$http.pendingRequests = [];createShortMethods('get','delete','head','jsonp');createShortMethodsWithData('post','put','patch');$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}));};});}function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,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)){cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else {if(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else {resolvePromise(cachedResp,200,{},'OK');}}}else {cache.put(url,promise);}}if(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$browser.cookies()[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;function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else {cache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else {resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}function resolvePromise(response,status,headers,statusText){status = Math.max(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,params){if(!params)return url;var parts=[];forEachSorted(params,function(value,key){if(value === null || isUndefined(value))return;if(!isArray(value))value = [value];forEach(value,function(v){if(isObject(v)){if(isDate(v)){v = v.toISOString();}else {v = toJson(v);}}parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));});});if(parts.length > 0){url += (url.indexOf('?') == -1?'?':'&') + parts.join('&');}return url;}}];}function createXhr(){return new window.XMLHttpRequest();}function $HttpBackendProvider(){this.$get = ['$browser','$window','$document',function($browser,$window,$document){return createHttpBackend($browser,createXhr,$browser.defer,$window.angular.callbacks,$document[0]);}];}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){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();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 || '';var response='response' in xhr?xhr.response:xhr.responseText;var status=xhr.status === 1223?204:xhr.status;if(status === 0){status = response?200:urlResolve(url).protocol == 'file'?404:0;}completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText);};var requestError=function requestError(){completeRequest(callback,-1,null,null,'');};xhr.onerror = requestError;xhr.onabort = requestError;if(withCredentials){xhr.withCredentials = true;}if(responseType){try{xhr.responseType = responseType;}catch(e) {if(responseType !== 'json'){throw e;}}}xhr.send(post || null);}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){if(timeoutId !== undefined){$browserDefer.cancel(timeoutId);}jsonpDone = xhr = null;callback(status,response,headersString,statusText);$browser.$$completeOutstandingRequest(noop);}};function jsonpReq(url,callbackId,done){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=minErr('$interpolate');function $InterpolateProvider(){var startSymbol='{{';var endSymbol='}}';this.startSymbol = function(value){if(value){startSymbol = value;return this;}else {return startSymbol;}};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 $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 {if(index !== textLength){concat.push(unescapeText(text.substring(index)));}break;}}if(trustedContext && concat.length > 1){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);}if(!mustHaveExpression || expressions.length){var compute=function compute(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 getValue(value){return trustedContext?$sce.getTrusted(trustedContext,value):$sce.valueOf(value);};var stringify=function stringify(value){if(value == null){return '';}switch(typeof value){case 'string':break;case 'number':value = '' + value;break;default:value = toJson(value);}return 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) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}},{exp:text,expressions:expressions,$$watchDelegate:function $$watchDelegate(scope,listener,objectEquality){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;},objectEquality);}});}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol);}function parseStringifyInterceptor(value){try{value = getValue(value);return allOrNothing && !isDefined(value)?value:stringify(value);}catch(err) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}}}$interpolate.startSymbol = function(){return startSymbol;};$interpolate.endSymbol = function(){return endSymbol;};return $interpolate;}];}function $IntervalProvider(){this.$get = ['$rootScope','$window','$q','$$q',function($rootScope,$window,$q,$$q){var intervals={};function interval(fn,delay,count,invokeApply){var 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,fn);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;}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;}];}function $LocaleProvider(){this.$get = function(){return {id:'en-us',NUMBER_FORMATS:{DECIMAL_SEP:'.',GROUP_SEP:',',PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:'',posSuf:'',negPre:'-',negSuf:'',gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:'¤',posSuf:'',negPre:'(¤',negSuf:')',gSize:3,lgSize:3}],CURRENCY_SYM:'$'},DATETIME_FORMATS:{MONTH:'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),SHORTMONTH:'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),DAY:'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),SHORTDAY:'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),AMPMS:['AM','PM'],medium:'MMM d, y h:mm:ss a','short':'M/d/yy h:mm a',fullDate:'EEEE, MMMM d, y',longDate:'MMMM d, y',mediumDate:'MMM d, y',shortDate:'M/d/yy',mediumTime:'h:mm:ss a',shortTime:'h:mm a',ERANAMES:['Before Christ','Anno Domini'],ERAS:['BC','AD']},pluralCat:function pluralCat(num){if(num === 1){return 'one';}return 'other';}};};}var PATH_MATCH=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={'http':80,'https':443,'ftp':21};var $locationMinErr=minErr('$location');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 = int(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);if(locationObj.$$path && locationObj.$$path.charAt(0) != '/'){locationObj.$$path = '/' + locationObj.$$path;}}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);}function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//') + 2));}function LocationHtml5Url(appBase,basePrefix){this.$$html5 = true;basePrefix = basePrefix || '';var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);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();};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);};this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){this.hash(relHref.slice(1));return true;}var appUrl,prevAppUrl;var rewrittenUrl;if((appUrl = beginsWith(appBase,url)) !== undefined){prevAppUrl = appUrl;if((appUrl = beginsWith(basePrefix,appUrl)) !== undefined){rewrittenUrl = appBaseNoFile + (beginsWith('/',appUrl) || appUrl);}else {rewrittenUrl = appBase + prevAppUrl;}}else if((appUrl = beginsWith(appBaseNoFile,url)) !== undefined){rewrittenUrl = appBaseNoFile + appUrl;}else if(appBaseNoFile == url + '/'){rewrittenUrl = appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};}function LocationHashbangUrl(appBase,hashPrefix){var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);this.$$parse = function(url){var withoutBaseUrl=beginsWith(appBase,url) || beginsWith(appBaseNoFile,url);var withoutHashUrl;if(withoutBaseUrl.charAt(0) === '#'){withoutHashUrl = beginsWith(hashPrefix,withoutBaseUrl);if(isUndefined(withoutHashUrl)){withoutHashUrl = withoutBaseUrl;}}else {withoutHashUrl = this.$$html5?withoutBaseUrl:'';}parseAppUrl(withoutHashUrl,this);this.$$path = removeWindowsDriveName(this.$$path,withoutHashUrl,appBase);this.$$compose();function removeWindowsDriveName(path,url,base){var windowsFilePathExp=/^\/[A-Z]:(\/.*)/;var firstPathSegmentMatch;if(url.indexOf(base) === 0){url = url.replace(base,'');}if(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch = windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}};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;};}function LocationHashbangInHtml5Url(appBase,hashPrefix){this.$$html5 = true;LocationHashbangUrl.apply(this,arguments);var appBaseNoFile=stripFile(appBase);this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){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;this.$$absUrl = appBase + hashPrefix + this.$$url;};}var locationPrototype={$$html5:false,$$replace:false,absUrl:locationGetter('$$absUrl'),url:function url(_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;},protocol:locationGetter('$$protocol'),host:locationGetter('$$host'),port:locationGetter('$$port'),path:locationGetterSetter('$$path',function(path){path = path !== null?path.toString():'';return path.charAt(0) == '/'?path:'/' + path;}),search:function search(_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,{});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;},hash:locationGetterSetter('$$hash',function(hash){return hash !== null?hash.toString():'';}),replace:function replace(){this.$$replace = true;return this;}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype = Object.create(locationPrototype);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');}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;};}function $LocationProvider(){var hashPrefix='',html5Mode={enabled:false,requireBase:true,rewriteLinks:true};this.hashPrefix = function(prefix){if(isDefined(prefix)){hashPrefix = prefix;return this;}else {return hashPrefix;}};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;}};this.$get = ['$rootScope','$browser','$sniffer','$rootElement','$window',function($rootScope,$browser,$sniffer,$rootElement,$window){var $location,LocationMode,baseHref=$browser.baseHref(),initialUrl=$browser.url(),appBase;if(html5Mode.enabled){if(!baseHref && html5Mode.requireBase){throw $locationMinErr('nobase','$location in HTML5 mode requires a tag to be present!');}appBase = serverBase(initialUrl) + (baseHref || '/');LocationMode = $sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url;}else {appBase = stripHash(initialUrl);LocationMode = LocationHashbangUrl;}$location = new LocationMode(appBase,'#' + 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);$location.$$state = $browser.state();}catch(e) {$location.url(oldUrl);$location.$$state = oldState;throw e;}}$rootElement.on('click',function(event){if(!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2)return;var elm=jqLite(event.target);while(nodeName_(elm[0]) !== 'a') {if(elm[0] === $rootElement[0] || !(elm = elm.parent())[0])return;}var absHref=elm.prop('href');var relHref=elm.attr('href') || elm.attr('xlink:href');if(isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]'){absHref = urlResolve(absHref.animVal).href;}if(IGNORE_URI_REGEXP.test(absHref))return;if(absHref && !elm.attr('target') && !event.isDefaultPrevented()){if($location.$$parseLinkUrl(absHref,relHref)){event.preventDefault();if($location.absUrl() != $browser.url()){$rootScope.$apply();$window.angular['ff-684208-preventDefault'] = true;}}}});if(trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)){$browser.url($location.absUrl(),true);}var initializing=true;$browser.onUrlChange(function(newUrl,newState){$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($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();});$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($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;});return $location;function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast('$locationChangeSuccess',$location.absUrl(),oldUrl,$location.$$state,oldState);}}];}function $LogProvider(){var debug=true,self=this;this.debugEnabled = function(flag){if(isDefined(flag)){debug = flag;return this;}else {return debug;}};this.$get = ['$window',function($window){return {log:consoleLog('log'),info:consoleLog('info'),warn:consoleLog('warn'),error:consoleLog('error'),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;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);};}return function(arg1,arg2){logFn(arg1,arg2 == null?'':arg2);};}}];}var $parseMinErr=minErr('$parse');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 ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor === obj){throw $parseMinErr('isecfn','Referencing Function in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(obj.window === obj){throw $parseMinErr('isecwindow','Referencing the Window in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(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(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);}}}var CONSTANTS=createMap();forEach({'null':function _null(){return null;},'true':function _true(){return true;},'false':function _false(){return false;},'undefined':function undefined(){}},function(constantGetter,name){constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;CONSTANTS[name] = constantGetter;});CONSTANTS['this'] = function(self){return self;};CONSTANTS['this'].sharedGetter = true;var OPERATORS=extend(createMap(),{'+':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);if(isDefined(a)){if(isDefined(b)){return a + b;}return a;}return isDefined(b)?b:undefined;},'-':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);return (isDefined(a)?a:0) - (isDefined(b)?b:0);},'*':function _(self,locals,a,b){return a(self,locals) * b(self,locals);},'/':function _(self,locals,a,b){return a(self,locals) / b(self,locals);},'%':function _(self,locals,a,b){return a(self,locals) % b(self,locals);},'===':function _(self,locals,a,b){return a(self,locals) === b(self,locals);},'!==':function _(self,locals,a,b){return a(self,locals) !== b(self,locals);},'==':function _(self,locals,a,b){return a(self,locals) == b(self,locals);},'!=':function _(self,locals,a,b){return a(self,locals) != b(self,locals);},'<':function _(self,locals,a,b){return a(self,locals) < b(self,locals);},'>':function _(self,locals,a,b){return a(self,locals) > b(self,locals);},'<=':function _(self,locals,a,b){return a(self,locals) <= b(self,locals);},'>=':function _(self,locals,a,b){return a(self,locals) >= b(self,locals);},'&&':function _(self,locals,a,b){return a(self,locals) && b(self,locals);},'||':function _(self,locals,a,b){return a(self,locals) || b(self,locals);},'!':function _(self,locals,a){return !a(self,locals);},'=':true,'|':true});var ESCAPE={'n':'\n','f':'\f','r':'\r','t':'\t','v':'\u000b','\'':'\'','"':'"'};var Lexer=function Lexer(options){this.options = options;};Lexer.prototype = {constructor:Lexer,lex:function lex(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 is(ch,chars){return chars.indexOf(ch) !== -1;},peek:function peek(i){var num=i || 1;return this.index + num < this.text.length?this.text.charAt(this.index + num):false;},isNumber:function isNumber(ch){return '0' <= ch && ch <= '9' && typeof ch === 'string';},isWhitespace:function isWhitespace(ch){return ch === ' ' || ch === '\r' || ch === '\t' || ch === '\n' || ch === '\u000b' || ch === ' ';},isIdent:function isIdent(ch){return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || '_' === ch || ch === '$';},isExpOperator:function isExpOperator(ch){return ch === '-' || ch === '+' || this.isNumber(ch);},throwError:function throwError(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 readNumber(){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 readIdent(){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 readString(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);}};function isConstant(exp){return exp.constant;}var Parser=function Parser(lexer,$filter,options){this.lexer = lexer;this.$filter = $filter;this.options = options;};Parser.ZERO = extend(function(){return 0;},{sharedGetter:true,constant:true});Parser.prototype = {constructor:Parser,parse:function parse(text){this.text = text;this.tokens = this.lexer.lex(text);var value=this.statements();if(this.tokens.length !== 0){this.throwError('is an unexpected token',this.tokens[0]);}value.literal = !!value.literal;value.constant = !!value.constant;return value;},primary:function primary(){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.peek().identifier && this.peek().text in CONSTANTS){primary = 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,context;while(next = this.expect('(','[','.')) {if(next.text === '('){primary = this.functionCall(primary,context);context = null;}else if(next.text === '['){context = primary;primary = this.objectIndex(primary);}else if(next.text === '.'){context = primary;primary = this.fieldAccess(primary);}else {this.throwError('IMPOSSIBLE');}}return primary;},throwError:function throwError(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));},peekToken:function peekToken(){if(this.tokens.length === 0)throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);return this.tokens[0];},peek:function peek(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4);},peekAhead:function peekAhead(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 expect(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);if(token){this.tokens.shift();return token;}return false;},consume:function consume(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;},unaryFn:function unaryFn(op,right){var fn=OPERATORS[op];return extend(function $parseUnaryFn(self,locals){return fn(self,locals,right);},{constant:right.constant,inputs:[right]});},binaryFn:function binaryFn(left,op,right,isBranching){var fn=OPERATORS[op];return extend(function $parseBinaryFn(self,locals){return fn(self,locals,left,right);},{constant:left.constant && right.constant,inputs:!isBranching && [left,right]});},identifier:function identifier(){var id=this.consume().text;while(this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2,'(')) {id += this.consume().text + this.consume().text;}return getterFn(id,this.options,this.text);},constant:function constant(){var value=this.consume().value;return extend(function $parseConstant(){return value;},{constant:true,literal:true});},statements:function statements(){var statements=[];while(true) {if(this.tokens.length > 0 && !this.peek('}',')',';',']'))statements.push(this.filterChain());if(!this.expect(';')){return statements.length === 1?statements[0]:function $parseStatements(self,locals){var value;for(var i=0,ii=statements.length;i < ii;i++) {value = statements[i](self,locals);}return value;};}}},filterChain:function filterChain(){var left=this.expression();var token;while(token = this.expect('|')) {left = this.filter(left);}return left;},filter:function filter(inputFn){var fn=this.$filter(this.consume().text);var argsFn;var args;if(this.peek(':')){argsFn = [];args = [];while(this.expect(':')) {argsFn.push(this.expression());}}var inputs=[inputFn].concat(argsFn || []);return extend(function $parseFilter(self,locals){var input=inputFn(self,locals);if(args){args[0] = input;var i=argsFn.length;while(i--) {args[i + 1] = argsFn[i](self,locals);}return fn.apply(undefined,args);}return fn(input);},{constant:!fn.$stateful && inputs.every(isConstant),inputs:!fn.$stateful && inputs});},expression:function expression(){return this.assignment();},assignment:function assignment(){var left=this.ternary();var right;var token;if(token = this.expect('=')){if(!left.assign){this.throwError('implies assignment but [' + this.text.substring(0,token.index) + '] can not be assigned to',token);}right = this.ternary();return extend(function $parseAssignment(scope,locals){return left.assign(scope,right(scope,locals),locals);},{inputs:[left,right]});}return left;},ternary:function ternary(){var left=this.logicalOR();var middle;var token;if(token = this.expect('?')){middle = this.assignment();if(this.consume(':')){var right=this.assignment();return extend(function $parseTernary(self,locals){return left(self,locals)?middle(self,locals):right(self,locals);},{constant:left.constant && middle.constant && right.constant});}}return left;},logicalOR:function logicalOR(){var left=this.logicalAND();var token;while(token = this.expect('||')) {left = this.binaryFn(left,token.text,this.logicalAND(),true);}return left;},logicalAND:function logicalAND(){var left=this.equality();var token;while(token = this.expect('&&')) {left = this.binaryFn(left,token.text,this.equality(),true);}return left;},equality:function equality(){var left=this.relational();var token;while(token = this.expect('==','!=','===','!==')) {left = this.binaryFn(left,token.text,this.relational());}return left;},relational:function relational(){var left=this.additive();var token;while(token = this.expect('<','>','<=','>=')) {left = this.binaryFn(left,token.text,this.additive());}return left;},additive:function additive(){var left=this.multiplicative();var token;while(token = this.expect('+','-')) {left = this.binaryFn(left,token.text,this.multiplicative());}return left;},multiplicative:function multiplicative(){var left=this.unary();var token;while(token = this.expect('*','/','%')) {left = this.binaryFn(left,token.text,this.unary());}return left;},unary:function unary(){var token;if(this.expect('+')){return this.primary();}else if(token = this.expect('-')){return this.binaryFn(Parser.ZERO,token.text,this.unary());}else if(token = this.expect('!')){return this.unaryFn(token.text,this.unary());}else {return this.primary();}},fieldAccess:function fieldAccess(object){var getter=this.identifier();return extend(function $parseFieldAccess(scope,locals,self){var o=self || object(scope,locals);return o == null?undefined:getter(o);},{assign:function assign(scope,value,locals){var o=object(scope,locals);if(!o)object.assign(scope,o = {},locals);return getter.assign(o,value);}});},objectIndex:function objectIndex(obj){var expression=this.text;var indexFn=this.expression();this.consume(']');return extend(function $parseObjectIndex(self,locals){var o=obj(self,locals),i=indexFn(self,locals),v;ensureSafeMemberName(i,expression);if(!o)return undefined;v = ensureSafeObject(o[i],expression);return v;},{assign:function assign(self,value,locals){var key=ensureSafeMemberName(indexFn(self,locals),expression);var o=ensureSafeObject(obj(self,locals),expression);if(!o)obj.assign(self,o = {},locals);return o[key] = value;}});},functionCall:function functionCall(fnGetter,contextGetter){var argsFn=[];if(this.peekToken().text !== ')'){do {argsFn.push(this.expression());}while(this.expect(','));}this.consume(')');var expressionText=this.text;var args=argsFn.length?[]:null;return function $parseFunctionCall(scope,locals){var context=contextGetter?contextGetter(scope,locals):isDefined(contextGetter)?undefined:scope;var fn=fnGetter(scope,locals,context) || noop;if(args){var i=argsFn.length;while(i--) {args[i] = ensureSafeObject(argsFn[i](scope,locals),expressionText);}}ensureSafeObject(context,expressionText);ensureSafeFunction(fn,expressionText);var v=fn.apply?fn.apply(context,args):fn(args[0],args[1],args[2],args[3],args[4]);if(args){args.length = 0;}return ensureSafeObject(v,expressionText);};},arrayDeclaration:function arrayDeclaration(){var elementFns=[];if(this.peekToken().text !== ']'){do {if(this.peek(']')){break;}elementFns.push(this.expression());}while(this.expect(','));}this.consume(']');return extend(function $parseArrayLiteral(self,locals){var array=[];for(var i=0,ii=elementFns.length;i < ii;i++) {array.push(elementFns[i](self,locals));}return array;},{literal:true,constant:elementFns.every(isConstant),inputs:elementFns});},object:function object(){var keys=[],valueFns=[];if(this.peekToken().text !== '}'){do {if(this.peek('}')){break;}var token=this.consume();if(token.constant){keys.push(token.value);}else if(token.identifier){keys.push(token.text);}else {this.throwError('invalid key',token);}this.consume(':');valueFns.push(this.expression());}while(this.expect(','));}this.consume('}');return extend(function $parseObjectLiteral(self,locals){var object={};for(var i=0,ii=valueFns.length;i < ii;i++) {object[keys[i]] = valueFns[i](self,locals);}return object;},{literal:true,constant:valueFns.every(isConstant),inputs:valueFns});}};function setter(obj,locals,path,setValue,fullExp){ensureSafeObject(obj,fullExp);ensureSafeObject(locals,fullExp);var element=path.split('.'),key;for(var i=0;element.length > 1;i++) {key = ensureSafeMemberName(element.shift(),fullExp);var propertyObj=i === 0 && locals && locals[key] || obj[key];if(!propertyObj){propertyObj = {};obj[key] = propertyObj;}obj = ensureSafeObject(propertyObj,fullExp);}key = ensureSafeMemberName(element.shift(),fullExp);ensureSafeObject(obj[key],fullExp);obj[key] = setValue;return setValue;}var getterFnCacheDefault=createMap();var getterFnCacheExpensive=createMap();function isPossiblyDangerousMemberName(name){return name == 'constructor';}function cspSafeGetterFn(key0,key1,key2,key3,key4,fullExp,expensiveChecks){ensureSafeMemberName(key0,fullExp);ensureSafeMemberName(key1,fullExp);ensureSafeMemberName(key2,fullExp);ensureSafeMemberName(key3,fullExp);ensureSafeMemberName(key4,fullExp);var eso=function eso(o){return ensureSafeObject(o,fullExp);};var eso0=expensiveChecks || isPossiblyDangerousMemberName(key0)?eso:identity;var eso1=expensiveChecks || isPossiblyDangerousMemberName(key1)?eso:identity;var eso2=expensiveChecks || isPossiblyDangerousMemberName(key2)?eso:identity;var eso3=expensiveChecks || isPossiblyDangerousMemberName(key3)?eso:identity;var eso4=expensiveChecks || isPossiblyDangerousMemberName(key4)?eso:identity;return function cspSafeGetter(scope,locals){var pathVal=locals && locals.hasOwnProperty(key0)?locals:scope;if(pathVal == null)return pathVal;pathVal = eso0(pathVal[key0]);if(!key1)return pathVal;if(pathVal == null)return undefined;pathVal = eso1(pathVal[key1]);if(!key2)return pathVal;if(pathVal == null)return undefined;pathVal = eso2(pathVal[key2]);if(!key3)return pathVal;if(pathVal == null)return undefined;pathVal = eso3(pathVal[key3]);if(!key4)return pathVal;if(pathVal == null)return undefined;pathVal = eso4(pathVal[key4]);return pathVal;};}function getterFnWithEnsureSafeObject(fn,fullExpression){return function(s,l){return fn(s,l,ensureSafeObject,fullExpression);};}function getterFn(path,options,fullExp){var expensiveChecks=options.expensiveChecks;var getterFnCache=expensiveChecks?getterFnCacheExpensive:getterFnCacheDefault;var fn=getterFnCache[path];if(fn)return fn;var pathKeys=path.split('.'),pathKeysLength=pathKeys.length;if(options.csp){if(pathKeysLength < 6){fn = cspSafeGetterFn(pathKeys[0],pathKeys[1],pathKeys[2],pathKeys[3],pathKeys[4],fullExp,expensiveChecks);}else {fn = function cspSafeGetter(scope,locals){var i=0,val;do {val = cspSafeGetterFn(pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],fullExp,expensiveChecks)(scope,locals);locals = undefined;scope = val;}while(i < pathKeysLength);return val;};}}else {var code='';if(expensiveChecks){code += 's = eso(s, fe);\nl = eso(l, fe);\n';}var needsEnsureSafeObject=expensiveChecks;forEach(pathKeys,function(key,index){ensureSafeMemberName(key,fullExp);var lookupJs=(index?'s':'((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key;if(expensiveChecks || isPossiblyDangerousMemberName(key)){lookupJs = 'eso(' + lookupJs + ', fe)';needsEnsureSafeObject = true;}code += 'if(s == null) return undefined;\n' + 's=' + lookupJs + ';\n';});code += 'return s;';var evaledFnGetter=new Function('s','l','eso','fe',code);evaledFnGetter.toString = valueFn(code);if(needsEnsureSafeObject){evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter,fullExp);}fn = evaledFnGetter;}fn.sharedGetter = true;fn.assign = function(self,value,locals){return setter(self,locals,path,value,path);};getterFnCache[path] = fn;return fn;}var objectValueOf=Object.prototype.valueOf;function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value);}function $ParseProvider(){var cacheDefault=createMap();var cacheExpensive=createMap();this.$get = ['$filter','$sniffer',function($filter,$sniffer){var $parseOptions={csp:$sniffer.csp,expensiveChecks:false},$parseOptionsExpensive={csp:$sniffer.csp,expensiveChecks:true};function wrapSharedExpression(exp){var wrapped=exp;if(exp.sharedGetter){wrapped = function $parseWrapper(self,locals){return exp(self,locals);};wrapped.literal = exp.literal;wrapped.constant = exp.constant;wrapped.assign = exp.assign;}return wrapped;}return function $parse(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(typeof exp){case 'string':cacheKey = exp = exp.trim();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 = wrapSharedExpression(parsedExpression);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 addInterceptor(noop,interceptorFn);}};function collectExpressionInputs(inputs,list){for(var i=0,ii=inputs.length;i < ii;i++) {var input=inputs[i];if(!input.constant){if(input.inputs){collectExpressionInputs(input.inputs,list);}else if(list.indexOf(input) === -1){list.push(input);}}}return list;}function expressionInputDirtyCheck(newValue,oldValueOfValue){if(newValue == null || oldValueOfValue == null){return newValue === oldValueOfValue;}if(typeof newValue === 'object'){newValue = getValueOf(newValue);if(typeof newValue === 'object'){return false;}}return newValue === oldValueOfValue || newValue !== newValue && oldValueOfValue !== oldValueOfValue;}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression){var inputExpressions=parsedExpression.$$inputs || (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs,[]));var lastResult;if(inputExpressions.length === 1){var oldInputValue=expressionInputDirtyCheck;inputExpressions = inputExpressions[0];return scope.$watch(function expressionInputWatch(scope){var newInputValue=inputExpressions(scope);if(!expressionInputDirtyCheck(newInputValue,oldInputValue)){lastResult = parsedExpression(scope);oldInputValue = newInputValue && getValueOf(newInputValue);}return lastResult;},listener,objectEquality);}var oldInputValueOfValues=[];for(var i=0,ii=inputExpressions.length;i < ii;i++) {oldInputValueOfValues[i] = expressionInputDirtyCheck;}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]))){oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);}}if(changed){lastResult = parsedExpression(scope);}return lastResult;},listener,objectEquality);}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){var value=parsedExpression(scope,locals);return interceptorFn(value,scope,locals);}:function oneTimeInterceptedExpression(scope,locals){var value=parsedExpression(scope,locals);var result=interceptorFn(value,scope,locals);return isDefined(value)?result:value;};if(parsedExpression.$$watchDelegate && parsedExpression.$$watchDelegate !== inputsWatchDelegate){fn.$$watchDelegate = parsedExpression.$$watchDelegate;}else if(!interceptorFn.$stateful){fn.$$watchDelegate = inputsWatchDelegate;fn.inputs = [parsedExpression];}return fn;}}];}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);}];}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)];}var defer=function defer(){return new Deferred();};function Promise(){this.$$state = {status:0};}Promise.prototype = {then:function then(onFulfilled,onRejected,progressBack){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 _catch(callback){return this.then(null,callback);},'finally':function _finally(callback,progressBack){return this.then(function(value){return handleCallback(value,true,callback);},function(error){return handleCallback(error,false,callback);},progressBack);}};function simpleBind(context,fn){return function(value){fn.call(context,value);};}function processQueue(state){var fn,promise,pending;pending = state.pending;state.processScheduled = false;state.pending = undefined;for(var i=0,ii=pending.length;i < ii;++i) {promise = pending[i][0];fn = pending[i][state.status];try{if(isFunction(fn)){promise.resolve(fn(state.value));}else if(state.status === 1){promise.resolve(state.value);}else {promise.reject(state.value);}}catch(e) {promise.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();this.resolve = simpleBind(this,this.resolve);this.reject = simpleBind(this,this.reject);this.notify = simpleBind(this,this.notify);}Deferred.prototype = {resolve:function resolve(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 $$resolve(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 reject(reason){if(this.promise.$$state.status)return;this.$$reject(reason);},$$reject:function $$reject(reason){this.promise.$$state.value = reason;this.promise.$$state.status = 2;scheduleProcessQueue(this.promise.$$state);},notify:function notify(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);}}});}}};var reject=function reject(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);}};var when=function when(value,callback,errback,progressBack){var result=new Deferred();result.resolve(value);return result.promise.then(callback,errback,progressBack);};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)){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.all = all;return $Q;}function $$RAFProvider(){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);return function(){$timeout.cancel(timer);};};raf.supported = rafSupported;return raf;}];}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;}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.$$isolateBindings = null;}Scope.prototype = {constructor:Scope,$new:function $new(isolate,parent){var child;parent = parent || this;if(isolate){child = new Scope();child.$root = this.$root;}else {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;}if(isolate || parent != this)child.$on('$destroy',destroyChildScope);return child;},$watch:function $watch(watchExp,listener,objectEquality){var get=$parse(watchExp);if(get.$$watchDelegate){return get.$$watchDelegate(this,listener,objectEquality,get);}var scope=this,array=scope.$$watchers,watcher={fn:listener,last:initWatchVal,get:get,exp:watchExp,eq:!!objectEquality};lastDirtyWatch = null;if(!isFunction(listener)){watcher.fn = noop;}if(!array){array = scope.$$watchers = [];}array.unshift(watcher);return function deregisterWatch(){arrayRemove(array,watcher);lastDirtyWatch = null;};},$watchGroup:function $watchGroup(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){var shouldCall=true;self.$evalAsync(function(){if(shouldCall)listener(newValues,newValues,self);});return function deregisterWatchGroup(){shouldCall = false;};}if(watchExpressions.length === 1){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()();}};},$watchCollection:function $watchCollection(obj,listener){$watchCollectionInterceptor.$stateful = true;var self=this;var newValue;var oldValue;var veryOldValue;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(isUndefined(newValue))return;if(!isObject(newValue)){if(oldValue !== newValue){oldValue = newValue;changeDetected++;}}else if(isArrayLike(newValue)){if(oldValue !== internalArray){oldValue = internalArray;oldLength = oldValue.length = 0;changeDetected++;}newLength = newValue.length;if(oldLength !== newLength){changeDetected++;oldValue.length = oldLength = newLength;}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){oldValue = internalObject = {};oldLength = 0;changeDetected++;}newLength = 0;for(key in newValue) {if(newValue.hasOwnProperty(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){changeDetected++;for(key in oldValue) {if(!newValue.hasOwnProperty(key)){oldLength--;delete oldValue[key];}}}}return changeDetected;}function $watchCollectionAction(){if(initRun){initRun = false;listener(newValue,newValue,self);}else {listener(newValue,veryOldValue,self);}if(trackVeryOldValue){if(!isObject(newValue)){veryOldValue = newValue;}else if(isArrayLike(newValue)){veryOldValue = new Array(newValue.length);for(var i=0;i < newValue.length;i++) {veryOldValue[i] = newValue[i];}}else {veryOldValue = {};for(var key in newValue) {if(hasOwnProperty.call(newValue,key)){veryOldValue[key] = newValue[key];}}}}}return this.$watch(changeDetector,$watchCollectionAction);},$digest:function $digest(){var watch,value,last,watchers,length,dirty,ttl=TTL,next,current,target=this,watchLog=[],logIdx,logMsg,asyncTask;beginPhase('$digest');$browser.$$checkUrlChange();if(this === $rootScope && applyAsyncId !== null){$browser.defer.cancel(applyAsyncId);flushApplyAsync();}lastDirtyWatch = null;do {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 {if(watchers = current.$$watchers){length = watchers.length;while(length--) {try{watch = watchers[length];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){dirty = false;break traverseScopesLoop;}}}catch(e) {$exceptionHandler(e);}}}if(!(next = current.$$childHead || current !== target && current.$$nextSibling)){while(current !== target && !(next = current.$$nextSibling)) {current = current.$parent;}}}while(current = next);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);}}},$destroy:function $destroy(){if(this.$$destroyed)return;var parent=this.$parent;this.$broadcast('$destroy');this.$$destroyed = true;if(this === $rootScope)return;for(var eventName in this.$$listenerCount) {decrementListenerCount(this,this.$$listenerCount[eventName],eventName);}if(parent.$$childHead == this)parent.$$childHead = this.$$nextSibling;if(parent.$$childTail == this)parent.$$childTail = this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling = this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling = this.$$prevSibling;this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;this.$on = this.$watch = this.$watchGroup = function(){return noop;};this.$$listeners = {};this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = this.$$watchers = null;},$eval:function $eval(expr,locals){return $parse(expr)(this,locals);},$evalAsync:function $evalAsync(expr,locals){if(!$rootScope.$$phase && !asyncQueue.length){$browser.defer(function(){if(asyncQueue.length){$rootScope.$digest();}});}asyncQueue.push({scope:this,expression:expr,locals:locals});},$$postDigest:function $$postDigest(fn){postDigestQueue.push(fn);},$apply:function $apply(expr){try{beginPhase('$apply');return this.$eval(expr);}catch(e) {$exceptionHandler(e);}finally {clearPhase();try{$rootScope.$digest();}catch(e) {$exceptionHandler(e);throw e;}}},$applyAsync:function $applyAsync(expr){var scope=this;expr && applyAsyncQueue.push($applyAsyncExpression);scheduleApplyAsync();function $applyAsyncExpression(){scope.$eval(expr);}},$on:function $on(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);}};},$emit:function $emit(name,args){var empty=[],namedListeners,scope=this,_stopPropagation=false,event={name:name,targetScope:scope,stopPropagation:function stopPropagation(){_stopPropagation = true;},preventDefault:function preventDefault(){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(!namedListeners[i]){namedListeners.splice(i,1);i--;length--;continue;}try{namedListeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}if(_stopPropagation){event.currentScope = null;return event;}scope = scope.$parent;}while(scope);event.currentScope = null;return event;},$broadcast:function $broadcast(name,args){var target=this,current=target,next=target,event={name:name,targetScope:target,preventDefault:function preventDefault(){event.defaultPrevented = true;},defaultPrevented:false};if(!target.$$listenerCount[name])return event;var listenerArgs=concat([event],arguments,1),listeners,i,length;while(current = next) {event.currentScope = current;listeners = current.$$listeners[name] || [];for(i = 0,length = listeners.length;i < length;i++) {if(!listeners[i]){listeners.splice(i,1);i--;length--;continue;}try{listeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}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();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 decrementListenerCount(current,count,name){do {current.$$listenerCount[name] -= count;if(current.$$listenerCount[name] === 0){delete current.$$listenerCount[name];}}while(current = current.$parent);}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);});}}}];}function $$SanitizeUriProvider(){var aHrefSanitizationWhitelist=/^\s*(https?|ftp|mailto|tel|file):/,imgSrcSanitizationWhitelist=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){aHrefSanitizationWhitelist = regexp;return this;}return aHrefSanitizationWhitelist;};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;};};}var $sceMinErr=minErr('$sce');var SCE_CONTEXTS={HTML:'html',CSS:'css',URL:'url',RESOURCE_URL:'resourceUrl',JS:'js'};function adjustMatcher(matcher){if(matcher === 'self'){return matcher;}else if(isString(matcher)){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)){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;}function $SceDelegateProvider(){this.SCE_CONTEXTS = SCE_CONTEXTS;var resourceUrlWhitelist=['self'],resourceUrlBlacklist=[];this.resourceUrlWhitelist = function(value){if(arguments.length){resourceUrlWhitelist = adjustMatchers(value);}return resourceUrlWhitelist;};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 {return !!matcher.exec(parsedUrl.href);}}function isResourceUrlAllowedByPolicy(url){var parsedUrl=urlResolve(url.toString());var i,n,allowed=false;for(i = 0,n = resourceUrlWhitelist.length;i < n;i++) {if(matchUrl(resourceUrlWhitelist[i],parsedUrl)){allowed = true;break;}}if(allowed){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]);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 || trustedValue === undefined || trustedValue === ''){return trustedValue;}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);}function valueOf(maybeTrusted){if(maybeTrusted instanceof trustedValueHolderBase){return maybeTrusted.$$unwrapTrustedValue();}else {return maybeTrusted;}}function getTrusted(type,maybeTrusted){if(maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === ''){return maybeTrusted;}var constructor=byType.hasOwnProperty(type)?byType[type]:null;if(constructor && maybeTrusted instanceof constructor){return maybeTrusted.$$unwrapTrustedValue();}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};}];}function $SceProvider(){var enabled=true;this.enabled = function(value){if(arguments.length){enabled = !!value;}return enabled;};this.$get = ['$parse','$sceDelegate',function($parse,$sceDelegate){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 to the top of your HTML ' + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');}var sce=shallowCopy(SCE_CONTEXTS);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;}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);});}};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;}];}function $SnifferProvider(){this.$get = ['$window','$document',function($window,$document){var eventSupport={},android=int((/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(document.body.style.webkitTransition);animations = isString(document.body.style.webkitAnimation);}}return {history:!!($window.history && $window.history.pushState && !(android < 4) && !boxee),hasEvent:function hasEvent(event){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');function $TemplateRequestProvider(){this.$get = ['$templateCache','$http','$q',function($templateCache,$http,$q){function handleRequestFn(tpl,ignoreRequestError){handleRequestFn.totalPendingRequests++;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){return response.data;},handleError);function handleError(resp){if(!ignoreRequestError){throw $compileMinErr('tpload','Failed to load template: {0}',tpl);}return $q.reject(resp);}}handleRequestFn.totalPendingRequests = 0;return handleRequestFn;}];}function $$TestabilityProvider(){this.$get = ['$rootScope','$browser','$location',function($rootScope,$browser,$location){var testability={};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;};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;}}};testability.getLocation = function(){return $location.url();};testability.setLocation = function(url){if(url !== $location.url()){$location.url(url);$rootScope.$digest();}};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={};function timeout(fn,delay,invokeApply){var skipApply=isDefined(invokeApply) && !invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise,timeoutId;timeoutId = $browser.defer(function(){try{deferred.resolve(fn());}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;}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;}];}var urlParsingNode=document.createElement('a');var originUrl=urlResolve(window.location.href);function urlResolve(url){var href=url;if(msie){urlParsingNode.setAttribute('href',href);href = urlParsingNode.href;}urlParsingNode.setAttribute('href',href);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};}function urlIsSameOrigin(requestUrl){var parsed=isString(requestUrl)?urlResolve(requestUrl):requestUrl;return parsed.protocol === originUrl.protocol && parsed.host === originUrl.host;}function $WindowProvider(){this.$get = valueFn(window);}$FilterProvider.$inject = ['$provide'];function $FilterProvider($provide){var suffix='Filter';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);};}];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);}function filterFilter(){return function(array,expression,comparator){if(!isArray(array))return array;var predicateFn;var matchAgainstAnyProp;switch(typeof expression){case 'function':predicateFn = expression;break;case 'boolean':case 'number':case 'string':matchAgainstAnyProp = true;case 'object':predicateFn = createPredicateFn(expression,comparator,matchAgainstAnyProp);break;default:return array;}return array.filter(predicateFn);};}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(isObject(actual) || isObject(expected)){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(_x3,_x4,_x5,_x6,_x7){var _again2=true;_function2: while(_again2) {var actual=_x3,expected=_x4,comparator=_x5,matchAgainstAnyProp=_x6,dontMatchWholeObject=_x7;actualType = expectedType = key = expectedVal = matchAnyProperty = actualVal = undefined;_again2 = false;var actualType=actual !== null?typeof actual:'null';var expectedType=expected !== null?typeof expected:'null';if(expectedType === 'string' && expected.charAt(0) === '!'){return !deepCompare(actual,expected.substring(1),comparator,matchAgainstAnyProp);}else if(isArray(actual)){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;}}if(dontMatchWholeObject){return false;}else {_x3 = actual;_x4 = expected;_x5 = comparator;_x6 = false;_again2 = true;continue _function2;}}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);}}}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;}return amount == null?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol);};}numberFilter.$inject = ['$locale'];function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){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(!isFinite(number) || isObject(number))return '';var isNegative=number < 0;number = Math.abs(number);var numStr=number + '',formatedText='',parts=[];var hasExponent=false;if(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(!hasExponent){var fractionLen=(numStr.split(DECIMAL_SEP)[1] || '').length;if(isUndefined(fractionSize)){fractionSize = Math.min(Math.max(pattern.minFrac,fractionLen),pattern.maxFrac);}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);}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);}}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){var zone=-1 * date.getTimezoneOffset();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){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(dayOfWeekOnFirst <= 4?5:12) - dayOfWeekOnFirst);}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),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);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),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+$/;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))?)?$/;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 = int(match[9] + match[10]);tzMin = int(match[9] + match[11]);}dateSetter.call(date,int(match[1]),int(match[2]) - 1,int(match[3]));var h=int(match[4] || 0) - tzHour;var m=int(match[5] || 0) - tzMin;var s=int(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)?int(date):jsonStringToDate(date);}if(isNumber(date)){date = new Date(date);}if(!isDate(date)){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;}}if(timezone && timezone === 'UTC'){date = new Date(date.getTime());date.setMinutes(date.getMinutes() + date.getTimezoneOffset());}forEach(parts,function(value){fn = DATE_FORMATS[value];text += fn?fn(date,$locale.DATETIME_FORMATS):value.replace(/(^'|'$)/g,'').replace(/''/g,'\'');});return text;};}function jsonFilter(){return function(object,spacing){if(isUndefined(spacing)){spacing = 2;}return toJson(object,spacing);};}var lowercaseFilter=valueFn(lowercase);var uppercaseFilter=valueFn(uppercase);function limitToFilter(){return function(input,limit){if(isNumber(input))input = input.toString();if(!isArray(input) && !isString(input))return input;if(Math.abs(Number(limit)) === Infinity){limit = Number(limit);}else {limit = int(limit);}if(limit){return limit > 0?input.slice(0,limit):input.slice(limit);}else {return isString(input)?'':[];}};}orderByFilter.$inject = ['$parse'];function orderByFilter($parse){return function(array,sortPredicate,reverseOrder){if(!isArrayLike(array))return array;sortPredicate = isArray(sortPredicate)?sortPredicate:[sortPredicate];if(sortPredicate.length === 0){sortPredicate = ['+'];}sortPredicate = sortPredicate.map(function(predicate){var descending=false,get=predicate || identity;if(isString(predicate)){if(predicate.charAt(0) == '+' || predicate.charAt(0) == '-'){descending = predicate.charAt(0) == '-';predicate = predicate.substring(1);}if(predicate === ''){return reverseComparator(compare,descending);}get = $parse(predicate);if(get.constant){var key=get();return reverseComparator(function(a,b){return compare(a[key],b[key]);},descending);}}return reverseComparator(function(a,b){return compare(get(a),get(b));},descending);});return slice.call(array).sort(reverseComparator(comparator,reverseOrder));function comparator(o1,o2){for(var i=0;i < sortPredicate.length;i++) {var comp=sortPredicate[i](o1,o2);if(comp !== 0)return comp;}return 0;}function reverseComparator(comp,descending){return descending?function(a,b){return comp(b,a);}:comp;}function isPrimitive(value){switch(typeof value){case 'number':case 'boolean':case 'string':return true;default:return false;}}function objectToString(value){if(value === null)return 'null';if(typeof value.valueOf === 'function'){value = value.valueOf();if(isPrimitive(value))return value;}if(typeof value.toString === 'function'){value = value.toString();if(isPrimitive(value))return value;}return '';}function compare(v1,v2){var t1=typeof v1;var t2=typeof v2;if(t1 === t2 && t1 === 'object'){v1 = objectToString(v1);v2 = objectToString(v2);}if(t1 === t2){if(t1 === 'string'){v1 = v1.toLowerCase();v2 = v2.toLowerCase();}if(v1 === v2)return 0;return v1 < v2?-1:1;}else {return t1 < t2?-1:1;}}};}function ngDirective(directive){if(isFunction(directive)){directive = {link:directive};}directive.restrict = directive.restrict || 'AC';return valueFn(directive);}var htmlAnchorDirective=valueFn({restrict:'E',compile:function compile(element,attr){if(!attr.href && !attr.xlinkHref && !attr.name){return function(scope,element){if(element[0].nodeName.toLowerCase() !== 'a')return;var href=toString.call(element.prop('href')) === '[object SVGAnimatedString]'?'xlink:href':'href';element.on('click',function(event){if(!element.attr(href)){event.preventDefault();}});};}}});var ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){if(propName == 'multiple')return;var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {restrict:'A',priority:100,link:function link(scope,element,attr){scope.$watch(attr[normalized],function ngBooleanAttrWatchAction(value){attr.$set(attrName,!!value);});}};};});forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr] = function(){return {priority:100,link:function link(scope,element,attr){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);});}};};});forEach(['src','srcset','href'],function(attrName){var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {priority:99,link:function link(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);if(msie && propName)element.prop(propName,attr[name]);});}};};});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;}FormController.$inject = ['$element','$attrs','$scope','$animate','$interpolate'];function FormController(element,attrs,$scope,$animate,$interpolate){var form=this,controls=[];var parentForm=form.$$parentForm = element.parent().controller('form') || nullFormCtrl;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;parentForm.$addControl(form);form.$rollbackViewValue = function(){forEach(controls,function(control){control.$rollbackViewValue();});};form.$commitViewValue = function(){forEach(controls,function(control){control.$commitViewValue();});};form.$addControl = function(control){assertNotHasOwnProperty(control.$name,'input');controls.push(control);if(control.$name){form[control.$name] = control;}};form.$$renameControl = function(control,newName){var oldName=control.$name;if(form[oldName] === control){delete form[oldName];}form[newName] = control;control.$name = newName;};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);};addSetValidityMethod({ctrl:this,$element:element,set:function set(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 unset(object,property,controller){var list=object[property];if(!list){return;}arrayRemove(list,controller);if(list.length === 0){delete object[property];}},parentForm:parentForm,$animate:$animate});form.$setDirty = function(){$animate.removeClass(element,PRISTINE_CLASS);$animate.addClass(element,DIRTY_CLASS);form.$dirty = true;form.$pristine = false;parentForm.$setDirty();};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();});};form.$setUntouched = function(){forEach(controls,function(control){control.$setUntouched();});};form.$setSubmitted = function(){$animate.addClass(element,SUBMITTED_CLASS);form.$submitted = true;parentForm.$setSubmitted();};}var formDirectiveFactory=function formDirectiveFactory(isNgForm){return ['$timeout',function($timeout){var formDirective={name:'form',restrict:isNgForm?'EAC':'E',controller:FormController,compile:function ngFormCompile(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?'name':isNgForm && attr.ngForm?'ngForm':false;return {pre:function ngFormPreLink(scope,formElement,attr,controller){if(!('action' in attr)){var handleFormSubmission=function handleFormSubmission(event){scope.$apply(function(){controller.$commitViewValue();controller.$setSubmitted();});event.preventDefault();};addEventListenerFn(formElement[0],'submit',handleFormSubmission);formElement.on('$destroy',function(){$timeout(function(){removeEventListenerFn(formElement[0],'submit',handleFormSubmission);},0,false);});}var parentFormCtrl=controller.$$parentForm;if(nameAttr){setter(scope,null,controller.$name,controller,controller.$name);attr.$observe(nameAttr,function(newValue){if(controller.$name === newValue)return;setter(scope,null,controller.$name,undefined,controller.$name);parentFormCtrl.$$renameControl(controller,newValue);setter(scope,null,controller.$name,controller,controller.$name);});}formElement.on('$destroy',function(){parentFormCtrl.$removeControl(controller);if(nameAttr){setter(scope,null,attr[nameAttr],undefined,controller.$name);}extend(controller,nullFormCtrl);});}};}};return formDirective;}];};var formDirective=formDirectiveFactory();var ngFormDirective=formDirectiveFactory(true);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*)))\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={'text':textInputType,'date':createDateInputType('date',DATE_REGEXP,createDateParser(DATE_REGEXP,['yyyy','MM','dd']),'yyyy-MM-dd'),'datetime-local':createDateInputType('datetimelocal',DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,['yyyy','MM','dd','HH','mm','ss','sss']),'yyyy-MM-ddTHH:mm:ss.sss'),'time':createDateInputType('time',TIME_REGEXP,createDateParser(TIME_REGEXP,['HH','mm','ss','sss']),'HH:mm:ss.sss'),'week':createDateInputType('week',WEEK_REGEXP,weekParser,'yyyy-Www'),'month':createDateInputType('month',MONTH_REGEXP,createDateParser(MONTH_REGEXP,['yyyy','MM']),'yyyy-MM'),'number':numberInputType,'url':urlInputType,'email':emailInputType,'radio':radioInputType,'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);if(!$sniffer.android){var composing=false;element.on('compositionstart',function(data){composing = true;});element.on('compositionend',function(){composing = false;listener();});}var listener=function listener(ev){if(timeout){$browser.defer.cancel(timeout);timeout = null;}if(composing)return;var value=element.val(),event=ev && ev.type;if(type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')){value = trim(value);}if(ctrl.$viewValue !== value || value === '' && ctrl.$$hasNativeValidators){ctrl.$setViewValue(value,event);}};if($sniffer.hasEvent('input')){element.on('input',listener);}else {var timeout;var deferListener=function deferListener(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;if(key === 91 || 15 < key && key < 19 || 37 <= key && key <= 40)return;deferListener(event,this,this.value);});if($sniffer.hasEvent('paste')){element.on('paste cut',deferListener);}}element.on('change',listener);ctrl.$render = function(){element.val(ctrl.$isEmpty(ctrl.$viewValue)?'':ctrl.$viewValue);};}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)){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)){var parsedDate=parseDate(value,previousDate);if(timezone === 'UTC'){parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());}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 === 'UTC'){var timezoneOffset=60000 * previousDate.getTimezoneOffset();previousDate = new Date(previousDate.getTime() + timezoneOffset);}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){return value && !(value.getTime && value.getTime() !== value.getTime());}function parseObservedDateValue(val){return isDefined(val)?isDate(val)?val:parseDate(val):undefined;}};}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) || {};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;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;ctrl.$validate();});}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){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){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){if(isUndefined(attr.name)){element.attr('name',nextUid());}var listener=function listener(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 minErr('ngModel')('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 listener(ev){ctrl.$setViewValue(element[0].checked,ev && ev.type);};element.on('click',listener);ctrl.$render = function(){element[0].checked = ctrl.$viewValue;};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;});}var inputDirective=['$browser','$sniffer','$filter','$parse',function($browser,$sniffer,$filter,$parse){return {restrict:'E',require:['?ngModel'],link:{pre:function pre(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+)$/;var ngValueDirective=function ngValueDirective(){return {restrict:'A',priority:100,compile:function compile(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);});};}}};};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 = value === undefined?'':value;});};}};}];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 = value === undefined?'':value;});};}};}];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(){element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');});};}};}];var ngChangeDirective=valueFn({restrict:'A',require:'ngModel',link:function link(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 link(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){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){var classCounts=element.data('$classCounts') || {};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){if(isArray(classVal)){return classVal;}else if(isString(classVal)){return classVal.split(' ');}else if(isObject(classVal)){var classes=[];forEach(classVal,function(v,k){if(v){classes = classes.concat(k.split(' '));}});return classes;}return classVal;}}];}var ngClassDirective=classDirective('',true);var ngClassOddDirective=classDirective('Odd',0);var ngClassEvenDirective=classDirective('Even',1);var ngCloakDirective=ngDirective({compile:function compile(element,attr){attr.$set('ngCloak',undefined);element.removeClass('ng-cloak');}});var ngControllerDirective=[function(){return {restrict:'A',scope:true,controller:'@',priority:500};}];var ngEventDirectives={};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 compile($element,attr){var fn=$parse(attr[directiveName],null,true);return function ngEventHandler(scope,element){element.on(eventName,function(event){var callback=function callback(){fn(scope,{$event:event});};if(forceAsyncEvents[eventName] && $rootScope.$$phase){scope.$evalAsync(callback);}else {scope.$apply(callback);}});};}};}];});var ngIfDirective=['$animate',function($animate){return {multiElement:true,transclude:'element',priority:600,terminal:true,restrict:'A',$$tlb:true,link:function link($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 + ' ');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;}}});}};}];var ngIncludeDirective=['$templateRequest','$anchorScroll','$animate','$sce',function($templateRequest,$anchorScroll,$animate,$sce){return {restrict:'ECA',priority:400,terminal:true,transclude:'element',controller:angular.noop,compile:function compile(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 cleanupLastIncludeContent(){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($sce.parseAsResourceUrl(srcExp),function ngIncludeWatchAction(src){var afterAnimation=function afterAnimation(){if(isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))){$anchorScroll();}};var thisChangeId=++changeCounter;if(src){$templateRequest(src,true).then(function(response){if(thisChangeId !== changeCounter)return;var newScope=scope.$new();ctrl.template = response;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;}});};}};}];var ngIncludeFillContentDirective=['$compile',function($compile){return {restrict:'ECA',priority:-400,require:'ngInclude',link:function link(scope,$element,$attr,ctrl){if(/SVG/.test($element[0].toString())){$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);}};}];var ngInitDirective=ngDirective({priority:450,compile:function compile(){return {pre:function pre(scope,element,attrs){scope.$eval(attrs.ngInit);}};}});var ngListDirective=function ngListDirective(){return {restrict:'A',priority:100,require:'ngModel',link:function link(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList) || ', ';var trimValues=attr.ngTrim !== 'false';var separator=trimValues?trim(ngList):ngList;var parse=function parse(viewValue){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;});ctrl.$isEmpty = function(value){return !value || !value.length;};}};};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=new minErr('ngModel');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;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 = {};this.$$success = {};this.$pending = undefined;this.$name = $interpolate($attr.name || '',false)($scope);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));}};this.$render = noop;this.$isEmpty = function(value){return isUndefined(value) || value === '' || value === null || value !== value;};var parentForm=$element.inheritedData('$formController') || nullFormCtrl,currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function set(object,property){object[property] = true;},unset:function unset(object,property){delete object[property];},parentForm:parentForm,$animate:$animate});this.$setPristine = function(){ctrl.$dirty = false;ctrl.$pristine = true;$animate.removeClass($element,DIRTY_CLASS);$animate.addClass($element,PRISTINE_CLASS);};this.$setDirty = function(){ctrl.$dirty = true;ctrl.$pristine = false;$animate.removeClass($element,PRISTINE_CLASS);$animate.addClass($element,DIRTY_CLASS);parentForm.$setDirty();};this.$setUntouched = function(){ctrl.$touched = false;ctrl.$untouched = true;$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS);};this.$setTouched = function(){ctrl.$touched = true;ctrl.$untouched = false;$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS);};this.$rollbackViewValue = function(){$timeout.cancel(pendingDebounce);ctrl.$viewValue = ctrl.$$lastCommittedViewValue;ctrl.$render();};this.$validate = function(){if(isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)){return;}var viewValue=ctrl.$$lastCommittedViewValue;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(!allowInvalid && prevValid !== allValid){ctrl.$modelValue = allValid?modelValue:undefined;if(ctrl.$modelValue !== prevModelValue){ctrl.$$writeModelToScope();}}});};this.$$runValidators = function(modelValue,viewValue,doneCallback){currentValidationRunId++;var localValidationRunId=currentValidationRunId;if(!processParseErrors()){validationDone(false);return;}if(!processSyncValidators()){validationDone(false);return;}processAsyncValidators();function processParseErrors(){var errorKey=ctrl.$$parserName || 'parse';if(parserValid === undefined){setValidity(errorKey,null);}else {if(!parserValid){forEach(ctrl.$validators,function(v,name){setValidity(name,null);});forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null);});}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);}}};this.$commitViewValue = function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce);if(ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)){return;}ctrl.$$lastCommittedViewValue = viewValue;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 = ngModelGet($scope);}var prevModelValue=ctrl.$modelValue;var allowInvalid=ctrl.$options && ctrl.$options.allowInvalid;ctrl.$$rawModelValue = modelValue;if(allowInvalid){ctrl.$modelValue = modelValue;writeToModelIfNeeded();}ctrl.$$runValidators(modelValue,ctrl.$$lastCommittedViewValue,function(allValid){if(!allowInvalid){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);}});};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();});}};$scope.$watch(function ngModelWatch(){var modelValue=ngModelGet($scope);if(modelValue !== ctrl.$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;});}];var ngModelDirective=['$rootScope',function($rootScope){return {restrict:'A',require:['ngModel','^?form','^?ngModelOptions'],controller:NgModelController,priority:1,compile:function ngModelCompile(element){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] || nullFormCtrl;modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);formCtrl.$addControl(modelCtrl);attr.$observe('name',function(newValue){if(modelCtrl.$name !== newValue){formCtrl.$$renameControl(modelCtrl,newValue);}});scope.$on('$destroy',function(){formCtrl.$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+|$)/;var ngModelOptionsDirective=function ngModelOptionsDirective(){return {restrict:'A',controller:['$scope','$attrs',function($scope,$attrs){var that=this;this.$options = $scope.$eval($attrs.ngModelOptions);if(this.$options.updateOn !== undefined){this.$options.updateOnDefault = false;this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP,function(){that.$options.updateOnDefault = true;return ' ';}));}else {this.$options.updateOnDefault = true;}}]};};function addSetValidityMethod(context){var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,parentForm=context.parentForm,$animate=context.$animate;classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));ctrl.$setValidity = setValidity;function setValidity(validationErrorKey,state,controller){if(state === undefined){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);}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);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) {return false;}}return true;}var ngNonBindableDirective=ngDirective({terminal:true,priority:1000});var ngPluralizeDirective=['$locale','$interpolate',function($locale,$interpolate){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return {restrict:'EA',link:function link(scope,element,attr){var numberExp=attr.count,whenExp=attr.$attr.when && element.attr(attr.$attr.when),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)){count = $locale.pluralCat(count - offset);}if(count !== lastCount && !(countIsNaN && isNaN(lastCount))){watchRemover();watchRemover = scope.$watch(whensExpFns[count],updateElementText);lastCount = count;}});function updateElementText(newText){element.text(newText || '');}}};}];var ngRepeatDirective=['$parse','$animate',function($parse,$animate){var NG_REMOVED='$$NG_REMOVED';var ngRepeatMinErr=minErr('ngRepeat');var updateScope=function updateScope(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){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);scope.$odd = !(scope.$even = (index & 1) === 0);};var getBlockStart=function getBlockStart(block){return block.clone[0];};var getBlockEnd=function getBlockEnd(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){if(keyIdentifier)hashFnLocals[keyIdentifier] = key;hashFnLocals[valueIdentifier] = value;hashFnLocals.$index = index;return trackByExpGetter($scope,hashFnLocals);};}var lastBlockMap=createMap();$scope.$watchCollection(rhs,function ngRepeatAction(collection){var index,length,previousNode=$element[0],nextNode,nextBlockMap=createMap(),collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove;if(aliasAs){$scope[aliasAs] = collection;}if(isArrayLike(collection)){collectionKeys = collection;trackByIdFn = trackByIdExpFn || trackByIdArrayFn;}else {trackByIdFn = trackByIdExpFn || trackByIdObjFn;collectionKeys = [];for(var itemKey in collection) {if(collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$'){collectionKeys.push(itemKey);}}collectionKeys.sort();}collectionLength = collectionKeys.length;nextBlockOrder = new Array(collectionLength);for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];trackById = trackByIdFn(key,value,index);if(lastBlockMap[trackById]){block = lastBlockMap[trackById];delete lastBlockMap[trackById];nextBlockMap[trackById] = block;nextBlockOrder[index] = block;}else if(nextBlockMap[trackById]){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 {nextBlockOrder[index] = {id:trackById,scope:undefined,clone:undefined};nextBlockMap[trackById] = true;}}for(var blockKey in lastBlockMap) {block = lastBlockMap[blockKey];elementsToRemove = getBlockNodes(block.clone);$animate.leave(elementsToRemove);if(elementsToRemove[0].parentNode){for(index = 0,length = elementsToRemove.length;index < length;index++) {elementsToRemove[index][NG_REMOVED] = true;}}block.scope.$destroy();}for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];block = nextBlockOrder[index];if(block.scope){nextNode = previousNode;do {nextNode = nextNode.nextSibling;}while(nextNode && nextNode[NG_REMOVED]);if(getBlockStart(block) != nextNode){$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode));}previousNode = getBlockEnd(block);updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength);}else {$transclude(function ngRepeatTransclude(clone,scope){block.scope = scope;var endNode=ngRepeatEndComment.cloneNode(false);clone[clone.length++] = endNode;$animate.enter(clone,null,jqLite(previousNode));previousNode = endNode;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';var ngShowDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngShow,function ngShowWatchAction(value){$animate[value?'removeClass':'addClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngHideDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngHide,function ngHideWatchAction(value){$animate[value?'addClass':'removeClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngStyleDirective=ngDirective(function(scope,element,attr){scope.$watchCollection(attr.ngStyle,function ngStyleWatchAction(newStyles,oldStyles){if(oldStyles && newStyles !== oldStyles){forEach(oldStyles,function(val,style){element.css(style,'');});}if(newStyles)element.css(newStyles);});});var ngSwitchDirective=['$animate',function($animate){return {restrict:'EA',require:'ngSwitch',controller:['$scope',function ngSwitchController(){this.cases = {};}],link:function link(scope,element,attr,ngSwitchController){var watchExpr=attr.ngSwitch || attr.on,selectedTranscludes=[],selectedElements=[],previousLeaveAnimations=[],selectedScopes=[];var spliceFactory=function spliceFactory(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 link(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 link(scope,element,attr,ctrl,$transclude){ctrl.cases['?'] = ctrl.cases['?'] || [];ctrl.cases['?'].push({transclude:$transclude,element:element});}});var ngTranscludeDirective=ngDirective({restrict:'EAC',link:function link($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);});}});var scriptDirective=['$templateCache',function($templateCache){return {restrict:'E',terminal:true,compile:function compile(element,attr){if(attr.type == 'text/ng-template'){var templateUrl=attr.id,text=element[0].text;$templateCache.put(templateUrl,text);}}};}];var ngOptionsMinErr=minErr('ngOptions');var ngOptionsDirective=valueFn({restrict:'A',terminal:true});var selectDirective=['$compile','$parse',function($compile,$parse){var NG_OPTIONS_REGEXP=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,nullModelCtrl={$setViewValue:noop};return {restrict:'E',require:['select','?ngModel'],controller:['$element','$scope','$attrs',function($element,$scope,$attrs){var self=this,optionsMap={},ngModelCtrl=nullModelCtrl,nullOption,unknownOption;self.databound = $attrs.ngModel;self.init = function(ngModelCtrl_,nullOption_,unknownOption_){ngModelCtrl = ngModelCtrl_;nullOption = nullOption_;unknownOption = unknownOption_;};self.addOption = function(value,element){assertNotHasOwnProperty(value,'"option value"');optionsMap[value] = true;if(ngModelCtrl.$viewValue == value){$element.val(value);if(unknownOption.parent())unknownOption.remove();}if(element && element[0].hasAttribute('selected')){element[0].selected = true;}};self.removeOption = function(value){if(this.hasOption(value)){delete optionsMap[value];if(ngModelCtrl.$viewValue === value){this.renderUnknownOption(value);}}};self.renderUnknownOption = function(val){var unknownVal='? ' + hashKey(val) + ' ?';unknownOption.val(unknownVal);$element.prepend(unknownOption);$element.val(unknownVal);unknownOption.prop('selected',true);};self.hasOption = function(value){return optionsMap.hasOwnProperty(value);};$scope.$on('$destroy',function(){self.renderUnknownOption = noop;});}],link:function link(scope,element,attr,ctrls){if(!ctrls[1])return;var selectCtrl=ctrls[0],ngModelCtrl=ctrls[1],multiple=attr.multiple,optionsExp=attr.ngOptions,nullOption=false,emptyOption,renderScheduled=false,optionTemplate=jqLite(document.createElement('option')),optGroupTemplate=jqLite(document.createElement('optgroup')),unknownOption=optionTemplate.clone();for(var i=0,children=element.children(),ii=children.length;i < ii;i++) {if(children[i].value === ''){emptyOption = nullOption = children.eq(i);break;}}selectCtrl.init(ngModelCtrl,nullOption,unknownOption);if(multiple){ngModelCtrl.$isEmpty = function(value){return !value || value.length === 0;};}if(optionsExp)setupAsOptions(scope,element,ngModelCtrl);else if(multiple)setupAsMultiple(scope,element,ngModelCtrl);else setupAsSingle(scope,element,ngModelCtrl,selectCtrl);function setupAsSingle(scope,selectElement,ngModelCtrl,selectCtrl){ngModelCtrl.$render = function(){var viewValue=ngModelCtrl.$viewValue;if(selectCtrl.hasOption(viewValue)){if(unknownOption.parent())unknownOption.remove();selectElement.val(viewValue);if(viewValue === '')emptyOption.prop('selected',true);}else {if(isUndefined(viewValue) && emptyOption){selectElement.val('');}else {selectCtrl.renderUnknownOption(viewValue);}}};selectElement.on('change',function(){scope.$apply(function(){if(unknownOption.parent())unknownOption.remove();ngModelCtrl.$setViewValue(selectElement.val());});});}function setupAsMultiple(scope,selectElement,ctrl){var lastView;ctrl.$render = function(){var items=new HashMap(ctrl.$viewValue);forEach(selectElement.find('option'),function(option){option.selected = isDefined(items.get(option.value));});};scope.$watch(function selectMultipleWatch(){if(!equals(lastView,ctrl.$viewValue)){lastView = shallowCopy(ctrl.$viewValue);ctrl.$render();}});selectElement.on('change',function(){scope.$apply(function(){var array=[];forEach(selectElement.find('option'),function(option){if(option.selected){array.push(option.value);}});ctrl.$setViewValue(array);});});}function setupAsOptions(scope,selectElement,ctrl){var match;if(!(match = optionsExp.match(NG_OPTIONS_REGEXP))){throw ngOptionsMinErr('iexp','Expected expression in form of ' + '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' + ' but got \'{0}\'. Element: {1}',optionsExp,startingTag(selectElement));}var displayFn=$parse(match[2] || match[1]),valueName=match[4] || match[6],selectAs=/ as /.test(match[0]) && match[1],selectAsFn=selectAs?$parse(selectAs):null,keyName=match[5],groupByFn=$parse(match[3] || ''),valueFn=$parse(match[2]?match[1]:valueName),valuesFn=$parse(match[7]),track=match[8],trackFn=track?$parse(match[8]):null,trackKeysCache={},optionGroupsCache=[[{element:selectElement,label:''}]],locals={};if(nullOption){$compile(nullOption)(scope);nullOption.removeClass('ng-scope');nullOption.remove();}selectElement.empty();selectElement.on('change',selectionChanged);ctrl.$render = render;scope.$watchCollection(valuesFn,scheduleRendering);scope.$watchCollection(getLabels,scheduleRendering);if(multiple){scope.$watchCollection(function(){return ctrl.$modelValue;},scheduleRendering);}function callExpression(exprFn,key,value){locals[valueName] = value;if(keyName)locals[keyName] = key;return exprFn(scope,locals);}function selectionChanged(){scope.$apply(function(){var collection=valuesFn(scope) || [];var viewValue;if(multiple){viewValue = [];forEach(selectElement.val(),function(selectedKey){selectedKey = trackFn?trackKeysCache[selectedKey]:selectedKey;viewValue.push(getViewValue(selectedKey,collection[selectedKey]));});}else {var selectedKey=trackFn?trackKeysCache[selectElement.val()]:selectElement.val();viewValue = getViewValue(selectedKey,collection[selectedKey]);}ctrl.$setViewValue(viewValue);render();});}function getViewValue(key,value){if(key === '?'){return undefined;}else if(key === ''){return null;}else {var viewValueFn=selectAsFn?selectAsFn:valueFn;return callExpression(viewValueFn,key,value);}}function getLabels(){var values=valuesFn(scope);var toDisplay;if(values && isArray(values)){toDisplay = new Array(values.length);for(var i=0,ii=values.length;i < ii;i++) {toDisplay[i] = callExpression(displayFn,i,values[i]);}return toDisplay;}else if(values){toDisplay = {};for(var prop in values) {if(values.hasOwnProperty(prop)){toDisplay[prop] = callExpression(displayFn,prop,values[prop]);}}}return toDisplay;}function createIsSelectedFn(viewValue){var selectedSet;if(multiple){if(trackFn && isArray(viewValue)){selectedSet = new HashMap([]);for(var trackIndex=0;trackIndex < viewValue.length;trackIndex++) {selectedSet.put(callExpression(trackFn,null,viewValue[trackIndex]),true);}}else {selectedSet = new HashMap(viewValue);}}else if(trackFn){viewValue = callExpression(trackFn,null,viewValue);}return function isSelected(key,value){var compareValueFn;if(trackFn){compareValueFn = trackFn;}else if(selectAsFn){compareValueFn = selectAsFn;}else {compareValueFn = valueFn;}if(multiple){return isDefined(selectedSet.remove(callExpression(compareValueFn,key,value)));}else {return viewValue === callExpression(compareValueFn,key,value);}};}function scheduleRendering(){if(!renderScheduled){scope.$$postDigest(render);renderScheduled = true;}}function updateLabelMap(labelMap,label,added){labelMap[label] = labelMap[label] || 0;labelMap[label] += added?1:-1;}function render(){renderScheduled = false;var optionGroups={'':[]},optionGroupNames=[''],optionGroupName,optionGroup,option,existingParent,existingOptions,existingOption,viewValue=ctrl.$viewValue,values=valuesFn(scope) || [],keys=keyName?sortedKeys(values):values,key,value,groupLength,length,groupIndex,index,labelMap={},selected,isSelected=createIsSelectedFn(viewValue),anySelected=false,lastElement,element,label,optionId;trackKeysCache = {};for(index = 0;length = keys.length,index < length;index++) {key = index;if(keyName){key = keys[index];if(key.charAt(0) === '$')continue;}value = values[key];optionGroupName = callExpression(groupByFn,key,value) || '';if(!(optionGroup = optionGroups[optionGroupName])){optionGroup = optionGroups[optionGroupName] = [];optionGroupNames.push(optionGroupName);}selected = isSelected(key,value);anySelected = anySelected || selected;label = callExpression(displayFn,key,value);label = isDefined(label)?label:'';optionId = trackFn?trackFn(scope,locals):keyName?keys[index]:index;if(trackFn){trackKeysCache[optionId] = key;}optionGroup.push({id:optionId,label:label,selected:selected});}if(!multiple){if(nullOption || viewValue === null){optionGroups[''].unshift({id:'',label:'',selected:!anySelected});}else if(!anySelected){optionGroups[''].unshift({id:'?',label:'',selected:true});}}for(groupIndex = 0,groupLength = optionGroupNames.length;groupIndex < groupLength;groupIndex++) {optionGroupName = optionGroupNames[groupIndex];optionGroup = optionGroups[optionGroupName];if(optionGroupsCache.length <= groupIndex){existingParent = {element:optGroupTemplate.clone().attr('label',optionGroupName),label:optionGroup.label};existingOptions = [existingParent];optionGroupsCache.push(existingOptions);selectElement.append(existingParent.element);}else {existingOptions = optionGroupsCache[groupIndex];existingParent = existingOptions[0];if(existingParent.label != optionGroupName){existingParent.element.attr('label',existingParent.label = optionGroupName);}}lastElement = null;for(index = 0,length = optionGroup.length;index < length;index++) {option = optionGroup[index];if(existingOption = existingOptions[index + 1]){lastElement = existingOption.element;if(existingOption.label !== option.label){updateLabelMap(labelMap,existingOption.label,false);updateLabelMap(labelMap,option.label,true);lastElement.text(existingOption.label = option.label);lastElement.prop('label',existingOption.label);}if(existingOption.id !== option.id){lastElement.val(existingOption.id = option.id);}if(lastElement[0].selected !== option.selected){lastElement.prop('selected',existingOption.selected = option.selected);if(msie){lastElement.prop('selected',existingOption.selected);}}}else {if(option.id === '' && nullOption){element = nullOption;}else {(element = optionTemplate.clone()).val(option.id).prop('selected',option.selected).attr('selected',option.selected).prop('label',option.label).text(option.label);}existingOptions.push(existingOption = {element:element,label:option.label,id:option.id,selected:option.selected});updateLabelMap(labelMap,option.label,true);if(lastElement){lastElement.after(element);}else {existingParent.element.append(element);}lastElement = element;}}index++;while(existingOptions.length > index) {option = existingOptions.pop();updateLabelMap(labelMap,option.label,false);option.element.remove();}}while(optionGroupsCache.length > groupIndex) {optionGroup = optionGroupsCache.pop();for(index = 1;index < optionGroup.length;++index) {updateLabelMap(labelMap,optionGroup[index].label,false);}optionGroup[0].element.remove();}forEach(labelMap,function(count,label){if(count > 0){selectCtrl.addOption(label);}else if(count < 0){selectCtrl.removeOption(label);}});}}}};}];var optionDirective=['$interpolate',function($interpolate){var nullSelectCtrl={addOption:noop,removeOption:noop};return {restrict:'E',priority:100,compile:function compile(element,attr){if(isUndefined(attr.value)){var interpolateFn=$interpolate(element.text(),true);if(!interpolateFn){attr.$set('value',element.text());}}return function(scope,element,attr){var selectCtrlName='$selectController',parent=element.parent(),selectCtrl=parent.data(selectCtrlName) || parent.parent().data(selectCtrlName);if(!selectCtrl || !selectCtrl.databound){selectCtrl = nullSelectCtrl;}if(interpolateFn){scope.$watch(interpolateFn,function interpolateWatchAction(newVal,oldVal){attr.$set('value',newVal);if(oldVal !== newVal){selectCtrl.removeOption(oldVal);}selectCtrl.addOption(newVal,element);});}else {selectCtrl.addOption(attr.value,element);}element.on('$destroy',function(){selectCtrl.removeOption(attr.value);});};}};}];var styleDirective=valueFn({restrict:'E',terminal:false});var requiredDirective=function requiredDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;attr.required = true;ctrl.$validators.required = function(modelValue,viewValue){return !attr.required || !ctrl.$isEmpty(viewValue);};attr.$observe('required',function(){ctrl.$validate();});}};};var patternDirective=function patternDirective(){return {restrict:'A',require:'?ngModel',link:function link(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(value){return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);};}};};var maxlengthDirective=function maxlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var maxlength=-1;attr.$observe('maxlength',function(value){var intVal=int(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 minlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var minlength=0;attr.$observe('minlength',function(value){minlength = int(value) || 0;ctrl.$validate();});ctrl.$validators.minlength = function(modelValue,viewValue){return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;};}};};if(window.angular.bootstrap){console.log('WARNING: Tried to load angular more than once.');return;}bindJQuery();publishExternalAPI(angular);jqLite(document).ready(function(){angularInit(document,bootstrap);});})(window,document);!window.angular.$$csp() && window.angular.element(document).find('head').prepend(''); + +/***/ }, +/* 5 */ +/***/ function(module, exports, __webpack_require__) { + + (function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define(factory);else if(typeof exports === 'object')exports['JSData'] = factory();else root['JSData'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _datastoreIndex=__webpack_require__(1);var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);module.exports = {DS:_datastoreIndex['default'],DSUtils:_utils['default'],DSErrors:_errors['default'],createStore:function createStore(options){return new _datastoreIndex['default'](options);},version:{full:'2.0.0-rc.1',major:parseInt('2',10),minor:parseInt('0',10),patch:parseInt('0',10),alpha:true?'false':false,beta:true?'false':false}};},function(module,exports,__webpack_require__){var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _sync_methodsIndex=__webpack_require__(4);var _async_methodsIndex=__webpack_require__(5);function lifecycleNoopCb(resource,attrs,cb){cb(null,attrs);}function lifecycleNoop(resource,attrs){return attrs;}function compare(_x,_x2,_x3,_x4){var _again=true;_function: while(_again) {var orderBy=_x,index=_x2,a=_x3,b=_x4;def = cA = cB = undefined;_again = false;var def=orderBy[index];var cA=_utils['default'].get(a,def[0]),cB=_utils['default'].get(b,def[0]);if(_utils['default']._s(cA)){cA = _utils['default'].upperCase(cA);}if(_utils['default']._s(cB)){cB = _utils['default'].upperCase(cB);}if(def[1] === 'DESC'){if(cB < cA){return -1;}else if(cB > cA){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}else {if(cA < cB){return -1;}else if(cA > cB){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}}}var Defaults=(function(){function Defaults(){_classCallCheck(this,Defaults);}_createClass(Defaults,[{key:'errorFn',value:function errorFn(a,b){if(this.error && typeof this.error === 'function'){try{if(typeof a === 'string'){throw new Error(a);}else {throw a;}}catch(err) {a = err;}this.error(this.name || null,a || null,b || null);}}}]);return Defaults;})();var defaultsPrototype=Defaults.prototype;defaultsPrototype.actions = {};defaultsPrototype.afterCreate = lifecycleNoopCb;defaultsPrototype.afterCreateCollection = lifecycleNoop;defaultsPrototype.afterCreateInstance = lifecycleNoop;defaultsPrototype.afterDestroy = lifecycleNoopCb;defaultsPrototype.afterEject = lifecycleNoop;defaultsPrototype.afterInject = lifecycleNoop;defaultsPrototype.afterReap = lifecycleNoop;defaultsPrototype.afterUpdate = lifecycleNoopCb;defaultsPrototype.afterValidate = lifecycleNoopCb;defaultsPrototype.allowSimpleWhere = true;defaultsPrototype.basePath = '';defaultsPrototype.beforeCreate = lifecycleNoopCb;defaultsPrototype.beforeCreateCollection = lifecycleNoop;defaultsPrototype.beforeCreateInstance = lifecycleNoop;defaultsPrototype.beforeDestroy = lifecycleNoopCb;defaultsPrototype.beforeEject = lifecycleNoop;defaultsPrototype.beforeInject = lifecycleNoop;defaultsPrototype.beforeReap = lifecycleNoop;defaultsPrototype.beforeUpdate = lifecycleNoopCb;defaultsPrototype.beforeValidate = lifecycleNoopCb;defaultsPrototype.bypassCache = false;defaultsPrototype.cacheResponse = !!_utils['default'].w;defaultsPrototype.clearEmptyQueries = true;defaultsPrototype.computed = {};defaultsPrototype.defaultAdapter = 'http';defaultsPrototype.debug = false;defaultsPrototype.defaultValues = {};defaultsPrototype.eagerEject = false;defaultsPrototype.eagerInject = false;defaultsPrototype.endpoint = '';defaultsPrototype.error = console?function(a,b,c){return console[typeof console.error === 'function'?'error':'log'](a,b,c);}:false;defaultsPrototype.instanceEvents = !!_utils['default'].w;defaultsPrototype.fallbackAdapters = ['http'];defaultsPrototype.findStrictCache = false;defaultsPrototype.idAttribute = 'id';defaultsPrototype.ignoredChanges = [/\$/];defaultsPrototype.ignoreMissing = false;defaultsPrototype.keepChangeHistory = false;defaultsPrototype.linkRelations = true;defaultsPrototype.log = console?function(a,b,c,d,e){return console[typeof console.info === 'function'?'info':'log'](a,b,c,d,e);}:false;defaultsPrototype.logFn = function(a,b,c,d){var _this=this;if(_this.debug && _this.log && typeof _this.log === 'function'){_this.log(_this.name || null,a || null,b || null,c || null,d || null);}};defaultsPrototype.maxAge = false;defaultsPrototype.methods = {};defaultsPrototype.notify = !!_utils['default'].w;defaultsPrototype.omit = [];defaultsPrototype.onConflict = 'merge';defaultsPrototype.reapAction = !!_utils['default'].w?'inject':'none';defaultsPrototype.reapInterval = !!_utils['default'].w?30000:false;defaultsPrototype.relationsEnumerable = false;defaultsPrototype.returnMeta = false;defaultsPrototype.resetHistoryOnInject = true;defaultsPrototype.strategy = 'single';defaultsPrototype.upsert = !!_utils['default'].w;defaultsPrototype.useClass = true;defaultsPrototype.useFilter = false;defaultsPrototype.validate = lifecycleNoopCb;defaultsPrototype.defaultFilter = function(collection,resourceName,params,options){var filtered=collection;var where=null;var reserved={skip:'',offset:'',where:'',limit:'',orderBy:'',sort:''};params = params || {};options = options || {};if(_utils['default']._o(params.where)){where = params.where;}else {where = {};}if(options.allowSimpleWhere){_utils['default'].forOwn(params,function(value,key){if(!(key in reserved) && !(key in where)){where[key] = {'==':value};}});}if(_utils['default'].isEmpty(where)){where = null;}if(where){filtered = _utils['default'].filter(filtered,function(attrs){var first=true;var keep=true;_utils['default'].forOwn(where,function(clause,field){if(!_utils['default']._o(clause)){clause = {'==':clause};}_utils['default'].forOwn(clause,function(term,op){var expr=undefined;var isOr=op[0] === '|';var val=_utils['default'].get(attrs,field);op = isOr?op.substr(1):op;if(op === '=='){expr = val == term;}else if(op === '==='){expr = val === term;}else if(op === '!='){expr = val != term;}else if(op === '!=='){expr = val !== term;}else if(op === '>'){expr = val > term;}else if(op === '>='){expr = val >= term;}else if(op === '<'){expr = val < term;}else if(op === '<='){expr = val <= term;}else if(op === 'isectEmpty'){expr = !_utils['default'].intersection(val || [],term || []).length;}else if(op === 'isectNotEmpty'){expr = _utils['default'].intersection(val || [],term || []).length;}else if(op === 'in'){if(_utils['default']._s(term)){expr = term.indexOf(val) !== -1;}else {expr = _utils['default'].contains(term,val);}}else if(op === 'notIn'){if(_utils['default']._s(term)){expr = term.indexOf(val) === -1;}else {expr = !_utils['default'].contains(term,val);}}else if(op === 'contains'){if(_utils['default']._s(val)){expr = val.indexOf(term) !== -1;}else {expr = _utils['default'].contains(val,term);}}else if(op === 'notContains'){if(_utils['default']._s(val)){expr = val.indexOf(term) === -1;}else {expr = !_utils['default'].contains(val,term);}}if(expr !== undefined){keep = first?expr:isOr?keep || expr:keep && expr;}first = false;});});return keep;});}var orderBy=null;if(_utils['default']._s(params.orderBy)){orderBy = [[params.orderBy,'ASC']];}else if(_utils['default']._a(params.orderBy)){orderBy = params.orderBy;}if(!orderBy && _utils['default']._s(params.sort)){orderBy = [[params.sort,'ASC']];}else if(!orderBy && _utils['default']._a(params.sort)){orderBy = params.sort;}if(orderBy){(function(){var index=0;_utils['default'].forEach(orderBy,function(def,i){if(_utils['default']._s(def)){orderBy[i] = [def,'ASC'];}else if(!_utils['default']._a(def)){throw new _errors['default'].IA('DS.filter("' + resourceName + '"[, params][, options]): ' + _utils['default'].toJson(def) + ': Must be a string or an array!',{params:{'orderBy[i]':{actual:typeof def,expected:'string|array'}}});}});filtered = _utils['default'].sort(filtered,function(a,b){return compare(orderBy,index,a,b);});})();}var limit=_utils['default']._n(params.limit)?params.limit:null;var skip=null;if(_utils['default']._n(params.skip)){skip = params.skip;}else if(_utils['default']._n(params.offset)){skip = params.offset;}if(limit && skip){filtered = _utils['default'].slice(filtered,skip,Math.min(filtered.length,skip + limit));}else if(_utils['default']._n(limit)){filtered = _utils['default'].slice(filtered,0,Math.min(filtered.length,limit));}else if(_utils['default']._n(skip)){if(skip < filtered.length){filtered = _utils['default'].slice(filtered,skip);}else {filtered = [];}}return filtered;};var DS=(function(){function DS(options){_classCallCheck(this,DS);var _this=this;options = options || {};_this.store = {};_this.s = _this.store;_this.definitions = {};_this.defs = _this.definitions;_this.adapters = {};_this.defaults = new Defaults();_this.observe = _utils['default'].observe;_utils['default'].forOwn(options,function(v,k){if(k === 'omit'){_this.defaults.omit = v.concat(Defaults.prototype.omit);}else {_this.defaults[k] = v;}});_this.defaults.logFn('new data store created',_this.defaults);var P=_utils['default'].Promise;if(P && !P.prototype.spread){P.prototype.spread = function(cb){return this.then(function(arr){return cb.apply(this,arr);});};}}_createClass(DS,[{key:'getAdapterName',value:function getAdapterName(options){var errorIfNotExist=false;options = options || {};this.defaults.logFn('getAdapterName',options);if(_utils['default']._s(options)){errorIfNotExist = true;options = {adapter:options};}if(this.adapters[options.adapter]){return options.adapter;}else if(errorIfNotExist){throw new Error(options.adapter + ' is not a registered adapter!');}else {return options.defaultAdapter;}}},{key:'getAdapter',value:function getAdapter(options){options = options || {};this.defaults.logFn('getAdapter',options);return this.adapters[this.getAdapterName(options)];}},{key:'registerAdapter',value:function registerAdapter(name,Adapter,options){var _this=this;options = options || {};_this.defaults.logFn('registerAdapter',name,Adapter,options);if(_utils['default'].isFunction(Adapter)){_this.adapters[name] = new Adapter(options);}else {_this.adapters[name] = Adapter;}if(options['default']){_this.defaults.defaultAdapter = name;}_this.defaults.logFn('default adapter is ' + _this.defaults.defaultAdapter);}},{key:'is',value:function is(resourceName,instance){var definition=this.defs[resourceName];if(!definition){throw new _errors['default'].NER(resourceName);}return instance instanceof definition[definition['class']];}}]);return DS;})();var dsPrototype=DS.prototype;dsPrototype.getAdapterName.shorthand = false;dsPrototype.getAdapter.shorthand = false;dsPrototype.registerAdapter.shorthand = false;dsPrototype.errors = _errors['default'];dsPrototype.utils = _utils['default'];function addMethods(target,obj){_utils['default'].forOwn(obj,function(v,k){target[k] = v;target[k].before = function(fn){var orig=target[k];target[k] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}return orig.apply(this,fn.apply(this,args) || args);};};});}addMethods(dsPrototype,_sync_methodsIndex['default']);addMethods(dsPrototype,_async_methodsIndex['default']);exports['default'] = DS;},function(module,exports,__webpack_require__){function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}var _errors=__webpack_require__(3);var BinaryHeap=__webpack_require__(7);var forEach=__webpack_require__(8);var slice=__webpack_require__(9);var forOwn=__webpack_require__(13);var contains=__webpack_require__(10);var deepMixIn=__webpack_require__(14);var pascalCase=__webpack_require__(18);var remove=__webpack_require__(11);var pick=__webpack_require__(15);var sort=__webpack_require__(12);var upperCase=__webpack_require__(19);var get=__webpack_require__(16);var set=__webpack_require__(17);var observe=__webpack_require__(6);var w=undefined;var objectProto=Object.prototype;var toString=objectProto.toString;var P=undefined;try{P = Promise;}catch(err) {console.error('js-data requires a global Promise constructor!');}var isArray=Array.isArray || function isArray(value){return toString.call(value) == '[object Array]' || false;};var isRegExp=function isRegExp(value){return toString.call(value) == '[object RegExp]' || false;};var isString=function isString(value){return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == '[object String]' || false;};var isObject=function isObject(value){return toString.call(value) == '[object Object]' || false;};var isDate=function isDate(value){return value && typeof value == 'object' && toString.call(value) == '[object Date]' || false;};var isNumber=function isNumber(value){var type=typeof value;return type == 'number' || value && type == 'object' && toString.call(value) == '[object Number]' || false;};var isFunction=function isFunction(value){return typeof value == 'function' || value && toString.call(value) === '[object Function]' || false;};var isStringOrNumber=function isStringOrNumber(value){return isString(value) || isNumber(value);};var isStringOrNumberErr=function isStringOrNumberErr(field){return new _errors['default'].IA('"' + field + '" must be a string or a number!');};var isObjectErr=function isObjectErr(field){return new _errors['default'].IA('"' + field + '" must be an object!');};var isArrayErr=function isArrayErr(field){return new _errors['default'].IA('"' + field + '" must be an array!');};var isEmpty=function isEmpty(val){if(val == null){return true;}else if(typeof val === 'string' || isArray(val)){return !val.length;}else if(typeof val === 'object'){var result=true;forOwn(val,function(){result = false;return false;});return result;}else {return true;}};var intersection=function intersection(array1,array2){if(!array1 || !array2){return [];}var result=[];var item=undefined;for(var i=0,_length=array1.length;i < _length;i++) {item = array1[i];if(contains(result,item)){continue;}if(contains(array2,item)){result.push(item);}}return result;};var filter=function filter(array,cb,thisObj){var results=[];forEach(array,function(value,key,arr){if(cb(value,key,arr)){results.push(value);}},thisObj);return results;};try{w = window;w = {};}catch(e) {w = null;}function Events(target){var events={};target = target || this;target.on = function(type,func,ctx){events[type] = events[type] || [];events[type].push({f:func,c:ctx});};target.off = function(type,func){var listeners=events[type];if(!listeners){events = {};}else if(func){for(var i=0;i < listeners.length;i++) {if(listeners[i] === func){listeners.splice(i,1);break;}}}else {listeners.splice(0,listeners.length);}};target.emit = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}var listeners=events[args.shift()] || [];if(listeners){for(var i=0;i < listeners.length;i++) {listeners[i].f.apply(listeners[i].c,args);}}};}var toPromisify=['beforeValidate','validate','afterValidate','beforeCreate','afterCreate','beforeUpdate','afterUpdate','beforeDestroy','afterDestroy'];var isBlacklisted=observe.isBlacklisted;var copy=function copy(source,destination,stackSource,stackDest,blacklist){if(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest,blacklist);}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(isObject(source)){destination = copy(source,Object.create(Object.getPrototypeOf(source)),stackSource,stackDest,blacklist);}}}else {if(source === destination){throw new Error('Cannot copy! Source and destination are identical.');}stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1){return stackDest[index];}stackSource.push(source);stackDest.push(destination);}var result=undefined;if(isArray(source)){var i=undefined;destination.length = 0;for(i = 0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest,blacklist);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){if(isBlacklisted(key,blacklist)){continue;}result = copy(source[key],null,stackSource,stackDest,blacklist);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}}}return destination;};var equals=function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2){return true;}if(o1 === null || o2 === null){return false;}if(o1 !== o1 && o2 !== o2){return true;}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;}_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}else if(isRegExp(o1) && isRegExp(o2)){return o1.toString() == o2.toString();}else {if(isArray(o2)){return false;}keySet = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key])){return false;}}return true;}}}return false;}};var resolveId=function resolveId(definition,idOrInstance){if(isString(idOrInstance) || isNumber(idOrInstance)){return idOrInstance;}else if(idOrInstance && definition){return idOrInstance[definition.idAttribute] || idOrInstance;}else {return idOrInstance;}};var resolveItem=function resolveItem(resource,idOrInstance){if(resource && (isString(idOrInstance) || isNumber(idOrInstance))){return resource.index[idOrInstance] || idOrInstance;}else {return idOrInstance;}};var isValidString=function isValidString(val){return val != null && val !== '';};var join=function join(items,separator){separator = separator || '';return filter(items,isValidString).join(separator);};var makePath=function makePath(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}var result=join(args,'/');return result.replace(/([^:\/]|^)\/{2,}/g,'$1/');};exports['default'] = {Promise:P,_:function _(parent,options){var _this=this;options = options || {};if(options && options.constructor === parent.constructor){return options;}else if(!isObject(options)){throw new _errors['default'].IA('"options" must be an object!');}forEach(toPromisify,function(name){if(typeof options[name] === 'function' && options[name].toString().indexOf('for (var _len = arg') === -1){options[name] = _this.promisify(options[name]);}});var O=function Options(attrs){var self=this;forOwn(attrs,function(value,key){self[key] = value;});};O.prototype = parent;O.prototype.orig = function(){var orig={};forOwn(this,function(value,key){orig[key] = value;});return orig;};return new O(options);},_n:isNumber,_s:isString,_sn:isStringOrNumber,_snErr:isStringOrNumberErr,_o:isObject,_oErr:isObjectErr,_a:isArray,_aErr:isArrayErr,compute:function compute(fn,field){var _this=this;var args=[];forEach(fn.deps,function(dep){args.push(get(_this,dep));});set(_this,field,fn[fn.length - 1].apply(_this,args));},contains:contains,copy:copy,deepMixIn:deepMixIn,diffObjectFromOldObject:observe.diffObjectFromOldObject,BinaryHeap:BinaryHeap,equals:equals,Events:Events,filter:filter,fillIn:function fillIn(target,obj){forOwn(obj,function(v,k){if(!(k in target)){target[k] = v;}});return target;},forEach:forEach,forOwn:forOwn,fromJson:function fromJson(json){return isString(json)?JSON.parse(json):json;},get:get,intersection:intersection,isArray:isArray,isBlacklisted:isBlacklisted,isEmpty:isEmpty,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isString:isString,makePath:makePath,observe:observe,omit:function omit(obj,bl){var toRemove=[];forOwn(obj,function(v,k){if(isBlacklisted(k,bl)){toRemove.push(k);}});forEach(toRemove,function(k){delete obj[k];});return obj;},pascalCase:pascalCase,pick:pick,promisify:function promisify(fn,target){var _this=this;if(!fn){return;}else if(typeof fn !== 'function'){throw new Error('Can only promisify functions!');}return function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}return new _this.Promise(function(resolve,reject){args.push(function(err,result){if(err){reject(err);}else {resolve(result);}});try{var promise=fn.apply(target || this,args);if(promise && promise.then){promise.then(resolve,reject);}}catch(err) {reject(err);}});};},remove:remove,set:set,slice:slice,sort:sort,toJson:JSON.stringify,updateTimestamp:function updateTimestamp(timestamp){var newTimestamp=typeof Date.now === 'function'?Date.now():new Date().getTime();if(timestamp && newTimestamp <= timestamp){return timestamp + 1;}else {return newTimestamp;}},upperCase:upperCase,removeCircular:function removeCircular(object){return (function rmCirc(value,ctx){var i=undefined;var nu=undefined;if(typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)){var cur=ctx.cur;var parent=ctx.ctx;while(parent) {if(parent.cur === cur){return undefined;}parent = parent.ctx;}if(isArray(value)){nu = [];for(i = 0;i < value.length;i += 1) {nu[i] = rmCirc(value[i],{ctx:ctx,cur:value[i]});}}else {nu = {};forOwn(value,function(v,k){nu[k] = rmCirc(value[k],{ctx:ctx,cur:value[k]});});}return nu;}return value;})(object,{ctx:null,cur:object});},resolveItem:resolveItem,resolveId:resolveId,respond:function respond(response,meta,options){if(options.returnMeta === 'array'){return [response,meta];}else if(options.returnMeta === 'object'){return {response:response,meta:meta};}else {return response;}},w:w,applyRelationGettersToTarget:function applyRelationGettersToTarget(store,definition,target){this.forEach(definition.relationList,function(def){var relationName=def.relation;var enumerable=typeof def.enumerable === 'boolean'?def.enumerable:!!definition.relationsEnumerable;if(typeof def.link === 'boolean'?def.link:!!definition.linkRelations){delete target[def.localField];if(def.type === 'belongsTo'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else if(def.type === 'hasMany'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};if(def.foreignKey){params[def.foreignKey] = this[definition.idAttribute];return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true});}else if(def.localKeys){params.where = _defineProperty({},definition.getResource(relationName).idAttribute,{'in':this[def.localKeys]});return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params);}return undefined;},set:function set(){}});}else if(def.type === 'hasOne'){if(def.localKey){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else {Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};params[def.foreignKey] = this[definition.idAttribute];var items=params[def.foreignKey]?definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true}):[];if(items.length){return items[0];}return undefined;},set:function set(){}});}}}});}};},function(module,exports,__webpack_require__){var _get=function get(_x,_x2,_x3){var _again=true;_function: while(_again) {var object=_x,property=_x2,receiver=_x3;desc = parent = getter = undefined;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x = parent;_x2 = property;_x3 = receiver;_again = true;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)subClass.__proto__ = superClass;}var IllegalArgumentError=(function(_Error){function IllegalArgumentError(message){_classCallCheck(this,IllegalArgumentError);_get(Object.getPrototypeOf(IllegalArgumentError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(IllegalArgumentError,_Error);return IllegalArgumentError;})(Error);var RuntimeError=(function(_Error2){function RuntimeError(message){_classCallCheck(this,RuntimeError);_get(Object.getPrototypeOf(RuntimeError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(RuntimeError,_Error2);return RuntimeError;})(Error);var NonexistentResourceError=(function(_Error3){function NonexistentResourceError(resourceName){_classCallCheck(this,NonexistentResourceError);_get(Object.getPrototypeOf(NonexistentResourceError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = resourceName + ' is not a registered resource!';}_inherits(NonexistentResourceError,_Error3);return NonexistentResourceError;})(Error);exports['default'] = {IllegalArgumentError:IllegalArgumentError,IA:IllegalArgumentError,RuntimeError:RuntimeError,R:RuntimeError,NonexistentResourceError:NonexistentResourceError,NER:NonexistentResourceError};},function(module,exports,__webpack_require__){var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _defineResource=__webpack_require__(28);var _eject=__webpack_require__(29);var _ejectAll=__webpack_require__(30);var _filter=__webpack_require__(31);var _inject=__webpack_require__(32);var NER=_errors['default'].NER;var IA=_errors['default'].IA;var R=_errors['default'].R;function diffIsEmpty(diff){return !(_utils['default'].isEmpty(diff.added) && _utils['default'].isEmpty(diff.removed) && _utils['default'].isEmpty(diff.changed));}exports['default'] = {changes:function changes(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];options = options || {};id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('changes',id,options);var item=definition.get(id);if(item){var _ret=(function(){if(_utils['default'].w){_this.s[resourceName].observers[id].deliver();}var ignoredChanges=options.ignoredChanges || [];_utils['default'].forEach(definition.relationFields,function(field){if(!_utils['default'].contains(ignoredChanges,field)){ignoredChanges.push(field);}});var diff=_utils['default'].diffObjectFromOldObject(item,_this.s[resourceName].previousAttributes[id],_utils['default'].equals,ignoredChanges);_utils['default'].forOwn(diff,function(changeset,name){var toKeep=[];_utils['default'].forOwn(changeset,function(value,field){if(!_utils['default'].isFunction(value)){toKeep.push(field);}});diff[name] = _utils['default'].pick(diff[name],toKeep);});_utils['default'].forEach(definition.relationFields,function(field){delete diff.added[field];delete diff.removed[field];delete diff.changed[field];});return {v:diff};})();if(typeof _ret === 'object')return _ret.v;}},changeHistory:function changeHistory(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(resourceName && !_this.defs[resourceName]){throw new NER(resourceName);}else if(id && !_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('changeHistory',id);if(!definition.keepChangeHistory){definition.errorFn('changeHistory is disabled for this resource!');}else {if(resourceName){var item=definition.get(id);if(item){return resource.changeHistories[id];}}else {return resource.changeHistory;}}},compute:function compute(resourceName,instance){var _this=this;var definition=_this.defs[resourceName];instance = _utils['default'].resolveItem(_this.s[resourceName],instance);if(!definition){throw new NER(resourceName);}else if(!instance){throw new R('Item not in the store!');}else if(!_utils['default']._o(instance) && !_utils['default']._sn(instance)){throw new IA('"instance" must be an object, string or number!');}definition.logFn('compute',instance);_utils['default'].forOwn(definition.computed,function(fn,field){_utils['default'].compute.call(instance,fn,field);});return instance;},createInstance:function createInstance(resourceName,attrs,options){var definition=this.defs[resourceName];var item=undefined;attrs = attrs || {};if(!definition){throw new NER(resourceName);}else if(attrs && !_utils['default'].isObject(attrs)){throw new IA('"attrs" must be an object!');}options = _utils['default']._(definition,options);options.logFn('createInstance',attrs,options);options.beforeCreateInstance(options,attrs);var Constructor=definition[definition['class']];item = new Constructor();if(options.defaultValues){_utils['default'].deepMixIn(item,options.defaultValues);}_utils['default'].deepMixIn(item,attrs);if(definition.computed){definition.compute(item);}options.afterCreateInstance(options,item);return item;},createCollection:function createCollection(resourceName,arr,params,options){var _this=this;var definition=_this.defs[resourceName];arr = arr || [];params = params || {};if(!definition){throw new NER(resourceName);}else if(arr && !_utils['default'].isArray(arr)){throw new IA('"arr" must be an array!');}options = _utils['default']._(definition,options);options.logFn('createCollection',arr,options);options.beforeCreateCollection(options,arr);Object.defineProperties(arr,{fetch:{value:function value(params,options){var __this=this;__this.params = params || __this.params;return definition.findAll(__this.params,options).then(function(data){if(data === __this){return __this;}data.unshift(__this.length);data.unshift(0);__this.splice.apply(__this,data);data.shift();data.shift();if(data.$$injected){_this.s[resourceName].queryData[_utils['default'].toJson(__this.params)] = __this;__this.$$injected = true;}return __this;});}},params:{value:params,writable:true},resourceName:{value:resourceName}});options.afterCreateCollection(options,arr);return arr;},defineResource:_defineResource['default'],digest:function digest(){this.observe.Platform.performMicrotaskCheckpoint();},eject:_eject['default'],ejectAll:_ejectAll['default'],filter:_filter['default'],get:function get(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('get',id,options);return _this.s[resourceName].index[id];},getAll:function getAll(resourceName,ids){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var collection=[];if(!definition){throw new NER(resourceName);}else if(ids && !_utils['default']._a(ids)){throw _utils['default']._aErr('ids');}definition.logFn('getAll',ids);if(_utils['default']._a(ids)){var _length=ids.length;for(var i=0;i < _length;i++) {if(resource.index[ids[i]]){collection.push(resource.index[ids[i]]);}}}else {collection = resource.collection.slice();}return collection;},hasChanges:function hasChanges(resourceName,id){var _this=this;var definition=_this.defs[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('hasChanges',id);return definition.get(id)?diffIsEmpty(definition.changes(id)):false;},inject:_inject['default'],lastModified:function lastModified(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastModified',id);if(id){if(!(id in resource.modified)){resource.modified[id] = 0;}return resource.modified[id];}return resource.collectionModified;},lastSaved:function lastSaved(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastSaved',id);if(!(id in resource.saved)){resource.saved[id] = 0;}return resource.saved[id];},previous:function previous(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('previous',id);return resource.previousAttributes[id]?_utils['default'].copy(resource.previousAttributes[id]):undefined;}};},function(module,exports,__webpack_require__){var _create=__webpack_require__(33);var _destroy=__webpack_require__(34);var _destroyAll=__webpack_require__(35);var _find=__webpack_require__(36);var _findAll=__webpack_require__(37);var _loadRelations=__webpack_require__(38);var _reap=__webpack_require__(39);var _save=__webpack_require__(40);var _update=__webpack_require__(41);var _updateAll=__webpack_require__(42);exports['default'] = {create:_create['default'],destroy:_destroy['default'],destroyAll:_destroyAll['default'],find:_find['default'],findAll:_findAll['default'],loadRelations:_loadRelations['default'],reap:_reap['default'],refresh:function refresh(resourceName,id,options){var _this=this;var DSUtils=_this.utils;return new DSUtils.Promise(function(resolve,reject){var definition=_this.defs[resourceName];id = DSUtils.resolveId(_this.defs[resourceName],id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refresh',id,options);resolve(_this.get(resourceName,id));}}).then(function(item){return item?_this.find(resourceName,id,options):item;});},refreshAll:function refreshAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refreshAll',params,options);resolve(_this.filter(resourceName,params,options));}}).then(function(existing){options.bypassCache = true;return _this.findAll(resourceName,params,options).then(function(found){DSUtils.forEach(existing,function(item){if(found.indexOf(item) === -1){definition.eject(item);}});return found;});});},save:_save['default'],update:_update['default'],updateAll:_updateAll['default']};},function(module,exports,__webpack_require__){(function(global){var testingExposeCycleCount=global.testingExposeCycleCount;function detectObjectObserve(){if(typeof Object.observe !== 'function' || typeof Array.observe !== 'function'){return false;}var records=[];function callback(recs){records = recs;}var test={};var arr=[];Object.observe(test,callback);Array.observe(arr,callback);test.id = 1;test.id = 2;delete test.id;arr.push(1,2);arr.length = 0;Object.deliverChangeRecords(callback);if(records.length !== 5)return false;if(records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice'){return false;}Object.unobserve(test,callback);Array.unobserve(arr,callback);return true;}var hasObserve=detectObjectObserve();var createObject='__proto__' in {}?function(obj){return obj;}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name));});return newObject;};var MAX_DIRTY_CHECK_CYCLES=1000;function dirtyCheck(observer){var cycles=0;while(cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {cycles++;}if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;return cycles > 0;}function objectIsEmpty(object){for(var prop in object) return false;return true;}function diffIsEmpty(diff){return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed);}function isBlacklisted(prop,bl){if(!bl || !bl.length){return false;}var matches;for(var i=0;i < bl.length;i++) {if(Object.prototype.toString.call(bl[i]) === '[object RegExp]' && bl[i].test(prop) || bl[i] === prop){return matches = prop;}}return !!matches;}function diffObjectFromOldObject(object,oldObject,equals,bl){var added={};var removed={};var changed={};for(var prop in oldObject) {var newValue=object[prop];if(isBlacklisted(prop,bl))continue;if(newValue !== undefined && (equals?equals(newValue,oldObject[prop]):newValue === oldObject[prop]))continue;if(!(prop in object)){removed[prop] = undefined;continue;}if(equals?!equals(newValue,oldObject[prop]):newValue !== oldObject[prop])changed[prop] = newValue;}for(var prop in object) {if(prop in oldObject)continue;if(isBlacklisted(prop,bl))continue;added[prop] = object[prop];}if(Array.isArray(object) && object.length !== oldObject.length)changed.length = object.length;return {added:added,removed:removed,changed:changed};}var eomTasks=[];function runEOMTasks(){if(!eomTasks.length)return false;for(var i=0;i < eomTasks.length;i++) {eomTasks[i]();}eomTasks.length = 0;return true;}var runEOM=hasObserve?(function(){return function(fn){return Promise.resolve().then(fn);};})():(function(){return function(fn){eomTasks.push(fn);};})();var observedObjectCache=[];function newObservedObject(){var observer;var object;var discardRecords=false;var first=true;function callback(records){if(observer && observer.state_ === OPENED && !discardRecords)observer.check_(records);}return {open:function open(obs){if(observer)throw Error('ObservedObject in use');if(!first)Object.deliverChangeRecords(callback);observer = obs;first = false;},observe:function observe(obj,arrayObserve){object = obj;if(arrayObserve)Array.observe(object,callback);else Object.observe(object,callback);},deliver:function deliver(discard){discardRecords = discard;Object.deliverChangeRecords(callback);discardRecords = false;},close:function close(){observer = undefined;Object.unobserve(object,callback);observedObjectCache.push(this);}};}function getObservedObject(observer,object,arrayObserve){var dir=observedObjectCache.pop() || newObservedObject();dir.open(observer);dir.observe(object,arrayObserve);return dir;}var UNOPENED=0;var OPENED=1;var CLOSED=2;var nextObserverId=1;function Observer(){this.state_ = UNOPENED;this.callback_ = undefined;this.target_ = undefined;this.directObserver_ = undefined;this.value_ = undefined;this.id_ = nextObserverId++;}Observer.prototype = {open:function open(callback,target){if(this.state_ != UNOPENED)throw Error('Observer has already been opened.');addToAll(this);this.callback_ = callback;this.target_ = target;this.connect_();this.state_ = OPENED;return this.value_;},close:function close(){if(this.state_ != OPENED)return;removeFromAll(this);this.disconnect_();this.value_ = undefined;this.callback_ = undefined;this.target_ = undefined;this.state_ = CLOSED;},deliver:function deliver(){if(this.state_ != OPENED)return;dirtyCheck(this);},report_:function report_(changes){try{this.callback_.apply(this.target_,changes);}catch(ex) {Observer._errorThrownDuringCallback = true;console.error('Exception caught during observer callback: ' + (ex.stack || ex));}},discardChanges:function discardChanges(){this.check_(undefined,true);return this.value_;}};var collectObservers=!hasObserve;var allObservers;Observer._allObserversCount = 0;if(collectObservers){allObservers = [];}function addToAll(observer){Observer._allObserversCount++;if(!collectObservers)return;allObservers.push(observer);}function removeFromAll(observer){Observer._allObserversCount--;}var runningMicrotaskCheckpoint=false;global.Platform = global.Platform || {};global.Platform.performMicrotaskCheckpoint = function(){if(runningMicrotaskCheckpoint)return;if(!collectObservers)return;runningMicrotaskCheckpoint = true;var cycles=0;var anyChanged,toCheck;do {cycles++;toCheck = allObservers;allObservers = [];anyChanged = false;for(var i=0;i < toCheck.length;i++) {var observer=toCheck[i];if(observer.state_ != OPENED)continue;if(observer.check_())anyChanged = true;allObservers.push(observer);}if(runEOMTasks())anyChanged = true;}while(cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;runningMicrotaskCheckpoint = false;};if(collectObservers){global.Platform.clearObservers = function(){allObservers = [];};}function ObjectObserver(object){Observer.call(this);this.value_ = object;this.oldObject_ = undefined;}ObjectObserver.prototype = createObject({__proto__:Observer.prototype,arrayObserve:false,connect_:function connect_(callback,target){if(hasObserve){this.directObserver_ = getObservedObject(this,this.value_,this.arrayObserve);}else {this.oldObject_ = this.copyObject(this.value_);}},copyObject:function copyObject(object){var copy=Array.isArray(object)?[]:{};for(var prop in object) {copy[prop] = object[prop];};if(Array.isArray(object))copy.length = object.length;return copy;},check_:function check_(changeRecords,skipChanges){var diff;var oldValues;if(hasObserve){if(!changeRecords)return false;oldValues = {};diff = diffObjectFromChangeRecords(this.value_,changeRecords,oldValues);}else {oldValues = this.oldObject_;diff = diffObjectFromOldObject(this.value_,this.oldObject_);}if(diffIsEmpty(diff))return false;if(!hasObserve)this.oldObject_ = this.copyObject(this.value_);this.report_([diff.added || {},diff.removed || {},diff.changed || {},function(property){return oldValues[property];}]);return true;},disconnect_:function disconnect_(){if(hasObserve){this.directObserver_.close();this.directObserver_ = undefined;}else {this.oldObject_ = undefined;}},deliver:function deliver(){if(this.state_ != OPENED)return;if(hasObserve)this.directObserver_.deliver(false);else dirtyCheck(this);},discardChanges:function discardChanges(){if(this.directObserver_)this.directObserver_.deliver(true);else this.oldObject_ = this.copyObject(this.value_);return this.value_;}});var observerSentinel={};var expectedRecordTypes={add:true,update:true,'delete':true};function diffObjectFromChangeRecords(object,changeRecords,oldValues){var added={};var removed={};for(var i=0;i < changeRecords.length;i++) {var record=changeRecords[i];if(!expectedRecordTypes[record.type]){console.error('Unknown changeRecord type: ' + record.type);console.error(record);continue;}if(!(record.name in oldValues))oldValues[record.name] = record.oldValue;if(record.type == 'update')continue;if(record.type == 'add'){if(record.name in removed)delete removed[record.name];else added[record.name] = true;continue;}if(record.name in added){delete added[record.name];delete oldValues[record.name];}else {removed[record.name] = true;}}for(var prop in added) added[prop] = object[prop];for(var prop in removed) removed[prop] = undefined;var changed={};for(var prop in oldValues) {if(prop in added || prop in removed)continue;var newValue=object[prop];if(oldValues[prop] !== newValue)changed[prop] = newValue;}return {added:added,removed:removed,changed:changed};}global.Observer = Observer;global.isBlacklisted = isBlacklisted;global.Observer.runEOM_ = runEOM;global.Observer.observerSentinel_ = observerSentinel;global.Observer.hasObjectObserve = hasObserve;global.diffObjectFromOldObject = diffObjectFromOldObject;global.ObjectObserver = ObjectObserver;})(exports);},function(module,exports,__webpack_require__){(function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define('yabh',factory);else if(typeof exports === 'object')exports['BinaryHeap'] = factory();else root['BinaryHeap'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _classCallCheck=function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}};var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();Object.defineProperty(exports,'__esModule',{value:true});function bubbleUp(heap,weightFunc,n){var element=heap[n];var weight=weightFunc(element);while(n > 0) {var parentN=Math.floor((n + 1) / 2) - 1;var _parent=heap[parentN];if(weight >= weightFunc(_parent)){break;}else {heap[parentN] = element;heap[n] = _parent;n = parentN;}}}var bubbleDown=function bubbleDown(heap,weightFunc,n){var length=heap.length;var node=heap[n];var nodeWeight=weightFunc(node);while(true) {var child2N=(n + 1) * 2,child1N=child2N - 1;var swap=null;if(child1N < length){var child1=heap[child1N],child1Weight=weightFunc(child1);if(child1Weight < nodeWeight){swap = child1N;}}if(child2N < length){var child2=heap[child2N],child2Weight=weightFunc(child2);if(child2Weight < (swap === null?nodeWeight:weightFunc(heap[child1N]))){swap = child2N;}}if(swap === null){break;}else {heap[n] = heap[swap];heap[swap] = node;n = swap;}}};var BinaryHeap=(function(){function BinaryHeap(weightFunc,compareFunc){_classCallCheck(this,BinaryHeap);if(!weightFunc){weightFunc = function(x){return x;};}if(!compareFunc){compareFunc = function(x,y){return x === y;};}if(typeof weightFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');}if(typeof compareFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');}this.weightFunc = weightFunc;this.compareFunc = compareFunc;this.heap = [];}_createClass(BinaryHeap,[{key:'push',value:function push(node){this.heap.push(node);bubbleUp(this.heap,this.weightFunc,this.heap.length - 1);}},{key:'peek',value:function peek(){return this.heap[0];}},{key:'pop',value:function pop(){var front=this.heap[0];var end=this.heap.pop();if(this.heap.length > 0){this.heap[0] = end;bubbleDown(this.heap,this.weightFunc,0);}return front;}},{key:'remove',value:function remove(node){var length=this.heap.length;for(var i=0;i < length;i++) {if(this.compareFunc(this.heap[i],node)){var removed=this.heap[i];var end=this.heap.pop();if(i !== length - 1){this.heap[i] = end;bubbleUp(this.heap,this.weightFunc,i);bubbleDown(this.heap,this.weightFunc,i);}return removed;}}return null;}},{key:'removeAll',value:function removeAll(){this.heap = [];}},{key:'size',value:function size(){return this.heap.length;}}]);return BinaryHeap;})();exports['default'] = BinaryHeap;module.exports = exports['default'];}]));});;},function(module,exports,__webpack_require__){function forEach(arr,callback,thisObj){if(arr == null){return;}var i=-1,len=arr.length;while(++i < len) {if(callback.call(thisObj,arr[i],i,arr) === false){break;}}}module.exports = forEach;},function(module,exports,__webpack_require__){function slice(arr,start,end){var len=arr.length;if(start == null){start = 0;}else if(start < 0){start = Math.max(len + start,0);}else {start = Math.min(start,len);}if(end == null){end = len;}else if(end < 0){end = Math.max(len + end,0);}else {end = Math.min(end,len);}var result=[];while(start < end) {result.push(arr[start++]);}return result;}module.exports = slice;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function contains(arr,val){return indexOf(arr,val) !== -1;}module.exports = contains;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function remove(arr,item){var idx=indexOf(arr,item);if(idx !== -1)arr.splice(idx,1);}module.exports = remove;},function(module,exports,__webpack_require__){function mergeSort(arr,compareFn){if(arr == null){return [];}else if(arr.length < 2){return arr;}if(compareFn == null){compareFn = defaultCompare;}var mid,left,right;mid = ~ ~(arr.length / 2);left = mergeSort(arr.slice(0,mid),compareFn);right = mergeSort(arr.slice(mid,arr.length),compareFn);return merge(left,right,compareFn);}function defaultCompare(a,b){return a < b?-1:a > b?1:0;}function merge(left,right,compareFn){var result=[];while(left.length && right.length) {if(compareFn(left[0],right[0]) <= 0){result.push(left.shift());}else {result.push(right.shift());}}if(left.length){result.push.apply(result,left);}if(right.length){result.push.apply(result,right);}return result;}module.exports = mergeSort;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var forIn=__webpack_require__(22);function forOwn(obj,fn,thisObj){forIn(obj,function(val,key){if(hasOwn(obj,key)){return fn.call(thisObj,obj[key],key,obj);}});}module.exports = forOwn;},function(module,exports,__webpack_require__){var forOwn=__webpack_require__(13);var isPlainObject=__webpack_require__(23);function deepMixIn(target,objects){var i=0,n=arguments.length,obj;while(++i < n) {obj = arguments[i];if(obj){forOwn(obj,copyProp,target);}}return target;}function copyProp(val,key){var existing=this[key];if(isPlainObject(val) && isPlainObject(existing)){deepMixIn(existing,val);}else {this[key] = val;}}module.exports = deepMixIn;},function(module,exports,__webpack_require__){var slice=__webpack_require__(9);function pick(obj,var_keys){var keys=typeof arguments[1] !== 'string'?arguments[1]:slice(arguments,1),out={},i=0,key;while(key = keys[i++]) {out[key] = obj[key];}return out;}module.exports = pick;},function(module,exports,__webpack_require__){var isPrimitive=__webpack_require__(24);function get(obj,prop){var parts=prop.split('.'),last=parts.pop();while(prop = parts.shift()) {obj = obj[prop];if(obj == null)return;}return obj[last];}module.exports = get;},function(module,exports,__webpack_require__){var namespace=__webpack_require__(25);function set(obj,prop,val){var parts=/^(.+)\.(.+)$/.exec(prop);if(parts){namespace(obj,parts[1])[parts[2]] = val;}else {obj[prop] = val;}}module.exports = set;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var camelCase=__webpack_require__(27);var upperCase=__webpack_require__(19);function pascalCase(str){str = toString(str);return camelCase(str).replace(/^[a-z]/,upperCase);}module.exports = pascalCase;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function upperCase(str){str = toString(str);return str.toUpperCase();}module.exports = upperCase;},function(module,exports,__webpack_require__){function indexOf(arr,item,fromIndex){fromIndex = fromIndex || 0;if(arr == null){return -1;}var len=arr.length,i=fromIndex < 0?len + fromIndex:fromIndex;while(i < len) {if(arr[i] === item){return i;}i++;}return -1;}module.exports = indexOf;},function(module,exports,__webpack_require__){function hasOwn(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports = hasOwn;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var _hasDontEnumBug,_dontEnums;function checkDontEnum(){_dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'];_hasDontEnumBug = true;for(var key in {'toString':null}) {_hasDontEnumBug = false;}}function forIn(obj,fn,thisObj){var key,i=0;if(_hasDontEnumBug == null)checkDontEnum();for(key in obj) {if(exec(fn,obj,key,thisObj) === false){break;}}if(_hasDontEnumBug){var ctor=obj.constructor,isProto=!!ctor && obj === ctor.prototype;while(key = _dontEnums[i++]) {if((key !== 'constructor' || !isProto && hasOwn(obj,key)) && obj[key] !== Object.prototype[key]){if(exec(fn,obj,key,thisObj) === false){break;}}}}}function exec(fn,obj,key,thisObj){return fn.call(thisObj,obj[key],key,obj);}module.exports = forIn;},function(module,exports,__webpack_require__){function isPlainObject(value){return !!value && typeof value === 'object' && value.constructor === Object;}module.exports = isPlainObject;},function(module,exports,__webpack_require__){function isPrimitive(value){switch(typeof value){case 'string':case 'number':case 'boolean':return true;}return value == null;}module.exports = isPrimitive;},function(module,exports,__webpack_require__){var forEach=__webpack_require__(8);function namespace(obj,path){if(!path)return obj;forEach(path.split('.'),function(key){if(!obj[key]){obj[key] = {};}obj = obj[key];});return obj;}module.exports = namespace;},function(module,exports,__webpack_require__){function toString(val){return val == null?'':val.toString();}module.exports = toString;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var replaceAccents=__webpack_require__(43);var removeNonWord=__webpack_require__(44);var upperCase=__webpack_require__(19);var lowerCase=__webpack_require__(45);function camelCase(str){str = toString(str);str = replaceAccents(str);str = removeNonWord(str).replace(/[\-_]/g,' ').replace(/\s[a-z]/g,upperCase).replace(/\s+/g,'').replace(/^[A-Z]/g,lowerCase);return str;}module.exports = camelCase;},function(module,exports,__webpack_require__){exports['default'] = defineResource;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var instanceMethods=['compute','eject','refresh','save','update','destroy','loadRelations','changeHistory','changes','hasChanges','lastModified','lastSaved','previous'];function defineResource(definition){var _this=this;var definitions=_this.defs;if(_utils['default']._s(definition)){definition = {name:definition.replace(/\s/gi,'')};}if(!_utils['default']._o(definition)){throw _utils['default']._oErr('definition');}else if(!_utils['default']._s(definition.name)){throw new _errors['default'].IA('"name" must be a string!');}else if(definitions[definition.name]){throw new _errors['default'].R(definition.name + ' is already registered!');}function Resource(options){this.defaultValues = {};this.methods = {};this.computed = {};_utils['default'].deepMixIn(this,options);var parent=_this.defaults;if(definition['extends'] && definitions[definition['extends']]){parent = definitions[definition['extends']];}_utils['default'].fillIn(this.defaultValues,parent.defaultValues);_utils['default'].fillIn(this.methods,parent.methods);_utils['default'].fillIn(this.computed,parent.computed);this.endpoint = 'endpoint' in options?options.endpoint:this.name;}try{var def;var _class;var _ret=(function(){if(definition['extends'] && definitions[definition['extends']]){Resource.prototype = definitions[definition['extends']];}else {Resource.prototype = _this.defaults;}definitions[definition.name] = new Resource(definition);def = definitions[definition.name];def.getResource = function(resourceName){return _this.defs[resourceName];};def.logFn('Preparing resource.');if(!_utils['default']._s(def.idAttribute)){throw new _errors['default'].IA('"idAttribute" must be a string!');}if(def.relations){def.relationList = [];def.relationFields = [];_utils['default'].forOwn(def.relations,function(relatedModels,type){_utils['default'].forOwn(relatedModels,function(defs,relationName){if(!_utils['default']._a(defs)){relatedModels[relationName] = [defs];}_utils['default'].forEach(relatedModels[relationName],function(d){d.type = type;d.relation = relationName;d.name = def.name;def.relationList.push(d);if(d.localField){def.relationFields.push(d.localField);}});});});if(def.relations.belongsTo){_utils['default'].forOwn(def.relations.belongsTo,function(relatedModel,modelName){_utils['default'].forEach(relatedModel,function(relation){if(relation.parent){def.parent = modelName;def.parentKey = relation.localKey;def.parentField = relation.localField;}});});}if(typeof Object.freeze === 'function'){Object.freeze(def.relations);Object.freeze(def.relationList);}}_class = def['class'] = _utils['default'].pascalCase(def.name);try{if(typeof def.useClass === 'function'){eval('function ' + _class + '() { def.useClass.call(this); }');def[_class] = eval(_class);def[_class].prototype = (function(proto){function Ctor(){}Ctor.prototype = proto;return new Ctor();})(def.useClass.prototype);}else {eval('function ' + _class + '() {}');def[_class] = eval(_class);}}catch(e) {def[_class] = function(){};}_utils['default'].forOwn(def.methods,function(fn,m){def[_class].prototype[m] = fn;});def[_class].prototype.set = function(key,value){var _this2=this;_utils['default'].set(this,key,value);def.compute(this);if(def.instanceEvents){setTimeout(function(){_this2.emit('DS.change',def,_this2);},0);}def.handleChange(this);return this;};def[_class].prototype.get = function(key){return _utils['default'].get(this,key);};if(def.instanceEvents){_utils['default'].Events(def[_class].prototype);}_utils['default'].applyRelationGettersToTarget(_this,def,def[_class].prototype);var parentOmit=null;if(!def.hasOwnProperty('omit')){parentOmit = def.omit;def.omit = [];}else {parentOmit = _this.defaults.omit;}def.omit = def.omit.concat(parentOmit || []);_utils['default'].forOwn(def.computed,function(fn,field){if(_utils['default'].isFunction(fn)){def.computed[field] = [fn];fn = def.computed[field];}if(def.methods && field in def.methods){def.errorFn('Computed property "' + field + '" conflicts with previously defined prototype method!');}def.omit.push(field);var deps;if(fn.length === 1){var match=fn[0].toString().match(/function.*?\(([\s\S]*?)\)/);deps = match[1].split(',');def.computed[field] = deps.concat(fn);fn = def.computed[field];if(deps.length){def.errorFn('Use the computed property array syntax for compatibility with minified code!');}}deps = fn.slice(0,fn.length - 1);_utils['default'].forEach(deps,function(val,index){deps[index] = val.trim();});fn.deps = _utils['default'].filter(deps,function(dep){return !!dep;});});_utils['default'].forEach(instanceMethods,function(name){def[_class].prototype['DS' + _utils['default'].pascalCase(name)] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}args.unshift(this[def.idAttribute] || this);args.unshift(def.name);return _this[name].apply(_this,args);};});def[_class].prototype.DSCreate = function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}args.unshift(this);args.unshift(def.name);return _this.create.apply(_this,args);};_this.s[def.name] = {collection:[],expiresHeap:new _utils['default'].BinaryHeap(function(x){return x.expires;},function(x,y){return x.item === y;}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var resource=_this.s[def.name];if(def.reapInterval){setInterval(function(){return def.reap();},def.reapInterval);}var fns=['registerAdapter','getAdapterName','getAdapter','is'];for(var key in _this) {if(typeof _this[key] === 'function'){fns.push(key);}}_utils['default'].forEach(fns,function(key){var k=key;if(_this[k].shorthand !== false){def[k] = function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}args.unshift(def.name);return _this[k].apply(_this,args);};def[k].before = function(fn){var orig=def[k];def[k] = function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4 < _len4;_key4++) {args[_key4] = arguments[_key4];}return orig.apply(def,fn.apply(def,args) || args);};};}else {def[k] = function(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5 < _len5;_key5++) {args[_key5] = arguments[_key5];}return _this[k].apply(_this,args);};}});def.beforeValidate = _utils['default'].promisify(def.beforeValidate);def.validate = _utils['default'].promisify(def.validate);def.afterValidate = _utils['default'].promisify(def.afterValidate);def.beforeCreate = _utils['default'].promisify(def.beforeCreate);def.afterCreate = _utils['default'].promisify(def.afterCreate);def.beforeUpdate = _utils['default'].promisify(def.beforeUpdate);def.afterUpdate = _utils['default'].promisify(def.afterUpdate);def.beforeDestroy = _utils['default'].promisify(def.beforeDestroy);def.afterDestroy = _utils['default'].promisify(def.afterDestroy);var defaultAdapter=undefined;if(def.hasOwnProperty('defaultAdapter')){defaultAdapter = def.defaultAdapter;}_utils['default'].forOwn(def.actions,function(action,name){if(def[name] && !def.actions[name]){throw new Error('Cannot override existing method "' + name + '"!');}action.request = action.request || function(config){return config;};action.response = action.response || function(response){return response;};action.responseError = action.responseError || function(err){return _utils['default'].Promise.reject(err);};def[name] = function(id,options){if(_utils['default']._o(id)){options = id;}options = options || {};var adapter=def.getAdapter(action.adapter || defaultAdapter || 'http');var config=_utils['default'].deepMixIn({},action);if(!options.hasOwnProperty('endpoint') && config.endpoint){options.endpoint = config.endpoint;}if(typeof options.getEndpoint === 'function'){config.url = options.getEndpoint(def,options);}else {var args=[options.basePath || adapter.defaults.basePath || def.basePath,adapter.getEndpoint(def,_utils['default']._sn(id)?id:null,options)];if(_utils['default']._sn(id)){args.push(id);}args.push(action.pathname || name);config.url = _utils['default'].makePath.apply(null,args);}config.method = config.method || 'GET';_utils['default'].deepMixIn(config,options);return new _utils['default'].Promise(function(r){return r(config);}).then(options.request || action.request).then(function(config){return adapter.HTTP(config);}).then(options.response || action.response,options.responseError || action.responseError);};});_utils['default'].Events(def);def.handleChange = function(data){resource.collectionModified = _utils['default'].updateTimestamp(resource.collectionModified);if(def.notify){setTimeout(function(){def.emit('DS.change',def,data);},0);}};def.logFn('Done preparing resource.');return {v:def};})();if(typeof _ret === 'object')return _ret.v;}catch(err) {_this.defaults.errorFn(err);delete definitions[definition.name];delete _this.s[definition.name];throw err;}}},function(module,exports,__webpack_require__){exports['default'] = eject;function eject(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined;var found=false;id = DSUtils.resolveId(definition,id);if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._sn(id)){throw DSUtils._snErr('id');}options = DSUtils._(definition,options);options.logFn('eject',id,options);for(var i=0;i < resource.collection.length;i++) {if(resource.collection[i][definition.idAttribute] == id){item = resource.collection[i];resource.expiresHeap.remove(item);found = true;break;}}if(found){var _ret=(function(){definition.beforeEject(options,item);if(options.notify){definition.emit('DS.beforeEject',definition,item);}var toRemove=[];DSUtils.forOwn(resource.queryData,function(items,queryHash){if(items.$$injected){DSUtils.remove(items,item);}if(!items.length && options.clearEmptyQueries){toRemove.push(queryHash);}});DSUtils.forEach(resource.changeHistories[id],function(changeRecord){DSUtils.remove(resource.changeHistory,changeRecord);});DSUtils.forEach(toRemove,function(queryHash){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];});if(DSUtils.w){resource.observers[id].close();}delete resource.observers[id];delete resource.index[id];delete resource.previousAttributes[id];delete resource.completedQueries[id];delete resource.pendingQueries[id];delete resource.changeHistories[id];delete resource.modified[id];delete resource.saved[id];resource.collection.splice(i,1);definition.handleChange(item);definition.afterEject(options,item);if(options.notify){definition.emit('DS.afterEject',definition,item);}return {v:item};})();if(typeof _ret === 'object')return _ret.v;}}},function(module,exports,__webpack_require__){exports['default'] = ejectAll;function ejectAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._o(params)){throw DSUtils._oErr('params');}definition.logFn('ejectAll',params,options);var resource=_this.s[resourceName];var queryHash=DSUtils.toJson(params);var items=definition.filter(params);var ids=[];if(DSUtils.isEmpty(params)){resource.completedQueries = {};}else {delete resource.completedQueries[queryHash];}DSUtils.forEach(items,function(item){if(item && item[definition.idAttribute]){ids.push(item[definition.idAttribute]);}});DSUtils.forEach(ids,function(id){definition.eject(id,options);});definition.handleChange(items);return items;}},function(module,exports,__webpack_require__){exports['default'] = filter;function filter(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];if(!definition){throw new _this.errors.NER(resourceName);}else if(params && !DSUtils._o(params)){throw DSUtils._oErr('params');}params = params || {};options = DSUtils._(definition,options);options.logFn('filter',params,options);return definition.defaultFilter.call(_this,_this.s[resourceName].collection,resourceName,params,options);}},function(module,exports,__webpack_require__){exports['default'] = inject;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);function makeObserverHandler(definition,resource){var DS=this;var name=definition.name;return function _react(added,removed,changed,oldValueFn,firstTime){var target=this;var item=undefined;var innerId=oldValueFn && oldValueFn(definition.idAttribute)?oldValueFn(definition.idAttribute):target[definition.idAttribute];_utils['default'].forEach(definition.relationFields,function(field){delete added[field];delete removed[field];delete changed[field];});if(!_utils['default'].isEmpty(added) || !_utils['default'].isEmpty(removed) || !_utils['default'].isEmpty(changed) || firstTime){item = DS.get(name,innerId);resource.modified[innerId] = _utils['default'].updateTimestamp(resource.modified[innerId]);if(item && definition.instanceEvents){setTimeout(function(){item.emit('DS.change',definition,item);},0);}definition.handleChange(item);if(definition.keepChangeHistory){var changeRecord={resourceName:name,target:item,added:added,removed:removed,changed:changed,timestamp:resource.modified[innerId]};resource.changeHistories[innerId].push(changeRecord);resource.changeHistory.push(changeRecord);}}if(definition.computed){item = item || DS.get(name,innerId);_utils['default'].forOwn(definition.computed,function(fn,field){var compute=false;_utils['default'].forEach(fn.deps,function(dep){if(dep in added || dep in removed || dep in changed || !(field in item)){compute = true;}});compute = compute || !fn.deps.length;if(compute){_utils['default'].compute.call(item,fn,field);}});}if(definition.idAttribute in changed){definition.errorFn('Doh! You just changed the primary key of an object! Your data for the "' + name + '" resource is now in an undefined (probably broken) state.');}};}function _inject(definition,resource,attrs,options){var _this=this;var injected=undefined;if(_utils['default']._a(attrs)){injected = [];for(var i=0;i < attrs.length;i++) {injected.push(_inject.call(_this,definition,resource,attrs[i],options));}}else {var _react=makeObserverHandler.call(_this,definition,resource);var c=definition.computed;var idA=definition.idAttribute;if(c && c[idA]){(function(){var args=[];_utils['default'].forEach(c[idA].deps,function(dep){args.push(attrs[dep]);});attrs[idA] = c[idA][c[idA].length - 1].apply(attrs,args);})();}if(!(idA in attrs)){var error=new _errors['default'].R(definition.name + '.inject: "attrs" must contain the property specified by "idAttribute"!');options.errorFn(error);throw error;}else {try{(function(){_utils['default'].forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=_this.defs[relationName];var toInject=attrs[def.localField];if(toInject){if(!relationDef){throw new _errors['default'].R(definition.name + ' relation is defined but the resource is not!');}if(_utils['default']._a(toInject)){(function(){var items=[];_utils['default'].forEach(toInject,function(toInjectItem){if(toInjectItem !== _this.s[relationName].index[toInjectItem[relationDef.idAttribute]]){try{var injectedItem=relationDef.inject(toInjectItem,options.orig());if(def.foreignKey){injectedItem[def.foreignKey] = attrs[definition.idAttribute];}items.push(injectedItem);}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}});})();}else {if(toInject !== _this.s[relationName].index[toInject[relationDef.idAttribute]]){try{var _injected=relationDef.inject(attrs[def.localField],options.orig());if(def.foreignKey){_injected[def.foreignKey] = attrs[definition.idAttribute];}}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}}}});var id=attrs[idA];var item=definition.get(id);var initialLastModified=item?resource.modified[id]:0;if(!item){if(attrs instanceof definition[definition['class']]){item = attrs;}else {item = new definition[definition['class']]();}_utils['default'].forEach(definition.relationList,function(def){delete attrs[def.localField];});_utils['default'].deepMixIn(item,attrs);resource.collection.push(item);resource.changeHistories[id] = [];if(_utils['default'].w){resource.observers[id] = new _this.observe.ObjectObserver(item);resource.observers[id].open(_react,item);}resource.index[id] = item;_react.call(item,{},{},{},null,true);resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);}else {if(options.onConflict === 'merge'){_utils['default'].deepMixIn(item,attrs);}else if(options.onConflict === 'replace'){_utils['default'].forOwn(item,function(v,k){if(k !== definition.idAttribute){if(!attrs.hasOwnProperty(k)){delete item[k];}}});_utils['default'].forOwn(attrs,function(v,k){if(k !== definition.idAttribute){item[k] = v;}});}if(definition.resetHistoryOnInject){resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);if(resource.changeHistories[id].length){_utils['default'].forEach(resource.changeHistories[id],function(changeRecord){_utils['default'].remove(resource.changeHistory,changeRecord);});resource.changeHistories[id].splice(0,resource.changeHistories[id].length);}}if(_utils['default'].w){resource.observers[id].deliver();}}resource.modified[id] = initialLastModified && resource.modified[id] === initialLastModified?_utils['default'].updateTimestamp(resource.modified[id]):resource.modified[id];resource.expiresHeap.remove(item);var timestamp=new Date().getTime();resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});injected = item;})();}catch(err) {options.errorFn(err,attrs);}}}return injected;}function inject(resourceName,attrs,options){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var injected=undefined;if(!definition){throw new _errors['default'].NER(resourceName);}else if(!_utils['default']._o(attrs) && !_utils['default']._a(attrs)){throw new _errors['default'].IA(resourceName + '.inject: "attrs" must be an object or an array!');}options = _utils['default']._(definition,options);options.logFn('inject',attrs,options);options.beforeInject(options,attrs);if(options.notify){definition.emit('DS.beforeInject',definition,attrs);}injected = _inject.call(_this,definition,resource,attrs,options);definition.handleChange(injected);options.afterInject(options,injected);if(options.notify){definition.emit('DS.afterInject',definition,injected);}return injected;}},function(module,exports,__webpack_require__){exports['default'] = create;function create(resourceName,attrs,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var adapter=undefined;options = options || {};attrs = attrs || {};var rejectionError=undefined;if(!definition){rejectionError = new _this.errors.NER(resourceName);}else if(!DSUtils._o(attrs)){rejectionError = DSUtils._oErr('attrs');}else {options = DSUtils._(definition,options);if(options.upsert && DSUtils._sn(attrs[definition.idAttribute])){return _this.update(resourceName,attrs[definition.idAttribute],attrs,options);}options.logFn('create',attrs,options);}return new DSUtils.Promise(function(resolve,reject){if(rejectionError){reject(rejectionError);}else {resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeCreate',definition,attrs);}adapter = _this.getAdapterName(options);return _this.adapters[adapter].create(definition,DSUtils.omit(attrs,options.omit),options);}).then(function(attrs){return options.afterCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.afterCreate',definition,attrs);}if(options.cacheResponse){var created=_this.inject(definition.name,attrs,options.orig());var id=created[definition.idAttribute];var resource=_this.s[resourceName];resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return created;}else {return _this.createInstance(resourceName,attrs,options);}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = destroy;function destroy(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var item=undefined;var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {item = definition.get(id) || {id:id};options = DSUtils._(definition,options);options.logFn('destroy',id,options);resolve(item);}}).then(function(attrs){return options.beforeDestroy.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeDestroy',definition,attrs);}if(options.eagerEject){definition.eject(id);}adapter = definition.getAdapter(options);return adapter.destroy(definition,id,options);}).then(function(){return options.afterDestroy.call(item,options,item);}).then(function(item){if(options.notify){definition.emit('DS.afterDestroy',definition,item);}definition.eject(id);return DSUtils.respond(id,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && item){definition.inject(item,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = destroyAll;function destroyAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var ejected=undefined,toEject=undefined,adapter=undefined;params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('attrs'));}else {options = DSUtils._(definition,options);options.logFn('destroyAll',params,options);resolve();}}).then(function(){toEject = definition.defaultFilter.call(_this,resourceName,params);return options.beforeDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.beforeDestroy',definition,toEject);}if(options.eagerEject){ejected = definition.ejectAll(params);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].destroyAll(definition,params,options);}).then(function(){return options.afterDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.afterDestroy',definition,toEject);}return ejected || definition.ejectAll(params);}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && ejected){definition.inject(ejected,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = find;function find(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('find',id,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[id];}if((!options.findStrictCache || id in resource.completedQueries) && definition.get(id) && !options.bypassCache){resolve(definition.get(id));}else {delete resource.completedQueries[id];resolve();}}}).then(function(item){if(!item){if(!(id in resource.pendingQueries)){var promise=undefined;var strategy=options.findStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].find(definition,id,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].find(definition,id,options);}resource.pendingQueries[id] = promise.then(function(data){delete resource.pendingQueries[id];if(options.cacheResponse){var injected=definition.inject(data,options.orig());resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return injected;}else {return definition.createInstance(data,options.orig());}});}return resource.pendingQueries[id];}else {return item;}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[id];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = findAll;function processResults(data,resourceName,queryHash,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var idAttribute=_this.defs[resourceName].idAttribute;var date=new Date().getTime();data = data || [];delete resource.pendingQueries[queryHash];resource.completedQueries[queryHash] = date;var injected=definition.inject(data,options.orig());if(DSUtils._a(injected)){DSUtils.forEach(injected,function(item){if(item){var id=item[idAttribute];if(id){resource.completedQueries[id] = date;resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);}}});}else {options.errorFn('response is expected to be an array!');resource.completedQueries[injected[idAttribute]] = date;}return injected;}function findAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var queryHash=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){params = params || {};if(!_this.defs[resourceName]){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);queryHash = DSUtils.toJson(params);options.logFn('findAll',params,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];}if(queryHash in resource.completedQueries){if(options.useFilter){resolve(definition.filter(params,options.orig()));}else {resolve(resource.queryData[queryHash]);}}else {resolve();}}}).then(function(items){if(!(queryHash in resource.completedQueries)){if(!(queryHash in resource.pendingQueries)){var promise=undefined;var strategy=options.findAllStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findAllFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].findAll(definition,params,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].findAll(definition,params,options);}resource.pendingQueries[queryHash] = promise.then(function(data){delete resource.pendingQueries[queryHash];if(options.cacheResponse){resource.queryData[queryHash] = processResults.call(_this,data,resourceName,queryHash,options);resource.queryData[queryHash].$$injected = true;return resource.queryData[queryHash];}else {DSUtils.forEach(data,function(item,i){data[i] = definition.createInstance(item,options.orig());});return data;}});}return resource.pendingQueries[queryHash];}else {return items;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[queryHash];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = loadRelations;function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}function loadRelations(resourceName,instance,relations,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];return new DSUtils.Promise(function(resolve,reject){if(DSUtils._sn(instance)){instance = definition.get(instance);}if(DSUtils._s(relations)){relations = [relations];}relations = relations || [];if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._o(instance)){reject(new DSErrors.IA('"instance(id)" must be a string, number or object!'));}else if(!DSUtils._a(relations)){reject(new DSErrors.IA('"relations" must be a string or an array!'));}else {(function(){var _options=DSUtils._(definition,options);_options.logFn('loadRelations',instance,relations,_options);var tasks=[];DSUtils.forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=definition.getResource(relationName);var __options=DSUtils._(relationDef,options);if(!relations.length || DSUtils.contains(relations,relationName) || DSUtils.contains(relations,def.localField)){var task=undefined;var params={};if(__options.allowSimpleWhere){params[def.foreignKey] = instance[definition.idAttribute];}else {params.where = {};params.where[def.foreignKey] = {'==':instance[definition.idAttribute]};}if(def.type === 'hasMany'){if(def.localKeys){delete params[def.foreignKey];params.where = _defineProperty({},relationDef.idAttribute,{'in':instance[def.localKeys]});}task = relationDef.findAll(params,__options.orig());}else if(def.type === 'hasOne'){if(def.localKey && instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}else if(def.foreignKey){task = relationDef.findAll(params,__options.orig()).then(function(hasOnes){return hasOnes.length?hasOnes[0]:null;});}}else if(instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}if(task){tasks.push(task);}}});resolve(tasks);})();}}).then(function(tasks){return DSUtils.Promise.all(tasks);}).then(function(){return instance;});}},function(module,exports,__webpack_require__){exports['default'] = reap;function reap(resourceName,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else {options = DSUtils._(definition,options);if(!options.hasOwnProperty('notify')){options.notify = false;}options.logFn('reap',options);var items=[];var now=new Date().getTime();var expiredItem=undefined;while((expiredItem = resource.expiresHeap.peek()) && expiredItem.expires < now) {items.push(expiredItem.item);delete expiredItem.item;resource.expiresHeap.pop();}resolve(items);}}).then(function(items){if(items.length){definition.beforeReap(options,items);if(options.notify){definition.emit('DS.beforeReap',definition,items);}}if(options.reapAction === 'inject'){(function(){var timestamp=new Date().getTime();DSUtils.forEach(items,function(item){resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});});})();}else if(options.reapAction === 'eject'){DSUtils.forEach(items,function(item){definition.eject(item[definition.idAttribute]);});}else if(options.reapAction === 'refresh'){var _ret2=(function(){var tasks=[];DSUtils.forEach(items,function(item){tasks.push(definition.refresh(item[definition.idAttribute]));});return {v:DSUtils.Promise.all(tasks)};})();if(typeof _ret2 === 'object')return _ret2.v;}return items;}).then(function(items){if(items.length){definition.afterReap(options,items);if(options.notify){definition.emit('DS.afterReap',definition,items);}}return items;});}},function(module,exports,__webpack_require__){exports['default'] = save;function save(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined,noChanges=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else if(!definition.get(id)){reject(new DSErrors.R('id "' + id + '" not found in cache!'));}else {item = definition.get(id);options = DSUtils._(definition,options);options.logFn('save',id,options);resolve(item);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}if(options.changesOnly){if(DSUtils.w){resource.observers[id].deliver();}var toKeep=[];var changes=definition.changes(id);for(var key in changes.added) {toKeep.push(key);}for(key in changes.changed) {toKeep.push(key);}changes = DSUtils.pick(attrs,toKeep);if(DSUtils.isEmpty(changes)){options.logFn('save - no changes',id,options);noChanges = true;return attrs;}else {attrs = changes;}}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(noChanges){return attrs;}else if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = update;function update(resourceName,id,attrs,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('update',id,attrs,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var resource=_this.s[resourceName];var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = updateAll;function updateAll(resourceName,attrs,params,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new DSErrors.NER(resourceName));}else {options = DSUtils._(definition,options);options.logFn('updateAll',attrs,params,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].updateAll(definition,DSUtils.omit(attrs,options.omit),params,options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(data){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}var origOptions=options.orig();if(options.cacheResponse){var _ret=(function(){var injected=definition.inject(data,origOptions);var resource=_this.s[resourceName];DSUtils.forEach(injected,function(i){var id=i[definition.idAttribute];resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[id] = DSUtils.copy(i,null,null,null,definition.relationFields);}});return {v:injected};})();if(typeof _ret === 'object')return _ret.v;}else {var _ret2=(function(){var instances=[];DSUtils.forEach(data,function(item){instances.push(definition.createInstance(item,origOptions));});return {v:instances};})();if(typeof _ret2 === 'object')return _ret2.v;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function replaceAccents(str){str = toString(str);if(str.search(/[\xC0-\xFF]/g) > -1){str = str.replace(/[\xC0-\xC5]/g,'A').replace(/[\xC6]/g,'AE').replace(/[\xC7]/g,'C').replace(/[\xC8-\xCB]/g,'E').replace(/[\xCC-\xCF]/g,'I').replace(/[\xD0]/g,'D').replace(/[\xD1]/g,'N').replace(/[\xD2-\xD6\xD8]/g,'O').replace(/[\xD9-\xDC]/g,'U').replace(/[\xDD]/g,'Y').replace(/[\xDE]/g,'P').replace(/[\xE0-\xE5]/g,'a').replace(/[\xE6]/g,'ae').replace(/[\xE7]/g,'c').replace(/[\xE8-\xEB]/g,'e').replace(/[\xEC-\xEF]/g,'i').replace(/[\xF1]/g,'n').replace(/[\xF2-\xF6\xF8]/g,'o').replace(/[\xF9-\xFC]/g,'u').replace(/[\xFE]/g,'p').replace(/[\xFD\xFF]/g,'y');}return str;}module.exports = replaceAccents;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var PATTERN=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;function removeNonWord(str){str = toString(str);return str.replace(PATTERN,'');}module.exports = removeNonWord;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function lowerCase(str){str = toString(str);return str.toLowerCase();}module.exports = lowerCase;}]));}); + +/***/ } +/******/ ]); \ No newline at end of file diff --git a/build_examples/webpack_es6_2/index.html b/build_examples/webpack_es6_2/index.html new file mode 100644 index 0000000..9769ccd --- /dev/null +++ b/build_examples/webpack_es6_2/index.html @@ -0,0 +1,11 @@ + + + + My App + + + + +

{{ test }}

+ + diff --git a/build_examples/webpack_es6_2/webpack.config.js b/build_examples/webpack_es6_2/webpack.config.js new file mode 100644 index 0000000..a645ef2 --- /dev/null +++ b/build_examples/webpack_es6_2/webpack.config.js @@ -0,0 +1,17 @@ +module.exports = { + entry: './app.js', + output: { + filename: 'bundle.js' + }, + externals: ['axios'], + resolve: { + alias: { + 'js-data-angular': '../../dist/js-data-angular.js' + } + }, + module: { + loaders: [ + { test: /(.+)\.js$/, loader: 'babel-loader?blacklist=useStrict' } + ] + } +}; From 47ea7abebe48900b0aee1e3c76a8bcf7ae3f30e0 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Wed, 1 Jul 2015 10:45:09 -0400 Subject: [PATCH 7/9] Removed some build files. --- .gitignore | 2 + build_examples/webpack_es6/bundle.js | 810 ------------------------- build_examples/webpack_es6_2/bundle.js | 804 ------------------------ 3 files changed, 2 insertions(+), 1614 deletions(-) delete mode 100644 build_examples/webpack_es6/bundle.js delete mode 100644 build_examples/webpack_es6_2/bundle.js diff --git a/.gitignore b/.gitignore index 1a7da08..75552dd 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ bower_components/ build_examples/r.js/bundle.js build_examples/browserify/bundle.js build_examples/webpack/bundle.js +build_examples/webpack_es6/bundle.js +build_examples/webpack_es6_2/bundle.js diff --git a/build_examples/webpack_es6/bundle.js b/build_examples/webpack_es6/bundle.js deleted file mode 100644 index 63a7168..0000000 --- a/build_examples/webpack_es6/bundle.js +++ /dev/null @@ -1,810 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - - var _angular = __webpack_require__(2); - - var _angular2 = _interopRequireDefault(_angular); - - var _jsDataAngular = __webpack_require__(1); - - var _jsDataAngular2 = _interopRequireDefault(_jsDataAngular); - - _angular2['default'].module('app', [_jsDataAngular2['default']]).run(function (DS, DSVersion, $rootScope) { - $rootScope.test = 'It works! Using js-data ' + DSVersion.full; - }); - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - /*! - * js-data-angular - * @version 3.0.0-rc.1 - Homepage - * @author Jason Dobry - * @copyright (c) 2014-2015 Jason Dobry - * @license MIT - * - * @overview Angular wrapper for js-data. - */ - (function webpackUniversalModuleDefinition(root, factory) { - if (true) module.exports = factory(__webpack_require__(5), __webpack_require__(2), (function webpackLoadOptionalExternalModule() { - try { - return __webpack_require__(3); - } catch (e) {} - })());else if (typeof define === 'function' && define.amd) define(['js-data', 'angular'], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { - return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root['axios']); - });else if (typeof exports === 'object') exports['jsDataAngularModuleName'] = factory(require('js-data'), require('angular'), (function webpackLoadOptionalExternalModule() { - try { - return require('axios'); - } catch (e) {} - })());else root['jsDataAngularModuleName'] = factory(root['JSData'], root['angular'], root['axios']); - })(this, function (__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) { - return ( /******/(function (modules) { - // webpackBootstrap - /******/ // The module cache - /******/var installedModules = {}; - - /******/ // The require function - /******/function __webpack_require__(moduleId) { - - /******/ // Check if module is in cache - /******/if (installedModules[moduleId]) - /******/return installedModules[moduleId].exports; - - /******/ // Create a new module (and put it into the cache) - /******/var module = installedModules[moduleId] = { - /******/exports: {}, - /******/id: moduleId, - /******/loaded: false - /******/ }; - - /******/ // Execute the module function - /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - - /******/ // Flag the module as loaded - /******/module.loaded = true; - - /******/ // Return the exports of the module - /******/return module.exports; - /******/ - } - - /******/ // expose the modules object (__webpack_modules__) - /******/__webpack_require__.m = modules; - - /******/ // expose the module cache - /******/__webpack_require__.c = installedModules; - - /******/ // __webpack_public_path__ - /******/__webpack_require__.p = ''; - - /******/ // Load entry module and return exports - /******/return __webpack_require__(0); - /******/ - })([ - /* 0 */ - /***/function (module, exports, __webpack_require__) { - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - - /*jshint loopfunc:true*/ - var JSData = __webpack_require__(1); - var DSHttpAdapter = __webpack_require__(4); - var angular = __webpack_require__(2); - - var DSUtils = JSData.DSUtils; - var DSErrors = JSData.DSErrors; - var isString = DSUtils.isString; - var isNumber = DSUtils.isNumber; - var isObject = DSUtils.isObject; - var set = DSUtils.set; - var resolveId = DSUtils.resolveId; - - var adapters = [{ - project: 'js-data-localstorage', - name: 'localstorage', - 'class': 'DSLocalStorageAdapter' - }, { - project: 'js-data-localforage', - name: 'localforage', - 'class': 'DSLocalForageAdapter' - }, { - project: 'js-data-firebase', - name: 'firebase', - 'class': 'DSFirebaseAdapter' - }, { - project: 'js-data-sql', - name: 'sql', - 'class': 'DSSqlAdapter' - }]; - - var functionsToWrap = ['compute', 'digest', 'eject', 'inject']; - - function registerAdapter(adapter) { - var Adapter = undefined; - - try { - Adapter = __webpack_require__(3)(adapter.project); - } catch (e) {} - - if (!Adapter) { - Adapter = window[adapter['class']]; - } - - if (Adapter) { - adapter.loaded = true; - angular.module('js-data').provider(adapter['class'], function () { - var _this = this; - _this.defaults = {}; - _this.$get = [function () { - return new Adapter(_this.defaults); - }]; - }); - } - } - - var DSHttpAdapterProvider = function DSHttpAdapterProvider() { - _classCallCheck(this, DSHttpAdapterProvider); - - var defaults = {}; - this.defaults = defaults; - - this.$get = ['$http', 'DS', function ($http, DS) { - defaults.http = defaults.http || $http; - var adapter = new DSHttpAdapter(defaults); - DS.registerAdapter('http', adapter, { 'default': true }); - return adapter; - }]; - }; - - var DSProvider = function DSProvider() { - _classCallCheck(this, DSProvider); - - var _this = this; - var deps = []; - - for (var i = 0; i < adapters.length; i++) { - if (adapters[i].loaded) { - deps.push(adapters[i]['class']); - } - } - - _this.defaults = {}; - - JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { - var _this = this; - - params = params || {}; - - if (!_this.definitions[resourceName]) { - throw new DSErrors.NER(resourceName); - } else if (!isObject(params)) { - throw new DSErrors.IA('"params" must be an object!'); - } else if (!isObject(scope)) { - throw new DSErrors.IA('"scope" must be an object!'); - } else if (!isString(expr)) { - throw new DSErrors.IA('"expr" must be a string!'); - } - - try { - return scope.$watch(function () { - return _this.lastModified(resourceName); - }, function () { - var items = _this.filter(resourceName, params); - set(scope, expr, items); - if (cb) { - cb(null, items); - } - }); - } catch (err) { - if (cb) { - cb(err); - } else { - throw err; - } - } - }; - - JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { - var _this = this; - - id = resolveId(_this.definitions[resourceName], id); - if (!_this.definitions[resourceName]) { - throw new DSErrors.NER(resourceName); - } else if (!isString(id) && !isNumber(id)) { - throw new DSErrors.IA('"id" must be a string or a number!'); - } else if (!isObject(scope)) { - throw new DSErrors.IA('"scope" must be an object!'); - } else if (!isString(expr)) { - throw new DSErrors.IA('"expr" must be a string!'); - } - - try { - return scope.$watch(function () { - return _this.lastModified(resourceName, id); - }, function () { - var item = _this.get(resourceName, id); - if (item) { - _this.compute(resourceName, id); - } - set(scope, expr, item); - if (cb) { - cb(null, item); - } - }); - } catch (err) { - if (cb) { - cb(err); - } else { - throw err; - } - } - }; - - function load() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var $rootScope = args[args.length - 2]; - var $q = args[args.length - 1]; - var store = new JSData.DS(_this.defaults); - var originals = {}; - - function QPromise(executor) { - var deferred = $q.defer(); - - try { - executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); - } catch (err) { - deferred.reject(err); - } - - return deferred.promise; - } - - QPromise.all = $q.all; - QPromise.when = $q.when; - QPromise.reject = $q.reject; - - DSUtils.Promise = QPromise; - - // Register any adapters that have been loaded - if (args.length) { - for (var i = 0; i < args.length; i++) { - for (var j = 0; j < adapters.length; j++) { - if (adapters[j].loaded && !adapters[j].registered) { - adapters[j].registered = true; - store.registerAdapter(adapters[j].name, args[i]); - break; - } - } - } - } - - var _loop = function _loop() { - var name = functionsToWrap[k]; - originals[name] = store[name]; - store[name] = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (!$rootScope.$$phase) { - return $rootScope.$apply(function () { - return originals[name].apply(store, args); - }); - } - return originals[name].apply(store, args); - }; - }; - - // Wrap certain sync functions with $apply - for (var k = 0; k < functionsToWrap.length; k++) { - _loop(); - } - - // Hook into the digest loop - if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { - $rootScope.$watch(function () { - return store.observe.Platform.performMicrotaskCheckpoint(); - }); - } - - return store; - } - - deps.push('$rootScope'); - deps.push('$q'); - deps.push(load); - - _this.$get = deps; - }; - - angular.module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', JSData.version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { - DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); - }]); - - for (var i = 0; i < adapters.length; i++) { - registerAdapter(adapters[i]); - } - - // return the module name - module.exports = 'js-data'; - module.exports.name = 'js-data'; - - /***/ - }, - /* 1 */ - /***/function (module, exports, __webpack_require__) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_1__; - - /***/ - }, - /* 2 */ - /***/function (module, exports, __webpack_require__) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - - /***/ - }, - /* 3 */ - /***/function (module, exports, __webpack_require__) { - - var map = {}; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function () { - throw new Error('Cannot find module \'' + req + '\'.'); - })(); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 3; - - /***/ - }, - /* 4 */ - /***/function (module, exports, __webpack_require__) { - - var _createClass = (function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); - } - }return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; - }; - })(); - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - - var JSData = __webpack_require__(1); - var axios = null; - - try { - axios = __webpack_require__(5); - } catch (e) {} - - var DSUtils = JSData.DSUtils; - var deepMixIn = DSUtils.deepMixIn; - var removeCircular = DSUtils.removeCircular; - var copy = DSUtils.copy; - var makePath = DSUtils.makePath; - var isString = DSUtils.isString; - var isNumber = DSUtils.isNumber; - - var Defaults = (function () { - function Defaults() { - _classCallCheck(this, Defaults); - } - - _createClass(Defaults, [{ - key: 'queryTransform', - value: function queryTransform(resourceConfig, params) { - return params; - } - }, { - key: 'deserialize', - value: function deserialize(resourceConfig, data) { - return data ? 'data' in data ? data.data : data : data; - } - }, { - key: 'serialize', - value: function serialize(resourceConfig, data) { - return data; - } - }, { - key: 'log', - value: function log() {} - }, { - key: 'error', - value: function error() {} - }]); - - return Defaults; - })(); - - var defaultsPrototype = Defaults.prototype; - - defaultsPrototype.basePath = ''; - - defaultsPrototype.forceTrailingSlash = ''; - - defaultsPrototype.httpConfig = {}; - - var DSHttpAdapter = (function () { - function DSHttpAdapter(options) { - _classCallCheck(this, DSHttpAdapter); - - this.defaults = new Defaults(); - if (console) { - this.defaults.log = function (a, b) { - return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); - }; - } - if (console) { - this.defaults.error = function (a, b) { - return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); - }; - } - deepMixIn(this.defaults, options); - this.http = options.http || axios; - } - - _createClass(DSHttpAdapter, [{ - key: 'getEndpoint', - value: function getEndpoint(resourceConfig, id, options) { - var _this2 = this; - - options = options || {}; - options.params = options.params || {}; - - var item = undefined; - var parentKey = resourceConfig.parentKey; - var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : resourceConfig.endpoint; - var parentField = resourceConfig.parentField; - var parentDef = resourceConfig.getResource(resourceConfig.parent); - var parentId = options.params[parentKey]; - - if (parentId === false || !parentKey || !parentDef) { - if (parentId === false) { - delete options.params[parentKey]; - } - return endpoint; - } else { - delete options.params[parentKey]; - - if (DSUtils._sn(id)) { - item = resourceConfig.get(id); - } else if (DSUtils._o(id)) { - item = id; - } - - if (item) { - parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); - } - - if (parentId) { - var _ret = (function () { - delete options.endpoint; - var _options = {}; - DSUtils.forOwn(options, function (value, key) { - _options[key] = value; - }); - return { - v: DSUtils.makePath(_this2.getEndpoint(parentDef, parentId, DSUtils._(parentDef, _options)), parentId, endpoint) - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return endpoint; - } - } - } - }, { - key: 'getPath', - value: function getPath(method, resourceConfig, id, options) { - var _this = this; - options = options || {}; - var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, this.getEndpoint(resourceConfig, isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; - if (method === 'find' || method === 'update' || method === 'destroy') { - args.push(id); - } - return makePath.apply(DSUtils, args); - } - }, { - key: 'HTTP', - value: function HTTP(config) { - var _this = this; - var start = new Date(); - config = copy(config); - config = deepMixIn(config, _this.defaults.httpConfig); - if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { - config.url += '/'; - } - if (typeof config.data === 'object') { - config.data = removeCircular(config.data); - } - config.method = config.method.toUpperCase(); - var suffix = config.suffix || _this.defaults.suffix; - if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { - config.url += suffix; - } - - function logResponse(data) { - var str = start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; - if (data.status >= 200 && data.status < 300) { - if (_this.defaults.log) { - _this.defaults.log(str, data); - } - return data; - } else { - if (_this.defaults.error) { - _this.defaults.error('\'FAILED: ' + str, data); - } - return DSUtils.Promise.reject(data); - } - } - - if (!this.http) { - throw new Error('You have not configured this adapter with an http library!'); - } - - return this.http(config).then(logResponse, logResponse); - } - }, { - key: 'GET', - value: function GET(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'get'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'POST', - value: function POST(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'post'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs - })); - } - }, { - key: 'PUT', - value: function PUT(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'put'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs || {} - })); - } - }, { - key: 'DEL', - value: function DEL(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'delete'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'find', - value: function find(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { - var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - return !item ? DSUtils.Promise.reject(new Error('Not Found!')) : item; - }); - } - }, { - key: 'findAll', - value: function findAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'create', - value: function create(resourceConfig, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.POST(_this.getPath('create', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'update', - value: function update(resourceConfig, id, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.PUT(_this.getPath('update', resourceConfig, id, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'updateAll', - value: function updateAll(resourceConfig, attrs, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroy', - value: function destroy(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroyAll', - value: function destroyAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }]); - - return DSHttpAdapter; - })(); - - module.exports = DSHttpAdapter; - - /***/ - }, - /* 5 */ - /***/function (module, exports, __webpack_require__) { - - if (typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') { - var e = new Error('Cannot find module "axios"');e.code = 'MODULE_NOT_FOUND';throw e; - } - module.exports = __WEBPACK_EXTERNAL_MODULE_5__; - - /***/ - } - /******/]) - ); - }); - ; - - /************************************************************************/ - /******/ - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(4); - module.exports = angular; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - if(typeof axios === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;} - module.exports = axios; - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - var require;(function(window,document,undefined){'use strict';function minErr(module,ErrorConstructor){ErrorConstructor = ErrorConstructor || Error;return function(){var code=arguments[0],prefix='[' + (module?module + ':':'') + code + '] ',template=arguments[1],templateArgs=arguments,message,i;message = prefix + template.replace(/\{\d+\}/g,function(match){var index=+match.slice(1,-1),arg;if(index + 2 < templateArgs.length){return toDebugString(templateArgs[index + 2]);}return match;});message = message + '\nhttp://errors.angularjs.org/1.3.15/' + (module?module + '/':'') + code;for(i = 2;i < arguments.length;i++) {message = message + (i == 2?'?':'&') + 'p' + (i - 2) + '=' + encodeURIComponent(toDebugString(arguments[i]));}return new ErrorConstructor(message);};}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/;var VALIDITY_STATE_PROPERTY='validity';var lowercase=function lowercase(string){return isString(string)?string.toLowerCase():string;};var hasOwnProperty=Object.prototype.hasOwnProperty;var uppercase=function uppercase(string){return isString(string)?string.toUpperCase():string;};var manualLowercase=function manualLowercase(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) | 32);}):s;};var manualUppercase=function manualUppercase(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) & ~32);}):s;};if('i' !== 'I'.toLowerCase()){lowercase = manualLowercase;uppercase = manualUppercase;}var msie,jqLite,jQuery,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,ngMinErr=minErr('ng'),angular=window.angular || (window.angular = {}),angularModule,uid=0;msie = document.documentMode;function isArrayLike(obj){if(obj == null || isWindow(obj)){return false;}var length=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;}function forEach(obj,iterator,context){var key,length;if(obj){if(isFunction(obj)){for(key in obj) {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 {for(key in obj) {if(obj.hasOwnProperty(key)){iterator.call(context,obj[key],key,obj);}}}}return obj;}function sortedKeys(obj){return Object.keys(obj).sort();}function forEachSorted(obj,iterator,context){var keys=sortedKeys(obj);for(var i=0;i < keys.length;i++) {iterator.call(context,obj[keys[i]],keys[i]);}return keys;}function reverseParams(iteratorFn){return function(value,key){iteratorFn(key,value);};}function nextUid(){return ++uid;}function setHashKey(obj,h){if(h){obj.$$hashKey = h;}else {delete obj.$$hashKey;}}function extend(dst){var h=dst.$$hashKey;for(var i=1,ii=arguments.length;i < ii;i++) {var obj=arguments[i];if(obj){var keys=Object.keys(obj);for(var j=0,jj=keys.length;j < jj;j++) {var key=keys[j];dst[key] = obj[key];}}}setHashKey(dst,h);return dst;}function int(str){return parseInt(str,10);}function inherit(parent,extra){return extend(Object.create(parent),extra);}function noop(){}noop.$inject = [];function identity($){return $;}identity.$inject = [];function valueFn(value){return function(){return value;};}function isUndefined(value){return typeof value === 'undefined';}function isDefined(value){return typeof value !== 'undefined';}function isObject(value){return value !== null && typeof value === 'object';}function isString(value){return typeof value === 'string';}function isNumber(value){return typeof value === 'number';}function isDate(value){return toString.call(value) === '[object Date]';}var isArray=Array.isArray;function isFunction(value){return typeof value === 'function';}function isRegExp(value){return toString.call(value) === '[object RegExp]';}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 trim=function trim(value){return isString(value)?value.trim():value;};var escapeForRegexp=function escapeForRegexp(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0)array.splice(index,1);return value;}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(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest);}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(isObject(source)){var emptyObject=Object.create(Object.getPrototypeOf(source));destination = copy(source,emptyObject,stackSource,stackDest);}}}else {if(source === destination)throw ngMinErr('cpi','Can\'t copy! Source and destination are identical.');stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1)return stackDest[index];stackSource.push(source);stackDest.push(destination);}var result;if(isArray(source)){destination.length = 0;for(var i=0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {var h=destination.$$hashKey;if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){result = copy(source[key],null,stackSource,stackDest);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}setHashKey(destination,h);}}return destination;}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;}function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2)return true;if(o1 === null || o2 === null)return false;if(o1 !== o1 && o2 !== o2)return true;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;_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}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 = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key]))return false;}return true;}}}return false;}}var csp=function csp(){if(isDefined(csp.isActive_))return csp.isActive_;var active=!!(document.querySelector('[ng-csp]') || document.querySelector('[data-ng-csp]'));if(!active){try{new Function('');}catch(e) {active = true;}}return csp.isActive_ = active;};function concat(array1,array2,index){return array1.concat(slice.call(array2,index));}function sliceArgs(args,startIndex){return slice.call(args,startIndex || 0);}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 {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;}function toJson(obj,pretty){if(typeof obj === 'undefined')return undefined;if(!isNumber(pretty)){pretty = pretty?2:null;}return JSON.stringify(obj,toJsonReplacer,pretty);}function fromJson(json){return isString(json)?JSON.parse(json):json;}function startingTag(element){element = jqLite(element).clone();try{element.empty();}catch(e) {}var elemHtml=jqLite('
').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);}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value);}catch(e) {}}function parseKeyValue(keyValue){var obj={},key_value,key;forEach((keyValue || '').split('&'),function(keyValue){if(keyValue){key_value = keyValue.replace(/\+/g,'%20').split('=');key = tryDecodeURIComponent(key_value[0]);if(isDefined(key)){var val=isDefined(key_value[1])?tryDecodeURIComponent(key_value[1]):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('&'):'';}function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}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;element = jqLite(element);for(i = 0;i < ii;++i) {attr = ngAttrPrefixes[i] + ngAttr;if(isString(attr = element.attr(attr))){return attr;}}return null;}function angularInit(element,bootstrap){var appElement,module,config={};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);}}function bootstrap(element,modules,config){if(!isObject(config))config = {};var defaultConfig={strictDi:false};config = extend(defaultConfig,config);var doBootstrap=function doBootstrap(){element = jqLite(element);if(element.injector()){var tag=element[0] === document?'document':startingTag(element);throw ngMinErr('btstrpd','App Already Bootstrapped with this Element \'{0}\'',tag.replace(//,'>'));}modules = modules || [];modules.unshift(['$provide',function($provide){$provide.value('$rootElement',element);}]);if(config.debugInfoEnabled){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();}}function reloadWithDebugInfo(){window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;window.location.reload();}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;}jQuery = window.jQuery;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});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;bindJQueryFired = true;}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;}function assertNotHasOwnProperty(name,context){if(name === 'hasOwnProperty'){throw ngMinErr('badname','hasOwnProperty is not a valid {0} name',context);}}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;}function getBlockNodes(nodes){var node=nodes[0];var endNode=nodes[nodes.length - 1];var blockNodes=[node];do {node = node.nextSibling;if(!node)break;blockNodes.push(node);}while(node !== endNode);return jqLite(blockNodes);}function createMap(){return Object.create(null);}var NODE_TYPE_ELEMENT=1;var NODE_TYPE_TEXT=3;var NODE_TYPE_COMMENT=8;var NODE_TYPE_DOCUMENT=9;var NODE_TYPE_DOCUMENT_FRAGMENT=11;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);angular.$$minErr = angular.$$minErr || minErr;return ensure(angular,'module',function(){var modules={};return function module(name,requires,configFn){var assertNotHasOwnProperty=function assertNotHasOwnProperty(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);}var invokeQueue=[];var configBlocks=[];var runBlocks=[];var config=invokeLater('$injector','invoke','push',configBlocks);var moduleInstance={_invokeQueue:invokeQueue,_configBlocks:configBlocks,_runBlocks:runBlocks,requires:requires,name:name,provider:invokeLater('$provide','provider'),factory:invokeLater('$provide','factory'),service:invokeLater('$provide','service'),value:invokeLater('$provide','value'),constant:invokeLater('$provide','constant','unshift'),animation:invokeLater('$animateProvider','register'),filter:invokeLater('$filterProvider','register'),controller:invokeLater('$controllerProvider','register'),directive:invokeLater('$compileProvider','directive'),config:config,run:function run(block){runBlocks.push(block);return this;}};if(configFn){config(configFn);}return moduleInstance;function invokeLater(provider,method,insertMethod,queue){if(!queue)queue = invokeQueue;return function(){queue[insertMethod || 'push']([provider,method,arguments]);return moduleInstance;};}});};});}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(typeof obj === 'undefined'){return 'undefined';}else if(typeof obj !== 'string'){return serializeObject(obj);}return obj;}var version={full:'1.3.15',major:1,minor:3,dot:15,codeName:'locality-filtration'};function publishExternalAPI(angular){extend(angular,{'bootstrap':bootstrap,'copy':copy,'extend':extend,'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);try{angularModule('ngLocale');}catch(e) {angularModule('ngLocale',[]).provider('$locale',$LocaleProvider);}angularModule('ng',['ngLocale'],['$provide',function ngModule($provide){$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,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpBackend:$HttpBackendProvider,$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,$$asyncCallback:$$AsyncCallbackProvider,$$jqLite:$$jqLiteProvider});}]);}JQLite.expando = 'ng339';var jqCache=JQLite.cache = {},jqId=1,addEventListenerFn=function addEventListenerFn(element,type,fn){element.addEventListener(type,fn,false);},removeEventListenerFn=function removeEventListenerFn(element,type,fn){element.removeEventListener(type,fn,false);};JQLite._data = function(node){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');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,''],'thead':[1,'','
'],'col':[2,'','
'],'tr':[2,'','
'],'td':[3,'','
'],'_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){var nodeType=node.nodeType;return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,fragment=context.createDocumentFragment(),nodes=[],i;if(jqLiteIsTextNode(html)){nodes.push(context.createTextNode(html));}else {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>') + wrap[2];i = wrap[0];while(i--) {tmp = tmp.lastChild;}nodes = concat(nodes,tmp.childNodes);tmp = fragment.firstChild;tmp.textContent = '';}fragment.textContent = '';fragment.innerHTML = '';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;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;}}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;}else {if(massGetter){return data;}else {if(isSimpleGetter){return data && data[key];}else {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){if(elements){if(elements.nodeType){root[root.length++] = elements;}else {var length=elements.length;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.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((value = jqLite.data(element,names[i])) !== undefined)return value;}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'){win.setTimeout(action);}else {jqLite(win).on('load',action);}}var JQLitePrototype=JQLite.prototype = {ready:function ready(fn){var fired=false;function trigger(){if(fired)return;fired = true;fn();}if(document.readyState === 'complete'){setTimeout(trigger);}else {this.on('DOMContentLoaded',trigger);JQLite(window).on('load',trigger);}},toString:function toString(){var value=[];forEach(this,function(e){value.push('' + e);});return '[' + value.join(', ') + ']';},eq:function eq(index){return index >= 0?jqLite(this[index]):jqLite(this[this.length + index]);},length:0,push:push,sort:[].sort,splice:[].splice};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){var booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;}function getAliasedAttrName(element,name){var nodeName=element.nodeName;return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];}forEach({data:jqLiteData,removeData:jqLiteRemoveData},function(fn,name){JQLite[name] = fn;});forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function scope(element){return jqLite.data(element,'$scope') || jqLiteInheritedData(element.parentNode || element,['$isolateScope','$scope']);},isolateScope:function isolateScope(element){return jqLite.data(element,'$isolateScope') || jqLite.data(element,'$isolateScopeNoTemplate');},controller:jqLiteController,injector:function injector(element){return jqLiteInheritedData(element,'$injector');},removeAttr:function removeAttr(element,name){element.removeAttribute(name);},hasClass:jqLiteHasClass,css:function css(element,name,value){name = camelCase(name);if(isDefined(value)){element.style[name] = value;}else {return element.style[name];}},attr:function attr(element,name,value){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){var ret=element.getAttribute(name,2);return ret === null?undefined:ret;}},prop:function prop(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 val(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 html(element,value){if(isUndefined(value)){return element.innerHTML;}jqLiteDealoc(element,true);element.innerHTML = value;},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name] = function(arg1,arg2){var i,key;var nodeCount=this.length;if(fn !== jqLiteEmpty && (fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)?arg1:arg2) === undefined){if(isObject(arg1)){for(i = 0;i < nodeCount;i++) {if(fn === jqLiteData){fn(this[i],arg1);}else {for(key in arg1) {fn(this[i],key,arg1[key]);}}}return this;}else {var value=fn.$dv;var jj=value === undefined?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 {for(i = 0;i < nodeCount;i++) {fn(this[i],arg1,arg2);}return this;}};});function createEventHandler(element,events){var eventHandler=function eventHandler(event,type){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;};if(eventFnsLength > 1){eventFns = shallowCopy(eventFns);}for(var i=0;i < eventFnsLength;i++) {if(!event.isImmediatePropagationStopped()){eventFns[i].call(element,event);}}};eventHandler.elem = element;return eventHandler;}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');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);}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'){jqLiteOn(element,MOUSE_EVENT_MAP[type],function(event){var target=this,related=event.relatedTarget;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 one(element,type,fn){element = jqLite(element);element.on(type,function onFn(){element.off(type,fn);element.off(type,onFn);});element.on(type,fn);},replaceWith:function replaceWith(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 children(element){var children=[];forEach(element.childNodes,function(element){if(element.nodeType === NODE_TYPE_ELEMENT)children.push(element);});return children;},contents:function contents(element){return element.contentDocument || element.childNodes || [];},append:function append(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 prepend(element,node){if(element.nodeType === NODE_TYPE_ELEMENT){var index=element.firstChild;forEach(new JQLite(node),function(child){element.insertBefore(child,index);});}},wrap:function wrap(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 detach(element){jqLiteRemove(element,true);},after:function after(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 toggleClass(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 parent(element){var parent=element.parentNode;return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT?parent:null;},next:function next(element){return element.nextElementSibling;},find:function find(element,selector){if(element.getElementsByTagName){return element.getElementsByTagName(selector);}else {return [];}},clone:jqLiteClone,triggerHandler:function triggerHandler(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){dummyEvent = {preventDefault:function preventDefault(){this.defaultPrevented = true;},isDefaultPrevented:function isDefaultPrevented(){return this.defaultPrevented === true;},stopImmediatePropagation:function stopImmediatePropagation(){this.immediatePropagationStopped = true;},isImmediatePropagationStopped:function isImmediatePropagationStopped(){return this.immediatePropagationStopped === true;},stopPropagation:noop,type:eventName,target:element};if(event.type){dummyEvent = extend(dummyEvent,event);}eventFnsCopy = shallowCopy(eventFns);handlerArgs = extraParameters?[dummyEvent].concat(extraParameters):[dummyEvent];forEach(eventFnsCopy,function(fn){if(!dummyEvent.isImmediatePropagationStopped()){fn.apply(element,handlerArgs);}});}}},function(fn,name){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)){value = jqLite(value);}}else {jqLiteAddNodes(value,fn(this[i],arg1,arg2,arg3));}}return isDefined(value)?value:this;};JQLite.prototype.bind = JQLite.prototype.on;JQLite.prototype.unbind = JQLite.prototype.off;});function $$jqLiteProvider(){this.$get = function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node = node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node = node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node = node[0];return jqLiteRemoveClass(node,classes);}});};}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;}function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid = function(){return ++uid;};}forEach(array,this.put,this);}HashMap.prototype = {put:function put(key,value){this[hashKey(key,this.nextUid)] = value;},get:function get(key){return this[hashKey(key,this.nextUid)];},remove:function remove(key){var value=this[key = hashKey(key,this.nextUid)];delete this[key];return value;}};var FN_ARGS=/^function\s*[^\(]*\(\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){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;}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){instanceInjector.invoke(fn || noop);});return instanceInjector;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});};}function loadModules(modulesToLoad){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){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;}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];}return fn.apply(self,args);}function instantiate(Type,locals,serviceName){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 has(name){return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);}};}}createInjector.$$annotate = annotate;function $AnchorScrollProvider(){var autoScrollingEnabled=true;this.disableAutoScrolling = function(){autoScrollingEnabled = false;};this.$get = ['$window','$location','$rootScope',function($window,$location,$rootScope){var document=$window.document;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){var elemTop=elem.getBoundingClientRect().top;$window.scrollBy(0,elemTop - offset);}}else {$window.scrollTo(0,0);}}function scroll(){var hash=$location.hash(),elm;if(!hash)scrollTo(null);else if(elm = document.getElementById(hash))scrollTo(elm);else if(elm = getFirstAnchor(document.getElementsByName(hash)))scrollTo(elm);else if(hash === 'top')scrollTo(null);}if(autoScrollingEnabled){$rootScope.$watch(function autoScrollWatch(){return $location.hash();},function autoScrollWatchAction(newVal,oldVal){if(newVal === oldVal && newVal === '')return;jqLiteDocumentLoaded(function(){$rootScope.$evalAsync(scroll);});});}return scroll;}];}var $animateMinErr=minErr('$animate');var $AnimateProvider=['$provide',function($provide){this.$$selectors = {};this.register = function(name,factory){var key=name + '-animation';if(name && name.charAt(0) != '.')throw $animateMinErr('notcsel','Expecting class selector starting with \'.\' got \'{0}\'.',name);this.$$selectors[name.substr(1)] = key;$provide.factory(key,factory);};this.classNameFilter = function(expression){if(arguments.length === 1){this.$$classNameFilter = expression instanceof RegExp?expression:null;}return this.$$classNameFilter;};this.$get = ['$$q','$$asyncCallback','$rootScope',function($$q,$$asyncCallback,$rootScope){var currentDefer;function runAnimationPostDigest(fn){var cancelFn,defer=$$q.defer();defer.promise.$$cancelFn = function ngAnimateMaybeCancel(){cancelFn && cancelFn();};$rootScope.$$postDigest(function ngAnimatePostDigest(){cancelFn = fn(function ngAnimateNotifyComplete(){defer.resolve();});});return defer.promise;}function resolveElementClasses(element,classes){var toAdd=[],toRemove=[];var hasClasses=createMap();forEach((element.attr('class') || '').split(/\s+/),function(className){hasClasses[className] = true;});forEach(classes,function(status,className){var hasClass=hasClasses[className];if(status === false && hasClass){toRemove.push(className);}else if(status === true && !hasClass){toAdd.push(className);}});return toAdd.length + toRemove.length > 0 && [toAdd.length?toAdd:null,toRemove.length?toRemove:null];}function cachedClassManipulation(cache,classes,op){for(var i=0,ii=classes.length;i < ii;++i) {var className=classes[i];cache[className] = op;}}function asyncPromise(){if(!currentDefer){currentDefer = $$q.defer();$$asyncCallback(function(){currentDefer.resolve();currentDefer = null;});}return currentDefer.promise;}function applyStyles(element,options){if(angular.isObject(options)){var styles=extend(options.from || {},options.to || {});element.css(styles);}}return {animate:function animate(element,from,to){applyStyles(element,{from:from,to:to});return asyncPromise();},enter:function enter(element,parent,after,options){applyStyles(element,options);after?after.after(element):parent.prepend(element);return asyncPromise();},leave:function leave(element,options){applyStyles(element,options);element.remove();return asyncPromise();},move:function move(element,parent,after,options){return this.enter(element,parent,after,options);},addClass:function addClass(element,className,options){return this.setClass(element,className,[],options);},$$addClassImmediately:function $$addClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteAddClass(element,className);});applyStyles(element,options);return asyncPromise();},removeClass:function removeClass(element,className,options){return this.setClass(element,[],className,options);},$$removeClassImmediately:function $$removeClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteRemoveClass(element,className);});applyStyles(element,options);return asyncPromise();},setClass:function setClass(element,add,remove,options){var self=this;var STORAGE_KEY='$$animateClasses';var createdCache=false;element = jqLite(element);var cache=element.data(STORAGE_KEY);if(!cache){cache = {classes:{},options:options};createdCache = true;}else if(options && cache.options){cache.options = angular.extend(cache.options || {},options);}var classes=cache.classes;add = isArray(add)?add:add.split(' ');remove = isArray(remove)?remove:remove.split(' ');cachedClassManipulation(classes,add,true);cachedClassManipulation(classes,remove,false);if(createdCache){cache.promise = runAnimationPostDigest(function(done){var cache=element.data(STORAGE_KEY);element.removeData(STORAGE_KEY);if(cache){var classes=resolveElementClasses(element,cache.classes);if(classes){self.$$setClassImmediately(element,classes[0],classes[1],cache.options);}}done();});element.data(STORAGE_KEY,cache);}return cache.promise;},$$setClassImmediately:function $$setClassImmediately(element,add,remove,options){add && this.$$addClassImmediately(element,add);remove && this.$$removeClassImmediately(element,remove);applyStyles(element,options);return asyncPromise();},enabled:noop,cancel:noop};}];}];function $$AsyncCallbackProvider(){this.$get = ['$$rAF','$timeout',function($$rAF,$timeout){return $$rAF.supported?function(fn){return $$rAF(fn);}:function(fn){return $timeout(fn,0,false);};}];}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=[];self.$$completeOutstandingRequest = completeOutstandingRequest;self.$$incOutstandingRequestCount = function(){outstandingRequestCount++;};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 + 1);}self.notifyWhenNoOutstandingRequests = function(callback){forEach(pollFns,function(pollFn){pollFn();});if(outstandingRequestCount === 0){callback();}else {outstandingRequestCallbacks.push(callback);}};var pollFns=[],pollTimeout;self.addPollFn = function(fn){if(isUndefined(pollTimeout))startPoller(100,setTimeout);pollFns.push(fn);return fn;};function startPoller(interval,setTimeout){(function check(){forEach(pollFns,function(pollFn){pollFn();});pollTimeout = setTimeout(check,interval);})();}var cachedState,lastHistoryState,lastBrowserUrl=location.href,baseElement=document.find('base'),reloadLocation=null;cacheState();lastHistoryState = cachedState;self.url = function(url,replace,state){if(isUndefined(state)){state = null;}if(location !== window.location)location = window.location;if(history !== window.history)history = window.history;if(url){var sameState=lastHistoryState === state;if(lastBrowserUrl === url && (!$sniffer.history || sameState)){return self;}var sameBase=lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);lastBrowserUrl = url;lastHistoryState = state;if($sniffer.history && (!sameBase || !sameState)){history[replace?'replaceState':'pushState'](state,'',url);cacheState();lastHistoryState = cachedState;}else {if(!sameBase){reloadLocation = url;}if(replace){location.replace(url);}else if(!sameBase){location.href = url;}else {location.hash = getHash(url);}}return self;}else {return reloadLocation || location.href.replace(/%27/g,'\'');}};self.state = function(){return cachedState;};var urlChangeListeners=[],urlChangeInit=false;function cacheStateAndFireUrlChange(){cacheState();fireUrlChange();}function getCurrentState(){try{return history.state;}catch(e) {}}var lastCachedState=null;function cacheState(){cachedState = getCurrentState();cachedState = isUndefined(cachedState)?null:cachedState;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);});}self.onUrlChange = function(callback){if(!urlChangeInit){if($sniffer.history)jqLite(window).on('popstate',cacheStateAndFireUrlChange);jqLite(window).on('hashchange',cacheStateAndFireUrlChange);urlChangeInit = true;}urlChangeListeners.push(callback);return callback;};self.$$checkUrlChange = fireUrlChange;self.baseHref = function(){var href=baseElement.attr('href');return href?href.replace(/^(https?\:)?\/\/[^\/]*/,''):'';};var lastCookies={};var lastCookieString='';var cookiePath=self.baseHref();function safeDecodeURIComponent(str){try{return decodeURIComponent(str);}catch(e) {return str;}}self.cookies = function(name,value){var cookieLength,cookieArray,cookie,i,index;if(name){if(value === undefined){rawDocument.cookie = encodeURIComponent(name) + '=;path=' + cookiePath + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';}else {if(isString(value)){cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=' + cookiePath).length + 1;if(cookieLength > 4096){$log.warn('Cookie \'' + name + '\' possibly not set or overflowed because it was too large (' + cookieLength + ' > 4096 bytes)!');}}}}else {if(rawDocument.cookie !== lastCookieString){lastCookieString = rawDocument.cookie;cookieArray = lastCookieString.split('; ');lastCookies = {};for(i = 0;i < cookieArray.length;i++) {cookie = cookieArray[i];index = cookie.indexOf('=');if(index > 0){name = safeDecodeURIComponent(cookie.substring(0,index));if(lastCookies[name] === undefined){lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));}}}}return lastCookies;}};self.defer = function(fn,delay){var timeoutId;outstandingRequestCount++;timeoutId = setTimeout(function(){delete pendingDeferIds[timeoutId];completeOutstandingRequest(fn);},delay || 0);pendingDeferIds[timeoutId] = true;return timeoutId;};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);}];}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;return caches[cacheId] = {put:function put(key,value){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key] || (lruHash[key] = {key:key});refresh(lruEntry);}if(isUndefined(value))return;if(!(key in data))size++;data[key] = value;if(size > capacity){this.remove(staleEnd.key);}return value;},get:function get(key){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;refresh(lruEntry);}return data[key];},remove:function remove(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--;},removeAll:function removeAll(){data = {};size = 0;lruHash = {};freshEnd = staleEnd = null;},destroy:function destroy(){data = null;stats = null;lruHash = null;delete caches[cacheId];},info:function info(){return extend({},stats,{size:size});}};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;}}function link(nextEntry,prevEntry){if(nextEntry != prevEntry){if(nextEntry)nextEntry.p = prevEntry;if(prevEntry)prevEntry.n = nextEntry;}}}cacheFactory.info = function(){var info={};forEach(caches,function(cache,cacheId){info[cacheId] = cache.info();});return info;};cacheFactory.get = function(cacheId){return caches[cacheId];};return cacheFactory;};}function $TemplateCacheProvider(){this.$get = ['$cacheFactory',function($cacheFactory){return $cacheFactory('templates');}];}var $compileMinErr=minErr('$compile');$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=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/;var EVENT_HANDLER_ATTR_REGEXP=/^(on[a-z]+|formaction)$/;function parseIsolateBindings(scope,directiveName){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 isolate scope definition for directive \'{0}\'.' + ' Definition: {... {1}: \'{2}\' ...}',directiveName,scopeName,definition);}bindings[scopeName] = {mode:match[1][0],collection:match[2] === '*',optional:match[3] === '?',attrName:match[4] || scopeName};});return bindings;}this.directive = function registerDirective(name,directiveFactory){assertNotHasOwnProperty(name,'directive');if(isString(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';if(isObject(directive.scope)){directive.$$isolateBindings = parseIsolateBindings(directive.scope,directive.name);}directives.push(directive);}catch(e) {$exceptionHandler(e);}});return directives;}]);}hasDirectives[name].push(directiveFactory);}else {forEach(name,reverseParams(registerDirective));}return this;};this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.aHrefSanitizationWhitelist();}};this.imgSrcSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();}};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 Attributes(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 = {$normalize:directiveNormalize,$addClass:function $addClass(classVal){if(classVal && classVal.length > 0){$animate.addClass(this.$$element,classVal);}},$removeClass:function $removeClass(classVal){if(classVal && classVal.length > 0){$animate.removeClass(this.$$element,classVal);}},$updateClass:function $updateClass(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:function $set(key,value,writeAttr,attrName){var node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(node,key),observer=key,nodeName;if(booleanKey){this.$$element.prop(key,value);attrName = booleanKey;}else if(aliasedKey){this[aliasedKey] = value;observer = aliasedKey;}this[key] = value;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'){this[key] = value = $$sanitizeUri(value,key === 'src');}else if(nodeName === 'img' && key === 'srcset'){var result='';var trimmedSrcset=trim(value);var srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;var pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/;var rawUris=trimmedSrcset.split(pattern);var nbrUrisWith2parts=Math.floor(rawUris.length / 2);for(var i=0;i < nbrUrisWith2parts;i++) {var innerIdx=i * 2;result += $$sanitizeUri(trim(rawUris[innerIdx]),true);result += ' ' + trim(rawUris[innerIdx + 1]);}var lastTuple=trim(rawUris[i * 2]).split(/\s/);result += $$sanitizeUri(trim(lastTuple[0]),true);if(lastTuple.length === 2){result += ' ' + trim(lastTuple[1]);}this[key] = value = result;}if(writeAttr !== false){if(value === null || value === undefined){this.$$element.removeAttr(attrName);}else {this.$$element.attr(attrName,value);}}var $$observers=this.$$observers;$$observers && forEach($$observers[observer],function(fn){try{fn(value);}catch(e) {$exceptionHandler(e);}});},$observe:function $observe(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)){fn(attrs[key]);}});return function(){arrayRemove(listeners,fn);};}};function safeAddClass($element,className){try{$element.addClass(className);}catch(e) {}}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)){$compileNodes = jqLite($compileNodes);}forEach($compileNodes,function(node,index){if(node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/)){$compileNodes[index] = jqLite(node).wrap('').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;if(parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude){parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;}if(!namespace){namespace = detectNamespaceForChildElements(futureParentElement);}var $linkNode;if(namespace !== 'html'){$linkNode = jqLite(wrapTemplate(namespace,jqLite('
').append($compileNodes).html()));}else if(cloneConnectFn){$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){var node=parentElement && parentElement[0];if(!node){return 'html';}else {return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/)?'svg':'html';}}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();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;}previousCompileContext = null;}return linkFnFound?compositeLinkFn:null;function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn;var stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;stableNodeList = new Array(nodeListLength);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);}else {childScope = scope;}if(nodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,nodeLinkFn.transclude,parentBoundTranscludeFn,nodeLinkFn.elementTranscludeOnThisElement);}else if(!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn){childBoundTranscludeFn = parentBoundTranscludeFn;}else if(!parentBoundTranscludeFn && transcludeFn){childBoundTranscludeFn = createBoundTranscludeFn(scope,transcludeFn);}else {childBoundTranscludeFn = null;}nodeLinkFn(childLinkFn,childScope,node,$rootElement,childBoundTranscludeFn);}else if(childLinkFn){childLinkFn(scope,node.childNodes,undefined,parentBoundTranscludeFn);}}}}function createBoundTranscludeFn(scope,transcludeFn,previousBoundTranscludeFn,elementTransclusion){var boundTranscludeFn=function boundTranscludeFn(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;}function collectDirectives(node,directives,attrs,maxPriority,ignoreDirective){var nodeType=node.nodeType,attrsMap=attrs.$attr,match,className;switch(nodeType){case NODE_TYPE_ELEMENT:addDirective(directives,directiveNormalize(nodeName_(node)),'E',maxPriority,ignoreDirective);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);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;}}addAttrInterpolateDirective(node,directives,value,nName,isNgAttr);addDirective(directives,nName,'A',maxPriority,ignoreDirective,attrStartName,attrEndName);}className = node.className;if(isObject(className)){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:addTextInterpolateDirective(directives,node.nodeValue);break;case NODE_TYPE_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) {}break;}directives.sort(byPriority);return directives;}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);}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);};}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){previousCompileContext = previousCompileContext || {};var terminalPriority=-Number.MAX_VALUE,newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,controllers,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;for(var i=0,ii=directives.length;i < ii;i++) {directive = directives[i];var attrStart=directive.$$start;var attrEnd=directive.$$end;if(attrStart){$compileNode = groupScan(compileNode,attrStart,attrEnd);}$template = undefined;if(terminalPriority > directive.priority){break;}if(directiveValue = directive.scope){if(!directive.templateUrl){if(isObject(directiveValue)){assertNoDuplicate('new/isolated scope',newIsolateScopeDirective || newScopeDirective,directive,$compileNode);newIsolateScopeDirective = directive;}else {assertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);}}newScopeDirective = newScopeDirective || directive;}directiveName = directive.name;if(!directive.templateUrl && directive.controller){directiveValue = directive.controller;controllerDirectives = controllerDirectives || {};assertNoDuplicate('\'' + directiveName + '\' controller',controllerDirectives[directiveName],directive,$compileNode);controllerDirectives[directiveName] = directive;}if(directiveValue = directive.transclude){hasTranscludeDirective = true;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,{nonTlbTranscludeDirective:nonTlbTranscludeDirective});}else {$template = jqLite(jqLiteClone(compileNode)).contents();$compileNode.empty();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:{}};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,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.elementTranscludeOnThisElement = hasElementTranscludeDirective;nodeLinkFn.templateOnThisElement = hasTemplate;nodeLinkFn.transclude = childTranscludeFn;previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;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,retrievalMethod='data',optional=false;var $searchElement=$element;var match;if(isString(require)){match = require.match(REQUIRE_PREFIX_REGEXP);require = require.substring(match[0].length);if(match[3]){if(match[1])match[3] = null;else match[1] = match[3];}if(match[1] === '^'){retrievalMethod = 'inheritedData';}else if(match[1] === '^^'){retrievalMethod = 'inheritedData';$searchElement = $element.parent();}if(match[2] === '?'){optional = true;}value = null;if(elementControllers && retrievalMethod === 'data'){if(value = elementControllers[require]){value = value.instance;}}value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');if(!value && !optional){throw $compileMinErr('ctreq','Controller \'{0}\', required by directive \'{1}\', can\'t be found!',require,directiveName);}return value || null;}else if(isArray(require)){value = [];forEach(require,function(require){value.push(getControllers(directiveName,require,$element,elementControllers));});}return value;}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){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){transcludeFn = controllersBoundTransclude;transcludeFn.$$boundTransclude = boundTranscludeFn;}if(controllerDirectives){controllers = {};elementControllers = {};forEach(controllerDirectives,function(directive){var locals={$scope:directive === newIsolateScopeDirective || directive.$$isolateScope?isolateScope:scope,$element:$element,$attrs:attrs,$transclude:transcludeFn},controllerInstance;controller = directive.controller;if(controller == '@'){controller = attrs[directive.name];}controllerInstance = $controller(controller,locals,true,directive.controllerAs);elementControllers[directive.name] = controllerInstance;if(!hasElementTranscludeDirective){$element.data('$' + directive.name + 'Controller',controllerInstance.instance);}controllers[directive.name] = controllerInstance;});}if(newIsolateScopeDirective){compile.$$addScopeInfo($element,isolateScope,true,!(templateDirective && (templateDirective === newIsolateScopeDirective || templateDirective === newIsolateScopeDirective.$$originalDirective)));compile.$$addScopeClass($element,true);var isolateScopeController=controllers && controllers[newIsolateScopeDirective.name];var isolateBindingContext=isolateScope;if(isolateScopeController && isolateScopeController.identifier && newIsolateScopeDirective.bindToController === true){isolateBindingContext = isolateScopeController.instance;}forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings,function(definition,scopeName){var attrName=definition.attrName,optional=definition.optional,mode=definition.mode,lastValue,parentGet,parentSet,compare;switch(mode){case '@':attrs.$observe(attrName,function(value){isolateBindingContext[scopeName] = value;});attrs.$$observers[attrName].$$scope = scope;if(attrs[attrName]){isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);}break;case '=':if(optional && !attrs[attrName]){return;}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(){lastValue = isolateBindingContext[scopeName] = parentGet(scope);throw $compileMinErr('nonassign','Expression \'{0}\' used with directive \'{1}\' is non-assignable!',attrs[attrName],newIsolateScopeDirective.name);};lastValue = isolateBindingContext[scopeName] = parentGet(scope);var parentValueWatch=function parentValueWatch(parentValue){if(!compare(parentValue,isolateBindingContext[scopeName])){if(!compare(parentValue,lastValue)){isolateBindingContext[scopeName] = parentValue;}else {parentSet(scope,parentValue = isolateBindingContext[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);}isolateScope.$on('$destroy',unwatch);break;case '&':parentGet = $parse(attrs[attrName]);isolateBindingContext[scopeName] = function(locals){return parentGet(scope,locals);};break;}});}if(controllers){forEach(controllers,function(controller){controller();});controllers = null;}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);}var scopeToChild=scope;if(newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)){scopeToChild = isolateScope;}childLinkFn && childLinkFn(scopeToChild,linkNode.childNodes,undefined,boundTranscludeFn);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);}function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement){var transcludeControllers;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){for(var j=0,jj=directives.length;j < jj;j++) {directives[j] = inherit(directives[j],{$$isolateScope:true});}}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((maxPriority === undefined || 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;}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;}function mergeTemplateAttributes(dst,src){var srcAttr=src.$attr,dstAttr=dst.$attr,$element=dst.$$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]);}});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;}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($sce.getTrustedResourceUrl(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)){linkNode = jqLiteClone(compileNode);}replaceWith(linkRootElement,jqLite(beforeTemplateLinkNode),linkNode);safeAddClass(jqLite(linkNode),oldClasses);}if(afterTemplateNodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn);}else {childBoundTranscludeFn = boundTranscludeFn;}afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,linkNode,$rootElement,childBoundTranscludeFn);}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);}};}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){if(previousDirective){throw $compileMinErr('multidir','Multiple directives [{0}, {1}] asking for {2} on: {3}',previousDirective.name,directive.name,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;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 + '';return wrapper.childNodes[0].childNodes;default:return template;}}function getTrustedContext(node,attrNormalizedName){if(attrNormalizedName == 'srcdoc'){return $sce.HTML;}var tag=nodeName_(node);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);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 compile(){return {pre:function attrInterpolatePreLinkFn(scope,element,attr){var $$observers=attr.$$observers || (attr.$$observers = {});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.');}var newValue=attr[name];if(newValue !== value){interpolateFn = newValue && $interpolate(newValue,true,trustedContext,allOrNothing);value = newValue;}if(!interpolateFn)return;attr[name] = interpolateFn(scope);($$observers[name] || ($$observers[name] = [])).$$inter = true;(attr.$$observers && attr.$$observers[name].$$scope || scope).$watch(interpolateFn,function interpolateFnWatchAction(newValue,oldValue){if(name === 'class' && newValue != oldValue){attr.$updateClass(newValue,oldValue);}else {attr.$set(name,newValue);}});}};}});}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($rootElement.context === firstElementToRemove){$rootElement.context = newNode;}break;}}}if(parent){parent.replaceChild(newNode,firstElementToRemove);}var fragment=document.createDocumentFragment();fragment.appendChild(firstElementToRemove);jqLite(newNode).data(jqLite(firstElementToRemove).data());if(!jQuery){delete jqLite.cache[firstElementToRemove[jqLite.expando]];}else {skipDestroyOnNextJQueryCleanData = true;jQuery.cleanData([firstElementToRemove]);}for(var k=1,kk=elementsToRemove.length;k < kk;k++) {var element=elementsToRemove[k];jqLite(element).remove();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));}}}];}var PREFIX_REGEXP=/^((?:x|data)[\:\-_])/i;function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}function nodesetLinkingFn(scope,nodeList,rootElement,boundTranscludeFn){}function directiveLinkingFn(nodesetLinkingFn,scope,node,rootElement,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');function $ControllerProvider(){var controllers={},globals=false,CNTRL_REG=/^(\S+)(\s+as\s+(\w+))?$/;this.register = function(name,constructor){assertNotHasOwnProperty(name,'controller');if(isObject(name)){extend(controllers,name);}else {controllers[name] = constructor;}};this.allowGlobals = function(){globals = true;};this.$get = ['$injector','$window',function($injector,$window){return function(expression,locals,later,ident){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){var controllerPrototype=(isArray(expression)?expression[expression.length - 1]:expression).prototype;instance = Object.create(controllerPrototype || null);if(identifier){addIdentifier(locals,identifier,instance,constructor || expression.name);}return extend(function(){$injector.invoke(expression,instance,locals,constructor);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;}}];}function $DocumentProvider(){this.$get = ['$window',function(window){return jqLite(window.document);}];}function $ExceptionHandlerProvider(){this.$get = ['$log',function($log){return function(exception,cause){$log.error.apply($log,arguments);};}];}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/;function defaultHttpResponseTransform(data,headers){if(isString(data)){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);}function parseHeaders(headers){var parsed=createMap(),key,val,i;if(!headers)return parsed;forEach(headers.split('\n'),function(line){i = line.indexOf(':');key = lowercase(trim(line.substr(0,i)));val = trim(line.substr(i + 1));if(key){parsed[key] = parsed[key]?parsed[key] + ', ' + val:val;}});return parsed;}function headersGetter(headers){var headersObj=isObject(headers)?headers:undefined;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;};}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;}function $HttpProvider(){var defaults=this.defaults = {transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d)?toJson(d):d;}],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'};var useApplyAsync=false;this.useApplyAsync = function(value){if(isDefined(value)){useApplyAsync = !!value;return this;}return useApplyAsync;};var interceptorFactories=this.interceptors = [];this.$get = ['$httpBackend','$browser','$cacheFactory','$rootScope','$q','$injector',function($httpBackend,$browser,$cacheFactory,$rootScope,$q,$injector){var defaultCache=$cacheFactory('$http');var reversedInterceptors=[];forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory));});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},requestConfig);config.headers = mergeHeaders(requestConfig);config.method = uppercase(config.method);var serverRequest=function serverRequest(config){var headers=config.headers;var reqData=transformData(config.data,headersGetter(headers),undefined,config.transformRequest);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;}return sendReq(config,reqData).then(transformResponse,transformResponse);};var chain=[serverRequest,undefined];var promise=$q.when(config);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);}promise.success = function(fn){promise.then(function(response){fn(response.data,response.status,response.headers,config);});return promise;};promise.error = function(fn){promise.then(null,function(response){fn(response.data,response.status,response.headers,config);});return promise;};return promise;function transformResponse(response){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){var headerContent,processedHeaders={};forEach(headers,function(headerFn,header){if(isFunction(headerFn)){headerContent = headerFn();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)]);defaultHeadersIteration: for(defHeaderName in defHeaders) {lowercaseDefHeaderName = lowercase(defHeaderName);for(reqHeaderName in reqHeaders) {if(lowercase(reqHeaderName) === lowercaseDefHeaderName){continue defaultHeadersIteration;}}reqHeaders[defHeaderName] = defHeaders[defHeaderName];}return executeHeaderFns(reqHeaders);}}$http.pendingRequests = [];createShortMethods('get','delete','head','jsonp');createShortMethodsWithData('post','put','patch');$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}));};});}function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,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)){cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else {if(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else {resolvePromise(cachedResp,200,{},'OK');}}}else {cache.put(url,promise);}}if(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$browser.cookies()[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;function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else {cache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else {resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}function resolvePromise(response,status,headers,statusText){status = Math.max(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,params){if(!params)return url;var parts=[];forEachSorted(params,function(value,key){if(value === null || isUndefined(value))return;if(!isArray(value))value = [value];forEach(value,function(v){if(isObject(v)){if(isDate(v)){v = v.toISOString();}else {v = toJson(v);}}parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));});});if(parts.length > 0){url += (url.indexOf('?') == -1?'?':'&') + parts.join('&');}return url;}}];}function createXhr(){return new window.XMLHttpRequest();}function $HttpBackendProvider(){this.$get = ['$browser','$window','$document',function($browser,$window,$document){return createHttpBackend($browser,createXhr,$browser.defer,$window.angular.callbacks,$document[0]);}];}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){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();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 || '';var response='response' in xhr?xhr.response:xhr.responseText;var status=xhr.status === 1223?204:xhr.status;if(status === 0){status = response?200:urlResolve(url).protocol == 'file'?404:0;}completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText);};var requestError=function requestError(){completeRequest(callback,-1,null,null,'');};xhr.onerror = requestError;xhr.onabort = requestError;if(withCredentials){xhr.withCredentials = true;}if(responseType){try{xhr.responseType = responseType;}catch(e) {if(responseType !== 'json'){throw e;}}}xhr.send(post || null);}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){if(timeoutId !== undefined){$browserDefer.cancel(timeoutId);}jsonpDone = xhr = null;callback(status,response,headersString,statusText);$browser.$$completeOutstandingRequest(noop);}};function jsonpReq(url,callbackId,done){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=minErr('$interpolate');function $InterpolateProvider(){var startSymbol='{{';var endSymbol='}}';this.startSymbol = function(value){if(value){startSymbol = value;return this;}else {return startSymbol;}};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 $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 {if(index !== textLength){concat.push(unescapeText(text.substring(index)));}break;}}if(trustedContext && concat.length > 1){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);}if(!mustHaveExpression || expressions.length){var compute=function compute(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 getValue(value){return trustedContext?$sce.getTrusted(trustedContext,value):$sce.valueOf(value);};var stringify=function stringify(value){if(value == null){return '';}switch(typeof value){case 'string':break;case 'number':value = '' + value;break;default:value = toJson(value);}return 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) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}},{exp:text,expressions:expressions,$$watchDelegate:function $$watchDelegate(scope,listener,objectEquality){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;},objectEquality);}});}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol);}function parseStringifyInterceptor(value){try{value = getValue(value);return allOrNothing && !isDefined(value)?value:stringify(value);}catch(err) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}}}$interpolate.startSymbol = function(){return startSymbol;};$interpolate.endSymbol = function(){return endSymbol;};return $interpolate;}];}function $IntervalProvider(){this.$get = ['$rootScope','$window','$q','$$q',function($rootScope,$window,$q,$$q){var intervals={};function interval(fn,delay,count,invokeApply){var 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,fn);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;}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;}];}function $LocaleProvider(){this.$get = function(){return {id:'en-us',NUMBER_FORMATS:{DECIMAL_SEP:'.',GROUP_SEP:',',PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:'',posSuf:'',negPre:'-',negSuf:'',gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:'¤',posSuf:'',negPre:'(¤',negSuf:')',gSize:3,lgSize:3}],CURRENCY_SYM:'$'},DATETIME_FORMATS:{MONTH:'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),SHORTMONTH:'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),DAY:'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),SHORTDAY:'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),AMPMS:['AM','PM'],medium:'MMM d, y h:mm:ss a','short':'M/d/yy h:mm a',fullDate:'EEEE, MMMM d, y',longDate:'MMMM d, y',mediumDate:'MMM d, y',shortDate:'M/d/yy',mediumTime:'h:mm:ss a',shortTime:'h:mm a',ERANAMES:['Before Christ','Anno Domini'],ERAS:['BC','AD']},pluralCat:function pluralCat(num){if(num === 1){return 'one';}return 'other';}};};}var PATH_MATCH=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={'http':80,'https':443,'ftp':21};var $locationMinErr=minErr('$location');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 = int(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);if(locationObj.$$path && locationObj.$$path.charAt(0) != '/'){locationObj.$$path = '/' + locationObj.$$path;}}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);}function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//') + 2));}function LocationHtml5Url(appBase,basePrefix){this.$$html5 = true;basePrefix = basePrefix || '';var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);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();};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);};this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){this.hash(relHref.slice(1));return true;}var appUrl,prevAppUrl;var rewrittenUrl;if((appUrl = beginsWith(appBase,url)) !== undefined){prevAppUrl = appUrl;if((appUrl = beginsWith(basePrefix,appUrl)) !== undefined){rewrittenUrl = appBaseNoFile + (beginsWith('/',appUrl) || appUrl);}else {rewrittenUrl = appBase + prevAppUrl;}}else if((appUrl = beginsWith(appBaseNoFile,url)) !== undefined){rewrittenUrl = appBaseNoFile + appUrl;}else if(appBaseNoFile == url + '/'){rewrittenUrl = appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};}function LocationHashbangUrl(appBase,hashPrefix){var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);this.$$parse = function(url){var withoutBaseUrl=beginsWith(appBase,url) || beginsWith(appBaseNoFile,url);var withoutHashUrl;if(withoutBaseUrl.charAt(0) === '#'){withoutHashUrl = beginsWith(hashPrefix,withoutBaseUrl);if(isUndefined(withoutHashUrl)){withoutHashUrl = withoutBaseUrl;}}else {withoutHashUrl = this.$$html5?withoutBaseUrl:'';}parseAppUrl(withoutHashUrl,this);this.$$path = removeWindowsDriveName(this.$$path,withoutHashUrl,appBase);this.$$compose();function removeWindowsDriveName(path,url,base){var windowsFilePathExp=/^\/[A-Z]:(\/.*)/;var firstPathSegmentMatch;if(url.indexOf(base) === 0){url = url.replace(base,'');}if(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch = windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}};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;};}function LocationHashbangInHtml5Url(appBase,hashPrefix){this.$$html5 = true;LocationHashbangUrl.apply(this,arguments);var appBaseNoFile=stripFile(appBase);this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){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;this.$$absUrl = appBase + hashPrefix + this.$$url;};}var locationPrototype={$$html5:false,$$replace:false,absUrl:locationGetter('$$absUrl'),url:function url(_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;},protocol:locationGetter('$$protocol'),host:locationGetter('$$host'),port:locationGetter('$$port'),path:locationGetterSetter('$$path',function(path){path = path !== null?path.toString():'';return path.charAt(0) == '/'?path:'/' + path;}),search:function search(_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,{});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;},hash:locationGetterSetter('$$hash',function(hash){return hash !== null?hash.toString():'';}),replace:function replace(){this.$$replace = true;return this;}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype = Object.create(locationPrototype);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');}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;};}function $LocationProvider(){var hashPrefix='',html5Mode={enabled:false,requireBase:true,rewriteLinks:true};this.hashPrefix = function(prefix){if(isDefined(prefix)){hashPrefix = prefix;return this;}else {return hashPrefix;}};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;}};this.$get = ['$rootScope','$browser','$sniffer','$rootElement','$window',function($rootScope,$browser,$sniffer,$rootElement,$window){var $location,LocationMode,baseHref=$browser.baseHref(),initialUrl=$browser.url(),appBase;if(html5Mode.enabled){if(!baseHref && html5Mode.requireBase){throw $locationMinErr('nobase','$location in HTML5 mode requires a tag to be present!');}appBase = serverBase(initialUrl) + (baseHref || '/');LocationMode = $sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url;}else {appBase = stripHash(initialUrl);LocationMode = LocationHashbangUrl;}$location = new LocationMode(appBase,'#' + 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);$location.$$state = $browser.state();}catch(e) {$location.url(oldUrl);$location.$$state = oldState;throw e;}}$rootElement.on('click',function(event){if(!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2)return;var elm=jqLite(event.target);while(nodeName_(elm[0]) !== 'a') {if(elm[0] === $rootElement[0] || !(elm = elm.parent())[0])return;}var absHref=elm.prop('href');var relHref=elm.attr('href') || elm.attr('xlink:href');if(isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]'){absHref = urlResolve(absHref.animVal).href;}if(IGNORE_URI_REGEXP.test(absHref))return;if(absHref && !elm.attr('target') && !event.isDefaultPrevented()){if($location.$$parseLinkUrl(absHref,relHref)){event.preventDefault();if($location.absUrl() != $browser.url()){$rootScope.$apply();$window.angular['ff-684208-preventDefault'] = true;}}}});if(trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)){$browser.url($location.absUrl(),true);}var initializing=true;$browser.onUrlChange(function(newUrl,newState){$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($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();});$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($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;});return $location;function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast('$locationChangeSuccess',$location.absUrl(),oldUrl,$location.$$state,oldState);}}];}function $LogProvider(){var debug=true,self=this;this.debugEnabled = function(flag){if(isDefined(flag)){debug = flag;return this;}else {return debug;}};this.$get = ['$window',function($window){return {log:consoleLog('log'),info:consoleLog('info'),warn:consoleLog('warn'),error:consoleLog('error'),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;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);};}return function(arg1,arg2){logFn(arg1,arg2 == null?'':arg2);};}}];}var $parseMinErr=minErr('$parse');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 ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor === obj){throw $parseMinErr('isecfn','Referencing Function in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(obj.window === obj){throw $parseMinErr('isecwindow','Referencing the Window in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(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(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);}}}var CONSTANTS=createMap();forEach({'null':function _null(){return null;},'true':function _true(){return true;},'false':function _false(){return false;},'undefined':function undefined(){}},function(constantGetter,name){constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;CONSTANTS[name] = constantGetter;});CONSTANTS['this'] = function(self){return self;};CONSTANTS['this'].sharedGetter = true;var OPERATORS=extend(createMap(),{'+':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);if(isDefined(a)){if(isDefined(b)){return a + b;}return a;}return isDefined(b)?b:undefined;},'-':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);return (isDefined(a)?a:0) - (isDefined(b)?b:0);},'*':function _(self,locals,a,b){return a(self,locals) * b(self,locals);},'/':function _(self,locals,a,b){return a(self,locals) / b(self,locals);},'%':function _(self,locals,a,b){return a(self,locals) % b(self,locals);},'===':function _(self,locals,a,b){return a(self,locals) === b(self,locals);},'!==':function _(self,locals,a,b){return a(self,locals) !== b(self,locals);},'==':function _(self,locals,a,b){return a(self,locals) == b(self,locals);},'!=':function _(self,locals,a,b){return a(self,locals) != b(self,locals);},'<':function _(self,locals,a,b){return a(self,locals) < b(self,locals);},'>':function _(self,locals,a,b){return a(self,locals) > b(self,locals);},'<=':function _(self,locals,a,b){return a(self,locals) <= b(self,locals);},'>=':function _(self,locals,a,b){return a(self,locals) >= b(self,locals);},'&&':function _(self,locals,a,b){return a(self,locals) && b(self,locals);},'||':function _(self,locals,a,b){return a(self,locals) || b(self,locals);},'!':function _(self,locals,a){return !a(self,locals);},'=':true,'|':true});var ESCAPE={'n':'\n','f':'\f','r':'\r','t':'\t','v':'\u000b','\'':'\'','"':'"'};var Lexer=function Lexer(options){this.options = options;};Lexer.prototype = {constructor:Lexer,lex:function lex(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 is(ch,chars){return chars.indexOf(ch) !== -1;},peek:function peek(i){var num=i || 1;return this.index + num < this.text.length?this.text.charAt(this.index + num):false;},isNumber:function isNumber(ch){return '0' <= ch && ch <= '9' && typeof ch === 'string';},isWhitespace:function isWhitespace(ch){return ch === ' ' || ch === '\r' || ch === '\t' || ch === '\n' || ch === '\u000b' || ch === ' ';},isIdent:function isIdent(ch){return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || '_' === ch || ch === '$';},isExpOperator:function isExpOperator(ch){return ch === '-' || ch === '+' || this.isNumber(ch);},throwError:function throwError(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 readNumber(){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 readIdent(){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 readString(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);}};function isConstant(exp){return exp.constant;}var Parser=function Parser(lexer,$filter,options){this.lexer = lexer;this.$filter = $filter;this.options = options;};Parser.ZERO = extend(function(){return 0;},{sharedGetter:true,constant:true});Parser.prototype = {constructor:Parser,parse:function parse(text){this.text = text;this.tokens = this.lexer.lex(text);var value=this.statements();if(this.tokens.length !== 0){this.throwError('is an unexpected token',this.tokens[0]);}value.literal = !!value.literal;value.constant = !!value.constant;return value;},primary:function primary(){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.peek().identifier && this.peek().text in CONSTANTS){primary = 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,context;while(next = this.expect('(','[','.')) {if(next.text === '('){primary = this.functionCall(primary,context);context = null;}else if(next.text === '['){context = primary;primary = this.objectIndex(primary);}else if(next.text === '.'){context = primary;primary = this.fieldAccess(primary);}else {this.throwError('IMPOSSIBLE');}}return primary;},throwError:function throwError(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));},peekToken:function peekToken(){if(this.tokens.length === 0)throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);return this.tokens[0];},peek:function peek(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4);},peekAhead:function peekAhead(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 expect(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);if(token){this.tokens.shift();return token;}return false;},consume:function consume(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;},unaryFn:function unaryFn(op,right){var fn=OPERATORS[op];return extend(function $parseUnaryFn(self,locals){return fn(self,locals,right);},{constant:right.constant,inputs:[right]});},binaryFn:function binaryFn(left,op,right,isBranching){var fn=OPERATORS[op];return extend(function $parseBinaryFn(self,locals){return fn(self,locals,left,right);},{constant:left.constant && right.constant,inputs:!isBranching && [left,right]});},identifier:function identifier(){var id=this.consume().text;while(this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2,'(')) {id += this.consume().text + this.consume().text;}return getterFn(id,this.options,this.text);},constant:function constant(){var value=this.consume().value;return extend(function $parseConstant(){return value;},{constant:true,literal:true});},statements:function statements(){var statements=[];while(true) {if(this.tokens.length > 0 && !this.peek('}',')',';',']'))statements.push(this.filterChain());if(!this.expect(';')){return statements.length === 1?statements[0]:function $parseStatements(self,locals){var value;for(var i=0,ii=statements.length;i < ii;i++) {value = statements[i](self,locals);}return value;};}}},filterChain:function filterChain(){var left=this.expression();var token;while(token = this.expect('|')) {left = this.filter(left);}return left;},filter:function filter(inputFn){var fn=this.$filter(this.consume().text);var argsFn;var args;if(this.peek(':')){argsFn = [];args = [];while(this.expect(':')) {argsFn.push(this.expression());}}var inputs=[inputFn].concat(argsFn || []);return extend(function $parseFilter(self,locals){var input=inputFn(self,locals);if(args){args[0] = input;var i=argsFn.length;while(i--) {args[i + 1] = argsFn[i](self,locals);}return fn.apply(undefined,args);}return fn(input);},{constant:!fn.$stateful && inputs.every(isConstant),inputs:!fn.$stateful && inputs});},expression:function expression(){return this.assignment();},assignment:function assignment(){var left=this.ternary();var right;var token;if(token = this.expect('=')){if(!left.assign){this.throwError('implies assignment but [' + this.text.substring(0,token.index) + '] can not be assigned to',token);}right = this.ternary();return extend(function $parseAssignment(scope,locals){return left.assign(scope,right(scope,locals),locals);},{inputs:[left,right]});}return left;},ternary:function ternary(){var left=this.logicalOR();var middle;var token;if(token = this.expect('?')){middle = this.assignment();if(this.consume(':')){var right=this.assignment();return extend(function $parseTernary(self,locals){return left(self,locals)?middle(self,locals):right(self,locals);},{constant:left.constant && middle.constant && right.constant});}}return left;},logicalOR:function logicalOR(){var left=this.logicalAND();var token;while(token = this.expect('||')) {left = this.binaryFn(left,token.text,this.logicalAND(),true);}return left;},logicalAND:function logicalAND(){var left=this.equality();var token;while(token = this.expect('&&')) {left = this.binaryFn(left,token.text,this.equality(),true);}return left;},equality:function equality(){var left=this.relational();var token;while(token = this.expect('==','!=','===','!==')) {left = this.binaryFn(left,token.text,this.relational());}return left;},relational:function relational(){var left=this.additive();var token;while(token = this.expect('<','>','<=','>=')) {left = this.binaryFn(left,token.text,this.additive());}return left;},additive:function additive(){var left=this.multiplicative();var token;while(token = this.expect('+','-')) {left = this.binaryFn(left,token.text,this.multiplicative());}return left;},multiplicative:function multiplicative(){var left=this.unary();var token;while(token = this.expect('*','/','%')) {left = this.binaryFn(left,token.text,this.unary());}return left;},unary:function unary(){var token;if(this.expect('+')){return this.primary();}else if(token = this.expect('-')){return this.binaryFn(Parser.ZERO,token.text,this.unary());}else if(token = this.expect('!')){return this.unaryFn(token.text,this.unary());}else {return this.primary();}},fieldAccess:function fieldAccess(object){var getter=this.identifier();return extend(function $parseFieldAccess(scope,locals,self){var o=self || object(scope,locals);return o == null?undefined:getter(o);},{assign:function assign(scope,value,locals){var o=object(scope,locals);if(!o)object.assign(scope,o = {},locals);return getter.assign(o,value);}});},objectIndex:function objectIndex(obj){var expression=this.text;var indexFn=this.expression();this.consume(']');return extend(function $parseObjectIndex(self,locals){var o=obj(self,locals),i=indexFn(self,locals),v;ensureSafeMemberName(i,expression);if(!o)return undefined;v = ensureSafeObject(o[i],expression);return v;},{assign:function assign(self,value,locals){var key=ensureSafeMemberName(indexFn(self,locals),expression);var o=ensureSafeObject(obj(self,locals),expression);if(!o)obj.assign(self,o = {},locals);return o[key] = value;}});},functionCall:function functionCall(fnGetter,contextGetter){var argsFn=[];if(this.peekToken().text !== ')'){do {argsFn.push(this.expression());}while(this.expect(','));}this.consume(')');var expressionText=this.text;var args=argsFn.length?[]:null;return function $parseFunctionCall(scope,locals){var context=contextGetter?contextGetter(scope,locals):isDefined(contextGetter)?undefined:scope;var fn=fnGetter(scope,locals,context) || noop;if(args){var i=argsFn.length;while(i--) {args[i] = ensureSafeObject(argsFn[i](scope,locals),expressionText);}}ensureSafeObject(context,expressionText);ensureSafeFunction(fn,expressionText);var v=fn.apply?fn.apply(context,args):fn(args[0],args[1],args[2],args[3],args[4]);if(args){args.length = 0;}return ensureSafeObject(v,expressionText);};},arrayDeclaration:function arrayDeclaration(){var elementFns=[];if(this.peekToken().text !== ']'){do {if(this.peek(']')){break;}elementFns.push(this.expression());}while(this.expect(','));}this.consume(']');return extend(function $parseArrayLiteral(self,locals){var array=[];for(var i=0,ii=elementFns.length;i < ii;i++) {array.push(elementFns[i](self,locals));}return array;},{literal:true,constant:elementFns.every(isConstant),inputs:elementFns});},object:function object(){var keys=[],valueFns=[];if(this.peekToken().text !== '}'){do {if(this.peek('}')){break;}var token=this.consume();if(token.constant){keys.push(token.value);}else if(token.identifier){keys.push(token.text);}else {this.throwError('invalid key',token);}this.consume(':');valueFns.push(this.expression());}while(this.expect(','));}this.consume('}');return extend(function $parseObjectLiteral(self,locals){var object={};for(var i=0,ii=valueFns.length;i < ii;i++) {object[keys[i]] = valueFns[i](self,locals);}return object;},{literal:true,constant:valueFns.every(isConstant),inputs:valueFns});}};function setter(obj,locals,path,setValue,fullExp){ensureSafeObject(obj,fullExp);ensureSafeObject(locals,fullExp);var element=path.split('.'),key;for(var i=0;element.length > 1;i++) {key = ensureSafeMemberName(element.shift(),fullExp);var propertyObj=i === 0 && locals && locals[key] || obj[key];if(!propertyObj){propertyObj = {};obj[key] = propertyObj;}obj = ensureSafeObject(propertyObj,fullExp);}key = ensureSafeMemberName(element.shift(),fullExp);ensureSafeObject(obj[key],fullExp);obj[key] = setValue;return setValue;}var getterFnCacheDefault=createMap();var getterFnCacheExpensive=createMap();function isPossiblyDangerousMemberName(name){return name == 'constructor';}function cspSafeGetterFn(key0,key1,key2,key3,key4,fullExp,expensiveChecks){ensureSafeMemberName(key0,fullExp);ensureSafeMemberName(key1,fullExp);ensureSafeMemberName(key2,fullExp);ensureSafeMemberName(key3,fullExp);ensureSafeMemberName(key4,fullExp);var eso=function eso(o){return ensureSafeObject(o,fullExp);};var eso0=expensiveChecks || isPossiblyDangerousMemberName(key0)?eso:identity;var eso1=expensiveChecks || isPossiblyDangerousMemberName(key1)?eso:identity;var eso2=expensiveChecks || isPossiblyDangerousMemberName(key2)?eso:identity;var eso3=expensiveChecks || isPossiblyDangerousMemberName(key3)?eso:identity;var eso4=expensiveChecks || isPossiblyDangerousMemberName(key4)?eso:identity;return function cspSafeGetter(scope,locals){var pathVal=locals && locals.hasOwnProperty(key0)?locals:scope;if(pathVal == null)return pathVal;pathVal = eso0(pathVal[key0]);if(!key1)return pathVal;if(pathVal == null)return undefined;pathVal = eso1(pathVal[key1]);if(!key2)return pathVal;if(pathVal == null)return undefined;pathVal = eso2(pathVal[key2]);if(!key3)return pathVal;if(pathVal == null)return undefined;pathVal = eso3(pathVal[key3]);if(!key4)return pathVal;if(pathVal == null)return undefined;pathVal = eso4(pathVal[key4]);return pathVal;};}function getterFnWithEnsureSafeObject(fn,fullExpression){return function(s,l){return fn(s,l,ensureSafeObject,fullExpression);};}function getterFn(path,options,fullExp){var expensiveChecks=options.expensiveChecks;var getterFnCache=expensiveChecks?getterFnCacheExpensive:getterFnCacheDefault;var fn=getterFnCache[path];if(fn)return fn;var pathKeys=path.split('.'),pathKeysLength=pathKeys.length;if(options.csp){if(pathKeysLength < 6){fn = cspSafeGetterFn(pathKeys[0],pathKeys[1],pathKeys[2],pathKeys[3],pathKeys[4],fullExp,expensiveChecks);}else {fn = function cspSafeGetter(scope,locals){var i=0,val;do {val = cspSafeGetterFn(pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],fullExp,expensiveChecks)(scope,locals);locals = undefined;scope = val;}while(i < pathKeysLength);return val;};}}else {var code='';if(expensiveChecks){code += 's = eso(s, fe);\nl = eso(l, fe);\n';}var needsEnsureSafeObject=expensiveChecks;forEach(pathKeys,function(key,index){ensureSafeMemberName(key,fullExp);var lookupJs=(index?'s':'((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key;if(expensiveChecks || isPossiblyDangerousMemberName(key)){lookupJs = 'eso(' + lookupJs + ', fe)';needsEnsureSafeObject = true;}code += 'if(s == null) return undefined;\n' + 's=' + lookupJs + ';\n';});code += 'return s;';var evaledFnGetter=new Function('s','l','eso','fe',code);evaledFnGetter.toString = valueFn(code);if(needsEnsureSafeObject){evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter,fullExp);}fn = evaledFnGetter;}fn.sharedGetter = true;fn.assign = function(self,value,locals){return setter(self,locals,path,value,path);};getterFnCache[path] = fn;return fn;}var objectValueOf=Object.prototype.valueOf;function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value);}function $ParseProvider(){var cacheDefault=createMap();var cacheExpensive=createMap();this.$get = ['$filter','$sniffer',function($filter,$sniffer){var $parseOptions={csp:$sniffer.csp,expensiveChecks:false},$parseOptionsExpensive={csp:$sniffer.csp,expensiveChecks:true};function wrapSharedExpression(exp){var wrapped=exp;if(exp.sharedGetter){wrapped = function $parseWrapper(self,locals){return exp(self,locals);};wrapped.literal = exp.literal;wrapped.constant = exp.constant;wrapped.assign = exp.assign;}return wrapped;}return function $parse(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(typeof exp){case 'string':cacheKey = exp = exp.trim();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 = wrapSharedExpression(parsedExpression);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 addInterceptor(noop,interceptorFn);}};function collectExpressionInputs(inputs,list){for(var i=0,ii=inputs.length;i < ii;i++) {var input=inputs[i];if(!input.constant){if(input.inputs){collectExpressionInputs(input.inputs,list);}else if(list.indexOf(input) === -1){list.push(input);}}}return list;}function expressionInputDirtyCheck(newValue,oldValueOfValue){if(newValue == null || oldValueOfValue == null){return newValue === oldValueOfValue;}if(typeof newValue === 'object'){newValue = getValueOf(newValue);if(typeof newValue === 'object'){return false;}}return newValue === oldValueOfValue || newValue !== newValue && oldValueOfValue !== oldValueOfValue;}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression){var inputExpressions=parsedExpression.$$inputs || (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs,[]));var lastResult;if(inputExpressions.length === 1){var oldInputValue=expressionInputDirtyCheck;inputExpressions = inputExpressions[0];return scope.$watch(function expressionInputWatch(scope){var newInputValue=inputExpressions(scope);if(!expressionInputDirtyCheck(newInputValue,oldInputValue)){lastResult = parsedExpression(scope);oldInputValue = newInputValue && getValueOf(newInputValue);}return lastResult;},listener,objectEquality);}var oldInputValueOfValues=[];for(var i=0,ii=inputExpressions.length;i < ii;i++) {oldInputValueOfValues[i] = expressionInputDirtyCheck;}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]))){oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);}}if(changed){lastResult = parsedExpression(scope);}return lastResult;},listener,objectEquality);}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){var value=parsedExpression(scope,locals);return interceptorFn(value,scope,locals);}:function oneTimeInterceptedExpression(scope,locals){var value=parsedExpression(scope,locals);var result=interceptorFn(value,scope,locals);return isDefined(value)?result:value;};if(parsedExpression.$$watchDelegate && parsedExpression.$$watchDelegate !== inputsWatchDelegate){fn.$$watchDelegate = parsedExpression.$$watchDelegate;}else if(!interceptorFn.$stateful){fn.$$watchDelegate = inputsWatchDelegate;fn.inputs = [parsedExpression];}return fn;}}];}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);}];}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)];}var defer=function defer(){return new Deferred();};function Promise(){this.$$state = {status:0};}Promise.prototype = {then:function then(onFulfilled,onRejected,progressBack){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 _catch(callback){return this.then(null,callback);},'finally':function _finally(callback,progressBack){return this.then(function(value){return handleCallback(value,true,callback);},function(error){return handleCallback(error,false,callback);},progressBack);}};function simpleBind(context,fn){return function(value){fn.call(context,value);};}function processQueue(state){var fn,promise,pending;pending = state.pending;state.processScheduled = false;state.pending = undefined;for(var i=0,ii=pending.length;i < ii;++i) {promise = pending[i][0];fn = pending[i][state.status];try{if(isFunction(fn)){promise.resolve(fn(state.value));}else if(state.status === 1){promise.resolve(state.value);}else {promise.reject(state.value);}}catch(e) {promise.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();this.resolve = simpleBind(this,this.resolve);this.reject = simpleBind(this,this.reject);this.notify = simpleBind(this,this.notify);}Deferred.prototype = {resolve:function resolve(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 $$resolve(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 reject(reason){if(this.promise.$$state.status)return;this.$$reject(reason);},$$reject:function $$reject(reason){this.promise.$$state.value = reason;this.promise.$$state.status = 2;scheduleProcessQueue(this.promise.$$state);},notify:function notify(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);}}});}}};var reject=function reject(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);}};var when=function when(value,callback,errback,progressBack){var result=new Deferred();result.resolve(value);return result.promise.then(callback,errback,progressBack);};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)){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.all = all;return $Q;}function $$RAFProvider(){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);return function(){$timeout.cancel(timer);};};raf.supported = rafSupported;return raf;}];}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;}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.$$isolateBindings = null;}Scope.prototype = {constructor:Scope,$new:function $new(isolate,parent){var child;parent = parent || this;if(isolate){child = new Scope();child.$root = this.$root;}else {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;}if(isolate || parent != this)child.$on('$destroy',destroyChildScope);return child;},$watch:function $watch(watchExp,listener,objectEquality){var get=$parse(watchExp);if(get.$$watchDelegate){return get.$$watchDelegate(this,listener,objectEquality,get);}var scope=this,array=scope.$$watchers,watcher={fn:listener,last:initWatchVal,get:get,exp:watchExp,eq:!!objectEquality};lastDirtyWatch = null;if(!isFunction(listener)){watcher.fn = noop;}if(!array){array = scope.$$watchers = [];}array.unshift(watcher);return function deregisterWatch(){arrayRemove(array,watcher);lastDirtyWatch = null;};},$watchGroup:function $watchGroup(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){var shouldCall=true;self.$evalAsync(function(){if(shouldCall)listener(newValues,newValues,self);});return function deregisterWatchGroup(){shouldCall = false;};}if(watchExpressions.length === 1){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()();}};},$watchCollection:function $watchCollection(obj,listener){$watchCollectionInterceptor.$stateful = true;var self=this;var newValue;var oldValue;var veryOldValue;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(isUndefined(newValue))return;if(!isObject(newValue)){if(oldValue !== newValue){oldValue = newValue;changeDetected++;}}else if(isArrayLike(newValue)){if(oldValue !== internalArray){oldValue = internalArray;oldLength = oldValue.length = 0;changeDetected++;}newLength = newValue.length;if(oldLength !== newLength){changeDetected++;oldValue.length = oldLength = newLength;}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){oldValue = internalObject = {};oldLength = 0;changeDetected++;}newLength = 0;for(key in newValue) {if(newValue.hasOwnProperty(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){changeDetected++;for(key in oldValue) {if(!newValue.hasOwnProperty(key)){oldLength--;delete oldValue[key];}}}}return changeDetected;}function $watchCollectionAction(){if(initRun){initRun = false;listener(newValue,newValue,self);}else {listener(newValue,veryOldValue,self);}if(trackVeryOldValue){if(!isObject(newValue)){veryOldValue = newValue;}else if(isArrayLike(newValue)){veryOldValue = new Array(newValue.length);for(var i=0;i < newValue.length;i++) {veryOldValue[i] = newValue[i];}}else {veryOldValue = {};for(var key in newValue) {if(hasOwnProperty.call(newValue,key)){veryOldValue[key] = newValue[key];}}}}}return this.$watch(changeDetector,$watchCollectionAction);},$digest:function $digest(){var watch,value,last,watchers,length,dirty,ttl=TTL,next,current,target=this,watchLog=[],logIdx,logMsg,asyncTask;beginPhase('$digest');$browser.$$checkUrlChange();if(this === $rootScope && applyAsyncId !== null){$browser.defer.cancel(applyAsyncId);flushApplyAsync();}lastDirtyWatch = null;do {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 {if(watchers = current.$$watchers){length = watchers.length;while(length--) {try{watch = watchers[length];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){dirty = false;break traverseScopesLoop;}}}catch(e) {$exceptionHandler(e);}}}if(!(next = current.$$childHead || current !== target && current.$$nextSibling)){while(current !== target && !(next = current.$$nextSibling)) {current = current.$parent;}}}while(current = next);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);}}},$destroy:function $destroy(){if(this.$$destroyed)return;var parent=this.$parent;this.$broadcast('$destroy');this.$$destroyed = true;if(this === $rootScope)return;for(var eventName in this.$$listenerCount) {decrementListenerCount(this,this.$$listenerCount[eventName],eventName);}if(parent.$$childHead == this)parent.$$childHead = this.$$nextSibling;if(parent.$$childTail == this)parent.$$childTail = this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling = this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling = this.$$prevSibling;this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;this.$on = this.$watch = this.$watchGroup = function(){return noop;};this.$$listeners = {};this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = this.$$watchers = null;},$eval:function $eval(expr,locals){return $parse(expr)(this,locals);},$evalAsync:function $evalAsync(expr,locals){if(!$rootScope.$$phase && !asyncQueue.length){$browser.defer(function(){if(asyncQueue.length){$rootScope.$digest();}});}asyncQueue.push({scope:this,expression:expr,locals:locals});},$$postDigest:function $$postDigest(fn){postDigestQueue.push(fn);},$apply:function $apply(expr){try{beginPhase('$apply');return this.$eval(expr);}catch(e) {$exceptionHandler(e);}finally {clearPhase();try{$rootScope.$digest();}catch(e) {$exceptionHandler(e);throw e;}}},$applyAsync:function $applyAsync(expr){var scope=this;expr && applyAsyncQueue.push($applyAsyncExpression);scheduleApplyAsync();function $applyAsyncExpression(){scope.$eval(expr);}},$on:function $on(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);}};},$emit:function $emit(name,args){var empty=[],namedListeners,scope=this,_stopPropagation=false,event={name:name,targetScope:scope,stopPropagation:function stopPropagation(){_stopPropagation = true;},preventDefault:function preventDefault(){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(!namedListeners[i]){namedListeners.splice(i,1);i--;length--;continue;}try{namedListeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}if(_stopPropagation){event.currentScope = null;return event;}scope = scope.$parent;}while(scope);event.currentScope = null;return event;},$broadcast:function $broadcast(name,args){var target=this,current=target,next=target,event={name:name,targetScope:target,preventDefault:function preventDefault(){event.defaultPrevented = true;},defaultPrevented:false};if(!target.$$listenerCount[name])return event;var listenerArgs=concat([event],arguments,1),listeners,i,length;while(current = next) {event.currentScope = current;listeners = current.$$listeners[name] || [];for(i = 0,length = listeners.length;i < length;i++) {if(!listeners[i]){listeners.splice(i,1);i--;length--;continue;}try{listeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}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();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 decrementListenerCount(current,count,name){do {current.$$listenerCount[name] -= count;if(current.$$listenerCount[name] === 0){delete current.$$listenerCount[name];}}while(current = current.$parent);}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);});}}}];}function $$SanitizeUriProvider(){var aHrefSanitizationWhitelist=/^\s*(https?|ftp|mailto|tel|file):/,imgSrcSanitizationWhitelist=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){aHrefSanitizationWhitelist = regexp;return this;}return aHrefSanitizationWhitelist;};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;};};}var $sceMinErr=minErr('$sce');var SCE_CONTEXTS={HTML:'html',CSS:'css',URL:'url',RESOURCE_URL:'resourceUrl',JS:'js'};function adjustMatcher(matcher){if(matcher === 'self'){return matcher;}else if(isString(matcher)){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)){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;}function $SceDelegateProvider(){this.SCE_CONTEXTS = SCE_CONTEXTS;var resourceUrlWhitelist=['self'],resourceUrlBlacklist=[];this.resourceUrlWhitelist = function(value){if(arguments.length){resourceUrlWhitelist = adjustMatchers(value);}return resourceUrlWhitelist;};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 {return !!matcher.exec(parsedUrl.href);}}function isResourceUrlAllowedByPolicy(url){var parsedUrl=urlResolve(url.toString());var i,n,allowed=false;for(i = 0,n = resourceUrlWhitelist.length;i < n;i++) {if(matchUrl(resourceUrlWhitelist[i],parsedUrl)){allowed = true;break;}}if(allowed){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]);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 || trustedValue === undefined || trustedValue === ''){return trustedValue;}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);}function valueOf(maybeTrusted){if(maybeTrusted instanceof trustedValueHolderBase){return maybeTrusted.$$unwrapTrustedValue();}else {return maybeTrusted;}}function getTrusted(type,maybeTrusted){if(maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === ''){return maybeTrusted;}var constructor=byType.hasOwnProperty(type)?byType[type]:null;if(constructor && maybeTrusted instanceof constructor){return maybeTrusted.$$unwrapTrustedValue();}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};}];}function $SceProvider(){var enabled=true;this.enabled = function(value){if(arguments.length){enabled = !!value;}return enabled;};this.$get = ['$parse','$sceDelegate',function($parse,$sceDelegate){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 to the top of your HTML ' + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');}var sce=shallowCopy(SCE_CONTEXTS);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;}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);});}};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;}];}function $SnifferProvider(){this.$get = ['$window','$document',function($window,$document){var eventSupport={},android=int((/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(document.body.style.webkitTransition);animations = isString(document.body.style.webkitAnimation);}}return {history:!!($window.history && $window.history.pushState && !(android < 4) && !boxee),hasEvent:function hasEvent(event){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');function $TemplateRequestProvider(){this.$get = ['$templateCache','$http','$q',function($templateCache,$http,$q){function handleRequestFn(tpl,ignoreRequestError){handleRequestFn.totalPendingRequests++;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){return response.data;},handleError);function handleError(resp){if(!ignoreRequestError){throw $compileMinErr('tpload','Failed to load template: {0}',tpl);}return $q.reject(resp);}}handleRequestFn.totalPendingRequests = 0;return handleRequestFn;}];}function $$TestabilityProvider(){this.$get = ['$rootScope','$browser','$location',function($rootScope,$browser,$location){var testability={};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;};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;}}};testability.getLocation = function(){return $location.url();};testability.setLocation = function(url){if(url !== $location.url()){$location.url(url);$rootScope.$digest();}};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={};function timeout(fn,delay,invokeApply){var skipApply=isDefined(invokeApply) && !invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise,timeoutId;timeoutId = $browser.defer(function(){try{deferred.resolve(fn());}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;}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;}];}var urlParsingNode=document.createElement('a');var originUrl=urlResolve(window.location.href);function urlResolve(url){var href=url;if(msie){urlParsingNode.setAttribute('href',href);href = urlParsingNode.href;}urlParsingNode.setAttribute('href',href);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};}function urlIsSameOrigin(requestUrl){var parsed=isString(requestUrl)?urlResolve(requestUrl):requestUrl;return parsed.protocol === originUrl.protocol && parsed.host === originUrl.host;}function $WindowProvider(){this.$get = valueFn(window);}$FilterProvider.$inject = ['$provide'];function $FilterProvider($provide){var suffix='Filter';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);};}];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);}function filterFilter(){return function(array,expression,comparator){if(!isArray(array))return array;var predicateFn;var matchAgainstAnyProp;switch(typeof expression){case 'function':predicateFn = expression;break;case 'boolean':case 'number':case 'string':matchAgainstAnyProp = true;case 'object':predicateFn = createPredicateFn(expression,comparator,matchAgainstAnyProp);break;default:return array;}return array.filter(predicateFn);};}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(isObject(actual) || isObject(expected)){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(_x3,_x4,_x5,_x6,_x7){var _again2=true;_function2: while(_again2) {var actual=_x3,expected=_x4,comparator=_x5,matchAgainstAnyProp=_x6,dontMatchWholeObject=_x7;actualType = expectedType = key = expectedVal = matchAnyProperty = actualVal = undefined;_again2 = false;var actualType=actual !== null?typeof actual:'null';var expectedType=expected !== null?typeof expected:'null';if(expectedType === 'string' && expected.charAt(0) === '!'){return !deepCompare(actual,expected.substring(1),comparator,matchAgainstAnyProp);}else if(isArray(actual)){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;}}if(dontMatchWholeObject){return false;}else {_x3 = actual;_x4 = expected;_x5 = comparator;_x6 = false;_again2 = true;continue _function2;}}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);}}}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;}return amount == null?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol);};}numberFilter.$inject = ['$locale'];function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){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(!isFinite(number) || isObject(number))return '';var isNegative=number < 0;number = Math.abs(number);var numStr=number + '',formatedText='',parts=[];var hasExponent=false;if(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(!hasExponent){var fractionLen=(numStr.split(DECIMAL_SEP)[1] || '').length;if(isUndefined(fractionSize)){fractionSize = Math.min(Math.max(pattern.minFrac,fractionLen),pattern.maxFrac);}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);}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);}}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){var zone=-1 * date.getTimezoneOffset();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){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(dayOfWeekOnFirst <= 4?5:12) - dayOfWeekOnFirst);}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),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);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),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+$/;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))?)?$/;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 = int(match[9] + match[10]);tzMin = int(match[9] + match[11]);}dateSetter.call(date,int(match[1]),int(match[2]) - 1,int(match[3]));var h=int(match[4] || 0) - tzHour;var m=int(match[5] || 0) - tzMin;var s=int(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)?int(date):jsonStringToDate(date);}if(isNumber(date)){date = new Date(date);}if(!isDate(date)){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;}}if(timezone && timezone === 'UTC'){date = new Date(date.getTime());date.setMinutes(date.getMinutes() + date.getTimezoneOffset());}forEach(parts,function(value){fn = DATE_FORMATS[value];text += fn?fn(date,$locale.DATETIME_FORMATS):value.replace(/(^'|'$)/g,'').replace(/''/g,'\'');});return text;};}function jsonFilter(){return function(object,spacing){if(isUndefined(spacing)){spacing = 2;}return toJson(object,spacing);};}var lowercaseFilter=valueFn(lowercase);var uppercaseFilter=valueFn(uppercase);function limitToFilter(){return function(input,limit){if(isNumber(input))input = input.toString();if(!isArray(input) && !isString(input))return input;if(Math.abs(Number(limit)) === Infinity){limit = Number(limit);}else {limit = int(limit);}if(limit){return limit > 0?input.slice(0,limit):input.slice(limit);}else {return isString(input)?'':[];}};}orderByFilter.$inject = ['$parse'];function orderByFilter($parse){return function(array,sortPredicate,reverseOrder){if(!isArrayLike(array))return array;sortPredicate = isArray(sortPredicate)?sortPredicate:[sortPredicate];if(sortPredicate.length === 0){sortPredicate = ['+'];}sortPredicate = sortPredicate.map(function(predicate){var descending=false,get=predicate || identity;if(isString(predicate)){if(predicate.charAt(0) == '+' || predicate.charAt(0) == '-'){descending = predicate.charAt(0) == '-';predicate = predicate.substring(1);}if(predicate === ''){return reverseComparator(compare,descending);}get = $parse(predicate);if(get.constant){var key=get();return reverseComparator(function(a,b){return compare(a[key],b[key]);},descending);}}return reverseComparator(function(a,b){return compare(get(a),get(b));},descending);});return slice.call(array).sort(reverseComparator(comparator,reverseOrder));function comparator(o1,o2){for(var i=0;i < sortPredicate.length;i++) {var comp=sortPredicate[i](o1,o2);if(comp !== 0)return comp;}return 0;}function reverseComparator(comp,descending){return descending?function(a,b){return comp(b,a);}:comp;}function isPrimitive(value){switch(typeof value){case 'number':case 'boolean':case 'string':return true;default:return false;}}function objectToString(value){if(value === null)return 'null';if(typeof value.valueOf === 'function'){value = value.valueOf();if(isPrimitive(value))return value;}if(typeof value.toString === 'function'){value = value.toString();if(isPrimitive(value))return value;}return '';}function compare(v1,v2){var t1=typeof v1;var t2=typeof v2;if(t1 === t2 && t1 === 'object'){v1 = objectToString(v1);v2 = objectToString(v2);}if(t1 === t2){if(t1 === 'string'){v1 = v1.toLowerCase();v2 = v2.toLowerCase();}if(v1 === v2)return 0;return v1 < v2?-1:1;}else {return t1 < t2?-1:1;}}};}function ngDirective(directive){if(isFunction(directive)){directive = {link:directive};}directive.restrict = directive.restrict || 'AC';return valueFn(directive);}var htmlAnchorDirective=valueFn({restrict:'E',compile:function compile(element,attr){if(!attr.href && !attr.xlinkHref && !attr.name){return function(scope,element){if(element[0].nodeName.toLowerCase() !== 'a')return;var href=toString.call(element.prop('href')) === '[object SVGAnimatedString]'?'xlink:href':'href';element.on('click',function(event){if(!element.attr(href)){event.preventDefault();}});};}}});var ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){if(propName == 'multiple')return;var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {restrict:'A',priority:100,link:function link(scope,element,attr){scope.$watch(attr[normalized],function ngBooleanAttrWatchAction(value){attr.$set(attrName,!!value);});}};};});forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr] = function(){return {priority:100,link:function link(scope,element,attr){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);});}};};});forEach(['src','srcset','href'],function(attrName){var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {priority:99,link:function link(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);if(msie && propName)element.prop(propName,attr[name]);});}};};});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;}FormController.$inject = ['$element','$attrs','$scope','$animate','$interpolate'];function FormController(element,attrs,$scope,$animate,$interpolate){var form=this,controls=[];var parentForm=form.$$parentForm = element.parent().controller('form') || nullFormCtrl;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;parentForm.$addControl(form);form.$rollbackViewValue = function(){forEach(controls,function(control){control.$rollbackViewValue();});};form.$commitViewValue = function(){forEach(controls,function(control){control.$commitViewValue();});};form.$addControl = function(control){assertNotHasOwnProperty(control.$name,'input');controls.push(control);if(control.$name){form[control.$name] = control;}};form.$$renameControl = function(control,newName){var oldName=control.$name;if(form[oldName] === control){delete form[oldName];}form[newName] = control;control.$name = newName;};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);};addSetValidityMethod({ctrl:this,$element:element,set:function set(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 unset(object,property,controller){var list=object[property];if(!list){return;}arrayRemove(list,controller);if(list.length === 0){delete object[property];}},parentForm:parentForm,$animate:$animate});form.$setDirty = function(){$animate.removeClass(element,PRISTINE_CLASS);$animate.addClass(element,DIRTY_CLASS);form.$dirty = true;form.$pristine = false;parentForm.$setDirty();};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();});};form.$setUntouched = function(){forEach(controls,function(control){control.$setUntouched();});};form.$setSubmitted = function(){$animate.addClass(element,SUBMITTED_CLASS);form.$submitted = true;parentForm.$setSubmitted();};}var formDirectiveFactory=function formDirectiveFactory(isNgForm){return ['$timeout',function($timeout){var formDirective={name:'form',restrict:isNgForm?'EAC':'E',controller:FormController,compile:function ngFormCompile(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?'name':isNgForm && attr.ngForm?'ngForm':false;return {pre:function ngFormPreLink(scope,formElement,attr,controller){if(!('action' in attr)){var handleFormSubmission=function handleFormSubmission(event){scope.$apply(function(){controller.$commitViewValue();controller.$setSubmitted();});event.preventDefault();};addEventListenerFn(formElement[0],'submit',handleFormSubmission);formElement.on('$destroy',function(){$timeout(function(){removeEventListenerFn(formElement[0],'submit',handleFormSubmission);},0,false);});}var parentFormCtrl=controller.$$parentForm;if(nameAttr){setter(scope,null,controller.$name,controller,controller.$name);attr.$observe(nameAttr,function(newValue){if(controller.$name === newValue)return;setter(scope,null,controller.$name,undefined,controller.$name);parentFormCtrl.$$renameControl(controller,newValue);setter(scope,null,controller.$name,controller,controller.$name);});}formElement.on('$destroy',function(){parentFormCtrl.$removeControl(controller);if(nameAttr){setter(scope,null,attr[nameAttr],undefined,controller.$name);}extend(controller,nullFormCtrl);});}};}};return formDirective;}];};var formDirective=formDirectiveFactory();var ngFormDirective=formDirectiveFactory(true);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*)))\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={'text':textInputType,'date':createDateInputType('date',DATE_REGEXP,createDateParser(DATE_REGEXP,['yyyy','MM','dd']),'yyyy-MM-dd'),'datetime-local':createDateInputType('datetimelocal',DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,['yyyy','MM','dd','HH','mm','ss','sss']),'yyyy-MM-ddTHH:mm:ss.sss'),'time':createDateInputType('time',TIME_REGEXP,createDateParser(TIME_REGEXP,['HH','mm','ss','sss']),'HH:mm:ss.sss'),'week':createDateInputType('week',WEEK_REGEXP,weekParser,'yyyy-Www'),'month':createDateInputType('month',MONTH_REGEXP,createDateParser(MONTH_REGEXP,['yyyy','MM']),'yyyy-MM'),'number':numberInputType,'url':urlInputType,'email':emailInputType,'radio':radioInputType,'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);if(!$sniffer.android){var composing=false;element.on('compositionstart',function(data){composing = true;});element.on('compositionend',function(){composing = false;listener();});}var listener=function listener(ev){if(timeout){$browser.defer.cancel(timeout);timeout = null;}if(composing)return;var value=element.val(),event=ev && ev.type;if(type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')){value = trim(value);}if(ctrl.$viewValue !== value || value === '' && ctrl.$$hasNativeValidators){ctrl.$setViewValue(value,event);}};if($sniffer.hasEvent('input')){element.on('input',listener);}else {var timeout;var deferListener=function deferListener(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;if(key === 91 || 15 < key && key < 19 || 37 <= key && key <= 40)return;deferListener(event,this,this.value);});if($sniffer.hasEvent('paste')){element.on('paste cut',deferListener);}}element.on('change',listener);ctrl.$render = function(){element.val(ctrl.$isEmpty(ctrl.$viewValue)?'':ctrl.$viewValue);};}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)){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)){var parsedDate=parseDate(value,previousDate);if(timezone === 'UTC'){parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());}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 === 'UTC'){var timezoneOffset=60000 * previousDate.getTimezoneOffset();previousDate = new Date(previousDate.getTime() + timezoneOffset);}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){return value && !(value.getTime && value.getTime() !== value.getTime());}function parseObservedDateValue(val){return isDefined(val)?isDate(val)?val:parseDate(val):undefined;}};}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) || {};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;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;ctrl.$validate();});}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){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){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){if(isUndefined(attr.name)){element.attr('name',nextUid());}var listener=function listener(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 minErr('ngModel')('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 listener(ev){ctrl.$setViewValue(element[0].checked,ev && ev.type);};element.on('click',listener);ctrl.$render = function(){element[0].checked = ctrl.$viewValue;};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;});}var inputDirective=['$browser','$sniffer','$filter','$parse',function($browser,$sniffer,$filter,$parse){return {restrict:'E',require:['?ngModel'],link:{pre:function pre(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+)$/;var ngValueDirective=function ngValueDirective(){return {restrict:'A',priority:100,compile:function compile(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);});};}}};};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 = value === undefined?'':value;});};}};}];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 = value === undefined?'':value;});};}};}];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(){element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');});};}};}];var ngChangeDirective=valueFn({restrict:'A',require:'ngModel',link:function link(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 link(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){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){var classCounts=element.data('$classCounts') || {};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){if(isArray(classVal)){return classVal;}else if(isString(classVal)){return classVal.split(' ');}else if(isObject(classVal)){var classes=[];forEach(classVal,function(v,k){if(v){classes = classes.concat(k.split(' '));}});return classes;}return classVal;}}];}var ngClassDirective=classDirective('',true);var ngClassOddDirective=classDirective('Odd',0);var ngClassEvenDirective=classDirective('Even',1);var ngCloakDirective=ngDirective({compile:function compile(element,attr){attr.$set('ngCloak',undefined);element.removeClass('ng-cloak');}});var ngControllerDirective=[function(){return {restrict:'A',scope:true,controller:'@',priority:500};}];var ngEventDirectives={};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 compile($element,attr){var fn=$parse(attr[directiveName],null,true);return function ngEventHandler(scope,element){element.on(eventName,function(event){var callback=function callback(){fn(scope,{$event:event});};if(forceAsyncEvents[eventName] && $rootScope.$$phase){scope.$evalAsync(callback);}else {scope.$apply(callback);}});};}};}];});var ngIfDirective=['$animate',function($animate){return {multiElement:true,transclude:'element',priority:600,terminal:true,restrict:'A',$$tlb:true,link:function link($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 + ' ');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;}}});}};}];var ngIncludeDirective=['$templateRequest','$anchorScroll','$animate','$sce',function($templateRequest,$anchorScroll,$animate,$sce){return {restrict:'ECA',priority:400,terminal:true,transclude:'element',controller:angular.noop,compile:function compile(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 cleanupLastIncludeContent(){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($sce.parseAsResourceUrl(srcExp),function ngIncludeWatchAction(src){var afterAnimation=function afterAnimation(){if(isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))){$anchorScroll();}};var thisChangeId=++changeCounter;if(src){$templateRequest(src,true).then(function(response){if(thisChangeId !== changeCounter)return;var newScope=scope.$new();ctrl.template = response;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;}});};}};}];var ngIncludeFillContentDirective=['$compile',function($compile){return {restrict:'ECA',priority:-400,require:'ngInclude',link:function link(scope,$element,$attr,ctrl){if(/SVG/.test($element[0].toString())){$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);}};}];var ngInitDirective=ngDirective({priority:450,compile:function compile(){return {pre:function pre(scope,element,attrs){scope.$eval(attrs.ngInit);}};}});var ngListDirective=function ngListDirective(){return {restrict:'A',priority:100,require:'ngModel',link:function link(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList) || ', ';var trimValues=attr.ngTrim !== 'false';var separator=trimValues?trim(ngList):ngList;var parse=function parse(viewValue){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;});ctrl.$isEmpty = function(value){return !value || !value.length;};}};};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=new minErr('ngModel');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;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 = {};this.$$success = {};this.$pending = undefined;this.$name = $interpolate($attr.name || '',false)($scope);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));}};this.$render = noop;this.$isEmpty = function(value){return isUndefined(value) || value === '' || value === null || value !== value;};var parentForm=$element.inheritedData('$formController') || nullFormCtrl,currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function set(object,property){object[property] = true;},unset:function unset(object,property){delete object[property];},parentForm:parentForm,$animate:$animate});this.$setPristine = function(){ctrl.$dirty = false;ctrl.$pristine = true;$animate.removeClass($element,DIRTY_CLASS);$animate.addClass($element,PRISTINE_CLASS);};this.$setDirty = function(){ctrl.$dirty = true;ctrl.$pristine = false;$animate.removeClass($element,PRISTINE_CLASS);$animate.addClass($element,DIRTY_CLASS);parentForm.$setDirty();};this.$setUntouched = function(){ctrl.$touched = false;ctrl.$untouched = true;$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS);};this.$setTouched = function(){ctrl.$touched = true;ctrl.$untouched = false;$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS);};this.$rollbackViewValue = function(){$timeout.cancel(pendingDebounce);ctrl.$viewValue = ctrl.$$lastCommittedViewValue;ctrl.$render();};this.$validate = function(){if(isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)){return;}var viewValue=ctrl.$$lastCommittedViewValue;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(!allowInvalid && prevValid !== allValid){ctrl.$modelValue = allValid?modelValue:undefined;if(ctrl.$modelValue !== prevModelValue){ctrl.$$writeModelToScope();}}});};this.$$runValidators = function(modelValue,viewValue,doneCallback){currentValidationRunId++;var localValidationRunId=currentValidationRunId;if(!processParseErrors()){validationDone(false);return;}if(!processSyncValidators()){validationDone(false);return;}processAsyncValidators();function processParseErrors(){var errorKey=ctrl.$$parserName || 'parse';if(parserValid === undefined){setValidity(errorKey,null);}else {if(!parserValid){forEach(ctrl.$validators,function(v,name){setValidity(name,null);});forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null);});}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);}}};this.$commitViewValue = function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce);if(ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)){return;}ctrl.$$lastCommittedViewValue = viewValue;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 = ngModelGet($scope);}var prevModelValue=ctrl.$modelValue;var allowInvalid=ctrl.$options && ctrl.$options.allowInvalid;ctrl.$$rawModelValue = modelValue;if(allowInvalid){ctrl.$modelValue = modelValue;writeToModelIfNeeded();}ctrl.$$runValidators(modelValue,ctrl.$$lastCommittedViewValue,function(allValid){if(!allowInvalid){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);}});};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();});}};$scope.$watch(function ngModelWatch(){var modelValue=ngModelGet($scope);if(modelValue !== ctrl.$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;});}];var ngModelDirective=['$rootScope',function($rootScope){return {restrict:'A',require:['ngModel','^?form','^?ngModelOptions'],controller:NgModelController,priority:1,compile:function ngModelCompile(element){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] || nullFormCtrl;modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);formCtrl.$addControl(modelCtrl);attr.$observe('name',function(newValue){if(modelCtrl.$name !== newValue){formCtrl.$$renameControl(modelCtrl,newValue);}});scope.$on('$destroy',function(){formCtrl.$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+|$)/;var ngModelOptionsDirective=function ngModelOptionsDirective(){return {restrict:'A',controller:['$scope','$attrs',function($scope,$attrs){var that=this;this.$options = $scope.$eval($attrs.ngModelOptions);if(this.$options.updateOn !== undefined){this.$options.updateOnDefault = false;this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP,function(){that.$options.updateOnDefault = true;return ' ';}));}else {this.$options.updateOnDefault = true;}}]};};function addSetValidityMethod(context){var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,parentForm=context.parentForm,$animate=context.$animate;classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));ctrl.$setValidity = setValidity;function setValidity(validationErrorKey,state,controller){if(state === undefined){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);}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);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) {return false;}}return true;}var ngNonBindableDirective=ngDirective({terminal:true,priority:1000});var ngPluralizeDirective=['$locale','$interpolate',function($locale,$interpolate){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return {restrict:'EA',link:function link(scope,element,attr){var numberExp=attr.count,whenExp=attr.$attr.when && element.attr(attr.$attr.when),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)){count = $locale.pluralCat(count - offset);}if(count !== lastCount && !(countIsNaN && isNaN(lastCount))){watchRemover();watchRemover = scope.$watch(whensExpFns[count],updateElementText);lastCount = count;}});function updateElementText(newText){element.text(newText || '');}}};}];var ngRepeatDirective=['$parse','$animate',function($parse,$animate){var NG_REMOVED='$$NG_REMOVED';var ngRepeatMinErr=minErr('ngRepeat');var updateScope=function updateScope(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){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);scope.$odd = !(scope.$even = (index & 1) === 0);};var getBlockStart=function getBlockStart(block){return block.clone[0];};var getBlockEnd=function getBlockEnd(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){if(keyIdentifier)hashFnLocals[keyIdentifier] = key;hashFnLocals[valueIdentifier] = value;hashFnLocals.$index = index;return trackByExpGetter($scope,hashFnLocals);};}var lastBlockMap=createMap();$scope.$watchCollection(rhs,function ngRepeatAction(collection){var index,length,previousNode=$element[0],nextNode,nextBlockMap=createMap(),collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove;if(aliasAs){$scope[aliasAs] = collection;}if(isArrayLike(collection)){collectionKeys = collection;trackByIdFn = trackByIdExpFn || trackByIdArrayFn;}else {trackByIdFn = trackByIdExpFn || trackByIdObjFn;collectionKeys = [];for(var itemKey in collection) {if(collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$'){collectionKeys.push(itemKey);}}collectionKeys.sort();}collectionLength = collectionKeys.length;nextBlockOrder = new Array(collectionLength);for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];trackById = trackByIdFn(key,value,index);if(lastBlockMap[trackById]){block = lastBlockMap[trackById];delete lastBlockMap[trackById];nextBlockMap[trackById] = block;nextBlockOrder[index] = block;}else if(nextBlockMap[trackById]){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 {nextBlockOrder[index] = {id:trackById,scope:undefined,clone:undefined};nextBlockMap[trackById] = true;}}for(var blockKey in lastBlockMap) {block = lastBlockMap[blockKey];elementsToRemove = getBlockNodes(block.clone);$animate.leave(elementsToRemove);if(elementsToRemove[0].parentNode){for(index = 0,length = elementsToRemove.length;index < length;index++) {elementsToRemove[index][NG_REMOVED] = true;}}block.scope.$destroy();}for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];block = nextBlockOrder[index];if(block.scope){nextNode = previousNode;do {nextNode = nextNode.nextSibling;}while(nextNode && nextNode[NG_REMOVED]);if(getBlockStart(block) != nextNode){$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode));}previousNode = getBlockEnd(block);updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength);}else {$transclude(function ngRepeatTransclude(clone,scope){block.scope = scope;var endNode=ngRepeatEndComment.cloneNode(false);clone[clone.length++] = endNode;$animate.enter(clone,null,jqLite(previousNode));previousNode = endNode;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';var ngShowDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngShow,function ngShowWatchAction(value){$animate[value?'removeClass':'addClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngHideDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngHide,function ngHideWatchAction(value){$animate[value?'addClass':'removeClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngStyleDirective=ngDirective(function(scope,element,attr){scope.$watchCollection(attr.ngStyle,function ngStyleWatchAction(newStyles,oldStyles){if(oldStyles && newStyles !== oldStyles){forEach(oldStyles,function(val,style){element.css(style,'');});}if(newStyles)element.css(newStyles);});});var ngSwitchDirective=['$animate',function($animate){return {restrict:'EA',require:'ngSwitch',controller:['$scope',function ngSwitchController(){this.cases = {};}],link:function link(scope,element,attr,ngSwitchController){var watchExpr=attr.ngSwitch || attr.on,selectedTranscludes=[],selectedElements=[],previousLeaveAnimations=[],selectedScopes=[];var spliceFactory=function spliceFactory(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 link(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 link(scope,element,attr,ctrl,$transclude){ctrl.cases['?'] = ctrl.cases['?'] || [];ctrl.cases['?'].push({transclude:$transclude,element:element});}});var ngTranscludeDirective=ngDirective({restrict:'EAC',link:function link($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);});}});var scriptDirective=['$templateCache',function($templateCache){return {restrict:'E',terminal:true,compile:function compile(element,attr){if(attr.type == 'text/ng-template'){var templateUrl=attr.id,text=element[0].text;$templateCache.put(templateUrl,text);}}};}];var ngOptionsMinErr=minErr('ngOptions');var ngOptionsDirective=valueFn({restrict:'A',terminal:true});var selectDirective=['$compile','$parse',function($compile,$parse){var NG_OPTIONS_REGEXP=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,nullModelCtrl={$setViewValue:noop};return {restrict:'E',require:['select','?ngModel'],controller:['$element','$scope','$attrs',function($element,$scope,$attrs){var self=this,optionsMap={},ngModelCtrl=nullModelCtrl,nullOption,unknownOption;self.databound = $attrs.ngModel;self.init = function(ngModelCtrl_,nullOption_,unknownOption_){ngModelCtrl = ngModelCtrl_;nullOption = nullOption_;unknownOption = unknownOption_;};self.addOption = function(value,element){assertNotHasOwnProperty(value,'"option value"');optionsMap[value] = true;if(ngModelCtrl.$viewValue == value){$element.val(value);if(unknownOption.parent())unknownOption.remove();}if(element && element[0].hasAttribute('selected')){element[0].selected = true;}};self.removeOption = function(value){if(this.hasOption(value)){delete optionsMap[value];if(ngModelCtrl.$viewValue === value){this.renderUnknownOption(value);}}};self.renderUnknownOption = function(val){var unknownVal='? ' + hashKey(val) + ' ?';unknownOption.val(unknownVal);$element.prepend(unknownOption);$element.val(unknownVal);unknownOption.prop('selected',true);};self.hasOption = function(value){return optionsMap.hasOwnProperty(value);};$scope.$on('$destroy',function(){self.renderUnknownOption = noop;});}],link:function link(scope,element,attr,ctrls){if(!ctrls[1])return;var selectCtrl=ctrls[0],ngModelCtrl=ctrls[1],multiple=attr.multiple,optionsExp=attr.ngOptions,nullOption=false,emptyOption,renderScheduled=false,optionTemplate=jqLite(document.createElement('option')),optGroupTemplate=jqLite(document.createElement('optgroup')),unknownOption=optionTemplate.clone();for(var i=0,children=element.children(),ii=children.length;i < ii;i++) {if(children[i].value === ''){emptyOption = nullOption = children.eq(i);break;}}selectCtrl.init(ngModelCtrl,nullOption,unknownOption);if(multiple){ngModelCtrl.$isEmpty = function(value){return !value || value.length === 0;};}if(optionsExp)setupAsOptions(scope,element,ngModelCtrl);else if(multiple)setupAsMultiple(scope,element,ngModelCtrl);else setupAsSingle(scope,element,ngModelCtrl,selectCtrl);function setupAsSingle(scope,selectElement,ngModelCtrl,selectCtrl){ngModelCtrl.$render = function(){var viewValue=ngModelCtrl.$viewValue;if(selectCtrl.hasOption(viewValue)){if(unknownOption.parent())unknownOption.remove();selectElement.val(viewValue);if(viewValue === '')emptyOption.prop('selected',true);}else {if(isUndefined(viewValue) && emptyOption){selectElement.val('');}else {selectCtrl.renderUnknownOption(viewValue);}}};selectElement.on('change',function(){scope.$apply(function(){if(unknownOption.parent())unknownOption.remove();ngModelCtrl.$setViewValue(selectElement.val());});});}function setupAsMultiple(scope,selectElement,ctrl){var lastView;ctrl.$render = function(){var items=new HashMap(ctrl.$viewValue);forEach(selectElement.find('option'),function(option){option.selected = isDefined(items.get(option.value));});};scope.$watch(function selectMultipleWatch(){if(!equals(lastView,ctrl.$viewValue)){lastView = shallowCopy(ctrl.$viewValue);ctrl.$render();}});selectElement.on('change',function(){scope.$apply(function(){var array=[];forEach(selectElement.find('option'),function(option){if(option.selected){array.push(option.value);}});ctrl.$setViewValue(array);});});}function setupAsOptions(scope,selectElement,ctrl){var match;if(!(match = optionsExp.match(NG_OPTIONS_REGEXP))){throw ngOptionsMinErr('iexp','Expected expression in form of ' + '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' + ' but got \'{0}\'. Element: {1}',optionsExp,startingTag(selectElement));}var displayFn=$parse(match[2] || match[1]),valueName=match[4] || match[6],selectAs=/ as /.test(match[0]) && match[1],selectAsFn=selectAs?$parse(selectAs):null,keyName=match[5],groupByFn=$parse(match[3] || ''),valueFn=$parse(match[2]?match[1]:valueName),valuesFn=$parse(match[7]),track=match[8],trackFn=track?$parse(match[8]):null,trackKeysCache={},optionGroupsCache=[[{element:selectElement,label:''}]],locals={};if(nullOption){$compile(nullOption)(scope);nullOption.removeClass('ng-scope');nullOption.remove();}selectElement.empty();selectElement.on('change',selectionChanged);ctrl.$render = render;scope.$watchCollection(valuesFn,scheduleRendering);scope.$watchCollection(getLabels,scheduleRendering);if(multiple){scope.$watchCollection(function(){return ctrl.$modelValue;},scheduleRendering);}function callExpression(exprFn,key,value){locals[valueName] = value;if(keyName)locals[keyName] = key;return exprFn(scope,locals);}function selectionChanged(){scope.$apply(function(){var collection=valuesFn(scope) || [];var viewValue;if(multiple){viewValue = [];forEach(selectElement.val(),function(selectedKey){selectedKey = trackFn?trackKeysCache[selectedKey]:selectedKey;viewValue.push(getViewValue(selectedKey,collection[selectedKey]));});}else {var selectedKey=trackFn?trackKeysCache[selectElement.val()]:selectElement.val();viewValue = getViewValue(selectedKey,collection[selectedKey]);}ctrl.$setViewValue(viewValue);render();});}function getViewValue(key,value){if(key === '?'){return undefined;}else if(key === ''){return null;}else {var viewValueFn=selectAsFn?selectAsFn:valueFn;return callExpression(viewValueFn,key,value);}}function getLabels(){var values=valuesFn(scope);var toDisplay;if(values && isArray(values)){toDisplay = new Array(values.length);for(var i=0,ii=values.length;i < ii;i++) {toDisplay[i] = callExpression(displayFn,i,values[i]);}return toDisplay;}else if(values){toDisplay = {};for(var prop in values) {if(values.hasOwnProperty(prop)){toDisplay[prop] = callExpression(displayFn,prop,values[prop]);}}}return toDisplay;}function createIsSelectedFn(viewValue){var selectedSet;if(multiple){if(trackFn && isArray(viewValue)){selectedSet = new HashMap([]);for(var trackIndex=0;trackIndex < viewValue.length;trackIndex++) {selectedSet.put(callExpression(trackFn,null,viewValue[trackIndex]),true);}}else {selectedSet = new HashMap(viewValue);}}else if(trackFn){viewValue = callExpression(trackFn,null,viewValue);}return function isSelected(key,value){var compareValueFn;if(trackFn){compareValueFn = trackFn;}else if(selectAsFn){compareValueFn = selectAsFn;}else {compareValueFn = valueFn;}if(multiple){return isDefined(selectedSet.remove(callExpression(compareValueFn,key,value)));}else {return viewValue === callExpression(compareValueFn,key,value);}};}function scheduleRendering(){if(!renderScheduled){scope.$$postDigest(render);renderScheduled = true;}}function updateLabelMap(labelMap,label,added){labelMap[label] = labelMap[label] || 0;labelMap[label] += added?1:-1;}function render(){renderScheduled = false;var optionGroups={'':[]},optionGroupNames=[''],optionGroupName,optionGroup,option,existingParent,existingOptions,existingOption,viewValue=ctrl.$viewValue,values=valuesFn(scope) || [],keys=keyName?sortedKeys(values):values,key,value,groupLength,length,groupIndex,index,labelMap={},selected,isSelected=createIsSelectedFn(viewValue),anySelected=false,lastElement,element,label,optionId;trackKeysCache = {};for(index = 0;length = keys.length,index < length;index++) {key = index;if(keyName){key = keys[index];if(key.charAt(0) === '$')continue;}value = values[key];optionGroupName = callExpression(groupByFn,key,value) || '';if(!(optionGroup = optionGroups[optionGroupName])){optionGroup = optionGroups[optionGroupName] = [];optionGroupNames.push(optionGroupName);}selected = isSelected(key,value);anySelected = anySelected || selected;label = callExpression(displayFn,key,value);label = isDefined(label)?label:'';optionId = trackFn?trackFn(scope,locals):keyName?keys[index]:index;if(trackFn){trackKeysCache[optionId] = key;}optionGroup.push({id:optionId,label:label,selected:selected});}if(!multiple){if(nullOption || viewValue === null){optionGroups[''].unshift({id:'',label:'',selected:!anySelected});}else if(!anySelected){optionGroups[''].unshift({id:'?',label:'',selected:true});}}for(groupIndex = 0,groupLength = optionGroupNames.length;groupIndex < groupLength;groupIndex++) {optionGroupName = optionGroupNames[groupIndex];optionGroup = optionGroups[optionGroupName];if(optionGroupsCache.length <= groupIndex){existingParent = {element:optGroupTemplate.clone().attr('label',optionGroupName),label:optionGroup.label};existingOptions = [existingParent];optionGroupsCache.push(existingOptions);selectElement.append(existingParent.element);}else {existingOptions = optionGroupsCache[groupIndex];existingParent = existingOptions[0];if(existingParent.label != optionGroupName){existingParent.element.attr('label',existingParent.label = optionGroupName);}}lastElement = null;for(index = 0,length = optionGroup.length;index < length;index++) {option = optionGroup[index];if(existingOption = existingOptions[index + 1]){lastElement = existingOption.element;if(existingOption.label !== option.label){updateLabelMap(labelMap,existingOption.label,false);updateLabelMap(labelMap,option.label,true);lastElement.text(existingOption.label = option.label);lastElement.prop('label',existingOption.label);}if(existingOption.id !== option.id){lastElement.val(existingOption.id = option.id);}if(lastElement[0].selected !== option.selected){lastElement.prop('selected',existingOption.selected = option.selected);if(msie){lastElement.prop('selected',existingOption.selected);}}}else {if(option.id === '' && nullOption){element = nullOption;}else {(element = optionTemplate.clone()).val(option.id).prop('selected',option.selected).attr('selected',option.selected).prop('label',option.label).text(option.label);}existingOptions.push(existingOption = {element:element,label:option.label,id:option.id,selected:option.selected});updateLabelMap(labelMap,option.label,true);if(lastElement){lastElement.after(element);}else {existingParent.element.append(element);}lastElement = element;}}index++;while(existingOptions.length > index) {option = existingOptions.pop();updateLabelMap(labelMap,option.label,false);option.element.remove();}}while(optionGroupsCache.length > groupIndex) {optionGroup = optionGroupsCache.pop();for(index = 1;index < optionGroup.length;++index) {updateLabelMap(labelMap,optionGroup[index].label,false);}optionGroup[0].element.remove();}forEach(labelMap,function(count,label){if(count > 0){selectCtrl.addOption(label);}else if(count < 0){selectCtrl.removeOption(label);}});}}}};}];var optionDirective=['$interpolate',function($interpolate){var nullSelectCtrl={addOption:noop,removeOption:noop};return {restrict:'E',priority:100,compile:function compile(element,attr){if(isUndefined(attr.value)){var interpolateFn=$interpolate(element.text(),true);if(!interpolateFn){attr.$set('value',element.text());}}return function(scope,element,attr){var selectCtrlName='$selectController',parent=element.parent(),selectCtrl=parent.data(selectCtrlName) || parent.parent().data(selectCtrlName);if(!selectCtrl || !selectCtrl.databound){selectCtrl = nullSelectCtrl;}if(interpolateFn){scope.$watch(interpolateFn,function interpolateWatchAction(newVal,oldVal){attr.$set('value',newVal);if(oldVal !== newVal){selectCtrl.removeOption(oldVal);}selectCtrl.addOption(newVal,element);});}else {selectCtrl.addOption(attr.value,element);}element.on('$destroy',function(){selectCtrl.removeOption(attr.value);});};}};}];var styleDirective=valueFn({restrict:'E',terminal:false});var requiredDirective=function requiredDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;attr.required = true;ctrl.$validators.required = function(modelValue,viewValue){return !attr.required || !ctrl.$isEmpty(viewValue);};attr.$observe('required',function(){ctrl.$validate();});}};};var patternDirective=function patternDirective(){return {restrict:'A',require:'?ngModel',link:function link(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(value){return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);};}};};var maxlengthDirective=function maxlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var maxlength=-1;attr.$observe('maxlength',function(value){var intVal=int(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 minlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var minlength=0;attr.$observe('minlength',function(value){minlength = int(value) || 0;ctrl.$validate();});ctrl.$validators.minlength = function(modelValue,viewValue){return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;};}};};if(window.angular.bootstrap){console.log('WARNING: Tried to load angular more than once.');return;}bindJQuery();publishExternalAPI(angular);jqLite(document).ready(function(){angularInit(document,bootstrap);});})(window,document);!window.angular.$$csp() && window.angular.element(document).find('head').prepend(''); - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - (function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define(factory);else if(typeof exports === 'object')exports['JSData'] = factory();else root['JSData'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _datastoreIndex=__webpack_require__(1);var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);module.exports = {DS:_datastoreIndex['default'],DSUtils:_utils['default'],DSErrors:_errors['default'],createStore:function createStore(options){return new _datastoreIndex['default'](options);},version:{full:'2.0.0-rc.1',major:parseInt('2',10),minor:parseInt('0',10),patch:parseInt('0',10),alpha:true?'false':false,beta:true?'false':false}};},function(module,exports,__webpack_require__){var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _sync_methodsIndex=__webpack_require__(4);var _async_methodsIndex=__webpack_require__(5);function lifecycleNoopCb(resource,attrs,cb){cb(null,attrs);}function lifecycleNoop(resource,attrs){return attrs;}function compare(_x,_x2,_x3,_x4){var _again=true;_function: while(_again) {var orderBy=_x,index=_x2,a=_x3,b=_x4;def = cA = cB = undefined;_again = false;var def=orderBy[index];var cA=_utils['default'].get(a,def[0]),cB=_utils['default'].get(b,def[0]);if(_utils['default']._s(cA)){cA = _utils['default'].upperCase(cA);}if(_utils['default']._s(cB)){cB = _utils['default'].upperCase(cB);}if(def[1] === 'DESC'){if(cB < cA){return -1;}else if(cB > cA){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}else {if(cA < cB){return -1;}else if(cA > cB){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}}}var Defaults=(function(){function Defaults(){_classCallCheck(this,Defaults);}_createClass(Defaults,[{key:'errorFn',value:function errorFn(a,b){if(this.error && typeof this.error === 'function'){try{if(typeof a === 'string'){throw new Error(a);}else {throw a;}}catch(err) {a = err;}this.error(this.name || null,a || null,b || null);}}}]);return Defaults;})();var defaultsPrototype=Defaults.prototype;defaultsPrototype.actions = {};defaultsPrototype.afterCreate = lifecycleNoopCb;defaultsPrototype.afterCreateCollection = lifecycleNoop;defaultsPrototype.afterCreateInstance = lifecycleNoop;defaultsPrototype.afterDestroy = lifecycleNoopCb;defaultsPrototype.afterEject = lifecycleNoop;defaultsPrototype.afterInject = lifecycleNoop;defaultsPrototype.afterReap = lifecycleNoop;defaultsPrototype.afterUpdate = lifecycleNoopCb;defaultsPrototype.afterValidate = lifecycleNoopCb;defaultsPrototype.allowSimpleWhere = true;defaultsPrototype.basePath = '';defaultsPrototype.beforeCreate = lifecycleNoopCb;defaultsPrototype.beforeCreateCollection = lifecycleNoop;defaultsPrototype.beforeCreateInstance = lifecycleNoop;defaultsPrototype.beforeDestroy = lifecycleNoopCb;defaultsPrototype.beforeEject = lifecycleNoop;defaultsPrototype.beforeInject = lifecycleNoop;defaultsPrototype.beforeReap = lifecycleNoop;defaultsPrototype.beforeUpdate = lifecycleNoopCb;defaultsPrototype.beforeValidate = lifecycleNoopCb;defaultsPrototype.bypassCache = false;defaultsPrototype.cacheResponse = !!_utils['default'].w;defaultsPrototype.clearEmptyQueries = true;defaultsPrototype.computed = {};defaultsPrototype.defaultAdapter = 'http';defaultsPrototype.debug = false;defaultsPrototype.defaultValues = {};defaultsPrototype.eagerEject = false;defaultsPrototype.eagerInject = false;defaultsPrototype.endpoint = '';defaultsPrototype.error = console?function(a,b,c){return console[typeof console.error === 'function'?'error':'log'](a,b,c);}:false;defaultsPrototype.instanceEvents = !!_utils['default'].w;defaultsPrototype.fallbackAdapters = ['http'];defaultsPrototype.findStrictCache = false;defaultsPrototype.idAttribute = 'id';defaultsPrototype.ignoredChanges = [/\$/];defaultsPrototype.ignoreMissing = false;defaultsPrototype.keepChangeHistory = false;defaultsPrototype.linkRelations = true;defaultsPrototype.log = console?function(a,b,c,d,e){return console[typeof console.info === 'function'?'info':'log'](a,b,c,d,e);}:false;defaultsPrototype.logFn = function(a,b,c,d){var _this=this;if(_this.debug && _this.log && typeof _this.log === 'function'){_this.log(_this.name || null,a || null,b || null,c || null,d || null);}};defaultsPrototype.maxAge = false;defaultsPrototype.methods = {};defaultsPrototype.notify = !!_utils['default'].w;defaultsPrototype.omit = [];defaultsPrototype.onConflict = 'merge';defaultsPrototype.reapAction = !!_utils['default'].w?'inject':'none';defaultsPrototype.reapInterval = !!_utils['default'].w?30000:false;defaultsPrototype.relationsEnumerable = false;defaultsPrototype.returnMeta = false;defaultsPrototype.resetHistoryOnInject = true;defaultsPrototype.strategy = 'single';defaultsPrototype.upsert = !!_utils['default'].w;defaultsPrototype.useClass = true;defaultsPrototype.useFilter = false;defaultsPrototype.validate = lifecycleNoopCb;defaultsPrototype.defaultFilter = function(collection,resourceName,params,options){var filtered=collection;var where=null;var reserved={skip:'',offset:'',where:'',limit:'',orderBy:'',sort:''};params = params || {};options = options || {};if(_utils['default']._o(params.where)){where = params.where;}else {where = {};}if(options.allowSimpleWhere){_utils['default'].forOwn(params,function(value,key){if(!(key in reserved) && !(key in where)){where[key] = {'==':value};}});}if(_utils['default'].isEmpty(where)){where = null;}if(where){filtered = _utils['default'].filter(filtered,function(attrs){var first=true;var keep=true;_utils['default'].forOwn(where,function(clause,field){if(!_utils['default']._o(clause)){clause = {'==':clause};}_utils['default'].forOwn(clause,function(term,op){var expr=undefined;var isOr=op[0] === '|';var val=_utils['default'].get(attrs,field);op = isOr?op.substr(1):op;if(op === '=='){expr = val == term;}else if(op === '==='){expr = val === term;}else if(op === '!='){expr = val != term;}else if(op === '!=='){expr = val !== term;}else if(op === '>'){expr = val > term;}else if(op === '>='){expr = val >= term;}else if(op === '<'){expr = val < term;}else if(op === '<='){expr = val <= term;}else if(op === 'isectEmpty'){expr = !_utils['default'].intersection(val || [],term || []).length;}else if(op === 'isectNotEmpty'){expr = _utils['default'].intersection(val || [],term || []).length;}else if(op === 'in'){if(_utils['default']._s(term)){expr = term.indexOf(val) !== -1;}else {expr = _utils['default'].contains(term,val);}}else if(op === 'notIn'){if(_utils['default']._s(term)){expr = term.indexOf(val) === -1;}else {expr = !_utils['default'].contains(term,val);}}else if(op === 'contains'){if(_utils['default']._s(val)){expr = val.indexOf(term) !== -1;}else {expr = _utils['default'].contains(val,term);}}else if(op === 'notContains'){if(_utils['default']._s(val)){expr = val.indexOf(term) === -1;}else {expr = !_utils['default'].contains(val,term);}}if(expr !== undefined){keep = first?expr:isOr?keep || expr:keep && expr;}first = false;});});return keep;});}var orderBy=null;if(_utils['default']._s(params.orderBy)){orderBy = [[params.orderBy,'ASC']];}else if(_utils['default']._a(params.orderBy)){orderBy = params.orderBy;}if(!orderBy && _utils['default']._s(params.sort)){orderBy = [[params.sort,'ASC']];}else if(!orderBy && _utils['default']._a(params.sort)){orderBy = params.sort;}if(orderBy){(function(){var index=0;_utils['default'].forEach(orderBy,function(def,i){if(_utils['default']._s(def)){orderBy[i] = [def,'ASC'];}else if(!_utils['default']._a(def)){throw new _errors['default'].IA('DS.filter("' + resourceName + '"[, params][, options]): ' + _utils['default'].toJson(def) + ': Must be a string or an array!',{params:{'orderBy[i]':{actual:typeof def,expected:'string|array'}}});}});filtered = _utils['default'].sort(filtered,function(a,b){return compare(orderBy,index,a,b);});})();}var limit=_utils['default']._n(params.limit)?params.limit:null;var skip=null;if(_utils['default']._n(params.skip)){skip = params.skip;}else if(_utils['default']._n(params.offset)){skip = params.offset;}if(limit && skip){filtered = _utils['default'].slice(filtered,skip,Math.min(filtered.length,skip + limit));}else if(_utils['default']._n(limit)){filtered = _utils['default'].slice(filtered,0,Math.min(filtered.length,limit));}else if(_utils['default']._n(skip)){if(skip < filtered.length){filtered = _utils['default'].slice(filtered,skip);}else {filtered = [];}}return filtered;};var DS=(function(){function DS(options){_classCallCheck(this,DS);var _this=this;options = options || {};_this.store = {};_this.s = _this.store;_this.definitions = {};_this.defs = _this.definitions;_this.adapters = {};_this.defaults = new Defaults();_this.observe = _utils['default'].observe;_utils['default'].forOwn(options,function(v,k){if(k === 'omit'){_this.defaults.omit = v.concat(Defaults.prototype.omit);}else {_this.defaults[k] = v;}});_this.defaults.logFn('new data store created',_this.defaults);var P=_utils['default'].Promise;if(P && !P.prototype.spread){P.prototype.spread = function(cb){return this.then(function(arr){return cb.apply(this,arr);});};}}_createClass(DS,[{key:'getAdapterName',value:function getAdapterName(options){var errorIfNotExist=false;options = options || {};this.defaults.logFn('getAdapterName',options);if(_utils['default']._s(options)){errorIfNotExist = true;options = {adapter:options};}if(this.adapters[options.adapter]){return options.adapter;}else if(errorIfNotExist){throw new Error(options.adapter + ' is not a registered adapter!');}else {return options.defaultAdapter;}}},{key:'getAdapter',value:function getAdapter(options){options = options || {};this.defaults.logFn('getAdapter',options);return this.adapters[this.getAdapterName(options)];}},{key:'registerAdapter',value:function registerAdapter(name,Adapter,options){var _this=this;options = options || {};_this.defaults.logFn('registerAdapter',name,Adapter,options);if(_utils['default'].isFunction(Adapter)){_this.adapters[name] = new Adapter(options);}else {_this.adapters[name] = Adapter;}if(options['default']){_this.defaults.defaultAdapter = name;}_this.defaults.logFn('default adapter is ' + _this.defaults.defaultAdapter);}},{key:'is',value:function is(resourceName,instance){var definition=this.defs[resourceName];if(!definition){throw new _errors['default'].NER(resourceName);}return instance instanceof definition[definition['class']];}}]);return DS;})();var dsPrototype=DS.prototype;dsPrototype.getAdapterName.shorthand = false;dsPrototype.getAdapter.shorthand = false;dsPrototype.registerAdapter.shorthand = false;dsPrototype.errors = _errors['default'];dsPrototype.utils = _utils['default'];function addMethods(target,obj){_utils['default'].forOwn(obj,function(v,k){target[k] = v;target[k].before = function(fn){var orig=target[k];target[k] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}return orig.apply(this,fn.apply(this,args) || args);};};});}addMethods(dsPrototype,_sync_methodsIndex['default']);addMethods(dsPrototype,_async_methodsIndex['default']);exports['default'] = DS;},function(module,exports,__webpack_require__){function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}var _errors=__webpack_require__(3);var BinaryHeap=__webpack_require__(7);var forEach=__webpack_require__(8);var slice=__webpack_require__(9);var forOwn=__webpack_require__(13);var contains=__webpack_require__(10);var deepMixIn=__webpack_require__(14);var pascalCase=__webpack_require__(18);var remove=__webpack_require__(11);var pick=__webpack_require__(15);var sort=__webpack_require__(12);var upperCase=__webpack_require__(19);var get=__webpack_require__(16);var set=__webpack_require__(17);var observe=__webpack_require__(6);var w=undefined;var objectProto=Object.prototype;var toString=objectProto.toString;var P=undefined;try{P = Promise;}catch(err) {console.error('js-data requires a global Promise constructor!');}var isArray=Array.isArray || function isArray(value){return toString.call(value) == '[object Array]' || false;};var isRegExp=function isRegExp(value){return toString.call(value) == '[object RegExp]' || false;};var isString=function isString(value){return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == '[object String]' || false;};var isObject=function isObject(value){return toString.call(value) == '[object Object]' || false;};var isDate=function isDate(value){return value && typeof value == 'object' && toString.call(value) == '[object Date]' || false;};var isNumber=function isNumber(value){var type=typeof value;return type == 'number' || value && type == 'object' && toString.call(value) == '[object Number]' || false;};var isFunction=function isFunction(value){return typeof value == 'function' || value && toString.call(value) === '[object Function]' || false;};var isStringOrNumber=function isStringOrNumber(value){return isString(value) || isNumber(value);};var isStringOrNumberErr=function isStringOrNumberErr(field){return new _errors['default'].IA('"' + field + '" must be a string or a number!');};var isObjectErr=function isObjectErr(field){return new _errors['default'].IA('"' + field + '" must be an object!');};var isArrayErr=function isArrayErr(field){return new _errors['default'].IA('"' + field + '" must be an array!');};var isEmpty=function isEmpty(val){if(val == null){return true;}else if(typeof val === 'string' || isArray(val)){return !val.length;}else if(typeof val === 'object'){var result=true;forOwn(val,function(){result = false;return false;});return result;}else {return true;}};var intersection=function intersection(array1,array2){if(!array1 || !array2){return [];}var result=[];var item=undefined;for(var i=0,_length=array1.length;i < _length;i++) {item = array1[i];if(contains(result,item)){continue;}if(contains(array2,item)){result.push(item);}}return result;};var filter=function filter(array,cb,thisObj){var results=[];forEach(array,function(value,key,arr){if(cb(value,key,arr)){results.push(value);}},thisObj);return results;};try{w = window;w = {};}catch(e) {w = null;}function Events(target){var events={};target = target || this;target.on = function(type,func,ctx){events[type] = events[type] || [];events[type].push({f:func,c:ctx});};target.off = function(type,func){var listeners=events[type];if(!listeners){events = {};}else if(func){for(var i=0;i < listeners.length;i++) {if(listeners[i] === func){listeners.splice(i,1);break;}}}else {listeners.splice(0,listeners.length);}};target.emit = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}var listeners=events[args.shift()] || [];if(listeners){for(var i=0;i < listeners.length;i++) {listeners[i].f.apply(listeners[i].c,args);}}};}var toPromisify=['beforeValidate','validate','afterValidate','beforeCreate','afterCreate','beforeUpdate','afterUpdate','beforeDestroy','afterDestroy'];var isBlacklisted=observe.isBlacklisted;var copy=function copy(source,destination,stackSource,stackDest,blacklist){if(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest,blacklist);}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(isObject(source)){destination = copy(source,Object.create(Object.getPrototypeOf(source)),stackSource,stackDest,blacklist);}}}else {if(source === destination){throw new Error('Cannot copy! Source and destination are identical.');}stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1){return stackDest[index];}stackSource.push(source);stackDest.push(destination);}var result=undefined;if(isArray(source)){var i=undefined;destination.length = 0;for(i = 0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest,blacklist);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){if(isBlacklisted(key,blacklist)){continue;}result = copy(source[key],null,stackSource,stackDest,blacklist);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}}}return destination;};var equals=function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2){return true;}if(o1 === null || o2 === null){return false;}if(o1 !== o1 && o2 !== o2){return true;}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;}_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}else if(isRegExp(o1) && isRegExp(o2)){return o1.toString() == o2.toString();}else {if(isArray(o2)){return false;}keySet = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key])){return false;}}return true;}}}return false;}};var resolveId=function resolveId(definition,idOrInstance){if(isString(idOrInstance) || isNumber(idOrInstance)){return idOrInstance;}else if(idOrInstance && definition){return idOrInstance[definition.idAttribute] || idOrInstance;}else {return idOrInstance;}};var resolveItem=function resolveItem(resource,idOrInstance){if(resource && (isString(idOrInstance) || isNumber(idOrInstance))){return resource.index[idOrInstance] || idOrInstance;}else {return idOrInstance;}};var isValidString=function isValidString(val){return val != null && val !== '';};var join=function join(items,separator){separator = separator || '';return filter(items,isValidString).join(separator);};var makePath=function makePath(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}var result=join(args,'/');return result.replace(/([^:\/]|^)\/{2,}/g,'$1/');};exports['default'] = {Promise:P,_:function _(parent,options){var _this=this;options = options || {};if(options && options.constructor === parent.constructor){return options;}else if(!isObject(options)){throw new _errors['default'].IA('"options" must be an object!');}forEach(toPromisify,function(name){if(typeof options[name] === 'function' && options[name].toString().indexOf('for (var _len = arg') === -1){options[name] = _this.promisify(options[name]);}});var O=function Options(attrs){var self=this;forOwn(attrs,function(value,key){self[key] = value;});};O.prototype = parent;O.prototype.orig = function(){var orig={};forOwn(this,function(value,key){orig[key] = value;});return orig;};return new O(options);},_n:isNumber,_s:isString,_sn:isStringOrNumber,_snErr:isStringOrNumberErr,_o:isObject,_oErr:isObjectErr,_a:isArray,_aErr:isArrayErr,compute:function compute(fn,field){var _this=this;var args=[];forEach(fn.deps,function(dep){args.push(get(_this,dep));});set(_this,field,fn[fn.length - 1].apply(_this,args));},contains:contains,copy:copy,deepMixIn:deepMixIn,diffObjectFromOldObject:observe.diffObjectFromOldObject,BinaryHeap:BinaryHeap,equals:equals,Events:Events,filter:filter,fillIn:function fillIn(target,obj){forOwn(obj,function(v,k){if(!(k in target)){target[k] = v;}});return target;},forEach:forEach,forOwn:forOwn,fromJson:function fromJson(json){return isString(json)?JSON.parse(json):json;},get:get,intersection:intersection,isArray:isArray,isBlacklisted:isBlacklisted,isEmpty:isEmpty,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isString:isString,makePath:makePath,observe:observe,omit:function omit(obj,bl){var toRemove=[];forOwn(obj,function(v,k){if(isBlacklisted(k,bl)){toRemove.push(k);}});forEach(toRemove,function(k){delete obj[k];});return obj;},pascalCase:pascalCase,pick:pick,promisify:function promisify(fn,target){var _this=this;if(!fn){return;}else if(typeof fn !== 'function'){throw new Error('Can only promisify functions!');}return function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}return new _this.Promise(function(resolve,reject){args.push(function(err,result){if(err){reject(err);}else {resolve(result);}});try{var promise=fn.apply(target || this,args);if(promise && promise.then){promise.then(resolve,reject);}}catch(err) {reject(err);}});};},remove:remove,set:set,slice:slice,sort:sort,toJson:JSON.stringify,updateTimestamp:function updateTimestamp(timestamp){var newTimestamp=typeof Date.now === 'function'?Date.now():new Date().getTime();if(timestamp && newTimestamp <= timestamp){return timestamp + 1;}else {return newTimestamp;}},upperCase:upperCase,removeCircular:function removeCircular(object){return (function rmCirc(value,ctx){var i=undefined;var nu=undefined;if(typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)){var cur=ctx.cur;var parent=ctx.ctx;while(parent) {if(parent.cur === cur){return undefined;}parent = parent.ctx;}if(isArray(value)){nu = [];for(i = 0;i < value.length;i += 1) {nu[i] = rmCirc(value[i],{ctx:ctx,cur:value[i]});}}else {nu = {};forOwn(value,function(v,k){nu[k] = rmCirc(value[k],{ctx:ctx,cur:value[k]});});}return nu;}return value;})(object,{ctx:null,cur:object});},resolveItem:resolveItem,resolveId:resolveId,respond:function respond(response,meta,options){if(options.returnMeta === 'array'){return [response,meta];}else if(options.returnMeta === 'object'){return {response:response,meta:meta};}else {return response;}},w:w,applyRelationGettersToTarget:function applyRelationGettersToTarget(store,definition,target){this.forEach(definition.relationList,function(def){var relationName=def.relation;var enumerable=typeof def.enumerable === 'boolean'?def.enumerable:!!definition.relationsEnumerable;if(typeof def.link === 'boolean'?def.link:!!definition.linkRelations){delete target[def.localField];if(def.type === 'belongsTo'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else if(def.type === 'hasMany'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};if(def.foreignKey){params[def.foreignKey] = this[definition.idAttribute];return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true});}else if(def.localKeys){params.where = _defineProperty({},definition.getResource(relationName).idAttribute,{'in':this[def.localKeys]});return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params);}return undefined;},set:function set(){}});}else if(def.type === 'hasOne'){if(def.localKey){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else {Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};params[def.foreignKey] = this[definition.idAttribute];var items=params[def.foreignKey]?definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true}):[];if(items.length){return items[0];}return undefined;},set:function set(){}});}}}});}};},function(module,exports,__webpack_require__){var _get=function get(_x,_x2,_x3){var _again=true;_function: while(_again) {var object=_x,property=_x2,receiver=_x3;desc = parent = getter = undefined;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x = parent;_x2 = property;_x3 = receiver;_again = true;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)subClass.__proto__ = superClass;}var IllegalArgumentError=(function(_Error){function IllegalArgumentError(message){_classCallCheck(this,IllegalArgumentError);_get(Object.getPrototypeOf(IllegalArgumentError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(IllegalArgumentError,_Error);return IllegalArgumentError;})(Error);var RuntimeError=(function(_Error2){function RuntimeError(message){_classCallCheck(this,RuntimeError);_get(Object.getPrototypeOf(RuntimeError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(RuntimeError,_Error2);return RuntimeError;})(Error);var NonexistentResourceError=(function(_Error3){function NonexistentResourceError(resourceName){_classCallCheck(this,NonexistentResourceError);_get(Object.getPrototypeOf(NonexistentResourceError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = resourceName + ' is not a registered resource!';}_inherits(NonexistentResourceError,_Error3);return NonexistentResourceError;})(Error);exports['default'] = {IllegalArgumentError:IllegalArgumentError,IA:IllegalArgumentError,RuntimeError:RuntimeError,R:RuntimeError,NonexistentResourceError:NonexistentResourceError,NER:NonexistentResourceError};},function(module,exports,__webpack_require__){var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _defineResource=__webpack_require__(28);var _eject=__webpack_require__(29);var _ejectAll=__webpack_require__(30);var _filter=__webpack_require__(31);var _inject=__webpack_require__(32);var NER=_errors['default'].NER;var IA=_errors['default'].IA;var R=_errors['default'].R;function diffIsEmpty(diff){return !(_utils['default'].isEmpty(diff.added) && _utils['default'].isEmpty(diff.removed) && _utils['default'].isEmpty(diff.changed));}exports['default'] = {changes:function changes(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];options = options || {};id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('changes',id,options);var item=definition.get(id);if(item){var _ret=(function(){if(_utils['default'].w){_this.s[resourceName].observers[id].deliver();}var ignoredChanges=options.ignoredChanges || [];_utils['default'].forEach(definition.relationFields,function(field){if(!_utils['default'].contains(ignoredChanges,field)){ignoredChanges.push(field);}});var diff=_utils['default'].diffObjectFromOldObject(item,_this.s[resourceName].previousAttributes[id],_utils['default'].equals,ignoredChanges);_utils['default'].forOwn(diff,function(changeset,name){var toKeep=[];_utils['default'].forOwn(changeset,function(value,field){if(!_utils['default'].isFunction(value)){toKeep.push(field);}});diff[name] = _utils['default'].pick(diff[name],toKeep);});_utils['default'].forEach(definition.relationFields,function(field){delete diff.added[field];delete diff.removed[field];delete diff.changed[field];});return {v:diff};})();if(typeof _ret === 'object')return _ret.v;}},changeHistory:function changeHistory(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(resourceName && !_this.defs[resourceName]){throw new NER(resourceName);}else if(id && !_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('changeHistory',id);if(!definition.keepChangeHistory){definition.errorFn('changeHistory is disabled for this resource!');}else {if(resourceName){var item=definition.get(id);if(item){return resource.changeHistories[id];}}else {return resource.changeHistory;}}},compute:function compute(resourceName,instance){var _this=this;var definition=_this.defs[resourceName];instance = _utils['default'].resolveItem(_this.s[resourceName],instance);if(!definition){throw new NER(resourceName);}else if(!instance){throw new R('Item not in the store!');}else if(!_utils['default']._o(instance) && !_utils['default']._sn(instance)){throw new IA('"instance" must be an object, string or number!');}definition.logFn('compute',instance);_utils['default'].forOwn(definition.computed,function(fn,field){_utils['default'].compute.call(instance,fn,field);});return instance;},createInstance:function createInstance(resourceName,attrs,options){var definition=this.defs[resourceName];var item=undefined;attrs = attrs || {};if(!definition){throw new NER(resourceName);}else if(attrs && !_utils['default'].isObject(attrs)){throw new IA('"attrs" must be an object!');}options = _utils['default']._(definition,options);options.logFn('createInstance',attrs,options);options.beforeCreateInstance(options,attrs);var Constructor=definition[definition['class']];item = new Constructor();if(options.defaultValues){_utils['default'].deepMixIn(item,options.defaultValues);}_utils['default'].deepMixIn(item,attrs);if(definition.computed){definition.compute(item);}options.afterCreateInstance(options,item);return item;},createCollection:function createCollection(resourceName,arr,params,options){var _this=this;var definition=_this.defs[resourceName];arr = arr || [];params = params || {};if(!definition){throw new NER(resourceName);}else if(arr && !_utils['default'].isArray(arr)){throw new IA('"arr" must be an array!');}options = _utils['default']._(definition,options);options.logFn('createCollection',arr,options);options.beforeCreateCollection(options,arr);Object.defineProperties(arr,{fetch:{value:function value(params,options){var __this=this;__this.params = params || __this.params;return definition.findAll(__this.params,options).then(function(data){if(data === __this){return __this;}data.unshift(__this.length);data.unshift(0);__this.splice.apply(__this,data);data.shift();data.shift();if(data.$$injected){_this.s[resourceName].queryData[_utils['default'].toJson(__this.params)] = __this;__this.$$injected = true;}return __this;});}},params:{value:params,writable:true},resourceName:{value:resourceName}});options.afterCreateCollection(options,arr);return arr;},defineResource:_defineResource['default'],digest:function digest(){this.observe.Platform.performMicrotaskCheckpoint();},eject:_eject['default'],ejectAll:_ejectAll['default'],filter:_filter['default'],get:function get(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('get',id,options);return _this.s[resourceName].index[id];},getAll:function getAll(resourceName,ids){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var collection=[];if(!definition){throw new NER(resourceName);}else if(ids && !_utils['default']._a(ids)){throw _utils['default']._aErr('ids');}definition.logFn('getAll',ids);if(_utils['default']._a(ids)){var _length=ids.length;for(var i=0;i < _length;i++) {if(resource.index[ids[i]]){collection.push(resource.index[ids[i]]);}}}else {collection = resource.collection.slice();}return collection;},hasChanges:function hasChanges(resourceName,id){var _this=this;var definition=_this.defs[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('hasChanges',id);return definition.get(id)?diffIsEmpty(definition.changes(id)):false;},inject:_inject['default'],lastModified:function lastModified(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastModified',id);if(id){if(!(id in resource.modified)){resource.modified[id] = 0;}return resource.modified[id];}return resource.collectionModified;},lastSaved:function lastSaved(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastSaved',id);if(!(id in resource.saved)){resource.saved[id] = 0;}return resource.saved[id];},previous:function previous(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('previous',id);return resource.previousAttributes[id]?_utils['default'].copy(resource.previousAttributes[id]):undefined;}};},function(module,exports,__webpack_require__){var _create=__webpack_require__(33);var _destroy=__webpack_require__(34);var _destroyAll=__webpack_require__(35);var _find=__webpack_require__(36);var _findAll=__webpack_require__(37);var _loadRelations=__webpack_require__(38);var _reap=__webpack_require__(39);var _save=__webpack_require__(40);var _update=__webpack_require__(41);var _updateAll=__webpack_require__(42);exports['default'] = {create:_create['default'],destroy:_destroy['default'],destroyAll:_destroyAll['default'],find:_find['default'],findAll:_findAll['default'],loadRelations:_loadRelations['default'],reap:_reap['default'],refresh:function refresh(resourceName,id,options){var _this=this;var DSUtils=_this.utils;return new DSUtils.Promise(function(resolve,reject){var definition=_this.defs[resourceName];id = DSUtils.resolveId(_this.defs[resourceName],id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refresh',id,options);resolve(_this.get(resourceName,id));}}).then(function(item){return item?_this.find(resourceName,id,options):item;});},refreshAll:function refreshAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refreshAll',params,options);resolve(_this.filter(resourceName,params,options));}}).then(function(existing){options.bypassCache = true;return _this.findAll(resourceName,params,options).then(function(found){DSUtils.forEach(existing,function(item){if(found.indexOf(item) === -1){definition.eject(item);}});return found;});});},save:_save['default'],update:_update['default'],updateAll:_updateAll['default']};},function(module,exports,__webpack_require__){(function(global){var testingExposeCycleCount=global.testingExposeCycleCount;function detectObjectObserve(){if(typeof Object.observe !== 'function' || typeof Array.observe !== 'function'){return false;}var records=[];function callback(recs){records = recs;}var test={};var arr=[];Object.observe(test,callback);Array.observe(arr,callback);test.id = 1;test.id = 2;delete test.id;arr.push(1,2);arr.length = 0;Object.deliverChangeRecords(callback);if(records.length !== 5)return false;if(records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice'){return false;}Object.unobserve(test,callback);Array.unobserve(arr,callback);return true;}var hasObserve=detectObjectObserve();var createObject='__proto__' in {}?function(obj){return obj;}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name));});return newObject;};var MAX_DIRTY_CHECK_CYCLES=1000;function dirtyCheck(observer){var cycles=0;while(cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {cycles++;}if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;return cycles > 0;}function objectIsEmpty(object){for(var prop in object) return false;return true;}function diffIsEmpty(diff){return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed);}function isBlacklisted(prop,bl){if(!bl || !bl.length){return false;}var matches;for(var i=0;i < bl.length;i++) {if(Object.prototype.toString.call(bl[i]) === '[object RegExp]' && bl[i].test(prop) || bl[i] === prop){return matches = prop;}}return !!matches;}function diffObjectFromOldObject(object,oldObject,equals,bl){var added={};var removed={};var changed={};for(var prop in oldObject) {var newValue=object[prop];if(isBlacklisted(prop,bl))continue;if(newValue !== undefined && (equals?equals(newValue,oldObject[prop]):newValue === oldObject[prop]))continue;if(!(prop in object)){removed[prop] = undefined;continue;}if(equals?!equals(newValue,oldObject[prop]):newValue !== oldObject[prop])changed[prop] = newValue;}for(var prop in object) {if(prop in oldObject)continue;if(isBlacklisted(prop,bl))continue;added[prop] = object[prop];}if(Array.isArray(object) && object.length !== oldObject.length)changed.length = object.length;return {added:added,removed:removed,changed:changed};}var eomTasks=[];function runEOMTasks(){if(!eomTasks.length)return false;for(var i=0;i < eomTasks.length;i++) {eomTasks[i]();}eomTasks.length = 0;return true;}var runEOM=hasObserve?(function(){return function(fn){return Promise.resolve().then(fn);};})():(function(){return function(fn){eomTasks.push(fn);};})();var observedObjectCache=[];function newObservedObject(){var observer;var object;var discardRecords=false;var first=true;function callback(records){if(observer && observer.state_ === OPENED && !discardRecords)observer.check_(records);}return {open:function open(obs){if(observer)throw Error('ObservedObject in use');if(!first)Object.deliverChangeRecords(callback);observer = obs;first = false;},observe:function observe(obj,arrayObserve){object = obj;if(arrayObserve)Array.observe(object,callback);else Object.observe(object,callback);},deliver:function deliver(discard){discardRecords = discard;Object.deliverChangeRecords(callback);discardRecords = false;},close:function close(){observer = undefined;Object.unobserve(object,callback);observedObjectCache.push(this);}};}function getObservedObject(observer,object,arrayObserve){var dir=observedObjectCache.pop() || newObservedObject();dir.open(observer);dir.observe(object,arrayObserve);return dir;}var UNOPENED=0;var OPENED=1;var CLOSED=2;var nextObserverId=1;function Observer(){this.state_ = UNOPENED;this.callback_ = undefined;this.target_ = undefined;this.directObserver_ = undefined;this.value_ = undefined;this.id_ = nextObserverId++;}Observer.prototype = {open:function open(callback,target){if(this.state_ != UNOPENED)throw Error('Observer has already been opened.');addToAll(this);this.callback_ = callback;this.target_ = target;this.connect_();this.state_ = OPENED;return this.value_;},close:function close(){if(this.state_ != OPENED)return;removeFromAll(this);this.disconnect_();this.value_ = undefined;this.callback_ = undefined;this.target_ = undefined;this.state_ = CLOSED;},deliver:function deliver(){if(this.state_ != OPENED)return;dirtyCheck(this);},report_:function report_(changes){try{this.callback_.apply(this.target_,changes);}catch(ex) {Observer._errorThrownDuringCallback = true;console.error('Exception caught during observer callback: ' + (ex.stack || ex));}},discardChanges:function discardChanges(){this.check_(undefined,true);return this.value_;}};var collectObservers=!hasObserve;var allObservers;Observer._allObserversCount = 0;if(collectObservers){allObservers = [];}function addToAll(observer){Observer._allObserversCount++;if(!collectObservers)return;allObservers.push(observer);}function removeFromAll(observer){Observer._allObserversCount--;}var runningMicrotaskCheckpoint=false;global.Platform = global.Platform || {};global.Platform.performMicrotaskCheckpoint = function(){if(runningMicrotaskCheckpoint)return;if(!collectObservers)return;runningMicrotaskCheckpoint = true;var cycles=0;var anyChanged,toCheck;do {cycles++;toCheck = allObservers;allObservers = [];anyChanged = false;for(var i=0;i < toCheck.length;i++) {var observer=toCheck[i];if(observer.state_ != OPENED)continue;if(observer.check_())anyChanged = true;allObservers.push(observer);}if(runEOMTasks())anyChanged = true;}while(cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;runningMicrotaskCheckpoint = false;};if(collectObservers){global.Platform.clearObservers = function(){allObservers = [];};}function ObjectObserver(object){Observer.call(this);this.value_ = object;this.oldObject_ = undefined;}ObjectObserver.prototype = createObject({__proto__:Observer.prototype,arrayObserve:false,connect_:function connect_(callback,target){if(hasObserve){this.directObserver_ = getObservedObject(this,this.value_,this.arrayObserve);}else {this.oldObject_ = this.copyObject(this.value_);}},copyObject:function copyObject(object){var copy=Array.isArray(object)?[]:{};for(var prop in object) {copy[prop] = object[prop];};if(Array.isArray(object))copy.length = object.length;return copy;},check_:function check_(changeRecords,skipChanges){var diff;var oldValues;if(hasObserve){if(!changeRecords)return false;oldValues = {};diff = diffObjectFromChangeRecords(this.value_,changeRecords,oldValues);}else {oldValues = this.oldObject_;diff = diffObjectFromOldObject(this.value_,this.oldObject_);}if(diffIsEmpty(diff))return false;if(!hasObserve)this.oldObject_ = this.copyObject(this.value_);this.report_([diff.added || {},diff.removed || {},diff.changed || {},function(property){return oldValues[property];}]);return true;},disconnect_:function disconnect_(){if(hasObserve){this.directObserver_.close();this.directObserver_ = undefined;}else {this.oldObject_ = undefined;}},deliver:function deliver(){if(this.state_ != OPENED)return;if(hasObserve)this.directObserver_.deliver(false);else dirtyCheck(this);},discardChanges:function discardChanges(){if(this.directObserver_)this.directObserver_.deliver(true);else this.oldObject_ = this.copyObject(this.value_);return this.value_;}});var observerSentinel={};var expectedRecordTypes={add:true,update:true,'delete':true};function diffObjectFromChangeRecords(object,changeRecords,oldValues){var added={};var removed={};for(var i=0;i < changeRecords.length;i++) {var record=changeRecords[i];if(!expectedRecordTypes[record.type]){console.error('Unknown changeRecord type: ' + record.type);console.error(record);continue;}if(!(record.name in oldValues))oldValues[record.name] = record.oldValue;if(record.type == 'update')continue;if(record.type == 'add'){if(record.name in removed)delete removed[record.name];else added[record.name] = true;continue;}if(record.name in added){delete added[record.name];delete oldValues[record.name];}else {removed[record.name] = true;}}for(var prop in added) added[prop] = object[prop];for(var prop in removed) removed[prop] = undefined;var changed={};for(var prop in oldValues) {if(prop in added || prop in removed)continue;var newValue=object[prop];if(oldValues[prop] !== newValue)changed[prop] = newValue;}return {added:added,removed:removed,changed:changed};}global.Observer = Observer;global.isBlacklisted = isBlacklisted;global.Observer.runEOM_ = runEOM;global.Observer.observerSentinel_ = observerSentinel;global.Observer.hasObjectObserve = hasObserve;global.diffObjectFromOldObject = diffObjectFromOldObject;global.ObjectObserver = ObjectObserver;})(exports);},function(module,exports,__webpack_require__){(function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define('yabh',factory);else if(typeof exports === 'object')exports['BinaryHeap'] = factory();else root['BinaryHeap'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _classCallCheck=function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}};var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();Object.defineProperty(exports,'__esModule',{value:true});function bubbleUp(heap,weightFunc,n){var element=heap[n];var weight=weightFunc(element);while(n > 0) {var parentN=Math.floor((n + 1) / 2) - 1;var _parent=heap[parentN];if(weight >= weightFunc(_parent)){break;}else {heap[parentN] = element;heap[n] = _parent;n = parentN;}}}var bubbleDown=function bubbleDown(heap,weightFunc,n){var length=heap.length;var node=heap[n];var nodeWeight=weightFunc(node);while(true) {var child2N=(n + 1) * 2,child1N=child2N - 1;var swap=null;if(child1N < length){var child1=heap[child1N],child1Weight=weightFunc(child1);if(child1Weight < nodeWeight){swap = child1N;}}if(child2N < length){var child2=heap[child2N],child2Weight=weightFunc(child2);if(child2Weight < (swap === null?nodeWeight:weightFunc(heap[child1N]))){swap = child2N;}}if(swap === null){break;}else {heap[n] = heap[swap];heap[swap] = node;n = swap;}}};var BinaryHeap=(function(){function BinaryHeap(weightFunc,compareFunc){_classCallCheck(this,BinaryHeap);if(!weightFunc){weightFunc = function(x){return x;};}if(!compareFunc){compareFunc = function(x,y){return x === y;};}if(typeof weightFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');}if(typeof compareFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');}this.weightFunc = weightFunc;this.compareFunc = compareFunc;this.heap = [];}_createClass(BinaryHeap,[{key:'push',value:function push(node){this.heap.push(node);bubbleUp(this.heap,this.weightFunc,this.heap.length - 1);}},{key:'peek',value:function peek(){return this.heap[0];}},{key:'pop',value:function pop(){var front=this.heap[0];var end=this.heap.pop();if(this.heap.length > 0){this.heap[0] = end;bubbleDown(this.heap,this.weightFunc,0);}return front;}},{key:'remove',value:function remove(node){var length=this.heap.length;for(var i=0;i < length;i++) {if(this.compareFunc(this.heap[i],node)){var removed=this.heap[i];var end=this.heap.pop();if(i !== length - 1){this.heap[i] = end;bubbleUp(this.heap,this.weightFunc,i);bubbleDown(this.heap,this.weightFunc,i);}return removed;}}return null;}},{key:'removeAll',value:function removeAll(){this.heap = [];}},{key:'size',value:function size(){return this.heap.length;}}]);return BinaryHeap;})();exports['default'] = BinaryHeap;module.exports = exports['default'];}]));});;},function(module,exports,__webpack_require__){function forEach(arr,callback,thisObj){if(arr == null){return;}var i=-1,len=arr.length;while(++i < len) {if(callback.call(thisObj,arr[i],i,arr) === false){break;}}}module.exports = forEach;},function(module,exports,__webpack_require__){function slice(arr,start,end){var len=arr.length;if(start == null){start = 0;}else if(start < 0){start = Math.max(len + start,0);}else {start = Math.min(start,len);}if(end == null){end = len;}else if(end < 0){end = Math.max(len + end,0);}else {end = Math.min(end,len);}var result=[];while(start < end) {result.push(arr[start++]);}return result;}module.exports = slice;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function contains(arr,val){return indexOf(arr,val) !== -1;}module.exports = contains;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function remove(arr,item){var idx=indexOf(arr,item);if(idx !== -1)arr.splice(idx,1);}module.exports = remove;},function(module,exports,__webpack_require__){function mergeSort(arr,compareFn){if(arr == null){return [];}else if(arr.length < 2){return arr;}if(compareFn == null){compareFn = defaultCompare;}var mid,left,right;mid = ~ ~(arr.length / 2);left = mergeSort(arr.slice(0,mid),compareFn);right = mergeSort(arr.slice(mid,arr.length),compareFn);return merge(left,right,compareFn);}function defaultCompare(a,b){return a < b?-1:a > b?1:0;}function merge(left,right,compareFn){var result=[];while(left.length && right.length) {if(compareFn(left[0],right[0]) <= 0){result.push(left.shift());}else {result.push(right.shift());}}if(left.length){result.push.apply(result,left);}if(right.length){result.push.apply(result,right);}return result;}module.exports = mergeSort;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var forIn=__webpack_require__(22);function forOwn(obj,fn,thisObj){forIn(obj,function(val,key){if(hasOwn(obj,key)){return fn.call(thisObj,obj[key],key,obj);}});}module.exports = forOwn;},function(module,exports,__webpack_require__){var forOwn=__webpack_require__(13);var isPlainObject=__webpack_require__(23);function deepMixIn(target,objects){var i=0,n=arguments.length,obj;while(++i < n) {obj = arguments[i];if(obj){forOwn(obj,copyProp,target);}}return target;}function copyProp(val,key){var existing=this[key];if(isPlainObject(val) && isPlainObject(existing)){deepMixIn(existing,val);}else {this[key] = val;}}module.exports = deepMixIn;},function(module,exports,__webpack_require__){var slice=__webpack_require__(9);function pick(obj,var_keys){var keys=typeof arguments[1] !== 'string'?arguments[1]:slice(arguments,1),out={},i=0,key;while(key = keys[i++]) {out[key] = obj[key];}return out;}module.exports = pick;},function(module,exports,__webpack_require__){var isPrimitive=__webpack_require__(24);function get(obj,prop){var parts=prop.split('.'),last=parts.pop();while(prop = parts.shift()) {obj = obj[prop];if(obj == null)return;}return obj[last];}module.exports = get;},function(module,exports,__webpack_require__){var namespace=__webpack_require__(25);function set(obj,prop,val){var parts=/^(.+)\.(.+)$/.exec(prop);if(parts){namespace(obj,parts[1])[parts[2]] = val;}else {obj[prop] = val;}}module.exports = set;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var camelCase=__webpack_require__(27);var upperCase=__webpack_require__(19);function pascalCase(str){str = toString(str);return camelCase(str).replace(/^[a-z]/,upperCase);}module.exports = pascalCase;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function upperCase(str){str = toString(str);return str.toUpperCase();}module.exports = upperCase;},function(module,exports,__webpack_require__){function indexOf(arr,item,fromIndex){fromIndex = fromIndex || 0;if(arr == null){return -1;}var len=arr.length,i=fromIndex < 0?len + fromIndex:fromIndex;while(i < len) {if(arr[i] === item){return i;}i++;}return -1;}module.exports = indexOf;},function(module,exports,__webpack_require__){function hasOwn(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports = hasOwn;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var _hasDontEnumBug,_dontEnums;function checkDontEnum(){_dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'];_hasDontEnumBug = true;for(var key in {'toString':null}) {_hasDontEnumBug = false;}}function forIn(obj,fn,thisObj){var key,i=0;if(_hasDontEnumBug == null)checkDontEnum();for(key in obj) {if(exec(fn,obj,key,thisObj) === false){break;}}if(_hasDontEnumBug){var ctor=obj.constructor,isProto=!!ctor && obj === ctor.prototype;while(key = _dontEnums[i++]) {if((key !== 'constructor' || !isProto && hasOwn(obj,key)) && obj[key] !== Object.prototype[key]){if(exec(fn,obj,key,thisObj) === false){break;}}}}}function exec(fn,obj,key,thisObj){return fn.call(thisObj,obj[key],key,obj);}module.exports = forIn;},function(module,exports,__webpack_require__){function isPlainObject(value){return !!value && typeof value === 'object' && value.constructor === Object;}module.exports = isPlainObject;},function(module,exports,__webpack_require__){function isPrimitive(value){switch(typeof value){case 'string':case 'number':case 'boolean':return true;}return value == null;}module.exports = isPrimitive;},function(module,exports,__webpack_require__){var forEach=__webpack_require__(8);function namespace(obj,path){if(!path)return obj;forEach(path.split('.'),function(key){if(!obj[key]){obj[key] = {};}obj = obj[key];});return obj;}module.exports = namespace;},function(module,exports,__webpack_require__){function toString(val){return val == null?'':val.toString();}module.exports = toString;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var replaceAccents=__webpack_require__(43);var removeNonWord=__webpack_require__(44);var upperCase=__webpack_require__(19);var lowerCase=__webpack_require__(45);function camelCase(str){str = toString(str);str = replaceAccents(str);str = removeNonWord(str).replace(/[\-_]/g,' ').replace(/\s[a-z]/g,upperCase).replace(/\s+/g,'').replace(/^[A-Z]/g,lowerCase);return str;}module.exports = camelCase;},function(module,exports,__webpack_require__){exports['default'] = defineResource;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var instanceMethods=['compute','eject','refresh','save','update','destroy','loadRelations','changeHistory','changes','hasChanges','lastModified','lastSaved','previous'];function defineResource(definition){var _this=this;var definitions=_this.defs;if(_utils['default']._s(definition)){definition = {name:definition.replace(/\s/gi,'')};}if(!_utils['default']._o(definition)){throw _utils['default']._oErr('definition');}else if(!_utils['default']._s(definition.name)){throw new _errors['default'].IA('"name" must be a string!');}else if(definitions[definition.name]){throw new _errors['default'].R(definition.name + ' is already registered!');}function Resource(options){this.defaultValues = {};this.methods = {};this.computed = {};_utils['default'].deepMixIn(this,options);var parent=_this.defaults;if(definition['extends'] && definitions[definition['extends']]){parent = definitions[definition['extends']];}_utils['default'].fillIn(this.defaultValues,parent.defaultValues);_utils['default'].fillIn(this.methods,parent.methods);_utils['default'].fillIn(this.computed,parent.computed);this.endpoint = 'endpoint' in options?options.endpoint:this.name;}try{var def;var _class;var _ret=(function(){if(definition['extends'] && definitions[definition['extends']]){Resource.prototype = definitions[definition['extends']];}else {Resource.prototype = _this.defaults;}definitions[definition.name] = new Resource(definition);def = definitions[definition.name];def.getResource = function(resourceName){return _this.defs[resourceName];};def.logFn('Preparing resource.');if(!_utils['default']._s(def.idAttribute)){throw new _errors['default'].IA('"idAttribute" must be a string!');}if(def.relations){def.relationList = [];def.relationFields = [];_utils['default'].forOwn(def.relations,function(relatedModels,type){_utils['default'].forOwn(relatedModels,function(defs,relationName){if(!_utils['default']._a(defs)){relatedModels[relationName] = [defs];}_utils['default'].forEach(relatedModels[relationName],function(d){d.type = type;d.relation = relationName;d.name = def.name;def.relationList.push(d);if(d.localField){def.relationFields.push(d.localField);}});});});if(def.relations.belongsTo){_utils['default'].forOwn(def.relations.belongsTo,function(relatedModel,modelName){_utils['default'].forEach(relatedModel,function(relation){if(relation.parent){def.parent = modelName;def.parentKey = relation.localKey;def.parentField = relation.localField;}});});}if(typeof Object.freeze === 'function'){Object.freeze(def.relations);Object.freeze(def.relationList);}}_class = def['class'] = _utils['default'].pascalCase(def.name);try{if(typeof def.useClass === 'function'){eval('function ' + _class + '() { def.useClass.call(this); }');def[_class] = eval(_class);def[_class].prototype = (function(proto){function Ctor(){}Ctor.prototype = proto;return new Ctor();})(def.useClass.prototype);}else {eval('function ' + _class + '() {}');def[_class] = eval(_class);}}catch(e) {def[_class] = function(){};}_utils['default'].forOwn(def.methods,function(fn,m){def[_class].prototype[m] = fn;});def[_class].prototype.set = function(key,value){var _this2=this;_utils['default'].set(this,key,value);def.compute(this);if(def.instanceEvents){setTimeout(function(){_this2.emit('DS.change',def,_this2);},0);}def.handleChange(this);return this;};def[_class].prototype.get = function(key){return _utils['default'].get(this,key);};if(def.instanceEvents){_utils['default'].Events(def[_class].prototype);}_utils['default'].applyRelationGettersToTarget(_this,def,def[_class].prototype);var parentOmit=null;if(!def.hasOwnProperty('omit')){parentOmit = def.omit;def.omit = [];}else {parentOmit = _this.defaults.omit;}def.omit = def.omit.concat(parentOmit || []);_utils['default'].forOwn(def.computed,function(fn,field){if(_utils['default'].isFunction(fn)){def.computed[field] = [fn];fn = def.computed[field];}if(def.methods && field in def.methods){def.errorFn('Computed property "' + field + '" conflicts with previously defined prototype method!');}def.omit.push(field);var deps;if(fn.length === 1){var match=fn[0].toString().match(/function.*?\(([\s\S]*?)\)/);deps = match[1].split(',');def.computed[field] = deps.concat(fn);fn = def.computed[field];if(deps.length){def.errorFn('Use the computed property array syntax for compatibility with minified code!');}}deps = fn.slice(0,fn.length - 1);_utils['default'].forEach(deps,function(val,index){deps[index] = val.trim();});fn.deps = _utils['default'].filter(deps,function(dep){return !!dep;});});_utils['default'].forEach(instanceMethods,function(name){def[_class].prototype['DS' + _utils['default'].pascalCase(name)] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}args.unshift(this[def.idAttribute] || this);args.unshift(def.name);return _this[name].apply(_this,args);};});def[_class].prototype.DSCreate = function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}args.unshift(this);args.unshift(def.name);return _this.create.apply(_this,args);};_this.s[def.name] = {collection:[],expiresHeap:new _utils['default'].BinaryHeap(function(x){return x.expires;},function(x,y){return x.item === y;}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var resource=_this.s[def.name];if(def.reapInterval){setInterval(function(){return def.reap();},def.reapInterval);}var fns=['registerAdapter','getAdapterName','getAdapter','is'];for(var key in _this) {if(typeof _this[key] === 'function'){fns.push(key);}}_utils['default'].forEach(fns,function(key){var k=key;if(_this[k].shorthand !== false){def[k] = function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}args.unshift(def.name);return _this[k].apply(_this,args);};def[k].before = function(fn){var orig=def[k];def[k] = function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4 < _len4;_key4++) {args[_key4] = arguments[_key4];}return orig.apply(def,fn.apply(def,args) || args);};};}else {def[k] = function(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5 < _len5;_key5++) {args[_key5] = arguments[_key5];}return _this[k].apply(_this,args);};}});def.beforeValidate = _utils['default'].promisify(def.beforeValidate);def.validate = _utils['default'].promisify(def.validate);def.afterValidate = _utils['default'].promisify(def.afterValidate);def.beforeCreate = _utils['default'].promisify(def.beforeCreate);def.afterCreate = _utils['default'].promisify(def.afterCreate);def.beforeUpdate = _utils['default'].promisify(def.beforeUpdate);def.afterUpdate = _utils['default'].promisify(def.afterUpdate);def.beforeDestroy = _utils['default'].promisify(def.beforeDestroy);def.afterDestroy = _utils['default'].promisify(def.afterDestroy);var defaultAdapter=undefined;if(def.hasOwnProperty('defaultAdapter')){defaultAdapter = def.defaultAdapter;}_utils['default'].forOwn(def.actions,function(action,name){if(def[name] && !def.actions[name]){throw new Error('Cannot override existing method "' + name + '"!');}action.request = action.request || function(config){return config;};action.response = action.response || function(response){return response;};action.responseError = action.responseError || function(err){return _utils['default'].Promise.reject(err);};def[name] = function(id,options){if(_utils['default']._o(id)){options = id;}options = options || {};var adapter=def.getAdapter(action.adapter || defaultAdapter || 'http');var config=_utils['default'].deepMixIn({},action);if(!options.hasOwnProperty('endpoint') && config.endpoint){options.endpoint = config.endpoint;}if(typeof options.getEndpoint === 'function'){config.url = options.getEndpoint(def,options);}else {var args=[options.basePath || adapter.defaults.basePath || def.basePath,adapter.getEndpoint(def,_utils['default']._sn(id)?id:null,options)];if(_utils['default']._sn(id)){args.push(id);}args.push(action.pathname || name);config.url = _utils['default'].makePath.apply(null,args);}config.method = config.method || 'GET';_utils['default'].deepMixIn(config,options);return new _utils['default'].Promise(function(r){return r(config);}).then(options.request || action.request).then(function(config){return adapter.HTTP(config);}).then(options.response || action.response,options.responseError || action.responseError);};});_utils['default'].Events(def);def.handleChange = function(data){resource.collectionModified = _utils['default'].updateTimestamp(resource.collectionModified);if(def.notify){setTimeout(function(){def.emit('DS.change',def,data);},0);}};def.logFn('Done preparing resource.');return {v:def};})();if(typeof _ret === 'object')return _ret.v;}catch(err) {_this.defaults.errorFn(err);delete definitions[definition.name];delete _this.s[definition.name];throw err;}}},function(module,exports,__webpack_require__){exports['default'] = eject;function eject(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined;var found=false;id = DSUtils.resolveId(definition,id);if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._sn(id)){throw DSUtils._snErr('id');}options = DSUtils._(definition,options);options.logFn('eject',id,options);for(var i=0;i < resource.collection.length;i++) {if(resource.collection[i][definition.idAttribute] == id){item = resource.collection[i];resource.expiresHeap.remove(item);found = true;break;}}if(found){var _ret=(function(){definition.beforeEject(options,item);if(options.notify){definition.emit('DS.beforeEject',definition,item);}var toRemove=[];DSUtils.forOwn(resource.queryData,function(items,queryHash){if(items.$$injected){DSUtils.remove(items,item);}if(!items.length && options.clearEmptyQueries){toRemove.push(queryHash);}});DSUtils.forEach(resource.changeHistories[id],function(changeRecord){DSUtils.remove(resource.changeHistory,changeRecord);});DSUtils.forEach(toRemove,function(queryHash){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];});if(DSUtils.w){resource.observers[id].close();}delete resource.observers[id];delete resource.index[id];delete resource.previousAttributes[id];delete resource.completedQueries[id];delete resource.pendingQueries[id];delete resource.changeHistories[id];delete resource.modified[id];delete resource.saved[id];resource.collection.splice(i,1);definition.handleChange(item);definition.afterEject(options,item);if(options.notify){definition.emit('DS.afterEject',definition,item);}return {v:item};})();if(typeof _ret === 'object')return _ret.v;}}},function(module,exports,__webpack_require__){exports['default'] = ejectAll;function ejectAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._o(params)){throw DSUtils._oErr('params');}definition.logFn('ejectAll',params,options);var resource=_this.s[resourceName];var queryHash=DSUtils.toJson(params);var items=definition.filter(params);var ids=[];if(DSUtils.isEmpty(params)){resource.completedQueries = {};}else {delete resource.completedQueries[queryHash];}DSUtils.forEach(items,function(item){if(item && item[definition.idAttribute]){ids.push(item[definition.idAttribute]);}});DSUtils.forEach(ids,function(id){definition.eject(id,options);});definition.handleChange(items);return items;}},function(module,exports,__webpack_require__){exports['default'] = filter;function filter(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];if(!definition){throw new _this.errors.NER(resourceName);}else if(params && !DSUtils._o(params)){throw DSUtils._oErr('params');}params = params || {};options = DSUtils._(definition,options);options.logFn('filter',params,options);return definition.defaultFilter.call(_this,_this.s[resourceName].collection,resourceName,params,options);}},function(module,exports,__webpack_require__){exports['default'] = inject;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);function makeObserverHandler(definition,resource){var DS=this;var name=definition.name;return function _react(added,removed,changed,oldValueFn,firstTime){var target=this;var item=undefined;var innerId=oldValueFn && oldValueFn(definition.idAttribute)?oldValueFn(definition.idAttribute):target[definition.idAttribute];_utils['default'].forEach(definition.relationFields,function(field){delete added[field];delete removed[field];delete changed[field];});if(!_utils['default'].isEmpty(added) || !_utils['default'].isEmpty(removed) || !_utils['default'].isEmpty(changed) || firstTime){item = DS.get(name,innerId);resource.modified[innerId] = _utils['default'].updateTimestamp(resource.modified[innerId]);if(item && definition.instanceEvents){setTimeout(function(){item.emit('DS.change',definition,item);},0);}definition.handleChange(item);if(definition.keepChangeHistory){var changeRecord={resourceName:name,target:item,added:added,removed:removed,changed:changed,timestamp:resource.modified[innerId]};resource.changeHistories[innerId].push(changeRecord);resource.changeHistory.push(changeRecord);}}if(definition.computed){item = item || DS.get(name,innerId);_utils['default'].forOwn(definition.computed,function(fn,field){var compute=false;_utils['default'].forEach(fn.deps,function(dep){if(dep in added || dep in removed || dep in changed || !(field in item)){compute = true;}});compute = compute || !fn.deps.length;if(compute){_utils['default'].compute.call(item,fn,field);}});}if(definition.idAttribute in changed){definition.errorFn('Doh! You just changed the primary key of an object! Your data for the "' + name + '" resource is now in an undefined (probably broken) state.');}};}function _inject(definition,resource,attrs,options){var _this=this;var injected=undefined;if(_utils['default']._a(attrs)){injected = [];for(var i=0;i < attrs.length;i++) {injected.push(_inject.call(_this,definition,resource,attrs[i],options));}}else {var _react=makeObserverHandler.call(_this,definition,resource);var c=definition.computed;var idA=definition.idAttribute;if(c && c[idA]){(function(){var args=[];_utils['default'].forEach(c[idA].deps,function(dep){args.push(attrs[dep]);});attrs[idA] = c[idA][c[idA].length - 1].apply(attrs,args);})();}if(!(idA in attrs)){var error=new _errors['default'].R(definition.name + '.inject: "attrs" must contain the property specified by "idAttribute"!');options.errorFn(error);throw error;}else {try{(function(){_utils['default'].forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=_this.defs[relationName];var toInject=attrs[def.localField];if(toInject){if(!relationDef){throw new _errors['default'].R(definition.name + ' relation is defined but the resource is not!');}if(_utils['default']._a(toInject)){(function(){var items=[];_utils['default'].forEach(toInject,function(toInjectItem){if(toInjectItem !== _this.s[relationName].index[toInjectItem[relationDef.idAttribute]]){try{var injectedItem=relationDef.inject(toInjectItem,options.orig());if(def.foreignKey){injectedItem[def.foreignKey] = attrs[definition.idAttribute];}items.push(injectedItem);}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}});})();}else {if(toInject !== _this.s[relationName].index[toInject[relationDef.idAttribute]]){try{var _injected=relationDef.inject(attrs[def.localField],options.orig());if(def.foreignKey){_injected[def.foreignKey] = attrs[definition.idAttribute];}}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}}}});var id=attrs[idA];var item=definition.get(id);var initialLastModified=item?resource.modified[id]:0;if(!item){if(attrs instanceof definition[definition['class']]){item = attrs;}else {item = new definition[definition['class']]();}_utils['default'].forEach(definition.relationList,function(def){delete attrs[def.localField];});_utils['default'].deepMixIn(item,attrs);resource.collection.push(item);resource.changeHistories[id] = [];if(_utils['default'].w){resource.observers[id] = new _this.observe.ObjectObserver(item);resource.observers[id].open(_react,item);}resource.index[id] = item;_react.call(item,{},{},{},null,true);resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);}else {if(options.onConflict === 'merge'){_utils['default'].deepMixIn(item,attrs);}else if(options.onConflict === 'replace'){_utils['default'].forOwn(item,function(v,k){if(k !== definition.idAttribute){if(!attrs.hasOwnProperty(k)){delete item[k];}}});_utils['default'].forOwn(attrs,function(v,k){if(k !== definition.idAttribute){item[k] = v;}});}if(definition.resetHistoryOnInject){resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);if(resource.changeHistories[id].length){_utils['default'].forEach(resource.changeHistories[id],function(changeRecord){_utils['default'].remove(resource.changeHistory,changeRecord);});resource.changeHistories[id].splice(0,resource.changeHistories[id].length);}}if(_utils['default'].w){resource.observers[id].deliver();}}resource.modified[id] = initialLastModified && resource.modified[id] === initialLastModified?_utils['default'].updateTimestamp(resource.modified[id]):resource.modified[id];resource.expiresHeap.remove(item);var timestamp=new Date().getTime();resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});injected = item;})();}catch(err) {options.errorFn(err,attrs);}}}return injected;}function inject(resourceName,attrs,options){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var injected=undefined;if(!definition){throw new _errors['default'].NER(resourceName);}else if(!_utils['default']._o(attrs) && !_utils['default']._a(attrs)){throw new _errors['default'].IA(resourceName + '.inject: "attrs" must be an object or an array!');}options = _utils['default']._(definition,options);options.logFn('inject',attrs,options);options.beforeInject(options,attrs);if(options.notify){definition.emit('DS.beforeInject',definition,attrs);}injected = _inject.call(_this,definition,resource,attrs,options);definition.handleChange(injected);options.afterInject(options,injected);if(options.notify){definition.emit('DS.afterInject',definition,injected);}return injected;}},function(module,exports,__webpack_require__){exports['default'] = create;function create(resourceName,attrs,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var adapter=undefined;options = options || {};attrs = attrs || {};var rejectionError=undefined;if(!definition){rejectionError = new _this.errors.NER(resourceName);}else if(!DSUtils._o(attrs)){rejectionError = DSUtils._oErr('attrs');}else {options = DSUtils._(definition,options);if(options.upsert && DSUtils._sn(attrs[definition.idAttribute])){return _this.update(resourceName,attrs[definition.idAttribute],attrs,options);}options.logFn('create',attrs,options);}return new DSUtils.Promise(function(resolve,reject){if(rejectionError){reject(rejectionError);}else {resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeCreate',definition,attrs);}adapter = _this.getAdapterName(options);return _this.adapters[adapter].create(definition,DSUtils.omit(attrs,options.omit),options);}).then(function(attrs){return options.afterCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.afterCreate',definition,attrs);}if(options.cacheResponse){var created=_this.inject(definition.name,attrs,options.orig());var id=created[definition.idAttribute];var resource=_this.s[resourceName];resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return created;}else {return _this.createInstance(resourceName,attrs,options);}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = destroy;function destroy(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var item=undefined;var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {item = definition.get(id) || {id:id};options = DSUtils._(definition,options);options.logFn('destroy',id,options);resolve(item);}}).then(function(attrs){return options.beforeDestroy.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeDestroy',definition,attrs);}if(options.eagerEject){definition.eject(id);}adapter = definition.getAdapter(options);return adapter.destroy(definition,id,options);}).then(function(){return options.afterDestroy.call(item,options,item);}).then(function(item){if(options.notify){definition.emit('DS.afterDestroy',definition,item);}definition.eject(id);return DSUtils.respond(id,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && item){definition.inject(item,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = destroyAll;function destroyAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var ejected=undefined,toEject=undefined,adapter=undefined;params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('attrs'));}else {options = DSUtils._(definition,options);options.logFn('destroyAll',params,options);resolve();}}).then(function(){toEject = definition.defaultFilter.call(_this,resourceName,params);return options.beforeDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.beforeDestroy',definition,toEject);}if(options.eagerEject){ejected = definition.ejectAll(params);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].destroyAll(definition,params,options);}).then(function(){return options.afterDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.afterDestroy',definition,toEject);}return ejected || definition.ejectAll(params);}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && ejected){definition.inject(ejected,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = find;function find(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('find',id,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[id];}if((!options.findStrictCache || id in resource.completedQueries) && definition.get(id) && !options.bypassCache){resolve(definition.get(id));}else {delete resource.completedQueries[id];resolve();}}}).then(function(item){if(!item){if(!(id in resource.pendingQueries)){var promise=undefined;var strategy=options.findStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].find(definition,id,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].find(definition,id,options);}resource.pendingQueries[id] = promise.then(function(data){delete resource.pendingQueries[id];if(options.cacheResponse){var injected=definition.inject(data,options.orig());resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return injected;}else {return definition.createInstance(data,options.orig());}});}return resource.pendingQueries[id];}else {return item;}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[id];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = findAll;function processResults(data,resourceName,queryHash,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var idAttribute=_this.defs[resourceName].idAttribute;var date=new Date().getTime();data = data || [];delete resource.pendingQueries[queryHash];resource.completedQueries[queryHash] = date;var injected=definition.inject(data,options.orig());if(DSUtils._a(injected)){DSUtils.forEach(injected,function(item){if(item){var id=item[idAttribute];if(id){resource.completedQueries[id] = date;resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);}}});}else {options.errorFn('response is expected to be an array!');resource.completedQueries[injected[idAttribute]] = date;}return injected;}function findAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var queryHash=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){params = params || {};if(!_this.defs[resourceName]){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);queryHash = DSUtils.toJson(params);options.logFn('findAll',params,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];}if(queryHash in resource.completedQueries){if(options.useFilter){resolve(definition.filter(params,options.orig()));}else {resolve(resource.queryData[queryHash]);}}else {resolve();}}}).then(function(items){if(!(queryHash in resource.completedQueries)){if(!(queryHash in resource.pendingQueries)){var promise=undefined;var strategy=options.findAllStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findAllFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].findAll(definition,params,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].findAll(definition,params,options);}resource.pendingQueries[queryHash] = promise.then(function(data){delete resource.pendingQueries[queryHash];if(options.cacheResponse){resource.queryData[queryHash] = processResults.call(_this,data,resourceName,queryHash,options);resource.queryData[queryHash].$$injected = true;return resource.queryData[queryHash];}else {DSUtils.forEach(data,function(item,i){data[i] = definition.createInstance(item,options.orig());});return data;}});}return resource.pendingQueries[queryHash];}else {return items;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[queryHash];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = loadRelations;function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}function loadRelations(resourceName,instance,relations,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];return new DSUtils.Promise(function(resolve,reject){if(DSUtils._sn(instance)){instance = definition.get(instance);}if(DSUtils._s(relations)){relations = [relations];}relations = relations || [];if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._o(instance)){reject(new DSErrors.IA('"instance(id)" must be a string, number or object!'));}else if(!DSUtils._a(relations)){reject(new DSErrors.IA('"relations" must be a string or an array!'));}else {(function(){var _options=DSUtils._(definition,options);_options.logFn('loadRelations',instance,relations,_options);var tasks=[];DSUtils.forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=definition.getResource(relationName);var __options=DSUtils._(relationDef,options);if(!relations.length || DSUtils.contains(relations,relationName) || DSUtils.contains(relations,def.localField)){var task=undefined;var params={};if(__options.allowSimpleWhere){params[def.foreignKey] = instance[definition.idAttribute];}else {params.where = {};params.where[def.foreignKey] = {'==':instance[definition.idAttribute]};}if(def.type === 'hasMany'){if(def.localKeys){delete params[def.foreignKey];params.where = _defineProperty({},relationDef.idAttribute,{'in':instance[def.localKeys]});}task = relationDef.findAll(params,__options.orig());}else if(def.type === 'hasOne'){if(def.localKey && instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}else if(def.foreignKey){task = relationDef.findAll(params,__options.orig()).then(function(hasOnes){return hasOnes.length?hasOnes[0]:null;});}}else if(instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}if(task){tasks.push(task);}}});resolve(tasks);})();}}).then(function(tasks){return DSUtils.Promise.all(tasks);}).then(function(){return instance;});}},function(module,exports,__webpack_require__){exports['default'] = reap;function reap(resourceName,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else {options = DSUtils._(definition,options);if(!options.hasOwnProperty('notify')){options.notify = false;}options.logFn('reap',options);var items=[];var now=new Date().getTime();var expiredItem=undefined;while((expiredItem = resource.expiresHeap.peek()) && expiredItem.expires < now) {items.push(expiredItem.item);delete expiredItem.item;resource.expiresHeap.pop();}resolve(items);}}).then(function(items){if(items.length){definition.beforeReap(options,items);if(options.notify){definition.emit('DS.beforeReap',definition,items);}}if(options.reapAction === 'inject'){(function(){var timestamp=new Date().getTime();DSUtils.forEach(items,function(item){resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});});})();}else if(options.reapAction === 'eject'){DSUtils.forEach(items,function(item){definition.eject(item[definition.idAttribute]);});}else if(options.reapAction === 'refresh'){var _ret2=(function(){var tasks=[];DSUtils.forEach(items,function(item){tasks.push(definition.refresh(item[definition.idAttribute]));});return {v:DSUtils.Promise.all(tasks)};})();if(typeof _ret2 === 'object')return _ret2.v;}return items;}).then(function(items){if(items.length){definition.afterReap(options,items);if(options.notify){definition.emit('DS.afterReap',definition,items);}}return items;});}},function(module,exports,__webpack_require__){exports['default'] = save;function save(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined,noChanges=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else if(!definition.get(id)){reject(new DSErrors.R('id "' + id + '" not found in cache!'));}else {item = definition.get(id);options = DSUtils._(definition,options);options.logFn('save',id,options);resolve(item);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}if(options.changesOnly){if(DSUtils.w){resource.observers[id].deliver();}var toKeep=[];var changes=definition.changes(id);for(var key in changes.added) {toKeep.push(key);}for(key in changes.changed) {toKeep.push(key);}changes = DSUtils.pick(attrs,toKeep);if(DSUtils.isEmpty(changes)){options.logFn('save - no changes',id,options);noChanges = true;return attrs;}else {attrs = changes;}}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(noChanges){return attrs;}else if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = update;function update(resourceName,id,attrs,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('update',id,attrs,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var resource=_this.s[resourceName];var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = updateAll;function updateAll(resourceName,attrs,params,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new DSErrors.NER(resourceName));}else {options = DSUtils._(definition,options);options.logFn('updateAll',attrs,params,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].updateAll(definition,DSUtils.omit(attrs,options.omit),params,options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(data){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}var origOptions=options.orig();if(options.cacheResponse){var _ret=(function(){var injected=definition.inject(data,origOptions);var resource=_this.s[resourceName];DSUtils.forEach(injected,function(i){var id=i[definition.idAttribute];resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[id] = DSUtils.copy(i,null,null,null,definition.relationFields);}});return {v:injected};})();if(typeof _ret === 'object')return _ret.v;}else {var _ret2=(function(){var instances=[];DSUtils.forEach(data,function(item){instances.push(definition.createInstance(item,origOptions));});return {v:instances};})();if(typeof _ret2 === 'object')return _ret2.v;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function replaceAccents(str){str = toString(str);if(str.search(/[\xC0-\xFF]/g) > -1){str = str.replace(/[\xC0-\xC5]/g,'A').replace(/[\xC6]/g,'AE').replace(/[\xC7]/g,'C').replace(/[\xC8-\xCB]/g,'E').replace(/[\xCC-\xCF]/g,'I').replace(/[\xD0]/g,'D').replace(/[\xD1]/g,'N').replace(/[\xD2-\xD6\xD8]/g,'O').replace(/[\xD9-\xDC]/g,'U').replace(/[\xDD]/g,'Y').replace(/[\xDE]/g,'P').replace(/[\xE0-\xE5]/g,'a').replace(/[\xE6]/g,'ae').replace(/[\xE7]/g,'c').replace(/[\xE8-\xEB]/g,'e').replace(/[\xEC-\xEF]/g,'i').replace(/[\xF1]/g,'n').replace(/[\xF2-\xF6\xF8]/g,'o').replace(/[\xF9-\xFC]/g,'u').replace(/[\xFE]/g,'p').replace(/[\xFD\xFF]/g,'y');}return str;}module.exports = replaceAccents;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var PATTERN=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;function removeNonWord(str){str = toString(str);return str.replace(PATTERN,'');}module.exports = removeNonWord;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function lowerCase(str){str = toString(str);return str.toLowerCase();}module.exports = lowerCase;}]));}); - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/build_examples/webpack_es6_2/bundle.js b/build_examples/webpack_es6_2/bundle.js deleted file mode 100644 index 4198430..0000000 --- a/build_examples/webpack_es6_2/bundle.js +++ /dev/null @@ -1,804 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(2); - - __webpack_require__(1); - - angular.module('app', ['js-data']).run(function (DS, DSVersion, $rootScope) { - $rootScope.test = 'It works! Using js-data ' + DSVersion.full; - }); - -/***/ }, -/* 1 */ -/***/ function(module, exports, __webpack_require__) { - - /*! - * js-data-angular - * @version 3.0.0-rc.1 - Homepage - * @author Jason Dobry - * @copyright (c) 2014-2015 Jason Dobry - * @license MIT - * - * @overview Angular wrapper for js-data. - */ - (function webpackUniversalModuleDefinition(root, factory) { - if (true) module.exports = factory(__webpack_require__(5), __webpack_require__(2), (function webpackLoadOptionalExternalModule() { - try { - return __webpack_require__(3); - } catch (e) {} - })());else if (typeof define === 'function' && define.amd) define(['js-data', 'angular'], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) { - return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root['axios']); - });else if (typeof exports === 'object') exports['jsDataAngularModuleName'] = factory(require('js-data'), require('angular'), (function webpackLoadOptionalExternalModule() { - try { - return require('axios'); - } catch (e) {} - })());else root['jsDataAngularModuleName'] = factory(root['JSData'], root['angular'], root['axios']); - })(this, function (__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) { - return ( /******/(function (modules) { - // webpackBootstrap - /******/ // The module cache - /******/var installedModules = {}; - - /******/ // The require function - /******/function __webpack_require__(moduleId) { - - /******/ // Check if module is in cache - /******/if (installedModules[moduleId]) - /******/return installedModules[moduleId].exports; - - /******/ // Create a new module (and put it into the cache) - /******/var module = installedModules[moduleId] = { - /******/exports: {}, - /******/id: moduleId, - /******/loaded: false - /******/ }; - - /******/ // Execute the module function - /******/modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - - /******/ // Flag the module as loaded - /******/module.loaded = true; - - /******/ // Return the exports of the module - /******/return module.exports; - /******/ - } - - /******/ // expose the modules object (__webpack_modules__) - /******/__webpack_require__.m = modules; - - /******/ // expose the module cache - /******/__webpack_require__.c = installedModules; - - /******/ // __webpack_public_path__ - /******/__webpack_require__.p = ''; - - /******/ // Load entry module and return exports - /******/return __webpack_require__(0); - /******/ - })([ - /* 0 */ - /***/function (module, exports, __webpack_require__) { - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - - /*jshint loopfunc:true*/ - var JSData = __webpack_require__(1); - var DSHttpAdapter = __webpack_require__(4); - var angular = __webpack_require__(2); - - var DSUtils = JSData.DSUtils; - var DSErrors = JSData.DSErrors; - var isString = DSUtils.isString; - var isNumber = DSUtils.isNumber; - var isObject = DSUtils.isObject; - var set = DSUtils.set; - var resolveId = DSUtils.resolveId; - - var adapters = [{ - project: 'js-data-localstorage', - name: 'localstorage', - 'class': 'DSLocalStorageAdapter' - }, { - project: 'js-data-localforage', - name: 'localforage', - 'class': 'DSLocalForageAdapter' - }, { - project: 'js-data-firebase', - name: 'firebase', - 'class': 'DSFirebaseAdapter' - }, { - project: 'js-data-sql', - name: 'sql', - 'class': 'DSSqlAdapter' - }]; - - var functionsToWrap = ['compute', 'digest', 'eject', 'inject']; - - function registerAdapter(adapter) { - var Adapter = undefined; - - try { - Adapter = __webpack_require__(3)(adapter.project); - } catch (e) {} - - if (!Adapter) { - Adapter = window[adapter['class']]; - } - - if (Adapter) { - adapter.loaded = true; - angular.module('js-data').provider(adapter['class'], function () { - var _this = this; - _this.defaults = {}; - _this.$get = [function () { - return new Adapter(_this.defaults); - }]; - }); - } - } - - var DSHttpAdapterProvider = function DSHttpAdapterProvider() { - _classCallCheck(this, DSHttpAdapterProvider); - - var defaults = {}; - this.defaults = defaults; - - this.$get = ['$http', 'DS', function ($http, DS) { - defaults.http = defaults.http || $http; - var adapter = new DSHttpAdapter(defaults); - DS.registerAdapter('http', adapter, { 'default': true }); - return adapter; - }]; - }; - - var DSProvider = function DSProvider() { - _classCallCheck(this, DSProvider); - - var _this = this; - var deps = []; - - for (var i = 0; i < adapters.length; i++) { - if (adapters[i].loaded) { - deps.push(adapters[i]['class']); - } - } - - _this.defaults = {}; - - JSData.DS.prototype.bindAll = function (resourceName, params, scope, expr, cb) { - var _this = this; - - params = params || {}; - - if (!_this.definitions[resourceName]) { - throw new DSErrors.NER(resourceName); - } else if (!isObject(params)) { - throw new DSErrors.IA('"params" must be an object!'); - } else if (!isObject(scope)) { - throw new DSErrors.IA('"scope" must be an object!'); - } else if (!isString(expr)) { - throw new DSErrors.IA('"expr" must be a string!'); - } - - try { - return scope.$watch(function () { - return _this.lastModified(resourceName); - }, function () { - var items = _this.filter(resourceName, params); - set(scope, expr, items); - if (cb) { - cb(null, items); - } - }); - } catch (err) { - if (cb) { - cb(err); - } else { - throw err; - } - } - }; - - JSData.DS.prototype.bindOne = function (resourceName, id, scope, expr, cb) { - var _this = this; - - id = resolveId(_this.definitions[resourceName], id); - if (!_this.definitions[resourceName]) { - throw new DSErrors.NER(resourceName); - } else if (!isString(id) && !isNumber(id)) { - throw new DSErrors.IA('"id" must be a string or a number!'); - } else if (!isObject(scope)) { - throw new DSErrors.IA('"scope" must be an object!'); - } else if (!isString(expr)) { - throw new DSErrors.IA('"expr" must be a string!'); - } - - try { - return scope.$watch(function () { - return _this.lastModified(resourceName, id); - }, function () { - var item = _this.get(resourceName, id); - if (item) { - _this.compute(resourceName, id); - } - set(scope, expr, item); - if (cb) { - cb(null, item); - } - }); - } catch (err) { - if (cb) { - cb(err); - } else { - throw err; - } - } - }; - - function load() { - for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; - } - - var $rootScope = args[args.length - 2]; - var $q = args[args.length - 1]; - var store = new JSData.DS(_this.defaults); - var originals = {}; - - function QPromise(executor) { - var deferred = $q.defer(); - - try { - executor.call(undefined, angular.bind(deferred, deferred.resolve), angular.bind(deferred, deferred.reject)); - } catch (err) { - deferred.reject(err); - } - - return deferred.promise; - } - - QPromise.all = $q.all; - QPromise.when = $q.when; - QPromise.reject = $q.reject; - - DSUtils.Promise = QPromise; - - // Register any adapters that have been loaded - if (args.length) { - for (var i = 0; i < args.length; i++) { - for (var j = 0; j < adapters.length; j++) { - if (adapters[j].loaded && !adapters[j].registered) { - adapters[j].registered = true; - store.registerAdapter(adapters[j].name, args[i]); - break; - } - } - } - } - - var _loop = function _loop() { - var name = functionsToWrap[k]; - originals[name] = store[name]; - store[name] = function () { - for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { - args[_key2] = arguments[_key2]; - } - - if (!$rootScope.$$phase) { - return $rootScope.$apply(function () { - return originals[name].apply(store, args); - }); - } - return originals[name].apply(store, args); - }; - }; - - // Wrap certain sync functions with $apply - for (var k = 0; k < functionsToWrap.length; k++) { - _loop(); - } - - // Hook into the digest loop - if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') { - $rootScope.$watch(function () { - return store.observe.Platform.performMicrotaskCheckpoint(); - }); - } - - return store; - } - - deps.push('$rootScope'); - deps.push('$q'); - deps.push(load); - - _this.$get = deps; - }; - - angular.module('js-data', ['ng']).value('DSUtils', DSUtils).value('DSErrors', DSErrors).value('DSVersion', JSData.version).provider('DS', DSProvider).provider('DSHttpAdapter', DSHttpAdapterProvider).run(['DS', 'DSHttpAdapter', function (DS, DSHttpAdapter) { - DS.registerAdapter('http', DSHttpAdapter, { 'default': true }); - }]); - - for (var i = 0; i < adapters.length; i++) { - registerAdapter(adapters[i]); - } - - // return the module name - module.exports = 'js-data'; - module.exports.name = 'js-data'; - - /***/ - }, - /* 1 */ - /***/function (module, exports, __webpack_require__) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_1__; - - /***/ - }, - /* 2 */ - /***/function (module, exports, __webpack_require__) { - - module.exports = __WEBPACK_EXTERNAL_MODULE_2__; - - /***/ - }, - /* 3 */ - /***/function (module, exports, __webpack_require__) { - - var map = {}; - function webpackContext(req) { - return __webpack_require__(webpackContextResolve(req)); - }; - function webpackContextResolve(req) { - return map[req] || (function () { - throw new Error('Cannot find module \'' + req + '\'.'); - })(); - }; - webpackContext.keys = function webpackContextKeys() { - return Object.keys(map); - }; - webpackContext.resolve = webpackContextResolve; - module.exports = webpackContext; - webpackContext.id = 3; - - /***/ - }, - /* 4 */ - /***/function (module, exports, __webpack_require__) { - - var _createClass = (function () { - function defineProperties(target, props) { - for (var i = 0; i < props.length; i++) { - var descriptor = props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if ('value' in descriptor) descriptor.writable = true;Object.defineProperty(target, descriptor.key, descriptor); - } - }return function (Constructor, protoProps, staticProps) { - if (protoProps) defineProperties(Constructor.prototype, protoProps);if (staticProps) defineProperties(Constructor, staticProps);return Constructor; - }; - })(); - - function _classCallCheck(instance, Constructor) { - if (!(instance instanceof Constructor)) { - throw new TypeError('Cannot call a class as a function'); - } - } - - var JSData = __webpack_require__(1); - var axios = null; - - try { - axios = __webpack_require__(5); - } catch (e) {} - - var DSUtils = JSData.DSUtils; - var deepMixIn = DSUtils.deepMixIn; - var removeCircular = DSUtils.removeCircular; - var copy = DSUtils.copy; - var makePath = DSUtils.makePath; - var isString = DSUtils.isString; - var isNumber = DSUtils.isNumber; - - var Defaults = (function () { - function Defaults() { - _classCallCheck(this, Defaults); - } - - _createClass(Defaults, [{ - key: 'queryTransform', - value: function queryTransform(resourceConfig, params) { - return params; - } - }, { - key: 'deserialize', - value: function deserialize(resourceConfig, data) { - return data ? 'data' in data ? data.data : data : data; - } - }, { - key: 'serialize', - value: function serialize(resourceConfig, data) { - return data; - } - }, { - key: 'log', - value: function log() {} - }, { - key: 'error', - value: function error() {} - }]); - - return Defaults; - })(); - - var defaultsPrototype = Defaults.prototype; - - defaultsPrototype.basePath = ''; - - defaultsPrototype.forceTrailingSlash = ''; - - defaultsPrototype.httpConfig = {}; - - var DSHttpAdapter = (function () { - function DSHttpAdapter(options) { - _classCallCheck(this, DSHttpAdapter); - - this.defaults = new Defaults(); - if (console) { - this.defaults.log = function (a, b) { - return console[typeof console.info === 'function' ? 'info' : 'log'](a, b); - }; - } - if (console) { - this.defaults.error = function (a, b) { - return console[typeof console.error === 'function' ? 'error' : 'log'](a, b); - }; - } - deepMixIn(this.defaults, options); - this.http = options.http || axios; - } - - _createClass(DSHttpAdapter, [{ - key: 'getEndpoint', - value: function getEndpoint(resourceConfig, id, options) { - var _this2 = this; - - options = options || {}; - options.params = options.params || {}; - - var item = undefined; - var parentKey = resourceConfig.parentKey; - var endpoint = options.hasOwnProperty('endpoint') ? options.endpoint : resourceConfig.endpoint; - var parentField = resourceConfig.parentField; - var parentDef = resourceConfig.getResource(resourceConfig.parent); - var parentId = options.params[parentKey]; - - if (parentId === false || !parentKey || !parentDef) { - if (parentId === false) { - delete options.params[parentKey]; - } - return endpoint; - } else { - delete options.params[parentKey]; - - if (DSUtils._sn(id)) { - item = resourceConfig.get(id); - } else if (DSUtils._o(id)) { - item = id; - } - - if (item) { - parentId = parentId || item[parentKey] || (item[parentField] ? item[parentField][parentDef.idAttribute] : null); - } - - if (parentId) { - var _ret = (function () { - delete options.endpoint; - var _options = {}; - DSUtils.forOwn(options, function (value, key) { - _options[key] = value; - }); - return { - v: DSUtils.makePath(_this2.getEndpoint(parentDef, parentId, DSUtils._(parentDef, _options)), parentId, endpoint) - }; - })(); - - if (typeof _ret === 'object') return _ret.v; - } else { - return endpoint; - } - } - } - }, { - key: 'getPath', - value: function getPath(method, resourceConfig, id, options) { - var _this = this; - options = options || {}; - var args = [options.basePath || _this.defaults.basePath || resourceConfig.basePath, this.getEndpoint(resourceConfig, isString(id) || isNumber(id) || method === 'create' ? id : null, options)]; - if (method === 'find' || method === 'update' || method === 'destroy') { - args.push(id); - } - return makePath.apply(DSUtils, args); - } - }, { - key: 'HTTP', - value: function HTTP(config) { - var _this = this; - var start = new Date(); - config = copy(config); - config = deepMixIn(config, _this.defaults.httpConfig); - if (_this.defaults.forceTrailingSlash && config.url[config.url.length - 1] !== '/') { - config.url += '/'; - } - if (typeof config.data === 'object') { - config.data = removeCircular(config.data); - } - config.method = config.method.toUpperCase(); - var suffix = config.suffix || _this.defaults.suffix; - if (suffix && config.url.substr(config.url.length - suffix.length) !== suffix) { - config.url += suffix; - } - - function logResponse(data) { - var str = start.toUTCString() + ' - ' + data.config.method.toUpperCase() + ' ' + data.config.url + ' - ' + data.status + ' ' + (new Date().getTime() - start.getTime()) + 'ms'; - if (data.status >= 200 && data.status < 300) { - if (_this.defaults.log) { - _this.defaults.log(str, data); - } - return data; - } else { - if (_this.defaults.error) { - _this.defaults.error('\'FAILED: ' + str, data); - } - return DSUtils.Promise.reject(data); - } - } - - if (!this.http) { - throw new Error('You have not configured this adapter with an http library!'); - } - - return this.http(config).then(logResponse, logResponse); - } - }, { - key: 'GET', - value: function GET(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'get'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'POST', - value: function POST(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'post'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs - })); - } - }, { - key: 'PUT', - value: function PUT(url, attrs, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'put'; - } - return this.HTTP(deepMixIn(config, { - url: url, - data: attrs || {} - })); - } - }, { - key: 'DEL', - value: function DEL(url, config) { - config = config || {}; - if (!('method' in config)) { - config.method = 'delete'; - } - return this.HTTP(deepMixIn(config, { - url: url - })); - } - }, { - key: 'find', - value: function find(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.GET(_this.getPath('find', resourceConfig, id, options), options).then(function (data) { - var item = (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - return !item ? DSUtils.Promise.reject(new Error('Not Found!')) : item; - }); - } - }, { - key: 'findAll', - value: function findAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return _this.GET(_this.getPath('findAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'create', - value: function create(resourceConfig, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.POST(_this.getPath('create', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'update', - value: function update(resourceConfig, id, attrs, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.PUT(_this.getPath('update', resourceConfig, id, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'updateAll', - value: function updateAll(resourceConfig, attrs, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.PUT(_this.getPath('updateAll', resourceConfig, attrs, options), options.serialize ? options.serialize(resourceConfig, attrs) : _this.defaults.serialize(resourceConfig, attrs), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroy', - value: function destroy(resourceConfig, id, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - options.params = _this.defaults.queryTransform(resourceConfig, options.params); - return _this.DEL(_this.getPath('destroy', resourceConfig, id, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }, { - key: 'destroyAll', - value: function destroyAll(resourceConfig, params, options) { - var _this = this; - options = options ? copy(options) : {}; - options.suffix = options.suffix || resourceConfig.suffix; - options.params = options.params || {}; - if (params) { - params = _this.defaults.queryTransform(resourceConfig, params); - deepMixIn(options.params, params); - } - return this.DEL(_this.getPath('destroyAll', resourceConfig, params, options), options).then(function (data) { - return (options.deserialize ? options.deserialize : _this.defaults.deserialize)(resourceConfig, data); - }); - } - }]); - - return DSHttpAdapter; - })(); - - module.exports = DSHttpAdapter; - - /***/ - }, - /* 5 */ - /***/function (module, exports, __webpack_require__) { - - if (typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') { - var e = new Error('Cannot find module "axios"');e.code = 'MODULE_NOT_FOUND';throw e; - } - module.exports = __WEBPACK_EXTERNAL_MODULE_5__; - - /***/ - } - /******/]) - ); - }); - ; - - /************************************************************************/ - /******/ - -/***/ }, -/* 2 */ -/***/ function(module, exports, __webpack_require__) { - - __webpack_require__(4); - module.exports = angular; - -/***/ }, -/* 3 */ -/***/ function(module, exports, __webpack_require__) { - - if(typeof axios === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;} - module.exports = axios; - -/***/ }, -/* 4 */ -/***/ function(module, exports, __webpack_require__) { - - var require;(function(window,document,undefined){'use strict';function minErr(module,ErrorConstructor){ErrorConstructor = ErrorConstructor || Error;return function(){var code=arguments[0],prefix='[' + (module?module + ':':'') + code + '] ',template=arguments[1],templateArgs=arguments,message,i;message = prefix + template.replace(/\{\d+\}/g,function(match){var index=+match.slice(1,-1),arg;if(index + 2 < templateArgs.length){return toDebugString(templateArgs[index + 2]);}return match;});message = message + '\nhttp://errors.angularjs.org/1.3.15/' + (module?module + '/':'') + code;for(i = 2;i < arguments.length;i++) {message = message + (i == 2?'?':'&') + 'p' + (i - 2) + '=' + encodeURIComponent(toDebugString(arguments[i]));}return new ErrorConstructor(message);};}var REGEX_STRING_REGEXP=/^\/(.+)\/([a-z]*)$/;var VALIDITY_STATE_PROPERTY='validity';var lowercase=function lowercase(string){return isString(string)?string.toLowerCase():string;};var hasOwnProperty=Object.prototype.hasOwnProperty;var uppercase=function uppercase(string){return isString(string)?string.toUpperCase():string;};var manualLowercase=function manualLowercase(s){return isString(s)?s.replace(/[A-Z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) | 32);}):s;};var manualUppercase=function manualUppercase(s){return isString(s)?s.replace(/[a-z]/g,function(ch){return String.fromCharCode(ch.charCodeAt(0) & ~32);}):s;};if('i' !== 'I'.toLowerCase()){lowercase = manualLowercase;uppercase = manualUppercase;}var msie,jqLite,jQuery,slice=[].slice,splice=[].splice,push=[].push,toString=Object.prototype.toString,ngMinErr=minErr('ng'),angular=window.angular || (window.angular = {}),angularModule,uid=0;msie = document.documentMode;function isArrayLike(obj){if(obj == null || isWindow(obj)){return false;}var length=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;}function forEach(obj,iterator,context){var key,length;if(obj){if(isFunction(obj)){for(key in obj) {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 {for(key in obj) {if(obj.hasOwnProperty(key)){iterator.call(context,obj[key],key,obj);}}}}return obj;}function sortedKeys(obj){return Object.keys(obj).sort();}function forEachSorted(obj,iterator,context){var keys=sortedKeys(obj);for(var i=0;i < keys.length;i++) {iterator.call(context,obj[keys[i]],keys[i]);}return keys;}function reverseParams(iteratorFn){return function(value,key){iteratorFn(key,value);};}function nextUid(){return ++uid;}function setHashKey(obj,h){if(h){obj.$$hashKey = h;}else {delete obj.$$hashKey;}}function extend(dst){var h=dst.$$hashKey;for(var i=1,ii=arguments.length;i < ii;i++) {var obj=arguments[i];if(obj){var keys=Object.keys(obj);for(var j=0,jj=keys.length;j < jj;j++) {var key=keys[j];dst[key] = obj[key];}}}setHashKey(dst,h);return dst;}function int(str){return parseInt(str,10);}function inherit(parent,extra){return extend(Object.create(parent),extra);}function noop(){}noop.$inject = [];function identity($){return $;}identity.$inject = [];function valueFn(value){return function(){return value;};}function isUndefined(value){return typeof value === 'undefined';}function isDefined(value){return typeof value !== 'undefined';}function isObject(value){return value !== null && typeof value === 'object';}function isString(value){return typeof value === 'string';}function isNumber(value){return typeof value === 'number';}function isDate(value){return toString.call(value) === '[object Date]';}var isArray=Array.isArray;function isFunction(value){return typeof value === 'function';}function isRegExp(value){return toString.call(value) === '[object RegExp]';}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 trim=function trim(value){return isString(value)?value.trim():value;};var escapeForRegexp=function escapeForRegexp(s){return s.replace(/([-()\[\]{}+?*.$\^|,:#= 0)array.splice(index,1);return value;}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(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest);}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(isObject(source)){var emptyObject=Object.create(Object.getPrototypeOf(source));destination = copy(source,emptyObject,stackSource,stackDest);}}}else {if(source === destination)throw ngMinErr('cpi','Can\'t copy! Source and destination are identical.');stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1)return stackDest[index];stackSource.push(source);stackDest.push(destination);}var result;if(isArray(source)){destination.length = 0;for(var i=0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {var h=destination.$$hashKey;if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){result = copy(source[key],null,stackSource,stackDest);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}setHashKey(destination,h);}}return destination;}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;}function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2)return true;if(o1 === null || o2 === null)return false;if(o1 !== o1 && o2 !== o2)return true;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;_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}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 = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key]))return false;}return true;}}}return false;}}var csp=function csp(){if(isDefined(csp.isActive_))return csp.isActive_;var active=!!(document.querySelector('[ng-csp]') || document.querySelector('[data-ng-csp]'));if(!active){try{new Function('');}catch(e) {active = true;}}return csp.isActive_ = active;};function concat(array1,array2,index){return array1.concat(slice.call(array2,index));}function sliceArgs(args,startIndex){return slice.call(args,startIndex || 0);}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 {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;}function toJson(obj,pretty){if(typeof obj === 'undefined')return undefined;if(!isNumber(pretty)){pretty = pretty?2:null;}return JSON.stringify(obj,toJsonReplacer,pretty);}function fromJson(json){return isString(json)?JSON.parse(json):json;}function startingTag(element){element = jqLite(element).clone();try{element.empty();}catch(e) {}var elemHtml=jqLite('
').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);}}function tryDecodeURIComponent(value){try{return decodeURIComponent(value);}catch(e) {}}function parseKeyValue(keyValue){var obj={},key_value,key;forEach((keyValue || '').split('&'),function(keyValue){if(keyValue){key_value = keyValue.replace(/\+/g,'%20').split('=');key = tryDecodeURIComponent(key_value[0]);if(isDefined(key)){var val=isDefined(key_value[1])?tryDecodeURIComponent(key_value[1]):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('&'):'';}function encodeUriSegment(val){return encodeUriQuery(val,true).replace(/%26/gi,'&').replace(/%3D/gi,'=').replace(/%2B/gi,'+');}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;element = jqLite(element);for(i = 0;i < ii;++i) {attr = ngAttrPrefixes[i] + ngAttr;if(isString(attr = element.attr(attr))){return attr;}}return null;}function angularInit(element,bootstrap){var appElement,module,config={};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);}}function bootstrap(element,modules,config){if(!isObject(config))config = {};var defaultConfig={strictDi:false};config = extend(defaultConfig,config);var doBootstrap=function doBootstrap(){element = jqLite(element);if(element.injector()){var tag=element[0] === document?'document':startingTag(element);throw ngMinErr('btstrpd','App Already Bootstrapped with this Element \'{0}\'',tag.replace(//,'>'));}modules = modules || [];modules.unshift(['$provide',function($provide){$provide.value('$rootElement',element);}]);if(config.debugInfoEnabled){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();}}function reloadWithDebugInfo(){window.name = 'NG_ENABLE_DEBUG_INFO!' + window.name;window.location.reload();}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;}jQuery = window.jQuery;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});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;bindJQueryFired = true;}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;}function assertNotHasOwnProperty(name,context){if(name === 'hasOwnProperty'){throw ngMinErr('badname','hasOwnProperty is not a valid {0} name',context);}}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;}function getBlockNodes(nodes){var node=nodes[0];var endNode=nodes[nodes.length - 1];var blockNodes=[node];do {node = node.nextSibling;if(!node)break;blockNodes.push(node);}while(node !== endNode);return jqLite(blockNodes);}function createMap(){return Object.create(null);}var NODE_TYPE_ELEMENT=1;var NODE_TYPE_TEXT=3;var NODE_TYPE_COMMENT=8;var NODE_TYPE_DOCUMENT=9;var NODE_TYPE_DOCUMENT_FRAGMENT=11;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);angular.$$minErr = angular.$$minErr || minErr;return ensure(angular,'module',function(){var modules={};return function module(name,requires,configFn){var assertNotHasOwnProperty=function assertNotHasOwnProperty(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);}var invokeQueue=[];var configBlocks=[];var runBlocks=[];var config=invokeLater('$injector','invoke','push',configBlocks);var moduleInstance={_invokeQueue:invokeQueue,_configBlocks:configBlocks,_runBlocks:runBlocks,requires:requires,name:name,provider:invokeLater('$provide','provider'),factory:invokeLater('$provide','factory'),service:invokeLater('$provide','service'),value:invokeLater('$provide','value'),constant:invokeLater('$provide','constant','unshift'),animation:invokeLater('$animateProvider','register'),filter:invokeLater('$filterProvider','register'),controller:invokeLater('$controllerProvider','register'),directive:invokeLater('$compileProvider','directive'),config:config,run:function run(block){runBlocks.push(block);return this;}};if(configFn){config(configFn);}return moduleInstance;function invokeLater(provider,method,insertMethod,queue){if(!queue)queue = invokeQueue;return function(){queue[insertMethod || 'push']([provider,method,arguments]);return moduleInstance;};}});};});}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(typeof obj === 'undefined'){return 'undefined';}else if(typeof obj !== 'string'){return serializeObject(obj);}return obj;}var version={full:'1.3.15',major:1,minor:3,dot:15,codeName:'locality-filtration'};function publishExternalAPI(angular){extend(angular,{'bootstrap':bootstrap,'copy':copy,'extend':extend,'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);try{angularModule('ngLocale');}catch(e) {angularModule('ngLocale',[]).provider('$locale',$LocaleProvider);}angularModule('ng',['ngLocale'],['$provide',function ngModule($provide){$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,$browser:$BrowserProvider,$cacheFactory:$CacheFactoryProvider,$controller:$ControllerProvider,$document:$DocumentProvider,$exceptionHandler:$ExceptionHandlerProvider,$filter:$FilterProvider,$interpolate:$InterpolateProvider,$interval:$IntervalProvider,$http:$HttpProvider,$httpBackend:$HttpBackendProvider,$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,$$asyncCallback:$$AsyncCallbackProvider,$$jqLite:$$jqLiteProvider});}]);}JQLite.expando = 'ng339';var jqCache=JQLite.cache = {},jqId=1,addEventListenerFn=function addEventListenerFn(element,type,fn){element.addEventListener(type,fn,false);},removeEventListenerFn=function removeEventListenerFn(element,type,fn){element.removeEventListener(type,fn,false);};JQLite._data = function(node){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');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,''],'thead':[1,'','
'],'col':[2,'','
'],'tr':[2,'','
'],'td':[3,'','
'],'_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){var nodeType=node.nodeType;return nodeType === NODE_TYPE_ELEMENT || !nodeType || nodeType === NODE_TYPE_DOCUMENT;}function jqLiteBuildFragment(html,context){var tmp,tag,wrap,fragment=context.createDocumentFragment(),nodes=[],i;if(jqLiteIsTextNode(html)){nodes.push(context.createTextNode(html));}else {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>') + wrap[2];i = wrap[0];while(i--) {tmp = tmp.lastChild;}nodes = concat(nodes,tmp.childNodes);tmp = fragment.firstChild;tmp.textContent = '';}fragment.textContent = '';fragment.innerHTML = '';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;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;}}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;}else {if(massGetter){return data;}else {if(isSimpleGetter){return data && data[key];}else {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){if(elements){if(elements.nodeType){root[root.length++] = elements;}else {var length=elements.length;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.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((value = jqLite.data(element,names[i])) !== undefined)return value;}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'){win.setTimeout(action);}else {jqLite(win).on('load',action);}}var JQLitePrototype=JQLite.prototype = {ready:function ready(fn){var fired=false;function trigger(){if(fired)return;fired = true;fn();}if(document.readyState === 'complete'){setTimeout(trigger);}else {this.on('DOMContentLoaded',trigger);JQLite(window).on('load',trigger);}},toString:function toString(){var value=[];forEach(this,function(e){value.push('' + e);});return '[' + value.join(', ') + ']';},eq:function eq(index){return index >= 0?jqLite(this[index]):jqLite(this[this.length + index]);},length:0,push:push,sort:[].sort,splice:[].splice};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){var booleanAttr=BOOLEAN_ATTR[name.toLowerCase()];return booleanAttr && BOOLEAN_ELEMENTS[nodeName_(element)] && booleanAttr;}function getAliasedAttrName(element,name){var nodeName=element.nodeName;return (nodeName === 'INPUT' || nodeName === 'TEXTAREA') && ALIASED_ATTR[name];}forEach({data:jqLiteData,removeData:jqLiteRemoveData},function(fn,name){JQLite[name] = fn;});forEach({data:jqLiteData,inheritedData:jqLiteInheritedData,scope:function scope(element){return jqLite.data(element,'$scope') || jqLiteInheritedData(element.parentNode || element,['$isolateScope','$scope']);},isolateScope:function isolateScope(element){return jqLite.data(element,'$isolateScope') || jqLite.data(element,'$isolateScopeNoTemplate');},controller:jqLiteController,injector:function injector(element){return jqLiteInheritedData(element,'$injector');},removeAttr:function removeAttr(element,name){element.removeAttribute(name);},hasClass:jqLiteHasClass,css:function css(element,name,value){name = camelCase(name);if(isDefined(value)){element.style[name] = value;}else {return element.style[name];}},attr:function attr(element,name,value){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){var ret=element.getAttribute(name,2);return ret === null?undefined:ret;}},prop:function prop(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 val(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 html(element,value){if(isUndefined(value)){return element.innerHTML;}jqLiteDealoc(element,true);element.innerHTML = value;},empty:jqLiteEmpty},function(fn,name){JQLite.prototype[name] = function(arg1,arg2){var i,key;var nodeCount=this.length;if(fn !== jqLiteEmpty && (fn.length == 2 && (fn !== jqLiteHasClass && fn !== jqLiteController)?arg1:arg2) === undefined){if(isObject(arg1)){for(i = 0;i < nodeCount;i++) {if(fn === jqLiteData){fn(this[i],arg1);}else {for(key in arg1) {fn(this[i],key,arg1[key]);}}}return this;}else {var value=fn.$dv;var jj=value === undefined?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 {for(i = 0;i < nodeCount;i++) {fn(this[i],arg1,arg2);}return this;}};});function createEventHandler(element,events){var eventHandler=function eventHandler(event,type){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;};if(eventFnsLength > 1){eventFns = shallowCopy(eventFns);}for(var i=0;i < eventFnsLength;i++) {if(!event.isImmediatePropagationStopped()){eventFns[i].call(element,event);}}};eventHandler.elem = element;return eventHandler;}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');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);}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'){jqLiteOn(element,MOUSE_EVENT_MAP[type],function(event){var target=this,related=event.relatedTarget;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 one(element,type,fn){element = jqLite(element);element.on(type,function onFn(){element.off(type,fn);element.off(type,onFn);});element.on(type,fn);},replaceWith:function replaceWith(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 children(element){var children=[];forEach(element.childNodes,function(element){if(element.nodeType === NODE_TYPE_ELEMENT)children.push(element);});return children;},contents:function contents(element){return element.contentDocument || element.childNodes || [];},append:function append(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 prepend(element,node){if(element.nodeType === NODE_TYPE_ELEMENT){var index=element.firstChild;forEach(new JQLite(node),function(child){element.insertBefore(child,index);});}},wrap:function wrap(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 detach(element){jqLiteRemove(element,true);},after:function after(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 toggleClass(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 parent(element){var parent=element.parentNode;return parent && parent.nodeType !== NODE_TYPE_DOCUMENT_FRAGMENT?parent:null;},next:function next(element){return element.nextElementSibling;},find:function find(element,selector){if(element.getElementsByTagName){return element.getElementsByTagName(selector);}else {return [];}},clone:jqLiteClone,triggerHandler:function triggerHandler(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){dummyEvent = {preventDefault:function preventDefault(){this.defaultPrevented = true;},isDefaultPrevented:function isDefaultPrevented(){return this.defaultPrevented === true;},stopImmediatePropagation:function stopImmediatePropagation(){this.immediatePropagationStopped = true;},isImmediatePropagationStopped:function isImmediatePropagationStopped(){return this.immediatePropagationStopped === true;},stopPropagation:noop,type:eventName,target:element};if(event.type){dummyEvent = extend(dummyEvent,event);}eventFnsCopy = shallowCopy(eventFns);handlerArgs = extraParameters?[dummyEvent].concat(extraParameters):[dummyEvent];forEach(eventFnsCopy,function(fn){if(!dummyEvent.isImmediatePropagationStopped()){fn.apply(element,handlerArgs);}});}}},function(fn,name){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)){value = jqLite(value);}}else {jqLiteAddNodes(value,fn(this[i],arg1,arg2,arg3));}}return isDefined(value)?value:this;};JQLite.prototype.bind = JQLite.prototype.on;JQLite.prototype.unbind = JQLite.prototype.off;});function $$jqLiteProvider(){this.$get = function $$jqLite(){return extend(JQLite,{hasClass:function hasClass(node,classes){if(node.attr)node = node[0];return jqLiteHasClass(node,classes);},addClass:function addClass(node,classes){if(node.attr)node = node[0];return jqLiteAddClass(node,classes);},removeClass:function removeClass(node,classes){if(node.attr)node = node[0];return jqLiteRemoveClass(node,classes);}});};}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;}function HashMap(array,isolatedUid){if(isolatedUid){var uid=0;this.nextUid = function(){return ++uid;};}forEach(array,this.put,this);}HashMap.prototype = {put:function put(key,value){this[hashKey(key,this.nextUid)] = value;},get:function get(key){return this[hashKey(key,this.nextUid)];},remove:function remove(key){var value=this[key = hashKey(key,this.nextUid)];delete this[key];return value;}};var FN_ARGS=/^function\s*[^\(]*\(\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){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;}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){instanceInjector.invoke(fn || noop);});return instanceInjector;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});};}function loadModules(modulesToLoad){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){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;}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];}return fn.apply(self,args);}function instantiate(Type,locals,serviceName){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 has(name){return providerCache.hasOwnProperty(name + providerSuffix) || cache.hasOwnProperty(name);}};}}createInjector.$$annotate = annotate;function $AnchorScrollProvider(){var autoScrollingEnabled=true;this.disableAutoScrolling = function(){autoScrollingEnabled = false;};this.$get = ['$window','$location','$rootScope',function($window,$location,$rootScope){var document=$window.document;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){var elemTop=elem.getBoundingClientRect().top;$window.scrollBy(0,elemTop - offset);}}else {$window.scrollTo(0,0);}}function scroll(){var hash=$location.hash(),elm;if(!hash)scrollTo(null);else if(elm = document.getElementById(hash))scrollTo(elm);else if(elm = getFirstAnchor(document.getElementsByName(hash)))scrollTo(elm);else if(hash === 'top')scrollTo(null);}if(autoScrollingEnabled){$rootScope.$watch(function autoScrollWatch(){return $location.hash();},function autoScrollWatchAction(newVal,oldVal){if(newVal === oldVal && newVal === '')return;jqLiteDocumentLoaded(function(){$rootScope.$evalAsync(scroll);});});}return scroll;}];}var $animateMinErr=minErr('$animate');var $AnimateProvider=['$provide',function($provide){this.$$selectors = {};this.register = function(name,factory){var key=name + '-animation';if(name && name.charAt(0) != '.')throw $animateMinErr('notcsel','Expecting class selector starting with \'.\' got \'{0}\'.',name);this.$$selectors[name.substr(1)] = key;$provide.factory(key,factory);};this.classNameFilter = function(expression){if(arguments.length === 1){this.$$classNameFilter = expression instanceof RegExp?expression:null;}return this.$$classNameFilter;};this.$get = ['$$q','$$asyncCallback','$rootScope',function($$q,$$asyncCallback,$rootScope){var currentDefer;function runAnimationPostDigest(fn){var cancelFn,defer=$$q.defer();defer.promise.$$cancelFn = function ngAnimateMaybeCancel(){cancelFn && cancelFn();};$rootScope.$$postDigest(function ngAnimatePostDigest(){cancelFn = fn(function ngAnimateNotifyComplete(){defer.resolve();});});return defer.promise;}function resolveElementClasses(element,classes){var toAdd=[],toRemove=[];var hasClasses=createMap();forEach((element.attr('class') || '').split(/\s+/),function(className){hasClasses[className] = true;});forEach(classes,function(status,className){var hasClass=hasClasses[className];if(status === false && hasClass){toRemove.push(className);}else if(status === true && !hasClass){toAdd.push(className);}});return toAdd.length + toRemove.length > 0 && [toAdd.length?toAdd:null,toRemove.length?toRemove:null];}function cachedClassManipulation(cache,classes,op){for(var i=0,ii=classes.length;i < ii;++i) {var className=classes[i];cache[className] = op;}}function asyncPromise(){if(!currentDefer){currentDefer = $$q.defer();$$asyncCallback(function(){currentDefer.resolve();currentDefer = null;});}return currentDefer.promise;}function applyStyles(element,options){if(angular.isObject(options)){var styles=extend(options.from || {},options.to || {});element.css(styles);}}return {animate:function animate(element,from,to){applyStyles(element,{from:from,to:to});return asyncPromise();},enter:function enter(element,parent,after,options){applyStyles(element,options);after?after.after(element):parent.prepend(element);return asyncPromise();},leave:function leave(element,options){applyStyles(element,options);element.remove();return asyncPromise();},move:function move(element,parent,after,options){return this.enter(element,parent,after,options);},addClass:function addClass(element,className,options){return this.setClass(element,className,[],options);},$$addClassImmediately:function $$addClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteAddClass(element,className);});applyStyles(element,options);return asyncPromise();},removeClass:function removeClass(element,className,options){return this.setClass(element,[],className,options);},$$removeClassImmediately:function $$removeClassImmediately(element,className,options){element = jqLite(element);className = !isString(className)?isArray(className)?className.join(' '):'':className;forEach(element,function(element){jqLiteRemoveClass(element,className);});applyStyles(element,options);return asyncPromise();},setClass:function setClass(element,add,remove,options){var self=this;var STORAGE_KEY='$$animateClasses';var createdCache=false;element = jqLite(element);var cache=element.data(STORAGE_KEY);if(!cache){cache = {classes:{},options:options};createdCache = true;}else if(options && cache.options){cache.options = angular.extend(cache.options || {},options);}var classes=cache.classes;add = isArray(add)?add:add.split(' ');remove = isArray(remove)?remove:remove.split(' ');cachedClassManipulation(classes,add,true);cachedClassManipulation(classes,remove,false);if(createdCache){cache.promise = runAnimationPostDigest(function(done){var cache=element.data(STORAGE_KEY);element.removeData(STORAGE_KEY);if(cache){var classes=resolveElementClasses(element,cache.classes);if(classes){self.$$setClassImmediately(element,classes[0],classes[1],cache.options);}}done();});element.data(STORAGE_KEY,cache);}return cache.promise;},$$setClassImmediately:function $$setClassImmediately(element,add,remove,options){add && this.$$addClassImmediately(element,add);remove && this.$$removeClassImmediately(element,remove);applyStyles(element,options);return asyncPromise();},enabled:noop,cancel:noop};}];}];function $$AsyncCallbackProvider(){this.$get = ['$$rAF','$timeout',function($$rAF,$timeout){return $$rAF.supported?function(fn){return $$rAF(fn);}:function(fn){return $timeout(fn,0,false);};}];}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=[];self.$$completeOutstandingRequest = completeOutstandingRequest;self.$$incOutstandingRequestCount = function(){outstandingRequestCount++;};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 + 1);}self.notifyWhenNoOutstandingRequests = function(callback){forEach(pollFns,function(pollFn){pollFn();});if(outstandingRequestCount === 0){callback();}else {outstandingRequestCallbacks.push(callback);}};var pollFns=[],pollTimeout;self.addPollFn = function(fn){if(isUndefined(pollTimeout))startPoller(100,setTimeout);pollFns.push(fn);return fn;};function startPoller(interval,setTimeout){(function check(){forEach(pollFns,function(pollFn){pollFn();});pollTimeout = setTimeout(check,interval);})();}var cachedState,lastHistoryState,lastBrowserUrl=location.href,baseElement=document.find('base'),reloadLocation=null;cacheState();lastHistoryState = cachedState;self.url = function(url,replace,state){if(isUndefined(state)){state = null;}if(location !== window.location)location = window.location;if(history !== window.history)history = window.history;if(url){var sameState=lastHistoryState === state;if(lastBrowserUrl === url && (!$sniffer.history || sameState)){return self;}var sameBase=lastBrowserUrl && stripHash(lastBrowserUrl) === stripHash(url);lastBrowserUrl = url;lastHistoryState = state;if($sniffer.history && (!sameBase || !sameState)){history[replace?'replaceState':'pushState'](state,'',url);cacheState();lastHistoryState = cachedState;}else {if(!sameBase){reloadLocation = url;}if(replace){location.replace(url);}else if(!sameBase){location.href = url;}else {location.hash = getHash(url);}}return self;}else {return reloadLocation || location.href.replace(/%27/g,'\'');}};self.state = function(){return cachedState;};var urlChangeListeners=[],urlChangeInit=false;function cacheStateAndFireUrlChange(){cacheState();fireUrlChange();}function getCurrentState(){try{return history.state;}catch(e) {}}var lastCachedState=null;function cacheState(){cachedState = getCurrentState();cachedState = isUndefined(cachedState)?null:cachedState;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);});}self.onUrlChange = function(callback){if(!urlChangeInit){if($sniffer.history)jqLite(window).on('popstate',cacheStateAndFireUrlChange);jqLite(window).on('hashchange',cacheStateAndFireUrlChange);urlChangeInit = true;}urlChangeListeners.push(callback);return callback;};self.$$checkUrlChange = fireUrlChange;self.baseHref = function(){var href=baseElement.attr('href');return href?href.replace(/^(https?\:)?\/\/[^\/]*/,''):'';};var lastCookies={};var lastCookieString='';var cookiePath=self.baseHref();function safeDecodeURIComponent(str){try{return decodeURIComponent(str);}catch(e) {return str;}}self.cookies = function(name,value){var cookieLength,cookieArray,cookie,i,index;if(name){if(value === undefined){rawDocument.cookie = encodeURIComponent(name) + '=;path=' + cookiePath + ';expires=Thu, 01 Jan 1970 00:00:00 GMT';}else {if(isString(value)){cookieLength = (rawDocument.cookie = encodeURIComponent(name) + '=' + encodeURIComponent(value) + ';path=' + cookiePath).length + 1;if(cookieLength > 4096){$log.warn('Cookie \'' + name + '\' possibly not set or overflowed because it was too large (' + cookieLength + ' > 4096 bytes)!');}}}}else {if(rawDocument.cookie !== lastCookieString){lastCookieString = rawDocument.cookie;cookieArray = lastCookieString.split('; ');lastCookies = {};for(i = 0;i < cookieArray.length;i++) {cookie = cookieArray[i];index = cookie.indexOf('=');if(index > 0){name = safeDecodeURIComponent(cookie.substring(0,index));if(lastCookies[name] === undefined){lastCookies[name] = safeDecodeURIComponent(cookie.substring(index + 1));}}}}return lastCookies;}};self.defer = function(fn,delay){var timeoutId;outstandingRequestCount++;timeoutId = setTimeout(function(){delete pendingDeferIds[timeoutId];completeOutstandingRequest(fn);},delay || 0);pendingDeferIds[timeoutId] = true;return timeoutId;};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);}];}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;return caches[cacheId] = {put:function put(key,value){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key] || (lruHash[key] = {key:key});refresh(lruEntry);}if(isUndefined(value))return;if(!(key in data))size++;data[key] = value;if(size > capacity){this.remove(staleEnd.key);}return value;},get:function get(key){if(capacity < Number.MAX_VALUE){var lruEntry=lruHash[key];if(!lruEntry)return;refresh(lruEntry);}return data[key];},remove:function remove(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--;},removeAll:function removeAll(){data = {};size = 0;lruHash = {};freshEnd = staleEnd = null;},destroy:function destroy(){data = null;stats = null;lruHash = null;delete caches[cacheId];},info:function info(){return extend({},stats,{size:size});}};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;}}function link(nextEntry,prevEntry){if(nextEntry != prevEntry){if(nextEntry)nextEntry.p = prevEntry;if(prevEntry)prevEntry.n = nextEntry;}}}cacheFactory.info = function(){var info={};forEach(caches,function(cache,cacheId){info[cacheId] = cache.info();});return info;};cacheFactory.get = function(cacheId){return caches[cacheId];};return cacheFactory;};}function $TemplateCacheProvider(){this.$get = ['$cacheFactory',function($cacheFactory){return $cacheFactory('templates');}];}var $compileMinErr=minErr('$compile');$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=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/;var EVENT_HANDLER_ATTR_REGEXP=/^(on[a-z]+|formaction)$/;function parseIsolateBindings(scope,directiveName){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 isolate scope definition for directive \'{0}\'.' + ' Definition: {... {1}: \'{2}\' ...}',directiveName,scopeName,definition);}bindings[scopeName] = {mode:match[1][0],collection:match[2] === '*',optional:match[3] === '?',attrName:match[4] || scopeName};});return bindings;}this.directive = function registerDirective(name,directiveFactory){assertNotHasOwnProperty(name,'directive');if(isString(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';if(isObject(directive.scope)){directive.$$isolateBindings = parseIsolateBindings(directive.scope,directive.name);}directives.push(directive);}catch(e) {$exceptionHandler(e);}});return directives;}]);}hasDirectives[name].push(directiveFactory);}else {forEach(name,reverseParams(registerDirective));}return this;};this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.aHrefSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.aHrefSanitizationWhitelist();}};this.imgSrcSanitizationWhitelist = function(regexp){if(isDefined(regexp)){$$sanitizeUriProvider.imgSrcSanitizationWhitelist(regexp);return this;}else {return $$sanitizeUriProvider.imgSrcSanitizationWhitelist();}};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 Attributes(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 = {$normalize:directiveNormalize,$addClass:function $addClass(classVal){if(classVal && classVal.length > 0){$animate.addClass(this.$$element,classVal);}},$removeClass:function $removeClass(classVal){if(classVal && classVal.length > 0){$animate.removeClass(this.$$element,classVal);}},$updateClass:function $updateClass(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:function $set(key,value,writeAttr,attrName){var node=this.$$element[0],booleanKey=getBooleanAttrName(node,key),aliasedKey=getAliasedAttrName(node,key),observer=key,nodeName;if(booleanKey){this.$$element.prop(key,value);attrName = booleanKey;}else if(aliasedKey){this[aliasedKey] = value;observer = aliasedKey;}this[key] = value;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'){this[key] = value = $$sanitizeUri(value,key === 'src');}else if(nodeName === 'img' && key === 'srcset'){var result='';var trimmedSrcset=trim(value);var srcPattern=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/;var pattern=/\s/.test(trimmedSrcset)?srcPattern:/(,)/;var rawUris=trimmedSrcset.split(pattern);var nbrUrisWith2parts=Math.floor(rawUris.length / 2);for(var i=0;i < nbrUrisWith2parts;i++) {var innerIdx=i * 2;result += $$sanitizeUri(trim(rawUris[innerIdx]),true);result += ' ' + trim(rawUris[innerIdx + 1]);}var lastTuple=trim(rawUris[i * 2]).split(/\s/);result += $$sanitizeUri(trim(lastTuple[0]),true);if(lastTuple.length === 2){result += ' ' + trim(lastTuple[1]);}this[key] = value = result;}if(writeAttr !== false){if(value === null || value === undefined){this.$$element.removeAttr(attrName);}else {this.$$element.attr(attrName,value);}}var $$observers=this.$$observers;$$observers && forEach($$observers[observer],function(fn){try{fn(value);}catch(e) {$exceptionHandler(e);}});},$observe:function $observe(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)){fn(attrs[key]);}});return function(){arrayRemove(listeners,fn);};}};function safeAddClass($element,className){try{$element.addClass(className);}catch(e) {}}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)){$compileNodes = jqLite($compileNodes);}forEach($compileNodes,function(node,index){if(node.nodeType == NODE_TYPE_TEXT && node.nodeValue.match(/\S+/)){$compileNodes[index] = jqLite(node).wrap('').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;if(parentBoundTranscludeFn && parentBoundTranscludeFn.$$boundTransclude){parentBoundTranscludeFn = parentBoundTranscludeFn.$$boundTransclude;}if(!namespace){namespace = detectNamespaceForChildElements(futureParentElement);}var $linkNode;if(namespace !== 'html'){$linkNode = jqLite(wrapTemplate(namespace,jqLite('
').append($compileNodes).html()));}else if(cloneConnectFn){$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){var node=parentElement && parentElement[0];if(!node){return 'html';}else {return nodeName_(node) !== 'foreignobject' && node.toString().match(/SVG/)?'svg':'html';}}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();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;}previousCompileContext = null;}return linkFnFound?compositeLinkFn:null;function compositeLinkFn(scope,nodeList,$rootElement,parentBoundTranscludeFn){var nodeLinkFn,childLinkFn,node,childScope,i,ii,idx,childBoundTranscludeFn;var stableNodeList;if(nodeLinkFnFound){var nodeListLength=nodeList.length;stableNodeList = new Array(nodeListLength);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);}else {childScope = scope;}if(nodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,nodeLinkFn.transclude,parentBoundTranscludeFn,nodeLinkFn.elementTranscludeOnThisElement);}else if(!nodeLinkFn.templateOnThisElement && parentBoundTranscludeFn){childBoundTranscludeFn = parentBoundTranscludeFn;}else if(!parentBoundTranscludeFn && transcludeFn){childBoundTranscludeFn = createBoundTranscludeFn(scope,transcludeFn);}else {childBoundTranscludeFn = null;}nodeLinkFn(childLinkFn,childScope,node,$rootElement,childBoundTranscludeFn);}else if(childLinkFn){childLinkFn(scope,node.childNodes,undefined,parentBoundTranscludeFn);}}}}function createBoundTranscludeFn(scope,transcludeFn,previousBoundTranscludeFn,elementTransclusion){var boundTranscludeFn=function boundTranscludeFn(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;}function collectDirectives(node,directives,attrs,maxPriority,ignoreDirective){var nodeType=node.nodeType,attrsMap=attrs.$attr,match,className;switch(nodeType){case NODE_TYPE_ELEMENT:addDirective(directives,directiveNormalize(nodeName_(node)),'E',maxPriority,ignoreDirective);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);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;}}addAttrInterpolateDirective(node,directives,value,nName,isNgAttr);addDirective(directives,nName,'A',maxPriority,ignoreDirective,attrStartName,attrEndName);}className = node.className;if(isObject(className)){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:addTextInterpolateDirective(directives,node.nodeValue);break;case NODE_TYPE_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) {}break;}directives.sort(byPriority);return directives;}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);}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);};}function applyDirectivesToNode(directives,compileNode,templateAttrs,transcludeFn,jqCollection,originalReplaceDirective,preLinkFns,postLinkFns,previousCompileContext){previousCompileContext = previousCompileContext || {};var terminalPriority=-Number.MAX_VALUE,newScopeDirective,controllerDirectives=previousCompileContext.controllerDirectives,controllers,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;for(var i=0,ii=directives.length;i < ii;i++) {directive = directives[i];var attrStart=directive.$$start;var attrEnd=directive.$$end;if(attrStart){$compileNode = groupScan(compileNode,attrStart,attrEnd);}$template = undefined;if(terminalPriority > directive.priority){break;}if(directiveValue = directive.scope){if(!directive.templateUrl){if(isObject(directiveValue)){assertNoDuplicate('new/isolated scope',newIsolateScopeDirective || newScopeDirective,directive,$compileNode);newIsolateScopeDirective = directive;}else {assertNoDuplicate('new/isolated scope',newIsolateScopeDirective,directive,$compileNode);}}newScopeDirective = newScopeDirective || directive;}directiveName = directive.name;if(!directive.templateUrl && directive.controller){directiveValue = directive.controller;controllerDirectives = controllerDirectives || {};assertNoDuplicate('\'' + directiveName + '\' controller',controllerDirectives[directiveName],directive,$compileNode);controllerDirectives[directiveName] = directive;}if(directiveValue = directive.transclude){hasTranscludeDirective = true;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,{nonTlbTranscludeDirective:nonTlbTranscludeDirective});}else {$template = jqLite(jqLiteClone(compileNode)).contents();$compileNode.empty();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:{}};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,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.elementTranscludeOnThisElement = hasElementTranscludeDirective;nodeLinkFn.templateOnThisElement = hasTemplate;nodeLinkFn.transclude = childTranscludeFn;previousCompileContext.hasElementTranscludeDirective = hasElementTranscludeDirective;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,retrievalMethod='data',optional=false;var $searchElement=$element;var match;if(isString(require)){match = require.match(REQUIRE_PREFIX_REGEXP);require = require.substring(match[0].length);if(match[3]){if(match[1])match[3] = null;else match[1] = match[3];}if(match[1] === '^'){retrievalMethod = 'inheritedData';}else if(match[1] === '^^'){retrievalMethod = 'inheritedData';$searchElement = $element.parent();}if(match[2] === '?'){optional = true;}value = null;if(elementControllers && retrievalMethod === 'data'){if(value = elementControllers[require]){value = value.instance;}}value = value || $searchElement[retrievalMethod]('$' + require + 'Controller');if(!value && !optional){throw $compileMinErr('ctreq','Controller \'{0}\', required by directive \'{1}\', can\'t be found!',require,directiveName);}return value || null;}else if(isArray(require)){value = [];forEach(require,function(require){value.push(getControllers(directiveName,require,$element,elementControllers));});}return value;}function nodeLinkFn(childLinkFn,scope,linkNode,$rootElement,boundTranscludeFn){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){transcludeFn = controllersBoundTransclude;transcludeFn.$$boundTransclude = boundTranscludeFn;}if(controllerDirectives){controllers = {};elementControllers = {};forEach(controllerDirectives,function(directive){var locals={$scope:directive === newIsolateScopeDirective || directive.$$isolateScope?isolateScope:scope,$element:$element,$attrs:attrs,$transclude:transcludeFn},controllerInstance;controller = directive.controller;if(controller == '@'){controller = attrs[directive.name];}controllerInstance = $controller(controller,locals,true,directive.controllerAs);elementControllers[directive.name] = controllerInstance;if(!hasElementTranscludeDirective){$element.data('$' + directive.name + 'Controller',controllerInstance.instance);}controllers[directive.name] = controllerInstance;});}if(newIsolateScopeDirective){compile.$$addScopeInfo($element,isolateScope,true,!(templateDirective && (templateDirective === newIsolateScopeDirective || templateDirective === newIsolateScopeDirective.$$originalDirective)));compile.$$addScopeClass($element,true);var isolateScopeController=controllers && controllers[newIsolateScopeDirective.name];var isolateBindingContext=isolateScope;if(isolateScopeController && isolateScopeController.identifier && newIsolateScopeDirective.bindToController === true){isolateBindingContext = isolateScopeController.instance;}forEach(isolateScope.$$isolateBindings = newIsolateScopeDirective.$$isolateBindings,function(definition,scopeName){var attrName=definition.attrName,optional=definition.optional,mode=definition.mode,lastValue,parentGet,parentSet,compare;switch(mode){case '@':attrs.$observe(attrName,function(value){isolateBindingContext[scopeName] = value;});attrs.$$observers[attrName].$$scope = scope;if(attrs[attrName]){isolateBindingContext[scopeName] = $interpolate(attrs[attrName])(scope);}break;case '=':if(optional && !attrs[attrName]){return;}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(){lastValue = isolateBindingContext[scopeName] = parentGet(scope);throw $compileMinErr('nonassign','Expression \'{0}\' used with directive \'{1}\' is non-assignable!',attrs[attrName],newIsolateScopeDirective.name);};lastValue = isolateBindingContext[scopeName] = parentGet(scope);var parentValueWatch=function parentValueWatch(parentValue){if(!compare(parentValue,isolateBindingContext[scopeName])){if(!compare(parentValue,lastValue)){isolateBindingContext[scopeName] = parentValue;}else {parentSet(scope,parentValue = isolateBindingContext[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);}isolateScope.$on('$destroy',unwatch);break;case '&':parentGet = $parse(attrs[attrName]);isolateBindingContext[scopeName] = function(locals){return parentGet(scope,locals);};break;}});}if(controllers){forEach(controllers,function(controller){controller();});controllers = null;}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);}var scopeToChild=scope;if(newIsolateScopeDirective && (newIsolateScopeDirective.template || newIsolateScopeDirective.templateUrl === null)){scopeToChild = isolateScope;}childLinkFn && childLinkFn(scopeToChild,linkNode.childNodes,undefined,boundTranscludeFn);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);}function controllersBoundTransclude(scope,cloneAttachFn,futureParentElement){var transcludeControllers;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){for(var j=0,jj=directives.length;j < jj;j++) {directives[j] = inherit(directives[j],{$$isolateScope:true});}}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((maxPriority === undefined || 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;}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;}function mergeTemplateAttributes(dst,src){var srcAttr=src.$attr,dstAttr=dst.$attr,$element=dst.$$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]);}});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;}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($sce.getTrustedResourceUrl(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)){linkNode = jqLiteClone(compileNode);}replaceWith(linkRootElement,jqLite(beforeTemplateLinkNode),linkNode);safeAddClass(jqLite(linkNode),oldClasses);}if(afterTemplateNodeLinkFn.transcludeOnThisElement){childBoundTranscludeFn = createBoundTranscludeFn(scope,afterTemplateNodeLinkFn.transclude,boundTranscludeFn);}else {childBoundTranscludeFn = boundTranscludeFn;}afterTemplateNodeLinkFn(afterTemplateChildLinkFn,scope,linkNode,$rootElement,childBoundTranscludeFn);}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);}};}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){if(previousDirective){throw $compileMinErr('multidir','Multiple directives [{0}, {1}] asking for {2} on: {3}',previousDirective.name,directive.name,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;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 + '';return wrapper.childNodes[0].childNodes;default:return template;}}function getTrustedContext(node,attrNormalizedName){if(attrNormalizedName == 'srcdoc'){return $sce.HTML;}var tag=nodeName_(node);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);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 compile(){return {pre:function attrInterpolatePreLinkFn(scope,element,attr){var $$observers=attr.$$observers || (attr.$$observers = {});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.');}var newValue=attr[name];if(newValue !== value){interpolateFn = newValue && $interpolate(newValue,true,trustedContext,allOrNothing);value = newValue;}if(!interpolateFn)return;attr[name] = interpolateFn(scope);($$observers[name] || ($$observers[name] = [])).$$inter = true;(attr.$$observers && attr.$$observers[name].$$scope || scope).$watch(interpolateFn,function interpolateFnWatchAction(newValue,oldValue){if(name === 'class' && newValue != oldValue){attr.$updateClass(newValue,oldValue);}else {attr.$set(name,newValue);}});}};}});}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($rootElement.context === firstElementToRemove){$rootElement.context = newNode;}break;}}}if(parent){parent.replaceChild(newNode,firstElementToRemove);}var fragment=document.createDocumentFragment();fragment.appendChild(firstElementToRemove);jqLite(newNode).data(jqLite(firstElementToRemove).data());if(!jQuery){delete jqLite.cache[firstElementToRemove[jqLite.expando]];}else {skipDestroyOnNextJQueryCleanData = true;jQuery.cleanData([firstElementToRemove]);}for(var k=1,kk=elementsToRemove.length;k < kk;k++) {var element=elementsToRemove[k];jqLite(element).remove();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));}}}];}var PREFIX_REGEXP=/^((?:x|data)[\:\-_])/i;function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}function nodesetLinkingFn(scope,nodeList,rootElement,boundTranscludeFn){}function directiveLinkingFn(nodesetLinkingFn,scope,node,rootElement,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');function $ControllerProvider(){var controllers={},globals=false,CNTRL_REG=/^(\S+)(\s+as\s+(\w+))?$/;this.register = function(name,constructor){assertNotHasOwnProperty(name,'controller');if(isObject(name)){extend(controllers,name);}else {controllers[name] = constructor;}};this.allowGlobals = function(){globals = true;};this.$get = ['$injector','$window',function($injector,$window){return function(expression,locals,later,ident){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){var controllerPrototype=(isArray(expression)?expression[expression.length - 1]:expression).prototype;instance = Object.create(controllerPrototype || null);if(identifier){addIdentifier(locals,identifier,instance,constructor || expression.name);}return extend(function(){$injector.invoke(expression,instance,locals,constructor);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;}}];}function $DocumentProvider(){this.$get = ['$window',function(window){return jqLite(window.document);}];}function $ExceptionHandlerProvider(){this.$get = ['$log',function($log){return function(exception,cause){$log.error.apply($log,arguments);};}];}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/;function defaultHttpResponseTransform(data,headers){if(isString(data)){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);}function parseHeaders(headers){var parsed=createMap(),key,val,i;if(!headers)return parsed;forEach(headers.split('\n'),function(line){i = line.indexOf(':');key = lowercase(trim(line.substr(0,i)));val = trim(line.substr(i + 1));if(key){parsed[key] = parsed[key]?parsed[key] + ', ' + val:val;}});return parsed;}function headersGetter(headers){var headersObj=isObject(headers)?headers:undefined;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;};}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;}function $HttpProvider(){var defaults=this.defaults = {transformResponse:[defaultHttpResponseTransform],transformRequest:[function(d){return isObject(d) && !isFile(d) && !isBlob(d) && !isFormData(d)?toJson(d):d;}],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'};var useApplyAsync=false;this.useApplyAsync = function(value){if(isDefined(value)){useApplyAsync = !!value;return this;}return useApplyAsync;};var interceptorFactories=this.interceptors = [];this.$get = ['$httpBackend','$browser','$cacheFactory','$rootScope','$q','$injector',function($httpBackend,$browser,$cacheFactory,$rootScope,$q,$injector){var defaultCache=$cacheFactory('$http');var reversedInterceptors=[];forEach(interceptorFactories,function(interceptorFactory){reversedInterceptors.unshift(isString(interceptorFactory)?$injector.get(interceptorFactory):$injector.invoke(interceptorFactory));});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},requestConfig);config.headers = mergeHeaders(requestConfig);config.method = uppercase(config.method);var serverRequest=function serverRequest(config){var headers=config.headers;var reqData=transformData(config.data,headersGetter(headers),undefined,config.transformRequest);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;}return sendReq(config,reqData).then(transformResponse,transformResponse);};var chain=[serverRequest,undefined];var promise=$q.when(config);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);}promise.success = function(fn){promise.then(function(response){fn(response.data,response.status,response.headers,config);});return promise;};promise.error = function(fn){promise.then(null,function(response){fn(response.data,response.status,response.headers,config);});return promise;};return promise;function transformResponse(response){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){var headerContent,processedHeaders={};forEach(headers,function(headerFn,header){if(isFunction(headerFn)){headerContent = headerFn();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)]);defaultHeadersIteration: for(defHeaderName in defHeaders) {lowercaseDefHeaderName = lowercase(defHeaderName);for(reqHeaderName in reqHeaders) {if(lowercase(reqHeaderName) === lowercaseDefHeaderName){continue defaultHeadersIteration;}}reqHeaders[defHeaderName] = defHeaders[defHeaderName];}return executeHeaderFns(reqHeaders);}}$http.pendingRequests = [];createShortMethods('get','delete','head','jsonp');createShortMethodsWithData('post','put','patch');$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}));};});}function sendReq(config,reqData){var deferred=$q.defer(),promise=deferred.promise,cache,cachedResp,reqHeaders=config.headers,url=buildUrl(config.url,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)){cachedResp.then(resolvePromiseWithResult,resolvePromiseWithResult);}else {if(isArray(cachedResp)){resolvePromise(cachedResp[1],cachedResp[0],shallowCopy(cachedResp[2]),cachedResp[3]);}else {resolvePromise(cachedResp,200,{},'OK');}}}else {cache.put(url,promise);}}if(isUndefined(cachedResp)){var xsrfValue=urlIsSameOrigin(config.url)?$browser.cookies()[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;function done(status,response,headersString,statusText){if(cache){if(isSuccess(status)){cache.put(url,[status,response,parseHeaders(headersString),statusText]);}else {cache.remove(url);}}function resolveHttpPromise(){resolvePromise(response,status,headersString,statusText);}if(useApplyAsync){$rootScope.$applyAsync(resolveHttpPromise);}else {resolveHttpPromise();if(!$rootScope.$$phase)$rootScope.$apply();}}function resolvePromise(response,status,headers,statusText){status = Math.max(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,params){if(!params)return url;var parts=[];forEachSorted(params,function(value,key){if(value === null || isUndefined(value))return;if(!isArray(value))value = [value];forEach(value,function(v){if(isObject(v)){if(isDate(v)){v = v.toISOString();}else {v = toJson(v);}}parts.push(encodeUriQuery(key) + '=' + encodeUriQuery(v));});});if(parts.length > 0){url += (url.indexOf('?') == -1?'?':'&') + parts.join('&');}return url;}}];}function createXhr(){return new window.XMLHttpRequest();}function $HttpBackendProvider(){this.$get = ['$browser','$window','$document',function($browser,$window,$document){return createHttpBackend($browser,createXhr,$browser.defer,$window.angular.callbacks,$document[0]);}];}function createHttpBackend($browser,createXhr,$browserDefer,callbacks,rawDocument){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();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 || '';var response='response' in xhr?xhr.response:xhr.responseText;var status=xhr.status === 1223?204:xhr.status;if(status === 0){status = response?200:urlResolve(url).protocol == 'file'?404:0;}completeRequest(callback,status,response,xhr.getAllResponseHeaders(),statusText);};var requestError=function requestError(){completeRequest(callback,-1,null,null,'');};xhr.onerror = requestError;xhr.onabort = requestError;if(withCredentials){xhr.withCredentials = true;}if(responseType){try{xhr.responseType = responseType;}catch(e) {if(responseType !== 'json'){throw e;}}}xhr.send(post || null);}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){if(timeoutId !== undefined){$browserDefer.cancel(timeoutId);}jsonpDone = xhr = null;callback(status,response,headersString,statusText);$browser.$$completeOutstandingRequest(noop);}};function jsonpReq(url,callbackId,done){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=minErr('$interpolate');function $InterpolateProvider(){var startSymbol='{{';var endSymbol='}}';this.startSymbol = function(value){if(value){startSymbol = value;return this;}else {return startSymbol;}};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 $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 {if(index !== textLength){concat.push(unescapeText(text.substring(index)));}break;}}if(trustedContext && concat.length > 1){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);}if(!mustHaveExpression || expressions.length){var compute=function compute(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 getValue(value){return trustedContext?$sce.getTrusted(trustedContext,value):$sce.valueOf(value);};var stringify=function stringify(value){if(value == null){return '';}switch(typeof value){case 'string':break;case 'number':value = '' + value;break;default:value = toJson(value);}return 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) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}},{exp:text,expressions:expressions,$$watchDelegate:function $$watchDelegate(scope,listener,objectEquality){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;},objectEquality);}});}function unescapeText(text){return text.replace(escapedStartRegexp,startSymbol).replace(escapedEndRegexp,endSymbol);}function parseStringifyInterceptor(value){try{value = getValue(value);return allOrNothing && !isDefined(value)?value:stringify(value);}catch(err) {var newErr=$interpolateMinErr('interr','Can\'t interpolate: {0}\n{1}',text,err.toString());$exceptionHandler(newErr);}}}$interpolate.startSymbol = function(){return startSymbol;};$interpolate.endSymbol = function(){return endSymbol;};return $interpolate;}];}function $IntervalProvider(){this.$get = ['$rootScope','$window','$q','$$q',function($rootScope,$window,$q,$$q){var intervals={};function interval(fn,delay,count,invokeApply){var 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,fn);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;}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;}];}function $LocaleProvider(){this.$get = function(){return {id:'en-us',NUMBER_FORMATS:{DECIMAL_SEP:'.',GROUP_SEP:',',PATTERNS:[{minInt:1,minFrac:0,maxFrac:3,posPre:'',posSuf:'',negPre:'-',negSuf:'',gSize:3,lgSize:3},{minInt:1,minFrac:2,maxFrac:2,posPre:'¤',posSuf:'',negPre:'(¤',negSuf:')',gSize:3,lgSize:3}],CURRENCY_SYM:'$'},DATETIME_FORMATS:{MONTH:'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),SHORTMONTH:'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),DAY:'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),SHORTDAY:'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(','),AMPMS:['AM','PM'],medium:'MMM d, y h:mm:ss a','short':'M/d/yy h:mm a',fullDate:'EEEE, MMMM d, y',longDate:'MMMM d, y',mediumDate:'MMM d, y',shortDate:'M/d/yy',mediumTime:'h:mm:ss a',shortTime:'h:mm a',ERANAMES:['Before Christ','Anno Domini'],ERAS:['BC','AD']},pluralCat:function pluralCat(num){if(num === 1){return 'one';}return 'other';}};};}var PATH_MATCH=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,DEFAULT_PORTS={'http':80,'https':443,'ftp':21};var $locationMinErr=minErr('$location');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 = int(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);if(locationObj.$$path && locationObj.$$path.charAt(0) != '/'){locationObj.$$path = '/' + locationObj.$$path;}}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);}function serverBase(url){return url.substring(0,url.indexOf('/',url.indexOf('//') + 2));}function LocationHtml5Url(appBase,basePrefix){this.$$html5 = true;basePrefix = basePrefix || '';var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);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();};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);};this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){this.hash(relHref.slice(1));return true;}var appUrl,prevAppUrl;var rewrittenUrl;if((appUrl = beginsWith(appBase,url)) !== undefined){prevAppUrl = appUrl;if((appUrl = beginsWith(basePrefix,appUrl)) !== undefined){rewrittenUrl = appBaseNoFile + (beginsWith('/',appUrl) || appUrl);}else {rewrittenUrl = appBase + prevAppUrl;}}else if((appUrl = beginsWith(appBaseNoFile,url)) !== undefined){rewrittenUrl = appBaseNoFile + appUrl;}else if(appBaseNoFile == url + '/'){rewrittenUrl = appBaseNoFile;}if(rewrittenUrl){this.$$parse(rewrittenUrl);}return !!rewrittenUrl;};}function LocationHashbangUrl(appBase,hashPrefix){var appBaseNoFile=stripFile(appBase);parseAbsoluteUrl(appBase,this);this.$$parse = function(url){var withoutBaseUrl=beginsWith(appBase,url) || beginsWith(appBaseNoFile,url);var withoutHashUrl;if(withoutBaseUrl.charAt(0) === '#'){withoutHashUrl = beginsWith(hashPrefix,withoutBaseUrl);if(isUndefined(withoutHashUrl)){withoutHashUrl = withoutBaseUrl;}}else {withoutHashUrl = this.$$html5?withoutBaseUrl:'';}parseAppUrl(withoutHashUrl,this);this.$$path = removeWindowsDriveName(this.$$path,withoutHashUrl,appBase);this.$$compose();function removeWindowsDriveName(path,url,base){var windowsFilePathExp=/^\/[A-Z]:(\/.*)/;var firstPathSegmentMatch;if(url.indexOf(base) === 0){url = url.replace(base,'');}if(windowsFilePathExp.exec(url)){return path;}firstPathSegmentMatch = windowsFilePathExp.exec(path);return firstPathSegmentMatch?firstPathSegmentMatch[1]:path;}};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;};}function LocationHashbangInHtml5Url(appBase,hashPrefix){this.$$html5 = true;LocationHashbangUrl.apply(this,arguments);var appBaseNoFile=stripFile(appBase);this.$$parseLinkUrl = function(url,relHref){if(relHref && relHref[0] === '#'){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;this.$$absUrl = appBase + hashPrefix + this.$$url;};}var locationPrototype={$$html5:false,$$replace:false,absUrl:locationGetter('$$absUrl'),url:function url(_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;},protocol:locationGetter('$$protocol'),host:locationGetter('$$host'),port:locationGetter('$$port'),path:locationGetterSetter('$$path',function(path){path = path !== null?path.toString():'';return path.charAt(0) == '/'?path:'/' + path;}),search:function search(_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,{});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;},hash:locationGetterSetter('$$hash',function(hash){return hash !== null?hash.toString():'';}),replace:function replace(){this.$$replace = true;return this;}};forEach([LocationHashbangInHtml5Url,LocationHashbangUrl,LocationHtml5Url],function(Location){Location.prototype = Object.create(locationPrototype);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');}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;};}function $LocationProvider(){var hashPrefix='',html5Mode={enabled:false,requireBase:true,rewriteLinks:true};this.hashPrefix = function(prefix){if(isDefined(prefix)){hashPrefix = prefix;return this;}else {return hashPrefix;}};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;}};this.$get = ['$rootScope','$browser','$sniffer','$rootElement','$window',function($rootScope,$browser,$sniffer,$rootElement,$window){var $location,LocationMode,baseHref=$browser.baseHref(),initialUrl=$browser.url(),appBase;if(html5Mode.enabled){if(!baseHref && html5Mode.requireBase){throw $locationMinErr('nobase','$location in HTML5 mode requires a tag to be present!');}appBase = serverBase(initialUrl) + (baseHref || '/');LocationMode = $sniffer.history?LocationHtml5Url:LocationHashbangInHtml5Url;}else {appBase = stripHash(initialUrl);LocationMode = LocationHashbangUrl;}$location = new LocationMode(appBase,'#' + 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);$location.$$state = $browser.state();}catch(e) {$location.url(oldUrl);$location.$$state = oldState;throw e;}}$rootElement.on('click',function(event){if(!html5Mode.rewriteLinks || event.ctrlKey || event.metaKey || event.shiftKey || event.which == 2 || event.button == 2)return;var elm=jqLite(event.target);while(nodeName_(elm[0]) !== 'a') {if(elm[0] === $rootElement[0] || !(elm = elm.parent())[0])return;}var absHref=elm.prop('href');var relHref=elm.attr('href') || elm.attr('xlink:href');if(isObject(absHref) && absHref.toString() === '[object SVGAnimatedString]'){absHref = urlResolve(absHref.animVal).href;}if(IGNORE_URI_REGEXP.test(absHref))return;if(absHref && !elm.attr('target') && !event.isDefaultPrevented()){if($location.$$parseLinkUrl(absHref,relHref)){event.preventDefault();if($location.absUrl() != $browser.url()){$rootScope.$apply();$window.angular['ff-684208-preventDefault'] = true;}}}});if(trimEmptyHash($location.absUrl()) != trimEmptyHash(initialUrl)){$browser.url($location.absUrl(),true);}var initializing=true;$browser.onUrlChange(function(newUrl,newState){$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($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();});$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($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;});return $location;function afterLocationChange(oldUrl,oldState){$rootScope.$broadcast('$locationChangeSuccess',$location.absUrl(),oldUrl,$location.$$state,oldState);}}];}function $LogProvider(){var debug=true,self=this;this.debugEnabled = function(flag){if(isDefined(flag)){debug = flag;return this;}else {return debug;}};this.$get = ['$window',function($window){return {log:consoleLog('log'),info:consoleLog('info'),warn:consoleLog('warn'),error:consoleLog('error'),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;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);};}return function(arg1,arg2){logFn(arg1,arg2 == null?'':arg2);};}}];}var $parseMinErr=minErr('$parse');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 ensureSafeObject(obj,fullExpression){if(obj){if(obj.constructor === obj){throw $parseMinErr('isecfn','Referencing Function in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(obj.window === obj){throw $parseMinErr('isecwindow','Referencing the Window in Angular expressions is disallowed! Expression: {0}',fullExpression);}else if(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(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);}}}var CONSTANTS=createMap();forEach({'null':function _null(){return null;},'true':function _true(){return true;},'false':function _false(){return false;},'undefined':function undefined(){}},function(constantGetter,name){constantGetter.constant = constantGetter.literal = constantGetter.sharedGetter = true;CONSTANTS[name] = constantGetter;});CONSTANTS['this'] = function(self){return self;};CONSTANTS['this'].sharedGetter = true;var OPERATORS=extend(createMap(),{'+':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);if(isDefined(a)){if(isDefined(b)){return a + b;}return a;}return isDefined(b)?b:undefined;},'-':function _(self,locals,a,b){a = a(self,locals);b = b(self,locals);return (isDefined(a)?a:0) - (isDefined(b)?b:0);},'*':function _(self,locals,a,b){return a(self,locals) * b(self,locals);},'/':function _(self,locals,a,b){return a(self,locals) / b(self,locals);},'%':function _(self,locals,a,b){return a(self,locals) % b(self,locals);},'===':function _(self,locals,a,b){return a(self,locals) === b(self,locals);},'!==':function _(self,locals,a,b){return a(self,locals) !== b(self,locals);},'==':function _(self,locals,a,b){return a(self,locals) == b(self,locals);},'!=':function _(self,locals,a,b){return a(self,locals) != b(self,locals);},'<':function _(self,locals,a,b){return a(self,locals) < b(self,locals);},'>':function _(self,locals,a,b){return a(self,locals) > b(self,locals);},'<=':function _(self,locals,a,b){return a(self,locals) <= b(self,locals);},'>=':function _(self,locals,a,b){return a(self,locals) >= b(self,locals);},'&&':function _(self,locals,a,b){return a(self,locals) && b(self,locals);},'||':function _(self,locals,a,b){return a(self,locals) || b(self,locals);},'!':function _(self,locals,a){return !a(self,locals);},'=':true,'|':true});var ESCAPE={'n':'\n','f':'\f','r':'\r','t':'\t','v':'\u000b','\'':'\'','"':'"'};var Lexer=function Lexer(options){this.options = options;};Lexer.prototype = {constructor:Lexer,lex:function lex(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 is(ch,chars){return chars.indexOf(ch) !== -1;},peek:function peek(i){var num=i || 1;return this.index + num < this.text.length?this.text.charAt(this.index + num):false;},isNumber:function isNumber(ch){return '0' <= ch && ch <= '9' && typeof ch === 'string';},isWhitespace:function isWhitespace(ch){return ch === ' ' || ch === '\r' || ch === '\t' || ch === '\n' || ch === '\u000b' || ch === ' ';},isIdent:function isIdent(ch){return 'a' <= ch && ch <= 'z' || 'A' <= ch && ch <= 'Z' || '_' === ch || ch === '$';},isExpOperator:function isExpOperator(ch){return ch === '-' || ch === '+' || this.isNumber(ch);},throwError:function throwError(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 readNumber(){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 readIdent(){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 readString(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);}};function isConstant(exp){return exp.constant;}var Parser=function Parser(lexer,$filter,options){this.lexer = lexer;this.$filter = $filter;this.options = options;};Parser.ZERO = extend(function(){return 0;},{sharedGetter:true,constant:true});Parser.prototype = {constructor:Parser,parse:function parse(text){this.text = text;this.tokens = this.lexer.lex(text);var value=this.statements();if(this.tokens.length !== 0){this.throwError('is an unexpected token',this.tokens[0]);}value.literal = !!value.literal;value.constant = !!value.constant;return value;},primary:function primary(){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.peek().identifier && this.peek().text in CONSTANTS){primary = 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,context;while(next = this.expect('(','[','.')) {if(next.text === '('){primary = this.functionCall(primary,context);context = null;}else if(next.text === '['){context = primary;primary = this.objectIndex(primary);}else if(next.text === '.'){context = primary;primary = this.fieldAccess(primary);}else {this.throwError('IMPOSSIBLE');}}return primary;},throwError:function throwError(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));},peekToken:function peekToken(){if(this.tokens.length === 0)throw $parseMinErr('ueoe','Unexpected end of expression: {0}',this.text);return this.tokens[0];},peek:function peek(e1,e2,e3,e4){return this.peekAhead(0,e1,e2,e3,e4);},peekAhead:function peekAhead(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 expect(e1,e2,e3,e4){var token=this.peek(e1,e2,e3,e4);if(token){this.tokens.shift();return token;}return false;},consume:function consume(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;},unaryFn:function unaryFn(op,right){var fn=OPERATORS[op];return extend(function $parseUnaryFn(self,locals){return fn(self,locals,right);},{constant:right.constant,inputs:[right]});},binaryFn:function binaryFn(left,op,right,isBranching){var fn=OPERATORS[op];return extend(function $parseBinaryFn(self,locals){return fn(self,locals,left,right);},{constant:left.constant && right.constant,inputs:!isBranching && [left,right]});},identifier:function identifier(){var id=this.consume().text;while(this.peek('.') && this.peekAhead(1).identifier && !this.peekAhead(2,'(')) {id += this.consume().text + this.consume().text;}return getterFn(id,this.options,this.text);},constant:function constant(){var value=this.consume().value;return extend(function $parseConstant(){return value;},{constant:true,literal:true});},statements:function statements(){var statements=[];while(true) {if(this.tokens.length > 0 && !this.peek('}',')',';',']'))statements.push(this.filterChain());if(!this.expect(';')){return statements.length === 1?statements[0]:function $parseStatements(self,locals){var value;for(var i=0,ii=statements.length;i < ii;i++) {value = statements[i](self,locals);}return value;};}}},filterChain:function filterChain(){var left=this.expression();var token;while(token = this.expect('|')) {left = this.filter(left);}return left;},filter:function filter(inputFn){var fn=this.$filter(this.consume().text);var argsFn;var args;if(this.peek(':')){argsFn = [];args = [];while(this.expect(':')) {argsFn.push(this.expression());}}var inputs=[inputFn].concat(argsFn || []);return extend(function $parseFilter(self,locals){var input=inputFn(self,locals);if(args){args[0] = input;var i=argsFn.length;while(i--) {args[i + 1] = argsFn[i](self,locals);}return fn.apply(undefined,args);}return fn(input);},{constant:!fn.$stateful && inputs.every(isConstant),inputs:!fn.$stateful && inputs});},expression:function expression(){return this.assignment();},assignment:function assignment(){var left=this.ternary();var right;var token;if(token = this.expect('=')){if(!left.assign){this.throwError('implies assignment but [' + this.text.substring(0,token.index) + '] can not be assigned to',token);}right = this.ternary();return extend(function $parseAssignment(scope,locals){return left.assign(scope,right(scope,locals),locals);},{inputs:[left,right]});}return left;},ternary:function ternary(){var left=this.logicalOR();var middle;var token;if(token = this.expect('?')){middle = this.assignment();if(this.consume(':')){var right=this.assignment();return extend(function $parseTernary(self,locals){return left(self,locals)?middle(self,locals):right(self,locals);},{constant:left.constant && middle.constant && right.constant});}}return left;},logicalOR:function logicalOR(){var left=this.logicalAND();var token;while(token = this.expect('||')) {left = this.binaryFn(left,token.text,this.logicalAND(),true);}return left;},logicalAND:function logicalAND(){var left=this.equality();var token;while(token = this.expect('&&')) {left = this.binaryFn(left,token.text,this.equality(),true);}return left;},equality:function equality(){var left=this.relational();var token;while(token = this.expect('==','!=','===','!==')) {left = this.binaryFn(left,token.text,this.relational());}return left;},relational:function relational(){var left=this.additive();var token;while(token = this.expect('<','>','<=','>=')) {left = this.binaryFn(left,token.text,this.additive());}return left;},additive:function additive(){var left=this.multiplicative();var token;while(token = this.expect('+','-')) {left = this.binaryFn(left,token.text,this.multiplicative());}return left;},multiplicative:function multiplicative(){var left=this.unary();var token;while(token = this.expect('*','/','%')) {left = this.binaryFn(left,token.text,this.unary());}return left;},unary:function unary(){var token;if(this.expect('+')){return this.primary();}else if(token = this.expect('-')){return this.binaryFn(Parser.ZERO,token.text,this.unary());}else if(token = this.expect('!')){return this.unaryFn(token.text,this.unary());}else {return this.primary();}},fieldAccess:function fieldAccess(object){var getter=this.identifier();return extend(function $parseFieldAccess(scope,locals,self){var o=self || object(scope,locals);return o == null?undefined:getter(o);},{assign:function assign(scope,value,locals){var o=object(scope,locals);if(!o)object.assign(scope,o = {},locals);return getter.assign(o,value);}});},objectIndex:function objectIndex(obj){var expression=this.text;var indexFn=this.expression();this.consume(']');return extend(function $parseObjectIndex(self,locals){var o=obj(self,locals),i=indexFn(self,locals),v;ensureSafeMemberName(i,expression);if(!o)return undefined;v = ensureSafeObject(o[i],expression);return v;},{assign:function assign(self,value,locals){var key=ensureSafeMemberName(indexFn(self,locals),expression);var o=ensureSafeObject(obj(self,locals),expression);if(!o)obj.assign(self,o = {},locals);return o[key] = value;}});},functionCall:function functionCall(fnGetter,contextGetter){var argsFn=[];if(this.peekToken().text !== ')'){do {argsFn.push(this.expression());}while(this.expect(','));}this.consume(')');var expressionText=this.text;var args=argsFn.length?[]:null;return function $parseFunctionCall(scope,locals){var context=contextGetter?contextGetter(scope,locals):isDefined(contextGetter)?undefined:scope;var fn=fnGetter(scope,locals,context) || noop;if(args){var i=argsFn.length;while(i--) {args[i] = ensureSafeObject(argsFn[i](scope,locals),expressionText);}}ensureSafeObject(context,expressionText);ensureSafeFunction(fn,expressionText);var v=fn.apply?fn.apply(context,args):fn(args[0],args[1],args[2],args[3],args[4]);if(args){args.length = 0;}return ensureSafeObject(v,expressionText);};},arrayDeclaration:function arrayDeclaration(){var elementFns=[];if(this.peekToken().text !== ']'){do {if(this.peek(']')){break;}elementFns.push(this.expression());}while(this.expect(','));}this.consume(']');return extend(function $parseArrayLiteral(self,locals){var array=[];for(var i=0,ii=elementFns.length;i < ii;i++) {array.push(elementFns[i](self,locals));}return array;},{literal:true,constant:elementFns.every(isConstant),inputs:elementFns});},object:function object(){var keys=[],valueFns=[];if(this.peekToken().text !== '}'){do {if(this.peek('}')){break;}var token=this.consume();if(token.constant){keys.push(token.value);}else if(token.identifier){keys.push(token.text);}else {this.throwError('invalid key',token);}this.consume(':');valueFns.push(this.expression());}while(this.expect(','));}this.consume('}');return extend(function $parseObjectLiteral(self,locals){var object={};for(var i=0,ii=valueFns.length;i < ii;i++) {object[keys[i]] = valueFns[i](self,locals);}return object;},{literal:true,constant:valueFns.every(isConstant),inputs:valueFns});}};function setter(obj,locals,path,setValue,fullExp){ensureSafeObject(obj,fullExp);ensureSafeObject(locals,fullExp);var element=path.split('.'),key;for(var i=0;element.length > 1;i++) {key = ensureSafeMemberName(element.shift(),fullExp);var propertyObj=i === 0 && locals && locals[key] || obj[key];if(!propertyObj){propertyObj = {};obj[key] = propertyObj;}obj = ensureSafeObject(propertyObj,fullExp);}key = ensureSafeMemberName(element.shift(),fullExp);ensureSafeObject(obj[key],fullExp);obj[key] = setValue;return setValue;}var getterFnCacheDefault=createMap();var getterFnCacheExpensive=createMap();function isPossiblyDangerousMemberName(name){return name == 'constructor';}function cspSafeGetterFn(key0,key1,key2,key3,key4,fullExp,expensiveChecks){ensureSafeMemberName(key0,fullExp);ensureSafeMemberName(key1,fullExp);ensureSafeMemberName(key2,fullExp);ensureSafeMemberName(key3,fullExp);ensureSafeMemberName(key4,fullExp);var eso=function eso(o){return ensureSafeObject(o,fullExp);};var eso0=expensiveChecks || isPossiblyDangerousMemberName(key0)?eso:identity;var eso1=expensiveChecks || isPossiblyDangerousMemberName(key1)?eso:identity;var eso2=expensiveChecks || isPossiblyDangerousMemberName(key2)?eso:identity;var eso3=expensiveChecks || isPossiblyDangerousMemberName(key3)?eso:identity;var eso4=expensiveChecks || isPossiblyDangerousMemberName(key4)?eso:identity;return function cspSafeGetter(scope,locals){var pathVal=locals && locals.hasOwnProperty(key0)?locals:scope;if(pathVal == null)return pathVal;pathVal = eso0(pathVal[key0]);if(!key1)return pathVal;if(pathVal == null)return undefined;pathVal = eso1(pathVal[key1]);if(!key2)return pathVal;if(pathVal == null)return undefined;pathVal = eso2(pathVal[key2]);if(!key3)return pathVal;if(pathVal == null)return undefined;pathVal = eso3(pathVal[key3]);if(!key4)return pathVal;if(pathVal == null)return undefined;pathVal = eso4(pathVal[key4]);return pathVal;};}function getterFnWithEnsureSafeObject(fn,fullExpression){return function(s,l){return fn(s,l,ensureSafeObject,fullExpression);};}function getterFn(path,options,fullExp){var expensiveChecks=options.expensiveChecks;var getterFnCache=expensiveChecks?getterFnCacheExpensive:getterFnCacheDefault;var fn=getterFnCache[path];if(fn)return fn;var pathKeys=path.split('.'),pathKeysLength=pathKeys.length;if(options.csp){if(pathKeysLength < 6){fn = cspSafeGetterFn(pathKeys[0],pathKeys[1],pathKeys[2],pathKeys[3],pathKeys[4],fullExp,expensiveChecks);}else {fn = function cspSafeGetter(scope,locals){var i=0,val;do {val = cspSafeGetterFn(pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],pathKeys[i++],fullExp,expensiveChecks)(scope,locals);locals = undefined;scope = val;}while(i < pathKeysLength);return val;};}}else {var code='';if(expensiveChecks){code += 's = eso(s, fe);\nl = eso(l, fe);\n';}var needsEnsureSafeObject=expensiveChecks;forEach(pathKeys,function(key,index){ensureSafeMemberName(key,fullExp);var lookupJs=(index?'s':'((l&&l.hasOwnProperty("' + key + '"))?l:s)') + '.' + key;if(expensiveChecks || isPossiblyDangerousMemberName(key)){lookupJs = 'eso(' + lookupJs + ', fe)';needsEnsureSafeObject = true;}code += 'if(s == null) return undefined;\n' + 's=' + lookupJs + ';\n';});code += 'return s;';var evaledFnGetter=new Function('s','l','eso','fe',code);evaledFnGetter.toString = valueFn(code);if(needsEnsureSafeObject){evaledFnGetter = getterFnWithEnsureSafeObject(evaledFnGetter,fullExp);}fn = evaledFnGetter;}fn.sharedGetter = true;fn.assign = function(self,value,locals){return setter(self,locals,path,value,path);};getterFnCache[path] = fn;return fn;}var objectValueOf=Object.prototype.valueOf;function getValueOf(value){return isFunction(value.valueOf)?value.valueOf():objectValueOf.call(value);}function $ParseProvider(){var cacheDefault=createMap();var cacheExpensive=createMap();this.$get = ['$filter','$sniffer',function($filter,$sniffer){var $parseOptions={csp:$sniffer.csp,expensiveChecks:false},$parseOptionsExpensive={csp:$sniffer.csp,expensiveChecks:true};function wrapSharedExpression(exp){var wrapped=exp;if(exp.sharedGetter){wrapped = function $parseWrapper(self,locals){return exp(self,locals);};wrapped.literal = exp.literal;wrapped.constant = exp.constant;wrapped.assign = exp.assign;}return wrapped;}return function $parse(exp,interceptorFn,expensiveChecks){var parsedExpression,oneTime,cacheKey;switch(typeof exp){case 'string':cacheKey = exp = exp.trim();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 = wrapSharedExpression(parsedExpression);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 addInterceptor(noop,interceptorFn);}};function collectExpressionInputs(inputs,list){for(var i=0,ii=inputs.length;i < ii;i++) {var input=inputs[i];if(!input.constant){if(input.inputs){collectExpressionInputs(input.inputs,list);}else if(list.indexOf(input) === -1){list.push(input);}}}return list;}function expressionInputDirtyCheck(newValue,oldValueOfValue){if(newValue == null || oldValueOfValue == null){return newValue === oldValueOfValue;}if(typeof newValue === 'object'){newValue = getValueOf(newValue);if(typeof newValue === 'object'){return false;}}return newValue === oldValueOfValue || newValue !== newValue && oldValueOfValue !== oldValueOfValue;}function inputsWatchDelegate(scope,listener,objectEquality,parsedExpression){var inputExpressions=parsedExpression.$$inputs || (parsedExpression.$$inputs = collectExpressionInputs(parsedExpression.inputs,[]));var lastResult;if(inputExpressions.length === 1){var oldInputValue=expressionInputDirtyCheck;inputExpressions = inputExpressions[0];return scope.$watch(function expressionInputWatch(scope){var newInputValue=inputExpressions(scope);if(!expressionInputDirtyCheck(newInputValue,oldInputValue)){lastResult = parsedExpression(scope);oldInputValue = newInputValue && getValueOf(newInputValue);}return lastResult;},listener,objectEquality);}var oldInputValueOfValues=[];for(var i=0,ii=inputExpressions.length;i < ii;i++) {oldInputValueOfValues[i] = expressionInputDirtyCheck;}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]))){oldInputValueOfValues[i] = newInputValue && getValueOf(newInputValue);}}if(changed){lastResult = parsedExpression(scope);}return lastResult;},listener,objectEquality);}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){var value=parsedExpression(scope,locals);return interceptorFn(value,scope,locals);}:function oneTimeInterceptedExpression(scope,locals){var value=parsedExpression(scope,locals);var result=interceptorFn(value,scope,locals);return isDefined(value)?result:value;};if(parsedExpression.$$watchDelegate && parsedExpression.$$watchDelegate !== inputsWatchDelegate){fn.$$watchDelegate = parsedExpression.$$watchDelegate;}else if(!interceptorFn.$stateful){fn.$$watchDelegate = inputsWatchDelegate;fn.inputs = [parsedExpression];}return fn;}}];}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);}];}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)];}var defer=function defer(){return new Deferred();};function Promise(){this.$$state = {status:0};}Promise.prototype = {then:function then(onFulfilled,onRejected,progressBack){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 _catch(callback){return this.then(null,callback);},'finally':function _finally(callback,progressBack){return this.then(function(value){return handleCallback(value,true,callback);},function(error){return handleCallback(error,false,callback);},progressBack);}};function simpleBind(context,fn){return function(value){fn.call(context,value);};}function processQueue(state){var fn,promise,pending;pending = state.pending;state.processScheduled = false;state.pending = undefined;for(var i=0,ii=pending.length;i < ii;++i) {promise = pending[i][0];fn = pending[i][state.status];try{if(isFunction(fn)){promise.resolve(fn(state.value));}else if(state.status === 1){promise.resolve(state.value);}else {promise.reject(state.value);}}catch(e) {promise.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();this.resolve = simpleBind(this,this.resolve);this.reject = simpleBind(this,this.reject);this.notify = simpleBind(this,this.notify);}Deferred.prototype = {resolve:function resolve(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 $$resolve(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 reject(reason){if(this.promise.$$state.status)return;this.$$reject(reason);},$$reject:function $$reject(reason){this.promise.$$state.value = reason;this.promise.$$state.status = 2;scheduleProcessQueue(this.promise.$$state);},notify:function notify(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);}}});}}};var reject=function reject(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);}};var when=function when(value,callback,errback,progressBack){var result=new Deferred();result.resolve(value);return result.promise.then(callback,errback,progressBack);};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)){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.all = all;return $Q;}function $$RAFProvider(){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);return function(){$timeout.cancel(timer);};};raf.supported = rafSupported;return raf;}];}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;}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.$$isolateBindings = null;}Scope.prototype = {constructor:Scope,$new:function $new(isolate,parent){var child;parent = parent || this;if(isolate){child = new Scope();child.$root = this.$root;}else {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;}if(isolate || parent != this)child.$on('$destroy',destroyChildScope);return child;},$watch:function $watch(watchExp,listener,objectEquality){var get=$parse(watchExp);if(get.$$watchDelegate){return get.$$watchDelegate(this,listener,objectEquality,get);}var scope=this,array=scope.$$watchers,watcher={fn:listener,last:initWatchVal,get:get,exp:watchExp,eq:!!objectEquality};lastDirtyWatch = null;if(!isFunction(listener)){watcher.fn = noop;}if(!array){array = scope.$$watchers = [];}array.unshift(watcher);return function deregisterWatch(){arrayRemove(array,watcher);lastDirtyWatch = null;};},$watchGroup:function $watchGroup(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){var shouldCall=true;self.$evalAsync(function(){if(shouldCall)listener(newValues,newValues,self);});return function deregisterWatchGroup(){shouldCall = false;};}if(watchExpressions.length === 1){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()();}};},$watchCollection:function $watchCollection(obj,listener){$watchCollectionInterceptor.$stateful = true;var self=this;var newValue;var oldValue;var veryOldValue;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(isUndefined(newValue))return;if(!isObject(newValue)){if(oldValue !== newValue){oldValue = newValue;changeDetected++;}}else if(isArrayLike(newValue)){if(oldValue !== internalArray){oldValue = internalArray;oldLength = oldValue.length = 0;changeDetected++;}newLength = newValue.length;if(oldLength !== newLength){changeDetected++;oldValue.length = oldLength = newLength;}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){oldValue = internalObject = {};oldLength = 0;changeDetected++;}newLength = 0;for(key in newValue) {if(newValue.hasOwnProperty(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){changeDetected++;for(key in oldValue) {if(!newValue.hasOwnProperty(key)){oldLength--;delete oldValue[key];}}}}return changeDetected;}function $watchCollectionAction(){if(initRun){initRun = false;listener(newValue,newValue,self);}else {listener(newValue,veryOldValue,self);}if(trackVeryOldValue){if(!isObject(newValue)){veryOldValue = newValue;}else if(isArrayLike(newValue)){veryOldValue = new Array(newValue.length);for(var i=0;i < newValue.length;i++) {veryOldValue[i] = newValue[i];}}else {veryOldValue = {};for(var key in newValue) {if(hasOwnProperty.call(newValue,key)){veryOldValue[key] = newValue[key];}}}}}return this.$watch(changeDetector,$watchCollectionAction);},$digest:function $digest(){var watch,value,last,watchers,length,dirty,ttl=TTL,next,current,target=this,watchLog=[],logIdx,logMsg,asyncTask;beginPhase('$digest');$browser.$$checkUrlChange();if(this === $rootScope && applyAsyncId !== null){$browser.defer.cancel(applyAsyncId);flushApplyAsync();}lastDirtyWatch = null;do {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 {if(watchers = current.$$watchers){length = watchers.length;while(length--) {try{watch = watchers[length];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){dirty = false;break traverseScopesLoop;}}}catch(e) {$exceptionHandler(e);}}}if(!(next = current.$$childHead || current !== target && current.$$nextSibling)){while(current !== target && !(next = current.$$nextSibling)) {current = current.$parent;}}}while(current = next);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);}}},$destroy:function $destroy(){if(this.$$destroyed)return;var parent=this.$parent;this.$broadcast('$destroy');this.$$destroyed = true;if(this === $rootScope)return;for(var eventName in this.$$listenerCount) {decrementListenerCount(this,this.$$listenerCount[eventName],eventName);}if(parent.$$childHead == this)parent.$$childHead = this.$$nextSibling;if(parent.$$childTail == this)parent.$$childTail = this.$$prevSibling;if(this.$$prevSibling)this.$$prevSibling.$$nextSibling = this.$$nextSibling;if(this.$$nextSibling)this.$$nextSibling.$$prevSibling = this.$$prevSibling;this.$destroy = this.$digest = this.$apply = this.$evalAsync = this.$applyAsync = noop;this.$on = this.$watch = this.$watchGroup = function(){return noop;};this.$$listeners = {};this.$parent = this.$$nextSibling = this.$$prevSibling = this.$$childHead = this.$$childTail = this.$root = this.$$watchers = null;},$eval:function $eval(expr,locals){return $parse(expr)(this,locals);},$evalAsync:function $evalAsync(expr,locals){if(!$rootScope.$$phase && !asyncQueue.length){$browser.defer(function(){if(asyncQueue.length){$rootScope.$digest();}});}asyncQueue.push({scope:this,expression:expr,locals:locals});},$$postDigest:function $$postDigest(fn){postDigestQueue.push(fn);},$apply:function $apply(expr){try{beginPhase('$apply');return this.$eval(expr);}catch(e) {$exceptionHandler(e);}finally {clearPhase();try{$rootScope.$digest();}catch(e) {$exceptionHandler(e);throw e;}}},$applyAsync:function $applyAsync(expr){var scope=this;expr && applyAsyncQueue.push($applyAsyncExpression);scheduleApplyAsync();function $applyAsyncExpression(){scope.$eval(expr);}},$on:function $on(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);}};},$emit:function $emit(name,args){var empty=[],namedListeners,scope=this,_stopPropagation=false,event={name:name,targetScope:scope,stopPropagation:function stopPropagation(){_stopPropagation = true;},preventDefault:function preventDefault(){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(!namedListeners[i]){namedListeners.splice(i,1);i--;length--;continue;}try{namedListeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}if(_stopPropagation){event.currentScope = null;return event;}scope = scope.$parent;}while(scope);event.currentScope = null;return event;},$broadcast:function $broadcast(name,args){var target=this,current=target,next=target,event={name:name,targetScope:target,preventDefault:function preventDefault(){event.defaultPrevented = true;},defaultPrevented:false};if(!target.$$listenerCount[name])return event;var listenerArgs=concat([event],arguments,1),listeners,i,length;while(current = next) {event.currentScope = current;listeners = current.$$listeners[name] || [];for(i = 0,length = listeners.length;i < length;i++) {if(!listeners[i]){listeners.splice(i,1);i--;length--;continue;}try{listeners[i].apply(null,listenerArgs);}catch(e) {$exceptionHandler(e);}}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();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 decrementListenerCount(current,count,name){do {current.$$listenerCount[name] -= count;if(current.$$listenerCount[name] === 0){delete current.$$listenerCount[name];}}while(current = current.$parent);}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);});}}}];}function $$SanitizeUriProvider(){var aHrefSanitizationWhitelist=/^\s*(https?|ftp|mailto|tel|file):/,imgSrcSanitizationWhitelist=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist = function(regexp){if(isDefined(regexp)){aHrefSanitizationWhitelist = regexp;return this;}return aHrefSanitizationWhitelist;};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;};};}var $sceMinErr=minErr('$sce');var SCE_CONTEXTS={HTML:'html',CSS:'css',URL:'url',RESOURCE_URL:'resourceUrl',JS:'js'};function adjustMatcher(matcher){if(matcher === 'self'){return matcher;}else if(isString(matcher)){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)){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;}function $SceDelegateProvider(){this.SCE_CONTEXTS = SCE_CONTEXTS;var resourceUrlWhitelist=['self'],resourceUrlBlacklist=[];this.resourceUrlWhitelist = function(value){if(arguments.length){resourceUrlWhitelist = adjustMatchers(value);}return resourceUrlWhitelist;};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 {return !!matcher.exec(parsedUrl.href);}}function isResourceUrlAllowedByPolicy(url){var parsedUrl=urlResolve(url.toString());var i,n,allowed=false;for(i = 0,n = resourceUrlWhitelist.length;i < n;i++) {if(matchUrl(resourceUrlWhitelist[i],parsedUrl)){allowed = true;break;}}if(allowed){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]);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 || trustedValue === undefined || trustedValue === ''){return trustedValue;}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);}function valueOf(maybeTrusted){if(maybeTrusted instanceof trustedValueHolderBase){return maybeTrusted.$$unwrapTrustedValue();}else {return maybeTrusted;}}function getTrusted(type,maybeTrusted){if(maybeTrusted === null || maybeTrusted === undefined || maybeTrusted === ''){return maybeTrusted;}var constructor=byType.hasOwnProperty(type)?byType[type]:null;if(constructor && maybeTrusted instanceof constructor){return maybeTrusted.$$unwrapTrustedValue();}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};}];}function $SceProvider(){var enabled=true;this.enabled = function(value){if(arguments.length){enabled = !!value;}return enabled;};this.$get = ['$parse','$sceDelegate',function($parse,$sceDelegate){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 to the top of your HTML ' + 'document. See http://docs.angularjs.org/api/ng.$sce for more information.');}var sce=shallowCopy(SCE_CONTEXTS);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;}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);});}};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;}];}function $SnifferProvider(){this.$get = ['$window','$document',function($window,$document){var eventSupport={},android=int((/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(document.body.style.webkitTransition);animations = isString(document.body.style.webkitAnimation);}}return {history:!!($window.history && $window.history.pushState && !(android < 4) && !boxee),hasEvent:function hasEvent(event){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');function $TemplateRequestProvider(){this.$get = ['$templateCache','$http','$q',function($templateCache,$http,$q){function handleRequestFn(tpl,ignoreRequestError){handleRequestFn.totalPendingRequests++;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){return response.data;},handleError);function handleError(resp){if(!ignoreRequestError){throw $compileMinErr('tpload','Failed to load template: {0}',tpl);}return $q.reject(resp);}}handleRequestFn.totalPendingRequests = 0;return handleRequestFn;}];}function $$TestabilityProvider(){this.$get = ['$rootScope','$browser','$location',function($rootScope,$browser,$location){var testability={};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;};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;}}};testability.getLocation = function(){return $location.url();};testability.setLocation = function(url){if(url !== $location.url()){$location.url(url);$rootScope.$digest();}};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={};function timeout(fn,delay,invokeApply){var skipApply=isDefined(invokeApply) && !invokeApply,deferred=(skipApply?$$q:$q).defer(),promise=deferred.promise,timeoutId;timeoutId = $browser.defer(function(){try{deferred.resolve(fn());}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;}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;}];}var urlParsingNode=document.createElement('a');var originUrl=urlResolve(window.location.href);function urlResolve(url){var href=url;if(msie){urlParsingNode.setAttribute('href',href);href = urlParsingNode.href;}urlParsingNode.setAttribute('href',href);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};}function urlIsSameOrigin(requestUrl){var parsed=isString(requestUrl)?urlResolve(requestUrl):requestUrl;return parsed.protocol === originUrl.protocol && parsed.host === originUrl.host;}function $WindowProvider(){this.$get = valueFn(window);}$FilterProvider.$inject = ['$provide'];function $FilterProvider($provide){var suffix='Filter';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);};}];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);}function filterFilter(){return function(array,expression,comparator){if(!isArray(array))return array;var predicateFn;var matchAgainstAnyProp;switch(typeof expression){case 'function':predicateFn = expression;break;case 'boolean':case 'number':case 'string':matchAgainstAnyProp = true;case 'object':predicateFn = createPredicateFn(expression,comparator,matchAgainstAnyProp);break;default:return array;}return array.filter(predicateFn);};}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(isObject(actual) || isObject(expected)){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(_x3,_x4,_x5,_x6,_x7){var _again2=true;_function2: while(_again2) {var actual=_x3,expected=_x4,comparator=_x5,matchAgainstAnyProp=_x6,dontMatchWholeObject=_x7;actualType = expectedType = key = expectedVal = matchAnyProperty = actualVal = undefined;_again2 = false;var actualType=actual !== null?typeof actual:'null';var expectedType=expected !== null?typeof expected:'null';if(expectedType === 'string' && expected.charAt(0) === '!'){return !deepCompare(actual,expected.substring(1),comparator,matchAgainstAnyProp);}else if(isArray(actual)){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;}}if(dontMatchWholeObject){return false;}else {_x3 = actual;_x4 = expected;_x5 = comparator;_x6 = false;_again2 = true;continue _function2;}}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);}}}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;}return amount == null?amount:formatNumber(amount,formats.PATTERNS[1],formats.GROUP_SEP,formats.DECIMAL_SEP,fractionSize).replace(/\u00A4/g,currencySymbol);};}numberFilter.$inject = ['$locale'];function numberFilter($locale){var formats=$locale.NUMBER_FORMATS;return function(number,fractionSize){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(!isFinite(number) || isObject(number))return '';var isNegative=number < 0;number = Math.abs(number);var numStr=number + '',formatedText='',parts=[];var hasExponent=false;if(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(!hasExponent){var fractionLen=(numStr.split(DECIMAL_SEP)[1] || '').length;if(isUndefined(fractionSize)){fractionSize = Math.min(Math.max(pattern.minFrac,fractionLen),pattern.maxFrac);}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);}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);}}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){var zone=-1 * date.getTimezoneOffset();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){var dayOfWeekOnFirst=new Date(year,0,1).getDay();return new Date(year,0,(dayOfWeekOnFirst <= 4?5:12) - dayOfWeekOnFirst);}function getThursdayThisWeek(datetime){return new Date(datetime.getFullYear(),datetime.getMonth(),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);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),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+$/;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))?)?$/;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 = int(match[9] + match[10]);tzMin = int(match[9] + match[11]);}dateSetter.call(date,int(match[1]),int(match[2]) - 1,int(match[3]));var h=int(match[4] || 0) - tzHour;var m=int(match[5] || 0) - tzMin;var s=int(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)?int(date):jsonStringToDate(date);}if(isNumber(date)){date = new Date(date);}if(!isDate(date)){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;}}if(timezone && timezone === 'UTC'){date = new Date(date.getTime());date.setMinutes(date.getMinutes() + date.getTimezoneOffset());}forEach(parts,function(value){fn = DATE_FORMATS[value];text += fn?fn(date,$locale.DATETIME_FORMATS):value.replace(/(^'|'$)/g,'').replace(/''/g,'\'');});return text;};}function jsonFilter(){return function(object,spacing){if(isUndefined(spacing)){spacing = 2;}return toJson(object,spacing);};}var lowercaseFilter=valueFn(lowercase);var uppercaseFilter=valueFn(uppercase);function limitToFilter(){return function(input,limit){if(isNumber(input))input = input.toString();if(!isArray(input) && !isString(input))return input;if(Math.abs(Number(limit)) === Infinity){limit = Number(limit);}else {limit = int(limit);}if(limit){return limit > 0?input.slice(0,limit):input.slice(limit);}else {return isString(input)?'':[];}};}orderByFilter.$inject = ['$parse'];function orderByFilter($parse){return function(array,sortPredicate,reverseOrder){if(!isArrayLike(array))return array;sortPredicate = isArray(sortPredicate)?sortPredicate:[sortPredicate];if(sortPredicate.length === 0){sortPredicate = ['+'];}sortPredicate = sortPredicate.map(function(predicate){var descending=false,get=predicate || identity;if(isString(predicate)){if(predicate.charAt(0) == '+' || predicate.charAt(0) == '-'){descending = predicate.charAt(0) == '-';predicate = predicate.substring(1);}if(predicate === ''){return reverseComparator(compare,descending);}get = $parse(predicate);if(get.constant){var key=get();return reverseComparator(function(a,b){return compare(a[key],b[key]);},descending);}}return reverseComparator(function(a,b){return compare(get(a),get(b));},descending);});return slice.call(array).sort(reverseComparator(comparator,reverseOrder));function comparator(o1,o2){for(var i=0;i < sortPredicate.length;i++) {var comp=sortPredicate[i](o1,o2);if(comp !== 0)return comp;}return 0;}function reverseComparator(comp,descending){return descending?function(a,b){return comp(b,a);}:comp;}function isPrimitive(value){switch(typeof value){case 'number':case 'boolean':case 'string':return true;default:return false;}}function objectToString(value){if(value === null)return 'null';if(typeof value.valueOf === 'function'){value = value.valueOf();if(isPrimitive(value))return value;}if(typeof value.toString === 'function'){value = value.toString();if(isPrimitive(value))return value;}return '';}function compare(v1,v2){var t1=typeof v1;var t2=typeof v2;if(t1 === t2 && t1 === 'object'){v1 = objectToString(v1);v2 = objectToString(v2);}if(t1 === t2){if(t1 === 'string'){v1 = v1.toLowerCase();v2 = v2.toLowerCase();}if(v1 === v2)return 0;return v1 < v2?-1:1;}else {return t1 < t2?-1:1;}}};}function ngDirective(directive){if(isFunction(directive)){directive = {link:directive};}directive.restrict = directive.restrict || 'AC';return valueFn(directive);}var htmlAnchorDirective=valueFn({restrict:'E',compile:function compile(element,attr){if(!attr.href && !attr.xlinkHref && !attr.name){return function(scope,element){if(element[0].nodeName.toLowerCase() !== 'a')return;var href=toString.call(element.prop('href')) === '[object SVGAnimatedString]'?'xlink:href':'href';element.on('click',function(event){if(!element.attr(href)){event.preventDefault();}});};}}});var ngAttributeAliasDirectives={};forEach(BOOLEAN_ATTR,function(propName,attrName){if(propName == 'multiple')return;var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {restrict:'A',priority:100,link:function link(scope,element,attr){scope.$watch(attr[normalized],function ngBooleanAttrWatchAction(value){attr.$set(attrName,!!value);});}};};});forEach(ALIASED_ATTR,function(htmlAttr,ngAttr){ngAttributeAliasDirectives[ngAttr] = function(){return {priority:100,link:function link(scope,element,attr){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);});}};};});forEach(['src','srcset','href'],function(attrName){var normalized=directiveNormalize('ng-' + attrName);ngAttributeAliasDirectives[normalized] = function(){return {priority:99,link:function link(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);if(msie && propName)element.prop(propName,attr[name]);});}};};});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;}FormController.$inject = ['$element','$attrs','$scope','$animate','$interpolate'];function FormController(element,attrs,$scope,$animate,$interpolate){var form=this,controls=[];var parentForm=form.$$parentForm = element.parent().controller('form') || nullFormCtrl;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;parentForm.$addControl(form);form.$rollbackViewValue = function(){forEach(controls,function(control){control.$rollbackViewValue();});};form.$commitViewValue = function(){forEach(controls,function(control){control.$commitViewValue();});};form.$addControl = function(control){assertNotHasOwnProperty(control.$name,'input');controls.push(control);if(control.$name){form[control.$name] = control;}};form.$$renameControl = function(control,newName){var oldName=control.$name;if(form[oldName] === control){delete form[oldName];}form[newName] = control;control.$name = newName;};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);};addSetValidityMethod({ctrl:this,$element:element,set:function set(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 unset(object,property,controller){var list=object[property];if(!list){return;}arrayRemove(list,controller);if(list.length === 0){delete object[property];}},parentForm:parentForm,$animate:$animate});form.$setDirty = function(){$animate.removeClass(element,PRISTINE_CLASS);$animate.addClass(element,DIRTY_CLASS);form.$dirty = true;form.$pristine = false;parentForm.$setDirty();};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();});};form.$setUntouched = function(){forEach(controls,function(control){control.$setUntouched();});};form.$setSubmitted = function(){$animate.addClass(element,SUBMITTED_CLASS);form.$submitted = true;parentForm.$setSubmitted();};}var formDirectiveFactory=function formDirectiveFactory(isNgForm){return ['$timeout',function($timeout){var formDirective={name:'form',restrict:isNgForm?'EAC':'E',controller:FormController,compile:function ngFormCompile(formElement,attr){formElement.addClass(PRISTINE_CLASS).addClass(VALID_CLASS);var nameAttr=attr.name?'name':isNgForm && attr.ngForm?'ngForm':false;return {pre:function ngFormPreLink(scope,formElement,attr,controller){if(!('action' in attr)){var handleFormSubmission=function handleFormSubmission(event){scope.$apply(function(){controller.$commitViewValue();controller.$setSubmitted();});event.preventDefault();};addEventListenerFn(formElement[0],'submit',handleFormSubmission);formElement.on('$destroy',function(){$timeout(function(){removeEventListenerFn(formElement[0],'submit',handleFormSubmission);},0,false);});}var parentFormCtrl=controller.$$parentForm;if(nameAttr){setter(scope,null,controller.$name,controller,controller.$name);attr.$observe(nameAttr,function(newValue){if(controller.$name === newValue)return;setter(scope,null,controller.$name,undefined,controller.$name);parentFormCtrl.$$renameControl(controller,newValue);setter(scope,null,controller.$name,controller,controller.$name);});}formElement.on('$destroy',function(){parentFormCtrl.$removeControl(controller);if(nameAttr){setter(scope,null,attr[nameAttr],undefined,controller.$name);}extend(controller,nullFormCtrl);});}};}};return formDirective;}];};var formDirective=formDirectiveFactory();var ngFormDirective=formDirectiveFactory(true);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*)))\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={'text':textInputType,'date':createDateInputType('date',DATE_REGEXP,createDateParser(DATE_REGEXP,['yyyy','MM','dd']),'yyyy-MM-dd'),'datetime-local':createDateInputType('datetimelocal',DATETIMELOCAL_REGEXP,createDateParser(DATETIMELOCAL_REGEXP,['yyyy','MM','dd','HH','mm','ss','sss']),'yyyy-MM-ddTHH:mm:ss.sss'),'time':createDateInputType('time',TIME_REGEXP,createDateParser(TIME_REGEXP,['HH','mm','ss','sss']),'HH:mm:ss.sss'),'week':createDateInputType('week',WEEK_REGEXP,weekParser,'yyyy-Www'),'month':createDateInputType('month',MONTH_REGEXP,createDateParser(MONTH_REGEXP,['yyyy','MM']),'yyyy-MM'),'number':numberInputType,'url':urlInputType,'email':emailInputType,'radio':radioInputType,'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);if(!$sniffer.android){var composing=false;element.on('compositionstart',function(data){composing = true;});element.on('compositionend',function(){composing = false;listener();});}var listener=function listener(ev){if(timeout){$browser.defer.cancel(timeout);timeout = null;}if(composing)return;var value=element.val(),event=ev && ev.type;if(type !== 'password' && (!attr.ngTrim || attr.ngTrim !== 'false')){value = trim(value);}if(ctrl.$viewValue !== value || value === '' && ctrl.$$hasNativeValidators){ctrl.$setViewValue(value,event);}};if($sniffer.hasEvent('input')){element.on('input',listener);}else {var timeout;var deferListener=function deferListener(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;if(key === 91 || 15 < key && key < 19 || 37 <= key && key <= 40)return;deferListener(event,this,this.value);});if($sniffer.hasEvent('paste')){element.on('paste cut',deferListener);}}element.on('change',listener);ctrl.$render = function(){element.val(ctrl.$isEmpty(ctrl.$viewValue)?'':ctrl.$viewValue);};}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)){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)){var parsedDate=parseDate(value,previousDate);if(timezone === 'UTC'){parsedDate.setMinutes(parsedDate.getMinutes() - parsedDate.getTimezoneOffset());}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 === 'UTC'){var timezoneOffset=60000 * previousDate.getTimezoneOffset();previousDate = new Date(previousDate.getTime() + timezoneOffset);}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){return value && !(value.getTime && value.getTime() !== value.getTime());}function parseObservedDateValue(val){return isDefined(val)?isDate(val)?val:parseDate(val):undefined;}};}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) || {};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;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;ctrl.$validate();});}}function urlInputType(scope,element,attr,ctrl,$sniffer,$browser){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){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){if(isUndefined(attr.name)){element.attr('name',nextUid());}var listener=function listener(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 minErr('ngModel')('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 listener(ev){ctrl.$setViewValue(element[0].checked,ev && ev.type);};element.on('click',listener);ctrl.$render = function(){element[0].checked = ctrl.$viewValue;};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;});}var inputDirective=['$browser','$sniffer','$filter','$parse',function($browser,$sniffer,$filter,$parse){return {restrict:'E',require:['?ngModel'],link:{pre:function pre(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+)$/;var ngValueDirective=function ngValueDirective(){return {restrict:'A',priority:100,compile:function compile(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);});};}}};};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 = value === undefined?'':value;});};}};}];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 = value === undefined?'':value;});};}};}];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(){element.html($sce.getTrustedHtml(ngBindHtmlGetter(scope)) || '');});};}};}];var ngChangeDirective=valueFn({restrict:'A',require:'ngModel',link:function link(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 link(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){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){var classCounts=element.data('$classCounts') || {};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){if(isArray(classVal)){return classVal;}else if(isString(classVal)){return classVal.split(' ');}else if(isObject(classVal)){var classes=[];forEach(classVal,function(v,k){if(v){classes = classes.concat(k.split(' '));}});return classes;}return classVal;}}];}var ngClassDirective=classDirective('',true);var ngClassOddDirective=classDirective('Odd',0);var ngClassEvenDirective=classDirective('Even',1);var ngCloakDirective=ngDirective({compile:function compile(element,attr){attr.$set('ngCloak',undefined);element.removeClass('ng-cloak');}});var ngControllerDirective=[function(){return {restrict:'A',scope:true,controller:'@',priority:500};}];var ngEventDirectives={};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 compile($element,attr){var fn=$parse(attr[directiveName],null,true);return function ngEventHandler(scope,element){element.on(eventName,function(event){var callback=function callback(){fn(scope,{$event:event});};if(forceAsyncEvents[eventName] && $rootScope.$$phase){scope.$evalAsync(callback);}else {scope.$apply(callback);}});};}};}];});var ngIfDirective=['$animate',function($animate){return {multiElement:true,transclude:'element',priority:600,terminal:true,restrict:'A',$$tlb:true,link:function link($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 + ' ');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;}}});}};}];var ngIncludeDirective=['$templateRequest','$anchorScroll','$animate','$sce',function($templateRequest,$anchorScroll,$animate,$sce){return {restrict:'ECA',priority:400,terminal:true,transclude:'element',controller:angular.noop,compile:function compile(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 cleanupLastIncludeContent(){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($sce.parseAsResourceUrl(srcExp),function ngIncludeWatchAction(src){var afterAnimation=function afterAnimation(){if(isDefined(autoScrollExp) && (!autoScrollExp || scope.$eval(autoScrollExp))){$anchorScroll();}};var thisChangeId=++changeCounter;if(src){$templateRequest(src,true).then(function(response){if(thisChangeId !== changeCounter)return;var newScope=scope.$new();ctrl.template = response;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;}});};}};}];var ngIncludeFillContentDirective=['$compile',function($compile){return {restrict:'ECA',priority:-400,require:'ngInclude',link:function link(scope,$element,$attr,ctrl){if(/SVG/.test($element[0].toString())){$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);}};}];var ngInitDirective=ngDirective({priority:450,compile:function compile(){return {pre:function pre(scope,element,attrs){scope.$eval(attrs.ngInit);}};}});var ngListDirective=function ngListDirective(){return {restrict:'A',priority:100,require:'ngModel',link:function link(scope,element,attr,ctrl){var ngList=element.attr(attr.$attr.ngList) || ', ';var trimValues=attr.ngTrim !== 'false';var separator=trimValues?trim(ngList):ngList;var parse=function parse(viewValue){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;});ctrl.$isEmpty = function(value){return !value || !value.length;};}};};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=new minErr('ngModel');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;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 = {};this.$$success = {};this.$pending = undefined;this.$name = $interpolate($attr.name || '',false)($scope);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));}};this.$render = noop;this.$isEmpty = function(value){return isUndefined(value) || value === '' || value === null || value !== value;};var parentForm=$element.inheritedData('$formController') || nullFormCtrl,currentValidationRunId=0;addSetValidityMethod({ctrl:this,$element:$element,set:function set(object,property){object[property] = true;},unset:function unset(object,property){delete object[property];},parentForm:parentForm,$animate:$animate});this.$setPristine = function(){ctrl.$dirty = false;ctrl.$pristine = true;$animate.removeClass($element,DIRTY_CLASS);$animate.addClass($element,PRISTINE_CLASS);};this.$setDirty = function(){ctrl.$dirty = true;ctrl.$pristine = false;$animate.removeClass($element,PRISTINE_CLASS);$animate.addClass($element,DIRTY_CLASS);parentForm.$setDirty();};this.$setUntouched = function(){ctrl.$touched = false;ctrl.$untouched = true;$animate.setClass($element,UNTOUCHED_CLASS,TOUCHED_CLASS);};this.$setTouched = function(){ctrl.$touched = true;ctrl.$untouched = false;$animate.setClass($element,TOUCHED_CLASS,UNTOUCHED_CLASS);};this.$rollbackViewValue = function(){$timeout.cancel(pendingDebounce);ctrl.$viewValue = ctrl.$$lastCommittedViewValue;ctrl.$render();};this.$validate = function(){if(isNumber(ctrl.$modelValue) && isNaN(ctrl.$modelValue)){return;}var viewValue=ctrl.$$lastCommittedViewValue;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(!allowInvalid && prevValid !== allValid){ctrl.$modelValue = allValid?modelValue:undefined;if(ctrl.$modelValue !== prevModelValue){ctrl.$$writeModelToScope();}}});};this.$$runValidators = function(modelValue,viewValue,doneCallback){currentValidationRunId++;var localValidationRunId=currentValidationRunId;if(!processParseErrors()){validationDone(false);return;}if(!processSyncValidators()){validationDone(false);return;}processAsyncValidators();function processParseErrors(){var errorKey=ctrl.$$parserName || 'parse';if(parserValid === undefined){setValidity(errorKey,null);}else {if(!parserValid){forEach(ctrl.$validators,function(v,name){setValidity(name,null);});forEach(ctrl.$asyncValidators,function(v,name){setValidity(name,null);});}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);}}};this.$commitViewValue = function(){var viewValue=ctrl.$viewValue;$timeout.cancel(pendingDebounce);if(ctrl.$$lastCommittedViewValue === viewValue && (viewValue !== '' || !ctrl.$$hasNativeValidators)){return;}ctrl.$$lastCommittedViewValue = viewValue;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 = ngModelGet($scope);}var prevModelValue=ctrl.$modelValue;var allowInvalid=ctrl.$options && ctrl.$options.allowInvalid;ctrl.$$rawModelValue = modelValue;if(allowInvalid){ctrl.$modelValue = modelValue;writeToModelIfNeeded();}ctrl.$$runValidators(modelValue,ctrl.$$lastCommittedViewValue,function(allValid){if(!allowInvalid){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);}});};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();});}};$scope.$watch(function ngModelWatch(){var modelValue=ngModelGet($scope);if(modelValue !== ctrl.$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;});}];var ngModelDirective=['$rootScope',function($rootScope){return {restrict:'A',require:['ngModel','^?form','^?ngModelOptions'],controller:NgModelController,priority:1,compile:function ngModelCompile(element){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] || nullFormCtrl;modelCtrl.$$setOptions(ctrls[2] && ctrls[2].$options);formCtrl.$addControl(modelCtrl);attr.$observe('name',function(newValue){if(modelCtrl.$name !== newValue){formCtrl.$$renameControl(modelCtrl,newValue);}});scope.$on('$destroy',function(){formCtrl.$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+|$)/;var ngModelOptionsDirective=function ngModelOptionsDirective(){return {restrict:'A',controller:['$scope','$attrs',function($scope,$attrs){var that=this;this.$options = $scope.$eval($attrs.ngModelOptions);if(this.$options.updateOn !== undefined){this.$options.updateOnDefault = false;this.$options.updateOn = trim(this.$options.updateOn.replace(DEFAULT_REGEXP,function(){that.$options.updateOnDefault = true;return ' ';}));}else {this.$options.updateOnDefault = true;}}]};};function addSetValidityMethod(context){var ctrl=context.ctrl,$element=context.$element,classCache={},set=context.set,unset=context.unset,parentForm=context.parentForm,$animate=context.$animate;classCache[INVALID_CLASS] = !(classCache[VALID_CLASS] = $element.hasClass(VALID_CLASS));ctrl.$setValidity = setValidity;function setValidity(validationErrorKey,state,controller){if(state === undefined){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);}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);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) {return false;}}return true;}var ngNonBindableDirective=ngDirective({terminal:true,priority:1000});var ngPluralizeDirective=['$locale','$interpolate',function($locale,$interpolate){var BRACE=/{}/g,IS_WHEN=/^when(Minus)?(.+)$/;return {restrict:'EA',link:function link(scope,element,attr){var numberExp=attr.count,whenExp=attr.$attr.when && element.attr(attr.$attr.when),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)){count = $locale.pluralCat(count - offset);}if(count !== lastCount && !(countIsNaN && isNaN(lastCount))){watchRemover();watchRemover = scope.$watch(whensExpFns[count],updateElementText);lastCount = count;}});function updateElementText(newText){element.text(newText || '');}}};}];var ngRepeatDirective=['$parse','$animate',function($parse,$animate){var NG_REMOVED='$$NG_REMOVED';var ngRepeatMinErr=minErr('ngRepeat');var updateScope=function updateScope(scope,index,valueIdentifier,value,keyIdentifier,key,arrayLength){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);scope.$odd = !(scope.$even = (index & 1) === 0);};var getBlockStart=function getBlockStart(block){return block.clone[0];};var getBlockEnd=function getBlockEnd(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){if(keyIdentifier)hashFnLocals[keyIdentifier] = key;hashFnLocals[valueIdentifier] = value;hashFnLocals.$index = index;return trackByExpGetter($scope,hashFnLocals);};}var lastBlockMap=createMap();$scope.$watchCollection(rhs,function ngRepeatAction(collection){var index,length,previousNode=$element[0],nextNode,nextBlockMap=createMap(),collectionLength,key,value,trackById,trackByIdFn,collectionKeys,block,nextBlockOrder,elementsToRemove;if(aliasAs){$scope[aliasAs] = collection;}if(isArrayLike(collection)){collectionKeys = collection;trackByIdFn = trackByIdExpFn || trackByIdArrayFn;}else {trackByIdFn = trackByIdExpFn || trackByIdObjFn;collectionKeys = [];for(var itemKey in collection) {if(collection.hasOwnProperty(itemKey) && itemKey.charAt(0) != '$'){collectionKeys.push(itemKey);}}collectionKeys.sort();}collectionLength = collectionKeys.length;nextBlockOrder = new Array(collectionLength);for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];trackById = trackByIdFn(key,value,index);if(lastBlockMap[trackById]){block = lastBlockMap[trackById];delete lastBlockMap[trackById];nextBlockMap[trackById] = block;nextBlockOrder[index] = block;}else if(nextBlockMap[trackById]){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 {nextBlockOrder[index] = {id:trackById,scope:undefined,clone:undefined};nextBlockMap[trackById] = true;}}for(var blockKey in lastBlockMap) {block = lastBlockMap[blockKey];elementsToRemove = getBlockNodes(block.clone);$animate.leave(elementsToRemove);if(elementsToRemove[0].parentNode){for(index = 0,length = elementsToRemove.length;index < length;index++) {elementsToRemove[index][NG_REMOVED] = true;}}block.scope.$destroy();}for(index = 0;index < collectionLength;index++) {key = collection === collectionKeys?index:collectionKeys[index];value = collection[key];block = nextBlockOrder[index];if(block.scope){nextNode = previousNode;do {nextNode = nextNode.nextSibling;}while(nextNode && nextNode[NG_REMOVED]);if(getBlockStart(block) != nextNode){$animate.move(getBlockNodes(block.clone),null,jqLite(previousNode));}previousNode = getBlockEnd(block);updateScope(block.scope,index,valueIdentifier,value,keyIdentifier,key,collectionLength);}else {$transclude(function ngRepeatTransclude(clone,scope){block.scope = scope;var endNode=ngRepeatEndComment.cloneNode(false);clone[clone.length++] = endNode;$animate.enter(clone,null,jqLite(previousNode));previousNode = endNode;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';var ngShowDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngShow,function ngShowWatchAction(value){$animate[value?'removeClass':'addClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngHideDirective=['$animate',function($animate){return {restrict:'A',multiElement:true,link:function link(scope,element,attr){scope.$watch(attr.ngHide,function ngHideWatchAction(value){$animate[value?'addClass':'removeClass'](element,NG_HIDE_CLASS,{tempClasses:NG_HIDE_IN_PROGRESS_CLASS});});}};}];var ngStyleDirective=ngDirective(function(scope,element,attr){scope.$watchCollection(attr.ngStyle,function ngStyleWatchAction(newStyles,oldStyles){if(oldStyles && newStyles !== oldStyles){forEach(oldStyles,function(val,style){element.css(style,'');});}if(newStyles)element.css(newStyles);});});var ngSwitchDirective=['$animate',function($animate){return {restrict:'EA',require:'ngSwitch',controller:['$scope',function ngSwitchController(){this.cases = {};}],link:function link(scope,element,attr,ngSwitchController){var watchExpr=attr.ngSwitch || attr.on,selectedTranscludes=[],selectedElements=[],previousLeaveAnimations=[],selectedScopes=[];var spliceFactory=function spliceFactory(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 link(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 link(scope,element,attr,ctrl,$transclude){ctrl.cases['?'] = ctrl.cases['?'] || [];ctrl.cases['?'].push({transclude:$transclude,element:element});}});var ngTranscludeDirective=ngDirective({restrict:'EAC',link:function link($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);});}});var scriptDirective=['$templateCache',function($templateCache){return {restrict:'E',terminal:true,compile:function compile(element,attr){if(attr.type == 'text/ng-template'){var templateUrl=attr.id,text=element[0].text;$templateCache.put(templateUrl,text);}}};}];var ngOptionsMinErr=minErr('ngOptions');var ngOptionsDirective=valueFn({restrict:'A',terminal:true});var selectDirective=['$compile','$parse',function($compile,$parse){var NG_OPTIONS_REGEXP=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\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]+?))?$/,nullModelCtrl={$setViewValue:noop};return {restrict:'E',require:['select','?ngModel'],controller:['$element','$scope','$attrs',function($element,$scope,$attrs){var self=this,optionsMap={},ngModelCtrl=nullModelCtrl,nullOption,unknownOption;self.databound = $attrs.ngModel;self.init = function(ngModelCtrl_,nullOption_,unknownOption_){ngModelCtrl = ngModelCtrl_;nullOption = nullOption_;unknownOption = unknownOption_;};self.addOption = function(value,element){assertNotHasOwnProperty(value,'"option value"');optionsMap[value] = true;if(ngModelCtrl.$viewValue == value){$element.val(value);if(unknownOption.parent())unknownOption.remove();}if(element && element[0].hasAttribute('selected')){element[0].selected = true;}};self.removeOption = function(value){if(this.hasOption(value)){delete optionsMap[value];if(ngModelCtrl.$viewValue === value){this.renderUnknownOption(value);}}};self.renderUnknownOption = function(val){var unknownVal='? ' + hashKey(val) + ' ?';unknownOption.val(unknownVal);$element.prepend(unknownOption);$element.val(unknownVal);unknownOption.prop('selected',true);};self.hasOption = function(value){return optionsMap.hasOwnProperty(value);};$scope.$on('$destroy',function(){self.renderUnknownOption = noop;});}],link:function link(scope,element,attr,ctrls){if(!ctrls[1])return;var selectCtrl=ctrls[0],ngModelCtrl=ctrls[1],multiple=attr.multiple,optionsExp=attr.ngOptions,nullOption=false,emptyOption,renderScheduled=false,optionTemplate=jqLite(document.createElement('option')),optGroupTemplate=jqLite(document.createElement('optgroup')),unknownOption=optionTemplate.clone();for(var i=0,children=element.children(),ii=children.length;i < ii;i++) {if(children[i].value === ''){emptyOption = nullOption = children.eq(i);break;}}selectCtrl.init(ngModelCtrl,nullOption,unknownOption);if(multiple){ngModelCtrl.$isEmpty = function(value){return !value || value.length === 0;};}if(optionsExp)setupAsOptions(scope,element,ngModelCtrl);else if(multiple)setupAsMultiple(scope,element,ngModelCtrl);else setupAsSingle(scope,element,ngModelCtrl,selectCtrl);function setupAsSingle(scope,selectElement,ngModelCtrl,selectCtrl){ngModelCtrl.$render = function(){var viewValue=ngModelCtrl.$viewValue;if(selectCtrl.hasOption(viewValue)){if(unknownOption.parent())unknownOption.remove();selectElement.val(viewValue);if(viewValue === '')emptyOption.prop('selected',true);}else {if(isUndefined(viewValue) && emptyOption){selectElement.val('');}else {selectCtrl.renderUnknownOption(viewValue);}}};selectElement.on('change',function(){scope.$apply(function(){if(unknownOption.parent())unknownOption.remove();ngModelCtrl.$setViewValue(selectElement.val());});});}function setupAsMultiple(scope,selectElement,ctrl){var lastView;ctrl.$render = function(){var items=new HashMap(ctrl.$viewValue);forEach(selectElement.find('option'),function(option){option.selected = isDefined(items.get(option.value));});};scope.$watch(function selectMultipleWatch(){if(!equals(lastView,ctrl.$viewValue)){lastView = shallowCopy(ctrl.$viewValue);ctrl.$render();}});selectElement.on('change',function(){scope.$apply(function(){var array=[];forEach(selectElement.find('option'),function(option){if(option.selected){array.push(option.value);}});ctrl.$setViewValue(array);});});}function setupAsOptions(scope,selectElement,ctrl){var match;if(!(match = optionsExp.match(NG_OPTIONS_REGEXP))){throw ngOptionsMinErr('iexp','Expected expression in form of ' + '\'_select_ (as _label_)? for (_key_,)?_value_ in _collection_\'' + ' but got \'{0}\'. Element: {1}',optionsExp,startingTag(selectElement));}var displayFn=$parse(match[2] || match[1]),valueName=match[4] || match[6],selectAs=/ as /.test(match[0]) && match[1],selectAsFn=selectAs?$parse(selectAs):null,keyName=match[5],groupByFn=$parse(match[3] || ''),valueFn=$parse(match[2]?match[1]:valueName),valuesFn=$parse(match[7]),track=match[8],trackFn=track?$parse(match[8]):null,trackKeysCache={},optionGroupsCache=[[{element:selectElement,label:''}]],locals={};if(nullOption){$compile(nullOption)(scope);nullOption.removeClass('ng-scope');nullOption.remove();}selectElement.empty();selectElement.on('change',selectionChanged);ctrl.$render = render;scope.$watchCollection(valuesFn,scheduleRendering);scope.$watchCollection(getLabels,scheduleRendering);if(multiple){scope.$watchCollection(function(){return ctrl.$modelValue;},scheduleRendering);}function callExpression(exprFn,key,value){locals[valueName] = value;if(keyName)locals[keyName] = key;return exprFn(scope,locals);}function selectionChanged(){scope.$apply(function(){var collection=valuesFn(scope) || [];var viewValue;if(multiple){viewValue = [];forEach(selectElement.val(),function(selectedKey){selectedKey = trackFn?trackKeysCache[selectedKey]:selectedKey;viewValue.push(getViewValue(selectedKey,collection[selectedKey]));});}else {var selectedKey=trackFn?trackKeysCache[selectElement.val()]:selectElement.val();viewValue = getViewValue(selectedKey,collection[selectedKey]);}ctrl.$setViewValue(viewValue);render();});}function getViewValue(key,value){if(key === '?'){return undefined;}else if(key === ''){return null;}else {var viewValueFn=selectAsFn?selectAsFn:valueFn;return callExpression(viewValueFn,key,value);}}function getLabels(){var values=valuesFn(scope);var toDisplay;if(values && isArray(values)){toDisplay = new Array(values.length);for(var i=0,ii=values.length;i < ii;i++) {toDisplay[i] = callExpression(displayFn,i,values[i]);}return toDisplay;}else if(values){toDisplay = {};for(var prop in values) {if(values.hasOwnProperty(prop)){toDisplay[prop] = callExpression(displayFn,prop,values[prop]);}}}return toDisplay;}function createIsSelectedFn(viewValue){var selectedSet;if(multiple){if(trackFn && isArray(viewValue)){selectedSet = new HashMap([]);for(var trackIndex=0;trackIndex < viewValue.length;trackIndex++) {selectedSet.put(callExpression(trackFn,null,viewValue[trackIndex]),true);}}else {selectedSet = new HashMap(viewValue);}}else if(trackFn){viewValue = callExpression(trackFn,null,viewValue);}return function isSelected(key,value){var compareValueFn;if(trackFn){compareValueFn = trackFn;}else if(selectAsFn){compareValueFn = selectAsFn;}else {compareValueFn = valueFn;}if(multiple){return isDefined(selectedSet.remove(callExpression(compareValueFn,key,value)));}else {return viewValue === callExpression(compareValueFn,key,value);}};}function scheduleRendering(){if(!renderScheduled){scope.$$postDigest(render);renderScheduled = true;}}function updateLabelMap(labelMap,label,added){labelMap[label] = labelMap[label] || 0;labelMap[label] += added?1:-1;}function render(){renderScheduled = false;var optionGroups={'':[]},optionGroupNames=[''],optionGroupName,optionGroup,option,existingParent,existingOptions,existingOption,viewValue=ctrl.$viewValue,values=valuesFn(scope) || [],keys=keyName?sortedKeys(values):values,key,value,groupLength,length,groupIndex,index,labelMap={},selected,isSelected=createIsSelectedFn(viewValue),anySelected=false,lastElement,element,label,optionId;trackKeysCache = {};for(index = 0;length = keys.length,index < length;index++) {key = index;if(keyName){key = keys[index];if(key.charAt(0) === '$')continue;}value = values[key];optionGroupName = callExpression(groupByFn,key,value) || '';if(!(optionGroup = optionGroups[optionGroupName])){optionGroup = optionGroups[optionGroupName] = [];optionGroupNames.push(optionGroupName);}selected = isSelected(key,value);anySelected = anySelected || selected;label = callExpression(displayFn,key,value);label = isDefined(label)?label:'';optionId = trackFn?trackFn(scope,locals):keyName?keys[index]:index;if(trackFn){trackKeysCache[optionId] = key;}optionGroup.push({id:optionId,label:label,selected:selected});}if(!multiple){if(nullOption || viewValue === null){optionGroups[''].unshift({id:'',label:'',selected:!anySelected});}else if(!anySelected){optionGroups[''].unshift({id:'?',label:'',selected:true});}}for(groupIndex = 0,groupLength = optionGroupNames.length;groupIndex < groupLength;groupIndex++) {optionGroupName = optionGroupNames[groupIndex];optionGroup = optionGroups[optionGroupName];if(optionGroupsCache.length <= groupIndex){existingParent = {element:optGroupTemplate.clone().attr('label',optionGroupName),label:optionGroup.label};existingOptions = [existingParent];optionGroupsCache.push(existingOptions);selectElement.append(existingParent.element);}else {existingOptions = optionGroupsCache[groupIndex];existingParent = existingOptions[0];if(existingParent.label != optionGroupName){existingParent.element.attr('label',existingParent.label = optionGroupName);}}lastElement = null;for(index = 0,length = optionGroup.length;index < length;index++) {option = optionGroup[index];if(existingOption = existingOptions[index + 1]){lastElement = existingOption.element;if(existingOption.label !== option.label){updateLabelMap(labelMap,existingOption.label,false);updateLabelMap(labelMap,option.label,true);lastElement.text(existingOption.label = option.label);lastElement.prop('label',existingOption.label);}if(existingOption.id !== option.id){lastElement.val(existingOption.id = option.id);}if(lastElement[0].selected !== option.selected){lastElement.prop('selected',existingOption.selected = option.selected);if(msie){lastElement.prop('selected',existingOption.selected);}}}else {if(option.id === '' && nullOption){element = nullOption;}else {(element = optionTemplate.clone()).val(option.id).prop('selected',option.selected).attr('selected',option.selected).prop('label',option.label).text(option.label);}existingOptions.push(existingOption = {element:element,label:option.label,id:option.id,selected:option.selected});updateLabelMap(labelMap,option.label,true);if(lastElement){lastElement.after(element);}else {existingParent.element.append(element);}lastElement = element;}}index++;while(existingOptions.length > index) {option = existingOptions.pop();updateLabelMap(labelMap,option.label,false);option.element.remove();}}while(optionGroupsCache.length > groupIndex) {optionGroup = optionGroupsCache.pop();for(index = 1;index < optionGroup.length;++index) {updateLabelMap(labelMap,optionGroup[index].label,false);}optionGroup[0].element.remove();}forEach(labelMap,function(count,label){if(count > 0){selectCtrl.addOption(label);}else if(count < 0){selectCtrl.removeOption(label);}});}}}};}];var optionDirective=['$interpolate',function($interpolate){var nullSelectCtrl={addOption:noop,removeOption:noop};return {restrict:'E',priority:100,compile:function compile(element,attr){if(isUndefined(attr.value)){var interpolateFn=$interpolate(element.text(),true);if(!interpolateFn){attr.$set('value',element.text());}}return function(scope,element,attr){var selectCtrlName='$selectController',parent=element.parent(),selectCtrl=parent.data(selectCtrlName) || parent.parent().data(selectCtrlName);if(!selectCtrl || !selectCtrl.databound){selectCtrl = nullSelectCtrl;}if(interpolateFn){scope.$watch(interpolateFn,function interpolateWatchAction(newVal,oldVal){attr.$set('value',newVal);if(oldVal !== newVal){selectCtrl.removeOption(oldVal);}selectCtrl.addOption(newVal,element);});}else {selectCtrl.addOption(attr.value,element);}element.on('$destroy',function(){selectCtrl.removeOption(attr.value);});};}};}];var styleDirective=valueFn({restrict:'E',terminal:false});var requiredDirective=function requiredDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;attr.required = true;ctrl.$validators.required = function(modelValue,viewValue){return !attr.required || !ctrl.$isEmpty(viewValue);};attr.$observe('required',function(){ctrl.$validate();});}};};var patternDirective=function patternDirective(){return {restrict:'A',require:'?ngModel',link:function link(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(value){return ctrl.$isEmpty(value) || isUndefined(regexp) || regexp.test(value);};}};};var maxlengthDirective=function maxlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var maxlength=-1;attr.$observe('maxlength',function(value){var intVal=int(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 minlengthDirective(){return {restrict:'A',require:'?ngModel',link:function link(scope,elm,attr,ctrl){if(!ctrl)return;var minlength=0;attr.$observe('minlength',function(value){minlength = int(value) || 0;ctrl.$validate();});ctrl.$validators.minlength = function(modelValue,viewValue){return ctrl.$isEmpty(viewValue) || viewValue.length >= minlength;};}};};if(window.angular.bootstrap){console.log('WARNING: Tried to load angular more than once.');return;}bindJQuery();publishExternalAPI(angular);jqLite(document).ready(function(){angularInit(document,bootstrap);});})(window,document);!window.angular.$$csp() && window.angular.element(document).find('head').prepend(''); - -/***/ }, -/* 5 */ -/***/ function(module, exports, __webpack_require__) { - - (function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define(factory);else if(typeof exports === 'object')exports['JSData'] = factory();else root['JSData'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _datastoreIndex=__webpack_require__(1);var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);module.exports = {DS:_datastoreIndex['default'],DSUtils:_utils['default'],DSErrors:_errors['default'],createStore:function createStore(options){return new _datastoreIndex['default'](options);},version:{full:'2.0.0-rc.1',major:parseInt('2',10),minor:parseInt('0',10),patch:parseInt('0',10),alpha:true?'false':false,beta:true?'false':false}};},function(module,exports,__webpack_require__){var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _sync_methodsIndex=__webpack_require__(4);var _async_methodsIndex=__webpack_require__(5);function lifecycleNoopCb(resource,attrs,cb){cb(null,attrs);}function lifecycleNoop(resource,attrs){return attrs;}function compare(_x,_x2,_x3,_x4){var _again=true;_function: while(_again) {var orderBy=_x,index=_x2,a=_x3,b=_x4;def = cA = cB = undefined;_again = false;var def=orderBy[index];var cA=_utils['default'].get(a,def[0]),cB=_utils['default'].get(b,def[0]);if(_utils['default']._s(cA)){cA = _utils['default'].upperCase(cA);}if(_utils['default']._s(cB)){cB = _utils['default'].upperCase(cB);}if(def[1] === 'DESC'){if(cB < cA){return -1;}else if(cB > cA){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}else {if(cA < cB){return -1;}else if(cA > cB){return 1;}else {if(index < orderBy.length - 1){_x = orderBy;_x2 = index + 1;_x3 = a;_x4 = b;_again = true;continue _function;}else {return 0;}}}}}var Defaults=(function(){function Defaults(){_classCallCheck(this,Defaults);}_createClass(Defaults,[{key:'errorFn',value:function errorFn(a,b){if(this.error && typeof this.error === 'function'){try{if(typeof a === 'string'){throw new Error(a);}else {throw a;}}catch(err) {a = err;}this.error(this.name || null,a || null,b || null);}}}]);return Defaults;})();var defaultsPrototype=Defaults.prototype;defaultsPrototype.actions = {};defaultsPrototype.afterCreate = lifecycleNoopCb;defaultsPrototype.afterCreateCollection = lifecycleNoop;defaultsPrototype.afterCreateInstance = lifecycleNoop;defaultsPrototype.afterDestroy = lifecycleNoopCb;defaultsPrototype.afterEject = lifecycleNoop;defaultsPrototype.afterInject = lifecycleNoop;defaultsPrototype.afterReap = lifecycleNoop;defaultsPrototype.afterUpdate = lifecycleNoopCb;defaultsPrototype.afterValidate = lifecycleNoopCb;defaultsPrototype.allowSimpleWhere = true;defaultsPrototype.basePath = '';defaultsPrototype.beforeCreate = lifecycleNoopCb;defaultsPrototype.beforeCreateCollection = lifecycleNoop;defaultsPrototype.beforeCreateInstance = lifecycleNoop;defaultsPrototype.beforeDestroy = lifecycleNoopCb;defaultsPrototype.beforeEject = lifecycleNoop;defaultsPrototype.beforeInject = lifecycleNoop;defaultsPrototype.beforeReap = lifecycleNoop;defaultsPrototype.beforeUpdate = lifecycleNoopCb;defaultsPrototype.beforeValidate = lifecycleNoopCb;defaultsPrototype.bypassCache = false;defaultsPrototype.cacheResponse = !!_utils['default'].w;defaultsPrototype.clearEmptyQueries = true;defaultsPrototype.computed = {};defaultsPrototype.defaultAdapter = 'http';defaultsPrototype.debug = false;defaultsPrototype.defaultValues = {};defaultsPrototype.eagerEject = false;defaultsPrototype.eagerInject = false;defaultsPrototype.endpoint = '';defaultsPrototype.error = console?function(a,b,c){return console[typeof console.error === 'function'?'error':'log'](a,b,c);}:false;defaultsPrototype.instanceEvents = !!_utils['default'].w;defaultsPrototype.fallbackAdapters = ['http'];defaultsPrototype.findStrictCache = false;defaultsPrototype.idAttribute = 'id';defaultsPrototype.ignoredChanges = [/\$/];defaultsPrototype.ignoreMissing = false;defaultsPrototype.keepChangeHistory = false;defaultsPrototype.linkRelations = true;defaultsPrototype.log = console?function(a,b,c,d,e){return console[typeof console.info === 'function'?'info':'log'](a,b,c,d,e);}:false;defaultsPrototype.logFn = function(a,b,c,d){var _this=this;if(_this.debug && _this.log && typeof _this.log === 'function'){_this.log(_this.name || null,a || null,b || null,c || null,d || null);}};defaultsPrototype.maxAge = false;defaultsPrototype.methods = {};defaultsPrototype.notify = !!_utils['default'].w;defaultsPrototype.omit = [];defaultsPrototype.onConflict = 'merge';defaultsPrototype.reapAction = !!_utils['default'].w?'inject':'none';defaultsPrototype.reapInterval = !!_utils['default'].w?30000:false;defaultsPrototype.relationsEnumerable = false;defaultsPrototype.returnMeta = false;defaultsPrototype.resetHistoryOnInject = true;defaultsPrototype.strategy = 'single';defaultsPrototype.upsert = !!_utils['default'].w;defaultsPrototype.useClass = true;defaultsPrototype.useFilter = false;defaultsPrototype.validate = lifecycleNoopCb;defaultsPrototype.defaultFilter = function(collection,resourceName,params,options){var filtered=collection;var where=null;var reserved={skip:'',offset:'',where:'',limit:'',orderBy:'',sort:''};params = params || {};options = options || {};if(_utils['default']._o(params.where)){where = params.where;}else {where = {};}if(options.allowSimpleWhere){_utils['default'].forOwn(params,function(value,key){if(!(key in reserved) && !(key in where)){where[key] = {'==':value};}});}if(_utils['default'].isEmpty(where)){where = null;}if(where){filtered = _utils['default'].filter(filtered,function(attrs){var first=true;var keep=true;_utils['default'].forOwn(where,function(clause,field){if(!_utils['default']._o(clause)){clause = {'==':clause};}_utils['default'].forOwn(clause,function(term,op){var expr=undefined;var isOr=op[0] === '|';var val=_utils['default'].get(attrs,field);op = isOr?op.substr(1):op;if(op === '=='){expr = val == term;}else if(op === '==='){expr = val === term;}else if(op === '!='){expr = val != term;}else if(op === '!=='){expr = val !== term;}else if(op === '>'){expr = val > term;}else if(op === '>='){expr = val >= term;}else if(op === '<'){expr = val < term;}else if(op === '<='){expr = val <= term;}else if(op === 'isectEmpty'){expr = !_utils['default'].intersection(val || [],term || []).length;}else if(op === 'isectNotEmpty'){expr = _utils['default'].intersection(val || [],term || []).length;}else if(op === 'in'){if(_utils['default']._s(term)){expr = term.indexOf(val) !== -1;}else {expr = _utils['default'].contains(term,val);}}else if(op === 'notIn'){if(_utils['default']._s(term)){expr = term.indexOf(val) === -1;}else {expr = !_utils['default'].contains(term,val);}}else if(op === 'contains'){if(_utils['default']._s(val)){expr = val.indexOf(term) !== -1;}else {expr = _utils['default'].contains(val,term);}}else if(op === 'notContains'){if(_utils['default']._s(val)){expr = val.indexOf(term) === -1;}else {expr = !_utils['default'].contains(val,term);}}if(expr !== undefined){keep = first?expr:isOr?keep || expr:keep && expr;}first = false;});});return keep;});}var orderBy=null;if(_utils['default']._s(params.orderBy)){orderBy = [[params.orderBy,'ASC']];}else if(_utils['default']._a(params.orderBy)){orderBy = params.orderBy;}if(!orderBy && _utils['default']._s(params.sort)){orderBy = [[params.sort,'ASC']];}else if(!orderBy && _utils['default']._a(params.sort)){orderBy = params.sort;}if(orderBy){(function(){var index=0;_utils['default'].forEach(orderBy,function(def,i){if(_utils['default']._s(def)){orderBy[i] = [def,'ASC'];}else if(!_utils['default']._a(def)){throw new _errors['default'].IA('DS.filter("' + resourceName + '"[, params][, options]): ' + _utils['default'].toJson(def) + ': Must be a string or an array!',{params:{'orderBy[i]':{actual:typeof def,expected:'string|array'}}});}});filtered = _utils['default'].sort(filtered,function(a,b){return compare(orderBy,index,a,b);});})();}var limit=_utils['default']._n(params.limit)?params.limit:null;var skip=null;if(_utils['default']._n(params.skip)){skip = params.skip;}else if(_utils['default']._n(params.offset)){skip = params.offset;}if(limit && skip){filtered = _utils['default'].slice(filtered,skip,Math.min(filtered.length,skip + limit));}else if(_utils['default']._n(limit)){filtered = _utils['default'].slice(filtered,0,Math.min(filtered.length,limit));}else if(_utils['default']._n(skip)){if(skip < filtered.length){filtered = _utils['default'].slice(filtered,skip);}else {filtered = [];}}return filtered;};var DS=(function(){function DS(options){_classCallCheck(this,DS);var _this=this;options = options || {};_this.store = {};_this.s = _this.store;_this.definitions = {};_this.defs = _this.definitions;_this.adapters = {};_this.defaults = new Defaults();_this.observe = _utils['default'].observe;_utils['default'].forOwn(options,function(v,k){if(k === 'omit'){_this.defaults.omit = v.concat(Defaults.prototype.omit);}else {_this.defaults[k] = v;}});_this.defaults.logFn('new data store created',_this.defaults);var P=_utils['default'].Promise;if(P && !P.prototype.spread){P.prototype.spread = function(cb){return this.then(function(arr){return cb.apply(this,arr);});};}}_createClass(DS,[{key:'getAdapterName',value:function getAdapterName(options){var errorIfNotExist=false;options = options || {};this.defaults.logFn('getAdapterName',options);if(_utils['default']._s(options)){errorIfNotExist = true;options = {adapter:options};}if(this.adapters[options.adapter]){return options.adapter;}else if(errorIfNotExist){throw new Error(options.adapter + ' is not a registered adapter!');}else {return options.defaultAdapter;}}},{key:'getAdapter',value:function getAdapter(options){options = options || {};this.defaults.logFn('getAdapter',options);return this.adapters[this.getAdapterName(options)];}},{key:'registerAdapter',value:function registerAdapter(name,Adapter,options){var _this=this;options = options || {};_this.defaults.logFn('registerAdapter',name,Adapter,options);if(_utils['default'].isFunction(Adapter)){_this.adapters[name] = new Adapter(options);}else {_this.adapters[name] = Adapter;}if(options['default']){_this.defaults.defaultAdapter = name;}_this.defaults.logFn('default adapter is ' + _this.defaults.defaultAdapter);}},{key:'is',value:function is(resourceName,instance){var definition=this.defs[resourceName];if(!definition){throw new _errors['default'].NER(resourceName);}return instance instanceof definition[definition['class']];}}]);return DS;})();var dsPrototype=DS.prototype;dsPrototype.getAdapterName.shorthand = false;dsPrototype.getAdapter.shorthand = false;dsPrototype.registerAdapter.shorthand = false;dsPrototype.errors = _errors['default'];dsPrototype.utils = _utils['default'];function addMethods(target,obj){_utils['default'].forOwn(obj,function(v,k){target[k] = v;target[k].before = function(fn){var orig=target[k];target[k] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}return orig.apply(this,fn.apply(this,args) || args);};};});}addMethods(dsPrototype,_sync_methodsIndex['default']);addMethods(dsPrototype,_async_methodsIndex['default']);exports['default'] = DS;},function(module,exports,__webpack_require__){function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}var _errors=__webpack_require__(3);var BinaryHeap=__webpack_require__(7);var forEach=__webpack_require__(8);var slice=__webpack_require__(9);var forOwn=__webpack_require__(13);var contains=__webpack_require__(10);var deepMixIn=__webpack_require__(14);var pascalCase=__webpack_require__(18);var remove=__webpack_require__(11);var pick=__webpack_require__(15);var sort=__webpack_require__(12);var upperCase=__webpack_require__(19);var get=__webpack_require__(16);var set=__webpack_require__(17);var observe=__webpack_require__(6);var w=undefined;var objectProto=Object.prototype;var toString=objectProto.toString;var P=undefined;try{P = Promise;}catch(err) {console.error('js-data requires a global Promise constructor!');}var isArray=Array.isArray || function isArray(value){return toString.call(value) == '[object Array]' || false;};var isRegExp=function isRegExp(value){return toString.call(value) == '[object RegExp]' || false;};var isString=function isString(value){return typeof value == 'string' || value && typeof value == 'object' && toString.call(value) == '[object String]' || false;};var isObject=function isObject(value){return toString.call(value) == '[object Object]' || false;};var isDate=function isDate(value){return value && typeof value == 'object' && toString.call(value) == '[object Date]' || false;};var isNumber=function isNumber(value){var type=typeof value;return type == 'number' || value && type == 'object' && toString.call(value) == '[object Number]' || false;};var isFunction=function isFunction(value){return typeof value == 'function' || value && toString.call(value) === '[object Function]' || false;};var isStringOrNumber=function isStringOrNumber(value){return isString(value) || isNumber(value);};var isStringOrNumberErr=function isStringOrNumberErr(field){return new _errors['default'].IA('"' + field + '" must be a string or a number!');};var isObjectErr=function isObjectErr(field){return new _errors['default'].IA('"' + field + '" must be an object!');};var isArrayErr=function isArrayErr(field){return new _errors['default'].IA('"' + field + '" must be an array!');};var isEmpty=function isEmpty(val){if(val == null){return true;}else if(typeof val === 'string' || isArray(val)){return !val.length;}else if(typeof val === 'object'){var result=true;forOwn(val,function(){result = false;return false;});return result;}else {return true;}};var intersection=function intersection(array1,array2){if(!array1 || !array2){return [];}var result=[];var item=undefined;for(var i=0,_length=array1.length;i < _length;i++) {item = array1[i];if(contains(result,item)){continue;}if(contains(array2,item)){result.push(item);}}return result;};var filter=function filter(array,cb,thisObj){var results=[];forEach(array,function(value,key,arr){if(cb(value,key,arr)){results.push(value);}},thisObj);return results;};try{w = window;w = {};}catch(e) {w = null;}function Events(target){var events={};target = target || this;target.on = function(type,func,ctx){events[type] = events[type] || [];events[type].push({f:func,c:ctx});};target.off = function(type,func){var listeners=events[type];if(!listeners){events = {};}else if(func){for(var i=0;i < listeners.length;i++) {if(listeners[i] === func){listeners.splice(i,1);break;}}}else {listeners.splice(0,listeners.length);}};target.emit = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}var listeners=events[args.shift()] || [];if(listeners){for(var i=0;i < listeners.length;i++) {listeners[i].f.apply(listeners[i].c,args);}}};}var toPromisify=['beforeValidate','validate','afterValidate','beforeCreate','afterCreate','beforeUpdate','afterUpdate','beforeDestroy','afterDestroy'];var isBlacklisted=observe.isBlacklisted;var copy=function copy(source,destination,stackSource,stackDest,blacklist){if(!destination){destination = source;if(source){if(isArray(source)){destination = copy(source,[],stackSource,stackDest,blacklist);}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(isObject(source)){destination = copy(source,Object.create(Object.getPrototypeOf(source)),stackSource,stackDest,blacklist);}}}else {if(source === destination){throw new Error('Cannot copy! Source and destination are identical.');}stackSource = stackSource || [];stackDest = stackDest || [];if(isObject(source)){var index=stackSource.indexOf(source);if(index !== -1){return stackDest[index];}stackSource.push(source);stackDest.push(destination);}var result=undefined;if(isArray(source)){var i=undefined;destination.length = 0;for(i = 0;i < source.length;i++) {result = copy(source[i],null,stackSource,stackDest,blacklist);if(isObject(source[i])){stackSource.push(source[i]);stackDest.push(result);}destination.push(result);}}else {if(isArray(destination)){destination.length = 0;}else {forEach(destination,function(value,key){delete destination[key];});}for(var key in source) {if(source.hasOwnProperty(key)){if(isBlacklisted(key,blacklist)){continue;}result = copy(source[key],null,stackSource,stackDest,blacklist);if(isObject(source[key])){stackSource.push(source[key]);stackDest.push(result);}destination[key] = result;}}}}return destination;};var equals=function equals(_x,_x2){var _again=true;_function: while(_again) {var o1=_x,o2=_x2;t1 = t2 = length = key = keySet = undefined;_again = false;if(o1 === o2){return true;}if(o1 === null || o2 === null){return false;}if(o1 !== o1 && o2 !== o2){return true;}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;}_x = o1.getTime();_x2 = o2.getTime();_again = true;continue _function;}else if(isRegExp(o1) && isRegExp(o2)){return o1.toString() == o2.toString();}else {if(isArray(o2)){return false;}keySet = {};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(!keySet.hasOwnProperty(key) && key.charAt(0) !== '$' && o2[key] !== undefined && !isFunction(o2[key])){return false;}}return true;}}}return false;}};var resolveId=function resolveId(definition,idOrInstance){if(isString(idOrInstance) || isNumber(idOrInstance)){return idOrInstance;}else if(idOrInstance && definition){return idOrInstance[definition.idAttribute] || idOrInstance;}else {return idOrInstance;}};var resolveItem=function resolveItem(resource,idOrInstance){if(resource && (isString(idOrInstance) || isNumber(idOrInstance))){return resource.index[idOrInstance] || idOrInstance;}else {return idOrInstance;}};var isValidString=function isValidString(val){return val != null && val !== '';};var join=function join(items,separator){separator = separator || '';return filter(items,isValidString).join(separator);};var makePath=function makePath(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}var result=join(args,'/');return result.replace(/([^:\/]|^)\/{2,}/g,'$1/');};exports['default'] = {Promise:P,_:function _(parent,options){var _this=this;options = options || {};if(options && options.constructor === parent.constructor){return options;}else if(!isObject(options)){throw new _errors['default'].IA('"options" must be an object!');}forEach(toPromisify,function(name){if(typeof options[name] === 'function' && options[name].toString().indexOf('for (var _len = arg') === -1){options[name] = _this.promisify(options[name]);}});var O=function Options(attrs){var self=this;forOwn(attrs,function(value,key){self[key] = value;});};O.prototype = parent;O.prototype.orig = function(){var orig={};forOwn(this,function(value,key){orig[key] = value;});return orig;};return new O(options);},_n:isNumber,_s:isString,_sn:isStringOrNumber,_snErr:isStringOrNumberErr,_o:isObject,_oErr:isObjectErr,_a:isArray,_aErr:isArrayErr,compute:function compute(fn,field){var _this=this;var args=[];forEach(fn.deps,function(dep){args.push(get(_this,dep));});set(_this,field,fn[fn.length - 1].apply(_this,args));},contains:contains,copy:copy,deepMixIn:deepMixIn,diffObjectFromOldObject:observe.diffObjectFromOldObject,BinaryHeap:BinaryHeap,equals:equals,Events:Events,filter:filter,fillIn:function fillIn(target,obj){forOwn(obj,function(v,k){if(!(k in target)){target[k] = v;}});return target;},forEach:forEach,forOwn:forOwn,fromJson:function fromJson(json){return isString(json)?JSON.parse(json):json;},get:get,intersection:intersection,isArray:isArray,isBlacklisted:isBlacklisted,isEmpty:isEmpty,isFunction:isFunction,isObject:isObject,isNumber:isNumber,isString:isString,makePath:makePath,observe:observe,omit:function omit(obj,bl){var toRemove=[];forOwn(obj,function(v,k){if(isBlacklisted(k,bl)){toRemove.push(k);}});forEach(toRemove,function(k){delete obj[k];});return obj;},pascalCase:pascalCase,pick:pick,promisify:function promisify(fn,target){var _this=this;if(!fn){return;}else if(typeof fn !== 'function'){throw new Error('Can only promisify functions!');}return function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}return new _this.Promise(function(resolve,reject){args.push(function(err,result){if(err){reject(err);}else {resolve(result);}});try{var promise=fn.apply(target || this,args);if(promise && promise.then){promise.then(resolve,reject);}}catch(err) {reject(err);}});};},remove:remove,set:set,slice:slice,sort:sort,toJson:JSON.stringify,updateTimestamp:function updateTimestamp(timestamp){var newTimestamp=typeof Date.now === 'function'?Date.now():new Date().getTime();if(timestamp && newTimestamp <= timestamp){return timestamp + 1;}else {return newTimestamp;}},upperCase:upperCase,removeCircular:function removeCircular(object){return (function rmCirc(value,ctx){var i=undefined;var nu=undefined;if(typeof value === 'object' && value !== null && !(value instanceof Boolean) && !(value instanceof Date) && !(value instanceof Number) && !(value instanceof RegExp) && !(value instanceof String)){var cur=ctx.cur;var parent=ctx.ctx;while(parent) {if(parent.cur === cur){return undefined;}parent = parent.ctx;}if(isArray(value)){nu = [];for(i = 0;i < value.length;i += 1) {nu[i] = rmCirc(value[i],{ctx:ctx,cur:value[i]});}}else {nu = {};forOwn(value,function(v,k){nu[k] = rmCirc(value[k],{ctx:ctx,cur:value[k]});});}return nu;}return value;})(object,{ctx:null,cur:object});},resolveItem:resolveItem,resolveId:resolveId,respond:function respond(response,meta,options){if(options.returnMeta === 'array'){return [response,meta];}else if(options.returnMeta === 'object'){return {response:response,meta:meta};}else {return response;}},w:w,applyRelationGettersToTarget:function applyRelationGettersToTarget(store,definition,target){this.forEach(definition.relationList,function(def){var relationName=def.relation;var enumerable=typeof def.enumerable === 'boolean'?def.enumerable:!!definition.relationsEnumerable;if(typeof def.link === 'boolean'?def.link:!!definition.linkRelations){delete target[def.localField];if(def.type === 'belongsTo'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else if(def.type === 'hasMany'){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};if(def.foreignKey){params[def.foreignKey] = this[definition.idAttribute];return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true});}else if(def.localKeys){params.where = _defineProperty({},definition.getResource(relationName).idAttribute,{'in':this[def.localKeys]});return definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params);}return undefined;},set:function set(){}});}else if(def.type === 'hasOne'){if(def.localKey){Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){return this[def.localKey]?definition.getResource(relationName).get(this[def.localKey]):undefined;},set:function set(){}});}else {Object.defineProperty(target,def.localField,{enumerable:enumerable,get:function get(){var params={};params[def.foreignKey] = this[definition.idAttribute];var items=params[def.foreignKey]?definition.getResource(relationName).defaultFilter.call(store,store.s[relationName].collection,relationName,params,{allowSimpleWhere:true}):[];if(items.length){return items[0];}return undefined;},set:function set(){}});}}}});}};},function(module,exports,__webpack_require__){var _get=function get(_x,_x2,_x3){var _again=true;_function: while(_again) {var object=_x,property=_x2,receiver=_x3;desc = parent = getter = undefined;_again = false;if(object === null)object = Function.prototype;var desc=Object.getOwnPropertyDescriptor(object,property);if(desc === undefined){var parent=Object.getPrototypeOf(object);if(parent === null){return undefined;}else {_x = parent;_x2 = property;_x3 = receiver;_again = true;continue _function;}}else if('value' in desc){return desc.value;}else {var getter=desc.get;if(getter === undefined){return undefined;}return getter.call(receiver);}}};function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}}function _inherits(subClass,superClass){if(typeof superClass !== 'function' && superClass !== null){throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass);}subClass.prototype = Object.create(superClass && superClass.prototype,{constructor:{value:subClass,enumerable:false,writable:true,configurable:true}});if(superClass)subClass.__proto__ = superClass;}var IllegalArgumentError=(function(_Error){function IllegalArgumentError(message){_classCallCheck(this,IllegalArgumentError);_get(Object.getPrototypeOf(IllegalArgumentError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(IllegalArgumentError,_Error);return IllegalArgumentError;})(Error);var RuntimeError=(function(_Error2){function RuntimeError(message){_classCallCheck(this,RuntimeError);_get(Object.getPrototypeOf(RuntimeError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = message;}_inherits(RuntimeError,_Error2);return RuntimeError;})(Error);var NonexistentResourceError=(function(_Error3){function NonexistentResourceError(resourceName){_classCallCheck(this,NonexistentResourceError);_get(Object.getPrototypeOf(NonexistentResourceError.prototype),'constructor',this).call(this);if(typeof Error.captureStackTrace === 'function'){Error.captureStackTrace(this,this.constructor);}this.type = this.constructor.name;this.message = resourceName + ' is not a registered resource!';}_inherits(NonexistentResourceError,_Error3);return NonexistentResourceError;})(Error);exports['default'] = {IllegalArgumentError:IllegalArgumentError,IA:IllegalArgumentError,RuntimeError:RuntimeError,R:RuntimeError,NonexistentResourceError:NonexistentResourceError,NER:NonexistentResourceError};},function(module,exports,__webpack_require__){var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var _defineResource=__webpack_require__(28);var _eject=__webpack_require__(29);var _ejectAll=__webpack_require__(30);var _filter=__webpack_require__(31);var _inject=__webpack_require__(32);var NER=_errors['default'].NER;var IA=_errors['default'].IA;var R=_errors['default'].R;function diffIsEmpty(diff){return !(_utils['default'].isEmpty(diff.added) && _utils['default'].isEmpty(diff.removed) && _utils['default'].isEmpty(diff.changed));}exports['default'] = {changes:function changes(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];options = options || {};id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('changes',id,options);var item=definition.get(id);if(item){var _ret=(function(){if(_utils['default'].w){_this.s[resourceName].observers[id].deliver();}var ignoredChanges=options.ignoredChanges || [];_utils['default'].forEach(definition.relationFields,function(field){if(!_utils['default'].contains(ignoredChanges,field)){ignoredChanges.push(field);}});var diff=_utils['default'].diffObjectFromOldObject(item,_this.s[resourceName].previousAttributes[id],_utils['default'].equals,ignoredChanges);_utils['default'].forOwn(diff,function(changeset,name){var toKeep=[];_utils['default'].forOwn(changeset,function(value,field){if(!_utils['default'].isFunction(value)){toKeep.push(field);}});diff[name] = _utils['default'].pick(diff[name],toKeep);});_utils['default'].forEach(definition.relationFields,function(field){delete diff.added[field];delete diff.removed[field];delete diff.changed[field];});return {v:diff};})();if(typeof _ret === 'object')return _ret.v;}},changeHistory:function changeHistory(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(resourceName && !_this.defs[resourceName]){throw new NER(resourceName);}else if(id && !_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('changeHistory',id);if(!definition.keepChangeHistory){definition.errorFn('changeHistory is disabled for this resource!');}else {if(resourceName){var item=definition.get(id);if(item){return resource.changeHistories[id];}}else {return resource.changeHistory;}}},compute:function compute(resourceName,instance){var _this=this;var definition=_this.defs[resourceName];instance = _utils['default'].resolveItem(_this.s[resourceName],instance);if(!definition){throw new NER(resourceName);}else if(!instance){throw new R('Item not in the store!');}else if(!_utils['default']._o(instance) && !_utils['default']._sn(instance)){throw new IA('"instance" must be an object, string or number!');}definition.logFn('compute',instance);_utils['default'].forOwn(definition.computed,function(fn,field){_utils['default'].compute.call(instance,fn,field);});return instance;},createInstance:function createInstance(resourceName,attrs,options){var definition=this.defs[resourceName];var item=undefined;attrs = attrs || {};if(!definition){throw new NER(resourceName);}else if(attrs && !_utils['default'].isObject(attrs)){throw new IA('"attrs" must be an object!');}options = _utils['default']._(definition,options);options.logFn('createInstance',attrs,options);options.beforeCreateInstance(options,attrs);var Constructor=definition[definition['class']];item = new Constructor();if(options.defaultValues){_utils['default'].deepMixIn(item,options.defaultValues);}_utils['default'].deepMixIn(item,attrs);if(definition.computed){definition.compute(item);}options.afterCreateInstance(options,item);return item;},createCollection:function createCollection(resourceName,arr,params,options){var _this=this;var definition=_this.defs[resourceName];arr = arr || [];params = params || {};if(!definition){throw new NER(resourceName);}else if(arr && !_utils['default'].isArray(arr)){throw new IA('"arr" must be an array!');}options = _utils['default']._(definition,options);options.logFn('createCollection',arr,options);options.beforeCreateCollection(options,arr);Object.defineProperties(arr,{fetch:{value:function value(params,options){var __this=this;__this.params = params || __this.params;return definition.findAll(__this.params,options).then(function(data){if(data === __this){return __this;}data.unshift(__this.length);data.unshift(0);__this.splice.apply(__this,data);data.shift();data.shift();if(data.$$injected){_this.s[resourceName].queryData[_utils['default'].toJson(__this.params)] = __this;__this.$$injected = true;}return __this;});}},params:{value:params,writable:true},resourceName:{value:resourceName}});options.afterCreateCollection(options,arr);return arr;},defineResource:_defineResource['default'],digest:function digest(){this.observe.Platform.performMicrotaskCheckpoint();},eject:_eject['default'],ejectAll:_ejectAll['default'],filter:_filter['default'],get:function get(resourceName,id,options){var _this=this;var definition=_this.defs[resourceName];if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}options = _utils['default']._(definition,options);options.logFn('get',id,options);return _this.s[resourceName].index[id];},getAll:function getAll(resourceName,ids){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var collection=[];if(!definition){throw new NER(resourceName);}else if(ids && !_utils['default']._a(ids)){throw _utils['default']._aErr('ids');}definition.logFn('getAll',ids);if(_utils['default']._a(ids)){var _length=ids.length;for(var i=0;i < _length;i++) {if(resource.index[ids[i]]){collection.push(resource.index[ids[i]]);}}}else {collection = resource.collection.slice();}return collection;},hasChanges:function hasChanges(resourceName,id){var _this=this;var definition=_this.defs[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('hasChanges',id);return definition.get(id)?diffIsEmpty(definition.changes(id)):false;},inject:_inject['default'],lastModified:function lastModified(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastModified',id);if(id){if(!(id in resource.modified)){resource.modified[id] = 0;}return resource.modified[id];}return resource.collectionModified;},lastSaved:function lastSaved(resourceName,id){var definition=this.defs[resourceName];var resource=this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}definition.logFn('lastSaved',id);if(!(id in resource.saved)){resource.saved[id] = 0;}return resource.saved[id];},previous:function previous(resourceName,id){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];id = _utils['default'].resolveId(definition,id);if(!definition){throw new NER(resourceName);}else if(!_utils['default']._sn(id)){throw _utils['default']._snErr('id');}definition.logFn('previous',id);return resource.previousAttributes[id]?_utils['default'].copy(resource.previousAttributes[id]):undefined;}};},function(module,exports,__webpack_require__){var _create=__webpack_require__(33);var _destroy=__webpack_require__(34);var _destroyAll=__webpack_require__(35);var _find=__webpack_require__(36);var _findAll=__webpack_require__(37);var _loadRelations=__webpack_require__(38);var _reap=__webpack_require__(39);var _save=__webpack_require__(40);var _update=__webpack_require__(41);var _updateAll=__webpack_require__(42);exports['default'] = {create:_create['default'],destroy:_destroy['default'],destroyAll:_destroyAll['default'],find:_find['default'],findAll:_findAll['default'],loadRelations:_loadRelations['default'],reap:_reap['default'],refresh:function refresh(resourceName,id,options){var _this=this;var DSUtils=_this.utils;return new DSUtils.Promise(function(resolve,reject){var definition=_this.defs[resourceName];id = DSUtils.resolveId(_this.defs[resourceName],id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refresh',id,options);resolve(_this.get(resourceName,id));}}).then(function(item){return item?_this.find(resourceName,id,options):item;});},refreshAll:function refreshAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);options.bypassCache = true;options.logFn('refreshAll',params,options);resolve(_this.filter(resourceName,params,options));}}).then(function(existing){options.bypassCache = true;return _this.findAll(resourceName,params,options).then(function(found){DSUtils.forEach(existing,function(item){if(found.indexOf(item) === -1){definition.eject(item);}});return found;});});},save:_save['default'],update:_update['default'],updateAll:_updateAll['default']};},function(module,exports,__webpack_require__){(function(global){var testingExposeCycleCount=global.testingExposeCycleCount;function detectObjectObserve(){if(typeof Object.observe !== 'function' || typeof Array.observe !== 'function'){return false;}var records=[];function callback(recs){records = recs;}var test={};var arr=[];Object.observe(test,callback);Array.observe(arr,callback);test.id = 1;test.id = 2;delete test.id;arr.push(1,2);arr.length = 0;Object.deliverChangeRecords(callback);if(records.length !== 5)return false;if(records[0].type != 'add' || records[1].type != 'update' || records[2].type != 'delete' || records[3].type != 'splice' || records[4].type != 'splice'){return false;}Object.unobserve(test,callback);Array.unobserve(arr,callback);return true;}var hasObserve=detectObjectObserve();var createObject='__proto__' in {}?function(obj){return obj;}:function(obj){var proto=obj.__proto__;if(!proto)return obj;var newObject=Object.create(proto);Object.getOwnPropertyNames(obj).forEach(function(name){Object.defineProperty(newObject,name,Object.getOwnPropertyDescriptor(obj,name));});return newObject;};var MAX_DIRTY_CHECK_CYCLES=1000;function dirtyCheck(observer){var cycles=0;while(cycles < MAX_DIRTY_CHECK_CYCLES && observer.check_()) {cycles++;}if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;return cycles > 0;}function objectIsEmpty(object){for(var prop in object) return false;return true;}function diffIsEmpty(diff){return objectIsEmpty(diff.added) && objectIsEmpty(diff.removed) && objectIsEmpty(diff.changed);}function isBlacklisted(prop,bl){if(!bl || !bl.length){return false;}var matches;for(var i=0;i < bl.length;i++) {if(Object.prototype.toString.call(bl[i]) === '[object RegExp]' && bl[i].test(prop) || bl[i] === prop){return matches = prop;}}return !!matches;}function diffObjectFromOldObject(object,oldObject,equals,bl){var added={};var removed={};var changed={};for(var prop in oldObject) {var newValue=object[prop];if(isBlacklisted(prop,bl))continue;if(newValue !== undefined && (equals?equals(newValue,oldObject[prop]):newValue === oldObject[prop]))continue;if(!(prop in object)){removed[prop] = undefined;continue;}if(equals?!equals(newValue,oldObject[prop]):newValue !== oldObject[prop])changed[prop] = newValue;}for(var prop in object) {if(prop in oldObject)continue;if(isBlacklisted(prop,bl))continue;added[prop] = object[prop];}if(Array.isArray(object) && object.length !== oldObject.length)changed.length = object.length;return {added:added,removed:removed,changed:changed};}var eomTasks=[];function runEOMTasks(){if(!eomTasks.length)return false;for(var i=0;i < eomTasks.length;i++) {eomTasks[i]();}eomTasks.length = 0;return true;}var runEOM=hasObserve?(function(){return function(fn){return Promise.resolve().then(fn);};})():(function(){return function(fn){eomTasks.push(fn);};})();var observedObjectCache=[];function newObservedObject(){var observer;var object;var discardRecords=false;var first=true;function callback(records){if(observer && observer.state_ === OPENED && !discardRecords)observer.check_(records);}return {open:function open(obs){if(observer)throw Error('ObservedObject in use');if(!first)Object.deliverChangeRecords(callback);observer = obs;first = false;},observe:function observe(obj,arrayObserve){object = obj;if(arrayObserve)Array.observe(object,callback);else Object.observe(object,callback);},deliver:function deliver(discard){discardRecords = discard;Object.deliverChangeRecords(callback);discardRecords = false;},close:function close(){observer = undefined;Object.unobserve(object,callback);observedObjectCache.push(this);}};}function getObservedObject(observer,object,arrayObserve){var dir=observedObjectCache.pop() || newObservedObject();dir.open(observer);dir.observe(object,arrayObserve);return dir;}var UNOPENED=0;var OPENED=1;var CLOSED=2;var nextObserverId=1;function Observer(){this.state_ = UNOPENED;this.callback_ = undefined;this.target_ = undefined;this.directObserver_ = undefined;this.value_ = undefined;this.id_ = nextObserverId++;}Observer.prototype = {open:function open(callback,target){if(this.state_ != UNOPENED)throw Error('Observer has already been opened.');addToAll(this);this.callback_ = callback;this.target_ = target;this.connect_();this.state_ = OPENED;return this.value_;},close:function close(){if(this.state_ != OPENED)return;removeFromAll(this);this.disconnect_();this.value_ = undefined;this.callback_ = undefined;this.target_ = undefined;this.state_ = CLOSED;},deliver:function deliver(){if(this.state_ != OPENED)return;dirtyCheck(this);},report_:function report_(changes){try{this.callback_.apply(this.target_,changes);}catch(ex) {Observer._errorThrownDuringCallback = true;console.error('Exception caught during observer callback: ' + (ex.stack || ex));}},discardChanges:function discardChanges(){this.check_(undefined,true);return this.value_;}};var collectObservers=!hasObserve;var allObservers;Observer._allObserversCount = 0;if(collectObservers){allObservers = [];}function addToAll(observer){Observer._allObserversCount++;if(!collectObservers)return;allObservers.push(observer);}function removeFromAll(observer){Observer._allObserversCount--;}var runningMicrotaskCheckpoint=false;global.Platform = global.Platform || {};global.Platform.performMicrotaskCheckpoint = function(){if(runningMicrotaskCheckpoint)return;if(!collectObservers)return;runningMicrotaskCheckpoint = true;var cycles=0;var anyChanged,toCheck;do {cycles++;toCheck = allObservers;allObservers = [];anyChanged = false;for(var i=0;i < toCheck.length;i++) {var observer=toCheck[i];if(observer.state_ != OPENED)continue;if(observer.check_())anyChanged = true;allObservers.push(observer);}if(runEOMTasks())anyChanged = true;}while(cycles < MAX_DIRTY_CHECK_CYCLES && anyChanged);if(testingExposeCycleCount)global.dirtyCheckCycleCount = cycles;runningMicrotaskCheckpoint = false;};if(collectObservers){global.Platform.clearObservers = function(){allObservers = [];};}function ObjectObserver(object){Observer.call(this);this.value_ = object;this.oldObject_ = undefined;}ObjectObserver.prototype = createObject({__proto__:Observer.prototype,arrayObserve:false,connect_:function connect_(callback,target){if(hasObserve){this.directObserver_ = getObservedObject(this,this.value_,this.arrayObserve);}else {this.oldObject_ = this.copyObject(this.value_);}},copyObject:function copyObject(object){var copy=Array.isArray(object)?[]:{};for(var prop in object) {copy[prop] = object[prop];};if(Array.isArray(object))copy.length = object.length;return copy;},check_:function check_(changeRecords,skipChanges){var diff;var oldValues;if(hasObserve){if(!changeRecords)return false;oldValues = {};diff = diffObjectFromChangeRecords(this.value_,changeRecords,oldValues);}else {oldValues = this.oldObject_;diff = diffObjectFromOldObject(this.value_,this.oldObject_);}if(diffIsEmpty(diff))return false;if(!hasObserve)this.oldObject_ = this.copyObject(this.value_);this.report_([diff.added || {},diff.removed || {},diff.changed || {},function(property){return oldValues[property];}]);return true;},disconnect_:function disconnect_(){if(hasObserve){this.directObserver_.close();this.directObserver_ = undefined;}else {this.oldObject_ = undefined;}},deliver:function deliver(){if(this.state_ != OPENED)return;if(hasObserve)this.directObserver_.deliver(false);else dirtyCheck(this);},discardChanges:function discardChanges(){if(this.directObserver_)this.directObserver_.deliver(true);else this.oldObject_ = this.copyObject(this.value_);return this.value_;}});var observerSentinel={};var expectedRecordTypes={add:true,update:true,'delete':true};function diffObjectFromChangeRecords(object,changeRecords,oldValues){var added={};var removed={};for(var i=0;i < changeRecords.length;i++) {var record=changeRecords[i];if(!expectedRecordTypes[record.type]){console.error('Unknown changeRecord type: ' + record.type);console.error(record);continue;}if(!(record.name in oldValues))oldValues[record.name] = record.oldValue;if(record.type == 'update')continue;if(record.type == 'add'){if(record.name in removed)delete removed[record.name];else added[record.name] = true;continue;}if(record.name in added){delete added[record.name];delete oldValues[record.name];}else {removed[record.name] = true;}}for(var prop in added) added[prop] = object[prop];for(var prop in removed) removed[prop] = undefined;var changed={};for(var prop in oldValues) {if(prop in added || prop in removed)continue;var newValue=object[prop];if(oldValues[prop] !== newValue)changed[prop] = newValue;}return {added:added,removed:removed,changed:changed};}global.Observer = Observer;global.isBlacklisted = isBlacklisted;global.Observer.runEOM_ = runEOM;global.Observer.observerSentinel_ = observerSentinel;global.Observer.hasObjectObserve = hasObserve;global.diffObjectFromOldObject = diffObjectFromOldObject;global.ObjectObserver = ObjectObserver;})(exports);},function(module,exports,__webpack_require__){(function webpackUniversalModuleDefinition(root,factory){if(true)module.exports = factory();else if(typeof define === 'function' && define.amd)define('yabh',factory);else if(typeof exports === 'object')exports['BinaryHeap'] = factory();else root['BinaryHeap'] = factory();})(this,function(){return ((function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId])return installedModules[moduleId].exports;var module=installedModules[moduleId] = {exports:{},id:moduleId,loaded:false};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.loaded = true;return module.exports;}__webpack_require__.m = modules;__webpack_require__.c = installedModules;__webpack_require__.p = '';return __webpack_require__(0);})([function(module,exports,__webpack_require__){var _classCallCheck=function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor)){throw new TypeError('Cannot call a class as a function');}};var _createClass=(function(){function defineProperties(target,props){for(var i=0;i < props.length;i++) {var descriptor=props[i];descriptor.enumerable = descriptor.enumerable || false;descriptor.configurable = true;if('value' in descriptor)descriptor.writable = true;Object.defineProperty(target,descriptor.key,descriptor);}}return function(Constructor,protoProps,staticProps){if(protoProps)defineProperties(Constructor.prototype,protoProps);if(staticProps)defineProperties(Constructor,staticProps);return Constructor;};})();Object.defineProperty(exports,'__esModule',{value:true});function bubbleUp(heap,weightFunc,n){var element=heap[n];var weight=weightFunc(element);while(n > 0) {var parentN=Math.floor((n + 1) / 2) - 1;var _parent=heap[parentN];if(weight >= weightFunc(_parent)){break;}else {heap[parentN] = element;heap[n] = _parent;n = parentN;}}}var bubbleDown=function bubbleDown(heap,weightFunc,n){var length=heap.length;var node=heap[n];var nodeWeight=weightFunc(node);while(true) {var child2N=(n + 1) * 2,child1N=child2N - 1;var swap=null;if(child1N < length){var child1=heap[child1N],child1Weight=weightFunc(child1);if(child1Weight < nodeWeight){swap = child1N;}}if(child2N < length){var child2=heap[child2N],child2Weight=weightFunc(child2);if(child2Weight < (swap === null?nodeWeight:weightFunc(heap[child1N]))){swap = child2N;}}if(swap === null){break;}else {heap[n] = heap[swap];heap[swap] = node;n = swap;}}};var BinaryHeap=(function(){function BinaryHeap(weightFunc,compareFunc){_classCallCheck(this,BinaryHeap);if(!weightFunc){weightFunc = function(x){return x;};}if(!compareFunc){compareFunc = function(x,y){return x === y;};}if(typeof weightFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "weightFunc" must be a function!');}if(typeof compareFunc !== 'function'){throw new Error('BinaryHeap([weightFunc][, compareFunc]): "compareFunc" must be a function!');}this.weightFunc = weightFunc;this.compareFunc = compareFunc;this.heap = [];}_createClass(BinaryHeap,[{key:'push',value:function push(node){this.heap.push(node);bubbleUp(this.heap,this.weightFunc,this.heap.length - 1);}},{key:'peek',value:function peek(){return this.heap[0];}},{key:'pop',value:function pop(){var front=this.heap[0];var end=this.heap.pop();if(this.heap.length > 0){this.heap[0] = end;bubbleDown(this.heap,this.weightFunc,0);}return front;}},{key:'remove',value:function remove(node){var length=this.heap.length;for(var i=0;i < length;i++) {if(this.compareFunc(this.heap[i],node)){var removed=this.heap[i];var end=this.heap.pop();if(i !== length - 1){this.heap[i] = end;bubbleUp(this.heap,this.weightFunc,i);bubbleDown(this.heap,this.weightFunc,i);}return removed;}}return null;}},{key:'removeAll',value:function removeAll(){this.heap = [];}},{key:'size',value:function size(){return this.heap.length;}}]);return BinaryHeap;})();exports['default'] = BinaryHeap;module.exports = exports['default'];}]));});;},function(module,exports,__webpack_require__){function forEach(arr,callback,thisObj){if(arr == null){return;}var i=-1,len=arr.length;while(++i < len) {if(callback.call(thisObj,arr[i],i,arr) === false){break;}}}module.exports = forEach;},function(module,exports,__webpack_require__){function slice(arr,start,end){var len=arr.length;if(start == null){start = 0;}else if(start < 0){start = Math.max(len + start,0);}else {start = Math.min(start,len);}if(end == null){end = len;}else if(end < 0){end = Math.max(len + end,0);}else {end = Math.min(end,len);}var result=[];while(start < end) {result.push(arr[start++]);}return result;}module.exports = slice;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function contains(arr,val){return indexOf(arr,val) !== -1;}module.exports = contains;},function(module,exports,__webpack_require__){var indexOf=__webpack_require__(20);function remove(arr,item){var idx=indexOf(arr,item);if(idx !== -1)arr.splice(idx,1);}module.exports = remove;},function(module,exports,__webpack_require__){function mergeSort(arr,compareFn){if(arr == null){return [];}else if(arr.length < 2){return arr;}if(compareFn == null){compareFn = defaultCompare;}var mid,left,right;mid = ~ ~(arr.length / 2);left = mergeSort(arr.slice(0,mid),compareFn);right = mergeSort(arr.slice(mid,arr.length),compareFn);return merge(left,right,compareFn);}function defaultCompare(a,b){return a < b?-1:a > b?1:0;}function merge(left,right,compareFn){var result=[];while(left.length && right.length) {if(compareFn(left[0],right[0]) <= 0){result.push(left.shift());}else {result.push(right.shift());}}if(left.length){result.push.apply(result,left);}if(right.length){result.push.apply(result,right);}return result;}module.exports = mergeSort;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var forIn=__webpack_require__(22);function forOwn(obj,fn,thisObj){forIn(obj,function(val,key){if(hasOwn(obj,key)){return fn.call(thisObj,obj[key],key,obj);}});}module.exports = forOwn;},function(module,exports,__webpack_require__){var forOwn=__webpack_require__(13);var isPlainObject=__webpack_require__(23);function deepMixIn(target,objects){var i=0,n=arguments.length,obj;while(++i < n) {obj = arguments[i];if(obj){forOwn(obj,copyProp,target);}}return target;}function copyProp(val,key){var existing=this[key];if(isPlainObject(val) && isPlainObject(existing)){deepMixIn(existing,val);}else {this[key] = val;}}module.exports = deepMixIn;},function(module,exports,__webpack_require__){var slice=__webpack_require__(9);function pick(obj,var_keys){var keys=typeof arguments[1] !== 'string'?arguments[1]:slice(arguments,1),out={},i=0,key;while(key = keys[i++]) {out[key] = obj[key];}return out;}module.exports = pick;},function(module,exports,__webpack_require__){var isPrimitive=__webpack_require__(24);function get(obj,prop){var parts=prop.split('.'),last=parts.pop();while(prop = parts.shift()) {obj = obj[prop];if(obj == null)return;}return obj[last];}module.exports = get;},function(module,exports,__webpack_require__){var namespace=__webpack_require__(25);function set(obj,prop,val){var parts=/^(.+)\.(.+)$/.exec(prop);if(parts){namespace(obj,parts[1])[parts[2]] = val;}else {obj[prop] = val;}}module.exports = set;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var camelCase=__webpack_require__(27);var upperCase=__webpack_require__(19);function pascalCase(str){str = toString(str);return camelCase(str).replace(/^[a-z]/,upperCase);}module.exports = pascalCase;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function upperCase(str){str = toString(str);return str.toUpperCase();}module.exports = upperCase;},function(module,exports,__webpack_require__){function indexOf(arr,item,fromIndex){fromIndex = fromIndex || 0;if(arr == null){return -1;}var len=arr.length,i=fromIndex < 0?len + fromIndex:fromIndex;while(i < len) {if(arr[i] === item){return i;}i++;}return -1;}module.exports = indexOf;},function(module,exports,__webpack_require__){function hasOwn(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}module.exports = hasOwn;},function(module,exports,__webpack_require__){var hasOwn=__webpack_require__(21);var _hasDontEnumBug,_dontEnums;function checkDontEnum(){_dontEnums = ['toString','toLocaleString','valueOf','hasOwnProperty','isPrototypeOf','propertyIsEnumerable','constructor'];_hasDontEnumBug = true;for(var key in {'toString':null}) {_hasDontEnumBug = false;}}function forIn(obj,fn,thisObj){var key,i=0;if(_hasDontEnumBug == null)checkDontEnum();for(key in obj) {if(exec(fn,obj,key,thisObj) === false){break;}}if(_hasDontEnumBug){var ctor=obj.constructor,isProto=!!ctor && obj === ctor.prototype;while(key = _dontEnums[i++]) {if((key !== 'constructor' || !isProto && hasOwn(obj,key)) && obj[key] !== Object.prototype[key]){if(exec(fn,obj,key,thisObj) === false){break;}}}}}function exec(fn,obj,key,thisObj){return fn.call(thisObj,obj[key],key,obj);}module.exports = forIn;},function(module,exports,__webpack_require__){function isPlainObject(value){return !!value && typeof value === 'object' && value.constructor === Object;}module.exports = isPlainObject;},function(module,exports,__webpack_require__){function isPrimitive(value){switch(typeof value){case 'string':case 'number':case 'boolean':return true;}return value == null;}module.exports = isPrimitive;},function(module,exports,__webpack_require__){var forEach=__webpack_require__(8);function namespace(obj,path){if(!path)return obj;forEach(path.split('.'),function(key){if(!obj[key]){obj[key] = {};}obj = obj[key];});return obj;}module.exports = namespace;},function(module,exports,__webpack_require__){function toString(val){return val == null?'':val.toString();}module.exports = toString;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var replaceAccents=__webpack_require__(43);var removeNonWord=__webpack_require__(44);var upperCase=__webpack_require__(19);var lowerCase=__webpack_require__(45);function camelCase(str){str = toString(str);str = replaceAccents(str);str = removeNonWord(str).replace(/[\-_]/g,' ').replace(/\s[a-z]/g,upperCase).replace(/\s+/g,'').replace(/^[A-Z]/g,lowerCase);return str;}module.exports = camelCase;},function(module,exports,__webpack_require__){exports['default'] = defineResource;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);var instanceMethods=['compute','eject','refresh','save','update','destroy','loadRelations','changeHistory','changes','hasChanges','lastModified','lastSaved','previous'];function defineResource(definition){var _this=this;var definitions=_this.defs;if(_utils['default']._s(definition)){definition = {name:definition.replace(/\s/gi,'')};}if(!_utils['default']._o(definition)){throw _utils['default']._oErr('definition');}else if(!_utils['default']._s(definition.name)){throw new _errors['default'].IA('"name" must be a string!');}else if(definitions[definition.name]){throw new _errors['default'].R(definition.name + ' is already registered!');}function Resource(options){this.defaultValues = {};this.methods = {};this.computed = {};_utils['default'].deepMixIn(this,options);var parent=_this.defaults;if(definition['extends'] && definitions[definition['extends']]){parent = definitions[definition['extends']];}_utils['default'].fillIn(this.defaultValues,parent.defaultValues);_utils['default'].fillIn(this.methods,parent.methods);_utils['default'].fillIn(this.computed,parent.computed);this.endpoint = 'endpoint' in options?options.endpoint:this.name;}try{var def;var _class;var _ret=(function(){if(definition['extends'] && definitions[definition['extends']]){Resource.prototype = definitions[definition['extends']];}else {Resource.prototype = _this.defaults;}definitions[definition.name] = new Resource(definition);def = definitions[definition.name];def.getResource = function(resourceName){return _this.defs[resourceName];};def.logFn('Preparing resource.');if(!_utils['default']._s(def.idAttribute)){throw new _errors['default'].IA('"idAttribute" must be a string!');}if(def.relations){def.relationList = [];def.relationFields = [];_utils['default'].forOwn(def.relations,function(relatedModels,type){_utils['default'].forOwn(relatedModels,function(defs,relationName){if(!_utils['default']._a(defs)){relatedModels[relationName] = [defs];}_utils['default'].forEach(relatedModels[relationName],function(d){d.type = type;d.relation = relationName;d.name = def.name;def.relationList.push(d);if(d.localField){def.relationFields.push(d.localField);}});});});if(def.relations.belongsTo){_utils['default'].forOwn(def.relations.belongsTo,function(relatedModel,modelName){_utils['default'].forEach(relatedModel,function(relation){if(relation.parent){def.parent = modelName;def.parentKey = relation.localKey;def.parentField = relation.localField;}});});}if(typeof Object.freeze === 'function'){Object.freeze(def.relations);Object.freeze(def.relationList);}}_class = def['class'] = _utils['default'].pascalCase(def.name);try{if(typeof def.useClass === 'function'){eval('function ' + _class + '() { def.useClass.call(this); }');def[_class] = eval(_class);def[_class].prototype = (function(proto){function Ctor(){}Ctor.prototype = proto;return new Ctor();})(def.useClass.prototype);}else {eval('function ' + _class + '() {}');def[_class] = eval(_class);}}catch(e) {def[_class] = function(){};}_utils['default'].forOwn(def.methods,function(fn,m){def[_class].prototype[m] = fn;});def[_class].prototype.set = function(key,value){var _this2=this;_utils['default'].set(this,key,value);def.compute(this);if(def.instanceEvents){setTimeout(function(){_this2.emit('DS.change',def,_this2);},0);}def.handleChange(this);return this;};def[_class].prototype.get = function(key){return _utils['default'].get(this,key);};if(def.instanceEvents){_utils['default'].Events(def[_class].prototype);}_utils['default'].applyRelationGettersToTarget(_this,def,def[_class].prototype);var parentOmit=null;if(!def.hasOwnProperty('omit')){parentOmit = def.omit;def.omit = [];}else {parentOmit = _this.defaults.omit;}def.omit = def.omit.concat(parentOmit || []);_utils['default'].forOwn(def.computed,function(fn,field){if(_utils['default'].isFunction(fn)){def.computed[field] = [fn];fn = def.computed[field];}if(def.methods && field in def.methods){def.errorFn('Computed property "' + field + '" conflicts with previously defined prototype method!');}def.omit.push(field);var deps;if(fn.length === 1){var match=fn[0].toString().match(/function.*?\(([\s\S]*?)\)/);deps = match[1].split(',');def.computed[field] = deps.concat(fn);fn = def.computed[field];if(deps.length){def.errorFn('Use the computed property array syntax for compatibility with minified code!');}}deps = fn.slice(0,fn.length - 1);_utils['default'].forEach(deps,function(val,index){deps[index] = val.trim();});fn.deps = _utils['default'].filter(deps,function(dep){return !!dep;});});_utils['default'].forEach(instanceMethods,function(name){def[_class].prototype['DS' + _utils['default'].pascalCase(name)] = function(){for(var _len=arguments.length,args=Array(_len),_key=0;_key < _len;_key++) {args[_key] = arguments[_key];}args.unshift(this[def.idAttribute] || this);args.unshift(def.name);return _this[name].apply(_this,args);};});def[_class].prototype.DSCreate = function(){for(var _len2=arguments.length,args=Array(_len2),_key2=0;_key2 < _len2;_key2++) {args[_key2] = arguments[_key2];}args.unshift(this);args.unshift(def.name);return _this.create.apply(_this,args);};_this.s[def.name] = {collection:[],expiresHeap:new _utils['default'].BinaryHeap(function(x){return x.expires;},function(x,y){return x.item === y;}),completedQueries:{},queryData:{},pendingQueries:{},index:{},modified:{},saved:{},previousAttributes:{},observers:{},changeHistories:{},changeHistory:[],collectionModified:0};var resource=_this.s[def.name];if(def.reapInterval){setInterval(function(){return def.reap();},def.reapInterval);}var fns=['registerAdapter','getAdapterName','getAdapter','is'];for(var key in _this) {if(typeof _this[key] === 'function'){fns.push(key);}}_utils['default'].forEach(fns,function(key){var k=key;if(_this[k].shorthand !== false){def[k] = function(){for(var _len3=arguments.length,args=Array(_len3),_key3=0;_key3 < _len3;_key3++) {args[_key3] = arguments[_key3];}args.unshift(def.name);return _this[k].apply(_this,args);};def[k].before = function(fn){var orig=def[k];def[k] = function(){for(var _len4=arguments.length,args=Array(_len4),_key4=0;_key4 < _len4;_key4++) {args[_key4] = arguments[_key4];}return orig.apply(def,fn.apply(def,args) || args);};};}else {def[k] = function(){for(var _len5=arguments.length,args=Array(_len5),_key5=0;_key5 < _len5;_key5++) {args[_key5] = arguments[_key5];}return _this[k].apply(_this,args);};}});def.beforeValidate = _utils['default'].promisify(def.beforeValidate);def.validate = _utils['default'].promisify(def.validate);def.afterValidate = _utils['default'].promisify(def.afterValidate);def.beforeCreate = _utils['default'].promisify(def.beforeCreate);def.afterCreate = _utils['default'].promisify(def.afterCreate);def.beforeUpdate = _utils['default'].promisify(def.beforeUpdate);def.afterUpdate = _utils['default'].promisify(def.afterUpdate);def.beforeDestroy = _utils['default'].promisify(def.beforeDestroy);def.afterDestroy = _utils['default'].promisify(def.afterDestroy);var defaultAdapter=undefined;if(def.hasOwnProperty('defaultAdapter')){defaultAdapter = def.defaultAdapter;}_utils['default'].forOwn(def.actions,function(action,name){if(def[name] && !def.actions[name]){throw new Error('Cannot override existing method "' + name + '"!');}action.request = action.request || function(config){return config;};action.response = action.response || function(response){return response;};action.responseError = action.responseError || function(err){return _utils['default'].Promise.reject(err);};def[name] = function(id,options){if(_utils['default']._o(id)){options = id;}options = options || {};var adapter=def.getAdapter(action.adapter || defaultAdapter || 'http');var config=_utils['default'].deepMixIn({},action);if(!options.hasOwnProperty('endpoint') && config.endpoint){options.endpoint = config.endpoint;}if(typeof options.getEndpoint === 'function'){config.url = options.getEndpoint(def,options);}else {var args=[options.basePath || adapter.defaults.basePath || def.basePath,adapter.getEndpoint(def,_utils['default']._sn(id)?id:null,options)];if(_utils['default']._sn(id)){args.push(id);}args.push(action.pathname || name);config.url = _utils['default'].makePath.apply(null,args);}config.method = config.method || 'GET';_utils['default'].deepMixIn(config,options);return new _utils['default'].Promise(function(r){return r(config);}).then(options.request || action.request).then(function(config){return adapter.HTTP(config);}).then(options.response || action.response,options.responseError || action.responseError);};});_utils['default'].Events(def);def.handleChange = function(data){resource.collectionModified = _utils['default'].updateTimestamp(resource.collectionModified);if(def.notify){setTimeout(function(){def.emit('DS.change',def,data);},0);}};def.logFn('Done preparing resource.');return {v:def};})();if(typeof _ret === 'object')return _ret.v;}catch(err) {_this.defaults.errorFn(err);delete definitions[definition.name];delete _this.s[definition.name];throw err;}}},function(module,exports,__webpack_require__){exports['default'] = eject;function eject(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined;var found=false;id = DSUtils.resolveId(definition,id);if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._sn(id)){throw DSUtils._snErr('id');}options = DSUtils._(definition,options);options.logFn('eject',id,options);for(var i=0;i < resource.collection.length;i++) {if(resource.collection[i][definition.idAttribute] == id){item = resource.collection[i];resource.expiresHeap.remove(item);found = true;break;}}if(found){var _ret=(function(){definition.beforeEject(options,item);if(options.notify){definition.emit('DS.beforeEject',definition,item);}var toRemove=[];DSUtils.forOwn(resource.queryData,function(items,queryHash){if(items.$$injected){DSUtils.remove(items,item);}if(!items.length && options.clearEmptyQueries){toRemove.push(queryHash);}});DSUtils.forEach(resource.changeHistories[id],function(changeRecord){DSUtils.remove(resource.changeHistory,changeRecord);});DSUtils.forEach(toRemove,function(queryHash){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];});if(DSUtils.w){resource.observers[id].close();}delete resource.observers[id];delete resource.index[id];delete resource.previousAttributes[id];delete resource.completedQueries[id];delete resource.pendingQueries[id];delete resource.changeHistories[id];delete resource.modified[id];delete resource.saved[id];resource.collection.splice(i,1);definition.handleChange(item);definition.afterEject(options,item);if(options.notify){definition.emit('DS.afterEject',definition,item);}return {v:item};})();if(typeof _ret === 'object')return _ret.v;}}},function(module,exports,__webpack_require__){exports['default'] = ejectAll;function ejectAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];params = params || {};if(!definition){throw new _this.errors.NER(resourceName);}else if(!DSUtils._o(params)){throw DSUtils._oErr('params');}definition.logFn('ejectAll',params,options);var resource=_this.s[resourceName];var queryHash=DSUtils.toJson(params);var items=definition.filter(params);var ids=[];if(DSUtils.isEmpty(params)){resource.completedQueries = {};}else {delete resource.completedQueries[queryHash];}DSUtils.forEach(items,function(item){if(item && item[definition.idAttribute]){ids.push(item[definition.idAttribute]);}});DSUtils.forEach(ids,function(id){definition.eject(id,options);});definition.handleChange(items);return items;}},function(module,exports,__webpack_require__){exports['default'] = filter;function filter(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];if(!definition){throw new _this.errors.NER(resourceName);}else if(params && !DSUtils._o(params)){throw DSUtils._oErr('params');}params = params || {};options = DSUtils._(definition,options);options.logFn('filter',params,options);return definition.defaultFilter.call(_this,_this.s[resourceName].collection,resourceName,params,options);}},function(module,exports,__webpack_require__){exports['default'] = inject;var _utils=__webpack_require__(2);var _errors=__webpack_require__(3);function makeObserverHandler(definition,resource){var DS=this;var name=definition.name;return function _react(added,removed,changed,oldValueFn,firstTime){var target=this;var item=undefined;var innerId=oldValueFn && oldValueFn(definition.idAttribute)?oldValueFn(definition.idAttribute):target[definition.idAttribute];_utils['default'].forEach(definition.relationFields,function(field){delete added[field];delete removed[field];delete changed[field];});if(!_utils['default'].isEmpty(added) || !_utils['default'].isEmpty(removed) || !_utils['default'].isEmpty(changed) || firstTime){item = DS.get(name,innerId);resource.modified[innerId] = _utils['default'].updateTimestamp(resource.modified[innerId]);if(item && definition.instanceEvents){setTimeout(function(){item.emit('DS.change',definition,item);},0);}definition.handleChange(item);if(definition.keepChangeHistory){var changeRecord={resourceName:name,target:item,added:added,removed:removed,changed:changed,timestamp:resource.modified[innerId]};resource.changeHistories[innerId].push(changeRecord);resource.changeHistory.push(changeRecord);}}if(definition.computed){item = item || DS.get(name,innerId);_utils['default'].forOwn(definition.computed,function(fn,field){var compute=false;_utils['default'].forEach(fn.deps,function(dep){if(dep in added || dep in removed || dep in changed || !(field in item)){compute = true;}});compute = compute || !fn.deps.length;if(compute){_utils['default'].compute.call(item,fn,field);}});}if(definition.idAttribute in changed){definition.errorFn('Doh! You just changed the primary key of an object! Your data for the "' + name + '" resource is now in an undefined (probably broken) state.');}};}function _inject(definition,resource,attrs,options){var _this=this;var injected=undefined;if(_utils['default']._a(attrs)){injected = [];for(var i=0;i < attrs.length;i++) {injected.push(_inject.call(_this,definition,resource,attrs[i],options));}}else {var _react=makeObserverHandler.call(_this,definition,resource);var c=definition.computed;var idA=definition.idAttribute;if(c && c[idA]){(function(){var args=[];_utils['default'].forEach(c[idA].deps,function(dep){args.push(attrs[dep]);});attrs[idA] = c[idA][c[idA].length - 1].apply(attrs,args);})();}if(!(idA in attrs)){var error=new _errors['default'].R(definition.name + '.inject: "attrs" must contain the property specified by "idAttribute"!');options.errorFn(error);throw error;}else {try{(function(){_utils['default'].forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=_this.defs[relationName];var toInject=attrs[def.localField];if(toInject){if(!relationDef){throw new _errors['default'].R(definition.name + ' relation is defined but the resource is not!');}if(_utils['default']._a(toInject)){(function(){var items=[];_utils['default'].forEach(toInject,function(toInjectItem){if(toInjectItem !== _this.s[relationName].index[toInjectItem[relationDef.idAttribute]]){try{var injectedItem=relationDef.inject(toInjectItem,options.orig());if(def.foreignKey){injectedItem[def.foreignKey] = attrs[definition.idAttribute];}items.push(injectedItem);}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}});})();}else {if(toInject !== _this.s[relationName].index[toInject[relationDef.idAttribute]]){try{var _injected=relationDef.inject(attrs[def.localField],options.orig());if(def.foreignKey){_injected[def.foreignKey] = attrs[definition.idAttribute];}}catch(err) {options.errorFn(err,'Failed to inject ' + def.type + ' relation: "' + relationName + '"!');}}}}});var id=attrs[idA];var item=definition.get(id);var initialLastModified=item?resource.modified[id]:0;if(!item){if(attrs instanceof definition[definition['class']]){item = attrs;}else {item = new definition[definition['class']]();}_utils['default'].forEach(definition.relationList,function(def){delete attrs[def.localField];});_utils['default'].deepMixIn(item,attrs);resource.collection.push(item);resource.changeHistories[id] = [];if(_utils['default'].w){resource.observers[id] = new _this.observe.ObjectObserver(item);resource.observers[id].open(_react,item);}resource.index[id] = item;_react.call(item,{},{},{},null,true);resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);}else {if(options.onConflict === 'merge'){_utils['default'].deepMixIn(item,attrs);}else if(options.onConflict === 'replace'){_utils['default'].forOwn(item,function(v,k){if(k !== definition.idAttribute){if(!attrs.hasOwnProperty(k)){delete item[k];}}});_utils['default'].forOwn(attrs,function(v,k){if(k !== definition.idAttribute){item[k] = v;}});}if(definition.resetHistoryOnInject){resource.previousAttributes[id] = _utils['default'].copy(item,null,null,null,definition.relationFields);if(resource.changeHistories[id].length){_utils['default'].forEach(resource.changeHistories[id],function(changeRecord){_utils['default'].remove(resource.changeHistory,changeRecord);});resource.changeHistories[id].splice(0,resource.changeHistories[id].length);}}if(_utils['default'].w){resource.observers[id].deliver();}}resource.modified[id] = initialLastModified && resource.modified[id] === initialLastModified?_utils['default'].updateTimestamp(resource.modified[id]):resource.modified[id];resource.expiresHeap.remove(item);var timestamp=new Date().getTime();resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});injected = item;})();}catch(err) {options.errorFn(err,attrs);}}}return injected;}function inject(resourceName,attrs,options){var _this=this;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var injected=undefined;if(!definition){throw new _errors['default'].NER(resourceName);}else if(!_utils['default']._o(attrs) && !_utils['default']._a(attrs)){throw new _errors['default'].IA(resourceName + '.inject: "attrs" must be an object or an array!');}options = _utils['default']._(definition,options);options.logFn('inject',attrs,options);options.beforeInject(options,attrs);if(options.notify){definition.emit('DS.beforeInject',definition,attrs);}injected = _inject.call(_this,definition,resource,attrs,options);definition.handleChange(injected);options.afterInject(options,injected);if(options.notify){definition.emit('DS.afterInject',definition,injected);}return injected;}},function(module,exports,__webpack_require__){exports['default'] = create;function create(resourceName,attrs,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var adapter=undefined;options = options || {};attrs = attrs || {};var rejectionError=undefined;if(!definition){rejectionError = new _this.errors.NER(resourceName);}else if(!DSUtils._o(attrs)){rejectionError = DSUtils._oErr('attrs');}else {options = DSUtils._(definition,options);if(options.upsert && DSUtils._sn(attrs[definition.idAttribute])){return _this.update(resourceName,attrs[definition.idAttribute],attrs,options);}options.logFn('create',attrs,options);}return new DSUtils.Promise(function(resolve,reject){if(rejectionError){reject(rejectionError);}else {resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeCreate',definition,attrs);}adapter = _this.getAdapterName(options);return _this.adapters[adapter].create(definition,DSUtils.omit(attrs,options.omit),options);}).then(function(attrs){return options.afterCreate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.afterCreate',definition,attrs);}if(options.cacheResponse){var created=_this.inject(definition.name,attrs,options.orig());var id=created[definition.idAttribute];var resource=_this.s[resourceName];resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return created;}else {return _this.createInstance(resourceName,attrs,options);}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = destroy;function destroy(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var item=undefined;var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {item = definition.get(id) || {id:id};options = DSUtils._(definition,options);options.logFn('destroy',id,options);resolve(item);}}).then(function(attrs){return options.beforeDestroy.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeDestroy',definition,attrs);}if(options.eagerEject){definition.eject(id);}adapter = definition.getAdapter(options);return adapter.destroy(definition,id,options);}).then(function(){return options.afterDestroy.call(item,options,item);}).then(function(item){if(options.notify){definition.emit('DS.afterDestroy',definition,item);}definition.eject(id);return DSUtils.respond(id,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && item){definition.inject(item,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = destroyAll;function destroyAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var ejected=undefined,toEject=undefined,adapter=undefined;params = params || {};return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('attrs'));}else {options = DSUtils._(definition,options);options.logFn('destroyAll',params,options);resolve();}}).then(function(){toEject = definition.defaultFilter.call(_this,resourceName,params);return options.beforeDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.beforeDestroy',definition,toEject);}if(options.eagerEject){ejected = definition.ejectAll(params);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].destroyAll(definition,params,options);}).then(function(){return options.afterDestroy(options,toEject);}).then(function(){if(options.notify){definition.emit('DS.afterDestroy',definition,toEject);}return ejected || definition.ejectAll(params);}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(options && options.eagerEject && ejected){definition.inject(ejected,{notify:false});}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = find;function find(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('find',id,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[id];}if((!options.findStrictCache || id in resource.completedQueries) && definition.get(id) && !options.bypassCache){resolve(definition.get(id));}else {delete resource.completedQueries[id];resolve();}}}).then(function(item){if(!item){if(!(id in resource.pendingQueries)){var promise=undefined;var strategy=options.findStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].find(definition,id,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].find(definition,id,options);}resource.pendingQueries[id] = promise.then(function(data){delete resource.pendingQueries[id];if(options.cacheResponse){var injected=definition.inject(data,options.orig());resource.completedQueries[id] = new Date().getTime();resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);return injected;}else {return definition.createInstance(data,options.orig());}});}return resource.pendingQueries[id];}else {return item;}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[id];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = findAll;function processResults(data,resourceName,queryHash,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var idAttribute=_this.defs[resourceName].idAttribute;var date=new Date().getTime();data = data || [];delete resource.pendingQueries[queryHash];resource.completedQueries[queryHash] = date;var injected=definition.inject(data,options.orig());if(DSUtils._a(injected)){DSUtils.forEach(injected,function(item){if(item){var id=item[idAttribute];if(id){resource.completedQueries[id] = date;resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);}}});}else {options.errorFn('response is expected to be an array!');resource.completedQueries[injected[idAttribute]] = date;}return injected;}function findAll(resourceName,params,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var queryHash=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){params = params || {};if(!_this.defs[resourceName]){reject(new _this.errors.NER(resourceName));}else if(!DSUtils._o(params)){reject(DSUtils._oErr('params'));}else {options = DSUtils._(definition,options);queryHash = DSUtils.toJson(params);options.logFn('findAll',params,options);if(options.params){options.params = DSUtils.copy(options.params);}if(options.bypassCache || !options.cacheResponse){delete resource.completedQueries[queryHash];delete resource.queryData[queryHash];}if(queryHash in resource.completedQueries){if(options.useFilter){resolve(definition.filter(params,options.orig()));}else {resolve(resource.queryData[queryHash]);}}else {resolve();}}}).then(function(items){if(!(queryHash in resource.completedQueries)){if(!(queryHash in resource.pendingQueries)){var promise=undefined;var strategy=options.findAllStrategy || options.strategy;if(strategy === 'fallback'){(function(){var makeFallbackCall=function makeFallbackCall(index){adapter = definition.getAdapterName((options.findAllFallbackAdapters || options.fallbackAdapters)[index]);return _this.adapters[adapter].findAll(definition,params,options)['catch'](function(err){index++;if(index < options.fallbackAdapters.length){return makeFallbackCall(index);}else {return DSUtils.Promise.reject(err);}});};promise = makeFallbackCall(0);})();}else {adapter = definition.getAdapterName(options);promise = _this.adapters[adapter].findAll(definition,params,options);}resource.pendingQueries[queryHash] = promise.then(function(data){delete resource.pendingQueries[queryHash];if(options.cacheResponse){resource.queryData[queryHash] = processResults.call(_this,data,resourceName,queryHash,options);resource.queryData[queryHash].$$injected = true;return resource.queryData[queryHash];}else {DSUtils.forEach(data,function(item,i){data[i] = definition.createInstance(item,options.orig());});return data;}});}return resource.pendingQueries[queryHash];}else {return items;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);})['catch'](function(err){if(resource){delete resource.pendingQueries[queryHash];}return DSUtils.Promise.reject(err);});}},function(module,exports,__webpack_require__){exports['default'] = loadRelations;function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true});}else {obj[key] = value;}return obj;}function loadRelations(resourceName,instance,relations,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];return new DSUtils.Promise(function(resolve,reject){if(DSUtils._sn(instance)){instance = definition.get(instance);}if(DSUtils._s(relations)){relations = [relations];}relations = relations || [];if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._o(instance)){reject(new DSErrors.IA('"instance(id)" must be a string, number or object!'));}else if(!DSUtils._a(relations)){reject(new DSErrors.IA('"relations" must be a string or an array!'));}else {(function(){var _options=DSUtils._(definition,options);_options.logFn('loadRelations',instance,relations,_options);var tasks=[];DSUtils.forEach(definition.relationList,function(def){var relationName=def.relation;var relationDef=definition.getResource(relationName);var __options=DSUtils._(relationDef,options);if(!relations.length || DSUtils.contains(relations,relationName) || DSUtils.contains(relations,def.localField)){var task=undefined;var params={};if(__options.allowSimpleWhere){params[def.foreignKey] = instance[definition.idAttribute];}else {params.where = {};params.where[def.foreignKey] = {'==':instance[definition.idAttribute]};}if(def.type === 'hasMany'){if(def.localKeys){delete params[def.foreignKey];params.where = _defineProperty({},relationDef.idAttribute,{'in':instance[def.localKeys]});}task = relationDef.findAll(params,__options.orig());}else if(def.type === 'hasOne'){if(def.localKey && instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}else if(def.foreignKey){task = relationDef.findAll(params,__options.orig()).then(function(hasOnes){return hasOnes.length?hasOnes[0]:null;});}}else if(instance[def.localKey]){task = relationDef.find(instance[def.localKey],__options.orig());}if(task){tasks.push(task);}}});resolve(tasks);})();}}).then(function(tasks){return DSUtils.Promise.all(tasks);}).then(function(){return instance;});}},function(module,exports,__webpack_require__){exports['default'] = reap;function reap(resourceName,options){var _this=this;var DSUtils=_this.utils;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new _this.errors.NER(resourceName));}else {options = DSUtils._(definition,options);if(!options.hasOwnProperty('notify')){options.notify = false;}options.logFn('reap',options);var items=[];var now=new Date().getTime();var expiredItem=undefined;while((expiredItem = resource.expiresHeap.peek()) && expiredItem.expires < now) {items.push(expiredItem.item);delete expiredItem.item;resource.expiresHeap.pop();}resolve(items);}}).then(function(items){if(items.length){definition.beforeReap(options,items);if(options.notify){definition.emit('DS.beforeReap',definition,items);}}if(options.reapAction === 'inject'){(function(){var timestamp=new Date().getTime();DSUtils.forEach(items,function(item){resource.expiresHeap.push({item:item,timestamp:timestamp,expires:definition.maxAge?timestamp + definition.maxAge:Number.MAX_VALUE});});})();}else if(options.reapAction === 'eject'){DSUtils.forEach(items,function(item){definition.eject(item[definition.idAttribute]);});}else if(options.reapAction === 'refresh'){var _ret2=(function(){var tasks=[];DSUtils.forEach(items,function(item){tasks.push(definition.refresh(item[definition.idAttribute]));});return {v:DSUtils.Promise.all(tasks)};})();if(typeof _ret2 === 'object')return _ret2.v;}return items;}).then(function(items){if(items.length){definition.afterReap(options,items);if(options.notify){definition.emit('DS.afterReap',definition,items);}}return items;});}},function(module,exports,__webpack_require__){exports['default'] = save;function save(resourceName,id,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var resource=_this.s[resourceName];var item=undefined,noChanges=undefined,adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else if(!definition.get(id)){reject(new DSErrors.R('id "' + id + '" not found in cache!'));}else {item = definition.get(id);options = DSUtils._(definition,options);options.logFn('save',id,options);resolve(item);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}if(options.changesOnly){if(DSUtils.w){resource.observers[id].deliver();}var toKeep=[];var changes=definition.changes(id);for(var key in changes.added) {toKeep.push(key);}for(key in changes.changed) {toKeep.push(key);}changes = DSUtils.pick(attrs,toKeep);if(DSUtils.isEmpty(changes)){options.logFn('save - no changes',id,options);noChanges = true;return attrs;}else {attrs = changes;}}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(noChanges){return attrs;}else if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = update;function update(resourceName,id,attrs,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){id = DSUtils.resolveId(definition,id);if(!definition){reject(new DSErrors.NER(resourceName));}else if(!DSUtils._sn(id)){reject(DSUtils._snErr('id'));}else {options = DSUtils._(definition,options);options.logFn('update',id,attrs,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].update(definition,id,DSUtils.omit(attrs,options.omit),options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(attrs){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}if(options.cacheResponse){var injected=definition.inject(attrs,options.orig());var resource=_this.s[resourceName];var _id=injected[definition.idAttribute];resource.saved[_id] = DSUtils.updateTimestamp(resource.saved[_id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[_id] = DSUtils.copy(injected,null,null,null,definition.relationFields);}return injected;}else {return definition.createInstance(attrs,options.orig());}}).then(function(item){return DSUtils.respond(item,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){exports['default'] = updateAll;function updateAll(resourceName,attrs,params,options){var _this=this;var DSUtils=_this.utils;var DSErrors=_this.errors;var definition=_this.defs[resourceName];var adapter=undefined;return new DSUtils.Promise(function(resolve,reject){if(!definition){reject(new DSErrors.NER(resourceName));}else {options = DSUtils._(definition,options);options.logFn('updateAll',attrs,params,options);resolve(attrs);}}).then(function(attrs){return options.beforeValidate.call(attrs,options,attrs);}).then(function(attrs){return options.validate.call(attrs,options,attrs);}).then(function(attrs){return options.afterValidate.call(attrs,options,attrs);}).then(function(attrs){return options.beforeUpdate.call(attrs,options,attrs);}).then(function(attrs){if(options.notify){definition.emit('DS.beforeUpdate',definition,attrs);}adapter = definition.getAdapterName(options);return _this.adapters[adapter].updateAll(definition,DSUtils.omit(attrs,options.omit),params,options);}).then(function(data){return options.afterUpdate.call(data,options,data);}).then(function(data){if(options.notify){definition.emit('DS.afterUpdate',definition,attrs);}var origOptions=options.orig();if(options.cacheResponse){var _ret=(function(){var injected=definition.inject(data,origOptions);var resource=_this.s[resourceName];DSUtils.forEach(injected,function(i){var id=i[definition.idAttribute];resource.saved[id] = DSUtils.updateTimestamp(resource.saved[id]);if(!definition.resetHistoryOnInject){resource.previousAttributes[id] = DSUtils.copy(i,null,null,null,definition.relationFields);}});return {v:injected};})();if(typeof _ret === 'object')return _ret.v;}else {var _ret2=(function(){var instances=[];DSUtils.forEach(data,function(item){instances.push(definition.createInstance(item,origOptions));});return {v:instances};})();if(typeof _ret2 === 'object')return _ret2.v;}}).then(function(items){return DSUtils.respond(items,{adapter:adapter},options);});}},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function replaceAccents(str){str = toString(str);if(str.search(/[\xC0-\xFF]/g) > -1){str = str.replace(/[\xC0-\xC5]/g,'A').replace(/[\xC6]/g,'AE').replace(/[\xC7]/g,'C').replace(/[\xC8-\xCB]/g,'E').replace(/[\xCC-\xCF]/g,'I').replace(/[\xD0]/g,'D').replace(/[\xD1]/g,'N').replace(/[\xD2-\xD6\xD8]/g,'O').replace(/[\xD9-\xDC]/g,'U').replace(/[\xDD]/g,'Y').replace(/[\xDE]/g,'P').replace(/[\xE0-\xE5]/g,'a').replace(/[\xE6]/g,'ae').replace(/[\xE7]/g,'c').replace(/[\xE8-\xEB]/g,'e').replace(/[\xEC-\xEF]/g,'i').replace(/[\xF1]/g,'n').replace(/[\xF2-\xF6\xF8]/g,'o').replace(/[\xF9-\xFC]/g,'u').replace(/[\xFE]/g,'p').replace(/[\xFD\xFF]/g,'y');}return str;}module.exports = replaceAccents;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);var PATTERN=/[^\x20\x2D0-9A-Z\x5Fa-z\xC0-\xD6\xD8-\xF6\xF8-\xFF]/g;function removeNonWord(str){str = toString(str);return str.replace(PATTERN,'');}module.exports = removeNonWord;},function(module,exports,__webpack_require__){var toString=__webpack_require__(26);function lowerCase(str){str = toString(str);return str.toLowerCase();}module.exports = lowerCase;}]));}); - -/***/ } -/******/ ]); \ No newline at end of file From c3558a6b4ed3ef087cb53fa713ab6609ce1f53e0 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Thu, 2 Jul 2015 19:33:19 -0400 Subject: [PATCH 8/9] Stable Version 3.0.0 --- CHANGELOG.md | 4 ++++ bower.json | 4 ++-- package.json | 6 +++--- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c1652ad..a2352b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +##### 3.0.0 - 02 July 2015 + +Stable Version 3.0.0 + ##### 3.0.0-rc.1 - 28 June 2015 Stable Version 3.0.0-rc.1 diff --git a/bower.json b/bower.json index c5ea6fd..5679625 100644 --- a/bower.json +++ b/bower.json @@ -22,8 +22,8 @@ "angular-mocks-1.3.2": "angular-mocks#1.3.2" }, "dependencies": { - "js-data": "2.0.0-rc.1", - "js-data-http": "2.0.0-rc.1", + "js-data": ">=2.0.0", + "js-data-http": ">=2.0.0", "angular": ">=1.1.0" } } diff --git a/package.json b/package.json index fed3d8b..6e60a6e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "js-data-angular", "description": "Angular wrapper for js-data.", - "version": "3.0.0-rc.1", + "version": "3.0.0", "homepage": "http://www.js-data.io/docs/js-data-angular", "repository": { "type": "git", @@ -49,9 +49,9 @@ }, "peerDependencies": { "angular": ">=1.1.0", - "js-data": "2.0.0-rc.1" + "js-data": ">=2.0.0" }, "dependencies": { - "js-data-http": "2.0.0-rc.1" + "js-data-http": ">=2.0.0" } } From 65dbe3e4ee4ee5f45330e24a4014b2baa7082640 Mon Sep 17 00:00:00 2001 From: Jason Dobry Date: Thu, 2 Jul 2015 19:35:42 -0400 Subject: [PATCH 9/9] 3.0.0 --- README.md | 2 ++ dist/js-data-angular.js | 2 +- dist/js-data-angular.min.js | 2 +- package.json | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index caf9d4d..2b68e74 100644 --- a/README.md +++ b/README.md @@ -99,6 +99,8 @@ app.controller('postCtrl', function ($scope, $routeParams, Post, Comment) { [CHANGELOG.md](https://github.com/js-data/js-data-angular/blob/master/CHANGELOG.md) ### Community +- [Gitter Channel](https://gitter.im/js-data/js-data) - Better than IRC! +- [Announcements](http://www.js-data.io/blog) - [Mailing List](https://groups.io/org/groupsio/jsdata) - Ask your questions! - [Issues](https://github.com/js-data/js-data-angular/issues) - Found a bug? Feature request? Submit an issue! - [GitHub](https://github.com/js-data/js-data-angular) - View the source code for js-data. diff --git a/dist/js-data-angular.js b/dist/js-data-angular.js index c8d910f..988d5ee 100644 --- a/dist/js-data-angular.js +++ b/dist/js-data-angular.js @@ -1,6 +1,6 @@ /*! * js-data-angular - * @version 3.0.0-rc.1 - Homepage + * @version 3.0.0 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT diff --git a/dist/js-data-angular.min.js b/dist/js-data-angular.min.js index 6930ad8..1d88e7c 100644 --- a/dist/js-data-angular.min.js +++ b/dist/js-data-angular.min.js @@ -1,6 +1,6 @@ /*! * js-data-angular -* @version 3.0.0-rc.1 - Homepage +* @version 3.0.0 - Homepage * @author Jason Dobry * @copyright (c) 2014-2015 Jason Dobry * @license MIT diff --git a/package.json b/package.json index 6e60a6e..a347d37 100644 --- a/package.json +++ b/package.json @@ -26,9 +26,9 @@ "grunt-contrib-clean": "0.6.0", "grunt-contrib-uglify": "0.9.1", "grunt-contrib-watch": "0.6.1", - "grunt-karma": "0.11.1", + "grunt-karma": "0.11.2", "grunt-karma-coveralls": "2.5.3", - "grunt-webpack": "1.0.10", + "grunt-webpack": "1.0.11", "jit-grunt": "0.9.1", "jshint-loader": "0.8.3", "karma": "0.12.37",