├── css ├── .gitkeep └── app.css ├── partials ├── partial1.html └── partial2.html ├── js ├── services │ ├── version.js │ ├── index.js │ └── module.js ├── controllers │ ├── my-ctrl-1.js │ ├── my-ctrl-2.js │ ├── index.js │ └── module.js ├── filters │ ├── index.js │ ├── interpolate.js │ └── module.js ├── directives │ ├── index.js │ ├── app-version.js │ └── module.js ├── app.js ├── bootstrap.js ├── main.js └── routes.js ├── lib ├── angular │ ├── bower.json │ ├── .bower.json │ ├── angular-ui-router.js │ └── angular.min.js ├── requirejs-domready │ ├── package.json │ ├── .bower.json │ ├── README.md │ ├── LICENSE │ └── domReady.js └── requirejs │ ├── package.json │ ├── .gitignore │ ├── testBaseUrl.js │ ├── .bower.json │ ├── index.html │ ├── tasks.txt │ ├── updatesubs.sh │ ├── README.md │ └── LICENSE ├── bower.json ├── readme.md └── index.html /css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /partials/partial1.html: -------------------------------------------------------------------------------- 1 |

This is the partial for view 1.

2 | -------------------------------------------------------------------------------- /js/services/version.js: -------------------------------------------------------------------------------- 1 | define(['./module'], function (services) { 2 | 'use strict'; 3 | services.value('version', '0.1'); 4 | }); 5 | -------------------------------------------------------------------------------- /lib/angular/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.0.8", 4 | "main": "./angular.js", 5 | "dependencies": { 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /lib/requirejs-domready/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "volo": { 3 | "url": "https://raw.github.com/requirejs/domReady/{version}/domReady.js" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /js/controllers/my-ctrl-1.js: -------------------------------------------------------------------------------- 1 | define(['./module'], function (controllers) { 2 | 'use strict'; 3 | controllers.controller('MyCtrl1', ['$scope',function ($scope) {}]); 4 | }); 5 | -------------------------------------------------------------------------------- /lib/requirejs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "volo": { 3 | "url": "https://raw.github.com/jrburke/requirejs/{version}/require.js" 4 | }, 5 | "main": "require.js" 6 | } 7 | -------------------------------------------------------------------------------- /partials/partial2.html: -------------------------------------------------------------------------------- 1 |

This is the partial for view 2.

2 |

3 | Showing of 'interpolate' filter: 4 | {{ 'Current version is v%VERSION%.' | interpolate }} 5 |

6 | -------------------------------------------------------------------------------- /js/controllers/my-ctrl-2.js: -------------------------------------------------------------------------------- 1 | define(['./module'], function (controllers) { 2 | 'use strict'; 3 | controllers.controller('MyCtrl2', ['$scope',function ($scope) { 4 | 5 | 6 | }]); 7 | }); 8 | -------------------------------------------------------------------------------- /lib/requirejs/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | docs/jquery-require-sample/webapp-build/ 3 | docs/jquery-require-sample/dist 4 | dist/dist-site/ 5 | dist/dist-build/ 6 | shrinktest.sh 7 | tests/layers/allplugins-require.js 8 | tests/packages/optimizing/built/ 9 | -------------------------------------------------------------------------------- /js/filters/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * attach filters to this module 3 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 4 | * properly referenced in one of the module dependencies in the array. 5 | **/ 6 | define(['./interpolate'], function () {}); 7 | -------------------------------------------------------------------------------- /lib/requirejs/testBaseUrl.js: -------------------------------------------------------------------------------- 1 | define([], function() { 2 | doh.register( 3 | "testBaseUrl", 4 | [ 5 | function testBaseUrl(t){ 6 | t.is(true, true); 7 | } 8 | ] 9 | ); 10 | doh.run(); 11 | }); -------------------------------------------------------------------------------- /js/directives/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * attach directives to this module 3 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 4 | * properly referenced in one of the module dependencies in the array. 5 | **/ 6 | define(['./app-version'], function () {}); 7 | -------------------------------------------------------------------------------- /js/directives/app-version.js: -------------------------------------------------------------------------------- 1 | define(['./module'], function (directives) { 2 | 'use strict'; 3 | directives.directive('appVersion', ['version', function (version) { 4 | return function (scope, elm) { 5 | elm.text(version); 6 | }; 7 | }]); 8 | }); 9 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "AngularJS + RequireJS Example", 3 | "version": "0.1", 4 | "main": "index.html", 5 | "ignore": [ 6 | "**/.*", 7 | "libs" 8 | ], 9 | "dependencies": { 10 | "angular": "~1.0.8", 11 | "requirejs": "~2.1.8", 12 | "requirejs-domready": "~2.0.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /js/filters/interpolate.js: -------------------------------------------------------------------------------- 1 | define(['./module'], function (filters) { 2 | 'use strict'; 3 | 4 | return filters.filter('interpolate', ['version', function (version) { 5 | return function (text) { 6 | return String(text).replace(/\%VERSION\%/mg, version); 7 | } 8 | }]); 9 | }); 10 | -------------------------------------------------------------------------------- /js/filters/module.js: -------------------------------------------------------------------------------- 1 | /** attach filters to this module 2 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 3 | * properly referenced in one of the module dependencies in the array. 4 | **/ 5 | define(['angular'], function (ng) { 6 | 'use strict'; 7 | return ng.module('app.filters', []); 8 | }); 9 | -------------------------------------------------------------------------------- /js/directives/module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * attach directives to this module 3 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 4 | * properly referenced in one of the module dependencies in the array. 5 | **/ 6 | define(['angular'], function (ng) { 7 | 'use strict'; 8 | return ng.module('app.directives', []); 9 | }); 10 | -------------------------------------------------------------------------------- /js/services/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * attach services to this module 3 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 4 | * properly referenced in one of the module dependencies in the array. 5 | * below, you can see we bring in our services and constants modules 6 | * which avails each service of, for example, the `config` constants object. 7 | **/ 8 | define(['./version'], function () {}); 9 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | It's a improvement in angular+require seed. 2 | I make ui-router into require.js. 3 | 4 | See [Angular + Require](http://www.startersquad.com/blog/angular-require/) post on [StarterSquad blog](http://www.startersquad.com/blog/). 5 | 6 | Example of Angular + Require usage - shows how to enabled RequireJS for Angular Seed. 7 | 8 | See this example [in browser](www.startersquad.com/examples/angularjs-requirejs-2/index-async.html). 9 | -------------------------------------------------------------------------------- /lib/requirejs/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "requirejs", 3 | "homepage": "https://github.com/jrburke/requirejs", 4 | "version": "2.1.8", 5 | "_release": "2.1.8", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "2.1.8", 9 | "commit": "2b083dbb358e8c1876b059434d4b571d8f87534a" 10 | }, 11 | "_source": "git://github.com/jrburke/requirejs.git", 12 | "_target": "~2.1.6", 13 | "_originalSource": "requirejs" 14 | } -------------------------------------------------------------------------------- /js/controllers/index.js: -------------------------------------------------------------------------------- 1 | /** attach controllers to this module 2 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 3 | * properly referenced in one of the module dependencies in the array. 4 | * below, you can see we bring in our services and constants modules 5 | * which avails each controller of, for example, the `config` constants object. 6 | **/ 7 | define([ 8 | './my-ctrl-1', 9 | './my-ctrl-2' 10 | ], function () {}); 11 | -------------------------------------------------------------------------------- /lib/requirejs-domready/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "requirejs-domready", 3 | "homepage": "https://github.com/requirejs/domReady", 4 | "version": "2.0.1", 5 | "_release": "2.0.1", 6 | "_resolution": { 7 | "type": "version", 8 | "tag": "2.0.1", 9 | "commit": "850d9c92541afac5d9c64506736272cdbf7a3ae5" 10 | }, 11 | "_source": "git://github.com/requirejs/domReady.git", 12 | "_target": "~2.0.1", 13 | "_originalSource": "requirejs-domready" 14 | } -------------------------------------------------------------------------------- /js/services/module.js: -------------------------------------------------------------------------------- 1 | /** 2 | * attach services to this module 3 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 4 | * properly referenced in one of the module dependencies in the array. 5 | * below, you can see we bring in our services and constants modules 6 | * which avails each service of, for example, the `config` constants object. 7 | **/ 8 | define(['angular'], function (ng) { 9 | 'use strict'; 10 | return ng.module('app.services', []); 11 | }); 12 | -------------------------------------------------------------------------------- /lib/angular/.bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "angular", 3 | "version": "1.0.8", 4 | "main": "./angular.js", 5 | "dependencies": {}, 6 | "homepage": "https://github.com/angular/bower-angular", 7 | "_release": "1.0.8", 8 | "_resolution": { 9 | "type": "version", 10 | "tag": "v1.0.8", 11 | "commit": "b2006330eef656b8e89a883feff7d7d2f3e5afed" 12 | }, 13 | "_source": "git://github.com/angular/bower-angular.git", 14 | "_target": "~1.0.7", 15 | "_originalSource": "angular" 16 | } -------------------------------------------------------------------------------- /js/controllers/module.js: -------------------------------------------------------------------------------- 1 | /** attach controllers to this module 2 | * if you get 'unknown {x}Provider' errors from angular, be sure they are 3 | * properly referenced in one of the module dependencies in the array. 4 | * below, you can see we bring in our services and constants modules 5 | * which avails each controller of, for example, the `config` constants object. 6 | **/ 7 | define(['angular'], function (ng) { 8 | 'use strict'; 9 | return ng.module('app.controllers', []); 10 | }); 11 | -------------------------------------------------------------------------------- /css/app.css: -------------------------------------------------------------------------------- 1 | /* app css stylesheet */ 2 | 3 | .menu { 4 | list-style: none; 5 | border-bottom: 0.1em solid black; 6 | margin-bottom: 2em; 7 | padding: 0 0 0.5em; 8 | } 9 | 10 | .menu:before { 11 | content: "["; 12 | } 13 | 14 | .menu:after { 15 | content: "]"; 16 | } 17 | 18 | .menu > li { 19 | display: inline; 20 | } 21 | 22 | .menu > li:before { 23 | content: "|"; 24 | padding-right: 0.3em; 25 | } 26 | 27 | .menu > li:nth-child(1):before { 28 | content: ""; 29 | padding: 0; 30 | } 31 | -------------------------------------------------------------------------------- /js/app.js: -------------------------------------------------------------------------------- 1 | /** 2 | * loads sub modules and wraps them up into the main module 3 | * this should be used for top-level module definitions only 4 | */ 5 | define([ 6 | 'angular', 7 | 'uiRouter', 8 | './controllers/index', 9 | './directives/index', 10 | './filters/index', 11 | './services/index' 12 | ], function (ng) { 13 | 'use strict'; 14 | 15 | return ng.module('app', [ 16 | 'app.services', 17 | 'app.controllers', 18 | 'app.filters', 19 | 'app.directives', 20 | 'ui.router' 21 | ]); 22 | }); 23 | -------------------------------------------------------------------------------- /js/bootstrap.js: -------------------------------------------------------------------------------- 1 | /** 2 | * bootstraps angular onto the window.document node 3 | * NOTE: the ng-app attribute should not be on the index.html when using ng.bootstrap 4 | */ 5 | define([ 6 | 'require', 7 | 'angular', 8 | 'app', 9 | 'routes' 10 | ], function (require, ng) { 11 | 'use strict'; 12 | 13 | /* 14 | * place operations that need to initialize prior to app start here 15 | * using the `run` function on the top-level module 16 | */ 17 | 18 | require(['domReady!'], function (document) { 19 | ng.bootstrap(document, ['app']); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | My AngularJS AngularJS + RequireJS App 6 | 7 | 8 | 9 | 15 | 16 | 20 | 21 |
22 | 23 |
Angular Require seed app: v
24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /lib/requirejs-domready/README.md: -------------------------------------------------------------------------------- 1 | # text 2 | 3 | An AMD loader plugin for detecting DOM ready. 4 | 5 | Known to work in RequireJS, but should work in other 6 | AMD loaders that support the same loader plugin API. 7 | 8 | ## Docs 9 | 10 | See the [RequireJS API text section](http://requirejs.org/docs/api.html#pageload). 11 | 12 | ## Latest release 13 | 14 | The latest release will be available from the "latest" tag. 15 | 16 | ## License 17 | 18 | Dual-licensed -- new BSD or MIT. 19 | 20 | ## Where are the tests? 21 | 22 | They are in the [requirejs](https://github.com/jrburke/requirejs) and 23 | [r.js](https://github.com/jrburke/r.js) repos. 24 | 25 | ## History 26 | 27 | This plugin was in the [requirejs repo](https://github.com/jrburke/requirejs) 28 | up until the requirejs 2.0 release. 29 | -------------------------------------------------------------------------------- /js/main.js: -------------------------------------------------------------------------------- 1 | /** 2 | * configure RequireJS 3 | * prefer named modules to long paths, especially for version mgt 4 | * or 3rd party libraries 5 | */ 6 | require.config({ 7 | 8 | paths: { 9 | 'domReady': '../lib/requirejs-domready/domReady', 10 | 'angular': '../lib/angular/angular', 11 | "uiRouter": "../lib/angular/angular-ui-router" 12 | }, 13 | 14 | /** 15 | * for libs that either do not support AMD out of the box, or 16 | * require some fine tuning to dependency mgt' 17 | */ 18 | shim: { 19 | 'angular': { 20 | exports: 'angular' 21 | }, 22 | 'uiRouter':{ 23 | deps: ['angular'] 24 | } 25 | }, 26 | 27 | deps: [ 28 | // kick start application... see bootstrap.js 29 | './bootstrap' 30 | ] 31 | }); 32 | -------------------------------------------------------------------------------- /lib/requirejs/index.html: -------------------------------------------------------------------------------- 1 |
2 |

/* ---

3 | 4 |

RequireJS is a JavaScript file and module loader. It is optimized for 5 | in-browser use, but it can be used in other JavaScript environments, 6 | like Rhino and Node. Using 7 | a modular script loader like RequireJS will improve the speed and 8 | quality of your code.

9 | 10 |

11 | IE 6+ .......... compatible ✔
12 | Firefox 2+ ..... compatible ✔
13 | Safari 3.2+ .... compatible ✔
14 | Chrome 3+ ...... compatible ✔
15 | Opera 10+ ...... compatible ✔ 16 |

17 | 18 |

Get started then check out the API.

19 | 20 |

--- */

21 |
22 | -------------------------------------------------------------------------------- /js/routes.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines the main routes in the application. 3 | * The routes you see here will be anchors '#/' unless specifically configured otherwise. 4 | */ 5 | 6 | /*define(['./app'], function (app) { 7 | 'use strict'; 8 | return app.config(['$routeProvider', function ($routeProvider) { 9 | $routeProvider.when('/view1', { 10 | templateUrl: 'partials/partial1.html', 11 | controller: 'MyCtrl1' 12 | }); 13 | 14 | $routeProvider.when('/view2', { 15 | templateUrl: 'partials/partial2.html', 16 | controller: 'MyCtrl2' 17 | }); 18 | 19 | $routeProvider.otherwise({ 20 | redirectTo: '/view1' 21 | }); 22 | }]); 23 | });*/ 24 | define(['./app'], function(app) { 25 | 'use strict'; 26 | return app.config(function($stateProvider) { 27 | $stateProvider.state('view1',{ 28 | url: '/view1', 29 | templateUrl: 'partials/partial1.html', 30 | controller:'MyCtrl1' 31 | }) 32 | .state('view2',{ 33 | url: '/view2', 34 | templateUrl: 'partials/partial2.html', 35 | controller: 'MyCtrl2' 36 | }); 37 | }) 38 | }); -------------------------------------------------------------------------------- /lib/requirejs/tasks.txt: -------------------------------------------------------------------------------- 1 | Release Notes 2 | ------------------- 3 | 4 | After merge/release: 5 | 6 | 7 | Implementation notes 8 | -------- 9 | * Cannot get rid of interactive stuff for IE because requirejs supports loading 10 | plain JS files that may not call define(). Since they do not call define, if 11 | they are loaded in between anon define call scripts, since onload on scripts 12 | do not fire immediately after script execution, the wrong names can be associated 13 | with scripts. 14 | 15 | 16 | - robust handling for anon modules loaded outside loader. 17 | - Just remove packages config altogether, suggest volojs for making adapter modules. 18 | -> Allow 'module': '' and 'module/': '' config instead of packages config. 19 | 20 | Tests to write: 21 | - mapConfig test for packages. 22 | 23 | Next release 24 | -------------- 25 | 26 | - ie 10, order plugin not working? 27 | 28 | https://github.com/jrburke/requirejs/issues/185 29 | 30 | - add pluginBuilder to the load api 31 | 32 | - require-cs circular ref: https://github.com/jrburke/require-cs/issues/13 33 | 34 | - make a decision matrix of when to use what. Mention lowercase names for file name convention. 35 | 36 | - paths entry for socket.io to remote domain/port, but then do a require.toUrl('socket.io') and it returns 37 | a local path instead of the remote path? 38 | 39 | 40 | - has() source trimming, needs brace matching? 41 | 42 | - Update the coffeescript plugin to use the writeFile API? 43 | -------------------------------------------------------------------------------- /lib/requirejs/updatesubs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script updates the sub projects that depend on the main requirejs 4 | # project. It is assumed the sub projects are siblings to this project 5 | # the the names specified below. 6 | 7 | echo "Updating r.js" 8 | cp require.js ../r.js/require.js 9 | cd ../r.js 10 | node dist.js 11 | cd ../requirejs 12 | 13 | # The RequireJS+jQuery sample project. 14 | echo "Updating jQuery sample project" 15 | cp require.js ../require-jquery/parts/require.js 16 | cp ../r.js/r.js ../require-jquery/jquery-require-sample/r.js 17 | cd ../require-jquery/parts 18 | ./update.sh 19 | cd ../../requirejs 20 | 21 | # The sample projects 22 | 23 | echo "Updating requirejs/example-jquery-cdn" 24 | cp require.js ../example-jquery-cdn/www/js/lib/require.js 25 | cp ../r.js/r.js ../example-jquery-cdn/tools/r.js 26 | 27 | echo "Updating requirejs/example-jquery-shim" 28 | cp require.js ../example-jquery-shim/www/js/lib/require.js 29 | cp ../r.js/r.js ../example-jquery-shim/tools/r.js 30 | 31 | echo "Updating requirejs/example-multipage" 32 | cp require.js ../example-multipage/www/js/lib/require.js 33 | cp ../r.js/r.js ../example-multipage/tools/r.js 34 | 35 | echo "Updating requirejs/example-multipage-shim" 36 | cp require.js ../example-multipage-shim/www/js/lib/require.js 37 | cp ../r.js/r.js ../example-multipage-shim/tools/r.js 38 | 39 | echo "Updating requirejs/example-libglobal" 40 | cp require.js ../example-libglobal/lib/require.js 41 | cp ../r.js/r.js ../example-libglobal/tools/r.js 42 | 43 | echo "Updating volojs/create-template" 44 | cp require.js ../../volojs/create-template/www/js/lib/require.js 45 | cp ../r.js/r.js ../../volojs/create-template/tools/r.js 46 | 47 | echo "Updating volojs/create-responsive-template" 48 | cp require.js ../../volojs/create-responsive-template/www/js/lib/require.js 49 | cp ../r.js/r.js ../../volojs/create-responsive-template/tools/r.js 50 | 51 | # The cajon project 52 | echo "Updating the cajon project" 53 | cp require.js ../cajon/tools/require.js 54 | cp ../r.js/r.js ../cajon/tools/r.js 55 | cd ../cajon/tools 56 | ./build-cajon.js 57 | cd ../../requirejs 58 | 59 | # The require-cs project 60 | echo "Updating the require-cs CoffeeScript plugin" 61 | cp require.js ../require-cs/demo/lib/require.js 62 | cp ../r.js/r.js ../require-cs/tools/r.js 63 | 64 | # The npm container stuff 65 | echo "Updating requirejs-npm" 66 | cp require.js ../requirejs-npm/requirejs/require.js 67 | cp ../r.js/r.js ../requirejs-npm/requirejs/bin/r.js 68 | -------------------------------------------------------------------------------- /lib/requirejs/README.md: -------------------------------------------------------------------------------- 1 | # RequireJS 2 | 3 | RequireJS loads plain JavaScript files as well as more defined modules. It is 4 | optimized for in-browser use, including in 5 | [a Web Worker](http://requirejs.org/docs/api.html#webworker), but it can be used 6 | in other JavaScript environments, like Rhino and 7 | [Node](http://requirejs.org/docs/node.html). It implements the 8 | [Asynchronous Module](https://github.com/amdjs/amdjs-api/wiki/AMD) 9 | API. 10 | 11 | RequireJS uses plain script tags to load modules/files, so it should allow for 12 | easy debugging. It can be used 13 | [simply to load existing JavaScript files](http://requirejs.org/docs/api.html#jsfiles), 14 | so you can add it to your existing project without having to re-write your 15 | JavaScript files. 16 | 17 | RequireJS includes [an optimization tool](http://requirejs.org/docs/optimization.html) 18 | you can run as part of your packaging steps for deploying your code. The 19 | optimization tool can combine and minify your JavaScript files to allow for 20 | better performance. 21 | 22 | If the JavaScript file defines a JavaScript module via 23 | [define()](http://requirejs.org/docs/api.html#define), then there are other benefits 24 | RequireJS can offer: [improvements over traditional CommonJS modules](http://requirejs.org/docs/commonjs.html) 25 | and [loading multiple versions](http://requirejs.org/docs/api.html#multiversion) 26 | of a module in a page. RequireJS also has a plugin system that supports features like 27 | [i18n string bundles](http://requirejs.org/docs/api.html#i18n), and 28 | [text file dependencies](http://requirejs.org/docs/api.html#text). 29 | 30 | RequireJS does not have any dependencies on a JavaScript framework. 31 | It is dual-licensed -- new BSD or MIT. 32 | 33 | The standard require.js file is around 5.5KB when minified via Closure Compiler 34 | and gzipped. 35 | 36 | RequireJS works in IE 6+, Firefox 2+, Safari 3.2+, Chrome 3+, and Opera 10+. 37 | 38 | [Latest Release](http://requirejs.org/docs/download.html) 39 | 40 | ## Directories 41 | 42 | * **dist**: Scripts and assets to generate the requirejs.org docs, and for 43 | generating a require.js release. 44 | * **docs**: The raw HTML files for the requirejs.org docs. Only includes the 45 | body of each page. Files in **dist** are used to generate a complete HTML page. 46 | * **tests**: Tests for require.js. 47 | * **testBaseUrl.js**: A file used in the tests inside **tests**. Purposely 48 | placed outside the tests directory for testing paths that go outside a baseUrl. 49 | * **updatesubs.sh**: Updates projects that depend on require.js Assumes the 50 | projects are siblings to this directory and have specific names. Useful to 51 | copy require.js to dependent projects easily while in development. 52 | -------------------------------------------------------------------------------- /lib/requirejs/LICENSE: -------------------------------------------------------------------------------- 1 | RequireJS is released under two licenses: new BSD, and MIT. You may pick the 2 | license that best suits your development needs. The text of both licenses are 3 | provided below. 4 | 5 | 6 | The "New" BSD License: 7 | ---------------------- 8 | 9 | Copyright (c) 2010-2011, The Dojo Foundation 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, this 16 | list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | * Neither the name of the Dojo Foundation nor the names of its contributors 21 | may be used to endorse or promote products derived from this software 22 | without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | 37 | MIT License 38 | ----------- 39 | 40 | Copyright (c) 2010-2011, The Dojo Foundation 41 | 42 | Permission is hereby granted, free of charge, to any person obtaining a copy 43 | of this software and associated documentation files (the "Software"), to deal 44 | in the Software without restriction, including without limitation the rights 45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the Software is 47 | furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in 50 | all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 58 | THE SOFTWARE. 59 | -------------------------------------------------------------------------------- /lib/requirejs-domready/LICENSE: -------------------------------------------------------------------------------- 1 | RequireJS is released under two licenses: new BSD, and MIT. You may pick the 2 | license that best suits your development needs. The text of both licenses are 3 | provided below. 4 | 5 | 6 | The "New" BSD License: 7 | ---------------------- 8 | 9 | Copyright (c) 2010-2011, The Dojo Foundation 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without 13 | modification, are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, this 16 | list of conditions and the following disclaimer. 17 | * Redistributions in binary form must reproduce the above copyright notice, 18 | this list of conditions and the following disclaimer in the documentation 19 | and/or other materials provided with the distribution. 20 | * Neither the name of the Dojo Foundation nor the names of its contributors 21 | may be used to endorse or promote products derived from this software 22 | without specific prior written permission. 23 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 25 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE 28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34 | 35 | 36 | 37 | MIT License 38 | ----------- 39 | 40 | Copyright (c) 2010-2011, The Dojo Foundation 41 | 42 | Permission is hereby granted, free of charge, to any person obtaining a copy 43 | of this software and associated documentation files (the "Software"), to deal 44 | in the Software without restriction, including without limitation the rights 45 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 46 | copies of the Software, and to permit persons to whom the Software is 47 | furnished to do so, subject to the following conditions: 48 | 49 | The above copyright notice and this permission notice shall be included in 50 | all copies or substantial portions of the Software. 51 | 52 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 53 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 54 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 55 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 56 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 57 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 58 | THE SOFTWARE. 59 | -------------------------------------------------------------------------------- /lib/requirejs-domready/domReady.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license RequireJS domReady 2.0.1 Copyright (c) 2010-2012, The Dojo Foundation All Rights Reserved. 3 | * Available via the MIT or new BSD license. 4 | * see: http://github.com/requirejs/domReady for details 5 | */ 6 | /*jslint */ 7 | /*global require: false, define: false, requirejs: false, 8 | window: false, clearInterval: false, document: false, 9 | self: false, setInterval: false */ 10 | 11 | 12 | define(function () { 13 | 'use strict'; 14 | 15 | var isTop, testDiv, scrollIntervalId, 16 | isBrowser = typeof window !== "undefined" && window.document, 17 | isPageLoaded = !isBrowser, 18 | doc = isBrowser ? document : null, 19 | readyCalls = []; 20 | 21 | function runCallbacks(callbacks) { 22 | var i; 23 | for (i = 0; i < callbacks.length; i += 1) { 24 | callbacks[i](doc); 25 | } 26 | } 27 | 28 | function callReady() { 29 | var callbacks = readyCalls; 30 | 31 | if (isPageLoaded) { 32 | //Call the DOM ready callbacks 33 | if (callbacks.length) { 34 | readyCalls = []; 35 | runCallbacks(callbacks); 36 | } 37 | } 38 | } 39 | 40 | /** 41 | * Sets the page as loaded. 42 | */ 43 | function pageLoaded() { 44 | if (!isPageLoaded) { 45 | isPageLoaded = true; 46 | if (scrollIntervalId) { 47 | clearInterval(scrollIntervalId); 48 | } 49 | 50 | callReady(); 51 | } 52 | } 53 | 54 | if (isBrowser) { 55 | if (document.addEventListener) { 56 | //Standards. Hooray! Assumption here that if standards based, 57 | //it knows about DOMContentLoaded. 58 | document.addEventListener("DOMContentLoaded", pageLoaded, false); 59 | window.addEventListener("load", pageLoaded, false); 60 | } else if (window.attachEvent) { 61 | window.attachEvent("onload", pageLoaded); 62 | 63 | testDiv = document.createElement('div'); 64 | try { 65 | isTop = window.frameElement === null; 66 | } catch (e) {} 67 | 68 | //DOMContentLoaded approximation that uses a doScroll, as found by 69 | //Diego Perini: http://javascript.nwbox.com/IEContentLoaded/, 70 | //but modified by other contributors, including jdalton 71 | if (testDiv.doScroll && isTop && window.external) { 72 | scrollIntervalId = setInterval(function () { 73 | try { 74 | testDiv.doScroll(); 75 | pageLoaded(); 76 | } catch (e) {} 77 | }, 30); 78 | } 79 | } 80 | 81 | //Check if document already complete, and if so, just trigger page load 82 | //listeners. Latest webkit browsers also use "interactive", and 83 | //will fire the onDOMContentLoaded before "interactive" but not after 84 | //entering "interactive" or "complete". More details: 85 | //http://dev.w3.org/html5/spec/the-end.html#the-end 86 | //http://stackoverflow.com/questions/3665561/document-readystate-of-interactive-vs-ondomcontentloaded 87 | //Hmm, this is more complicated on further use, see "firing too early" 88 | //bug: https://github.com/requirejs/domReady/issues/1 89 | //so removing the || document.readyState === "interactive" test. 90 | //There is still a window.onload binding that should get fired if 91 | //DOMContentLoaded is missed. 92 | if (document.readyState === "complete") { 93 | pageLoaded(); 94 | } 95 | } 96 | 97 | /** START OF PUBLIC API **/ 98 | 99 | /** 100 | * Registers a callback for DOM ready. If DOM is already ready, the 101 | * callback is called immediately. 102 | * @param {Function} callback 103 | */ 104 | function domReady(callback) { 105 | if (isPageLoaded) { 106 | callback(doc); 107 | } else { 108 | readyCalls.push(callback); 109 | } 110 | return domReady; 111 | } 112 | 113 | domReady.version = '2.0.1'; 114 | 115 | /** 116 | * Loader Plugin API method 117 | */ 118 | domReady.load = function (name, req, onLoad, config) { 119 | if (config.isBuild) { 120 | onLoad(null); 121 | } else { 122 | domReady(onLoad); 123 | } 124 | }; 125 | 126 | /** END OF PUBLIC API **/ 127 | 128 | return domReady; 129 | }); 130 | -------------------------------------------------------------------------------- /lib/angular/angular-ui-router.js: -------------------------------------------------------------------------------- 1 | /** 2 | * State-based routing for AngularJS 3 | * @version v0.2.0 4 | * @link http://angular-ui.github.com/ 5 | * @license MIT License, http://www.opensource.org/licenses/MIT 6 | */ 7 | (function (window, angular, undefined) { 8 | /*jshint globalstrict:true*/ 9 | /*global angular:false*/ 10 | 'use strict'; 11 | 12 | var isDefined = angular.isDefined, 13 | isFunction = angular.isFunction, 14 | isString = angular.isString, 15 | isObject = angular.isObject, 16 | isArray = angular.isArray, 17 | forEach = angular.forEach, 18 | extend = angular.extend, 19 | copy = angular.copy; 20 | 21 | function inherit(parent, extra) { 22 | return extend(new (extend(function() {}, { prototype: parent }))(), extra); 23 | } 24 | 25 | function merge(dst) { 26 | forEach(arguments, function(obj) { 27 | if (obj !== dst) { 28 | forEach(obj, function(value, key) { 29 | if (!dst.hasOwnProperty(key)) dst[key] = value; 30 | }); 31 | } 32 | }); 33 | return dst; 34 | } 35 | 36 | /** 37 | * Finds the common ancestor path between two states. 38 | * 39 | * @param {Object} first The first state. 40 | * @param {Object} second The second state. 41 | * @return {Array} Returns an array of state names in descending order, not including the root. 42 | */ 43 | function ancestors(first, second) { 44 | var path = []; 45 | 46 | for (var n in first.path) { 47 | if (first.path[n] === "") continue; 48 | if (!second.path[n]) break; 49 | path.push(first.path[n]); 50 | } 51 | return path; 52 | } 53 | 54 | /** 55 | * Merges a set of parameters with all parameters inherited between the common parents of the 56 | * current state and a given destination state. 57 | * 58 | * @param {Object} currentParams The value of the current state parameters ($stateParams). 59 | * @param {Object} newParams The set of parameters which will be composited with inherited params. 60 | * @param {Object} $current Internal definition of object representing the current state. 61 | * @param {Object} $to Internal definition of object representing state to transition to. 62 | */ 63 | function inheritParams(currentParams, newParams, $current, $to) { 64 | var parents = ancestors($current, $to), parentParams, inherited = {}, inheritList = []; 65 | 66 | for (var i in parents) { 67 | if (!parents[i].params || !parents[i].params.length) continue; 68 | parentParams = parents[i].params; 69 | 70 | for (var j in parentParams) { 71 | if (inheritList.indexOf(parentParams[j]) >= 0) continue; 72 | inheritList.push(parentParams[j]); 73 | inherited[parentParams[j]] = currentParams[parentParams[j]]; 74 | } 75 | } 76 | return extend({}, inherited, newParams); 77 | } 78 | 79 | angular.module('ui.router.util', ['ng']); 80 | angular.module('ui.router.router', ['ui.router.util']); 81 | angular.module('ui.router.state', ['ui.router.router', 'ui.router.util']); 82 | angular.module('ui.router', ['ui.router.state']); 83 | angular.module('ui.router.compat', ['ui.router']); 84 | 85 | 86 | /** 87 | * Service (`ui-util`). Manages resolution of (acyclic) graphs of promises. 88 | * @module $resolve 89 | * @requires $q 90 | * @requires $injector 91 | */ 92 | $Resolve.$inject = ['$q', '$injector']; 93 | function $Resolve( $q, $injector) { 94 | 95 | var VISIT_IN_PROGRESS = 1, 96 | VISIT_DONE = 2, 97 | NOTHING = {}, 98 | NO_DEPENDENCIES = [], 99 | NO_LOCALS = NOTHING, 100 | NO_PARENT = extend($q.when(NOTHING), { $$promises: NOTHING, $$values: NOTHING }); 101 | 102 | 103 | /** 104 | * Studies a set of invocables that are likely to be used multiple times. 105 | * $resolve.study(invocables)(locals, parent, self) 106 | * is equivalent to 107 | * $resolve.resolve(invocables, locals, parent, self) 108 | * but the former is more efficient (in fact `resolve` just calls `study` internally). 109 | * See {@link module:$resolve/resolve} for details. 110 | * @function 111 | * @param {Object} invocables 112 | * @return {Function} 113 | */ 114 | this.study = function (invocables) { 115 | if (!isObject(invocables)) throw new Error("'invocables' must be an object"); 116 | 117 | // Perform a topological sort of invocables to build an ordered plan 118 | var plan = [], cycle = [], visited = {}; 119 | function visit(value, key) { 120 | if (visited[key] === VISIT_DONE) return; 121 | 122 | cycle.push(key); 123 | if (visited[key] === VISIT_IN_PROGRESS) { 124 | cycle.splice(0, cycle.indexOf(key)); 125 | throw new Error("Cyclic dependency: " + cycle.join(" -> ")); 126 | } 127 | visited[key] = VISIT_IN_PROGRESS; 128 | 129 | if (isString(value)) { 130 | plan.push(key, [ function() { return $injector.get(key); }], NO_DEPENDENCIES); 131 | } else { 132 | var params = $injector.annotate(value); 133 | forEach(params, function (param) { 134 | if (param !== key && invocables.hasOwnProperty(param)) visit(invocables[param], param); 135 | }); 136 | plan.push(key, value, params); 137 | } 138 | 139 | cycle.pop(); 140 | visited[key] = VISIT_DONE; 141 | } 142 | forEach(invocables, visit); 143 | invocables = cycle = visited = null; // plan is all that's required 144 | 145 | function isResolve(value) { 146 | return isObject(value) && value.then && value.$$promises; 147 | } 148 | 149 | return function (locals, parent, self) { 150 | if (isResolve(locals) && self === undefined) { 151 | self = parent; parent = locals; locals = null; 152 | } 153 | if (!locals) locals = NO_LOCALS; 154 | else if (!isObject(locals)) { 155 | throw new Error("'locals' must be an object"); 156 | } 157 | if (!parent) parent = NO_PARENT; 158 | else if (!isResolve(parent)) { 159 | throw new Error("'parent' must be a promise returned by $resolve.resolve()"); 160 | } 161 | 162 | // To complete the overall resolution, we have to wait for the parent 163 | // promise and for the promise for each invokable in our plan. 164 | var resolution = $q.defer(), 165 | result = resolution.promise, 166 | promises = result.$$promises = {}, 167 | values = extend({}, locals), 168 | wait = 1 + plan.length/3, 169 | merged = false; 170 | 171 | function done() { 172 | // Merge parent values we haven't got yet and publish our own $$values 173 | if (!--wait) { 174 | if (!merged) merge(values, parent.$$values); 175 | result.$$values = values; 176 | result.$$promises = true; // keep for isResolve() 177 | resolution.resolve(values); 178 | } 179 | } 180 | 181 | function fail(reason) { 182 | result.$$failure = reason; 183 | resolution.reject(reason); 184 | } 185 | 186 | // Short-circuit if parent has already failed 187 | if (isDefined(parent.$$failure)) { 188 | fail(parent.$$failure); 189 | return result; 190 | } 191 | 192 | // Merge parent values if the parent has already resolved, or merge 193 | // parent promises and wait if the parent resolve is still in progress. 194 | if (parent.$$values) { 195 | merged = merge(values, parent.$$values); 196 | done(); 197 | } else { 198 | extend(promises, parent.$$promises); 199 | parent.then(done, fail); 200 | } 201 | 202 | // Process each invocable in the plan, but ignore any where a local of the same name exists. 203 | for (var i=0, ii=plan.length; i} invocables functions to invoke or `$injector` services to fetch. 288 | * @param {Object.} [locals] values to make available to the injectables 289 | * @param {Promise.} [parent] a promise returned by another call to `$resolve`. 290 | * @param {Object} [self] the `this` for the invoked methods 291 | * @return {Promise.} Promise for an object that contains the resolved return value 292 | * of all invocables, as well as any inherited and local values. 293 | */ 294 | this.resolve = function (invocables, locals, parent, self) { 295 | return this.study(invocables)(locals, parent, self); 296 | }; 297 | } 298 | 299 | angular.module('ui.router.util').service('$resolve', $Resolve); 300 | 301 | 302 | /** 303 | * Service. Manages loading of templates. 304 | * @constructor 305 | * @name $templateFactory 306 | * @requires $http 307 | * @requires $templateCache 308 | * @requires $injector 309 | */ 310 | $TemplateFactory.$inject = ['$http', '$templateCache', '$injector']; 311 | function $TemplateFactory( $http, $templateCache, $injector) { 312 | 313 | /** 314 | * Creates a template from a configuration object. 315 | * @function 316 | * @name $templateFactory#fromConfig 317 | * @methodOf $templateFactory 318 | * @param {Object} config Configuration object for which to load a template. The following 319 | * properties are search in the specified order, and the first one that is defined is 320 | * used to create the template: 321 | * @param {string|Function} config.template html string template or function to load via 322 | * {@link $templateFactory#fromString fromString}. 323 | * @param {string|Function} config.templateUrl url to load or a function returning the url 324 | * to load via {@link $templateFactory#fromUrl fromUrl}. 325 | * @param {Function} config.templateProvider function to invoke via 326 | * {@link $templateFactory#fromProvider fromProvider}. 327 | * @param {Object} params Parameters to pass to the template function. 328 | * @param {Object} [locals] Locals to pass to `invoke` if the template is loaded via a 329 | * `templateProvider`. Defaults to `{ params: params }`. 330 | * @return {string|Promise.} The template html as a string, or a promise for that string, 331 | * or `null` if no template is configured. 332 | */ 333 | this.fromConfig = function (config, params, locals) { 334 | return ( 335 | isDefined(config.template) ? this.fromString(config.template, params) : 336 | isDefined(config.templateUrl) ? this.fromUrl(config.templateUrl, params) : 337 | isDefined(config.templateProvider) ? this.fromProvider(config.templateProvider, params, locals) : 338 | null 339 | ); 340 | }; 341 | 342 | /** 343 | * Creates a template from a string or a function returning a string. 344 | * @function 345 | * @name $templateFactory#fromString 346 | * @methodOf $templateFactory 347 | * @param {string|Function} template html template as a string or function that returns an html 348 | * template as a string. 349 | * @param {Object} params Parameters to pass to the template function. 350 | * @return {string|Promise.} The template html as a string, or a promise for that string. 351 | */ 352 | this.fromString = function (template, params) { 353 | return isFunction(template) ? template(params) : template; 354 | }; 355 | 356 | /** 357 | * Loads a template from the a URL via `$http` and `$templateCache`. 358 | * @function 359 | * @name $templateFactory#fromUrl 360 | * @methodOf $templateFactory 361 | * @param {string|Function} url url of the template to load, or a function that returns a url. 362 | * @param {Object} params Parameters to pass to the url function. 363 | * @return {string|Promise.} The template html as a string, or a promise for that string. 364 | */ 365 | this.fromUrl = function (url, params) { 366 | if (isFunction(url)) url = url(params); 367 | if (url == null) return null; 368 | else return $http 369 | .get(url, { cache: $templateCache }) 370 | .then(function(response) { return response.data; }); 371 | }; 372 | 373 | /** 374 | * Creates a template by invoking an injectable provider function. 375 | * @function 376 | * @name $templateFactory#fromUrl 377 | * @methodOf $templateFactory 378 | * @param {Function} provider Function to invoke via `$injector.invoke` 379 | * @param {Object} params Parameters for the template. 380 | * @param {Object} [locals] Locals to pass to `invoke`. Defaults to `{ params: params }`. 381 | * @return {string|Promise.} The template html as a string, or a promise for that string. 382 | */ 383 | this.fromProvider = function (provider, params, locals) { 384 | return $injector.invoke(provider, null, locals || { params: params }); 385 | }; 386 | } 387 | 388 | angular.module('ui.router.util').service('$templateFactory', $TemplateFactory); 389 | 390 | /** 391 | * Matches URLs against patterns and extracts named parameters from the path or the search 392 | * part of the URL. A URL pattern consists of a path pattern, optionally followed by '?' and a list 393 | * of search parameters. Multiple search parameter names are separated by '&'. Search parameters 394 | * do not influence whether or not a URL is matched, but their values are passed through into 395 | * the matched parameters returned by {@link UrlMatcher#exec exec}. 396 | * 397 | * Path parameter placeholders can be specified using simple colon/catch-all syntax or curly brace 398 | * syntax, which optionally allows a regular expression for the parameter to be specified: 399 | * 400 | * * ':' name - colon placeholder 401 | * * '*' name - catch-all placeholder 402 | * * '{' name '}' - curly placeholder 403 | * * '{' name ':' regexp '}' - curly placeholder with regexp. Should the regexp itself contain 404 | * curly braces, they must be in matched pairs or escaped with a backslash. 405 | * 406 | * Parameter names may contain only word characters (latin letters, digits, and underscore) and 407 | * must be unique within the pattern (across both path and search parameters). For colon 408 | * placeholders or curly placeholders without an explicit regexp, a path parameter matches any 409 | * number of characters other than '/'. For catch-all placeholders the path parameter matches 410 | * any number of characters. 411 | * 412 | * ### Examples 413 | * 414 | * * '/hello/' - Matches only if the path is exactly '/hello/'. There is no special treatment for 415 | * trailing slashes, and patterns have to match the entire path, not just a prefix. 416 | * * '/user/:id' - Matches '/user/bob' or '/user/1234!!!' or even '/user/' but not '/user' or 417 | * '/user/bob/details'. The second path segment will be captured as the parameter 'id'. 418 | * * '/user/{id}' - Same as the previous example, but using curly brace syntax. 419 | * * '/user/{id:[^/]*}' - Same as the previous example. 420 | * * '/user/{id:[0-9a-fA-F]{1,8}}' - Similar to the previous example, but only matches if the id 421 | * parameter consists of 1 to 8 hex digits. 422 | * * '/files/{path:.*}' - Matches any URL starting with '/files/' and captures the rest of the 423 | * path into the parameter 'path'. 424 | * * '/files/*path' - ditto. 425 | * 426 | * @constructor 427 | * @param {string} pattern the pattern to compile into a matcher. 428 | * 429 | * @property {string} prefix A static prefix of this pattern. The matcher guarantees that any 430 | * URL matching this matcher (i.e. any string for which {@link UrlMatcher#exec exec()} returns 431 | * non-null) will start with this prefix. 432 | */ 433 | function UrlMatcher(pattern) { 434 | 435 | // Find all placeholders and create a compiled pattern, using either classic or curly syntax: 436 | // '*' name 437 | // ':' name 438 | // '{' name '}' 439 | // '{' name ':' regexp '}' 440 | // The regular expression is somewhat complicated due to the need to allow curly braces 441 | // inside the regular expression. The placeholder regexp breaks down as follows: 442 | // ([:*])(\w+) classic placeholder ($1 / $2) 443 | // \{(\w+)(?:\:( ... ))?\} curly brace placeholder ($3) with optional regexp ... ($4) 444 | // (?: ... | ... | ... )+ the regexp consists of any number of atoms, an atom being either 445 | // [^{}\\]+ - anything other than curly braces or backslash 446 | // \\. - a backslash escape 447 | // \{(?:[^{}\\]+|\\.)*\} - a matched set of curly braces containing other atoms 448 | var placeholder = /([:*])(\w+)|\{(\w+)(?:\:((?:[^{}\\]+|\\.|\{(?:[^{}\\]+|\\.)*\})+))?\}/g, 449 | names = {}, compiled = '^', last = 0, m, 450 | segments = this.segments = [], 451 | params = this.params = []; 452 | 453 | function addParameter(id) { 454 | if (!/^\w+(-+\w+)*$/.test(id)) throw new Error("Invalid parameter name '" + id + "' in pattern '" + pattern + "'"); 455 | if (names[id]) throw new Error("Duplicate parameter name '" + id + "' in pattern '" + pattern + "'"); 456 | names[id] = true; 457 | params.push(id); 458 | } 459 | 460 | function quoteRegExp(string) { 461 | return string.replace(/[\\\[\]\^$*+?.()|{}]/g, "\\$&"); 462 | } 463 | 464 | this.source = pattern; 465 | 466 | // Split into static segments separated by path parameter placeholders. 467 | // The number of segments is always 1 more than the number of parameters. 468 | var id, regexp, segment; 469 | while ((m = placeholder.exec(pattern))) { 470 | id = m[2] || m[3]; // IE[78] returns '' for unmatched groups instead of null 471 | regexp = m[4] || (m[1] == '*' ? '.*' : '[^/]*'); 472 | segment = pattern.substring(last, m.index); 473 | if (segment.indexOf('?') >= 0) break; // we're into the search part 474 | compiled += quoteRegExp(segment) + '(' + regexp + ')'; 475 | addParameter(id); 476 | segments.push(segment); 477 | last = placeholder.lastIndex; 478 | } 479 | segment = pattern.substring(last); 480 | 481 | // Find any search parameter names and remove them from the last segment 482 | var i = segment.indexOf('?'); 483 | if (i >= 0) { 484 | var search = this.sourceSearch = segment.substring(i); 485 | segment = segment.substring(0, i); 486 | this.sourcePath = pattern.substring(0, last+i); 487 | 488 | // Allow parameters to be separated by '?' as well as '&' to make concat() easier 489 | forEach(search.substring(1).split(/[&?]/), addParameter); 490 | } else { 491 | this.sourcePath = pattern; 492 | this.sourceSearch = ''; 493 | } 494 | 495 | compiled += quoteRegExp(segment) + '$'; 496 | segments.push(segment); 497 | this.regexp = new RegExp(compiled); 498 | this.prefix = segments[0]; 499 | } 500 | 501 | /** 502 | * Returns a new matcher for a pattern constructed by appending the path part and adding the 503 | * search parameters of the specified pattern to this pattern. The current pattern is not 504 | * modified. This can be understood as creating a pattern for URLs that are relative to (or 505 | * suffixes of) the current pattern. 506 | * 507 | * ### Example 508 | * The following two matchers are equivalent: 509 | * ``` 510 | * new UrlMatcher('/user/{id}?q').concat('/details?date'); 511 | * new UrlMatcher('/user/{id}/details?q&date'); 512 | * ``` 513 | * 514 | * @param {string} pattern The pattern to append. 515 | * @return {UrlMatcher} A matcher for the concatenated pattern. 516 | */ 517 | UrlMatcher.prototype.concat = function (pattern) { 518 | // Because order of search parameters is irrelevant, we can add our own search 519 | // parameters to the end of the new pattern. Parse the new pattern by itself 520 | // and then join the bits together, but it's much easier to do this on a string level. 521 | return new UrlMatcher(this.sourcePath + pattern + this.sourceSearch); 522 | }; 523 | 524 | UrlMatcher.prototype.toString = function () { 525 | return this.source; 526 | }; 527 | 528 | /** 529 | * Tests the specified path against this matcher, and returns an object containing the captured 530 | * parameter values, or null if the path does not match. The returned object contains the values 531 | * of any search parameters that are mentioned in the pattern, but their value may be null if 532 | * they are not present in `searchParams`. This means that search parameters are always treated 533 | * as optional. 534 | * 535 | * ### Example 536 | * ``` 537 | * new UrlMatcher('/user/{id}?q&r').exec('/user/bob', { x:'1', q:'hello' }); 538 | * // returns { id:'bob', q:'hello', r:null } 539 | * ``` 540 | * 541 | * @param {string} path The URL path to match, e.g. `$location.path()`. 542 | * @param {Object} searchParams URL search parameters, e.g. `$location.search()`. 543 | * @return {Object} The captured parameter values. 544 | */ 545 | UrlMatcher.prototype.exec = function (path, searchParams) { 546 | var m = this.regexp.exec(path); 547 | if (!m) return null; 548 | 549 | var params = this.params, nTotal = params.length, 550 | nPath = this.segments.length-1, 551 | values = {}, i; 552 | 553 | if (nPath !== m.length - 1) throw new Error("Unbalanced capture group in route '" + this.source + "'"); 554 | 555 | for (i=0; i} An array of parameter names. Must be treated as read-only. If the 564 | * pattern has no parameters, an empty array is returned. 565 | */ 566 | UrlMatcher.prototype.parameters = function () { 567 | return this.params; 568 | }; 569 | 570 | /** 571 | * Creates a URL that matches this pattern by substituting the specified values 572 | * for the path and search parameters. Null values for path parameters are 573 | * treated as empty strings. 574 | * 575 | * ### Example 576 | * ``` 577 | * new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' }); 578 | * // returns '/user/bob?q=yes' 579 | * ``` 580 | * 581 | * @param {Object} values the values to substitute for the parameters in this pattern. 582 | * @return {string} the formatted URL (path and optionally search part). 583 | */ 584 | UrlMatcher.prototype.format = function (values) { 585 | var segments = this.segments, params = this.params; 586 | if (!values) return segments.join(''); 587 | 588 | var nPath = segments.length-1, nTotal = params.length, 589 | result = segments[0], i, search, value; 590 | 591 | for (i=0; i= 0) throw new Error("State must have a valid name"); 916 | if (states[name]) throw new Error("State '" + name + "'' is already defined"); 917 | 918 | for (var key in stateBuilder) { 919 | state[key] = stateBuilder[key](state); 920 | } 921 | states[name] = state; 922 | 923 | // Register the state in the global state list and with $urlRouter if necessary. 924 | if (!state['abstract'] && state.url) { 925 | $urlRouterProvider.when(state.url, ['$match', '$stateParams', function ($match, $stateParams) { 926 | if ($state.$current.navigable != state || !equalForKeys($match, $stateParams)) { 927 | $state.transitionTo(state, $match, false); 928 | } 929 | }]); 930 | } 931 | return state; 932 | } 933 | 934 | 935 | // Implicit root state that is always active 936 | root = registerState({ 937 | name: '', 938 | url: '^', 939 | views: null, 940 | 'abstract': true 941 | }); 942 | root.navigable = null; 943 | 944 | 945 | // .state(state) 946 | // .state(name, state) 947 | this.state = state; 948 | function state(name, definition) { 949 | /*jshint validthis: true */ 950 | if (isObject(name)) definition = name; 951 | else definition.name = name; 952 | registerState(definition); 953 | return this; 954 | } 955 | 956 | // $urlRouter is injected just to ensure it gets instantiated 957 | this.$get = $get; 958 | $get.$inject = ['$rootScope', '$q', '$view', '$injector', '$resolve', '$stateParams', '$location', '$urlRouter']; 959 | function $get( $rootScope, $q, $view, $injector, $resolve, $stateParams, $location, $urlRouter) { 960 | 961 | var TransitionSuperseded = $q.reject(new Error('transition superseded')); 962 | var TransitionPrevented = $q.reject(new Error('transition prevented')); 963 | 964 | root.locals = { resolve: null, globals: { $stateParams: {} } }; 965 | $state = { 966 | params: {}, 967 | current: root.self, 968 | $current: root, 969 | transition: null 970 | }; 971 | 972 | $state.go = function go(to, params, options) { 973 | return this.transitionTo(to, params, extend({ inherit: true, relative: $state.$current }, options)); 974 | }; 975 | 976 | $state.transitionTo = function transitionTo(to, toParams, options) { 977 | if (!isDefined(options)) options = (options === true || options === false) ? { location: options } : {}; 978 | toParams = toParams || {}; 979 | options = extend({ location: true, inherit: false, relative: null }, options); 980 | 981 | var toState = findState(to, options.relative); 982 | if (!isDefined(toState)) throw new Error("No such state " + toState); 983 | if (toState['abstract']) throw new Error("Cannot transition to abstract state '" + to + "'"); 984 | if (options.inherit) toParams = inheritParams($stateParams, toParams || {}, $state.$current, toState); 985 | to = toState; 986 | 987 | var toPath = to.path, 988 | from = $state.$current, fromParams = $state.params, fromPath = from.path; 989 | 990 | // Starting from the root of the path, keep all levels that haven't changed 991 | var keep, state, locals = root.locals, toLocals = []; 992 | for (keep = 0, state = toPath[keep]; 993 | state && state === fromPath[keep] && equalForKeys(toParams, fromParams, state.ownParams); 994 | keep++, state = toPath[keep]) { 995 | locals = toLocals[keep] = state.locals; 996 | } 997 | 998 | // If we're going to the same state and all locals are kept, we've got nothing to do. 999 | // But clear 'transition', as we still want to cancel any other pending transitions. 1000 | // TODO: We may not want to bump 'transition' if we're called from a location change that we've initiated ourselves, 1001 | // because we might accidentally abort a legitimate transition initiated from code? 1002 | if (to === from && locals === from.locals) { 1003 | $state.transition = null; 1004 | return $q.when($state.current); 1005 | } 1006 | 1007 | // Normalize/filter parameters before we pass them to event handlers etc. 1008 | toParams = normalize(to.params, toParams || {}); 1009 | 1010 | // Broadcast start event and cancel the transition if requested 1011 | var evt = $rootScope.$broadcast('$stateChangeStart', to.self, toParams, from.self, fromParams); 1012 | if (evt.defaultPrevented) return TransitionPrevented; 1013 | 1014 | // Resolve locals for the remaining states, but don't update any global state just 1015 | // yet -- if anything fails to resolve the current state needs to remain untouched. 1016 | // We also set up an inheritance chain for the locals here. This allows the view directive 1017 | // to quickly look up the correct definition for each view in the current state. Even 1018 | // though we create the locals object itself outside resolveState(), it is initially 1019 | // empty and gets filled asynchronously. We need to keep track of the promise for the 1020 | // (fully resolved) current locals, and pass this down the chain. 1021 | var resolved = $q.when(locals); 1022 | for (var l=keep; l=keep; l--) { 1038 | exiting = fromPath[l]; 1039 | if (exiting.self.onExit) { 1040 | $injector.invoke(exiting.self.onExit, exiting.self, exiting.locals.globals); 1041 | } 1042 | exiting.locals = null; 1043 | } 1044 | 1045 | // Enter 'to' states not kept 1046 | for (l=keep; l').html(template).contents(); 1246 | animate.enter(contents, element); 1247 | return contents; 1248 | } 1249 | }, 1250 | "false": { 1251 | remove: function(element) { element.html(''); }, 1252 | restore: function(compiled, element) { element.append(compiled); }, 1253 | populate: function(template, element) { 1254 | element.html(template); 1255 | return element.contents(); 1256 | } 1257 | } 1258 | })[doAnimate.toString()]; 1259 | }; 1260 | 1261 | // Put back the compiled initial view 1262 | element.append(transclude(scope)); 1263 | 1264 | // Find the details of the parent view directive (if any) and use it 1265 | // to derive our own qualified view name, then hang our own details 1266 | // off the DOM so child directives can find it. 1267 | var parent = element.parent().inheritedData('$uiView'); 1268 | if (name.indexOf('@') < 0) name = name + '@' + (parent ? parent.state.name : ''); 1269 | var view = { name: name, state: null }; 1270 | element.data('$uiView', view); 1271 | 1272 | var eventHook = function() { 1273 | if (viewIsUpdating) return; 1274 | viewIsUpdating = true; 1275 | 1276 | try { updateView(true); } catch (e) { 1277 | viewIsUpdating = false; 1278 | throw e; 1279 | } 1280 | viewIsUpdating = false; 1281 | }; 1282 | 1283 | scope.$on('$stateChangeSuccess', eventHook); 1284 | scope.$on('$viewContentLoading', eventHook); 1285 | updateView(false); 1286 | 1287 | function updateView(doAnimate) { 1288 | var locals = $state.$current && $state.$current.locals[name]; 1289 | if (locals === viewLocals) return; // nothing to do 1290 | var render = renderer(animate && doAnimate); 1291 | 1292 | // Remove existing content 1293 | render.remove(element); 1294 | 1295 | // Destroy previous view scope 1296 | if (viewScope) { 1297 | viewScope.$destroy(); 1298 | viewScope = null; 1299 | } 1300 | 1301 | if (!locals) { 1302 | viewLocals = null; 1303 | view.state = null; 1304 | 1305 | // Restore the initial view 1306 | return render.restore(transclude(scope), element); 1307 | } 1308 | 1309 | viewLocals = locals; 1310 | view.state = locals.$$state; 1311 | 1312 | var link = $compile(render.populate(locals.$template, element)); 1313 | viewScope = scope.$new(); 1314 | 1315 | if (locals.$$controller) { 1316 | locals.$scope = viewScope; 1317 | var controller = $controller(locals.$$controller, locals); 1318 | element.children().data('$ngControllerController', controller); 1319 | } 1320 | link(viewScope); 1321 | viewScope.$emit('$viewContentLoaded'); 1322 | if (onloadExp) viewScope.$eval(onloadExp); 1323 | 1324 | // TODO: This seems strange, shouldn't $anchorScroll listen for $viewContentLoaded if necessary? 1325 | // $anchorScroll might listen on event... 1326 | $anchorScroll(); 1327 | } 1328 | }; 1329 | } 1330 | }; 1331 | return directive; 1332 | } 1333 | 1334 | angular.module('ui.router.state').directive('uiView', $ViewDirective); 1335 | 1336 | function parseStateRef(ref) { 1337 | var parsed = ref.match(/^([^(]+?)\s*(\((.*)\))?$/); 1338 | if (!parsed || parsed.length !== 4) throw new Error("Invalid state ref '" + ref + "'"); 1339 | return { state: parsed[1], paramExpr: parsed[3] || null }; 1340 | } 1341 | 1342 | $StateRefDirective.$inject = ['$state']; 1343 | function $StateRefDirective($state) { 1344 | return { 1345 | restrict: 'A', 1346 | link: function(scope, element, attrs) { 1347 | var ref = parseStateRef(attrs.uiSref); 1348 | var params = null, url = null, base = $state.$current; 1349 | var isForm = element[0].nodeName === "FORM"; 1350 | var attr = isForm ? "action" : "href", nav = true; 1351 | 1352 | var stateData = element.parent().inheritedData('$uiView'); 1353 | 1354 | if (stateData && stateData.state && stateData.state.name) { 1355 | base = stateData.state; 1356 | } 1357 | 1358 | var update = function(newVal) { 1359 | if (newVal) params = newVal; 1360 | if (!nav) return; 1361 | 1362 | var newHref = $state.href(ref.state, params, { relative: base }); 1363 | 1364 | if (!newHref) { 1365 | nav = false; 1366 | return false; 1367 | } 1368 | element[0][attr] = newHref; 1369 | }; 1370 | 1371 | if (ref.paramExpr) { 1372 | scope.$watch(ref.paramExpr, function(newVal, oldVal) { 1373 | if (newVal !== oldVal) update(newVal); 1374 | }, true); 1375 | params = scope.$eval(ref.paramExpr); 1376 | } 1377 | update(); 1378 | 1379 | if (isForm) return; 1380 | 1381 | element.bind("click", function(e) { 1382 | if ((e.which == 1) && !e.ctrlKey && !e.metaKey && !e.shiftKey) { 1383 | $state.go(ref.state, params, { relative: base }); 1384 | scope.$apply(); 1385 | e.preventDefault(); 1386 | } 1387 | }); 1388 | } 1389 | }; 1390 | } 1391 | 1392 | angular.module('ui.router.state').directive('uiSref', $StateRefDirective); 1393 | 1394 | $RouteProvider.$inject = ['$stateProvider', '$urlRouterProvider']; 1395 | function $RouteProvider( $stateProvider, $urlRouterProvider) { 1396 | 1397 | var routes = []; 1398 | 1399 | onEnterRoute.$inject = ['$$state']; 1400 | function onEnterRoute( $$state) { 1401 | /*jshint validthis: true */ 1402 | this.locals = $$state.locals.globals; 1403 | this.params = this.locals.$stateParams; 1404 | } 1405 | 1406 | function onExitRoute() { 1407 | /*jshint validthis: true */ 1408 | this.locals = null; 1409 | this.params = null; 1410 | } 1411 | 1412 | this.when = when; 1413 | function when(url, route) { 1414 | /*jshint validthis: true */ 1415 | if (route.redirectTo != null) { 1416 | // Redirect, configure directly on $urlRouterProvider 1417 | var redirect = route.redirectTo, handler; 1418 | if (isString(redirect)) { 1419 | handler = redirect; // leave $urlRouterProvider to handle 1420 | } else if (isFunction(redirect)) { 1421 | // Adapt to $urlRouterProvider API 1422 | handler = function (params, $location) { 1423 | return redirect(params, $location.path(), $location.search()); 1424 | }; 1425 | } else { 1426 | throw new Error("Invalid 'redirectTo' in when()"); 1427 | } 1428 | $urlRouterProvider.when(url, handler); 1429 | } else { 1430 | // Regular route, configure as state 1431 | $stateProvider.state(inherit(route, { 1432 | parent: null, 1433 | name: 'route:' + encodeURIComponent(url), 1434 | url: url, 1435 | onEnter: onEnterRoute, 1436 | onExit: onExitRoute 1437 | })); 1438 | } 1439 | routes.push(route); 1440 | return this; 1441 | } 1442 | 1443 | this.$get = $get; 1444 | $get.$inject = ['$state', '$rootScope', '$routeParams']; 1445 | function $get( $state, $rootScope, $routeParams) { 1446 | 1447 | var $route = { 1448 | routes: routes, 1449 | params: $routeParams, 1450 | current: undefined 1451 | }; 1452 | 1453 | function stateAsRoute(state) { 1454 | return (state.name !== '') ? state : undefined; 1455 | } 1456 | 1457 | $rootScope.$on('$stateChangeStart', function (ev, to, toParams, from, fromParams) { 1458 | $rootScope.$broadcast('$routeChangeStart', stateAsRoute(to), stateAsRoute(from)); 1459 | }); 1460 | 1461 | $rootScope.$on('$stateChangeSuccess', function (ev, to, toParams, from, fromParams) { 1462 | $route.current = stateAsRoute(to); 1463 | $rootScope.$broadcast('$routeChangeSuccess', stateAsRoute(to), stateAsRoute(from)); 1464 | copy(toParams, $route.params); 1465 | }); 1466 | 1467 | $rootScope.$on('$stateChangeError', function (ev, to, toParams, from, fromParams, error) { 1468 | $rootScope.$broadcast('$routeChangeError', stateAsRoute(to), stateAsRoute(from), error); 1469 | }); 1470 | 1471 | return $route; 1472 | } 1473 | } 1474 | 1475 | angular.module('ui.router.compat') 1476 | .provider('$route', $RouteProvider) 1477 | .directive('ngView', $ViewDirective); 1478 | })(window, window.angular); -------------------------------------------------------------------------------- /lib/angular/angular.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | AngularJS v1.0.8 3 | (c) 2010-2012 Google, Inc. http://angularjs.org 4 | License: MIT 5 | */ 6 | (function(P,T,q){'use strict';function m(b,a,c){var d;if(b)if(H(b))for(d in b)d!="prototype"&&d!="length"&&d!="name"&&b.hasOwnProperty(d)&&a.call(c,b[d],d);else if(b.forEach&&b.forEach!==m)b.forEach(a,c);else if(!b||typeof b.length!=="number"?0:typeof b.hasOwnProperty!="function"&&typeof b.constructor!="function"||b instanceof L||aa&&b instanceof aa||ma.call(b)!=="[object Object]"||typeof b.callee==="function")for(d=0;d=0&&b.splice(c,1);return a}function U(b,a){if(pa(b)||b&&b.$evalAsync&&b.$watch)throw Error("Can't copy Window or Scope");if(a){if(b===a)throw Error("Can't copy equivalent objects or arrays");if(E(b))for(var c=a.length=0;c2?ha.call(arguments,2):[];return H(a)&&!(a instanceof RegExp)?c.length?function(){return arguments.length?a.apply(b,c.concat(ha.call(arguments,0))):a.apply(b,c)}:function(){return arguments.length?a.apply(b,arguments):a.call(b)}:a}function kc(b,a){var c=a;/^\$+/.test(b)?c=q:pa(a)?c="$WINDOW":a&&T===a?c="$DOCUMENT":a&&a.$evalAsync&& 13 | a.$watch&&(c="$SCOPE");return c}function ba(b,a){return typeof b==="undefined"?q:JSON.stringify(b,kc,a?" ":null)}function qb(b){return B(b)?JSON.parse(b):b}function Wa(b){b&&b.length!==0?(b=y(""+b),b=!(b=="f"||b=="0"||b=="false"||b=="no"||b=="n"||b=="[]")):b=!1;return b}function qa(b){b=w(b).clone();try{b.html("")}catch(a){}var c=w("
").append(b).html();try{return b[0].nodeType===3?y(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+y(b)})}catch(d){return y(c)}}function rb(b){try{return decodeURIComponent(b)}catch(a){}} 14 | function Xa(b){var a={},c,d;m((b||"").split("&"),function(b){b&&(c=b.split("="),d=rb(c[0]),v(d)&&(a[d]=v(c[1])?rb(c[1]):!0))});return a}function sb(b){var a=[];m(b,function(b,d){a.push(Ya(d,!0)+(b===!0?"":"="+Ya(b,!0)))});return a.length?a.join("&"):""}function Za(b){return Ya(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function Ya(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,a?"%20":"+")} 15 | function lc(b,a){function c(a){a&&d.push(a)}var d=[b],e,g,h=["ng:app","ng-app","x-ng-app","data-ng-app"],f=/\sng[:\-]app(:\s*([\w\d_]+);?)?\s/;m(h,function(a){h[a]=!0;c(T.getElementById(a));a=a.replace(":","\\:");b.querySelectorAll&&(m(b.querySelectorAll("."+a),c),m(b.querySelectorAll("."+a+"\\:"),c),m(b.querySelectorAll("["+a+"]"),c))});m(d,function(a){if(!e){var b=f.exec(" "+a.className+" ");b?(e=a,g=(b[2]||"").replace(/\s+/g,",")):m(a.attributes,function(b){if(!e&&h[b.name])e=a,g=b.value})}}); 16 | e&&a(e,g?[g]:[])}function tb(b,a){var c=function(){b=w(b);a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);a.unshift("ng");var c=ub(a);c.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return c},d=/^NG_DEFER_BOOTSTRAP!/;if(P&&!d.test(P.name))return c();P.name=P.name.replace(d,"");$a.resumeBootstrap=function(b){m(b,function(b){a.push(b)});c()}}function ab(b,a){a=a||"_";return b.replace(mc,function(b, 17 | d){return(d?a:"")+b.toLowerCase()})}function bb(b,a,c){if(!b)throw Error("Argument '"+(a||"?")+"' is "+(c||"required"));return b}function ra(b,a,c){c&&E(b)&&(b=b[b.length-1]);bb(H(b),a,"not a function, got "+(b&&typeof b=="object"?b.constructor.name||"Object":typeof b));return b}function cb(b,a,c){if(!a)return b;for(var a=a.split("."),d,e=b,g=a.length,h=0;h 
"+b;a.removeChild(a.firstChild);eb(this,a.childNodes);this.remove()}else eb(this,b)}function fb(b){return b.cloneNode(!0)}function sa(b){wb(b);for(var a=0,b=b.childNodes|| 21 | [];a-1}function zb(b,a){a&&m(a.split(" "),function(a){b.className=S((" "+b.className+" ").replace(/[\n\t]/g," ").replace(" "+S(a)+" "," "))})}function Ab(b,a){a&&m(a.split(" "),function(a){if(!Ca(b,a))b.className=S(b.className+" "+S(a))})}function eb(b,a){if(a)for(var a=!a.nodeName&&v(a.length)&&!pa(a)?a:[a],c=0;c4096&&c.warn("Cookie '"+ 34 | a+"' possibly not set or overflowed because it was too large ("+d+" > 4096 bytes)!")}else{if(i.cookie!==Q){Q=i.cookie;d=Q.split("; ");ga={};for(f=0;f0&&(a=unescape(e.substring(0,j)),ga[a]===q&&(ga[a]=unescape(e.substring(j+1))))}return ga}};f.defer=function(a,b){var c;p++;c=l(function(){delete o[c];e(a)},b||0);o[c]=!0;return c};f.defer.cancel=function(a){return o[a]?(delete o[a],n(a),e(s),!0):!1}}function zc(){this.$get=["$window","$log","$sniffer","$document", 35 | function(b,a,c,d){return new xc(b,d,a,c)}]}function Ac(){this.$get=function(){function b(b,d){function e(a){if(a!=l){if(n){if(n==a)n=a.n}else n=a;g(a.n,a.p);g(a,l);l=a;l.n=null}}function g(a,b){if(a!=b){if(a)a.p=b;if(b)b.n=a}}if(b in a)throw Error("cacheId "+b+" taken");var h=0,f=D({},d,{id:b}),i={},j=d&&d.capacity||Number.MAX_VALUE,k={},l=null,n=null;return a[b]={put:function(a,b){var c=k[a]||(k[a]={key:a});e(c);u(b)||(a in i||h++,i[a]=b,h>j&&this.remove(n.key))},get:function(a){var b=k[a];if(b)return e(b), 36 | i[a]},remove:function(a){var b=k[a];if(b){if(b==l)l=b.p;if(b==n)n=b.n;g(b.n,b.p);delete k[a];delete i[a];h--}},removeAll:function(){i={};h=0;k={};l=n=null},destroy:function(){k=f=i=null;delete a[b]},info:function(){return D({},f,{size:h})}}}var a={};b.info=function(){var b={};m(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function Bc(){this.$get=["$cacheFactory",function(b){return b("templates")}]}function Fb(b){var a={},c="Directive",d=/^\s*directive\:\s*([\d\w\-_]+)\s+(.*)$/, 37 | e=/(([\d\w\-_]+)(?:\:([^;]+))?;?)/,g="Template must have exactly one root element. was: ",h=/^\s*(https?|ftp|mailto|file):/;this.directive=function i(d,e){B(d)?(bb(e,"directive"),a.hasOwnProperty(d)||(a[d]=[],b.factory(d+c,["$injector","$exceptionHandler",function(b,c){var e=[];m(a[d],function(a){try{var g=b.invoke(a);if(H(g))g={compile:I(g)};else if(!g.compile&&g.link)g.compile=I(g.link);g.priority=g.priority||0;g.name=g.name||d;g.require=g.require||g.controller&&g.name;g.restrict=g.restrict||"A"; 38 | e.push(g)}catch(h){c(h)}});return e}])),a[d].push(e)):m(d,ob(i));return this};this.urlSanitizationWhitelist=function(a){return v(a)?(h=a,this):h};this.$get=["$injector","$interpolate","$exceptionHandler","$http","$templateCache","$parse","$controller","$rootScope","$document",function(b,j,k,l,n,o,p,z,r){function x(a,b,c){a instanceof w||(a=w(a));m(a,function(b,c){b.nodeType==3&&b.nodeValue.match(/\S+/)&&(a[c]=w(b).wrap("").parent()[0])});var d=A(a,b,a,c);return function(b,c){bb(b,"scope"); 39 | for(var e=c?va.clone.call(a):a,g=0,j=e.length;g=8||i.specified)k=i.name,o=ca(k.toLowerCase()),j[o]=k,c[o]=i=S(V&&k=="href"?decodeURIComponent(a.getAttribute(k,2)):i.value),Cb(a,o)&&(c[o]=!0),R(a,b,i,o),C(b,o,"A",g);a=a.className;if(B(a)&&a!=="")for(;h=e.exec(a);)o=ca(h[2]),C(b,o,"C",g)&&(c[o]=S(h[3])),a=a.substr(h.index+h[0].length);break;case 3:Y(b,a.nodeValue);break;case 8:try{if(h=d.exec(a.nodeValue))o=ca(h[1]),C(b,o,"M",g)&&(c[o]=S(h[2]))}catch(n){}}b.sort(t);return b}function K(a,b,c,d,e){function j(a, 42 | b){if(a)a.require=t.require,n.push(a);if(b)b.require=t.require,r.push(b)}function h(a,b){var c,d="data",e=!1;if(B(a)){for(;(c=a.charAt(0))=="^"||c=="?";)a=a.substr(1),c=="^"&&(d="inheritedData"),e=e||c=="?";c=b[d]("$"+a+"Controller");if(!c&&!e)throw Error("No controller: "+a);}else E(a)&&(c=[],m(a,function(a){c.push(h(a,b))}));return c}function i(a,d,e,g,j){var l,z,t,F,N;l=b===e?c:jc(c,new ia(w(e),c.$attr));z=l.$$element;if(K){var Cc=/^\s*([@=&])\s*(\w*)\s*$/,x=d.$parent||d;m(K.scope,function(a,b){var c= 43 | a.match(Cc)||[],e=c[2]||b,c=c[1],g,j,h;d.$$isolateBindings[b]=c+e;switch(c){case "@":l.$observe(e,function(a){d[b]=a});l.$$observers[e].$$scope=x;break;case "=":j=o(l[e]);h=j.assign||function(){g=d[b]=j(x);throw Error(Gb+l[e]+" (directive: "+K.name+")");};g=d[b]=j(x);d.$watch(function(){var a=j(x);a!==d[b]&&(a!==g?g=d[b]=a:h(x,a=g=d[b]));return a});break;case "&":j=o(l[e]);d[b]=function(a){return j(x,a)};break;default:throw Error("Invalid isolate scope definition for directive "+K.name+": "+a);}})}Y&& 44 | m(Y,function(a){var b={$scope:d,$element:z,$attrs:l,$transclude:j};N=a.controller;N=="@"&&(N=l[a.name]);z.data("$"+a.name+"Controller",p(N,b))});g=0;for(t=n.length;gt.priority)break; 45 | if(u=t.scope)ua("isolated scope",K,t,F),M(u)&&(N(F,"ng-isolate-scope"),K=t),N(F,"ng-scope"),z=z||t;C=t.name;if(u=t.controller)Y=Y||{},ua("'"+C+"' controller",Y[C],t,F),Y[C]=t;if(u=t.transclude)ua("transclusion",ja,t,F),ja=t,l=t.priority,u=="element"?(R=w(b),F=c.$$element=w(T.createComment(" "+C+": "+c[C]+" ")),b=F[0],v(e,w(R[0]),b),da=x(R,d,l)):(R=w(fb(b)).contents(),F.html(""),da=x(R,d));if(u=t.template)if(ua("template",A,t,F),A=t,u=Hb(u),t.replace){R=w("
"+S(u)+"
").contents();b=R[0];if(R.length!= 46 | 1||b.nodeType!==1)throw Error(g+u);v(e,F,b);C={$attr:{}};a=a.concat(J(b,a.splice(D+1,a.length-(D+1)),C));ga(c,C);y=a.length}else F.html(u);if(t.templateUrl)ua("template",A,t,F),A=t,i=Q(a.splice(D,a.length-D),i,F,c,e,t.replace,da),y=a.length;else if(t.compile)try{s=t.compile(F,c,da),H(s)?j(null,s):s&&j(s.pre,s.post)}catch(G){k(G,qa(F))}if(t.terminal)i.terminal=!0,l=Math.max(l,t.priority)}i.scope=z&&z.scope;i.transclude=ja&&da;return i}function C(d,e,g,j){var h=!1;if(a.hasOwnProperty(e))for(var o,e= 47 | b.get(e+c),l=0,p=e.length;lo.priority)&&o.restrict.indexOf(g)!=-1)d.push(o),h=!0}catch(n){k(n)}return h}function ga(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;m(a,function(d,e){e.charAt(0)!="$"&&(b[e]&&(d+=(e==="style"?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});m(b,function(b,g){g=="class"?(N(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):g=="style"?e.attr("style",e.attr("style")+";"+b):g.charAt(0)!="$"&&!a.hasOwnProperty(g)&&(a[g]=b,d[g]=c[g])})}function Q(a,b,c,d,e, 48 | j,h){var i=[],k,o,p=c[0],r=a.shift(),z=D({},r,{controller:null,templateUrl:null,transclude:null,scope:null});c.html("");l.get(r.templateUrl,{cache:n}).success(function(l){var n,r,l=Hb(l);if(j){r=w("
"+S(l)+"
").contents();n=r[0];if(r.length!=1||n.nodeType!==1)throw Error(g+l);l={$attr:{}};v(e,c,n);J(n,a,l);ga(d,l)}else n=p,c.html(l);a.unshift(z);k=K(a,n,d,h);for(o=A(c[0].childNodes,h);i.length;){var ia=i.pop(),l=i.pop();r=i.pop();var F=i.pop(),t=n;r!==p&&(t=fb(n),v(l,w(r),t));k(function(){b(o, 49 | F,t,e,ia)},F,t,e,ia)}i=null}).error(function(a,b,c,d){throw Error("Failed to load template: "+d.url);});return function(a,c,d,e,g){i?(i.push(c),i.push(d),i.push(e),i.push(g)):k(function(){b(o,c,d,e,g)},c,d,e,g)}}function t(a,b){return b.priority-a.priority}function ua(a,b,c,d){if(b)throw Error("Multiple directives ["+b.name+", "+c.name+"] asking for "+a+" on: "+qa(d));}function Y(a,b){var c=j(b,!0);c&&a.push({priority:0,compile:I(function(a,b){var d=b.parent(),e=d.data("$binding")||[];e.push(c);N(d.data("$binding", 50 | e),"ng-binding");a.$watch(c,function(a){b[0].nodeValue=a})})})}function R(a,b,c,d){var e=j(c,!0);e&&b.push({priority:100,compile:I(function(a,b,c){b=c.$$observers||(c.$$observers={});d==="class"&&(e=j(c[d],!0));c[d]=q;(b[d]||(b[d]=[])).$$inter=!0;(c.$$observers&&c.$$observers[d].$$scope||a).$watch(e,function(a){c.$set(d,a)})})})}function v(a,b,c){var d=b[0],e=d.parentNode,g,j;if(a){g=0;for(j=a.length;g0){var e=Q[0],f=e.text;if(f==a||f==b||f==c||f==d||!a&&!b&&!c&&!d)return e}return!1}function f(b,c,d,f){return(b=h(b,c,d,f))?(a&&!b.json&&e("is not valid json",b),Q.shift(),b):!1}function i(a){f(a)||e("is unexpected, expecting ["+ 69 | a+"]",h())}function j(a,b){return function(c,d){return a(c,d,b)}}function k(a,b,c){return function(d,e){return b(d,e,a,c)}}function l(){for(var a=[];;)if(Q.length>0&&!h("}",")",";","]")&&a.push(v()),!f(";"))return a.length==1?a[0]:function(b,c){for(var d,e=0;e","<=",">="))a=k(a,b.fn,r());return a}function x(){for(var a=m(),b;b=f("*","/","%");)a=k(a,b.fn,m());return a}function m(){var a;return f("+")?A():(a=f("-"))?k(C,a.fn,m()):(a=f("!"))?j(a.fn,m()):A()}function A(){var a; 71 | if(f("("))a=v(),i(")");else if(f("["))a=J();else if(f("{"))a=K();else{var b=f();(a=b.fn)||e("not a primary expression",b)}for(var c;b=f("(","[",".");)b.text==="("?(a=w(a,c),c=null):b.text==="["?(c=a,a=R(a)):b.text==="."?(c=a,a=Y(a)):e("IMPOSSIBLE");return a}function J(){var a=[];if(g().text!="]"){do a.push(t());while(f(","))}i("]");return function(b,c){for(var d=[],e=0;e1;d++){var e=a.shift(),g=b[e];g||(g={},b[e]=g);b=g}return b[a.shift()]=c}function Pb(b,a,c,d,e){return function(g,h){var f=h&&h.hasOwnProperty(b)?h:g,i;if(f===null||f===q)return f;if((f=f[b])&&f.then){if(!("$$v"in f))i=f,i.$$v=q,i.then(function(a){i.$$v=a});f=f.$$v}if(!a||f===null||f=== 75 | q)return f;if((f=f[a])&&f.then){if(!("$$v"in f))i=f,i.$$v=q,i.then(function(a){i.$$v=a});f=f.$$v}if(!c||f===null||f===q)return f;if((f=f[c])&&f.then){if(!("$$v"in f))i=f,i.$$v=q,i.then(function(a){i.$$v=a});f=f.$$v}if(!d||f===null||f===q)return f;if((f=f[d])&&f.then){if(!("$$v"in f))i=f,i.$$v=q,i.then(function(a){i.$$v=a});f=f.$$v}if(!e||f===null||f===q)return f;if((f=f[e])&&f.then){if(!("$$v"in f))i=f,i.$$v=q,i.then(function(a){i.$$v=a});f=f.$$v}return f}}function Nb(b,a){if(jb.hasOwnProperty(b))return jb[b]; 76 | var c=b.split("."),d=c.length,e;if(a)e=d<6?Pb(c[0],c[1],c[2],c[3],c[4]):function(a,b){var e=0,g;do g=Pb(c[e++],c[e++],c[e++],c[e++],c[e++])(a,b),b=q,a=g;while(e7),hasEvent:function(c){if(c=="input"&&V==9)return!1;if(u(a[c])){var e= 92 | b.document.createElement("div");a[c]="on"+c in e}return a[c]},csp:!1}}]}function Yc(){this.$get=I(P)}function Qb(b){var a={},c,d,e;if(!b)return a;m(b.split("\n"),function(b){e=b.indexOf(":");c=y(S(b.substr(0,e)));d=S(b.substr(e+1));c&&(a[c]?a[c]+=", "+d:a[c]=d)});return a}function Rb(b){var a=M(b)?b:q;return function(c){a||(a=Qb(b));return c?a[y(c)]||null:a}}function Sb(b,a,c){if(H(c))return c(b,a);m(c,function(c){b=c(b,a)});return b}function Zc(){var b=/^\s*(\[|\{[^\{])/,a=/[\}\]]\s*$/,c=/^\)\]\}',?\n/, 93 | d=this.defaults={transformResponse:[function(d){B(d)&&(d=d.replace(c,""),b.test(d)&&a.test(d)&&(d=qb(d,!0)));return d}],transformRequest:[function(a){return M(a)&&ma.apply(a)!=="[object File]"?ba(a):a}],headers:{common:{Accept:"application/json, text/plain, */*","X-Requested-With":"XMLHttpRequest"},post:{"Content-Type":"application/json;charset=utf-8"},put:{"Content-Type":"application/json;charset=utf-8"}}},e=this.responseInterceptors=[];this.$get=["$httpBackend","$browser","$cacheFactory","$rootScope", 94 | "$q","$injector",function(a,b,c,i,j,k){function l(a){function c(a){var b=D({},a,{data:Sb(a.data,a.headers,f)});return 200<=a.status&&a.status<300?b:j.reject(b)}a.method=la(a.method);var e=a.transformRequest||d.transformRequest,f=a.transformResponse||d.transformResponse,g=D({},a.headers),i=D({"X-XSRF-TOKEN":b.cookies()["XSRF-TOKEN"]},d.headers.common,d.headers[y(a.method)]),k,l,o,p;a:for(k in i){l=y(k);for(o in a.headers)if(y(o)===l)continue a;g[k]=i[k]}if(u(a.data))for(var q in g)if(y(q)==="content-type"){delete g[q]; 95 | break}e=Sb(a.data,Rb(g),e);p=n(a,e,g);p=p.then(c,c);m(z,function(a){p=a(p)});p.success=function(b){p.then(function(c){b(c.data,c.status,c.headers,a)});return p};p.error=function(b){p.then(null,function(c){b(c.data,c.status,c.headers,a)});return p};return p}function n(b,c,d){function e(a,b,c){m&&(200<=a&&a<300?m.put(q,[a,b,Qb(c)]):m.remove(q));f(b,a,c);i.$apply()}function f(a,c,d){c=Math.max(c,0);(200<=c&&c<300?k.resolve:k.reject)({data:a,status:c,headers:Rb(d),config:b})}function h(){var a=za(l.pendingRequests, 96 | b);a!==-1&&l.pendingRequests.splice(a,1)}var k=j.defer(),n=k.promise,m,t,q=o(b.url,b.params);l.pendingRequests.push(b);n.then(h,h);b.cache&&b.method=="GET"&&(m=M(b.cache)?b.cache:p);if(m)if(t=m.get(q))if(t.then)return t.then(h,h),t;else E(t)?f(t[1],t[0],U(t[2])):f(t,200,{});else m.put(q,n);t||a(b.method,q,c,e,d,b.timeout,b.withCredentials);return n}function o(a,b){if(!b)return a;var c=[];hc(b,function(a,b){a==null||a==q||(M(a)&&(a=ba(a)),c.push(encodeURIComponent(b)+"="+encodeURIComponent(a)))}); 97 | return a+(a.indexOf("?")==-1?"?":"&")+c.join("&")}var p=c("$http"),z=[];m(e,function(a){z.push(B(a)?k.get(a):k.invoke(a))});l.pendingRequests=[];(function(a){m(arguments,function(a){l[a]=function(b,c){return l(D(c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");(function(a){m(arguments,function(a){l[a]=function(b,c,d){return l(D(d||{},{method:a,url:b,data:c}))}})})("post","put");l.defaults=d;return l}]}function $c(){this.$get=["$browser","$window","$document",function(b,a,c){return ad(b, 98 | bd,b.defer,a.angular.callbacks,c[0],a.location.protocol.replace(":",""))}]}function ad(b,a,c,d,e,g){function h(a,b){var c=e.createElement("script"),d=function(){e.body.removeChild(c);b&&b()};c.type="text/javascript";c.src=a;V?c.onreadystatechange=function(){/loaded|complete/.test(c.readyState)&&d()}:c.onload=c.onerror=d;e.body.appendChild(c)}return function(e,i,j,k,l,n,o){function p(a,c,d,e){c=(i.match(Jb)||["",g])[1]=="file"?d?200:404:c;a(c==1223?204:c,d,e);b.$$completeOutstandingRequest(s)}b.$$incOutstandingRequestCount(); 99 | i=i||b.url();if(y(e)=="jsonp"){var q="_"+(d.counter++).toString(36);d[q]=function(a){d[q].data=a};h(i.replace("JSON_CALLBACK","angular.callbacks."+q),function(){d[q].data?p(k,200,d[q].data):p(k,-2);delete d[q]})}else{var r=new a;r.open(e,i,!0);m(l,function(a,b){a&&r.setRequestHeader(b,a)});var x;r.onreadystatechange=function(){if(r.readyState==4){var a=r.getAllResponseHeaders(),b=["Cache-Control","Content-Language","Content-Type","Expires","Last-Modified","Pragma"];a||(a="",m(b,function(b){var c= 100 | r.getResponseHeader(b);c&&(a+=b+": "+c+"\n")}));p(k,x||r.status,r.responseText,a)}};if(o)r.withCredentials=!0;r.send(j||"");n>0&&c(function(){x=-1;r.abort()},n)}}}function cd(){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:"\u00a4",posSuf:"",negPre:"(\u00a4",negSuf:")",gSize:3,lgSize:3}],CURRENCY_SYM:"$"},DATETIME_FORMATS:{MONTH:"January,February,March,April,May,June,July,August,September,October,November,December".split(","), 101 | 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"},pluralCat:function(b){return b===1?"one":"other"}}}}function dd(){this.$get=["$rootScope","$browser","$q", 102 | "$exceptionHandler",function(b,a,c,d){function e(e,f,i){var j=c.defer(),k=j.promise,l=v(i)&&!i,f=a.defer(function(){try{j.resolve(e())}catch(a){j.reject(a),d(a)}finally{delete g[k.$$timeoutId]}l||b.$apply()},f);k.$$timeoutId=f;g[f]=j;return k}var g={};e.cancel=function(b){return b&&b.$$timeoutId in g?(g[b.$$timeoutId].reject("canceled"),delete g[b.$$timeoutId],a.defer.cancel(b.$$timeoutId)):!1};return e}]}function Tb(b){function a(a,e){return b.factory(a+c,e)}var c="Filter";this.register=a;this.$get= 103 | ["$injector",function(a){return function(b){return a.get(b+c)}}];a("currency",Ub);a("date",Vb);a("filter",ed);a("json",fd);a("limitTo",gd);a("lowercase",hd);a("number",Wb);a("orderBy",Xb);a("uppercase",id)}function ed(){return function(b,a){if(!E(b))return b;var c=[];c.check=function(a){for(var b=0;b 104 | -1;case "object":for(var c in a)if(c.charAt(0)!=="$"&&d(a[c],b))return!0;return!1;case "array":for(c=0;ce+1?h="0":(f=h,j=!0)}if(j)e>0&&b>-1&&b<1&&(f=b.toFixed(e));else{h=(h.split(Zb)[1]||"").length;u(e)&&(e=Math.min(Math.max(a.minFrac,h),a.maxFrac));var h=Math.pow(10,e),b=Math.round(b*h)/h,b=(""+b).split(Zb),h=b[0],b=b[1]||"",j=0,k=a.lgSize,l=a.gSize;if(h.length>=k+l)for(var j=h.length-k,n=0;n0||e>-c)e+=c;e===0&&c==-12&&(e=12);return kb(e,a,d)}}function Ka(b,a){return function(c,d){var e=c["get"+b](),g=la(a?"SHORT"+b:b);return d[g][e]}}function Vb(b){function a(a){var b;if(b=a.match(c)){var a=new Date(0),g=0,h=0;b[9]&&(g=G(b[9]+b[10]),h=G(b[9]+ 108 | b[11]));a.setUTCFullYear(G(b[1]),G(b[2])-1,G(b[3]));a.setUTCHours(G(b[4]||0)-g,G(b[5]||0)-h,G(b[6]||0),G(b[7]||0))}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e){var g="",h=[],f,i,e=e||"mediumDate",e=b.DATETIME_FORMATS[e]||e;B(c)&&(c=jd.test(c)?G(c):a(c));Ra(c)&&(c=new Date(c));if(!oa(c))return c;for(;e;)(i=kd.exec(e))?(h=h.concat(ha.call(i,1)),e=h.pop()):(h.push(e),e=null);m(h,function(a){f=ld[a];g+=f?f(c, 109 | b.DATETIME_FORMATS):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function fd(){return function(b){return ba(b,!0)}}function gd(){return function(b,a){if(!(b instanceof Array))return b;var a=G(a),c=[],d,e;if(!b||!(b instanceof Array))return c;a>b.length?a=b.length:a<-b.length&&(a=-b.length);a>0?(d=0,e=a):(d=b.length+a,e=b.length);for(;dn?(d.$setValidity("maxlength", 115 | !1),q):(d.$setValidity("maxlength",!0),a)};d.$parsers.push(c);d.$formatters.push(c)}}function lb(b,a){b="ngClass"+b;return W(function(c,d,e){function g(b){if(a===!0||c.$index%2===a)i&&!ea(b,i)&&h(i),f(b);i=U(b)}function h(a){M(a)&&!E(a)&&(a=Ta(a,function(a,b){if(a)return b}));d.removeClass(E(a)?a.join(" "):a)}function f(a){M(a)&&!E(a)&&(a=Ta(a,function(a,b){if(a)return b}));a&&d.addClass(E(a)?a.join(" "):a)}var i=q;c.$watch(e[b],g,!0);e.$observe("class",function(){var a=c.$eval(e[b]);g(a,a)});b!== 116 | "ngClass"&&c.$watch("$index",function(d,g){var i=d&1;i!==g&1&&(i===a?f(c.$eval(e[b])):h(c.$eval(e[b])))})})}var y=function(b){return B(b)?b.toLowerCase():b},la=function(b){return B(b)?b.toUpperCase():b},V=G((/msie (\d+)/.exec(y(navigator.userAgent))||[])[1]),w,aa,ha=[].slice,Qa=[].push,ma=Object.prototype.toString,$a=P.angular||(P.angular={}),ta,Ga,Z=["0","0","0"];s.$inject=[];na.$inject=[];var S=function(){return!String.prototype.trim?function(b){return B(b)?b.replace(/^\s*/,"").replace(/\s*$/,""): 117 | b}:function(b){return B(b)?b.trim():b}}();Ga=V<9?function(b){b=b.nodeName?b:b[0];return b.scopeName&&b.scopeName!="HTML"?la(b.scopeName+":"+b.nodeName):b.nodeName}:function(b){return b.nodeName?b.nodeName:b[0].nodeName};var mc=/[A-Z]/g,md={full:"1.0.8",major:1,minor:0,dot:8,codeName:"bubble-burst"},Ba=L.cache={},Aa=L.expando="ng-"+(new Date).getTime(),qc=1,bc=P.document.addEventListener?function(b,a,c){b.addEventListener(a,c,!1)}:function(b,a,c){b.attachEvent("on"+a,c)},gb=P.document.removeEventListener? 118 | function(b,a,c){b.removeEventListener(a,c,!1)}:function(b,a,c){b.detachEvent("on"+a,c)},oc=/([\:\-\_]+(.))/g,pc=/^moz([A-Z])/,va=L.prototype={ready:function(b){function a(){c||(c=!0,b())}var c=!1;this.bind("DOMContentLoaded",a);L(P).bind("load",a)},toString:function(){var b=[];m(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return b>=0?w(this[b]):w(this[this.length+b])},length:0,push:Qa,sort:[].sort,splice:[].splice},Ea={};m("multiple,selected,checked,disabled,readOnly,required".split(","), 119 | function(b){Ea[y(b)]=b});var Db={};m("input,select,option,textarea,button,form".split(","),function(b){Db[la(b)]=!0});m({data:yb,inheritedData:Da,scope:function(b){return Da(b,"$scope")},controller:Bb,injector:function(b){return Da(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:Ca,css:function(b,a,c){a=vb(a);if(v(c))b.style[a]=c;else{var d;V<=8&&(d=b.currentStyle&&b.currentStyle[a],d===""&&(d="auto"));d=d||b.style[a];V<=8&&(d=d===""?q:d);return d}},attr:function(b,a,c){var d= 120 | y(a);if(Ea[d])if(v(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||s).specified?d:q;else if(v(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),b===null?q:b},prop:function(b,a,c){if(v(c))b[a]=c;else return b[a]},text:D(V<9?function(b,a){if(b.nodeType==1){if(u(a))return b.innerText;b.innerText=a}else{if(u(a))return b.nodeValue;b.nodeValue=a}}:function(b,a){if(u(a))return b.textContent;b.textContent=a},{$dv:""}), 121 | val:function(b,a){if(u(a)){if(Ga(b)==="SELECT"&&b.multiple){var c=[];m(b.options,function(a){a.selected&&c.push(a.value||a.text)});return c.length===0?null:c}return b.value}b.value=a},html:function(b,a){if(u(a))return b.innerHTML;for(var c=0,d=b.childNodes;c":function(a,c,d,e){return d(a,c)>e(a,c)},"<=":function(a,c,d,e){return d(a,c)<=e(a,c)},">=":function(a,c,d,e){return d(a,c)>=e(a,c)},"&&":function(a,c,d,e){return d(a,c)&&e(a,c)},"||":function(a,c,d,e){return d(a,c)||e(a,c)},"&":function(a,c,d,e){return d(a,c)&e(a,c)},"|":function(a,c,d,e){return e(a,c)(a,c,d(a,c))},"!":function(a,c,d){return!d(a,c)}},Pc={n:"\n",f:"\u000c",r:"\r",t:"\t",v:"\u000b","'":"'",'"':'"'},jb={},bd=P.XMLHttpRequest||function(){try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(a){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(c){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(d){}throw Error("This browser does not support XMLHttpRequest."); 131 | };Tb.$inject=["$provide"];Ub.$inject=["$locale"];Wb.$inject=["$locale"];var Zb=".",ld={yyyy:O("FullYear",4),yy:O("FullYear",2,0,!0),y:O("FullYear",1),MMMM:Ka("Month"),MMM:Ka("Month",!0),MM:O("Month",2,1),M:O("Month",1,1),dd:O("Date",2),d:O("Date",1),HH:O("Hours",2),H:O("Hours",1),hh:O("Hours",2,-12),h:O("Hours",1,-12),mm:O("Minutes",2),m:O("Minutes",1),ss:O("Seconds",2),s:O("Seconds",1),EEEE:Ka("Day"),EEE:Ka("Day",!0),a:function(a,c){return a.getHours()<12?c.AMPMS[0]:c.AMPMS[1]},Z:function(a){var a= 132 | -1*a.getTimezoneOffset(),c=a>=0?"+":"";c+=kb(Math[a>0?"floor":"ceil"](a/60),2)+kb(Math.abs(a%60),2);return c}},kd=/((?:[^yMdHhmsaZE']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z))(.*)/,jd=/^\d+$/;Vb.$inject=["$locale"];var hd=I(y),id=I(la);Xb.$inject=["$parse"];var nd=I({restrict:"E",compile:function(a,c){V<=8&&(!c.href&&!c.name&&c.$set("href",""),a.append(T.createComment("IE fix")));return function(a,c){c.bind("click",function(a){c.attr("href")||a.preventDefault()})}}}),mb={};m(Ea,function(a, 133 | c){var d=ca("ng-"+c);mb[d]=function(){return{priority:100,compile:function(){return function(a,g,h){a.$watch(h[d],function(a){h.$set(c,!!a)})}}}}});m(["src","href"],function(a){var c=ca("ng-"+a);mb[c]=function(){return{priority:99,link:function(d,e,g){g.$observe(c,function(c){c&&(g.$set(a,c),V&&e.prop(a,g[a]))})}}}});var Na={$addControl:s,$removeControl:s,$setValidity:s,$setDirty:s};$b.$inject=["$element","$attrs","$scope"];var Qa=function(a){return["$timeout",function(c){var d={name:"form",restrict:"E", 134 | controller:$b,compile:function(){return{pre:function(a,d,h,f){if(!h.action){var i=function(a){a.preventDefault?a.preventDefault():a.returnValue=!1};bc(d[0],"submit",i);d.bind("$destroy",function(){c(function(){gb(d[0],"submit",i)},0,!1)})}var j=d.parent().controller("form"),k=h.name||h.ngForm;k&&(a[k]=f);j&&d.bind("$destroy",function(){j.$removeControl(f);k&&(a[k]=q);D(f,Na)})}}}};return a?D(U(d),{restrict:"EAC"}):d}]},od=Qa(),pd=Qa(!0),qd=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/, 135 | rd=/^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,6}$/,sd=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,dc={text:Pa,number:function(a,c,d,e,g,h){Pa(a,c,d,e,g,h);e.$parsers.push(function(a){var c=X(a);return c||sd.test(a)?(e.$setValidity("number",!0),a===""?null:c?a:parseFloat(a)):(e.$setValidity("number",!1),q)});e.$formatters.push(function(a){return X(a)?"":""+a});if(d.min){var f=parseFloat(d.min),a=function(a){return!X(a)&&ai?(e.$setValidity("max",!1),q):(e.$setValidity("max",!0),a)};e.$parsers.push(d);e.$formatters.push(d)}e.$formatters.push(function(a){return X(a)||Ra(a)?(e.$setValidity("number",!0),a):(e.$setValidity("number",!1),q)})},url:function(a,c,d,e,g,h){Pa(a,c,d,e,g,h);a=function(a){return X(a)||qd.test(a)?(e.$setValidity("url",!0),a):(e.$setValidity("url",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},email:function(a, 137 | c,d,e,g,h){Pa(a,c,d,e,g,h);a=function(a){return X(a)||rd.test(a)?(e.$setValidity("email",!0),a):(e.$setValidity("email",!1),q)};e.$formatters.push(a);e.$parsers.push(a)},radio:function(a,c,d,e){u(d.name)&&c.attr("name",xa());c.bind("click",function(){c[0].checked&&a.$apply(function(){e.$setViewValue(d.value)})});e.$render=function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e){var g=d.ngTrueValue,h=d.ngFalseValue;B(g)||(g=!0);B(h)||(h=!1);c.bind("click", 138 | function(){a.$apply(function(){e.$setViewValue(c[0].checked)})});e.$render=function(){c[0].checked=e.$viewValue};e.$formatters.push(function(a){return a===g});e.$parsers.push(function(a){return a?g:h})},hidden:s,button:s,submit:s,reset:s},ec=["$browser","$sniffer",function(a,c){return{restrict:"E",require:"?ngModel",link:function(d,e,g,h){h&&(dc[y(g.type)]||dc.text)(d,e,g,h,c,a)}}}],Ma="ng-valid",La="ng-invalid",Oa="ng-pristine",ac="ng-dirty",td=["$scope","$exceptionHandler","$attrs","$element","$parse", 139 | function(a,c,d,e,g){function h(a,c){c=c?"-"+ab(c,"-"):"";e.removeClass((a?La:Ma)+c).addClass((a?Ma:La)+c)}this.$modelValue=this.$viewValue=Number.NaN;this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$name=d.name;var f=g(d.ngModel),i=f.assign;if(!i)throw Error(Gb+d.ngModel+" ("+qa(e)+")");this.$render=s;var j=e.inheritedData("$formController")||Na,k=0,l=this.$error={};e.addClass(Oa);h(!0);this.$setValidity=function(a, 140 | c){if(l[a]!==!c){if(c){if(l[a]&&k--,!k)h(!0),this.$valid=!0,this.$invalid=!1}else h(!1),this.$invalid=!0,this.$valid=!1,k++;l[a]=!c;h(c,a);j.$setValidity(a,c,this)}};this.$setViewValue=function(d){this.$viewValue=d;if(this.$pristine)this.$dirty=!0,this.$pristine=!1,e.removeClass(Oa).addClass(ac),j.$setDirty();m(this.$parsers,function(a){d=a(d)});if(this.$modelValue!==d)this.$modelValue=d,i(a,d),m(this.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};var n=this;a.$watch(function(){var c= 141 | f(a);if(n.$modelValue!==c){var d=n.$formatters,e=d.length;for(n.$modelValue=c;e--;)c=d[e](c);if(n.$viewValue!==c)n.$viewValue=c,n.$render()}})}],ud=function(){return{require:["ngModel","^?form"],controller:td,link:function(a,c,d,e){var g=e[0],h=e[1]||Na;h.$addControl(g);c.bind("$destroy",function(){h.$removeControl(g)})}}},vd=I({require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),fc=function(){return{require:"?ngModel",link:function(a,c,d,e){if(e){d.required= 142 | !0;var g=function(a){if(d.required&&(X(a)||a===!1))e.$setValidity("required",!1);else return e.$setValidity("required",!0),a};e.$formatters.push(g);e.$parsers.unshift(g);d.$observe("required",function(){g(e.$viewValue)})}}}},wd=function(){return{require:"ngModel",link:function(a,c,d,e){var g=(a=/\/(.*)\//.exec(d.ngList))&&RegExp(a[1])||d.ngList||",";e.$parsers.push(function(a){var c=[];a&&m(a.split(g),function(a){a&&c.push(S(a))});return c});e.$formatters.push(function(a){return E(a)?a.join(", "): 143 | q})}}},xd=/^(true|false|\d+)$/,yd=function(){return{priority:100,compile:function(a,c){return xd.test(c.ngValue)?function(a,c,g){g.$set("value",a.$eval(g.ngValue))}:function(a,c,g){a.$watch(g.ngValue,function(a){g.$set("value",a)})}}}},zd=W(function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBind);a.$watch(d.ngBind,function(a){c.text(a==q?"":a)})}),Ad=["$interpolate",function(a){return function(c,d,e){c=a(d.attr(e.$attr.ngBindTemplate));d.addClass("ng-binding").data("$binding",c);e.$observe("ngBindTemplate", 144 | function(a){d.text(a)})}}],Bd=[function(){return function(a,c,d){c.addClass("ng-binding").data("$binding",d.ngBindHtmlUnsafe);a.$watch(d.ngBindHtmlUnsafe,function(a){c.html(a||"")})}}],Cd=lb("",!0),Dd=lb("Odd",0),Ed=lb("Even",1),Fd=W({compile:function(a,c){c.$set("ngCloak",q);a.removeClass("ng-cloak")}}),Gd=[function(){return{scope:!0,controller:"@"}}],Hd=["$sniffer",function(a){return{priority:1E3,compile:function(){a.csp=!0}}}],gc={};m("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave submit".split(" "), 145 | function(a){var c=ca("ng-"+a);gc[c]=["$parse",function(d){return function(e,g,h){var f=d(h[c]);g.bind(y(a),function(a){e.$apply(function(){f(e,{$event:a})})})}}]});var Id=["$http","$templateCache","$anchorScroll","$compile",function(a,c,d,e){return{restrict:"ECA",terminal:!0,compile:function(g,h){var f=h.ngInclude||h.src,i=h.onload||"",j=h.autoscroll;return function(g,h){var n=0,o,p=function(){o&&(o.$destroy(),o=null);h.html("")};g.$watch(f,function(f){var m=++n;f?a.get(f,{cache:c}).success(function(a){m=== 146 | n&&(o&&o.$destroy(),o=g.$new(),h.html(a),e(h.contents())(o),v(j)&&(!j||g.$eval(j))&&d(),o.$emit("$includeContentLoaded"),g.$eval(i))}).error(function(){m===n&&p()}):p()})}}}}],Jd=W({compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),Kd=W({terminal:!0,priority:1E3}),Ld=["$locale","$interpolate",function(a,c){var d=/{}/g;return{restrict:"EA",link:function(e,g,h){var f=h.count,i=g.attr(h.$attr.when),j=h.offset||0,k=e.$eval(i),l={},n=c.startSymbol(),o=c.endSymbol();m(k,function(a,e){l[e]= 147 | c(a.replace(d,n+f+"-"+j+o))});e.$watch(function(){var c=parseFloat(e.$eval(f));return isNaN(c)?"":(c in k||(c=a.pluralCat(c-j)),l[c](e,g,!0))},function(a){g.text(a)})}}}],Md=W({transclude:"element",priority:1E3,terminal:!0,compile:function(a,c,d){return function(a,c,h){var f=h.ngRepeat,h=f.match(/^\s*(.+)\s+in\s+(.*)\s*$/),i,j,k;if(!h)throw Error("Expected ngRepeat in form of '_item_ in _collection_' but got '"+f+"'.");f=h[1];i=h[2];h=f.match(/^(?:([\$\w]+)|\(([\$\w]+)\s*,\s*([\$\w]+)\))$/);if(!h)throw Error("'item' in 'item in collection' should be identifier or (key, value) but got '"+ 148 | f+"'.");j=h[3]||h[1];k=h[2];var l=new hb;a.$watch(function(a){var e,f,h=a.$eval(i),m=c,q=new hb,u,A,w,v,C,s;if(E(h))C=h||[];else{C=[];for(w in h)h.hasOwnProperty(w)&&w.charAt(0)!="$"&&C.push(w);C.sort()}u=C.length-1;e=0;for(f=C.length;ez;)v.pop().element.remove()}for(;w.length>y;)w.pop()[0].element.remove()}var i;if(!(i=s.match(d)))throw Error("Expected ngOptions in form of '_select_ (as _label_)? for (_key_,)?_value_ in _collection_' but got '"+s+"'.");var j=c(i[2]||i[1]),k=i[4]|| 158 | i[6],l=i[5],m=c(i[3]||""),n=c(i[2]?i[1]:k),o=c(i[7]),w=[[{element:f,label:""}]];r&&(a(r)(e),r.removeClass("ng-scope"),r.remove());f.html("");f.bind("change",function(){e.$apply(function(){var a,c=o(e)||[],d={},h,i,j,m,r,s;if(p){i=[];m=0;for(s=w.length;m@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak{display:none !important;}ng\\:form{display:block;}'); 164 | --------------------------------------------------------------------------------