actualizado a 1.4 hasta tema 6

This commit is contained in:
Alberto Basalo 2015-10-13 20:05:11 +02:00
Родитель 9951e8e29f
Коммит ccab466801
56 изменённых файлов: 2131 добавлений и 1013 удалений

Просмотреть файл

@ -0,0 +1,8 @@
HolaAngularJS
=============
Hola Mundo con AngularJS
________________________
AngularJS es una técnología que nos facilita enormemente la ccreación de interfaces web.
Puedes comprobar como este humilde *Hola Mundo* se torna potente sólo con añadir un par de *directivas* de AngularJS.

Просмотреть файл

@ -0,0 +1,40 @@
<!--Directiva ng-app para indicarle a AngularJS que debe ejecutarse sobre este documento-->
<html ng-app>
<head>
<title>Hola AngularJS</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Tutorial simple Hola Mundo en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="HolaAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso, ng-app" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
</head>
<body class="container-fluid">
<header>
<h1>Hola Mundo AngularJS</h1>
<h2>uno + uno son {{ 1 + 1}} </h2>
</header>
<section>
<div>
<span>¿Cómo te llamas? : </span>
<!--Directiva ng-model para enlazar la vista con una propiedad del modelo-->
<input ng-model="tuNombre">
</div>
<br/>
<!--Interpolación en el contenido de una expresión {{entre llaves}} que usa una propiedadad del modelo-->
<div class="text-info">Hola {{ tuNombre }}, bienvenido al mundo de AngularJS !!!</div>
</section>
<footer>
<hr>
<p>Código de ejemplo creado por <a href="https://twitter.com/albertobasalo">Alberto Basalo</a> de <a href="http://agorabinaria.com">Ágora Binaria</a></p>
<p>Accede a este y otros contenidos formativos en <a href="https://github.com/AcademiaBinaria">GitHub-AcademiaBinaria</a></p>
</footer>
<!-- Enlace al CDN de Google para descargar una versión minimizada de AngularJS-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
</body>
</html>

Просмотреть файл

@ -0,0 +1,10 @@
ClimAngularJS
=============
Demo de uso de llamadas con **$http** y directivas **ng-options** y **ng-repeat**. Usa el API de *openweathermap*
# Avanzado
En la versión avanzada se hace uso de factorias y directivas
Las **factorias** permiten extraer lógica de negocio y mantienen los controladores con tamaños reducidos
Las **directivas** agregan funcionalidad al HTML haciendo las ptente y semántico

Просмотреть файл

@ -0,0 +1,61 @@
angular
.module('climAngular', []);
angular
.module('climAngular')
.controller("ClimAngularCtrl", ClimAngularCtrl);
// La función controladora se crea con nombre de maner independiente
// En lugar de programarla inline dentro del constructor del controlador
function ClimAngularCtrl($http) {
// Esta función necesita una dependencia y la declara como un parametro
// AngularJS se encarga de instaciar y proveer los parámetros necesarios
// En este caso es $http que es un servicio includo en el paquete básico
var baseurl = "http://api.openweathermap.org/data/2.5/forecast/daily?q=";
var jsonp = "&units=metric&APPID=7d596391de2ab0c37b781868265d681e&callback=JSON_CALLBACK";
var vm = this;
// Podemos tener datos precargados
vm.city_name = "Madrid";
vm.country_code = "ES"
// El array de valores que se enlaza al desplegable generado con ng-options
vm.countries = [
{
name: 'Argentina',
code: 'AR'
},
{
name: 'Brasil',
code: 'BR'
},
{
name: 'España',
code: 'ES'
},
{
name: 'Portugal',
code: 'PT'
}];
// Las funciones pueden, y deben, definirse con su nombre, y publicarlas a través del viewmodel
vm.getForecast = getForecast;
function getForecast() {
var url = baseurl + vm.city_name + ',' + vm.country_code + jsonp
// Uso del servicio de $http para hacer una llamada, en este caso JSONP
// $http devuleve promesas y debemos proveerle de callbacks para cuando se resuelvan
$http
.jsonp(url)
.success(fillForecast);
// funcion callback que se ejcuta cuando responda openweathermap
function fillForecast(forecastData) {
// asignación al viewmodel de los datos recibidos
vm.forecast = forecastData
}
};
}

Просмотреть файл

@ -0,0 +1,63 @@
<html ng-app="climAngular" ng-controller="ClimAngularCtrl as vm">
<head>
<title>ClimAngularJS</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Tutorial para una aplicación sencilla pero completa en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ClimAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso, ng-repeat, filter, $http" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
</head>
<body class="container-fluid">
<header>
<h1>ClimAngularJS: El clima en AngularJS</h1>
</header>
<section>
<div class="form-inline">
<input class="form-control" type="text" ng-model="vm.city_name" />
<!-- Directiva ng-options con una expresión que recorre un lista generando las opciones del desplegable -->
<select class="form-control" ng-model="vm.country_code" ng-options="country.code as country.name for country in vm.countries"></select>
<button class="btn btn-primary" ng-click="vm.getForecast()">Forecast</button>
</div>
<hr>
<div class="form-inline">
<span> Ver sólo días con clima según el filtro : </span>
<input type="text" class="form-control" ng-model="vm.search_weather" />
</div>
<hr>
<ul class="list-unstyled">
<!-- Directiva ng-repeat recorre un array y genera elementos para cada elemento-->
<!-- El operador | actúa como un pipe linux enviando contenido al siguiente comando, en este caso un filtro-->
<li ng-repeat="aDay in vm.forecast.list | filter:vm.search_weather">
<!-- Dentro se tratabaja contra el iterador (day) definido en la expresión superior-->
<!-- Aquí vemos ejemplos de otros filtros como uppercase y date-->
<span>{{ aDay.dt * 1000| date:'EEEE, dd-MMM-yyyy' }} </span>
<!-- Se pueden interpolar datos en cualquier sitio-->
<span name="icon">
<img ng-src="http://openweathermap.org/img/w/{{aDay.weather[0].icon}}.png" />
</span>
<span name="temp">{{aDay.temp.day}} ºC</span>
<span name="description">{{aDay.weather[0].description | uppercase}}</span>
<hr>
</li>
</ul>
</section>
<footer>
<hr>
<p>Código de ejemplo creado por <a href="https://twitter.com/albertobasalo">Alberto Basalo</a> de <a href="http://agorabinaria.com">Ágora Binaria</a>
</p>
<p>Accede a este y otros contenidos formativos en <a href="https://github.com/AcademiaBinaria">GitHub-AcademiaBinaria</a>
</p>
<p>API provided by <a href="http://openweathermap.org/api">Openweathermap</a>
</p>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<!-- En este ejemplo, la lógica está en su propio fichero javascript.-->
<script src="app.js"></script>
</body>
</html>

Просмотреть файл

@ -142,8 +142,8 @@
<hr>
<p>Código de ejemplo creado por <a href="https://twitter.com/albertobasalo">Alberto Basalo</a> de <a href="http://agorabinaria.com">Ágora Binaria</a>
</p>
<p>Accede a más contenidos formativos en <a href="https://github.com/orgs/AcademiaBinaria/dashboard">GitHub-AcademiaBinaria</a>
<p>Accede a más contenidos formativos en <a href="https://github.com/AcademiaBinaria">GitHub-AcademiaBinaria</a>
</p>
</footer>
</body>
</html>
</html>

Просмотреть файл

@ -1,57 +0,0 @@
// Es una buena práctica dedicar un fichero para cada controlador, factoría...
// Usamos el patrón de funciones de invocación inmediata
// Esto permite tener código protegido dentro del cuerpo de una función
// Pero al mismo tiempo garantiza que se ejecutará automáticamente
(function() {
// la función controladora se define con su propio nombre
function cajaCtrl() {
// El viewmodel o vm es la propia función
// Guardamos una referencia a 'this' en una variable que podamos usar dentro de otras funciones
var vm = this;
// Declaración y asignación de valores iniciales
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// Array en el que guardar los movimientos
vm.movimientos = [];
// El scope no son sólo datos, también funciones
vm.guardarMovimiento = function() {
if (vm.nuevoMovimiento.esIngreso) {
vm.total.ingresos += vm.nuevoMovimiento.importe;
} else {
vm.total.gastos += vm.nuevoMovimiento.importe;
}
// creamos una cipia de los valores del actual formulario
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
// Se almacena un copia del nuevo movimiento, y se reutiliza la variable para crear otros
vm.movimientos.push(auxCopyMov);
// El formulario se limpia y la variable se reutiliza
vm.nuevoMovimiento.importe = 0;
}
// las funiones puede llamarse desde la vista o desde el código
vm.balance = function() {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function(movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
// Accedemos al módulo por su nombre a través de la única variable global 'angular'
var modulo = angular.module('controlCajaApp');
// En dicho módulo creamos un controlador, cuyo código es la función previamente definida
modulo.controller('CajaCtrl', cajaCtrl);
}()); // Sintáxis JS para invocación inmediata

Просмотреть файл

@ -4,7 +4,9 @@
<!-- En este ejercicio incrustamos toda la lógica dentro de html -->
<!-- Para ello llevamos al extremo el uso de directivas como ng-init y ng-click -->
<!-- Esta es una práctica muy poco recomendable y que sólo se usa a modo de introducción de las capacidades declarativas de AngularJS -->
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
@ -18,13 +20,15 @@
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<!-- Directiva para inicialización del viewmodel -->
<body ng-init="nuevoMovimiento={esIngreso:1,esGasto:0, importe:0};
total={ingresos:0, gastos:0, balance :0};
maestros={
categoriasIngresos:['Nómina','Ventas','Intereses Depósitos'],
categoriasGastos:['Hipotéca','Compras', 'Impuestos']
};
movimientos=[];">
movimientos=[];
valorBuscado=''; campoOrden='fecha'; sentidoOrden=1;">
<div class="container">
<div class="text-center">
<h1>Controla tu Cash Flow</h1>
@ -53,8 +57,9 @@
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<!-- ng-class permite asignar clases CSS en función de valores del modelo-->
<span class="label " ng-class="{'label-success': total.balance>=0 , 'label-danger' : total.balance<0}">
<!-- ng-class permite asignar clases CSS en función de valores del modelo-->
<span class="label "
ng-class="{'label-success': total.balance>=0 , 'label-danger' : total.balance<0}">
{{total.balance | number:2 }} €
</span>
</h1>
@ -65,7 +70,8 @@
</div>
<hr>
<div class="row-fluid">
<form class="form-horizontal text-left">
<form class="
-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
@ -76,16 +82,12 @@
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<!--Con ng-click ejecutamos acciones en respuesta al usuario-->
<button type="button" class="btn btn-success"
ng-class="{'active':nuevoMovimiento.esIngreso==1}"
ng-click="nuevoMovimiento.esIngreso=1; nuevoMovimiento.esGasto=0">
<span ng-class="{'small':nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
<!--Con ng-click ejecutamos acciones en respuesta al usuario-->
<button type="button" class="btn btn-success" ng-class="{'active':nuevoMovimiento.esIngreso}" ng-click="nuevoMovimiento.esIngreso=1; nuevoMovimiento.esGasto=0">
<span ng-class="{'small':nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger"
ng-class="{'active':nuevoMovimiento.esGasto==1}"
ng-click="nuevoMovimiento.esIngreso=0; nuevoMovimiento.esGasto=1">
<span ng-class="{'small':nuevoMovimiento.esGasto==0}">- Gasto</span>
<button type="button" class="btn btn-danger" ng-class="{'active':nuevoMovimiento.esGasto}" ng-click="nuevoMovimiento.esIngreso=0; nuevoMovimiento.esGasto=1">
<span ng-class="{'small':nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
@ -95,12 +97,8 @@
<div class="controls">
<!-- ng-show y su contrario ng-hide muestran u ocultan en función de un valor-->
<!--Los selectores se llenan de opciones dinámicamente-->
<select ng-show="nuevoMovimiento.esIngreso" name="categoria"
ng-model="nuevoMovimiento.categoria"
ng-options="categoria for categoria in maestros.categoriasIngresos"></select>
<select ng-hide="nuevoMovimiento.esIngreso" name="categoria"
ng-model="nuevoMovimiento.categoria"
ng-options="categoria for categoria in maestros.categoriasGastos"></select>
<select ng-show="nuevoMovimiento.esIngreso" name="categoria" ng-model="nuevoMovimiento.categoria" ng-options="categoria for categoria in maestros.categoriasIngresos"></select>
<select ng-hide="nuevoMovimiento.esIngreso" name="categoria" ng-model="nuevoMovimiento.categoria" ng-options="categoria for categoria in maestros.categoriasGastos"></select>
</div>
</div>
</div>
@ -122,8 +120,8 @@
<div class="text-right">
<!-- La directiva ng-click está pensada para llamar a funciones, pero admite expresiones complejas -->
<!--En este caso, y sólo como ejemplo porque es muy mala práctica, lleva todo el peso de la lógica-->
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary"
ng-click="total.ingresos=total.ingresos + (nuevoMovimiento.esIngreso * nuevoMovimiento.importe);
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="
total.ingresos=total.ingresos + (nuevoMovimiento.esIngreso * nuevoMovimiento.importe);
total.gastos=total.gastos + (nuevoMovimiento.esGasto * nuevoMovimiento.importe);
total.balance=total.ingresos - total.gastos;
movimientos.push({
@ -141,7 +139,7 @@
{{movimientos}}
<hr>
<!-- Uno de los prinipales caso de uso al hacer intefaces es mostrar tablas de datos-->
<!-- Con AngularJS es muy sencillo. Su potente directiva ng-repeat hace todo el trabajo sucio-->
<!-- Con AngularJS es muy sencillo. Su potente directiva ng-repeat hace todo el trabajo sucio-->
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="filtro">Filtrar por:</label>
@ -150,18 +148,18 @@
<thead>
<!-- Cabecera de tabla que sirve para ordenar par varios campos y rotar el sentido de ordenación-->
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = (campo == 'fecha' && !sentido)">Fecha</a>
<th><a href="" ng-click="campoOrden = 'fecha'; sentidoOrden = !sentidoOrden">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = (campo == 'importe' && !sentido)">Importe</a>
<th><a href="" ng-click="campoOrden = 'importe'; sentidoOrden = !sentidoOrden">Importe</a>
</th>
</tr>
</thead>
<tbody>
<!-- ng-repeat permite filtrar y ordenar los registros-->
<tr ng-repeat="movimiento in movimientos | filter:valorBuscado | orderBy:campo:sentido">
<!--dentro del ambiente crado por la directiva, accedemos directamente al iterador recién definido-->
<tr ng-repeat="movimiento in movimientos | filter:valorBuscado | orderBy:campoOrden:sentidoOrden">
<!--dentro del ambiente creado por la directiva, accedemos directamente al iterador recién definido-->
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
@ -180,7 +178,7 @@
</footer>
<!-- JavaScript References -->
<!-- Las referencias a AngularJS puede descargarse a local, pero también están disponibles en CDNs muuy populares -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
</body>
</html>

Просмотреть файл

@ -1,43 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>World Tour</title>
<meta charset="UTF-8">
<meta name="description" content="Ejercicio curso AngularJS" />
<meta name="keywords" content="" />
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body ng-app="aBay" ng-controller="pujasCtrl">
<header>
<h1>Angular Bay</h1>
</header>
<hr>
<section name="region_selector">
<div class="form">
<label for="user_name">Email</label>
<input type="email" class="form-control" ng-model="email" >
<label for="puja">Puja</label>
<input type="number" class="form-control" ng-model="puja" >
<button ng-click="guardar()">Pujar</button>
</div>
</section>
<hr>
<section name="pujas" class="container">
<div class="row">
<span>Email</span>
<span>Puja</span>
</div>
<div class="row" ng-repeat="puja in data.pujas">
<span>{{email}}</span>
<span>{{puja}}</span>
</div>
</section>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.17/angular.min.js"></script>
<script src='https://cdn.firebase.com/v0/firebase.js'></script>
<script src='https://cdn.firebase.com/libs/angularfire/0.7.1/angularfire.min.js'></script>
<script src="app.js"></script>
</body>
</html>

Просмотреть файл

@ -1,14 +0,0 @@
var aBayApp = angular.module('aBay', ['firebase']);
aBayApp.controller('pujasCtrl', function ($scope, $firebase) {
var dataRef = new Firebase("https://angularBay.firebaseio.com/data");
$scope.data  =  $firebase(dataRef);
$scope.data.pujas = [];
$scope.guardar = function()
{
console.log("hola");
$scope.data.pujas.push({email:$scope.email, puja:$scope.puja});
$scope.data.$save();
}
});

Просмотреть файл

@ -1,38 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>World Tour</title>
<meta charset="UTF-8">
<meta name="description" content="Ejercicio curso AngularJS" />
<meta name="keywords" content="" />
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<header>
<h1>Angular Bay</h1>
</header>
<hr>
<section name="region_selector">
<div class="form">
<label for="user_name">Email</label>
<input type="email" class="form-control" name="usuario" >
<label for="puja">Puja</label>
<input type="number" class="form-control" name="puja" >
</div>
</section>
<hr>
<section name="pujas" class="container">
<div class="row">
<span>Email</span>
<span>Puja</span>
</div>
<div class="row" >
<span>alberto@angular.js</span>
<span>1320</span>
</div>
</section>
</body>
</html>

@ -1 +0,0 @@
Subproject commit 22deedd43296ca223daf1c9048e6498d52f8b1af

@ -1 +0,0 @@
Subproject commit 20bf20c712d1aca02bb36abd941b6f618fbb5b2a

Просмотреть файл

@ -0,0 +1,2 @@
// Declaración de un nuevo módulo sin dependencias, llamado 'cashFlow'
angular.module('cashFlow', []);

Просмотреть файл

@ -0,0 +1,63 @@
// Es una buena práctica dedicar un fichero para cada controlador, factoría...
// Usamos el patrón de funciones de invocación inmediata
// Esto permite tener código protegido dentro del cuerpo de una función
// Pero al mismo tiempo garantiza que se ejecutará automáticamente
(function () {
// la función controladora se define con su propio nombre
function cajaCtrl() {
// El viewmodel es la propia función
// Guardamos una referencia a 'this' en una variable que podamos usar dentro de otras funciones
var vm = this;
// Declaración y asignación de valores iniciales
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// Array en el que guardar los movimientos
vm.movimientos = [];
// El scope no son sólo datos, también funciones
vm.guardarMovimiento = function () {
if (vm.nuevoMovimiento.esIngreso) {
vm.total.ingresos += vm.nuevoMovimiento.importe;
} else {
vm.total.gastos += vm.nuevoMovimiento.importe;
}
// creamos una copia de los valores del actual formulario
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
// USamos funciones de transformación
auxCopyMov.tipo = vm.tipo(auxCopyMov);
// Se almacena la copia del nuevo movimiento, y se reutiliza la variable para crear otros
vm.movimientos.push(auxCopyMov);
// El formulario se limpia y la variable se reutiliza
vm.nuevoMovimiento.importe = 0;
}
// las funiones puede llamarse desde la vista o desde el código
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
// Accedemos al módulo por su nombre a través de la única variable global 'angular'
// En dicho módulo creamos un controlador, cuyo código es la función previamente definida
angular.module('cashFlow').controller('CajaCtrl', cajaCtrl);
}
()); // Sintáxis JS para invocación inmediata

Просмотреть файл

@ -0,0 +1,153 @@
<html lang="es" ng-app="cashFlow">
<!-- En este ejercicio extraemos la lógica del html llevándola a JS -->
<!-- Esta es una práctica muy poco recomendable y que sólo se usa a modo de introducción de las capacidades declarativas de AngularJS -->
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Simple Interés en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<!--La directiva ng-controller la usaremos siempre con la sintaxis 'as'-->
<body ng-controller="CajaCtrl as caja">
<div class="container text-center">
<section name="total">
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
<!-- Ejemplo de uso de funciones dentro de expresiones-->
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>
<hr>
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-hide="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
</section>
<hr>
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>
</div>
<footer>
<hr>
<p>Código de ejemplo creado por <a href="https://twitter.com/albertobasalo">Alberto Basalo</a> de <a href="http://agorabinaria.com">Ágora Binaria</a>
</p>
<p>Accede a más contenidos formativos en <a href="https://github.com/AcademiaBinaria">GitHub-AcademiaBinaria</a>
</p>
</footer>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<!-- Referencias a nuestro propio código, un fichero para el módulo principal de la aplicación, y otro para su controlador-->
<script src="app.js"></script>
<script src="cajaCtrl.js"></script>
</body>
</html>

289
03b-require/angular.min.js поставляемый Normal file
Просмотреть файл

@ -0,0 +1,289 @@
/*
AngularJS v1.4.0
(c) 2010-2015 Google, Inc. http://angularjs.org
License: MIT
*/
(function(N,W,u){'use strict';function F(b){return function(){var a=arguments[0],c;c="["+(b?b+":":"")+a+"] http://errors.angularjs.org/1.4.0/"+(b?b+"/":"")+a;for(a=1;a<arguments.length;a++){c=c+(1==a?"?":"&")+"p"+(a-1)+"=";var d=encodeURIComponent,e;e=arguments[a];e="function"==typeof e?e.toString().replace(/ \{[\s\S]*$/,""):"undefined"==typeof e?"undefined":"string"!=typeof e?JSON.stringify(e):e;c+=d(e)}return Error(c)}}function Da(b){if(null==b||Ta(b))return!1;var a="length"in Object(b)&&b.length;
return b.nodeType===pa&&a?!0:L(b)||K(b)||0===a||"number"===typeof a&&0<a&&a-1 in b}function n(b,a,c){var d,e;if(b)if(G(b))for(d in b)"prototype"==d||"length"==d||"name"==d||b.hasOwnProperty&&!b.hasOwnProperty(d)||a.call(c,b[d],d,b);else if(K(b)||Da(b)){var f="object"!==typeof b;d=0;for(e=b.length;d<e;d++)(f||d in b)&&a.call(c,b[d],d,b)}else if(b.forEach&&b.forEach!==n)b.forEach(a,c,b);else if(nc(b))for(d in b)a.call(c,b[d],d,b);else if("function"===typeof b.hasOwnProperty)for(d in b)b.hasOwnProperty(d)&&
a.call(c,b[d],d,b);else for(d in b)kb.call(b,d)&&a.call(c,b[d],d,b);return b}function oc(b,a,c){for(var d=Object.keys(b).sort(),e=0;e<d.length;e++)a.call(c,b[d[e]],d[e]);return d}function pc(b){return function(a,c){b(c,a)}}function Td(){return++lb}function qc(b,a){a?b.$$hashKey=a:delete b.$$hashKey}function Nb(b,a,c){for(var d=b.$$hashKey,e=0,f=a.length;e<f;++e){var g=a[e];if(C(g)||G(g))for(var h=Object.keys(g),l=0,k=h.length;l<k;l++){var m=h[l],r=g[m];c&&C(r)?(C(b[m])||(b[m]=K(r)?[]:{}),Nb(b[m],
[r],!0)):b[m]=r}}qc(b,d);return b}function Q(b){return Nb(b,ra.call(arguments,1),!1)}function Ud(b){return Nb(b,ra.call(arguments,1),!0)}function Y(b){return parseInt(b,10)}function Ob(b,a){return Q(Object.create(b),a)}function w(){}function Ua(b){return b}function qa(b){return function(){return b}}function v(b){return"undefined"===typeof b}function y(b){return"undefined"!==typeof b}function C(b){return null!==b&&"object"===typeof b}function nc(b){return null!==b&&"object"===typeof b&&!rc(b)}function L(b){return"string"===
typeof b}function V(b){return"number"===typeof b}function da(b){return"[object Date]"===sa.call(b)}function G(b){return"function"===typeof b}function Va(b){return"[object RegExp]"===sa.call(b)}function Ta(b){return b&&b.window===b}function Wa(b){return b&&b.$evalAsync&&b.$watch}function Xa(b){return"boolean"===typeof b}function sc(b){return!(!b||!(b.nodeName||b.prop&&b.attr&&b.find))}function Vd(b){var a={};b=b.split(",");var c;for(c=0;c<b.length;c++)a[b[c]]=!0;return a}function ta(b){return E(b.nodeName||
b[0]&&b[0].nodeName)}function Ya(b,a){var c=b.indexOf(a);0<=c&&b.splice(c,1);return c}function ua(b,a,c,d){function e(a,b,c,d,e){var f=ua(b,null,d,e);C(b)&&(d.push(b),e.push(f));c[a]=f}if(Ta(b)||Wa(b))throw Ea("cpws");if(tc.test(sa.call(a)))throw Ea("cpta");if(a){if(b===a)throw Ea("cpi");c=c||[];d=d||[];if(C(b)){var f=c.indexOf(b);if(-1!==f)return d[f];c.push(b);d.push(a)}var g;if(K(b))for(f=a.length=0;f<b.length;f++)g=ua(b[f],null,c,d),C(b[f])&&(c.push(b[f]),d.push(g)),a.push(g);else{f=a.$$hashKey;
K(a)?a.length=0:n(a,function(b,c){delete a[c]});if(nc(b))for(g in b)e(g,b[g],a,c,d);else if(b&&"function"===typeof b.hasOwnProperty)for(g in b)b.hasOwnProperty(g)&&e(g,b[g],a,c,d);else for(g in b)kb.call(b,g)&&e(g,b[g],a,c,d);qc(a,f)}}else if(a=b)K(b)?a=ua(b,[],c,d):tc.test(sa.call(b))?a=new b.constructor(b):da(b)?a=new Date(b.getTime()):Va(b)?(a=new RegExp(b.source,b.toString().match(/[^\/]*$/)[0]),a.lastIndex=b.lastIndex):C(b)&&(g=Object.create(rc(b)),a=ua(b,g,c,d));return a}function fa(b,a){if(K(b)){a=
a||[];for(var c=0,d=b.length;c<d;c++)a[c]=b[c]}else if(C(b))for(c in a=a||{},b)if("$"!==c.charAt(0)||"$"!==c.charAt(1))a[c]=b[c];return a||b}function ka(b,a){if(b===a)return!0;if(null===b||null===a)return!1;if(b!==b&&a!==a)return!0;var c=typeof b,d;if(c==typeof a&&"object"==c)if(K(b)){if(!K(a))return!1;if((c=b.length)==a.length){for(d=0;d<c;d++)if(!ka(b[d],a[d]))return!1;return!0}}else{if(da(b))return da(a)?ka(b.getTime(),a.getTime()):!1;if(Va(b))return Va(a)?b.toString()==a.toString():!1;if(Wa(b)||
Wa(a)||Ta(b)||Ta(a)||K(a)||da(a)||Va(a))return!1;c=ga();for(d in b)if("$"!==d.charAt(0)&&!G(b[d])){if(!ka(b[d],a[d]))return!1;c[d]=!0}for(d in a)if(!(d in c||"$"===d.charAt(0)||a[d]===u||G(a[d])))return!1;return!0}return!1}function Za(b,a,c){return b.concat(ra.call(a,c))}function uc(b,a){var c=2<arguments.length?ra.call(arguments,2):[];return!G(a)||a instanceof RegExp?a:c.length?function(){return arguments.length?a.apply(b,Za(c,arguments,0)):a.apply(b,c)}:function(){return arguments.length?a.apply(b,
arguments):a.call(b)}}function Wd(b,a){var c=a;"string"===typeof b&&"$"===b.charAt(0)&&"$"===b.charAt(1)?c=u:Ta(a)?c="$WINDOW":a&&W===a?c="$DOCUMENT":Wa(a)&&(c="$SCOPE");return c}function $a(b,a){if("undefined"===typeof b)return u;V(a)||(a=a?2:null);return JSON.stringify(b,Wd,a)}function vc(b){return L(b)?JSON.parse(b):b}function wc(b,a){var c=Date.parse("Jan 01, 1970 00:00:00 "+b)/6E4;return isNaN(c)?a:c}function Pb(b,a,c){c=c?-1:1;var d=wc(a,b.getTimezoneOffset());a=b;b=c*(d-b.getTimezoneOffset());
a=new Date(a.getTime());a.setMinutes(a.getMinutes()+b);return a}function va(b){b=z(b).clone();try{b.empty()}catch(a){}var c=z("<div>").append(b).html();try{return b[0].nodeType===ab?E(c):c.match(/^(<[^>]+>)/)[1].replace(/^<([\w\-]+)/,function(a,b){return"<"+E(b)})}catch(d){return E(c)}}function xc(b){try{return decodeURIComponent(b)}catch(a){}}function yc(b){var a={},c,d;n((b||"").split("&"),function(b){b&&(c=b.replace(/\+/g,"%20").split("="),d=xc(c[0]),y(d)&&(b=y(c[1])?xc(c[1]):!0,kb.call(a,d)?K(a[d])?
a[d].push(b):a[d]=[a[d],b]:a[d]=b))});return a}function Qb(b){var a=[];n(b,function(b,d){K(b)?n(b,function(b){a.push(ia(d,!0)+(!0===b?"":"="+ia(b,!0)))}):a.push(ia(d,!0)+(!0===b?"":"="+ia(b,!0)))});return a.length?a.join("&"):""}function mb(b){return ia(b,!0).replace(/%26/gi,"&").replace(/%3D/gi,"=").replace(/%2B/gi,"+")}function ia(b,a){return encodeURIComponent(b).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%3B/gi,";").replace(/%20/g,a?"%20":"+")}
function Xd(b,a){var c,d,e=Na.length;for(d=0;d<e;++d)if(c=Na[d]+a,L(c=b.getAttribute(c)))return c;return null}function Yd(b,a){var c,d,e={};n(Na,function(a){a+="app";!c&&b.hasAttribute&&b.hasAttribute(a)&&(c=b,d=b.getAttribute(a))});n(Na,function(a){a+="app";var e;!c&&(e=b.querySelector("["+a.replace(":","\\:")+"]"))&&(c=e,d=e.getAttribute(a))});c&&(e.strictDi=null!==Xd(c,"strict-di"),a(c,d?[d]:[],e))}function zc(b,a,c){C(c)||(c={});c=Q({strictDi:!1},c);var d=function(){b=z(b);if(b.injector()){var d=
b[0]===W?"document":va(b);throw Ea("btstrpd",d.replace(/</,"&lt;").replace(/>/,"&gt;"));}a=a||[];a.unshift(["$provide",function(a){a.value("$rootElement",b)}]);c.debugInfoEnabled&&a.push(["$compileProvider",function(a){a.debugInfoEnabled(!0)}]);a.unshift("ng");d=bb(a,c.strictDi);d.invoke(["$rootScope","$rootElement","$compile","$injector",function(a,b,c,d){a.$apply(function(){b.data("$injector",d);c(b)(a)})}]);return d},e=/^NG_ENABLE_DEBUG_INFO!/,f=/^NG_DEFER_BOOTSTRAP!/;N&&e.test(N.name)&&(c.debugInfoEnabled=
!0,N.name=N.name.replace(e,""));if(N&&!f.test(N.name))return d();N.name=N.name.replace(f,"");aa.resumeBootstrap=function(b){n(b,function(b){a.push(b)});return d()};G(aa.resumeDeferredBootstrap)&&aa.resumeDeferredBootstrap()}function Zd(){N.name="NG_ENABLE_DEBUG_INFO!"+N.name;N.location.reload()}function $d(b){b=aa.element(b).injector();if(!b)throw Ea("test");return b.get("$$testability")}function Ac(b,a){a=a||"_";return b.replace(ae,function(b,d){return(d?a:"")+b.toLowerCase()})}function be(){var b;
if(!Bc){var a=nb();la=N.jQuery;y(a)&&(la=null===a?u:N[a]);la&&la.fn.on?(z=la,Q(la.fn,{scope:Oa.scope,isolateScope:Oa.isolateScope,controller:Oa.controller,injector:Oa.injector,inheritedData:Oa.inheritedData}),b=la.cleanData,la.cleanData=function(a){var d;if(Rb)Rb=!1;else for(var e=0,f;null!=(f=a[e]);e++)(d=la._data(f,"events"))&&d.$destroy&&la(f).triggerHandler("$destroy");b(a)}):z=R;aa.element=z;Bc=!0}}function Sb(b,a,c){if(!b)throw Ea("areq",a||"?",c||"required");return b}function Pa(b,a,c){c&&
K(b)&&(b=b[b.length-1]);Sb(G(b),a,"not a function, got "+(b&&"object"===typeof b?b.constructor.name||"Object":typeof b));return b}function Qa(b,a){if("hasOwnProperty"===b)throw Ea("badname",a);}function Cc(b,a,c){if(!a)return b;a=a.split(".");for(var d,e=b,f=a.length,g=0;g<f;g++)d=a[g],b&&(b=(e=b)[d]);return!c&&G(b)?uc(e,b):b}function ob(b){var a=b[0];b=b[b.length-1];var c=[a];do{a=a.nextSibling;if(!a)break;c.push(a)}while(a!==b);return z(c)}function ga(){return Object.create(null)}function ce(b){function a(a,
b,c){return a[b]||(a[b]=c())}var c=F("$injector"),d=F("ng");b=a(b,"angular",Object);b.$$minErr=b.$$minErr||F;return a(b,"module",function(){var b={};return function(f,g,h){if("hasOwnProperty"===f)throw d("badname","module");g&&b.hasOwnProperty(f)&&(b[f]=null);return a(b,f,function(){function a(c,d,e,f){f||(f=b);return function(){f[e||"push"]([c,d,arguments]);return A}}if(!g)throw c("nomod",f);var b=[],d=[],e=[],s=a("$injector","invoke","push",d),A={_invokeQueue:b,_configBlocks:d,_runBlocks:e,requires:g,
name:f,provider:a("$provide","provider"),factory:a("$provide","factory"),service:a("$provide","service"),value:a("$provide","value"),constant:a("$provide","constant","unshift"),decorator:a("$provide","decorator"),animation:a("$animateProvider","register"),filter:a("$filterProvider","register"),controller:a("$controllerProvider","register"),directive:a("$compileProvider","directive"),config:s,run:function(a){e.push(a);return this}};h&&s(h);return A})}})}function de(b){Q(b,{bootstrap:zc,copy:ua,extend:Q,
merge:Ud,equals:ka,element:z,forEach:n,injector:bb,noop:w,bind:uc,toJson:$a,fromJson:vc,identity:Ua,isUndefined:v,isDefined:y,isString:L,isFunction:G,isObject:C,isNumber:V,isElement:sc,isArray:K,version:ee,isDate:da,lowercase:E,uppercase:pb,callbacks:{counter:0},getTestability:$d,$$minErr:F,$$csp:cb,reloadWithDebugInfo:Zd});db=ce(N);try{db("ngLocale")}catch(a){db("ngLocale",[]).provider("$locale",fe)}db("ng",["ngLocale"],["$provide",function(a){a.provider({$$sanitizeUri:ge});a.provider("$compile",
Dc).directive({a:he,input:Ec,textarea:Ec,form:ie,script:je,select:ke,style:le,option:me,ngBind:ne,ngBindHtml:oe,ngBindTemplate:pe,ngClass:qe,ngClassEven:re,ngClassOdd:se,ngCloak:te,ngController:ue,ngForm:ve,ngHide:we,ngIf:xe,ngInclude:ye,ngInit:ze,ngNonBindable:Ae,ngPluralize:Be,ngRepeat:Ce,ngShow:De,ngStyle:Ee,ngSwitch:Fe,ngSwitchWhen:Ge,ngSwitchDefault:He,ngOptions:Ie,ngTransclude:Je,ngModel:Ke,ngList:Le,ngChange:Me,pattern:Fc,ngPattern:Fc,required:Gc,ngRequired:Gc,minlength:Hc,ngMinlength:Hc,maxlength:Ic,
ngMaxlength:Ic,ngValue:Ne,ngModelOptions:Oe}).directive({ngInclude:Pe}).directive(qb).directive(Jc);a.provider({$anchorScroll:Qe,$animate:Re,$$animateQueue:Se,$$AnimateRunner:Te,$browser:Ue,$cacheFactory:Ve,$controller:We,$document:Xe,$exceptionHandler:Ye,$filter:Kc,$interpolate:Ze,$interval:$e,$http:af,$httpParamSerializer:bf,$httpParamSerializerJQLike:cf,$httpBackend:df,$location:ef,$log:ff,$parse:gf,$rootScope:hf,$q:jf,$$q:kf,$sce:lf,$sceDelegate:mf,$sniffer:nf,$templateCache:of,$templateRequest:pf,
$$testability:qf,$timeout:rf,$window:sf,$$rAF:tf,$$asyncCallback:uf,$$jqLite:vf,$$HashMap:wf,$$cookieReader:xf})}])}function eb(b){return b.replace(yf,function(a,b,d,e){return e?d.toUpperCase():d}).replace(zf,"Moz$1")}function Lc(b){b=b.nodeType;return b===pa||!b||9===b}function Mc(b,a){var c,d,e=a.createDocumentFragment(),f=[];if(Tb.test(b)){c=c||e.appendChild(a.createElement("div"));d=(Af.exec(b)||["",""])[1].toLowerCase();d=ma[d]||ma._default;c.innerHTML=d[1]+b.replace(Bf,"<$1></$2>")+d[2];for(d=
d[0];d--;)c=c.lastChild;f=Za(f,c.childNodes);c=e.firstChild;c.textContent=""}else f.push(a.createTextNode(b));e.textContent="";e.innerHTML="";n(f,function(a){e.appendChild(a)});return e}function R(b){if(b instanceof R)return b;var a;L(b)&&(b=T(b),a=!0);if(!(this instanceof R)){if(a&&"<"!=b.charAt(0))throw Ub("nosel");return new R(b)}if(a){a=W;var c;b=(c=Cf.exec(b))?[a.createElement(c[1])]:(c=Mc(b,a))?c.childNodes:[]}Nc(this,b)}function Vb(b){return b.cloneNode(!0)}function rb(b,a){a||sb(b);if(b.querySelectorAll)for(var c=
b.querySelectorAll("*"),d=0,e=c.length;d<e;d++)sb(c[d])}function Oc(b,a,c,d){if(y(d))throw Ub("offargs");var e=(d=tb(b))&&d.events,f=d&&d.handle;if(f)if(a)n(a.split(" "),function(a){if(y(c)){var d=e[a];Ya(d||[],c);if(d&&0<d.length)return}b.removeEventListener(a,f,!1);delete e[a]});else for(a in e)"$destroy"!==a&&b.removeEventListener(a,f,!1),delete e[a]}function sb(b,a){var c=b.ng339,d=c&&ub[c];d&&(a?delete d.data[a]:(d.handle&&(d.events.$destroy&&d.handle({},"$destroy"),Oc(b)),delete ub[c],b.ng339=
u))}function tb(b,a){var c=b.ng339,c=c&&ub[c];a&&!c&&(b.ng339=c=++Df,c=ub[c]={events:{},data:{},handle:u});return c}function Wb(b,a,c){if(Lc(b)){var d=y(c),e=!d&&a&&!C(a),f=!a;b=(b=tb(b,!e))&&b.data;if(d)b[a]=c;else{if(f)return b;if(e)return b&&b[a];Q(b,a)}}}function vb(b,a){return b.getAttribute?-1<(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ").indexOf(" "+a+" "):!1}function wb(b,a){a&&b.setAttribute&&n(a.split(" "),function(a){b.setAttribute("class",T((" "+(b.getAttribute("class")||
"")+" ").replace(/[\n\t]/g," ").replace(" "+T(a)+" "," ")))})}function xb(b,a){if(a&&b.setAttribute){var c=(" "+(b.getAttribute("class")||"")+" ").replace(/[\n\t]/g," ");n(a.split(" "),function(a){a=T(a);-1===c.indexOf(" "+a+" ")&&(c+=a+" ")});b.setAttribute("class",T(c))}}function Nc(b,a){if(a)if(a.nodeType)b[b.length++]=a;else{var c=a.length;if("number"===typeof c&&a.window!==a){if(c)for(var d=0;d<c;d++)b[b.length++]=a[d]}else b[b.length++]=a}}function Pc(b,a){return yb(b,"$"+(a||"ngController")+
"Controller")}function yb(b,a,c){9==b.nodeType&&(b=b.documentElement);for(a=K(a)?a:[a];b;){for(var d=0,e=a.length;d<e;d++)if((c=z.data(b,a[d]))!==u)return c;b=b.parentNode||11===b.nodeType&&b.host}}function Qc(b){for(rb(b,!0);b.firstChild;)b.removeChild(b.firstChild)}function Xb(b,a){a||rb(b);var c=b.parentNode;c&&c.removeChild(b)}function Ef(b,a){a=a||N;if("complete"===a.document.readyState)a.setTimeout(b);else z(a).on("load",b)}function Rc(b,a){var c=zb[a.toLowerCase()];return c&&Sc[ta(b)]&&c}function Ff(b,
a){var c=b.nodeName;return("INPUT"===c||"TEXTAREA"===c)&&Tc[a]}function Gf(b,a){var c=function(c,e){c.isDefaultPrevented=function(){return c.defaultPrevented};var f=a[e||c.type],g=f?f.length:0;if(g){if(v(c.immediatePropagationStopped)){var h=c.stopImmediatePropagation;c.stopImmediatePropagation=function(){c.immediatePropagationStopped=!0;c.stopPropagation&&c.stopPropagation();h&&h.call(c)}}c.isImmediatePropagationStopped=function(){return!0===c.immediatePropagationStopped};1<g&&(f=fa(f));for(var l=
0;l<g;l++)c.isImmediatePropagationStopped()||f[l].call(b,c)}};c.elem=b;return c}function vf(){this.$get=function(){return Q(R,{hasClass:function(b,a){b.attr&&(b=b[0]);return vb(b,a)},addClass:function(b,a){b.attr&&(b=b[0]);return xb(b,a)},removeClass:function(b,a){b.attr&&(b=b[0]);return wb(b,a)}})}}function Fa(b,a){var c=b&&b.$$hashKey;if(c)return"function"===typeof c&&(c=b.$$hashKey()),c;c=typeof b;return c="function"==c||"object"==c&&null!==b?b.$$hashKey=c+":"+(a||Td)():c+":"+b}function Ra(b,a){if(a){var c=
0;this.nextUid=function(){return++c}}n(b,this.put,this)}function Hf(b){return(b=b.toString().replace(Uc,"").match(Vc))?"function("+(b[1]||"").replace(/[\s\r\n]+/," ")+")":"fn"}function bb(b,a){function c(a){return function(b,c){if(C(b))n(b,pc(a));else return a(b,c)}}function d(a,b){Qa(a,"service");if(G(b)||K(b))b=s.instantiate(b);if(!b.$get)throw Ga("pget",a);return r[a+"Provider"]=b}function e(a,b){return function(){var c=H.invoke(b,this);if(v(c))throw Ga("undef",a);return c}}function f(a,b,c){return d(a,
{$get:!1!==c?e(a,b):b})}function g(a){var b=[],c;n(a,function(a){function d(a){var b,c;b=0;for(c=a.length;b<c;b++){var e=a[b],f=s.get(e[0]);f[e[1]].apply(f,e[2])}}if(!m.get(a)){m.put(a,!0);try{L(a)?(c=db(a),b=b.concat(g(c.requires)).concat(c._runBlocks),d(c._invokeQueue),d(c._configBlocks)):G(a)?b.push(s.invoke(a)):K(a)?b.push(s.invoke(a)):Pa(a,"module")}catch(e){throw K(a)&&(a=a[a.length-1]),e.message&&e.stack&&-1==e.stack.indexOf(e.message)&&(e=e.message+"\n"+e.stack),Ga("modulerr",a,e.stack||e.message||
e);}}});return b}function h(b,c){function d(a,e){if(b.hasOwnProperty(a)){if(b[a]===l)throw Ga("cdep",a+" <- "+k.join(" <- "));return b[a]}try{return k.unshift(a),b[a]=l,b[a]=c(a,e)}catch(f){throw b[a]===l&&delete b[a],f;}finally{k.shift()}}function e(b,c,f,g){"string"===typeof f&&(g=f,f=null);var h=[],k=bb.$$annotate(b,a,g),l,s,m;s=0;for(l=k.length;s<l;s++){m=k[s];if("string"!==typeof m)throw Ga("itkn",m);h.push(f&&f.hasOwnProperty(m)?f[m]:d(m,g))}K(b)&&(b=b[l]);return b.apply(c,h)}return{invoke:e,
instantiate:function(a,b,c){var d=Object.create((K(a)?a[a.length-1]:a).prototype||null);a=e(a,d,b,c);return C(a)||G(a)?a:d},get:d,annotate:bb.$$annotate,has:function(a){return r.hasOwnProperty(a+"Provider")||b.hasOwnProperty(a)}}}a=!0===a;var l={},k=[],m=new Ra([],!0),r={$provide:{provider:c(d),factory:c(f),service:c(function(a,b){return f(a,["$injector",function(a){return a.instantiate(b)}])}),value:c(function(a,b){return f(a,qa(b),!1)}),constant:c(function(a,b){Qa(a,"constant");r[a]=b;A[a]=b}),
decorator:function(a,b){var c=s.get(a+"Provider"),d=c.$get;c.$get=function(){var a=H.invoke(d,c);return H.invoke(b,null,{$delegate:a})}}}},s=r.$injector=h(r,function(a,b){aa.isString(b)&&k.push(b);throw Ga("unpr",k.join(" <- "));}),A={},H=A.$injector=h(A,function(a,b){var c=s.get(a+"Provider",b);return H.invoke(c.$get,c,u,a)});n(g(b),function(a){H.invoke(a||w)});return H}function Qe(){var b=!0;this.disableAutoScrolling=function(){b=!1};this.$get=["$window","$location","$rootScope",function(a,c,d){function e(a){var b=
null;Array.prototype.some.call(a,function(a){if("a"===ta(a))return b=a,!0});return b}function f(b){if(b){b.scrollIntoView();var c;c=g.yOffset;G(c)?c=c():sc(c)?(c=c[0],c="fixed"!==a.getComputedStyle(c).position?0:c.getBoundingClientRect().bottom):V(c)||(c=0);c&&(b=b.getBoundingClientRect().top,a.scrollBy(0,b-c))}else a.scrollTo(0,0)}function g(a){a=L(a)?a:c.hash();var b;a?(b=h.getElementById(a))?f(b):(b=e(h.getElementsByName(a)))?f(b):"top"===a&&f(null):f(null)}var h=a.document;b&&d.$watch(function(){return c.hash()},
function(a,b){a===b&&""===a||Ef(function(){d.$evalAsync(g)})});return g}]}function fb(b,a){if(!b&&!a)return"";if(!b)return a;if(!a)return b;K(b)&&(b=b.join(" "));K(a)&&(a=a.join(" "));return b+" "+a}function If(b){L(b)&&(b=b.split(" "));var a=ga();n(b,function(b){b.length&&(a[b]=!0)});return a}function Ha(b){return C(b)?b:{}}function uf(){this.$get=["$$rAF","$timeout",function(b,a){return b.supported?function(a){return b(a)}:function(b){return a(b,0,!1)}}]}function Jf(b,a,c,d){function e(a){try{a.apply(null,
ra.call(arguments,1))}finally{if(H--,0===H)for(;M.length;)try{M.pop()()}catch(b){c.error(b)}}}function f(){g();h()}function g(){a:{try{t=m.state;break a}catch(a){}t=void 0}t=v(t)?null:t;ka(t,D)&&(t=D);D=t}function h(){if(x!==l.url()||p!==t)x=l.url(),p=t,n(B,function(a){a(l.url(),t)})}var l=this,k=b.location,m=b.history,r=b.setTimeout,s=b.clearTimeout,A={};l.isMock=!1;var H=0,M=[];l.$$completeOutstandingRequest=e;l.$$incOutstandingRequestCount=function(){H++};l.notifyWhenNoOutstandingRequests=function(a){0===
H?a():M.push(a)};var t,p,x=k.href,q=a.find("base"),I=null;g();p=t;l.url=function(a,c,e){v(e)&&(e=null);k!==b.location&&(k=b.location);m!==b.history&&(m=b.history);if(a){var f=p===e;if(x===a&&(!d.history||f))return l;var h=x&&Ia(x)===Ia(a);x=a;p=e;!d.history||h&&f?(h||(I=a),c?k.replace(a):h?(c=k,e=a.indexOf("#"),a=-1===e?"":a.substr(e+1),c.hash=a):k.href=a):(m[c?"replaceState":"pushState"](e,"",a),g(),p=t);return l}return I||k.href.replace(/%27/g,"'")};l.state=function(){return t};var B=[],O=!1,D=
null;l.onUrlChange=function(a){if(!O){if(d.history)z(b).on("popstate",f);z(b).on("hashchange",f);O=!0}B.push(a);return a};l.$$applicationDestroyed=function(){z(b).off("hashchange popstate",f)};l.$$checkUrlChange=h;l.baseHref=function(){var a=q.attr("href");return a?a.replace(/^(https?\:)?\/\/[^\/]*/,""):""};l.defer=function(a,b){var c;H++;c=r(function(){delete A[c];e(a)},b||0);A[c]=!0;return c};l.defer.cancel=function(a){return A[a]?(delete A[a],s(a),e(w),!0):!1}}function Ue(){this.$get=["$window",
"$log","$sniffer","$document",function(b,a,c,d){return new Jf(b,d,a,c)}]}function Ve(){this.$get=function(){function b(b,d){function e(a){a!=r&&(s?s==a&&(s=a.n):s=a,f(a.n,a.p),f(a,r),r=a,r.n=null)}function f(a,b){a!=b&&(a&&(a.p=b),b&&(b.n=a))}if(b in a)throw F("$cacheFactory")("iid",b);var g=0,h=Q({},d,{id:b}),l={},k=d&&d.capacity||Number.MAX_VALUE,m={},r=null,s=null;return a[b]={put:function(a,b){if(!v(b)){if(k<Number.MAX_VALUE){var c=m[a]||(m[a]={key:a});e(c)}a in l||g++;l[a]=b;g>k&&this.remove(s.key);
return b}},get:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;e(b)}return l[a]},remove:function(a){if(k<Number.MAX_VALUE){var b=m[a];if(!b)return;b==r&&(r=b.p);b==s&&(s=b.n);f(b.n,b.p);delete m[a]}delete l[a];g--},removeAll:function(){l={};g=0;m={};r=s=null},destroy:function(){m=h=l=null;delete a[b]},info:function(){return Q({},h,{size:g})}}}var a={};b.info=function(){var b={};n(a,function(a,e){b[e]=a.info()});return b};b.get=function(b){return a[b]};return b}}function of(){this.$get=
["$cacheFactory",function(b){return b("templates")}]}function Dc(b,a){function c(a,b,c){var d=/^\s*([@&]|=(\*?))(\??)\s*(\w*)\s*$/,e={};n(a,function(a,f){var g=a.match(d);if(!g)throw ea("iscp",b,f,a,c?"controller bindings definition":"isolate scope definition");e[f]={mode:g[1][0],collection:"*"===g[2],optional:"?"===g[3],attrName:g[4]||f}});return e}function d(a){var b=a.charAt(0);if(!b||b!==E(b))throw ea("baddir",a);if(a!==a.trim())throw ea("baddir",a);}var e={},f=/^\s*directive\:\s*([\w\-]+)\s+(.*)$/,
g=/(([\w\-]+)(?:\:([^;]+))?;?)/,h=Vd("ngSrc,ngSrcset,src,srcset"),l=/^(?:(\^\^?)?(\?)?(\^\^?)?)?/,k=/^(on[a-z]+|formaction)$/;this.directive=function s(a,f){Qa(a,"directive");L(a)?(d(a),Sb(f,"directiveFactory"),e.hasOwnProperty(a)||(e[a]=[],b.factory(a+"Directive",["$injector","$exceptionHandler",function(b,d){var f=[];n(e[a],function(e,g){try{var h=b.invoke(e);G(h)?h={compile:qa(h)}:!h.compile&&h.link&&(h.compile=qa(h.link));h.priority=h.priority||0;h.index=g;h.name=h.name||a;h.require=h.require||
h.controller&&h.name;h.restrict=h.restrict||"EA";var k=h,l=h,s=h.name,m={isolateScope:null,bindToController:null};C(l.scope)&&(!0===l.bindToController?(m.bindToController=c(l.scope,s,!0),m.isolateScope={}):m.isolateScope=c(l.scope,s,!1));C(l.bindToController)&&(m.bindToController=c(l.bindToController,s,!0));if(C(m.bindToController)){var H=l.controller,ba=l.controllerAs;if(!H)throw ea("noctrl",s);var ha;a:if(ba&&L(ba))ha=ba;else{if(L(H)){var n=Wc.exec(H);if(n){ha=n[3];break a}}ha=void 0}if(!ha)throw ea("noident",
s);}var q=k.$$bindings=m;C(q.isolateScope)&&(h.$$isolateBindings=q.isolateScope);f.push(h)}catch(u){d(u)}});return f}])),e[a].push(f)):n(a,pc(s));return this};this.aHrefSanitizationWhitelist=function(b){return y(b)?(a.aHrefSanitizationWhitelist(b),this):a.aHrefSanitizationWhitelist()};this.imgSrcSanitizationWhitelist=function(b){return y(b)?(a.imgSrcSanitizationWhitelist(b),this):a.imgSrcSanitizationWhitelist()};var m=!0;this.debugInfoEnabled=function(a){return y(a)?(m=a,this):m};this.$get=["$injector",
"$interpolate","$exceptionHandler","$templateRequest","$parse","$controller","$rootScope","$document","$sce","$animate","$$sanitizeUri",function(a,b,c,d,t,p,x,q,I,B,O){function D(a,b){try{a.addClass(b)}catch(c){}}function S(a,b,c,d,e){a instanceof z||(a=z(a));n(a,function(b,c){b.nodeType==ab&&b.nodeValue.match(/\S+/)&&(a[c]=z(b).wrap("<span></span>").parent()[0])});var f=P(a,b,a,c,d,e);S.$$addScopeClass(a);var g=null;return function(b,c,d){Sb(b,"scope");d=d||{};var e=d.parentBoundTranscludeFn,h=d.transcludeControllers;
d=d.futureParentElement;e&&e.$$boundTransclude&&(e=e.$$boundTransclude);g||(g=(d=d&&d[0])?"foreignobject"!==ta(d)&&d.toString().match(/SVG/)?"svg":"html":"html");d="html"!==g?z(Yb(g,z("<div>").append(a).html())):c?Oa.clone.call(a):a;if(h)for(var l in h)d.data("$"+l+"Controller",h[l].instance);S.$$addScopeInfo(d,b);c&&c(d,b);f&&f(b,d,d,e);return d}}function P(a,b,c,d,e,f){function g(a,c,d,e){var f,l,k,m,s,B,A;if(p)for(A=Array(c.length),m=0;m<h.length;m+=3)f=h[m],A[f]=c[f];else A=c;m=0;for(s=h.length;m<
s;)if(l=A[h[m++]],c=h[m++],f=h[m++],c){if(c.scope){if(k=a.$new(),S.$$addScopeInfo(z(l),k),B=c.$$destroyBindings)c.$$destroyBindings=null,k.$on("$destroyed",B)}else k=a;B=c.transcludeOnThisElement?ba(a,c.transclude,e,c.elementTranscludeOnThisElement):!c.templateOnThisElement&&e?e:!e&&b?ba(a,b):null;c(f,k,l,d,B,c)}else f&&f(a,l.childNodes,u,e)}for(var h=[],l,k,m,s,p,B=0;B<a.length;B++){l=new aa;k=ha(a[B],[],l,0===B?d:u,e);(f=k.length?J(k,a[B],l,b,c,null,[],[],f):null)&&f.scope&&S.$$addScopeClass(l.$$element);
l=f&&f.terminal||!(m=a[B].childNodes)||!m.length?null:P(m,f?(f.transcludeOnThisElement||!f.templateOnThisElement)&&f.transclude:b);if(f||l)h.push(B,f,l),s=!0,p=p||f;f=null}return s?g:null}function ba(a,b,c,d){return function(d,e,f,g,h){d||(d=a.$new(!1,h),d.$$transcluded=!0);return b(d,e,{parentBoundTranscludeFn:c,transcludeControllers:f,futureParentElement:g})}}function ha(a,b,c,d,e){var h=c.$attr,l;switch(a.nodeType){case pa:v(b,xa(ta(a)),"E",d,e);for(var k,m,s,p=a.attributes,B=0,A=p&&p.length;B<
A;B++){var H=!1,M=!1;k=p[B];l=k.name;m=T(k.value);k=xa(l);if(s=ia.test(k))l=l.replace(Yc,"").substr(8).replace(/_(.)/g,function(a,b){return b.toUpperCase()});var P=k.replace(/(Start|End)$/,"");F(P)&&k===P+"Start"&&(H=l,M=l.substr(0,l.length-5)+"end",l=l.substr(0,l.length-6));k=xa(l.toLowerCase());h[k]=l;if(s||!c.hasOwnProperty(k))c[k]=m,Rc(a,k)&&(c[k]=!0);V(a,b,m,k,s);v(b,k,"A",d,e,H,M)}a=a.className;C(a)&&(a=a.animVal);if(L(a)&&""!==a)for(;l=g.exec(a);)k=xa(l[2]),v(b,k,"C",d,e)&&(c[k]=T(l[3])),a=
a.substr(l.index+l[0].length);break;case ab:za(b,a.nodeValue);break;case 8:try{if(l=f.exec(a.nodeValue))k=xa(l[1]),v(b,k,"M",d,e)&&(c[k]=T(l[2]))}catch(O){}}b.sort(Ja);return b}function wa(a,b,c){var d=[],e=0;if(b&&a.hasAttribute&&a.hasAttribute(b)){do{if(!a)throw ea("uterdir",b,c);a.nodeType==pa&&(a.hasAttribute(b)&&e++,a.hasAttribute(c)&&e--);d.push(a);a=a.nextSibling}while(0<e)}else d.push(a);return z(d)}function Xc(a,b,c){return function(d,e,f,g,h){e=wa(e[0],b,c);return a(d,e,f,g,h)}}function J(a,
b,d,e,f,g,h,k,m){function s(a,b,c,d){if(a){c&&(a=Xc(a,c,d));a.require=J.require;a.directiveName=w;if(t===J||J.$$isolateScope)a=Z(a,{isolateScope:!0});h.push(a)}if(b){c&&(b=Xc(b,c,d));b.require=J.require;b.directiveName=w;if(t===J||J.$$isolateScope)b=Z(b,{isolateScope:!0});k.push(b)}}function B(a,b,c,d){var e;if(L(b)){var f=b.match(l);b=b.substring(f[0].length);var g=f[1]||f[3],f="?"===f[2];"^^"===g?c=c.parent():e=(e=d&&d[b])&&e.instance;e||(d="$"+b+"Controller",e=g?c.inheritedData(d):c.data(d));if(!e&&
!f)throw ea("ctreq",b,a);}else if(K(b))for(e=[],g=0,f=b.length;g<f;g++)e[g]=B(a,b[g],c,d);return e||null}function A(a,b,c,d,e,f){var g=ga(),h;for(h in d){var l=d[h],k={$scope:l===t||l.$$isolateScope?e:f,$element:a,$attrs:b,$transclude:c},m=l.controller;"@"==m&&(m=b[l.name]);k=p(m,k,!0,l.controllerAs);g[l.name]=k;q||a.data("$"+l.name+"Controller",k.instance)}return g}function M(a,c,e,f,g,l){function m(a,b,c){var d;Wa(a)||(c=b,b=a,a=u);q&&(d=n);c||(c=q?ja.parent():ja);return g(a,b,d,c,X)}var s,p,H,
P,n,ha,ja;b===e?(f=d,ja=d.$$element):(ja=z(e),f=new aa(ja,d));t&&(P=c.$new(!0));g&&(ha=m,ha.$$boundTransclude=g);ba&&(n=A(ja,f,ha,ba,P,c));t&&(S.$$addScopeInfo(ja,P,!0,!(D&&(D===t||D===t.$$originalDirective))),S.$$addScopeClass(ja,!0),P.$$isolateBindings=t.$$isolateBindings,Y(c,f,P,P.$$isolateBindings,t,P));if(n){var x=t||O,I;x&&n[x.name]&&(p=x.$$bindings.bindToController,(H=n[x.name])&&H.identifier&&p&&(I=H,l.$$destroyBindings=Y(c,f,H.instance,p,x)));for(s in n){H=n[s];var wa=H();wa!==H.instance&&
(H.instance=wa,ja.data("$"+J.name+"Controller",wa),H===I&&(l.$$destroyBindings(),l.$$destroyBindings=Y(c,f,wa,p,x)))}}s=0;for(l=h.length;s<l;s++)p=h[s],$(p,p.isolateScope?P:c,ja,f,p.require&&B(p.directiveName,p.require,ja,n),ha);var X=c;t&&(t.template||null===t.templateUrl)&&(X=P);a&&a(X,e.childNodes,u,g);for(s=k.length-1;0<=s;s--)p=k[s],$(p,p.isolateScope?P:c,ja,f,p.require&&B(p.directiveName,p.require,ja,n),ha)}m=m||{};for(var P=-Number.MAX_VALUE,O,ba=m.controllerDirectives,t=m.newIsolateScopeDirective,
D=m.templateDirective,n=m.nonTlbTranscludeDirective,x=!1,I=!1,q=m.hasElementTranscludeDirective,X=d.$$element=z(b),J,w,v,Ja=e,za,F=0,E=a.length;F<E;F++){J=a[F];var Ab=J.$$start,Q=J.$$end;Ab&&(X=wa(b,Ab,Q));v=u;if(P>J.priority)break;if(v=J.scope)J.templateUrl||(C(v)?(N("new/isolated scope",t||O,J,X),t=J):N("new/isolated scope",t,J,X)),O=O||J;w=J.name;!J.templateUrl&&J.controller&&(v=J.controller,ba=ba||ga(),N("'"+w+"' controller",ba[w],J,X),ba[w]=J);if(v=J.transclude)x=!0,J.$$tlb||(N("transclusion",
n,J,X),n=J),"element"==v?(q=!0,P=J.priority,v=X,X=d.$$element=z(W.createComment(" "+w+": "+d[w]+" ")),b=X[0],U(f,ra.call(v,0),b),Ja=S(v,e,P,g&&g.name,{nonTlbTranscludeDirective:n})):(v=z(Vb(b)).contents(),X.empty(),Ja=S(v,e));if(J.template)if(I=!0,N("template",D,J,X),D=J,v=G(J.template)?J.template(X,d):J.template,v=fa(v),J.replace){g=J;v=Tb.test(v)?Zc(Yb(J.templateNamespace,T(v))):[];b=v[0];if(1!=v.length||b.nodeType!==pa)throw ea("tplrt",w,"");U(f,X,b);E={$attr:{}};v=ha(b,[],E);var R=a.splice(F+
1,a.length-(F+1));t&&y(v);a=a.concat(v).concat(R);$c(d,E);E=a.length}else X.html(v);if(J.templateUrl)I=!0,N("template",D,J,X),D=J,J.replace&&(g=J),M=Kf(a.splice(F,a.length-F),X,d,f,x&&Ja,h,k,{controllerDirectives:ba,newIsolateScopeDirective:t,templateDirective:D,nonTlbTranscludeDirective:n}),E=a.length;else if(J.compile)try{za=J.compile(X,d,Ja),G(za)?s(null,za,Ab,Q):za&&s(za.pre,za.post,Ab,Q)}catch(V){c(V,va(X))}J.terminal&&(M.terminal=!0,P=Math.max(P,J.priority))}M.scope=O&&!0===O.scope;M.transcludeOnThisElement=
x;M.elementTranscludeOnThisElement=q;M.templateOnThisElement=I;M.transclude=Ja;m.hasElementTranscludeDirective=q;return M}function y(a){for(var b=0,c=a.length;b<c;b++)a[b]=Ob(a[b],{$$isolateScope:!0})}function v(b,d,f,g,h,l,k){if(d===h)return null;h=null;if(e.hasOwnProperty(d)){var m;d=a.get(d+"Directive");for(var p=0,B=d.length;p<B;p++)try{m=d[p],(g===u||g>m.priority)&&-1!=m.restrict.indexOf(f)&&(l&&(m=Ob(m,{$$start:l,$$end:k})),b.push(m),h=m)}catch(A){c(A)}}return h}function F(b){if(e.hasOwnProperty(b))for(var c=
a.get(b+"Directive"),d=0,f=c.length;d<f;d++)if(b=c[d],b.multiElement)return!0;return!1}function $c(a,b){var c=b.$attr,d=a.$attr,e=a.$$element;n(a,function(d,e){"$"!=e.charAt(0)&&(b[e]&&b[e]!==d&&(d+=("style"===e?";":" ")+b[e]),a.$set(e,d,!0,c[e]))});n(b,function(b,f){"class"==f?(D(e,b),a["class"]=(a["class"]?a["class"]+" ":"")+b):"style"==f?(e.attr("style",e.attr("style")+";"+b),a.style=(a.style?a.style+";":"")+b):"$"==f.charAt(0)||a.hasOwnProperty(f)||(a[f]=b,d[f]=c[f])})}function Kf(a,b,c,e,f,g,
h,l){var k=[],m,s,p=b[0],B=a.shift(),A=Ob(B,{templateUrl:null,transclude:null,replace:null,$$originalDirective:B}),H=G(B.templateUrl)?B.templateUrl(b,c):B.templateUrl,O=B.templateNamespace;b.empty();d(I.getTrustedResourceUrl(H)).then(function(d){var M,t;d=fa(d);if(B.replace){d=Tb.test(d)?Zc(Yb(O,T(d))):[];M=d[0];if(1!=d.length||M.nodeType!==pa)throw ea("tplrt",B.name,H);d={$attr:{}};U(e,b,M);var x=ha(M,[],d);C(B.scope)&&y(x);a=x.concat(a);$c(c,d)}else M=p,b.html(d);a.unshift(A);m=J(a,M,c,f,b,B,g,
h,l);n(e,function(a,c){a==M&&(e[c]=b[0])});for(s=P(b[0].childNodes,f);k.length;){d=k.shift();t=k.shift();var S=k.shift(),I=k.shift(),x=b[0];if(!d.$$destroyed){if(t!==p){var wa=t.className;l.hasElementTranscludeDirective&&B.replace||(x=Vb(M));U(S,z(t),x);D(z(x),wa)}t=m.transcludeOnThisElement?ba(d,m.transclude,I):I;m(s,d,x,e,t,m)}}k=null});return function(a,b,c,d,e){a=e;b.$$destroyed||(k?k.push(b,c,d,a):(m.transcludeOnThisElement&&(a=ba(b,m.transclude,e)),m(s,b,c,d,a,m)))}}function Ja(a,b){var c=b.priority-
a.priority;return 0!==c?c:a.name!==b.name?a.name<b.name?-1:1:a.index-b.index}function N(a,b,c,d){if(b)throw ea("multidir",b.name,c.name,a,va(d));}function za(a,c){var d=b(c,!0);d&&a.push({priority:0,compile:function(a){a=a.parent();var b=!!a.length;b&&S.$$addBindingClass(a);return function(a,c){var e=c.parent();b||S.$$addBindingClass(e);S.$$addBindingInfo(e,d.expressions);a.$watch(d,function(a){c[0].nodeValue=a})}}})}function Yb(a,b){a=E(a||"html");switch(a){case "svg":case "math":var c=W.createElement("div");
c.innerHTML="<"+a+">"+b+"</"+a+">";return c.childNodes[0].childNodes;default:return b}}function R(a,b){if("srcdoc"==b)return I.HTML;var c=ta(a);if("xlinkHref"==b||"form"==c&&"action"==b||"img"!=c&&("src"==b||"ngSrc"==b))return I.RESOURCE_URL}function V(a,c,d,e,f){var g=R(a,e);f=h[e]||f;var l=b(d,!0,g,f);if(l){if("multiple"===e&&"select"===ta(a))throw ea("selmulti",va(a));c.push({priority:100,compile:function(){return{pre:function(a,c,h){c=h.$$observers||(h.$$observers={});if(k.test(e))throw ea("nodomevents");
var m=h[e];m!==d&&(l=m&&b(m,!0,g,f),d=m);l&&(h[e]=l(a),(c[e]||(c[e]=[])).$$inter=!0,(h.$$observers&&h.$$observers[e].$$scope||a).$watch(l,function(a,b){"class"===e&&a!=b?h.$updateClass(a,b):h.$set(e,a)}))}}}})}}function U(a,b,c){var d=b[0],e=b.length,f=d.parentNode,g,h;if(a)for(g=0,h=a.length;g<h;g++)if(a[g]==d){a[g++]=c;h=g+e-1;for(var l=a.length;g<l;g++,h++)h<l?a[g]=a[h]:delete a[g];a.length-=e-1;a.context===d&&(a.context=c);break}f&&f.replaceChild(c,d);a=W.createDocumentFragment();a.appendChild(d);
z(c).data(z(d).data());la?(Rb=!0,la.cleanData([d])):delete z.cache[d[z.expando]];d=1;for(e=b.length;d<e;d++)f=b[d],z(f).remove(),a.appendChild(f),delete b[d];b[0]=c;b.length=1}function Z(a,b){return Q(function(){return a.apply(null,arguments)},a,b)}function $(a,b,d,e,f,g){try{a(b,d,e,f,g)}catch(h){c(h,va(d))}}function Y(a,c,d,e,f,g){var h;n(e,function(e,g){var l=e.attrName,k=e.optional,m,s,p,B;switch(e.mode){case "@":c.$observe(l,function(a){d[g]=a});c.$$observers[l].$$scope=a;c[l]&&(d[g]=b(c[l])(a));
break;case "=":if(k&&!c[l])break;s=t(c[l]);B=s.literal?ka:function(a,b){return a===b||a!==a&&b!==b};p=s.assign||function(){m=d[g]=s(a);throw ea("nonassign",c[l],f.name);};m=d[g]=s(a);k=function(b){B(b,d[g])||(B(b,m)?p(a,b=d[g]):d[g]=b);return m=b};k.$stateful=!0;k=e.collection?a.$watchCollection(c[l],k):a.$watch(t(c[l],k),null,s.literal);h=h||[];h.push(k);break;case "&":if(!c.hasOwnProperty(l)&&k)break;s=t(c[l]);if(s===w&&k)break;d[g]=function(b){return s(a,b)}}});e=h?function(){for(var a=0,b=h.length;a<
b;++a)h[a]()}:w;return g&&e!==w?(g.$on("$destroy",e),w):e}var aa=function(a,b){if(b){var c=Object.keys(b),d,e,f;d=0;for(e=c.length;d<e;d++)f=c[d],this[f]=b[f]}else this.$attr={};this.$$element=a};aa.prototype={$normalize:xa,$addClass:function(a){a&&0<a.length&&B.addClass(this.$$element,a)},$removeClass:function(a){a&&0<a.length&&B.removeClass(this.$$element,a)},$updateClass:function(a,b){var c=ad(a,b);c&&c.length&&B.addClass(this.$$element,c);(c=ad(b,a))&&c.length&&B.removeClass(this.$$element,c)},
$set:function(a,b,d,e){var f=this.$$element[0],g=Rc(f,a),h=Ff(f,a),f=a;g?(this.$$element.prop(a,b),e=g):h&&(this[h]=b,f=h);this[a]=b;e?this.$attr[a]=e:(e=this.$attr[a])||(this.$attr[a]=e=Ac(a,"-"));g=ta(this.$$element);if("a"===g&&"href"===a||"img"===g&&"src"===a)this[a]=b=O(b,"src"===a);else if("img"===g&&"srcset"===a){for(var g="",h=T(b),l=/(\s+\d+x\s*,|\s+\d+w\s*,|\s+,|,\s+)/,l=/\s/.test(h)?l:/(,)/,h=h.split(l),l=Math.floor(h.length/2),k=0;k<l;k++)var m=2*k,g=g+O(T(h[m]),!0),g=g+(" "+T(h[m+1]));
h=T(h[2*k]).split(/\s/);g+=O(T(h[0]),!0);2===h.length&&(g+=" "+T(h[1]));this[a]=b=g}!1!==d&&(null===b||b===u?this.$$element.removeAttr(e):this.$$element.attr(e,b));(a=this.$$observers)&&n(a[f],function(a){try{a(b)}catch(d){c(d)}})},$observe:function(a,b){var c=this,d=c.$$observers||(c.$$observers=ga()),e=d[a]||(d[a]=[]);e.push(b);x.$evalAsync(function(){!e.$$inter&&c.hasOwnProperty(a)&&b(c[a])});return function(){Ya(e,b)}}};var ca=b.startSymbol(),da=b.endSymbol(),fa="{{"==ca||"}}"==da?Ua:function(a){return a.replace(/\{\{/g,
ca).replace(/}}/g,da)},ia=/^ngAttr[A-Z]/;S.$$addBindingInfo=m?function(a,b){var c=a.data("$binding")||[];K(b)?c=c.concat(b):c.push(b);a.data("$binding",c)}:w;S.$$addBindingClass=m?function(a){D(a,"ng-binding")}:w;S.$$addScopeInfo=m?function(a,b,c,d){a.data(c?d?"$isolateScopeNoTemplate":"$isolateScope":"$scope",b)}:w;S.$$addScopeClass=m?function(a,b){D(a,b?"ng-isolate-scope":"ng-scope")}:w;return S}]}function xa(b){return eb(b.replace(Yc,""))}function ad(b,a){var c="",d=b.split(/\s+/),e=a.split(/\s+/),
f=0;a:for(;f<d.length;f++){for(var g=d[f],h=0;h<e.length;h++)if(g==e[h])continue a;c+=(0<c.length?" ":"")+g}return c}function Zc(b){b=z(b);var a=b.length;if(1>=a)return b;for(;a--;)8===b[a].nodeType&&Lf.call(b,a,1);return b}function We(){var b={},a=!1;this.register=function(a,d){Qa(a,"controller");C(a)?Q(b,a):b[a]=d};this.allowGlobals=function(){a=!0};this.$get=["$injector","$window",function(c,d){function e(a,b,c,d){if(!a||!C(a.$scope))throw F("$controller")("noscp",d,b);a.$scope[b]=c}return function(f,
g,h,l){var k,m,r;h=!0===h;l&&L(l)&&(r=l);if(L(f)){l=f.match(Wc);if(!l)throw Mf("ctrlfmt",f);m=l[1];r=r||l[3];f=b.hasOwnProperty(m)?b[m]:Cc(g.$scope,m,!0)||(a?Cc(d,m,!0):u);Pa(f,m,!0)}if(h)return h=(K(f)?f[f.length-1]:f).prototype,k=Object.create(h||null),r&&e(g,r,k,m||f.name),Q(function(){var a=c.invoke(f,k,g,m);a!==k&&(C(a)||G(a))&&(k=a,r&&e(g,r,k,m||f.name));return k},{instance:k,identifier:r});k=c.instantiate(f,g,m);r&&e(g,r,k,m||f.name);return k}}]}function Xe(){this.$get=["$window",function(b){return z(b.document)}]}
function Ye(){this.$get=["$log",function(b){return function(a,c){b.error.apply(b,arguments)}}]}function Zb(b){return C(b)?da(b)?b.toISOString():$a(b):b}function bf(){this.$get=function(){return function(b){if(!b)return"";var a=[];oc(b,function(b,d){null===b||v(b)||(K(b)?n(b,function(b,c){a.push(ia(d)+"="+ia(Zb(b)))}):a.push(ia(d)+"="+ia(Zb(b))))});return a.join("&")}}}function cf(){this.$get=function(){return function(b){function a(b,e,f){null===b||v(b)||(K(b)?n(b,function(b){a(b,e+"[]")}):C(b)&&
!da(b)?oc(b,function(b,c){a(b,e+(f?"":"[")+c+(f?"":"]"))}):c.push(ia(e)+"="+ia(Zb(b))))}if(!b)return"";var c=[];a(b,"",!0);return c.join("&")}}}function $b(b,a){if(L(b)){var c=b.replace(Nf,"").trim();if(c){var d=a("Content-Type");(d=d&&0===d.indexOf(bd))||(d=(d=c.match(Of))&&Pf[d[0]].test(c));d&&(b=vc(c))}}return b}function cd(b){var a=ga(),c;L(b)?n(b.split("\n"),function(b){c=b.indexOf(":");var e=E(T(b.substr(0,c)));b=T(b.substr(c+1));e&&(a[e]=a[e]?a[e]+", "+b:b)}):C(b)&&n(b,function(b,c){var f=
E(c),g=T(b);f&&(a[f]=a[f]?a[f]+", "+g:g)});return a}function dd(b){var a;return function(c){a||(a=cd(b));return c?(c=a[E(c)],void 0===c&&(c=null),c):a}}function ed(b,a,c,d){if(G(d))return d(b,a,c);n(d,function(d){b=d(b,a,c)});return b}function af(){var b=this.defaults={transformResponse:[$b],transformRequest:[function(a){return C(a)&&"[object File]"!==sa.call(a)&&"[object Blob]"!==sa.call(a)&&"[object FormData]"!==sa.call(a)?$a(a):a}],headers:{common:{Accept:"application/json, text/plain, */*"},post:fa(ac),
put:fa(ac),patch:fa(ac)},xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",paramSerializer:"$httpParamSerializer"},a=!1;this.useApplyAsync=function(b){return y(b)?(a=!!b,this):a};var c=this.interceptors=[];this.$get=["$httpBackend","$$cookieReader","$cacheFactory","$rootScope","$q","$injector",function(d,e,f,g,h,l){function k(a){function c(a){var b=Q({},a);b.data=a.data?ed(a.data,a.headers,a.status,e.transformResponse):a.data;a=a.status;return 200<=a&&300>a?b:h.reject(b)}function d(a,b){var c,
e={};n(a,function(a,d){G(a)?(c=a(b),null!=c&&(e[d]=c)):e[d]=a});return e}if(!aa.isObject(a))throw F("$http")("badreq",a);var e=Q({method:"get",transformRequest:b.transformRequest,transformResponse:b.transformResponse,paramSerializer:b.paramSerializer},a);e.headers=function(a){var c=b.headers,e=Q({},a.headers),f,g,h,c=Q({},c.common,c[E(a.method)]);a:for(f in c){g=E(f);for(h in e)if(E(h)===g)continue a;e[f]=c[f]}return d(e,fa(a))}(a);e.method=pb(e.method);e.paramSerializer=L(e.paramSerializer)?l.get(e.paramSerializer):
e.paramSerializer;var f=[function(a){var d=a.headers,e=ed(a.data,dd(d),u,a.transformRequest);v(e)&&n(d,function(a,b){"content-type"===E(b)&&delete d[b]});v(a.withCredentials)&&!v(b.withCredentials)&&(a.withCredentials=b.withCredentials);return m(a,e).then(c,c)},u],g=h.when(e);for(n(A,function(a){(a.request||a.requestError)&&f.unshift(a.request,a.requestError);(a.response||a.responseError)&&f.push(a.response,a.responseError)});f.length;){a=f.shift();var k=f.shift(),g=g.then(a,k)}g.success=function(a){Pa(a,
"fn");g.then(function(b){a(b.data,b.status,b.headers,e)});return g};g.error=function(a){Pa(a,"fn");g.then(null,function(b){a(b.data,b.status,b.headers,e)});return g};return g}function m(c,f){function l(b,c,d,e){function f(){m(c,b,d,e)}O&&(200<=b&&300>b?O.put(P,[b,c,cd(d),e]):O.remove(P));a?g.$applyAsync(f):(f(),g.$$phase||g.$apply())}function m(a,b,d,e){b=Math.max(b,0);(200<=b&&300>b?I.resolve:I.reject)({data:a,status:b,headers:dd(d),config:c,statusText:e})}function A(a){m(a.data,a.status,fa(a.headers()),
a.statusText)}function n(){var a=k.pendingRequests.indexOf(c);-1!==a&&k.pendingRequests.splice(a,1)}var I=h.defer(),B=I.promise,O,D,S=c.headers,P=r(c.url,c.paramSerializer(c.params));k.pendingRequests.push(c);B.then(n,n);!c.cache&&!b.cache||!1===c.cache||"GET"!==c.method&&"JSONP"!==c.method||(O=C(c.cache)?c.cache:C(b.cache)?b.cache:s);O&&(D=O.get(P),y(D)?D&&G(D.then)?D.then(A,A):K(D)?m(D[1],D[0],fa(D[2]),D[3]):m(D,200,{},"OK"):O.put(P,B));v(D)&&((D=fd(c.url)?e()[c.xsrfCookieName||b.xsrfCookieName]:
u)&&(S[c.xsrfHeaderName||b.xsrfHeaderName]=D),d(c.method,P,f,l,S,c.timeout,c.withCredentials,c.responseType));return B}function r(a,b){0<b.length&&(a+=(-1==a.indexOf("?")?"?":"&")+b);return a}var s=f("$http");b.paramSerializer=L(b.paramSerializer)?l.get(b.paramSerializer):b.paramSerializer;var A=[];n(c,function(a){A.unshift(L(a)?l.get(a):l.invoke(a))});k.pendingRequests=[];(function(a){n(arguments,function(a){k[a]=function(b,c){return k(Q({},c||{},{method:a,url:b}))}})})("get","delete","head","jsonp");
(function(a){n(arguments,function(a){k[a]=function(b,c,d){return k(Q({},d||{},{method:a,url:b,data:c}))}})})("post","put","patch");k.defaults=b;return k}]}function Qf(){return new N.XMLHttpRequest}function df(){this.$get=["$browser","$window","$document",function(b,a,c){return Rf(b,Qf,b.defer,a.angular.callbacks,c[0])}]}function Rf(b,a,c,d,e){function f(a,b,c){var f=e.createElement("script"),m=null;f.type="text/javascript";f.src=a;f.async=!0;m=function(a){f.removeEventListener("load",m,!1);f.removeEventListener("error",
m,!1);e.body.removeChild(f);f=null;var g=-1,A="unknown";a&&("load"!==a.type||d[b].called||(a={type:"error"}),A=a.type,g="error"===a.type?404:200);c&&c(g,A)};f.addEventListener("load",m,!1);f.addEventListener("error",m,!1);e.body.appendChild(f);return m}return function(e,h,l,k,m,r,s,A){function H(){p&&p();x&&x.abort()}function M(a,d,e,f,g){I!==u&&c.cancel(I);p=x=null;a(d,e,f,g);b.$$completeOutstandingRequest(w)}b.$$incOutstandingRequestCount();h=h||b.url();if("jsonp"==E(e)){var t="_"+(d.counter++).toString(36);
d[t]=function(a){d[t].data=a;d[t].called=!0};var p=f(h.replace("JSON_CALLBACK","angular.callbacks."+t),t,function(a,b){M(k,a,d[t].data,"",b);d[t]=w})}else{var x=a();x.open(e,h,!0);n(m,function(a,b){y(a)&&x.setRequestHeader(b,a)});x.onload=function(){var a=x.statusText||"",b="response"in x?x.response:x.responseText,c=1223===x.status?204:x.status;0===c&&(c=b?200:"file"==Aa(h).protocol?404:0);M(k,c,b,x.getAllResponseHeaders(),a)};e=function(){M(k,-1,null,null,"")};x.onerror=e;x.onabort=e;s&&(x.withCredentials=
!0);if(A)try{x.responseType=A}catch(q){if("json"!==A)throw q;}x.send(l)}if(0<r)var I=c(H,r);else r&&G(r.then)&&r.then(H)}}function Ze(){var b="{{",a="}}";this.startSymbol=function(a){return a?(b=a,this):b};this.endSymbol=function(b){return b?(a=b,this):a};this.$get=["$parse","$exceptionHandler","$sce",function(c,d,e){function f(a){return"\\\\\\"+a}function g(c){return c.replace(m,b).replace(r,a)}function h(f,h,m,r){function t(a){try{var b=a;a=m?e.getTrusted(m,b):e.valueOf(b);var c;if(r&&!y(a))c=a;
else if(null==a)c="";else{switch(typeof a){case "string":break;case "number":a=""+a;break;default:a=$a(a)}c=a}return c}catch(g){d(Ka.interr(f,g))}}r=!!r;for(var p,n,q=0,I=[],B=[],O=f.length,D=[],S=[];q<O;)if(-1!=(p=f.indexOf(b,q))&&-1!=(n=f.indexOf(a,p+l)))q!==p&&D.push(g(f.substring(q,p))),q=f.substring(p+l,n),I.push(q),B.push(c(q,t)),q=n+k,S.push(D.length),D.push("");else{q!==O&&D.push(g(f.substring(q)));break}m&&1<D.length&&Ka.throwNoconcat(f);if(!h||I.length){var P=function(a){for(var b=0,c=I.length;b<
c;b++){if(r&&v(a[b]))return;D[S[b]]=a[b]}return D.join("")};return Q(function(a){var b=0,c=I.length,e=Array(c);try{for(;b<c;b++)e[b]=B[b](a);return P(e)}catch(g){d(Ka.interr(f,g))}},{exp:f,expressions:I,$$watchDelegate:function(a,b){var c;return a.$watchGroup(B,function(d,e){var f=P(d);G(b)&&b.call(this,f,d!==e?c:f,a);c=f})}})}}var l=b.length,k=a.length,m=new RegExp(b.replace(/./g,f),"g"),r=new RegExp(a.replace(/./g,f),"g");h.startSymbol=function(){return b};h.endSymbol=function(){return a};return h}]}
function $e(){this.$get=["$rootScope","$window","$q","$$q",function(b,a,c,d){function e(e,h,l,k){var m=4<arguments.length,r=m?ra.call(arguments,4):[],s=a.setInterval,A=a.clearInterval,H=0,M=y(k)&&!k,t=(M?d:c).defer(),p=t.promise;l=y(l)?l:0;p.then(null,null,m?function(){e.apply(null,r)}:e);p.$$intervalId=s(function(){t.notify(H++);0<l&&H>=l&&(t.resolve(H),A(p.$$intervalId),delete f[p.$$intervalId]);M||b.$apply()},h);f[p.$$intervalId]=t;return p}var f={};e.cancel=function(b){return b&&b.$$intervalId in
f?(f[b.$$intervalId].reject("canceled"),a.clearInterval(b.$$intervalId),delete f[b.$$intervalId],!0):!1};return e}]}function fe(){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(" "),
SHORTMONTH:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" "),DAY:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),SHORTDAY:"Sun Mon Tue Wed Thu Fri Sat".split(" "),AMPMS:["AM","PM"],medium:"MMM d, y h:mm:ss a","short":"M/d/yy h:mm a",fullDate:"EEEE, MMMM d, y",longDate:"MMMM d, y",mediumDate:"MMM d, y",shortDate:"M/d/yy",mediumTime:"h:mm:ss a",shortTime:"h:mm a",ERANAMES:["Before Christ","Anno Domini"],ERAS:["BC","AD"]},pluralCat:function(b){return 1===b?"one":"other"}}}}
function bc(b){b=b.split("/");for(var a=b.length;a--;)b[a]=mb(b[a]);return b.join("/")}function gd(b,a){var c=Aa(b);a.$$protocol=c.protocol;a.$$host=c.hostname;a.$$port=Y(c.port)||Sf[c.protocol]||null}function hd(b,a){var c="/"!==b.charAt(0);c&&(b="/"+b);var d=Aa(b);a.$$path=decodeURIComponent(c&&"/"===d.pathname.charAt(0)?d.pathname.substring(1):d.pathname);a.$$search=yc(d.search);a.$$hash=decodeURIComponent(d.hash);a.$$path&&"/"!=a.$$path.charAt(0)&&(a.$$path="/"+a.$$path)}function ya(b,a){if(0===
a.indexOf(b))return a.substr(b.length)}function Ia(b){var a=b.indexOf("#");return-1==a?b:b.substr(0,a)}function Bb(b){return b.replace(/(#.+)|#$/,"$1")}function cc(b){return b.substr(0,Ia(b).lastIndexOf("/")+1)}function dc(b,a){this.$$html5=!0;a=a||"";var c=cc(b);gd(b,this);this.$$parse=function(a){var b=ya(c,a);if(!L(b))throw Cb("ipthprfx",a,c);hd(b,this);this.$$path||(this.$$path="/");this.$$compose()};this.$$compose=function(){var a=Qb(this.$$search),b=this.$$hash?"#"+mb(this.$$hash):"";this.$$url=
bc(this.$$path)+(a?"?"+a:"")+b;this.$$absUrl=c+this.$$url.substr(1)};this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,g;(f=ya(b,d))!==u?(g=f,g=(f=ya(a,f))!==u?c+(ya("/",f)||f):b+g):(f=ya(c,d))!==u?g=c+f:c==d+"/"&&(g=c);g&&this.$$parse(g);return!!g}}function ec(b,a){var c=cc(b);gd(b,this);this.$$parse=function(d){d=ya(b,d)||ya(c,d);var e;"#"===d.charAt(0)?(e=ya(a,d),v(e)&&(e=d)):e=this.$$html5?d:"";hd(e,this);d=this.$$path;var f=/^\/[A-Z]:(\/.*)/;0===e.indexOf(b)&&
(e=e.replace(b,""));f.exec(e)||(d=(e=f.exec(d))?e[1]:d);this.$$path=d;this.$$compose()};this.$$compose=function(){var c=Qb(this.$$search),e=this.$$hash?"#"+mb(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+(this.$$url?a+this.$$url:"")};this.$$parseLinkUrl=function(a,c){return Ia(b)==Ia(a)?(this.$$parse(a),!0):!1}}function id(b,a){this.$$html5=!0;ec.apply(this,arguments);var c=cc(b);this.$$parseLinkUrl=function(d,e){if(e&&"#"===e[0])return this.hash(e.slice(1)),!0;var f,
g;b==Ia(d)?f=d:(g=ya(c,d))?f=b+a+g:c===d+"/"&&(f=c);f&&this.$$parse(f);return!!f};this.$$compose=function(){var c=Qb(this.$$search),e=this.$$hash?"#"+mb(this.$$hash):"";this.$$url=bc(this.$$path)+(c?"?"+c:"")+e;this.$$absUrl=b+a+this.$$url}}function Db(b){return function(){return this[b]}}function jd(b,a){return function(c){if(v(c))return this[b];this[b]=a(c);this.$$compose();return this}}function ef(){var b="",a={enabled:!1,requireBase:!0,rewriteLinks:!0};this.hashPrefix=function(a){return y(a)?
(b=a,this):b};this.html5Mode=function(b){return Xa(b)?(a.enabled=b,this):C(b)?(Xa(b.enabled)&&(a.enabled=b.enabled),Xa(b.requireBase)&&(a.requireBase=b.requireBase),Xa(b.rewriteLinks)&&(a.rewriteLinks=b.rewriteLinks),this):a};this.$get=["$rootScope","$browser","$sniffer","$rootElement","$window",function(c,d,e,f,g){function h(a,b,c){var e=k.url(),f=k.$$state;try{d.url(a,b,c),k.$$state=d.state()}catch(g){throw k.url(e),k.$$state=f,g;}}function l(a,b){c.$broadcast("$locationChangeSuccess",k.absUrl(),
a,k.$$state,b)}var k,m;m=d.baseHref();var r=d.url(),s;if(a.enabled){if(!m&&a.requireBase)throw Cb("nobase");s=r.substring(0,r.indexOf("/",r.indexOf("//")+2))+(m||"/");m=e.history?dc:id}else s=Ia(r),m=ec;k=new m(s,"#"+b);k.$$parseLinkUrl(r,r);k.$$state=d.state();var A=/^\s*(javascript|mailto):/i;f.on("click",function(b){if(a.rewriteLinks&&!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&2!=b.which&&2!=b.button){for(var e=z(b.target);"a"!==ta(e[0]);)if(e[0]===f[0]||!(e=e.parent())[0])return;var h=e.prop("href"),
l=e.attr("href")||e.attr("xlink:href");C(h)&&"[object SVGAnimatedString]"===h.toString()&&(h=Aa(h.animVal).href);A.test(h)||!h||e.attr("target")||b.isDefaultPrevented()||!k.$$parseLinkUrl(h,l)||(b.preventDefault(),k.absUrl()!=d.url()&&(c.$apply(),g.angular["ff-684208-preventDefault"]=!0))}});Bb(k.absUrl())!=Bb(r)&&d.url(k.absUrl(),!0);var H=!0;d.onUrlChange(function(a,b){c.$evalAsync(function(){var d=k.absUrl(),e=k.$$state,f;k.$$parse(a);k.$$state=b;f=c.$broadcast("$locationChangeStart",a,d,b,e).defaultPrevented;
k.absUrl()===a&&(f?(k.$$parse(d),k.$$state=e,h(d,!1,e)):(H=!1,l(d,e)))});c.$$phase||c.$digest()});c.$watch(function(){var a=Bb(d.url()),b=Bb(k.absUrl()),f=d.state(),g=k.$$replace,m=a!==b||k.$$html5&&e.history&&f!==k.$$state;if(H||m)H=!1,c.$evalAsync(function(){var b=k.absUrl(),d=c.$broadcast("$locationChangeStart",b,a,k.$$state,f).defaultPrevented;k.absUrl()===b&&(d?(k.$$parse(a),k.$$state=f):(m&&h(b,g,f===k.$$state?null:k.$$state),l(a,f)))});k.$$replace=!1});return k}]}function ff(){var b=!0,a=this;
this.debugEnabled=function(a){return y(a)?(b=a,this):b};this.$get=["$window",function(c){function d(a){a instanceof Error&&(a.stack?a=a.message&&-1===a.stack.indexOf(a.message)?"Error: "+a.message+"\n"+a.stack:a.stack:a.sourceURL&&(a=a.message+"\n"+a.sourceURL+":"+a.line));return a}function e(a){var b=c.console||{},e=b[a]||b.log||w;a=!1;try{a=!!e.apply}catch(l){}return a?function(){var a=[];n(arguments,function(b){a.push(d(b))});return e.apply(b,a)}:function(a,b){e(a,null==b?"":b)}}return{log:e("log"),
info:e("info"),warn:e("warn"),error:e("error"),debug:function(){var c=e("debug");return function(){b&&c.apply(a,arguments)}}()}}]}function Ba(b,a){if("__defineGetter__"===b||"__defineSetter__"===b||"__lookupGetter__"===b||"__lookupSetter__"===b||"__proto__"===b)throw ca("isecfld",a);return b}function na(b,a){if(b){if(b.constructor===b)throw ca("isecfn",a);if(b.window===b)throw ca("isecwindow",a);if(b.children&&(b.nodeName||b.prop&&b.attr&&b.find))throw ca("isecdom",a);if(b===Object)throw ca("isecobj",
a);}return b}function kd(b,a){if(b){if(b.constructor===b)throw ca("isecfn",a);if(b===Tf||b===Uf||b===Vf)throw ca("isecff",a);}}function Wf(b,a){return"undefined"!==typeof b?b:a}function ld(b,a){return"undefined"===typeof b?a:"undefined"===typeof a?b:b+a}function U(b,a){var c,d;switch(b.type){case q.Program:c=!0;n(b.body,function(b){U(b.expression,a);c=c&&b.expression.constant});b.constant=c;break;case q.Literal:b.constant=!0;b.toWatch=[];break;case q.UnaryExpression:U(b.argument,a);b.constant=b.argument.constant;
b.toWatch=b.argument.toWatch;break;case q.BinaryExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.left.toWatch.concat(b.right.toWatch);break;case q.LogicalExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;b.toWatch=b.constant?[]:[b];break;case q.ConditionalExpression:U(b.test,a);U(b.alternate,a);U(b.consequent,a);b.constant=b.test.constant&&b.alternate.constant&&b.consequent.constant;b.toWatch=b.constant?[]:[b];break;case q.Identifier:b.constant=
!1;b.toWatch=[b];break;case q.MemberExpression:U(b.object,a);b.computed&&U(b.property,a);b.constant=b.object.constant&&(!b.computed||b.property.constant);b.toWatch=[b];break;case q.CallExpression:c=b.filter?!a(b.callee.name).$stateful:!1;d=[];n(b.arguments,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=b.filter&&!a(b.callee.name).$stateful?d:[b];break;case q.AssignmentExpression:U(b.left,a);U(b.right,a);b.constant=b.left.constant&&b.right.constant;
b.toWatch=[b];break;case q.ArrayExpression:c=!0;d=[];n(b.elements,function(b){U(b,a);c=c&&b.constant;b.constant||d.push.apply(d,b.toWatch)});b.constant=c;b.toWatch=d;break;case q.ObjectExpression:c=!0;d=[];n(b.properties,function(b){U(b.value,a);c=c&&b.value.constant;b.value.constant||d.push.apply(d,b.value.toWatch)});b.constant=c;b.toWatch=d;break;case q.ThisExpression:b.constant=!1,b.toWatch=[]}}function md(b){if(1==b.length){b=b[0].expression;var a=b.toWatch;return 1!==a.length?a:a[0]!==b?a:u}}
function nd(b){return b.type===q.Identifier||b.type===q.MemberExpression}function od(b){if(1===b.body.length&&nd(b.body[0].expression))return{type:q.AssignmentExpression,left:b.body[0].expression,right:{type:q.NGValueParameter},operator:"="}}function pd(b){return 0===b.body.length||1===b.body.length&&(b.body[0].expression.type===q.Literal||b.body[0].expression.type===q.ArrayExpression||b.body[0].expression.type===q.ObjectExpression)}function qd(b,a){this.astBuilder=b;this.$filter=a}function rd(b,
a){this.astBuilder=b;this.$filter=a}function Eb(b,a,c,d){na(b,d);a=a.split(".");for(var e,f=0;1<a.length;f++){e=Ba(a.shift(),d);var g=na(b[e],d);g||(g={},b[e]=g);b=g}e=Ba(a.shift(),d);na(b[e],d);return b[e]=c}function Fb(b){return"constructor"==b}function fc(b){return G(b.valueOf)?b.valueOf():Xf.call(b)}function gf(){var b=ga(),a=ga();this.$get=["$filter","$sniffer",function(c,d){function e(a,b){return null==a||null==b?a===b:"object"===typeof a&&(a=fc(a),"object"===typeof a)?!1:a===b||a!==a&&b!==
b}function f(a,b,c,d,f){var g=d.inputs,h;if(1===g.length){var l=e,g=g[0];return a.$watch(function(a){var b=g(a);e(b,l)||(h=d(a,u,u,[b]),l=b&&fc(b));return h},b,c,f)}for(var k=[],m=[],r=0,n=g.length;r<n;r++)k[r]=e,m[r]=null;return a.$watch(function(a){for(var b=!1,c=0,f=g.length;c<f;c++){var l=g[c](a);if(b||(b=!e(l,k[c])))m[c]=l,k[c]=l&&fc(l)}b&&(h=d(a,u,u,m));return h},b,c,f)}function g(a,b,c,d){var e,f;return e=a.$watch(function(a){return d(a)},function(a,c,d){f=a;G(b)&&b.apply(this,arguments);y(a)&&
d.$$postDigest(function(){y(f)&&e()})},c)}function h(a,b,c,d){function e(a){var b=!0;n(a,function(a){y(a)||(b=!1)});return b}var f,g;return f=a.$watch(function(a){return d(a)},function(a,c,d){g=a;G(b)&&b.call(this,a,c,d);e(a)&&d.$$postDigest(function(){e(g)&&f()})},c)}function l(a,b,c,d){var e;return e=a.$watch(function(a){return d(a)},function(a,c,d){G(b)&&b.apply(this,arguments);e()},c)}function k(a,b){if(!b)return a;var c=a.$$watchDelegate,c=c!==h&&c!==g?function(c,d,e,f){e=a(c,d,e,f);return b(e,
c,d)}:function(c,d,e,f){e=a(c,d,e,f);c=b(e,c,d);return y(e)?c:e};a.$$watchDelegate&&a.$$watchDelegate!==f?c.$$watchDelegate=a.$$watchDelegate:b.$stateful||(c.$$watchDelegate=f,c.inputs=a.inputs?a.inputs:[a]);return c}var m={csp:d.csp,expensiveChecks:!1},r={csp:d.csp,expensiveChecks:!0};return function(d,e,H){var n,t,p;switch(typeof d){case "string":p=d=d.trim();var q=H?a:b;n=q[p];n||(":"===d.charAt(0)&&":"===d.charAt(1)&&(t=!0,d=d.substring(2)),H=H?r:m,n=new gc(H),n=(new hc(n,c,H)).parse(d),n.constant?
n.$$watchDelegate=l:t?n.$$watchDelegate=n.literal?h:g:n.inputs&&(n.$$watchDelegate=f),q[p]=n);return k(n,e);case "function":return k(d,e);default:return w}}}]}function jf(){this.$get=["$rootScope","$exceptionHandler",function(b,a){return sd(function(a){b.$evalAsync(a)},a)}]}function kf(){this.$get=["$browser","$exceptionHandler",function(b,a){return sd(function(a){b.defer(a)},a)}]}function sd(b,a){function c(a,b,c){function d(b){return function(c){e||(e=!0,b.call(a,c))}}var e=!1;return[d(b),d(c)]}
function d(){this.$$state={status:0}}function e(a,b){return function(c){b.call(a,c)}}function f(c){!c.processScheduled&&c.pending&&(c.processScheduled=!0,b(function(){var b,d,e;e=c.pending;c.processScheduled=!1;c.pending=u;for(var f=0,g=e.length;f<g;++f){d=e[f][0];b=e[f][c.status];try{G(b)?d.resolve(b(c.value)):1===c.status?d.resolve(c.value):d.reject(c.value)}catch(h){d.reject(h),a(h)}}}))}function g(){this.promise=new d;this.resolve=e(this,this.resolve);this.reject=e(this,this.reject);this.notify=
e(this,this.notify)}var h=F("$q",TypeError);d.prototype={then:function(a,b,c){var d=new g;this.$$state.pending=this.$$state.pending||[];this.$$state.pending.push([d,a,b,c]);0<this.$$state.status&&f(this.$$state);return d.promise},"catch":function(a){return this.then(null,a)},"finally":function(a,b){return this.then(function(b){return k(b,!0,a)},function(b){return k(b,!1,a)},b)}};g.prototype={resolve:function(a){this.promise.$$state.status||(a===this.promise?this.$$reject(h("qcycle",a)):this.$$resolve(a))},
$$resolve:function(b){var d,e;e=c(this,this.$$resolve,this.$$reject);try{if(C(b)||G(b))d=b&&b.then;G(d)?(this.promise.$$state.status=-1,d.call(b,e[0],e[1],this.notify)):(this.promise.$$state.value=b,this.promise.$$state.status=1,f(this.promise.$$state))}catch(g){e[1](g),a(g)}},reject:function(a){this.promise.$$state.status||this.$$reject(a)},$$reject:function(a){this.promise.$$state.value=a;this.promise.$$state.status=2;f(this.promise.$$state)},notify:function(c){var d=this.promise.$$state.pending;
0>=this.promise.$$state.status&&d&&d.length&&b(function(){for(var b,e,f=0,g=d.length;f<g;f++){e=d[f][0];b=d[f][3];try{e.notify(G(b)?b(c):c)}catch(h){a(h)}}})}};var l=function(a,b){var c=new g;b?c.resolve(a):c.reject(a);return c.promise},k=function(a,b,c){var d=null;try{G(c)&&(d=c())}catch(e){return l(e,!1)}return d&&G(d.then)?d.then(function(){return l(a,b)},function(a){return l(a,!1)}):l(a,b)},m=function(a,b,c,d){var e=new g;e.resolve(a);return e.promise.then(b,c,d)},r=function A(a){if(!G(a))throw h("norslvr",
a);if(!(this instanceof A))return new A(a);var b=new g;a(function(a){b.resolve(a)},function(a){b.reject(a)});return b.promise};r.defer=function(){return new g};r.reject=function(a){var b=new g;b.reject(a);return b.promise};r.when=m;r.all=function(a){var b=new g,c=0,d=K(a)?[]:{};n(a,function(a,e){c++;m(a).then(function(a){d.hasOwnProperty(e)||(d[e]=a,--c||b.resolve(d))},function(a){d.hasOwnProperty(e)||b.reject(a)})});0===c&&b.resolve(d);return b.promise};return r}function tf(){this.$get=["$window",
"$timeout",function(b,a){function c(){for(var a=0;a<m.length;a++){var b=m[a];b&&(m[a]=null,b())}k=m.length=0}function d(a){var b=m.length;k++;m.push(a);0===b&&(l=h(c));return function(){0<=b&&(b=m[b]=null,0===--k&&l&&(l(),l=null,m.length=0))}}var e=b.requestAnimationFrame||b.webkitRequestAnimationFrame,f=b.cancelAnimationFrame||b.webkitCancelAnimationFrame||b.webkitCancelRequestAnimationFrame,g=!!e,h=g?function(a){var b=e(a);return function(){f(b)}}:function(b){var c=a(b,16.66,!1);return function(){a.cancel(c)}};
d.supported=g;var l,k=0,m=[];return d}]}function hf(){function b(a){function b(){this.$$watchers=this.$$nextSibling=this.$$childHead=this.$$childTail=null;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$id=++lb;this.$$ChildScope=null}b.prototype=a;return b}var a=10,c=F("$rootScope"),d=null,e=null;this.digestTtl=function(b){arguments.length&&(a=b);return a};this.$get=["$injector","$exceptionHandler","$parse","$browser",function(f,g,h,l){function k(a){a.currentScope.$$destroyed=
!0}function m(){this.$id=++lb;this.$$phase=this.$parent=this.$$watchers=this.$$nextSibling=this.$$prevSibling=this.$$childHead=this.$$childTail=null;this.$root=this;this.$$destroyed=!1;this.$$listeners={};this.$$listenerCount={};this.$$watchersCount=0;this.$$isolateBindings=null}function r(a){if(p.$$phase)throw c("inprog",p.$$phase);p.$$phase=a}function s(a,b){do a.$$watchersCount+=b;while(a=a.$parent)}function A(a,b,c){do a.$$listenerCount[c]-=b,0===a.$$listenerCount[c]&&delete a.$$listenerCount[c];
while(a=a.$parent)}function q(){}function u(){for(;I.length;)try{I.shift()()}catch(a){g(a)}e=null}function t(){null===e&&(e=l.defer(function(){p.$apply(u)}))}m.prototype={constructor:m,$new:function(a,c){var d;c=c||this;a?(d=new m,d.$root=this.$root):(this.$$ChildScope||(this.$$ChildScope=b(this)),d=new this.$$ChildScope);d.$parent=c;d.$$prevSibling=c.$$childTail;c.$$childHead?(c.$$childTail.$$nextSibling=d,c.$$childTail=d):c.$$childHead=c.$$childTail=d;(a||c!=this)&&d.$on("$destroy",k);return d},
$watch:function(a,b,c,e){var f=h(a);if(f.$$watchDelegate)return f.$$watchDelegate(this,b,c,f,a);var g=this,l=g.$$watchers,k={fn:b,last:q,get:f,exp:e||a,eq:!!c};d=null;G(b)||(k.fn=w);l||(l=g.$$watchers=[]);l.unshift(k);s(this,1);return function(){0<=Ya(l,k)&&s(g,-1);d=null}},$watchGroup:function(a,b){function c(){h=!1;l?(l=!1,b(e,e,g)):b(e,d,g)}var d=Array(a.length),e=Array(a.length),f=[],g=this,h=!1,l=!0;if(!a.length){var k=!0;g.$evalAsync(function(){k&&b(e,e,g)});return function(){k=!1}}if(1===a.length)return this.$watch(a[0],
function(a,c,f){e[0]=a;d[0]=c;b(e,a===c?e:d,f)});n(a,function(a,b){var l=g.$watch(a,function(a,f){e[b]=a;d[b]=f;h||(h=!0,g.$evalAsync(c))});f.push(l)});return function(){for(;f.length;)f.shift()()}},$watchCollection:function(a,b){function c(a){e=a;var b,d,g,h;if(!v(e)){if(C(e))if(Da(e))for(f!==r&&(f=r,n=f.length=0,k++),a=e.length,n!==a&&(k++,f.length=n=a),b=0;b<a;b++)h=f[b],g=e[b],d=h!==h&&g!==g,d||h===g||(k++,f[b]=g);else{f!==s&&(f=s={},n=0,k++);a=0;for(b in e)e.hasOwnProperty(b)&&(a++,g=e[b],h=
f[b],b in f?(d=h!==h&&g!==g,d||h===g||(k++,f[b]=g)):(n++,f[b]=g,k++));if(n>a)for(b in k++,f)e.hasOwnProperty(b)||(n--,delete f[b])}else f!==e&&(f=e,k++);return k}}c.$stateful=!0;var d=this,e,f,g,l=1<b.length,k=0,m=h(a,c),r=[],s={},p=!0,n=0;return this.$watch(m,function(){p?(p=!1,b(e,e,d)):b(e,g,d);if(l)if(C(e))if(Da(e)){g=Array(e.length);for(var a=0;a<e.length;a++)g[a]=e[a]}else for(a in g={},e)kb.call(e,a)&&(g[a]=e[a]);else g=e})},$digest:function(){var b,f,h,k,m,s,n=a,A,t=[],I,v;r("$digest");l.$$checkUrlChange();
this===p&&null!==e&&(l.defer.cancel(e),u());d=null;do{s=!1;for(A=this;x.length;){try{v=x.shift(),v.scope.$eval(v.expression,v.locals)}catch(w){g(w)}d=null}a:do{if(k=A.$$watchers)for(m=k.length;m--;)try{if(b=k[m])if((f=b.get(A))!==(h=b.last)&&!(b.eq?ka(f,h):"number"===typeof f&&"number"===typeof h&&isNaN(f)&&isNaN(h)))s=!0,d=b,b.last=b.eq?ua(f,null):f,b.fn(f,h===q?f:h,A),5>n&&(I=4-n,t[I]||(t[I]=[]),t[I].push({msg:G(b.exp)?"fn: "+(b.exp.name||b.exp.toString()):b.exp,newVal:f,oldVal:h}));else if(b===
d){s=!1;break a}}catch(z){g(z)}if(!(k=A.$$watchersCount&&A.$$childHead||A!==this&&A.$$nextSibling))for(;A!==this&&!(k=A.$$nextSibling);)A=A.$parent}while(A=k);if((s||x.length)&&!n--)throw p.$$phase=null,c("infdig",a,t);}while(s||x.length);for(p.$$phase=null;y.length;)try{y.shift()()}catch(C){g(C)}},$destroy:function(){if(!this.$$destroyed){var a=this.$parent;this.$broadcast("$destroy");this.$$destroyed=!0;this===p&&l.$$applicationDestroyed();s(this,-this.$$watchersCount);for(var b in this.$$listenerCount)A(this,
this.$$listenerCount[b],b);a&&a.$$childHead==this&&(a.$$childHead=this.$$nextSibling);a&&a.$$childTail==this&&(a.$$childTail=this.$$prevSibling);this.$$prevSibling&&(this.$$prevSibling.$$nextSibling=this.$$nextSibling);this.$$nextSibling&&(this.$$nextSibling.$$prevSibling=this.$$prevSibling);this.$destroy=this.$digest=this.$apply=this.$evalAsync=this.$applyAsync=w;this.$on=this.$watch=this.$watchGroup=function(){return w};this.$$listeners={};this.$parent=this.$$nextSibling=this.$$prevSibling=this.$$childHead=
this.$$childTail=this.$root=this.$$watchers=null}},$eval:function(a,b){return h(a)(this,b)},$evalAsync:function(a,b){p.$$phase||x.length||l.defer(function(){x.length&&p.$digest()});x.push({scope:this,expression:a,locals:b})},$$postDigest:function(a){y.push(a)},$apply:function(a){try{return r("$apply"),this.$eval(a)}catch(b){g(b)}finally{p.$$phase=null;try{p.$digest()}catch(c){throw g(c),c;}}},$applyAsync:function(a){function b(){c.$eval(a)}var c=this;a&&I.push(b);t()},$on:function(a,b){var c=this.$$listeners[a];
c||(this.$$listeners[a]=c=[]);c.push(b);var d=this;do d.$$listenerCount[a]||(d.$$listenerCount[a]=0),d.$$listenerCount[a]++;while(d=d.$parent);var e=this;return function(){var d=c.indexOf(b);-1!==d&&(c[d]=null,A(e,1,a))}},$emit:function(a,b){var c=[],d,e=this,f=!1,h={name:a,targetScope:e,stopPropagation:function(){f=!0},preventDefault:function(){h.defaultPrevented=!0},defaultPrevented:!1},l=Za([h],arguments,1),k,m;do{d=e.$$listeners[a]||c;h.currentScope=e;k=0;for(m=d.length;k<m;k++)if(d[k])try{d[k].apply(null,
l)}catch(r){g(r)}else d.splice(k,1),k--,m--;if(f)return h.currentScope=null,h;e=e.$parent}while(e);h.currentScope=null;return h},$broadcast:function(a,b){var c=this,d=this,e={name:a,targetScope:this,preventDefault:function(){e.defaultPrevented=!0},defaultPrevented:!1};if(!this.$$listenerCount[a])return e;for(var f=Za([e],arguments,1),h,l;c=d;){e.currentScope=c;d=c.$$listeners[a]||[];h=0;for(l=d.length;h<l;h++)if(d[h])try{d[h].apply(null,f)}catch(k){g(k)}else d.splice(h,1),h--,l--;if(!(d=c.$$listenerCount[a]&&
c.$$childHead||c!==this&&c.$$nextSibling))for(;c!==this&&!(d=c.$$nextSibling);)c=c.$parent}e.currentScope=null;return e}};var p=new m,x=p.$$asyncQueue=[],y=p.$$postDigestQueue=[],I=p.$$applyAsyncQueue=[];return p}]}function ge(){var b=/^\s*(https?|ftp|mailto|tel|file):/,a=/^\s*((https?|ftp|file|blob):|data:image\/)/;this.aHrefSanitizationWhitelist=function(a){return y(a)?(b=a,this):b};this.imgSrcSanitizationWhitelist=function(b){return y(b)?(a=b,this):a};this.$get=function(){return function(c,d){var e=
d?a:b,f;f=Aa(c).href;return""===f||f.match(e)?c:"unsafe:"+f}}}function Yf(b){if("self"===b)return b;if(L(b)){if(-1<b.indexOf("***"))throw Ca("iwcard",b);b=td(b).replace("\\*\\*",".*").replace("\\*","[^:/.?&;]*");return new RegExp("^"+b+"$")}if(Va(b))return new RegExp("^"+b.source+"$");throw Ca("imatcher");}function ud(b){var a=[];y(b)&&n(b,function(b){a.push(Yf(b))});return a}function mf(){this.SCE_CONTEXTS=oa;var b=["self"],a=[];this.resourceUrlWhitelist=function(a){arguments.length&&(b=ud(a));return b};
this.resourceUrlBlacklist=function(b){arguments.length&&(a=ud(b));return a};this.$get=["$injector",function(c){function d(a,b){return"self"===a?fd(b):!!a.exec(b.href)}function e(a){var b=function(a){this.$$unwrapTrustedValue=function(){return a}};a&&(b.prototype=new a);b.prototype.valueOf=function(){return this.$$unwrapTrustedValue()};b.prototype.toString=function(){return this.$$unwrapTrustedValue().toString()};return b}var f=function(a){throw Ca("unsafe");};c.has("$sanitize")&&(f=c.get("$sanitize"));
var g=e(),h={};h[oa.HTML]=e(g);h[oa.CSS]=e(g);h[oa.URL]=e(g);h[oa.JS]=e(g);h[oa.RESOURCE_URL]=e(h[oa.URL]);return{trustAs:function(a,b){var c=h.hasOwnProperty(a)?h[a]:null;if(!c)throw Ca("icontext",a,b);if(null===b||b===u||""===b)return b;if("string"!==typeof b)throw Ca("itype",a);return new c(b)},getTrusted:function(c,e){if(null===e||e===u||""===e)return e;var g=h.hasOwnProperty(c)?h[c]:null;if(g&&e instanceof g)return e.$$unwrapTrustedValue();if(c===oa.RESOURCE_URL){var g=Aa(e.toString()),r,s,n=
!1;r=0;for(s=b.length;r<s;r++)if(d(b[r],g)){n=!0;break}if(n)for(r=0,s=a.length;r<s;r++)if(d(a[r],g)){n=!1;break}if(n)return e;throw Ca("insecurl",e.toString());}if(c===oa.HTML)return f(e);throw Ca("unsafe");},valueOf:function(a){return a instanceof g?a.$$unwrapTrustedValue():a}}}]}function lf(){var b=!0;this.enabled=function(a){arguments.length&&(b=!!a);return b};this.$get=["$parse","$sceDelegate",function(a,c){if(b&&8>gb)throw Ca("iequirks");var d=fa(oa);d.isEnabled=function(){return b};d.trustAs=
c.trustAs;d.getTrusted=c.getTrusted;d.valueOf=c.valueOf;b||(d.trustAs=d.getTrusted=function(a,b){return b},d.valueOf=Ua);d.parseAs=function(b,c){var e=a(c);return e.literal&&e.constant?e:a(c,function(a){return d.getTrusted(b,a)})};var e=d.parseAs,f=d.getTrusted,g=d.trustAs;n(oa,function(a,b){var c=E(b);d[eb("parse_as_"+c)]=function(b){return e(a,b)};d[eb("get_trusted_"+c)]=function(b){return f(a,b)};d[eb("trust_as_"+c)]=function(b){return g(a,b)}});return d}]}function nf(){this.$get=["$window","$document",
function(b,a){var c={},d=Y((/android (\d+)/.exec(E((b.navigator||{}).userAgent))||[])[1]),e=/Boxee/i.test((b.navigator||{}).userAgent),f=a[0]||{},g,h=/^(Moz|webkit|ms)(?=[A-Z])/,l=f.body&&f.body.style,k=!1,m=!1;if(l){for(var r in l)if(k=h.exec(r)){g=k[0];g=g.substr(0,1).toUpperCase()+g.substr(1);break}g||(g="WebkitOpacity"in l&&"webkit");k=!!("transition"in l||g+"Transition"in l);m=!!("animation"in l||g+"Animation"in l);!d||k&&m||(k=L(l.webkitTransition),m=L(l.webkitAnimation))}return{history:!(!b.history||
!b.history.pushState||4>d||e),hasEvent:function(a){if("input"===a&&11>=gb)return!1;if(v(c[a])){var b=f.createElement("div");c[a]="on"+a in b}return c[a]},csp:cb(),vendorPrefix:g,transitions:k,animations:m,android:d}}]}function pf(){this.$get=["$templateCache","$http","$q",function(b,a,c){function d(e,f){d.totalPendingRequests++;var g=a.defaults&&a.defaults.transformResponse;K(g)?g=g.filter(function(a){return a!==$b}):g===$b&&(g=null);return a.get(e,{cache:b,transformResponse:g})["finally"](function(){d.totalPendingRequests--}).then(function(a){b.put(e,
a.data);return a.data},function(a){if(!f)throw ea("tpload",e,a.status,a.statusText);return c.reject(a)})}d.totalPendingRequests=0;return d}]}function qf(){this.$get=["$rootScope","$browser","$location",function(b,a,c){return{findBindings:function(a,b,c){a=a.getElementsByClassName("ng-binding");var g=[];n(a,function(a){var d=aa.element(a).data("$binding");d&&n(d,function(d){c?(new RegExp("(^|\\s)"+td(b)+"(\\s|\\||$)")).test(d)&&g.push(a):-1!=d.indexOf(b)&&g.push(a)})});return g},findModels:function(a,
b,c){for(var g=["ng-","data-ng-","ng\\:"],h=0;h<g.length;++h){var l=a.querySelectorAll("["+g[h]+"model"+(c?"=":"*=")+'"'+b+'"]');if(l.length)return l}},getLocation:function(){return c.url()},setLocation:function(a){a!==c.url()&&(c.url(a),b.$digest())},whenStable:function(b){a.notifyWhenNoOutstandingRequests(b)}}}]}function rf(){this.$get=["$rootScope","$browser","$q","$$q","$exceptionHandler",function(b,a,c,d,e){function f(f,l,k){G(f)||(k=l,l=f,f=w);var m=ra.call(arguments,3),r=y(k)&&!k,s=(r?d:c).defer(),
n=s.promise,q;q=a.defer(function(){try{s.resolve(f.apply(null,m))}catch(a){s.reject(a),e(a)}finally{delete g[n.$$timeoutId]}r||b.$apply()},l);n.$$timeoutId=q;g[q]=s;return n}var g={};f.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 f}]}function Aa(b){gb&&(Z.setAttribute("href",b),b=Z.href);Z.setAttribute("href",b);return{href:Z.href,protocol:Z.protocol?Z.protocol.replace(/:$/,""):"",host:Z.host,
search:Z.search?Z.search.replace(/^\?/,""):"",hash:Z.hash?Z.hash.replace(/^#/,""):"",hostname:Z.hostname,port:Z.port,pathname:"/"===Z.pathname.charAt(0)?Z.pathname:"/"+Z.pathname}}function fd(b){b=L(b)?Aa(b):b;return b.protocol===vd.protocol&&b.host===vd.host}function sf(){this.$get=qa(N)}function wd(b){function a(a){try{return decodeURIComponent(a)}catch(b){return a}}var c=b[0]||{},d={},e="";return function(){var b,g,h,l,k;b=c.cookie||"";if(b!==e)for(e=b,b=e.split("; "),d={},h=0;h<b.length;h++)g=
b[h],l=g.indexOf("="),0<l&&(k=a(g.substring(0,l)),d[k]===u&&(d[k]=a(g.substring(l+1))));return d}}function xf(){this.$get=wd}function Kc(b){function a(c,d){if(C(c)){var e={};n(c,function(b,c){e[c]=a(c,b)});return e}return b.factory(c+"Filter",d)}this.register=a;this.$get=["$injector",function(a){return function(b){return a.get(b+"Filter")}}];a("currency",xd);a("date",yd);a("filter",Zf);a("json",$f);a("limitTo",ag);a("lowercase",bg);a("number",zd);a("orderBy",Ad);a("uppercase",cg)}function Zf(){return function(b,
a,c){if(!Da(b)){if(null==b)return b;throw F("filter")("notarray",b);}var d;switch(ic(a)){case "function":break;case "boolean":case "null":case "number":case "string":d=!0;case "object":a=dg(a,c,d);break;default:return b}return Array.prototype.filter.call(b,a)}}function dg(b,a,c){var d=C(b)&&"$"in b;!0===a?a=ka:G(a)||(a=function(a,b){if(v(a))return!1;if(null===a||null===b)return a===b;var c;!(c=C(b))&&(c=C(a))&&(c=a,c=!(G(c.toString)&&c.toString!==Object.prototype.toString));if(c)return!1;a=E(""+a);
b=E(""+b);return-1!==a.indexOf(b)});return function(e){return d&&!C(e)?La(e,b.$,a,!1):La(e,b,a,c)}}function La(b,a,c,d,e){var f=ic(b),g=ic(a);if("string"===g&&"!"===a.charAt(0))return!La(b,a.substring(1),c,d);if(K(b))return b.some(function(b){return La(b,a,c,d)});switch(f){case "object":var h;if(d){for(h in b)if("$"!==h.charAt(0)&&La(b[h],a,c,!0))return!0;return e?!1:La(b,a,c,!1)}if("object"===g){for(h in a)if(e=a[h],!G(e)&&!v(e)&&(f="$"===h,!La(f?b:b[h],e,c,f,f)))return!1;return!0}return c(b,a);
case "function":return!1;default:return c(b,a)}}function ic(b){return null===b?"null":typeof b}function xd(b){var a=b.NUMBER_FORMATS;return function(b,d,e){v(d)&&(d=a.CURRENCY_SYM);v(e)&&(e=a.PATTERNS[1].maxFrac);return null==b?b:Bd(b,a.PATTERNS[1],a.GROUP_SEP,a.DECIMAL_SEP,e).replace(/\u00A4/g,d)}}function zd(b){var a=b.NUMBER_FORMATS;return function(b,d){return null==b?b:Bd(b,a.PATTERNS[0],a.GROUP_SEP,a.DECIMAL_SEP,d)}}function Bd(b,a,c,d,e){if(C(b))return"";var f=0>b;b=Math.abs(b);var g=Infinity===
b;if(!g&&!isFinite(b))return"";var h=b+"",l="",k=!1,m=[];g&&(l="\u221e");if(!g&&-1!==h.indexOf("e")){var r=h.match(/([\d\.]+)e(-?)(\d+)/);r&&"-"==r[2]&&r[3]>e+1?b=0:(l=h,k=!0)}if(g||k)0<e&&1>b&&(l=b.toFixed(e),b=parseFloat(l));else{g=(h.split(Cd)[1]||"").length;v(e)&&(e=Math.min(Math.max(a.minFrac,g),a.maxFrac));b=+(Math.round(+(b.toString()+"e"+e)).toString()+"e"+-e);var g=(""+b).split(Cd),h=g[0],g=g[1]||"",r=0,s=a.lgSize,n=a.gSize;if(h.length>=s+n)for(r=h.length-s,k=0;k<r;k++)0===(r-k)%n&&0!==k&&
(l+=c),l+=h.charAt(k);for(k=r;k<h.length;k++)0===(h.length-k)%s&&0!==k&&(l+=c),l+=h.charAt(k);for(;g.length<e;)g+="0";e&&"0"!==e&&(l+=d+g.substr(0,e))}0===b&&(f=!1);m.push(f?a.negPre:a.posPre,l,f?a.negSuf:a.posSuf);return m.join("")}function Gb(b,a,c){var d="";0>b&&(d="-",b=-b);for(b=""+b;b.length<a;)b="0"+b;c&&(b=b.substr(b.length-a));return d+b}function $(b,a,c,d){c=c||0;return function(e){e=e["get"+b]();if(0<c||e>-c)e+=c;0===e&&-12==c&&(e=12);return Gb(e,a,d)}}function Hb(b,a){return function(c,
d){var e=c["get"+b](),f=pb(a?"SHORT"+b:b);return d[f][e]}}function Dd(b){var a=(new Date(b,0,1)).getDay();return new Date(b,0,(4>=a?5:12)-a)}function Ed(b){return function(a){var c=Dd(a.getFullYear());a=+new Date(a.getFullYear(),a.getMonth(),a.getDate()+(4-a.getDay()))-+c;a=1+Math.round(a/6048E5);return Gb(a,b)}}function jc(b,a){return 0>=b.getFullYear()?a.ERAS[0]:a.ERAS[1]}function yd(b){function a(a){var b;if(b=a.match(c)){a=new Date(0);var f=0,g=0,h=b[8]?a.setUTCFullYear:a.setFullYear,l=b[8]?a.setUTCHours:
a.setHours;b[9]&&(f=Y(b[9]+b[10]),g=Y(b[9]+b[11]));h.call(a,Y(b[1]),Y(b[2])-1,Y(b[3]));f=Y(b[4]||0)-f;g=Y(b[5]||0)-g;h=Y(b[6]||0);b=Math.round(1E3*parseFloat("0."+(b[7]||0)));l.call(a,f,g,h,b)}return a}var c=/^(\d{4})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;return function(c,e,f){var g="",h=[],l,k;e=e||"mediumDate";e=b.DATETIME_FORMATS[e]||e;L(c)&&(c=eg.test(c)?Y(c):a(c));V(c)&&(c=new Date(c));if(!da(c)||!isFinite(c.getTime()))return c;for(;e;)(k=
fg.exec(e))?(h=Za(h,k,1),e=h.pop()):(h.push(e),e=null);var m=c.getTimezoneOffset();f&&(m=wc(f,c.getTimezoneOffset()),c=Pb(c,f,!0));n(h,function(a){l=gg[a];g+=l?l(c,b.DATETIME_FORMATS,m):a.replace(/(^'|'$)/g,"").replace(/''/g,"'")});return g}}function $f(){return function(b,a){v(a)&&(a=2);return $a(b,a)}}function ag(){return function(b,a,c){a=Infinity===Math.abs(Number(a))?Number(a):Y(a);if(isNaN(a))return b;V(b)&&(b=b.toString());if(!K(b)&&!L(b))return b;c=!c||isNaN(c)?0:Y(c);c=0>c&&c>=-b.length?
b.length+c:c;return 0<=a?b.slice(c,c+a):0===c?b.slice(a,b.length):b.slice(Math.max(0,c+a),c)}}function Ad(b){return function(a,c,d){function e(a,b){return b?function(b,c){return a(c,b)}:a}function f(a){switch(typeof a){case "number":case "boolean":case "string":return!0;default:return!1}}function g(a){return null===a?"null":"function"===typeof a.valueOf&&(a=a.valueOf(),f(a))||"function"===typeof a.toString&&(a=a.toString(),f(a))?a:""}function h(a,b){var c=typeof a,d=typeof b;c===d&&"object"===c&&
(a=g(a),b=g(b));return c===d?("string"===c&&(a=a.toLowerCase(),b=b.toLowerCase()),a===b?0:a<b?-1:1):c<d?-1:1}if(!Da(a))return a;c=K(c)?c:[c];0===c.length&&(c=["+"]);c=c.map(function(a){var c=!1,d=a||Ua;if(L(a)){if("+"==a.charAt(0)||"-"==a.charAt(0))c="-"==a.charAt(0),a=a.substring(1);if(""===a)return e(h,c);d=b(a);if(d.constant){var f=d();return e(function(a,b){return h(a[f],b[f])},c)}}return e(function(a,b){return h(d(a),d(b))},c)});return ra.call(a).sort(e(function(a,b){for(var d=0;d<c.length;d++){var e=
c[d](a,b);if(0!==e)return e}return 0},d))}}function Ma(b){G(b)&&(b={link:b});b.restrict=b.restrict||"AC";return qa(b)}function Fd(b,a,c,d,e){var f=this,g=[],h=f.$$parentForm=b.parent().controller("form")||Ib;f.$error={};f.$$success={};f.$pending=u;f.$name=e(a.name||a.ngForm||"")(c);f.$dirty=!1;f.$pristine=!0;f.$valid=!0;f.$invalid=!1;f.$submitted=!1;h.$addControl(f);f.$rollbackViewValue=function(){n(g,function(a){a.$rollbackViewValue()})};f.$commitViewValue=function(){n(g,function(a){a.$commitViewValue()})};
f.$addControl=function(a){Qa(a.$name,"input");g.push(a);a.$name&&(f[a.$name]=a)};f.$$renameControl=function(a,b){var c=a.$name;f[c]===a&&delete f[c];f[b]=a;a.$name=b};f.$removeControl=function(a){a.$name&&f[a.$name]===a&&delete f[a.$name];n(f.$pending,function(b,c){f.$setValidity(c,null,a)});n(f.$error,function(b,c){f.$setValidity(c,null,a)});n(f.$$success,function(b,c){f.$setValidity(c,null,a)});Ya(g,a)};Gd({ctrl:this,$element:b,set:function(a,b,c){var d=a[b];d?-1===d.indexOf(c)&&d.push(c):a[b]=
[c]},unset:function(a,b,c){var d=a[b];d&&(Ya(d,c),0===d.length&&delete a[b])},parentForm:h,$animate:d});f.$setDirty=function(){d.removeClass(b,Sa);d.addClass(b,Jb);f.$dirty=!0;f.$pristine=!1;h.$setDirty()};f.$setPristine=function(){d.setClass(b,Sa,Jb+" ng-submitted");f.$dirty=!1;f.$pristine=!0;f.$submitted=!1;n(g,function(a){a.$setPristine()})};f.$setUntouched=function(){n(g,function(a){a.$setUntouched()})};f.$setSubmitted=function(){d.addClass(b,"ng-submitted");f.$submitted=!0;h.$setSubmitted()}}
function kc(b){b.$formatters.push(function(a){return b.$isEmpty(a)?a:a.toString()})}function hb(b,a,c,d,e,f){var g=E(a[0].type);if(!e.android){var h=!1;a.on("compositionstart",function(a){h=!0});a.on("compositionend",function(){h=!1;l()})}var l=function(b){k&&(f.defer.cancel(k),k=null);if(!h){var e=a.val();b=b&&b.type;"password"===g||c.ngTrim&&"false"===c.ngTrim||(e=T(e));(d.$viewValue!==e||""===e&&d.$$hasNativeValidators)&&d.$setViewValue(e,b)}};if(e.hasEvent("input"))a.on("input",l);else{var k,
m=function(a,b,c){k||(k=f.defer(function(){k=null;b&&b.value===c||l(a)}))};a.on("keydown",function(a){var b=a.keyCode;91===b||15<b&&19>b||37<=b&&40>=b||m(a,this,this.value)});if(e.hasEvent("paste"))a.on("paste cut",m)}a.on("change",l);d.$render=function(){a.val(d.$isEmpty(d.$viewValue)?"":d.$viewValue)}}function Kb(b,a){return function(c,d){var e,f;if(da(c))return c;if(L(c)){'"'==c.charAt(0)&&'"'==c.charAt(c.length-1)&&(c=c.substring(1,c.length-1));if(hg.test(c))return new Date(c);b.lastIndex=0;if(e=
b.exec(c))return e.shift(),f=d?{yyyy:d.getFullYear(),MM:d.getMonth()+1,dd:d.getDate(),HH:d.getHours(),mm:d.getMinutes(),ss:d.getSeconds(),sss:d.getMilliseconds()/1E3}:{yyyy:1970,MM:1,dd:1,HH:0,mm:0,ss:0,sss:0},n(e,function(b,c){c<a.length&&(f[a[c]]=+b)}),new Date(f.yyyy,f.MM-1,f.dd,f.HH,f.mm,f.ss||0,1E3*f.sss||0)}return NaN}}function ib(b,a,c,d){return function(e,f,g,h,l,k,m){function r(a){return a&&!(a.getTime&&a.getTime()!==a.getTime())}function s(a){return y(a)?da(a)?a:c(a):u}Hd(e,f,g,h);hb(e,
f,g,h,l,k);var n=h&&h.$options&&h.$options.timezone,q;h.$$parserName=b;h.$parsers.push(function(b){return h.$isEmpty(b)?null:a.test(b)?(b=c(b,q),n&&(b=Pb(b,n)),b):u});h.$formatters.push(function(a){if(a&&!da(a))throw Lb("datefmt",a);if(r(a))return(q=a)&&n&&(q=Pb(q,n,!0)),m("date")(a,d,n);q=null;return""});if(y(g.min)||g.ngMin){var M;h.$validators.min=function(a){return!r(a)||v(M)||c(a)>=M};g.$observe("min",function(a){M=s(a);h.$validate()})}if(y(g.max)||g.ngMax){var t;h.$validators.max=function(a){return!r(a)||
v(t)||c(a)<=t};g.$observe("max",function(a){t=s(a);h.$validate()})}}}function Hd(b,a,c,d){(d.$$hasNativeValidators=C(a[0].validity))&&d.$parsers.push(function(b){var c=a.prop("validity")||{};return c.badInput&&!c.typeMismatch?u:b})}function Id(b,a,c,d,e){if(y(d)){b=b(d);if(!b.constant)throw F("ngModel")("constexpr",c,d);return b(a)}return e}function lc(b,a){b="ngClass"+b;return["$animate",function(c){function d(a,b){var c=[],d=0;a:for(;d<a.length;d++){for(var e=a[d],m=0;m<b.length;m++)if(e==b[m])continue a;
c.push(e)}return c}function e(a){var b=[];return K(a)?(n(a,function(a){b=b.concat(e(a))}),b):L(a)?a.split(" "):C(a)?(n(a,function(a,c){a&&(b=b.concat(c.split(" ")))}),b):a}return{restrict:"AC",link:function(f,g,h){function l(a,b){var c=g.data("$classCounts")||ga(),d=[];n(a,function(a){if(0<b||c[a])c[a]=(c[a]||0)+b,c[a]===+(0<b)&&d.push(a)});g.data("$classCounts",c);return d.join(" ")}function k(b){if(!0===a||f.$index%2===a){var k=e(b||[]);if(!m){var n=l(k,1);h.$addClass(n)}else if(!ka(b,m)){var q=
e(m),n=d(k,q),k=d(q,k),n=l(n,1),k=l(k,-1);n&&n.length&&c.addClass(g,n);k&&k.length&&c.removeClass(g,k)}}m=fa(b)}var m;f.$watch(h[b],k,!0);h.$observe("class",function(a){k(f.$eval(h[b]))});"ngClass"!==b&&f.$watch("$index",function(c,d){var g=c&1;if(g!==(d&1)){var k=e(f.$eval(h[b]));g===a?(g=l(k,1),h.$addClass(g)):(g=l(k,-1),h.$removeClass(g))}})}}}]}function Gd(b){function a(a,b){b&&!f[a]?(k.addClass(e,a),f[a]=!0):!b&&f[a]&&(k.removeClass(e,a),f[a]=!1)}function c(b,c){b=b?"-"+Ac(b,"-"):"";a(jb+b,!0===
c);a(Jd+b,!1===c)}var d=b.ctrl,e=b.$element,f={},g=b.set,h=b.unset,l=b.parentForm,k=b.$animate;f[Jd]=!(f[jb]=e.hasClass(jb));d.$setValidity=function(b,e,f){e===u?(d.$pending||(d.$pending={}),g(d.$pending,b,f)):(d.$pending&&h(d.$pending,b,f),Kd(d.$pending)&&(d.$pending=u));Xa(e)?e?(h(d.$error,b,f),g(d.$$success,b,f)):(g(d.$error,b,f),h(d.$$success,b,f)):(h(d.$error,b,f),h(d.$$success,b,f));d.$pending?(a(Ld,!0),d.$valid=d.$invalid=u,c("",null)):(a(Ld,!1),d.$valid=Kd(d.$error),d.$invalid=!d.$valid,c("",
d.$valid));e=d.$pending&&d.$pending[b]?u:d.$error[b]?!1:d.$$success[b]?!0:null;c(b,e);l.$setValidity(b,e,d)}}function Kd(b){if(b)for(var a in b)return!1;return!0}var ig=/^\/(.+)\/([a-z]*)$/,E=function(b){return L(b)?b.toLowerCase():b},kb=Object.prototype.hasOwnProperty,pb=function(b){return L(b)?b.toUpperCase():b},gb,z,la,ra=[].slice,Lf=[].splice,jg=[].push,sa=Object.prototype.toString,rc=Object.getPrototypeOf,Ea=F("ng"),aa=N.angular||(N.angular={}),db,lb=0;gb=W.documentMode;w.$inject=[];Ua.$inject=
[];var K=Array.isArray,tc=/^\[object (Uint8(Clamped)?)|(Uint16)|(Uint32)|(Int8)|(Int16)|(Int32)|(Float(32)|(64))Array\]$/,T=function(b){return L(b)?b.trim():b},td=function(b){return b.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1").replace(/\x08/g,"\\x08")},cb=function(){if(y(cb.isActive_))return cb.isActive_;var b=!(!W.querySelector("[ng-csp]")&&!W.querySelector("[data-ng-csp]"));if(!b)try{new Function("")}catch(a){b=!0}return cb.isActive_=b},nb=function(){if(y(nb.name_))return nb.name_;var b,a,
c=Na.length,d,e;for(a=0;a<c;++a)if(d=Na[a],b=W.querySelector("["+d.replace(":","\\:")+"jq]")){e=b.getAttribute(d+"jq");break}return nb.name_=e},Na=["ng-","data-ng-","ng:","x-ng-"],ae=/[A-Z]/g,Bc=!1,Rb,pa=1,ab=3,ee={full:"1.4.0",major:1,minor:4,dot:0,codeName:"jaracimrman-existence"};R.expando="ng339";var ub=R.cache={},Df=1;R._data=function(b){return this.cache[b[this.expando]]||{}};var yf=/([\:\-\_]+(.))/g,zf=/^moz([A-Z])/,kg={mouseleave:"mouseout",mouseenter:"mouseover"},Ub=F("jqLite"),Cf=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,
Tb=/<|&#?\w+;/,Af=/<([\w:]+)/,Bf=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,ma={option:[1,'<select multiple="multiple">',"</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ma.optgroup=ma.option;ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead;ma.th=ma.td;var Oa=R.prototype={ready:function(b){function a(){c||(c=
!0,b())}var c=!1;"complete"===W.readyState?setTimeout(a):(this.on("DOMContentLoaded",a),R(N).on("load",a))},toString:function(){var b=[];n(this,function(a){b.push(""+a)});return"["+b.join(", ")+"]"},eq:function(b){return 0<=b?z(this[b]):z(this[this.length+b])},length:0,push:jg,sort:[].sort,splice:[].splice},zb={};n("multiple selected checked disabled readOnly required open".split(" "),function(b){zb[E(b)]=b});var Sc={};n("input select option textarea button form details".split(" "),function(b){Sc[b]=
!0});var Tc={ngMinlength:"minlength",ngMaxlength:"maxlength",ngMin:"min",ngMax:"max",ngPattern:"pattern"};n({data:Wb,removeData:sb},function(b,a){R[a]=b});n({data:Wb,inheritedData:yb,scope:function(b){return z.data(b,"$scope")||yb(b.parentNode||b,["$isolateScope","$scope"])},isolateScope:function(b){return z.data(b,"$isolateScope")||z.data(b,"$isolateScopeNoTemplate")},controller:Pc,injector:function(b){return yb(b,"$injector")},removeAttr:function(b,a){b.removeAttribute(a)},hasClass:vb,css:function(b,
a,c){a=eb(a);if(y(c))b.style[a]=c;else return b.style[a]},attr:function(b,a,c){var d=b.nodeType;if(d!==ab&&2!==d&&8!==d)if(d=E(a),zb[d])if(y(c))c?(b[a]=!0,b.setAttribute(a,d)):(b[a]=!1,b.removeAttribute(d));else return b[a]||(b.attributes.getNamedItem(a)||w).specified?d:u;else if(y(c))b.setAttribute(a,c);else if(b.getAttribute)return b=b.getAttribute(a,2),null===b?u:b},prop:function(b,a,c){if(y(c))b[a]=c;else return b[a]},text:function(){function b(a,b){if(v(b)){var d=a.nodeType;return d===pa||d===
ab?a.textContent:""}a.textContent=b}b.$dv="";return b}(),val:function(b,a){if(v(a)){if(b.multiple&&"select"===ta(b)){var c=[];n(b.options,function(a){a.selected&&c.push(a.value||a.text)});return 0===c.length?null:c}return b.value}b.value=a},html:function(b,a){if(v(a))return b.innerHTML;rb(b,!0);b.innerHTML=a},empty:Qc},function(b,a){R.prototype[a]=function(a,d){var e,f,g=this.length;if(b!==Qc&&(2==b.length&&b!==vb&&b!==Pc?a:d)===u){if(C(a)){for(e=0;e<g;e++)if(b===Wb)b(this[e],a);else for(f in a)b(this[e],
f,a[f]);return this}e=b.$dv;g=e===u?Math.min(g,1):g;for(f=0;f<g;f++){var h=b(this[f],a,d);e=e?e+h:h}return e}for(e=0;e<g;e++)b(this[e],a,d);return this}});n({removeData:sb,on:function a(c,d,e,f){if(y(f))throw Ub("onargs");if(Lc(c)){var g=tb(c,!0);f=g.events;var h=g.handle;h||(h=g.handle=Gf(c,f));for(var g=0<=d.indexOf(" ")?d.split(" "):[d],l=g.length;l--;){d=g[l];var k=f[d];k||(f[d]=[],"mouseenter"===d||"mouseleave"===d?a(c,kg[d],function(a){var c=a.relatedTarget;c&&(c===this||this.contains(c))||
h(a,d)}):"$destroy"!==d&&c.addEventListener(d,h,!1),k=f[d]);k.push(e)}}},off:Oc,one:function(a,c,d){a=z(a);a.on(c,function f(){a.off(c,d);a.off(c,f)});a.on(c,d)},replaceWith:function(a,c){var d,e=a.parentNode;rb(a);n(new R(c),function(c){d?e.insertBefore(c,d.nextSibling):e.replaceChild(c,a);d=c})},children:function(a){var c=[];n(a.childNodes,function(a){a.nodeType===pa&&c.push(a)});return c},contents:function(a){return a.contentDocument||a.childNodes||[]},append:function(a,c){var d=a.nodeType;if(d===
pa||11===d){c=new R(c);for(var d=0,e=c.length;d<e;d++)a.appendChild(c[d])}},prepend:function(a,c){if(a.nodeType===pa){var d=a.firstChild;n(new R(c),function(c){a.insertBefore(c,d)})}},wrap:function(a,c){c=z(c).eq(0).clone()[0];var d=a.parentNode;d&&d.replaceChild(c,a);c.appendChild(a)},remove:Xb,detach:function(a){Xb(a,!0)},after:function(a,c){var d=a,e=a.parentNode;c=new R(c);for(var f=0,g=c.length;f<g;f++){var h=c[f];e.insertBefore(h,d.nextSibling);d=h}},addClass:xb,removeClass:wb,toggleClass:function(a,
c,d){c&&n(c.split(" "),function(c){var f=d;v(f)&&(f=!vb(a,c));(f?xb:wb)(a,c)})},parent:function(a){return(a=a.parentNode)&&11!==a.nodeType?a:null},next:function(a){return a.nextElementSibling},find:function(a,c){return a.getElementsByTagName?a.getElementsByTagName(c):[]},clone:Vb,triggerHandler:function(a,c,d){var e,f,g=c.type||c,h=tb(a);if(h=(h=h&&h.events)&&h[g])e={preventDefault:function(){this.defaultPrevented=!0},isDefaultPrevented:function(){return!0===this.defaultPrevented},stopImmediatePropagation:function(){this.immediatePropagationStopped=
!0},isImmediatePropagationStopped:function(){return!0===this.immediatePropagationStopped},stopPropagation:w,type:g,target:a},c.type&&(e=Q(e,c)),c=fa(h),f=d?[e].concat(d):[e],n(c,function(c){e.isImmediatePropagationStopped()||c.apply(a,f)})}},function(a,c){R.prototype[c]=function(c,e,f){for(var g,h=0,l=this.length;h<l;h++)v(g)?(g=a(this[h],c,e,f),y(g)&&(g=z(g))):Nc(g,a(this[h],c,e,f));return y(g)?g:this};R.prototype.bind=R.prototype.on;R.prototype.unbind=R.prototype.off});Ra.prototype={put:function(a,
c){this[Fa(a,this.nextUid)]=c},get:function(a){return this[Fa(a,this.nextUid)]},remove:function(a){var c=this[a=Fa(a,this.nextUid)];delete this[a];return c}};var wf=[function(){this.$get=[function(){return Ra}]}],Vc=/^function\s*[^\(]*\(\s*([^\)]*)\)/m,lg=/,/,mg=/^\s*(_?)(\S+?)\1\s*$/,Uc=/((\/\/.*$)|(\/\*[\s\S]*?\*\/))/mg,Ga=F("$injector");bb.$$annotate=function(a,c,d){var e;if("function"===typeof a){if(!(e=a.$inject)){e=[];if(a.length){if(c)throw L(d)&&d||(d=a.name||Hf(a)),Ga("strictdi",d);c=a.toString().replace(Uc,
"");c=c.match(Vc);n(c[1].split(lg),function(a){a.replace(mg,function(a,c,d){e.push(d)})})}a.$inject=e}}else K(a)?(c=a.length-1,Pa(a[c],"fn"),e=a.slice(0,c)):Pa(a,"fn",!0);return e};var Md=F("$animate"),Te=function(){this.$get=["$q","$$rAF",function(a,c){function d(){}d.all=w;d.chain=w;d.prototype={end:w,cancel:w,resume:w,pause:w,complete:w,then:function(d,f){return a(function(a){c(function(){a()})}).then(d,f)}};return d}]},Se=function(){var a=new Ra,c=[];this.$get=["$$AnimateRunner","$rootScope",
function(d,e){function f(d,f,l){var k=a.get(d);k||(a.put(d,k={}),c.push(d));f&&n(f.split(" "),function(a){a&&(k[a]=!0)});l&&n(l.split(" "),function(a){a&&(k[a]=!1)});1<c.length||e.$$postDigest(function(){n(c,function(c){var d=a.get(c);if(d){var e=If(c.attr("class")),f="",g="";n(d,function(a,c){a!==!!e[c]&&(a?f+=(f.length?" ":"")+c:g+=(g.length?" ":"")+c)});n(c,function(a){f&&xb(a,f);g&&wb(a,g)});a.remove(c)}});c.length=0})}return{enabled:w,on:w,off:w,pin:w,push:function(a,c,e,k){k&&k();e=e||{};e.from&&
a.css(e.from);e.to&&a.css(e.to);(e.addClass||e.removeClass)&&f(a,e.addClass,e.removeClass);return new d}}}]},Re=["$provide",function(a){var c=this;this.$$registeredAnimations=Object.create(null);this.register=function(d,e){if(d&&"."!==d.charAt(0))throw Md("notcsel",d);var f=d+"-animation";c.$$registeredAnimations[d.substr(1)]=f;a.factory(f,e)};this.classNameFilter=function(a){if(1===arguments.length&&(this.$$classNameFilter=a instanceof RegExp?a:null)&&/(\s+|\/)ng-animate(\s+|\/)/.test(this.$$classNameFilter.toString()))throw Md("nongcls",
"ng-animate");return this.$$classNameFilter};this.$get=["$$animateQueue",function(a){function c(a,d,e){if(e){var l;a:{for(l=0;l<e.length;l++){var k=e[l];if(1===k.nodeType){l=k;break a}}l=void 0}!l||l.parentNode||l.previousElementSibling||(e=null)}e?e.after(a):d.prepend(a)}return{on:a.on,off:a.off,pin:a.pin,enabled:a.enabled,cancel:function(a){a.end&&a.end()},enter:function(f,g,h,l){g=g&&z(g);h=h&&z(h);g=g||h.parent();c(f,g,h);return a.push(f,"enter",Ha(l))},move:function(f,g,h,l){g=g&&z(g);h=h&&z(h);
g=g||h.parent();c(f,g,h);return a.push(f,"move",Ha(l))},leave:function(c,e){return a.push(c,"leave",Ha(e),function(){c.remove()})},addClass:function(c,e,h){h=Ha(h);h.addClass=fb(h.addclass,e);return a.push(c,"addClass",h)},removeClass:function(c,e,h){h=Ha(h);h.removeClass=fb(h.removeClass,e);return a.push(c,"removeClass",h)},setClass:function(c,e,h,l){l=Ha(l);l.addClass=fb(l.addClass,e);l.removeClass=fb(l.removeClass,h);return a.push(c,"setClass",l)},animate:function(c,e,h,l,k){k=Ha(k);k.from=k.from?
Q(k.from,e):e;k.to=k.to?Q(k.to,h):h;k.tempClasses=fb(k.tempClasses,l||"ng-inline-animate");return a.push(c,"animate",k)}}}]}],ea=F("$compile");Dc.$inject=["$provide","$$sanitizeUriProvider"];var Yc=/^((?:x|data)[\:\-_])/i,Mf=F("$controller"),Wc=/^(\S+)(\s+as\s+(\w+))?$/,bd="application/json",ac={"Content-Type":bd+";charset=utf-8"},Of=/^\[|^\{(?!\{)/,Pf={"[":/]$/,"{":/}$/},Nf=/^\)\]\}',?\n/,Ka=aa.$interpolateMinErr=F("$interpolate");Ka.throwNoconcat=function(a){throw Ka("noconcat",a);};Ka.interr=function(a,
c){return Ka("interr",a,c.toString())};var ng=/^([^\?#]*)(\?([^#]*))?(#(.*))?$/,Sf={http:80,https:443,ftp:21},Cb=F("$location"),og={$$html5:!1,$$replace:!1,absUrl:Db("$$absUrl"),url:function(a){if(v(a))return this.$$url;var c=ng.exec(a);(c[1]||""===a)&&this.path(decodeURIComponent(c[1]));(c[2]||c[1]||""===a)&&this.search(c[3]||"");this.hash(c[5]||"");return this},protocol:Db("$$protocol"),host:Db("$$host"),port:Db("$$port"),path:jd("$$path",function(a){a=null!==a?a.toString():"";return"/"==a.charAt(0)?
a:"/"+a}),search:function(a,c){switch(arguments.length){case 0:return this.$$search;case 1:if(L(a)||V(a))a=a.toString(),this.$$search=yc(a);else if(C(a))a=ua(a,{}),n(a,function(c,e){null==c&&delete a[e]}),this.$$search=a;else throw Cb("isrcharg");break;default:v(c)||null===c?delete this.$$search[a]:this.$$search[a]=c}this.$$compose();return this},hash:jd("$$hash",function(a){return null!==a?a.toString():""}),replace:function(){this.$$replace=!0;return this}};n([id,ec,dc],function(a){a.prototype=Object.create(og);
a.prototype.state=function(c){if(!arguments.length)return this.$$state;if(a!==dc||!this.$$html5)throw Cb("nostate");this.$$state=v(c)?null:c;return this}});var ca=F("$parse"),Tf=Function.prototype.call,Uf=Function.prototype.apply,Vf=Function.prototype.bind,Mb=ga();n("+ - * / % === !== == != < > <= >= && || ! = |".split(" "),function(a){Mb[a]=!0});var pg={n:"\n",f:"\f",r:"\r",t:"\t",v:"\v","'":"'",'"':'"'},gc=function(a){this.options=a};gc.prototype={constructor:gc,lex:function(a){this.text=a;this.index=
0;for(this.tokens=[];this.index<this.text.length;)if(a=this.text.charAt(this.index),'"'===a||"'"===a)this.readString(a);else if(this.isNumber(a)||"."===a&&this.isNumber(this.peek()))this.readNumber();else if(this.isIdent(a))this.readIdent();else if(this.is(a,"(){}[].,;:?"))this.tokens.push({index:this.index,text:a}),this.index++;else if(this.isWhitespace(a))this.index++;else{var c=a+this.peek(),d=c+this.peek(2),e=Mb[c],f=Mb[d];Mb[a]||e||f?(a=f?d:e?c:a,this.tokens.push({index:this.index,text:a,operator:!0}),
this.index+=a.length):this.throwError("Unexpected next character ",this.index,this.index+1)}return this.tokens},is:function(a,c){return-1!==c.indexOf(a)},peek:function(a){a=a||1;return this.index+a<this.text.length?this.text.charAt(this.index+a):!1},isNumber:function(a){return"0"<=a&&"9">=a&&"string"===typeof a},isWhitespace:function(a){return" "===a||"\r"===a||"\t"===a||"\n"===a||"\v"===a||"\u00a0"===a},isIdent:function(a){return"a"<=a&&"z">=a||"A"<=a&&"Z">=a||"_"===a||"$"===a},isExpOperator:function(a){return"-"===
a||"+"===a||this.isNumber(a)},throwError:function(a,c,d){d=d||this.index;c=y(c)?"s "+c+"-"+this.index+" ["+this.text.substring(c,d)+"]":" "+d;throw ca("lexerr",a,c,this.text);},readNumber:function(){for(var a="",c=this.index;this.index<this.text.length;){var d=E(this.text.charAt(this.index));if("."==d||this.isNumber(d))a+=d;else{var e=this.peek();if("e"==d&&this.isExpOperator(e))a+=d;else if(this.isExpOperator(d)&&e&&this.isNumber(e)&&"e"==a.charAt(a.length-1))a+=d;else if(!this.isExpOperator(d)||
e&&this.isNumber(e)||"e"!=a.charAt(a.length-1))break;else this.throwError("Invalid exponent")}this.index++}this.tokens.push({index:c,text:a,constant:!0,value:Number(a)})},readIdent:function(){for(var a=this.index;this.index<this.text.length;){var c=this.text.charAt(this.index);if(!this.isIdent(c)&&!this.isNumber(c))break;this.index++}this.tokens.push({index:a,text:this.text.slice(a,this.index),identifier:!0})},readString:function(a){var c=this.index;this.index++;for(var d="",e=a,f=!1;this.index<this.text.length;){var g=
this.text.charAt(this.index),e=e+g;if(f)"u"===g?(f=this.text.substring(this.index+1,this.index+5),f.match(/[\da-f]{4}/i)||this.throwError("Invalid unicode escape [\\u"+f+"]"),this.index+=4,d+=String.fromCharCode(parseInt(f,16))):d+=pg[g]||g,f=!1;else if("\\"===g)f=!0;else{if(g===a){this.index++;this.tokens.push({index:c,text:e,constant:!0,value:d});return}d+=g}this.index++}this.throwError("Unterminated quote",c)}};var q=function(a,c){this.lexer=a;this.options=c};q.Program="Program";q.ExpressionStatement=
"ExpressionStatement";q.AssignmentExpression="AssignmentExpression";q.ConditionalExpression="ConditionalExpression";q.LogicalExpression="LogicalExpression";q.BinaryExpression="BinaryExpression";q.UnaryExpression="UnaryExpression";q.CallExpression="CallExpression";q.MemberExpression="MemberExpression";q.Identifier="Identifier";q.Literal="Literal";q.ArrayExpression="ArrayExpression";q.Property="Property";q.ObjectExpression="ObjectExpression";q.ThisExpression="ThisExpression";q.NGValueParameter="NGValueParameter";
q.prototype={ast:function(a){this.text=a;this.tokens=this.lexer.lex(a);a=this.program();0!==this.tokens.length&&this.throwError("is an unexpected token",this.tokens[0]);return a},program:function(){for(var a=[];;)if(0<this.tokens.length&&!this.peek("}",")",";","]")&&a.push(this.expressionStatement()),!this.expect(";"))return{type:q.Program,body:a}},expressionStatement:function(){return{type:q.ExpressionStatement,expression:this.filterChain()}},filterChain:function(){for(var a=this.expression();this.expect("|");)a=
this.filter(a);return a},expression:function(){return this.assignment()},assignment:function(){var a=this.ternary();this.expect("=")&&(a={type:q.AssignmentExpression,left:a,right:this.assignment(),operator:"="});return a},ternary:function(){var a=this.logicalOR(),c,d;return this.expect("?")&&(c=this.expression(),this.consume(":"))?(d=this.expression(),{type:q.ConditionalExpression,test:a,alternate:c,consequent:d}):a},logicalOR:function(){for(var a=this.logicalAND();this.expect("||");)a={type:q.LogicalExpression,
operator:"||",left:a,right:this.logicalAND()};return a},logicalAND:function(){for(var a=this.equality();this.expect("&&");)a={type:q.LogicalExpression,operator:"&&",left:a,right:this.equality()};return a},equality:function(){for(var a=this.relational(),c;c=this.expect("==","!=","===","!==");)a={type:q.BinaryExpression,operator:c.text,left:a,right:this.relational()};return a},relational:function(){for(var a=this.additive(),c;c=this.expect("<",">","<=",">=");)a={type:q.BinaryExpression,operator:c.text,
left:a,right:this.additive()};return a},additive:function(){for(var a=this.multiplicative(),c;c=this.expect("+","-");)a={type:q.BinaryExpression,operator:c.text,left:a,right:this.multiplicative()};return a},multiplicative:function(){for(var a=this.unary(),c;c=this.expect("*","/","%");)a={type:q.BinaryExpression,operator:c.text,left:a,right:this.unary()};return a},unary:function(){var a;return(a=this.expect("+","-","!"))?{type:q.UnaryExpression,operator:a.text,prefix:!0,argument:this.unary()}:this.primary()},
primary:function(){var a;this.expect("(")?(a=this.filterChain(),this.consume(")")):this.expect("[")?a=this.arrayDeclaration():this.expect("{")?a=this.object():this.constants.hasOwnProperty(this.peek().text)?a=ua(this.constants[this.consume().text]):this.peek().identifier?a=this.identifier():this.peek().constant?a=this.constant():this.throwError("not a primary expression",this.peek());for(var c;c=this.expect("(","[",".");)"("===c.text?(a={type:q.CallExpression,callee:a,arguments:this.parseArguments()},
this.consume(")")):"["===c.text?(a={type:q.MemberExpression,object:a,property:this.expression(),computed:!0},this.consume("]")):"."===c.text?a={type:q.MemberExpression,object:a,property:this.identifier(),computed:!1}:this.throwError("IMPOSSIBLE");return a},filter:function(a){a=[a];for(var c={type:q.CallExpression,callee:this.identifier(),arguments:a,filter:!0};this.expect(":");)a.push(this.expression());return c},parseArguments:function(){var a=[];if(")"!==this.peekToken().text){do a.push(this.expression());
while(this.expect(","))}return a},identifier:function(){var a=this.consume();a.identifier||this.throwError("is not a valid identifier",a);return{type:q.Identifier,name:a.text}},constant:function(){return{type:q.Literal,value:this.consume().value}},arrayDeclaration:function(){var a=[];if("]"!==this.peekToken().text){do{if(this.peek("]"))break;a.push(this.expression())}while(this.expect(","))}this.consume("]");return{type:q.ArrayExpression,elements:a}},object:function(){var a=[],c;if("}"!==this.peekToken().text){do{if(this.peek("}"))break;
c={type:q.Property,kind:"init"};this.peek().constant?c.key=this.constant():this.peek().identifier?c.key=this.identifier():this.throwError("invalid key",this.peek());this.consume(":");c.value=this.expression();a.push(c)}while(this.expect(","))}this.consume("}");return{type:q.ObjectExpression,properties:a}},throwError:function(a,c){throw ca("syntax",c.text,a,c.index+1,this.text,this.text.substring(c.index));},consume:function(a){if(0===this.tokens.length)throw ca("ueoe",this.text);var c=this.expect(a);
c||this.throwError("is unexpected, expecting ["+a+"]",this.peek());return c},peekToken:function(){if(0===this.tokens.length)throw ca("ueoe",this.text);return this.tokens[0]},peek:function(a,c,d,e){return this.peekAhead(0,a,c,d,e)},peekAhead:function(a,c,d,e,f){if(this.tokens.length>a){a=this.tokens[a];var g=a.text;if(g===c||g===d||g===e||g===f||!(c||d||e||f))return a}return!1},expect:function(a,c,d,e){return(a=this.peek(a,c,d,e))?(this.tokens.shift(),a):!1},constants:{"true":{type:q.Literal,value:!0},
"false":{type:q.Literal,value:!1},"null":{type:q.Literal,value:null},undefined:{type:q.Literal,value:u},"this":{type:q.ThisExpression}}};qd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.state={nextId:0,filters:{},expensiveChecks:c,fn:{vars:[],body:[],own:{}},assign:{vars:[],body:[],own:{}},inputs:[]};U(e,d.$filter);var f="",g;this.stage="assign";if(g=od(e))this.state.computing="assign",f=this.nextId(),this.recurse(g,f),f="fn.assign="+this.generateFunction("assign","s,v,l");
g=md(e.body);d.stage="inputs";n(g,function(a,c){var e="fn"+c;d.state[e]={vars:[],body:[],own:{}};d.state.computing=e;var f=d.nextId();d.recurse(a,f);d.return_(f);d.state.inputs.push(e);a.watchId=c});this.state.computing="fn";this.stage="main";this.recurse(e);f='"'+this.USE+" "+this.STRICT+'";\n'+this.filterPrefix()+"var fn="+this.generateFunction("fn","s,l,a,i")+f+this.watchFns()+"return fn;";f=(new Function("$filter","ensureSafeMemberName","ensureSafeObject","ensureSafeFunction","ifDefined","plus",
"text",f))(this.$filter,Ba,na,kd,Wf,ld,a);this.state=this.stage=u;f.literal=pd(e);f.constant=e.constant;return f},USE:"use",STRICT:"strict",watchFns:function(){var a=[],c=this.state.inputs,d=this;n(c,function(c){a.push("var "+c+"="+d.generateFunction(c,"s"))});c.length&&a.push("fn.inputs=["+c.join(",")+"];");return a.join("")},generateFunction:function(a,c){return"function("+c+"){"+this.varsPrefix(a)+this.body(a)+"};"},filterPrefix:function(){var a=[],c=this;n(this.state.filters,function(d,e){a.push(d+
"=$filter("+c.escape(e)+")")});return a.length?"var "+a.join(",")+";":""},varsPrefix:function(a){return this.state[a].vars.length?"var "+this.state[a].vars.join(",")+";":""},body:function(a){return this.state[a].body.join("")},recurse:function(a,c,d,e,f,g){var h,l,k=this,m,r;e=e||w;if(!g&&y(a.watchId))c=c||this.nextId(),this.if_("i",this.lazyAssign(c,this.computedMember("i",a.watchId)),this.lazyRecurse(a,c,d,e,f,!0));else switch(a.type){case q.Program:n(a.body,function(c,d){k.recurse(c.expression,
u,u,function(a){l=a});d!==a.body.length-1?k.current().body.push(l,";"):k.return_(l)});break;case q.Literal:r=this.escape(a.value);this.assign(c,r);e(r);break;case q.UnaryExpression:this.recurse(a.argument,u,u,function(a){l=a});r=a.operator+"("+this.ifDefined(l,0)+")";this.assign(c,r);e(r);break;case q.BinaryExpression:this.recurse(a.left,u,u,function(a){h=a});this.recurse(a.right,u,u,function(a){l=a});r="+"===a.operator?this.plus(h,l):"-"===a.operator?this.ifDefined(h,0)+a.operator+this.ifDefined(l,
0):"("+h+")"+a.operator+"("+l+")";this.assign(c,r);e(r);break;case q.LogicalExpression:c=c||this.nextId();k.recurse(a.left,c);k.if_("&&"===a.operator?c:k.not(c),k.lazyRecurse(a.right,c));e(c);break;case q.ConditionalExpression:c=c||this.nextId();k.recurse(a.test,c);k.if_(c,k.lazyRecurse(a.alternate,c),k.lazyRecurse(a.consequent,c));e(c);break;case q.Identifier:c=c||this.nextId();d&&(d.context="inputs"===k.stage?"s":this.assign(this.nextId(),this.getHasOwnProperty("l",a.name)+"?l:s"),d.computed=!1,
d.name=a.name);Ba(a.name);k.if_("inputs"===k.stage||k.not(k.getHasOwnProperty("l",a.name)),function(){k.if_("inputs"===k.stage||"s",function(){f&&1!==f&&k.if_(k.not(k.nonComputedMember("s",a.name)),k.lazyAssign(k.nonComputedMember("s",a.name),"{}"));k.assign(c,k.nonComputedMember("s",a.name))})},c&&k.lazyAssign(c,k.nonComputedMember("l",a.name)));(k.state.expensiveChecks||Fb(a.name))&&k.addEnsureSafeObject(c);e(c);break;case q.MemberExpression:h=d&&(d.context=this.nextId())||this.nextId();c=c||this.nextId();
k.recurse(a.object,h,u,function(){k.if_(k.notNull(h),function(){if(a.computed)l=k.nextId(),k.recurse(a.property,l),k.addEnsureSafeMemberName(l),f&&1!==f&&k.if_(k.not(k.computedMember(h,l)),k.lazyAssign(k.computedMember(h,l),"{}")),r=k.ensureSafeObject(k.computedMember(h,l)),k.assign(c,r),d&&(d.computed=!0,d.name=l);else{Ba(a.property.name);f&&1!==f&&k.if_(k.not(k.nonComputedMember(h,a.property.name)),k.lazyAssign(k.nonComputedMember(h,a.property.name),"{}"));r=k.nonComputedMember(h,a.property.name);
if(k.state.expensiveChecks||Fb(a.property.name))r=k.ensureSafeObject(r);k.assign(c,r);d&&(d.computed=!1,d.name=a.property.name)}e(c)})},!!f);break;case q.CallExpression:c=c||this.nextId();a.filter?(l=k.filter(a.callee.name),m=[],n(a.arguments,function(a){var c=k.nextId();k.recurse(a,c);m.push(c)}),r=l+"("+m.join(",")+")",k.assign(c,r),e(c)):(l=k.nextId(),h={},m=[],k.recurse(a.callee,l,h,function(){k.if_(k.notNull(l),function(){k.addEnsureSafeFunction(l);n(a.arguments,function(a){k.recurse(a,k.nextId(),
u,function(a){m.push(k.ensureSafeObject(a))})});h.name?(k.state.expensiveChecks||k.addEnsureSafeObject(h.context),r=k.member(h.context,h.name,h.computed)+"("+m.join(",")+")"):r=l+"("+m.join(",")+")";r=k.ensureSafeObject(r);k.assign(c,r);e(c)})}));break;case q.AssignmentExpression:l=this.nextId();h={};if(!nd(a.left))throw ca("lval");this.recurse(a.left,u,h,function(){k.if_(k.notNull(h.context),function(){k.recurse(a.right,l);k.addEnsureSafeObject(k.member(h.context,h.name,h.computed));r=k.member(h.context,
h.name,h.computed)+a.operator+l;k.assign(c,r);e(c||r)})},1);break;case q.ArrayExpression:m=[];n(a.elements,function(a){k.recurse(a,k.nextId(),u,function(a){m.push(a)})});r="["+m.join(",")+"]";this.assign(c,r);e(r);break;case q.ObjectExpression:m=[];n(a.properties,function(a){k.recurse(a.value,k.nextId(),u,function(c){m.push(k.escape(a.key.type===q.Identifier?a.key.name:""+a.key.value)+":"+c)})});r="{"+m.join(",")+"}";this.assign(c,r);e(r);break;case q.ThisExpression:this.assign(c,"s");e("s");break;
case q.NGValueParameter:this.assign(c,"v"),e("v")}},getHasOwnProperty:function(a,c){var d=a+"."+c,e=this.current().own;e.hasOwnProperty(d)||(e[d]=this.nextId(!1,a+"&&("+this.escape(c)+" in "+a+")"));return e[d]},assign:function(a,c){if(a)return this.current().body.push(a,"=",c,";"),a},filter:function(a){this.state.filters.hasOwnProperty(a)||(this.state.filters[a]=this.nextId(!0));return this.state.filters[a]},ifDefined:function(a,c){return"ifDefined("+a+","+this.escape(c)+")"},plus:function(a,c){return"plus("+
a+","+c+")"},return_:function(a){this.current().body.push("return ",a,";")},if_:function(a,c,d){if(!0===a)c();else{var e=this.current().body;e.push("if(",a,"){");c();e.push("}");d&&(e.push("else{"),d(),e.push("}"))}},not:function(a){return"!("+a+")"},notNull:function(a){return a+"!=null"},nonComputedMember:function(a,c){return a+"."+c},computedMember:function(a,c){return a+"["+c+"]"},member:function(a,c,d){return d?this.computedMember(a,c):this.nonComputedMember(a,c)},addEnsureSafeObject:function(a){this.current().body.push(this.ensureSafeObject(a),
";")},addEnsureSafeMemberName:function(a){this.current().body.push(this.ensureSafeMemberName(a),";")},addEnsureSafeFunction:function(a){this.current().body.push(this.ensureSafeFunction(a),";")},ensureSafeObject:function(a){return"ensureSafeObject("+a+",text)"},ensureSafeMemberName:function(a){return"ensureSafeMemberName("+a+",text)"},ensureSafeFunction:function(a){return"ensureSafeFunction("+a+",text)"},lazyRecurse:function(a,c,d,e,f,g){var h=this;return function(){h.recurse(a,c,d,e,f,g)}},lazyAssign:function(a,
c){var d=this;return function(){d.assign(a,c)}},stringEscapeRegex:/[^ a-zA-Z0-9]/g,stringEscapeFn:function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)},escape:function(a){if(L(a))return"'"+a.replace(this.stringEscapeRegex,this.stringEscapeFn)+"'";if(V(a))return a.toString();if(!0===a)return"true";if(!1===a)return"false";if(null===a)return"null";if("undefined"===typeof a)return"undefined";throw ca("esc");},nextId:function(a,c){var d="v"+this.state.nextId++;a||this.current().vars.push(d+
(c?"="+c:""));return d},current:function(){return this.state[this.state.computing]}};rd.prototype={compile:function(a,c){var d=this,e=this.astBuilder.ast(a);this.expression=a;this.expensiveChecks=c;U(e,d.$filter);var f,g;if(f=od(e))g=this.recurse(f);f=md(e.body);var h;f&&(h=[],n(f,function(a,c){var e=d.recurse(a);a.input=e;h.push(e);a.watchId=c}));var l=[];n(e.body,function(a){l.push(d.recurse(a.expression))});f=0===e.body.length?function(){}:1===e.body.length?l[0]:function(a,c){var d;n(l,function(e){d=
e(a,c)});return d};g&&(f.assign=function(a,c,d){return g(a,d,c)});h&&(f.inputs=h);f.literal=pd(e);f.constant=e.constant;return f},recurse:function(a,c,d){var e,f,g=this,h;if(a.input)return this.inputs(a.input,a.watchId);switch(a.type){case q.Literal:return this.value(a.value,c);case q.UnaryExpression:return f=this.recurse(a.argument),this["unary"+a.operator](f,c);case q.BinaryExpression:return e=this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case q.LogicalExpression:return e=
this.recurse(a.left),f=this.recurse(a.right),this["binary"+a.operator](e,f,c);case q.ConditionalExpression:return this["ternary?:"](this.recurse(a.test),this.recurse(a.alternate),this.recurse(a.consequent),c);case q.Identifier:return Ba(a.name,g.expression),g.identifier(a.name,g.expensiveChecks||Fb(a.name),c,d,g.expression);case q.MemberExpression:return e=this.recurse(a.object,!1,!!d),a.computed||(Ba(a.property.name,g.expression),f=a.property.name),a.computed&&(f=this.recurse(a.property)),a.computed?
this.computedMember(e,f,c,d,g.expression):this.nonComputedMember(e,f,g.expensiveChecks,c,d,g.expression);case q.CallExpression:return h=[],n(a.arguments,function(a){h.push(g.recurse(a))}),a.filter&&(f=this.$filter(a.callee.name)),a.filter||(f=this.recurse(a.callee,!0)),a.filter?function(a,d,e,g){for(var n=[],q=0;q<h.length;++q)n.push(h[q](a,d,e,g));a=f.apply(u,n,g);return c?{context:u,name:u,value:a}:a}:function(a,d,e,r){var n=f(a,d,e,r),q;if(null!=n.value){na(n.context,g.expression);kd(n.value,g.expression);
q=[];for(var u=0;u<h.length;++u)q.push(na(h[u](a,d,e,r),g.expression));q=na(n.value.apply(n.context,q),g.expression)}return c?{value:q}:q};case q.AssignmentExpression:return e=this.recurse(a.left,!0,1),f=this.recurse(a.right),function(a,d,h,n){var s=e(a,d,h,n);a=f(a,d,h,n);na(s.value,g.expression);s.context[s.name]=a;return c?{value:a}:a};case q.ArrayExpression:return h=[],n(a.elements,function(a){h.push(g.recurse(a))}),function(a,d,e,f){for(var g=[],n=0;n<h.length;++n)g.push(h[n](a,d,e,f));return c?
{value:g}:g};case q.ObjectExpression:return h=[],n(a.properties,function(a){h.push({key:a.key.type===q.Identifier?a.key.name:""+a.key.value,value:g.recurse(a.value)})}),function(a,d,e,f){for(var g={},n=0;n<h.length;++n)g[h[n].key]=h[n].value(a,d,e,f);return c?{value:g}:g};case q.ThisExpression:return function(a){return c?{value:a}:a};case q.NGValueParameter:return function(a,d,e,f){return c?{value:e}:e}}},"unary+":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);d=y(d)?+d:0;return c?{value:d}:
d}},"unary-":function(a,c){return function(d,e,f,g){d=a(d,e,f,g);d=y(d)?-d:0;return c?{value:d}:d}},"unary!":function(a,c){return function(d,e,f,g){d=!a(d,e,f,g);return c?{value:d}:d}},"binary+":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=ld(l,e);return d?{value:l}:l}},"binary-":function(a,c,d){return function(e,f,g,h){var l=a(e,f,g,h);e=c(e,f,g,h);l=(y(l)?l:0)-(y(e)?e:0);return d?{value:l}:l}},"binary*":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)*c(e,f,g,h);
return d?{value:e}:e}},"binary/":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)/c(e,f,g,h);return d?{value:e}:e}},"binary%":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)%c(e,f,g,h);return d?{value:e}:e}},"binary===":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)===c(e,f,g,h);return d?{value:e}:e}},"binary!==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)!==c(e,f,g,h);return d?{value:e}:e}},"binary==":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)==c(e,f,g,h);return d?
{value:e}:e}},"binary!=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)!=c(e,f,g,h);return d?{value:e}:e}},"binary<":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<c(e,f,g,h);return d?{value:e}:e}},"binary>":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>c(e,f,g,h);return d?{value:e}:e}},"binary<=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)<=c(e,f,g,h);return d?{value:e}:e}},"binary>=":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)>=c(e,f,g,h);return d?{value:e}:
e}},"binary&&":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)&&c(e,f,g,h);return d?{value:e}:e}},"binary||":function(a,c,d){return function(e,f,g,h){e=a(e,f,g,h)||c(e,f,g,h);return d?{value:e}:e}},"ternary?:":function(a,c,d,e){return function(f,g,h,l){f=a(f,g,h,l)?c(f,g,h,l):d(f,g,h,l);return e?{value:f}:f}},value:function(a,c){return function(){return c?{context:u,name:u,value:a}:a}},identifier:function(a,c,d,e,f){return function(g,h,l,k){g=h&&a in h?h:g;e&&1!==e&&g&&!g[a]&&(g[a]={});h=g?
g[a]:u;c&&na(h,f);return d?{context:g,name:a,value:h}:h}},computedMember:function(a,c,d,e,f){return function(g,h,l,k){var m=a(g,h,l,k),n,s;null!=m&&(n=c(g,h,l,k),Ba(n,f),e&&1!==e&&m&&!m[n]&&(m[n]={}),s=m[n],na(s,f));return d?{context:m,name:n,value:s}:s}},nonComputedMember:function(a,c,d,e,f,g){return function(h,l,k,m){h=a(h,l,k,m);f&&1!==f&&h&&!h[c]&&(h[c]={});l=null!=h?h[c]:u;(d||Fb(c))&&na(l,g);return e?{context:h,name:c,value:l}:l}},inputs:function(a,c){return function(d,e,f,g){return g?g[c]:
a(d,e,f)}}};var hc=function(a,c,d){this.lexer=a;this.$filter=c;this.options=d;this.ast=new q(this.lexer);this.astCompiler=d.csp?new rd(this.ast,c):new qd(this.ast,c)};hc.prototype={constructor:hc,parse:function(a){return this.astCompiler.compile(a,this.options.expensiveChecks)}};ga();ga();var Xf=Object.prototype.valueOf,Ca=F("$sce"),oa={HTML:"html",CSS:"css",URL:"url",RESOURCE_URL:"resourceUrl",JS:"js"},ea=F("$compile"),Z=W.createElement("a"),vd=Aa(N.location.href);wd.$inject=["$document"];Kc.$inject=
["$provide"];xd.$inject=["$locale"];zd.$inject=["$locale"];var Cd=".",gg={yyyy:$("FullYear",4),yy:$("FullYear",2,0,!0),y:$("FullYear",1),MMMM:Hb("Month"),MMM:Hb("Month",!0),MM:$("Month",2,1),M:$("Month",1,1),dd:$("Date",2),d:$("Date",1),HH:$("Hours",2),H:$("Hours",1),hh:$("Hours",2,-12),h:$("Hours",1,-12),mm:$("Minutes",2),m:$("Minutes",1),ss:$("Seconds",2),s:$("Seconds",1),sss:$("Milliseconds",3),EEEE:Hb("Day"),EEE:Hb("Day",!0),a:function(a,c){return 12>a.getHours()?c.AMPMS[0]:c.AMPMS[1]},Z:function(a,
c,d){a=-1*d;return a=(0<=a?"+":"")+(Gb(Math[0<a?"floor":"ceil"](a/60),2)+Gb(Math.abs(a%60),2))},ww:Ed(2),w:Ed(1),G:jc,GG:jc,GGG:jc,GGGG:function(a,c){return 0>=a.getFullYear()?c.ERANAMES[0]:c.ERANAMES[1]}},fg=/((?:[^yMdHhmsaZEwG']+)|(?:'(?:[^']|'')*')|(?:E+|y+|M+|d+|H+|h+|m+|s+|a|Z|G+|w+))(.*)/,eg=/^\-?\d+$/;yd.$inject=["$locale"];var bg=qa(E),cg=qa(pb);Ad.$inject=["$parse"];var he=qa({restrict:"E",compile:function(a,c){if(!c.href&&!c.xlinkHref)return function(a,c){if("a"===c[0].nodeName.toLowerCase()){var f=
"[object SVGAnimatedString]"===sa.call(c.prop("href"))?"xlink:href":"href";c.on("click",function(a){c.attr(f)||a.preventDefault()})}}}}),qb={};n(zb,function(a,c){function d(a,d,f){a.$watch(f[e],function(a){f.$set(c,!!a)})}if("multiple"!=a){var e=xa("ng-"+c),f=d;"checked"===a&&(f=function(a,c,f){f.ngModel!==f[e]&&d(a,c,f)});qb[e]=function(){return{restrict:"A",priority:100,link:f}}}});n(Tc,function(a,c){qb[c]=function(){return{priority:100,link:function(a,e,f){if("ngPattern"===c&&"/"==f.ngPattern.charAt(0)&&
(e=f.ngPattern.match(ig))){f.$set("ngPattern",new RegExp(e[1],e[2]));return}a.$watch(f[c],function(a){f.$set(c,a)})}}}});n(["src","srcset","href"],function(a){var c=xa("ng-"+a);qb[c]=function(){return{priority:99,link:function(d,e,f){var g=a,h=a;"href"===a&&"[object SVGAnimatedString]"===sa.call(e.prop("href"))&&(h="xlinkHref",f.$attr[h]="xlink:href",g=null);f.$observe(c,function(c){c?(f.$set(h,c),gb&&g&&e.prop(g,f[h])):"href"===a&&f.$set(h,null)})}}}});var Ib={$addControl:w,$$renameControl:function(a,
c){a.$name=c},$removeControl:w,$setValidity:w,$setDirty:w,$setPristine:w,$setSubmitted:w};Fd.$inject=["$element","$attrs","$scope","$animate","$interpolate"];var Nd=function(a){return["$timeout",function(c){return{name:"form",restrict:a?"EAC":"E",controller:Fd,compile:function(d,e){d.addClass(Sa).addClass(jb);var f=e.name?"name":a&&e.ngForm?"ngForm":!1;return{pre:function(a,d,e,k){if(!("action"in e)){var m=function(c){a.$apply(function(){k.$commitViewValue();k.$setSubmitted()});c.preventDefault()};
d[0].addEventListener("submit",m,!1);d.on("$destroy",function(){c(function(){d[0].removeEventListener("submit",m,!1)},0,!1)})}var n=k.$$parentForm;f&&(Eb(a,k.$name,k,k.$name),e.$observe(f,function(c){k.$name!==c&&(Eb(a,k.$name,u,k.$name),n.$$renameControl(k,c),Eb(a,k.$name,k,k.$name))}));d.on("$destroy",function(){n.$removeControl(k);f&&Eb(a,e[f],u,k.$name);Q(k,Ib)})}}}}}]},ie=Nd(),ve=Nd(!0),hg=/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d\.\d+([+-][0-2]\d:[0-5]\d|Z)/,qg=/^(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?$/,
rg=/^[a-z0-9!#$%&'*+\/=?^_`{|}~.-]+@[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i,sg=/^\s*(\-|\+)?(\d+|(\d*(\.\d*)))\s*$/,Od=/^(\d{4})-(\d{2})-(\d{2})$/,Pd=/^(\d{4})-(\d\d)-(\d\d)T(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,mc=/^(\d{4})-W(\d\d)$/,Qd=/^(\d{4})-(\d\d)$/,Rd=/^(\d\d):(\d\d)(?::(\d\d)(\.\d{1,3})?)?$/,Sd={text:function(a,c,d,e,f,g){hb(a,c,d,e,f,g);kc(e)},date:ib("date",Od,Kb(Od,["yyyy","MM","dd"]),"yyyy-MM-dd"),"datetime-local":ib("datetimelocal",Pd,Kb(Pd,"yyyy MM dd HH mm ss sss".split(" ")),
"yyyy-MM-ddTHH:mm:ss.sss"),time:ib("time",Rd,Kb(Rd,["HH","mm","ss","sss"]),"HH:mm:ss.sss"),week:ib("week",mc,function(a,c){if(da(a))return a;if(L(a)){mc.lastIndex=0;var d=mc.exec(a);if(d){var e=+d[1],f=+d[2],g=d=0,h=0,l=0,k=Dd(e),f=7*(f-1);c&&(d=c.getHours(),g=c.getMinutes(),h=c.getSeconds(),l=c.getMilliseconds());return new Date(e,0,k.getDate()+f,d,g,h,l)}}return NaN},"yyyy-Www"),month:ib("month",Qd,Kb(Qd,["yyyy","MM"]),"yyyy-MM"),number:function(a,c,d,e,f,g){Hd(a,c,d,e);hb(a,c,d,e,f,g);e.$$parserName=
"number";e.$parsers.push(function(a){return e.$isEmpty(a)?null:sg.test(a)?parseFloat(a):u});e.$formatters.push(function(a){if(!e.$isEmpty(a)){if(!V(a))throw Lb("numfmt",a);a=a.toString()}return a});if(y(d.min)||d.ngMin){var h;e.$validators.min=function(a){return e.$isEmpty(a)||v(h)||a>=h};d.$observe("min",function(a){y(a)&&!V(a)&&(a=parseFloat(a,10));h=V(a)&&!isNaN(a)?a:u;e.$validate()})}if(y(d.max)||d.ngMax){var l;e.$validators.max=function(a){return e.$isEmpty(a)||v(l)||a<=l};d.$observe("max",function(a){y(a)&&
!V(a)&&(a=parseFloat(a,10));l=V(a)&&!isNaN(a)?a:u;e.$validate()})}},url:function(a,c,d,e,f,g){hb(a,c,d,e,f,g);kc(e);e.$$parserName="url";e.$validators.url=function(a,c){var d=a||c;return e.$isEmpty(d)||qg.test(d)}},email:function(a,c,d,e,f,g){hb(a,c,d,e,f,g);kc(e);e.$$parserName="email";e.$validators.email=function(a,c){var d=a||c;return e.$isEmpty(d)||rg.test(d)}},radio:function(a,c,d,e){v(d.name)&&c.attr("name",++lb);c.on("click",function(a){c[0].checked&&e.$setViewValue(d.value,a&&a.type)});e.$render=
function(){c[0].checked=d.value==e.$viewValue};d.$observe("value",e.$render)},checkbox:function(a,c,d,e,f,g,h,l){var k=Id(l,a,"ngTrueValue",d.ngTrueValue,!0),m=Id(l,a,"ngFalseValue",d.ngFalseValue,!1);c.on("click",function(a){e.$setViewValue(c[0].checked,a&&a.type)});e.$render=function(){c[0].checked=e.$viewValue};e.$isEmpty=function(a){return!1===a};e.$formatters.push(function(a){return ka(a,k)});e.$parsers.push(function(a){return a?k:m})},hidden:w,button:w,submit:w,reset:w,file:w},Ec=["$browser",
"$sniffer","$filter","$parse",function(a,c,d,e){return{restrict:"E",require:["?ngModel"],link:{pre:function(f,g,h,l){l[0]&&(Sd[E(h.type)]||Sd.text)(f,g,h,l[0],c,a,d,e)}}}}],tg=/^(true|false|\d+)$/,Ne=function(){return{restrict:"A",priority:100,compile:function(a,c){return tg.test(c.ngValue)?function(a,c,f){f.$set("value",a.$eval(f.ngValue))}:function(a,c,f){a.$watch(f.ngValue,function(a){f.$set("value",a)})}}}},ne=["$compile",function(a){return{restrict:"AC",compile:function(c){a.$$addBindingClass(c);
return function(c,e,f){a.$$addBindingInfo(e,f.ngBind);e=e[0];c.$watch(f.ngBind,function(a){e.textContent=a===u?"":a})}}}}],pe=["$interpolate","$compile",function(a,c){return{compile:function(d){c.$$addBindingClass(d);return function(d,f,g){d=a(f.attr(g.$attr.ngBindTemplate));c.$$addBindingInfo(f,d.expressions);f=f[0];g.$observe("ngBindTemplate",function(a){f.textContent=a===u?"":a})}}}}],oe=["$sce","$parse","$compile",function(a,c,d){return{restrict:"A",compile:function(e,f){var g=c(f.ngBindHtml),
h=c(f.ngBindHtml,function(a){return(a||"").toString()});d.$$addBindingClass(e);return function(c,e,f){d.$$addBindingInfo(e,f.ngBindHtml);c.$watch(h,function(){e.html(a.getTrustedHtml(g(c))||"")})}}}}],Me=qa({restrict:"A",require:"ngModel",link:function(a,c,d,e){e.$viewChangeListeners.push(function(){a.$eval(d.ngChange)})}}),qe=lc("",!0),se=lc("Odd",0),re=lc("Even",1),te=Ma({compile:function(a,c){c.$set("ngCloak",u);a.removeClass("ng-cloak")}}),ue=[function(){return{restrict:"A",scope:!0,controller:"@",
priority:500}}],Jc={},ug={blur:!0,focus:!0};n("click dblclick mousedown mouseup mouseover mouseout mousemove mouseenter mouseleave keydown keyup keypress submit focus blur copy cut paste".split(" "),function(a){var c=xa("ng-"+a);Jc[c]=["$parse","$rootScope",function(d,e){return{restrict:"A",compile:function(f,g){var h=d(g[c],null,!0);return function(c,d){d.on(a,function(d){var f=function(){h(c,{$event:d})};ug[a]&&e.$$phase?c.$evalAsync(f):c.$apply(f)})}}}}]});var xe=["$animate",function(a){return{multiElement:!0,
transclude:"element",priority:600,terminal:!0,restrict:"A",$$tlb:!0,link:function(c,d,e,f,g){var h,l,k;c.$watch(e.ngIf,function(c){c?l||g(function(c,f){l=f;c[c.length++]=W.createComment(" end ngIf: "+e.ngIf+" ");h={clone:c};a.enter(c,d.parent(),d)}):(k&&(k.remove(),k=null),l&&(l.$destroy(),l=null),h&&(k=ob(h.clone),a.leave(k).then(function(){k=null}),h=null))})}}}],ye=["$templateRequest","$anchorScroll","$animate","$sce",function(a,c,d,e){return{restrict:"ECA",priority:400,terminal:!0,transclude:"element",
controller:aa.noop,compile:function(f,g){var h=g.ngInclude||g.src,l=g.onload||"",k=g.autoscroll;return function(f,g,n,q,u){var v=0,t,p,x,w=function(){p&&(p.remove(),p=null);t&&(t.$destroy(),t=null);x&&(d.leave(x).then(function(){p=null}),p=x,x=null)};f.$watch(e.parseAsResourceUrl(h),function(e){var h=function(){!y(k)||k&&!f.$eval(k)||c()},n=++v;e?(a(e,!0).then(function(a){if(n===v){var c=f.$new();q.template=a;a=u(c,function(a){w();d.enter(a,null,g).then(h)});t=c;x=a;t.$emit("$includeContentLoaded",
e);f.$eval(l)}},function(){n===v&&(w(),f.$emit("$includeContentError",e))}),f.$emit("$includeContentRequested",e)):(w(),q.template=null)})}}}}],Pe=["$compile",function(a){return{restrict:"ECA",priority:-400,require:"ngInclude",link:function(c,d,e,f){/SVG/.test(d[0].toString())?(d.empty(),a(Mc(f.template,W).childNodes)(c,function(a){d.append(a)},{futureParentElement:d})):(d.html(f.template),a(d.contents())(c))}}}],ze=Ma({priority:450,compile:function(){return{pre:function(a,c,d){a.$eval(d.ngInit)}}}}),
Le=function(){return{restrict:"A",priority:100,require:"ngModel",link:function(a,c,d,e){var f=c.attr(d.$attr.ngList)||", ",g="false"!==d.ngTrim,h=g?T(f):f;e.$parsers.push(function(a){if(!v(a)){var c=[];a&&n(a.split(h),function(a){a&&c.push(g?T(a):a)});return c}});e.$formatters.push(function(a){return K(a)?a.join(f):u});e.$isEmpty=function(a){return!a||!a.length}}}},jb="ng-valid",Jd="ng-invalid",Sa="ng-pristine",Jb="ng-dirty",Ld="ng-pending",Lb=new F("ngModel"),vg=["$scope","$exceptionHandler","$attrs",
"$element","$parse","$animate","$timeout","$rootScope","$q","$interpolate",function(a,c,d,e,f,g,h,l,k,m){this.$modelValue=this.$viewValue=Number.NaN;this.$$rawModelValue=u;this.$validators={};this.$asyncValidators={};this.$parsers=[];this.$formatters=[];this.$viewChangeListeners=[];this.$untouched=!0;this.$touched=!1;this.$pristine=!0;this.$dirty=!1;this.$valid=!0;this.$invalid=!1;this.$error={};this.$$success={};this.$pending=u;this.$name=m(d.name||"",!1)(a);var r=f(d.ngModel),s=r.assign,q=r,H=s,
M=null,t,p=this;this.$$setOptions=function(a){if((p.$options=a)&&a.getterSetter){var c=f(d.ngModel+"()"),g=f(d.ngModel+"($$$p)");q=function(a){var d=r(a);G(d)&&(d=c(a));return d};H=function(a,c){G(r(a))?g(a,{$$$p:p.$modelValue}):s(a,p.$modelValue)}}else if(!r.assign)throw Lb("nonassign",d.ngModel,va(e));};this.$render=w;this.$isEmpty=function(a){return v(a)||""===a||null===a||a!==a};var x=e.inheritedData("$formController")||Ib,z=0;Gd({ctrl:this,$element:e,set:function(a,c){a[c]=!0},unset:function(a,
c){delete a[c]},parentForm:x,$animate:g});this.$setPristine=function(){p.$dirty=!1;p.$pristine=!0;g.removeClass(e,Jb);g.addClass(e,Sa)};this.$setDirty=function(){p.$dirty=!0;p.$pristine=!1;g.removeClass(e,Sa);g.addClass(e,Jb);x.$setDirty()};this.$setUntouched=function(){p.$touched=!1;p.$untouched=!0;g.setClass(e,"ng-untouched","ng-touched")};this.$setTouched=function(){p.$touched=!0;p.$untouched=!1;g.setClass(e,"ng-touched","ng-untouched")};this.$rollbackViewValue=function(){h.cancel(M);p.$viewValue=
p.$$lastCommittedViewValue;p.$render()};this.$validate=function(){if(!V(p.$modelValue)||!isNaN(p.$modelValue)){var a=p.$$rawModelValue,c=p.$valid,d=p.$modelValue,e=p.$options&&p.$options.allowInvalid;p.$$runValidators(a,p.$$lastCommittedViewValue,function(f){e||c===f||(p.$modelValue=f?a:u,p.$modelValue!==d&&p.$$writeModelToScope())})}};this.$$runValidators=function(a,c,d){function e(){var d=!0;n(p.$validators,function(e,f){var h=e(a,c);d=d&&h;g(f,h)});return d?!0:(n(p.$asyncValidators,function(a,
c){g(c,null)}),!1)}function f(){var d=[],e=!0;n(p.$asyncValidators,function(f,h){var k=f(a,c);if(!k||!G(k.then))throw Lb("$asyncValidators",k);g(h,u);d.push(k.then(function(){g(h,!0)},function(a){e=!1;g(h,!1)}))});d.length?k.all(d).then(function(){h(e)},w):h(!0)}function g(a,c){l===z&&p.$setValidity(a,c)}function h(a){l===z&&d(a)}z++;var l=z;(function(){var a=p.$$parserName||"parse";if(t===u)g(a,null);else return t||(n(p.$validators,function(a,c){g(c,null)}),n(p.$asyncValidators,function(a,c){g(c,
null)})),g(a,t),t;return!0})()?e()?f():h(!1):h(!1)};this.$commitViewValue=function(){var a=p.$viewValue;h.cancel(M);if(p.$$lastCommittedViewValue!==a||""===a&&p.$$hasNativeValidators)p.$$lastCommittedViewValue=a,p.$pristine&&this.$setDirty(),this.$$parseAndValidate()};this.$$parseAndValidate=function(){var c=p.$$lastCommittedViewValue;if(t=v(c)?u:!0)for(var d=0;d<p.$parsers.length;d++)if(c=p.$parsers[d](c),v(c)){t=!1;break}V(p.$modelValue)&&isNaN(p.$modelValue)&&(p.$modelValue=q(a));var e=p.$modelValue,
f=p.$options&&p.$options.allowInvalid;p.$$rawModelValue=c;f&&(p.$modelValue=c,p.$modelValue!==e&&p.$$writeModelToScope());p.$$runValidators(c,p.$$lastCommittedViewValue,function(a){f||(p.$modelValue=a?c:u,p.$modelValue!==e&&p.$$writeModelToScope())})};this.$$writeModelToScope=function(){H(a,p.$modelValue);n(p.$viewChangeListeners,function(a){try{a()}catch(d){c(d)}})};this.$setViewValue=function(a,c){p.$viewValue=a;p.$options&&!p.$options.updateOnDefault||p.$$debounceViewValueCommit(c)};this.$$debounceViewValueCommit=
function(c){var d=0,e=p.$options;e&&y(e.debounce)&&(e=e.debounce,V(e)?d=e:V(e[c])?d=e[c]:V(e["default"])&&(d=e["default"]));h.cancel(M);d?M=h(function(){p.$commitViewValue()},d):l.$$phase?p.$commitViewValue():a.$apply(function(){p.$commitViewValue()})};a.$watch(function(){var c=q(a);if(c!==p.$modelValue&&(p.$modelValue===p.$modelValue||c===c)){p.$modelValue=p.$$rawModelValue=c;t=u;for(var d=p.$formatters,e=d.length,f=c;e--;)f=d[e](f);p.$viewValue!==f&&(p.$viewValue=p.$$lastCommittedViewValue=f,p.$render(),
p.$$runValidators(c,f,w))}return c})}],Ke=["$rootScope",function(a){return{restrict:"A",require:["ngModel","^?form","^?ngModelOptions"],controller:vg,priority:1,compile:function(c){c.addClass(Sa).addClass("ng-untouched").addClass(jb);return{pre:function(a,c,f,g){var h=g[0],l=g[1]||Ib;h.$$setOptions(g[2]&&g[2].$options);l.$addControl(h);f.$observe("name",function(a){h.$name!==a&&l.$$renameControl(h,a)});a.$on("$destroy",function(){l.$removeControl(h)})},post:function(c,e,f,g){var h=g[0];if(h.$options&&
h.$options.updateOn)e.on(h.$options.updateOn,function(a){h.$$debounceViewValueCommit(a&&a.type)});e.on("blur",function(e){h.$touched||(a.$$phase?c.$evalAsync(h.$setTouched):c.$apply(h.$setTouched))})}}}}}],wg=/(\s+|^)default(\s+|$)/,Oe=function(){return{restrict:"A",controller:["$scope","$attrs",function(a,c){var d=this;this.$options=ua(a.$eval(c.ngModelOptions));this.$options.updateOn!==u?(this.$options.updateOnDefault=!1,this.$options.updateOn=T(this.$options.updateOn.replace(wg,function(){d.$options.updateOnDefault=
!0;return" "}))):this.$options.updateOnDefault=!0}]}},Ae=Ma({terminal:!0,priority:1E3}),xg=F("ngOptions"),yg=/^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/,Ie=["$compile","$parse",function(a,c){function d(a,d,e){function f(a,c,d,e,g){this.selectValue=a;this.viewValue=c;this.label=d;this.group=e;this.disabled=g}
var m=a.match(yg);if(!m)throw xg("iexp",a,va(d));var n=m[5]||m[7],s=m[6];a=/ as /.test(m[0])&&m[1];var q=m[9];d=c(m[2]?m[1]:n);var u=a&&c(a)||d,v=q&&c(q),t=q?function(a,c){return v(e,c)}:function(a){return Fa(a)},p=function(a,c){return t(a,D(a,c))},x=c(m[2]||m[1]),w=c(m[3]||""),y=c(m[4]||""),B=c(m[8]),z={},D=s?function(a,c){z[s]=c;z[n]=a;return z}:function(a){z[n]=a;return z};return{trackBy:q,getTrackByValue:p,getWatchables:c(B,function(a){var c=[];a=a||[];Object.keys(a).forEach(function(d){var f=
D(a[d],d);d=t(a[d],f);c.push(d);if(m[2]||m[1])d=x(e,f),c.push(d);m[4]&&(f=y(e,f),c.push(f))});return c}),getOptions:function(){var a=[],c={},d=B(e)||[],g;if(!s&&Da(d))g=d;else{g=[];for(var h in d)d.hasOwnProperty(h)&&"$"!==h.charAt(0)&&g.push(h)}h=g.length;for(var m=0;m<h;m++){var n=d===g?m:g[m],r=D(d[n],n),v=u(e,r),n=t(v,r),z=x(e,r),M=w(e,r),r=y(e,r),v=new f(n,v,z,M,r);a.push(v);c[n]=v}return{items:a,selectValueMap:c,getOptionFromViewValue:function(a){return c[p(a)]},getViewValueFromOption:function(a){return q?
aa.copy(a.viewValue):a.viewValue}}}}}var e=W.createElement("option"),f=W.createElement("optgroup");return{restrict:"A",terminal:!0,require:["select","?ngModel"],link:function(c,h,l,k){function m(a,c){a.element=c;c.disabled=a.disabled;a.value!==c.value&&(c.value=a.selectValue);a.label!==c.label&&(c.label=a.label,c.textContent=a.label)}function r(a,c,d,e){c&&E(c.nodeName)===d?d=c:(d=e.cloneNode(!1),c?a.insertBefore(d,c):a.appendChild(d));return d}function q(a){for(var c;a;)c=a.nextSibling,Xb(a),a=c}
function u(a){var c=p&&p[0],d=O&&O[0];if(c||d)for(;a&&(a===c||a===d);)a=a.nextSibling;return a}function v(){var a=D&&t.readValue();D=C.getOptions();var c={},d=h[0].firstChild;B&&h.prepend(p);d=u(d);D.items.forEach(function(a){var g,k;a.group?(g=c[a.group],g||(g=r(h[0],d,"optgroup",f),d=g.nextSibling,g.label=a.group,g=c[a.group]={groupElement:g,currentOptionElement:g.firstChild}),k=r(g.groupElement,g.currentOptionElement,"option",e),m(a,k),g.currentOptionElement=k.nextSibling):(k=r(h[0],d,"option",
e),m(a,k),d=k.nextSibling)});Object.keys(c).forEach(function(a){q(c[a].currentOptionElement)});q(d);w.$render();if(!w.$isEmpty(a)){var g=t.readValue();if(C.trackBy&&!ka(a,g)||a!==g)w.$setViewValue(g),w.$render()}}var w=k[1];if(w){var t=k[0];k=l.multiple;for(var p,x=0,y=h.children(),I=y.length;x<I;x++)if(""===y[x].value){p=y.eq(x);break}var B=!!p,O=z(e.cloneNode(!1));O.val("?");var D,C=d(l.ngOptions,h,c);k?(w.$isEmpty=function(a){return!a||0===a.length},t.writeValue=function(a){D.items.forEach(function(a){a.element.selected=
!1});a&&a.forEach(function(a){(a=D.getOptionFromViewValue(a))&&!a.disabled&&(a.element.selected=!0)})},t.readValue=function(){var a=h.val()||[],c=[];n(a,function(a){a=D.selectValueMap[a];a.disabled||c.push(D.getViewValueFromOption(a))});return c},C.trackBy&&c.$watchCollection(function(){if(K(w.$viewValue))return w.$viewValue.map(function(a){return C.getTrackByValue(a)})},function(){w.$render()})):(t.writeValue=function(a){var c=D.getOptionFromViewValue(a);c&&!c.disabled?h[0].value!==c.selectValue&&
(O.remove(),B||p.remove(),h[0].value=c.selectValue,c.element.selected=!0,c.element.setAttribute("selected","selected")):null===a||B?(O.remove(),B||h.prepend(p),h.val(""),p.prop("selected",!0),p.attr("selected",!0)):(B||p.remove(),h.prepend(O),h.val("?"),O.prop("selected",!0),O.attr("selected",!0))},t.readValue=function(){var a=D.selectValueMap[h.val()];return a&&!a.disabled?(B||p.remove(),O.remove(),D.getViewValueFromOption(a)):null},C.trackBy&&c.$watch(function(){return C.getTrackByValue(w.$viewValue)},
function(){w.$render()}));B?(p.remove(),a(p)(c),p.removeClass("ng-scope")):p=z(e.cloneNode(!1));v();c.$watchCollection(C.getWatchables,v)}}}}],Be=["$locale","$interpolate","$log",function(a,c,d){var e=/{}/g,f=/^when(Minus)?(.+)$/;return{link:function(g,h,l){function k(a){h.text(a||"")}var m=l.count,r=l.$attr.when&&h.attr(l.$attr.when),q=l.offset||0,u=g.$eval(r)||{},z={},y=c.startSymbol(),t=c.endSymbol(),p=y+m+"-"+q+t,x=aa.noop,C;n(l,function(a,c){var d=f.exec(c);d&&(d=(d[1]?"-":"")+E(d[2]),u[d]=h.attr(l.$attr[c]))});
n(u,function(a,d){z[d]=c(a.replace(e,p))});g.$watch(m,function(c){var e=parseFloat(c),f=isNaN(e);f||e in u||(e=a.pluralCat(e-q));e===C||f&&V(C)&&isNaN(C)||(x(),f=z[e],v(f)?(null!=c&&d.debug("ngPluralize: no rule defined for '"+e+"' in "+r),x=w,k()):x=g.$watch(f,k),C=e)})}}}],Ce=["$parse","$animate",function(a,c){var d=F("ngRepeat"),e=function(a,c,d,e,k,m,n){a[d]=e;k&&(a[k]=m);a.$index=c;a.$first=0===c;a.$last=c===n-1;a.$middle=!(a.$first||a.$last);a.$odd=!(a.$even=0===(c&1))};return{restrict:"A",
multiElement:!0,transclude:"element",priority:1E3,terminal:!0,$$tlb:!0,compile:function(f,g){var h=g.ngRepeat,l=W.createComment(" end ngRepeat: "+h+" "),k=h.match(/^\s*([\s\S]+?)\s+in\s+([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);if(!k)throw d("iexp",h);var m=k[1],r=k[2],q=k[3],v=k[4],k=m.match(/^(?:(\s*[\$\w]+)|\(\s*([\$\w]+)\s*,\s*([\$\w]+)\s*\))$/);if(!k)throw d("iidexp",m);var w=k[3]||k[1],y=k[2];if(q&&(!/^[$a-zA-Z_][$a-zA-Z0-9_]*$/.test(q)||/^(null|undefined|this|\$index|\$first|\$middle|\$last|\$even|\$odd|\$parent|\$root|\$id)$/.test(q)))throw d("badident",
q);var t,p,x,C,I={$id:Fa};v?t=a(v):(x=function(a,c){return Fa(c)},C=function(a){return a});return function(a,f,g,k,m){t&&(p=function(c,d,e){y&&(I[y]=c);I[w]=d;I.$index=e;return t(a,I)});var v=ga();a.$watchCollection(r,function(g){var k,r,t=f[0],A,D=ga(),I,G,L,F,K,E,N;q&&(a[q]=g);if(Da(g))K=g,r=p||x;else for(N in r=p||C,K=[],g)g.hasOwnProperty(N)&&"$"!==N.charAt(0)&&K.push(N);I=K.length;N=Array(I);for(k=0;k<I;k++)if(G=g===K?k:K[k],L=g[G],F=r(G,L,k),v[F])E=v[F],delete v[F],D[F]=E,N[k]=E;else{if(D[F])throw n(N,
function(a){a&&a.scope&&(v[a.id]=a)}),d("dupes",h,F,L);N[k]={id:F,scope:u,clone:u};D[F]=!0}for(A in v){E=v[A];F=ob(E.clone);c.leave(F);if(F[0].parentNode)for(k=0,r=F.length;k<r;k++)F[k].$$NG_REMOVED=!0;E.scope.$destroy()}for(k=0;k<I;k++)if(G=g===K?k:K[k],L=g[G],E=N[k],E.scope){A=t;do A=A.nextSibling;while(A&&A.$$NG_REMOVED);E.clone[0]!=A&&c.move(ob(E.clone),null,z(t));t=E.clone[E.clone.length-1];e(E.scope,k,w,L,y,G,I)}else m(function(a,d){E.scope=d;var f=l.cloneNode(!1);a[a.length++]=f;c.enter(a,
null,z(t));t=f;E.clone=a;D[E.id]=E;e(E.scope,k,w,L,y,G,I)});v=D})}}}}],De=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngShow,function(c){a[c?"removeClass":"addClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],we=["$animate",function(a){return{restrict:"A",multiElement:!0,link:function(c,d,e){c.$watch(e.ngHide,function(c){a[c?"addClass":"removeClass"](d,"ng-hide",{tempClasses:"ng-hide-animate"})})}}}],Ee=Ma(function(a,c,d){a.$watch(d.ngStyle,
function(a,d){d&&a!==d&&n(d,function(a,d){c.css(d,"")});a&&c.css(a)},!0)}),Fe=["$animate",function(a){return{require:"ngSwitch",controller:["$scope",function(){this.cases={}}],link:function(c,d,e,f){var g=[],h=[],l=[],k=[],m=function(a,c){return function(){a.splice(c,1)}};c.$watch(e.ngSwitch||e.on,function(c){var d,e;d=0;for(e=l.length;d<e;++d)a.cancel(l[d]);d=l.length=0;for(e=k.length;d<e;++d){var q=ob(h[d].clone);k[d].$destroy();(l[d]=a.leave(q)).then(m(l,d))}h.length=0;k.length=0;(g=f.cases["!"+
c]||f.cases["?"])&&n(g,function(c){c.transclude(function(d,e){k.push(e);var f=c.element;d[d.length++]=W.createComment(" end ngSwitchWhen: ");h.push({clone:d});a.enter(d,f.parent(),f)})})})}}}],Ge=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,c,d,e,f){e.cases["!"+d.ngSwitchWhen]=e.cases["!"+d.ngSwitchWhen]||[];e.cases["!"+d.ngSwitchWhen].push({transclude:f,element:c})}}),He=Ma({transclude:"element",priority:1200,require:"^ngSwitch",multiElement:!0,link:function(a,
c,d,e,f){e.cases["?"]=e.cases["?"]||[];e.cases["?"].push({transclude:f,element:c})}}),Je=Ma({restrict:"EAC",link:function(a,c,d,e,f){if(!f)throw F("ngTransclude")("orphan",va(c));f(function(a){c.empty();c.append(a)})}}),je=["$templateCache",function(a){return{restrict:"E",terminal:!0,compile:function(c,d){"text/ng-template"==d.type&&a.put(d.id,c[0].text)}}}],zg={$setViewValue:w,$render:w},Ag=["$element","$scope","$attrs",function(a,c,d){var e=this,f=new Ra;e.ngModelCtrl=zg;e.unknownOption=z(W.createElement("option"));
e.renderUnknownOption=function(c){c="? "+Fa(c)+" ?";e.unknownOption.val(c);a.prepend(e.unknownOption);a.val(c)};c.$on("$destroy",function(){e.renderUnknownOption=w});e.removeUnknownOption=function(){e.unknownOption.parent()&&e.unknownOption.remove()};e.readValue=function(){e.removeUnknownOption();return a.val()};e.writeValue=function(c){e.hasOption(c)?(e.removeUnknownOption(),a.val(c),""===c&&e.emptyOption.prop("selected",!0)):null==c&&e.emptyOption?(e.removeUnknownOption(),a.val("")):e.renderUnknownOption(c)};
e.addOption=function(a,c){Qa(a,'"option value"');""===a&&(e.emptyOption=c);var d=f.get(a)||0;f.put(a,d+1)};e.removeOption=function(a){var c=f.get(a);c&&(1===c?(f.remove(a),""===a&&(e.emptyOption=u)):f.put(a,c-1))};e.hasOption=function(a){return!!f.get(a)}}],ke=function(){return{restrict:"E",require:["select","?ngModel"],controller:Ag,link:function(a,c,d,e){var f=e[1];if(f){var g=e[0];g.ngModelCtrl=f;f.$render=function(){g.writeValue(f.$viewValue)};c.on("change",function(){a.$apply(function(){f.$setViewValue(g.readValue())})});
if(d.multiple){g.readValue=function(){var a=[];n(c.find("option"),function(c){c.selected&&a.push(c.value)});return a};g.writeValue=function(a){var d=new Ra(a);n(c.find("option"),function(a){a.selected=y(d.get(a.value))})};var h,l=NaN;a.$watch(function(){l!==f.$viewValue||ka(h,f.$viewValue)||(h=fa(f.$viewValue),f.$render());l=f.$viewValue});f.$isEmpty=function(a){return!a||0===a.length}}}}}},me=["$interpolate",function(a){function c(a){a[0].hasAttribute("selected")&&(a[0].selected=!0)}return{restrict:"E",
priority:100,compile:function(d,e){if(v(e.value)){var f=a(d.text(),!0);f||e.$set("value",d.text())}return function(a,d,e){var k=d.parent(),m=k.data("$selectController")||k.parent().data("$selectController");m&&m.ngModelCtrl&&(f?a.$watch(f,function(a,f){e.$set("value",a);f!==a&&m.removeOption(f);m.addOption(a,d);m.ngModelCtrl.$render();c(d)}):(m.addOption(e.value,d),m.ngModelCtrl.$render(),c(d)),d.on("$destroy",function(){m.removeOption(e.value);m.ngModelCtrl.$render()}))}}}}],le=qa({restrict:"E",
terminal:!1}),Gc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){e&&(d.required=!0,e.$validators.required=function(a,c){return!d.required||!e.$isEmpty(c)},d.$observe("required",function(){e.$validate()}))}}},Fc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f,g=d.ngPattern||d.pattern;d.$observe("pattern",function(a){L(a)&&0<a.length&&(a=new RegExp("^"+a+"$"));if(a&&!a.test)throw F("ngPattern")("noregexp",g,a,va(c));f=a||u;e.$validate()});
e.$validators.pattern=function(a){return e.$isEmpty(a)||v(f)||f.test(a)}}}}},Ic=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=-1;d.$observe("maxlength",function(a){a=Y(a);f=isNaN(a)?-1:a;e.$validate()});e.$validators.maxlength=function(a,c){return 0>f||e.$isEmpty(c)||c.length<=f}}}}},Hc=function(){return{restrict:"A",require:"?ngModel",link:function(a,c,d,e){if(e){var f=0;d.$observe("minlength",function(a){f=Y(a)||0;e.$validate()});e.$validators.minlength=function(a,
c){return e.$isEmpty(c)||c.length>=f}}}}};N.angular.bootstrap?console.log("WARNING: Tried to load angular more than once."):(be(),de(aa),z(W).ready(function(){Yd(W,zc)}))})(window,document);!window.angular.$$csp()&&window.angular.element(document).find("head").prepend('<style type="text/css">@charset "UTF-8";[ng\\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>');
//# sourceMappingURL=angular.min.js.map

16
03b-require/app.js Normal file
Просмотреть файл

@ -0,0 +1,16 @@
'use strict';
var dependencias =['angular'];
var crear = function (angular) {
var dependencias = ['cajaCtrl'];
var iniciar = function (cajaCtrl) {
angular
.module('controlCajaApp', [])
.controller('CajaCtrl', cajaCtrl);
angular.bootstrap(document, ['controlCajaApp']);
};
require(dependencias, iniciar);
};
require(dependencias,crear);

53
03b-require/cajaCtrl.js Normal file
Просмотреть файл

@ -0,0 +1,53 @@
'use strict';
var dependencias = ['angular'];
var crear = function (angular) {
var cajaCtrl = function () {
var vm = this;
// Declaración y asignación de valores iniciales
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// Array en el que guardar los movimientos
vm.movimientos = [];
// El scope no son sólo datos, también funciones
vm.guardarMovimiento = function () {
if (vm.nuevoMovimiento.esIngreso) {
vm.total.ingresos += vm.nuevoMovimiento.importe;
} else {
vm.total.gastos += vm.nuevoMovimiento.importe;
}
// creamos una cipia de los valores del actual formulario
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
// Se almacena un copia del nuevo movimiento, y se reutiliza la variable para crear otros
vm.movimientos.push(auxCopyMov);
// El formulario se limpia y la variable se reutiliza
vm.nuevoMovimiento.importe = 0;
}
// las funiones puede llamarse desde la vista o desde el código
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
};
return [cajaCtrl];
}
define(dependencias, crear);

149
03b-require/index.html Normal file
Просмотреть файл

@ -0,0 +1,149 @@
<html lang="es" id="controlCajaApp">
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Simple Interés en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<!--La directiva ng-controller la usaremos siempre con la sintaxis 'as'-->
<body ng-controller="CajaCtrl as caja">
<div class="container text-center">
<section name="total">
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
<!-- Ejemplo de uso de funciones dentro de expresiones-->
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>
<hr>
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-hide="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
</section>
<hr>
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>
</div>
<footer>
<hr>
<p>Código de ejemplo creado por <a href="https://twitter.com/albertobasalo">Alberto Basalo</a> de <a href="http://agorabinaria.com">Ágora Binaria</a>
</p>
<p>Accede a más contenidos formativos en <a href="https://github.com/AcademiaBinaria">GitHub-AcademiaBinaria</a>
</p>
</footer>
<!-- JavaScript References -->
<script src="require.js" data-main="main.js"></script>
</body>
</html>

13
03b-require/main.js Normal file
Просмотреть файл

@ -0,0 +1,13 @@
require.config({
baseUrl: "/03b-require/",
paths: {
'angular': 'angular.min'
},
shim: {
'angular': {
exports: 'angular'
}
},
deps: ['app']
});

36
03b-require/require.js Normal file
Просмотреть файл

@ -0,0 +1,36 @@
/*
RequireJS 2.1.18 Copyright (c) 2010-2015, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1===c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.undefed||
(this.defineDep(b,a),this.check())}));this.errback?q(a,"error",u(this,this.errback)):this.events.error&&q(a,"error",u(this,function(a){this.emit("error",a)}))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};
i={config:j,contextName:b,registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=
i.makeShimExports(a);b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b,null,!0))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,
e){function j(c,d,m){var n,q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,
{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);e.undefed=!0;d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),
y(b))});return j},enable:function(a){m(h,a.id)&&s(a).enable()},completeLoad:function(a){var b,c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=
a+(b||"");else{d=j.paths;a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,
a=I(a),i.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror","Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==
typeof importScripts,ja=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);
(e=m(F,p))||(e=F[p]=g.s.newContext(p));n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.18";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],
D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&
0>e.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=
I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),
function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);

Просмотреть файл

@ -1,2 +1,2 @@
// Declaración de un nuevo módulo sin dependencias, llamado 'controlCajaApp'
angular.module('controlCajaApp', []);
angular.module('controlCajaApp', []);

60
03c-karma/cajaCtrl.js Normal file
Просмотреть файл

@ -0,0 +1,60 @@
// Es una buena práctica dedicar un fichero para cada controlador, factoría...
// Usamos el patrón de funciones de invocación inmediata
// Esto permite tener código protegido dentro del cuerpo de una función
// Pero al mismo tiempo garantiza que se ejecutará automáticamente
(function () {
// la función controladora se define con su propio nombre
function cajaCtrl() {
// El viewmodel o vm es la propia función
// Guardamos una referencia a 'this' en una variable que podamos usar dentro de otras funciones
var vm = this;
// Declaración y asignación de valores iniciales
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// Array en el que guardar los movimientos
vm.movimientos = [];
// El scope no son sólo datos, también funciones
vm.guardarMovimiento = function () {
if (vm.nuevoMovimiento.esIngreso) {
vm.total.ingresos += vm.nuevoMovimiento.importe;
} else {
vm.total.gastos += vm.nuevoMovimiento.importe;
}
// creamos una cipia de los valores del actual formulario
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
// Se almacena un copia del nuevo movimiento, y se reutiliza la variable para crear otros
vm.movimientos.push(auxCopyMov);
// El formulario se limpia y la variable se reutiliza
vm.nuevoMovimiento.importe = 0;
}
// las funiones puede llamarse desde la vista o desde el código
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
// Accedemos al módulo por su nombre a través de la única variable global 'angular'
var modulo = angular.module('controlCajaApp');
// En dicho módulo creamos un controlador, cuyo código es la función previamente definida
modulo.controller('CajaCtrl', cajaCtrl);
}()); // Sintáxis JS para invocación inmediata

Просмотреть файл

@ -68,11 +68,11 @@
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso==1}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto==1}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto==0}">- Gasto</span>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
@ -117,11 +117,11 @@
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = campo == ('fecha' && !sentido)">Fecha</a>
<th><a href="" ng-click="campo = 'fecha'; sentido = !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = campo == ('importe' && !sentido)">Importe</a>
<th><a href="" ng-click="campo = 'importe'; sentido = !sentido">Importe</a>
</th>
</tr>
</thead>
@ -144,7 +144,7 @@
</p>
</footer>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<!-- Referencias a nuestro propio código, un fichero para el módulo principal de la aplicación, y otro para su controlador-->
<script src="app.js"></script>
<script src="cajaCtrl.js"></script>

70
03c-karma/karma.conf.js Normal file
Просмотреть файл

@ -0,0 +1,70 @@
// Karma configuration
// Generated on Thu Jun 04 2015 20:32:34 GMT+0200 (CEST)
//http://karma-runner.github.io/0.12/intro/installation.html
//https://www.airpair.com/angularjs/posts/testing-angular-with-karma
//http://www.ng-newsletter.com/advent2013/#!/day/19
module.exports = function (config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
// frameworks to use
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
frameworks: ['jasmine'],
// list of files / patterns to load in the browser
files: [
'https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js',
'app.js',
'cajaCtrl.js',
'test/*Spec.js'
],
// list of files to exclude
exclude: [
],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {},
// test results reporter to use
// possible values: 'dots', 'progress'
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
reporters: ['progress'],
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// start these browsers
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
browsers: ['Chrome'],
// Continuous Integration mode
// if true, Karma captures browsers, runs the tests and exits
singleRun: false
});
};

Просмотреть файл

@ -0,0 +1,21 @@
describe('Unit: CajaController', function () {
// Load the module with MainController
beforeEach(module('controlCajaApp'));
var ctrl, scope;
// inject the $controller and $rootScope services
// in the beforeEach block
beforeEach(inject(function ($controller, $rootScope) {
// Create a new scope that's a child of the $rootScope
scope = $rootScope.$new();
// Create the controller
ctrl = $controller('CajaCtrl', {
$scope: scope
});
}));
it('should create $scope.greeting when calling sayHello',
function () {
expect(scope.titulo).toEqual("Controla tu Cash Flow");
});
})

Просмотреть файл

@ -1,36 +1,36 @@
// Vemos como usar una dependencia de otro módulo
// En este caso el módulo es 'ngRoute'
// Que viene en el fichero angular-route.min.js
angular.module('controlCajaApp', ['ngRoute']);
// Además de controladores, un módulo puede tener funciones de configuración
// Estas se ejecutarán al arrancar la aplicación
function configurarRutas($routeProvider) {
// Declaramos una dependencia en el parámetro $routeProvider
// Este servicio nos provee de métodos para realizar un enrutado en el cliente
// Con esto se crean las SPA
$routeProvider
.when('/', {
// Para cada ruta se declara la vista y el controlador asociados
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'total.html'
})
.when('/nuevo', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'nuevo.html'
})
.when('/lista', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'lista.html'
})
.otherwise({
// en caso de peticiones no contempladas podemos redirigir
redirectTo: '/'
});
}
// Se registra la función como un configurador del módulo
angular.module('controlCajaApp').config(configurarRutas);
// Vemos como usar una dependencia de otro módulo
// En este caso el módulo es 'ngRoute'
// Que viene en el fichero angular-route.min.js
angular.module('cashFlow', ['ngRoute']);
// Además de controladores, un módulo puede tener funciones de configuración
// Estas se ejecutarán al arrancar la aplicación
function configurarRutas($routeProvider) {
// Declaramos una dependencia en el parámetro $routeProvider
// Este servicio nos provee de métodos para realizar un enrutado en el cliente
// Con esto se crean las SPA
$routeProvider
.when('/', {
// Para cada ruta se declara la vista y el controlador asociados
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'total.html'
})
.when('/nuevo', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'nuevo.html'
})
.when('/lista', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'lista.html'
})
.otherwise({
// en caso de peticiones no contempladas podemos redirigir
redirectTo: '/'
});
}
// Se registra la función como un configurador del módulo
angular.module('cashFlow').config(configurarRutas);

Просмотреть файл

@ -1,48 +1,48 @@
// El controlador permanece común a las tres vistas
// En principio esto facilita la programación
(function () {
var cajaCtrl = function () {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
vm.movimientos = [];
vm.guardarMovimiento = function () {
if(vm.nuevoMovimiento.esIngreso){
vm.total.ingresos += vm.nuevoMovimiento.importe;
}else{
vm.total.gastos += vm.nuevoMovimiento.importe;
}
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
vm.movimientos.push(auxCopyMov);
vm.nuevoMovimiento.importe = 0;
}
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
angular.module('controlCajaApp').controller('CajaCtrl', cajaCtrl);
}());
// El controlador permanece común a las tres vistas
// En principio esto facilita la programación
(function () {
var cajaCtrl = function () {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.total = {
ingresos: 0,
gastos: 0
};
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
vm.movimientos = [];
vm.guardarMovimiento = function () {
if(vm.nuevoMovimiento.esIngreso){
vm.total.ingresos += vm.nuevoMovimiento.importe;
}else{
vm.total.gastos += vm.nuevoMovimiento.importe;
}
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
vm.movimientos.push(auxCopyMov);
vm.nuevoMovimiento.importe = 0;
}
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
angular.module('cashFlow').controller('CajaCtrl', cajaCtrl);
}());

Просмотреть файл

@ -1,56 +1,60 @@
<html lang="es" ng-app="controlCajaApp">
<!--Distribuimos el contenido en tres vistas parciales y un archivo índice (este mismo)
Cada vista será una 'página' con urls independientes -->
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- Se mantiene el menú de navegación -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('/') }">
<a href="#/">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('/nuevo') }">
<a href="#/nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('/lista') }">
<a href="#/lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- El contenido principal se cargará dinámicamente -->
<!-- De eso se encarga la directiva ng-view en colaboración con el ng-router -->
<!-- Sólo puede haber un ng-view por página-->
<div class="container text-center" style="padding-top:50px;" ng-view >
<!-- Aquí irá el contenido dinámico -->
<!-- Puede ser todo lo complejo que se quiera-->
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<!-- Referencia a Angular Route que contiene el módulo ngRoute -->
<!-- Suelen seguir un patrón de nombrado -->
<!-- angular-nombre-modulo.min.js para el fichero-->
<!-- y ngNombreModulo para el módulo-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js"></script>
<!-- Las vistas parciales no es necesario refrenciarlas en el html -->
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
</body>
</html>
<html lang="es" ng-app="cashFlow">
<!--Distribuimos el contenido en tres vistas parciales y un archivo índice (este mismo)
Cada vista será una 'página' con urls independientes -->
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<!-- Se crea un menú de navegación -->
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('/') }">
<a href="#/">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('/nuevo') }">
<a href="#/nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('/lista') }">
<a href="#/lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- El contenido principal se cargará dinámicamente -->
<!-- De eso se encarga la directiva ng-view en colaboración con el ng-router -->
<!-- Sólo puede haber un ng-view por página-->
<div class="container text-center" style="padding-top:50px;" ng-view >
<!-- Aquí irá el contenido dinámico -->
<!-- Puede ser todo lo complejo que se quiera-->
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<!-- Referencia a Angular Route que contiene el módulo ngRoute -->
<!-- Suelen seguir un patrón de nombrado -->
<!-- angular-nombre-modulo.min.js para el fichero-->
<!-- y ngNombreModulo para el módulo-->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-route.min.js"></script>
<!-- Las vistas parciales no es necesario refrenciarlas en el html -->
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
</body>
</html>

Просмотреть файл

@ -1,26 +1,26 @@
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = campo == 'fecha' && !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = campo == 'importe' && !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>
<section name="lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>

Просмотреть файл

@ -1,8 +1,8 @@
(function () {
var menuCtrl = function ($location) {
this.isActive = function (ruta) {
return ruta === $location.path();
}
}
angular.module('controlCajaApp').controller('MenuCtrl',menuCtrl);
}());
(function () {
var menuCtrl = function ($location) {
this.isActive = function (ruta) {
return ruta === $location.path();
}
}
angular.module('cashFlow').controller('MenuCtrl',menuCtrl);
}());

Просмотреть файл

@ -1,53 +1,53 @@
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso==1}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto==1}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto==0}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
{{caja.movimientos}}
</section>
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
{{caja.movimientos}}
</section>

Просмотреть файл

@ -0,0 +1,49 @@
"use strict";
var http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs');
var mimeTypes = {
"html": "text/html",
"png": "image/png",
"js": "text/javascript",
"css": "text/css"
};
http.createServer(staticServer).listen(3000);
function staticServer(req, res) {
var pathname = url.parse(req.url).pathname;
if (pathname === "/") {
pathname = "index.html";
}
fileServer(res, pathname);
}
function fileServer(res, pathname) {
var filename = path.join(process.cwd(), pathname);
var extension = path.extname(filename).split(".")[1];
if (!extension) {
extension = "html";
filename += "." + extension;
}
fs.exists(filename, function (exists) {
if (!exists) {
notFound(res);
} else {
res.writeHead(200, {
'Content-Type': mimeTypes[extension]
});
fs.createReadStream(filename).pipe(res);
}
});
}
function notFound(res) {
res.writeHead(404, {
'Content-Type': 'text/html'
});
res.write("<html><head><meta charset='utf-8'></head><body><h1>404</h1> Nada por aquí</body></html>");
res.end();
}

Просмотреть файл

@ -1,40 +1,40 @@
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<!-- Cada plantilla debe tener un elemento ráiz en el html-->
<section name="total">
<!-- Se supone un viweModel llamado caja -->
<!-- Aunque suene mal, no importa que la vista conozca al controlador, es más grave al revés-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<!-- Cada plantilla debe tener un elemento ráiz en el html-->
<section name="total">
<!-- Se supone un viweModel llamado caja -->
<!-- Aunque suene mal, no importa que la vista conozca al controlador, es más grave al revés-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>

Просмотреть файл

@ -1,23 +1,23 @@
angular.module('controlCajaApp', ['ngRoute']);
angular.module('controlCajaApp').config(function ($routeProvider) {
$routeProvider
.when('/', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'total.html'
})
.when('/nuevo', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'nuevo.html'
})
.when('/lista', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'lista.html'
})
.otherwise({
redirectTo: '/'
});
});
angular.module('cashFlow', ['ngRoute']);
angular.module('cashFlow').config(function ($routeProvider) {
$routeProvider
.when('/', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'total.html'
})
.when('/nuevo', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'nuevo.html'
})
.when('/lista', {
controller: 'CajaCtrl',
controllerAs: 'caja',
templateUrl: 'lista.html'
})
.otherwise({
redirectTo: '/'
});
});

Просмотреть файл

@ -1,43 +1,29 @@
(function () {
// El controlador ahora tiene una dependencia de la factoría
// Las dependencias se buscan en nuestro módulo
// o en cualquiera de sus dependencias
var cajaCtrl = function (movimientosFactory) {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// La parte de datos que debe compartir la delega sobre la factoría
vm.movimientos = movimientosFactory.getMovimientos();
vm.total = movimientosFactory.getTotal();
vm.guardarMovimiento = function () {
if(vm.nuevoMovimiento.esIngreso){
vm.total.ingresos += vm.nuevoMovimiento.importe;
}else{
vm.total.gastos += vm.nuevoMovimiento.importe;
}
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
// realmente estamos escribiendo en el array que mantiene la factoría
vm.movimientos.push(auxCopyMov);
vm.nuevoMovimiento.importe = 0;
}
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
angular.module('controlCajaApp').controller('CajaCtrl', cajaCtrl);
}());
(function () {
// El controlador ahora tiene una dependencia de la factoría
// Las dependencias se buscan en nuestro módulo
// o en cualquiera de sus dependencias
var cajaCtrl = function (movimientosFactory,maestrosService) {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.maestros = maestrosService.categarias;
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
// La parte de datos que debe compartir la delega sobre la factoría
vm.movimientos = movimientosFactory.getMovimientos();
vm.total = movimientosFactory.getTotal();
vm.guardarMovimiento = function () {
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
movimientosFactory.postMovimiento(auxCopyMov);
vm.nuevoMovimiento.importe=0;
}
vm.balance = movimientosFactory.balance();
vm.tipo = movimientosFactory.tipo;
}
angular.module('cashFlow').controller('CajaCtrl', cajaCtrl);
}());

Просмотреть файл

@ -1,52 +1,53 @@
<!--
Para evitar el problema de los controladores instanciables
Debemos evitar almacenar datos en ellos
Esos datos normalmente venfrán de un API o del almacenamiento local
Pero si los queremos mantener en memoria, entnoces han de venir de una factoria
Las factorias y los servicios son singleton
-->
<html lang="es" ng-app="controlCajaApp">
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('/') }">
<a href="#/">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('/nuevo') }">
<a href="#/nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('/lista') }">
<a href="#/lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container text-center" style="padding-top:50px;" ng-view >
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js"></script>
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
<!-- Referencia a la factoría recién creada, como siempre un fichero por componente -->
<script src="movimientosFactory.js"></script>
</body>
</html>
<!--
Para evitar el problema de los controladores instanciables
Debemos evitar almacenar datos en ellos
Esos datos normalmente venfrán de un API o del almacenamiento local
Pero si los queremos mantener en memoria, entnoces han de venir de una factoria
Las factorias y los servicios son singleton
-->
<html lang="es" ng-app="cashFlow">
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('/') }">
<a href="#/">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('/nuevo') }">
<a href="#/nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('/lista') }">
<a href="#/lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container text-center" style="padding-top:50px;" ng-view >
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular-route.min.js"></script>
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
<!-- Referencia a la factoría recién creada, como siempre un fichero por componente -->
<script src="movimientosFactory.js"></script>
<script src="maestrosService.js"></script>
</body>
</html>

Просмотреть файл

@ -1,26 +1,26 @@
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = campo == 'fecha' && !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = campo == 'importe' && !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = campo == 'fecha' && !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = campo == 'importe' && !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>

Просмотреть файл

@ -0,0 +1,18 @@
(function () {
function maestrosService() {
var privado ="";
this.categarias = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
}
// se registran dentro de un módulo con la palabra clave factory
angular.module('cashFlow').service('maestrosService', maestrosService);
}());

Просмотреть файл

@ -1,8 +1,8 @@
(function () {
var menuCtrl = function ($location) {
this.isActive = function (ruta) {
return ruta === $location.path();
}
}
angular.module('controlCajaApp').controller('MenuCtrl',menuCtrl);
}());
(function () {
var menuCtrl = function ($location) {
this.isActive = function (ruta) {
return ruta === $location.path();
}
}
angular.module('controlCajaApp').controller('MenuCtrl',menuCtrl);
}());

Просмотреть файл

@ -1,39 +1,50 @@
(function () {
// Las factorías, y los servicios, son funciones estándar
// Una gran diferencia con los controladores es que son singleton
// Eso los convierte en un buen lugar para compartir datos
var movimientosFactory =   function ()  {
// el array de movimientos y el total lo mantiene la factoría
// de esta forma sobrevive a las recargas de controladores
var movimientos = [];
// Normalmente estos datos se persisten en servidores remotos
// o al menos se almacenan en el browser
var total = {
ingresos: 0,
gastos: 0
};
// las factorias siempre devuelven objetos (en este caso le llamo factory)
// Estos objetos pueden contener funciones de lógica reutilizables
var factory  =   {};
factory.getMovimientos =   function ()  {
return movimientos;
};
factory.getTotal =   function ()  {
return total;
};
factory.postMovimiento =   function (movimiento)  {
movimientos.push(movimiento);
total.ingresos += movimiento.esIngreso * movimiento.importe;
total.gastos += movimiento.esGasto * movimiento.importe;
};
// Exponemos funionalidad devolviendo el objeto creado,
// para que el cliente explote sus métodos
return factory;
};
// se registran dentro de un módulo con la palabra clave factory
angular.module('controlCajaApp').factory('movimientosFactory', movimientosFactory);
}());
(function () {
// Las factorías, y los servicios, son funciones estándar
// Una gran diferencia con los controladores es que son singleton
// Eso los convierte en un buen lugar para compartir datos
var movimientosFactory =   function ()  {
// el array de movimientos y el total lo mantiene la factoría
// de esta forma sobrevive a las recargas de controladores
var movimientos = [];
// Normalmente estos datos se persisten en servidores remotos
// o al menos se almacenan en el browser
var total = {
ingresos: 0,
gastos: 0
};
// las factorias siempre devuelven objetos, para eso son fábricas
// en este caso le llamo result
// Estos objetos pueden contener funciones de lógica reutilizables
var result  =   {};
/** lista de los movimientos actuales */
result.getMovimientos =   function ()  {
return movimientos;
};
/** objeto total actual */
result.getTotal =   function ()  {
return total;
};
/** guardar un nuevo movimiento */
result.postMovimiento =   function (movimiento)  {
movimientos.push(movimiento);
total.ingresos += movimiento.esIngreso * movimiento.importe;
total.gastos += movimiento.esGasto * movimiento.importe;
};
/** acceso al balance */
result.balance = function () {
return total.ingresos - total.gastos
}
/** función auxiliar para cabiar de movimiento */
result.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
// Exponemos funcionalidad devolviendo el objeto creado,
// para que el cliente explote sus métodos
return result;
};
// se registran dentro de un módulo con la palabra clave factory
angular.module('cashFlow').factory('movimientosFactory', movimientosFactory);
}());

Просмотреть файл

@ -1,53 +1,53 @@
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso==1}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto==1}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto==0}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
{{caja.movimientos}}
</section>
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso==1}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto==1}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto==0}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
{{caja.movimientos}}
</section>

Просмотреть файл

@ -0,0 +1,49 @@
"use strict";
var http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs');
var mimeTypes = {
"html": "text/html",
"png": "image/png",
"js": "text/javascript",
"css": "text/css"
};
http.createServer(staticServer).listen(3000);
function staticServer(req, res) {
var pathname = url.parse(req.url).pathname;
if (pathname === "/") {
pathname = "index.html";
}
fileServer(res, pathname);
}
function fileServer(res, pathname) {
var filename = path.join(process.cwd(), pathname);
var extension = path.extname(filename).split(".")[1];
if (!extension) {
extension = "html";
filename += "." + extension;
}
fs.exists(filename, function (exists) {
if (!exists) {
notFound(res);
} else {
res.writeHead(200, {
'Content-Type': mimeTypes[extension]
});
fs.createReadStream(filename).pipe(res);
}
});
}
function notFound(res) {
res.writeHead(404, {
'Content-Type': 'text/html'
});
res.write("<html><head><meta charset='utf-8'></head><body><h1>404</h1> Nada por aquí</body></html>");
res.end();
}

Просмотреть файл

@ -1,38 +1,38 @@
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<section name="total">
<!-- Pero se supone un viweModel llamado caja-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<section name="total">
<!-- Pero se supone un viweModel llamado caja-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>

Просмотреть файл

@ -1,29 +1,29 @@
// tenemos que cambiar la dependencia hacia el nuevo módulo
angular.module('controlCajaApp', ['ui.router']);
// las rutas ahora se maneja con el concepto de estado
angular.module('controlCajaApp').config(function ($stateProvider,$locationProvider) {
// Las rutas pasan a ser opcionales,
// en la práctica sólo se usan si viene de aplicaciones externas y por cuestiones de SEO
$stateProvider
.state('total', {
url: '/',
controller: 'CajaCtrl as caja',
templateUrl: 'total.html'
})
.state('nuevo', {
url: '/nuevo',
controller: 'CajaCtrl as caja',
templateUrl: 'nuevo.html'
})
.state('lista', {
url: '/lista',
controller: 'CajaCtrl as caja',
templateUrl: 'lista.html'
}).state('not-found', {
url: '*path',
templateUrl: 'not-found.html'
});
// realmente no existe un estado 'not found',
// pero puede llegar rutas no controladas
});
// tenemos que cambiar la dependencia hacia el nuevo módulo
angular.module('cashFlow', ['ui.router']);
// las rutas ahora se maneja con el concepto de estado
angular.module('cashFlow').config(function ($stateProvider) {
// Las rutas pasan a ser opcionales,
// en la práctica sólo se usan si vienen de aplicaciones externas y por cuestiones de SEO
$stateProvider
.state('total', {
url: '/',
controller: 'CajaCtrl as caja',
templateUrl: 'total.html'
})
.state('nuevo', {
url: '/nuevo',
controller: 'CajaCtrl as caja',
templateUrl: 'nuevo.html'
})
.state('lista', {
url: '/lista',
controller: 'CajaCtrl as caja',
templateUrl: 'lista.html'
}).state('not-found', {
url: '*path',
templateUrl: 'not-found.html'
});
// realmente no existe un estado 'not found',
// pero puede llegar rutas no controladas
});

Просмотреть файл

@ -1,40 +1,40 @@
(function () {
var cajaCtrl = function (movimientosFactory) {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
vm.movimientos = movimientosFactory.getMovimientos();
vm.total = movimientosFactory.getTotal();
vm.guardarMovimiento = function () {
if(vm.nuevoMovimiento.esIngreso){
vm.total.ingresos += vm.nuevoMovimiento.importe;
}else{
vm.total.gastos += vm.nuevoMovimiento.importe;
}
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
vm.movimientos.push(auxCopyMov);
vm.nuevoMovimiento.importe = 0;
}
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
angular.module('controlCajaApp').controller('CajaCtrl', cajaCtrl);
}());
(function () {
var cajaCtrl = function (movimientosFactory) {
var vm = this;
vm.titulo = "Controla tu Cash Flow";
vm.maestros = {
categoriasIngresos: ['Nómina', 'Ventas', 'Intereses Depósitos'],
categoriasGastos: ['Hipotéca', 'Compras', 'Impuestos']
};
vm.nuevoMovimiento = {
esIngreso: 1,
esGasto: 0,
importe: 0,
fecha: new Date()
};
vm.movimientos = movimientosFactory.getMovimientos();
vm.total = movimientosFactory.getTotal();
vm.guardarMovimiento = function () {
if(vm.nuevoMovimiento.esIngreso){
vm.total.ingresos += vm.nuevoMovimiento.importe;
}else{
vm.total.gastos += vm.nuevoMovimiento.importe;
}
var auxCopyMov = angular.copy(vm.nuevoMovimiento);
auxCopyMov.tipo = vm.tipo(auxCopyMov);
vm.movimientos.push(auxCopyMov);
vm.nuevoMovimiento.importe = 0;
}
vm.balance = function () {
return vm.total.ingresos - vm.total.gastos
}
vm.tipo = function (movimiento) {
return movimiento.esIngreso && 'Ingreso' || 'Gasto'
}
}
angular.module('cashFlow').controller('CajaCtrl', cajaCtrl);
}());

Просмотреть файл

@ -1,50 +1,50 @@
<html lang="es" ng-app="controlCajaApp">
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('total') }">
<!-- Los enlaces se formulan como estado, con ui-sref -->
<!-- Estos estados generan rutas, según la configuración -->
<!-- Pero internamente siempre trabajamos con estados -->
<a ui-sref="total">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('nuevo') }">
<a ui-sref="nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('lista') }">
<a ui-sref="lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- La directiva de ui-router es... ui-view-->
<div class="container text-center" style="padding-top:50px;" ui-view >
<!-- En este caso podríamos tener varias vista a la vez-->
<!-- Incluso estados anidados unos dentro de otros-->
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script>
<!-- En lugar del enrutador de AngularJS, usaremos uno de terceros, llamado ui-router-->
<script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js"></script>
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
<script src="movimientosFactory.js"></script>
</body>
</html>
<html lang="es" ng-app="cashFlow">
<head>
<title>Control de Caja</title>
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
<meta charset="utf-8" />
<meta lang="es" />
<meta name="description" content="Ejemplo Control de Caja en AngularJS por Alberto Basalo" />
<meta name="author" content="Alberto Basalo @ Ágora Binaria" />
<meta name="application-name" content="ControlAngularJS" />
<meta name="Keywords" content="AngularJS, ejemplo, tutorial, curso" />
<link rel="author" href="https://plus.google.com/+AlbertoBasalo71" />
<!-- Bootstrap core CSS -->
<link href="http://getbootstrap.com/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation" ng-controller="MenuCtrl as menu">
<div class="navbar-inner">
<div class="container">
<ul class="nav navbar-nav">
<li ng-class="{ active: menu.isActive('total') }">
<!-- Los enlaces se formulan como estado, con ui-sref -->
<!-- Estos estados generan rutas, según la configuración -->
<!-- Pero internamente siempre trabajamos con estados -->
<a ui-sref="total">Totales</a>
</li>
<li ng-class="{ active: menu.isActive('nuevo') }">
<a ui-sref="nuevo">Nuevo</a>
</li>
<li ng-class="{ active: menu.isActive('lista') }">
<a ui-sref="lista">Lista</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- La directiva de ui-router es... ui-view-->
<div class="container text-center" style="padding-top:50px;" ui-view >
<!-- En este caso podríamos tener varias vista a la vez-->
<!-- Incluso estados anidados unos dentro de otros-->
</div>
<!-- JavaScript References -->
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.0/angular.min.js"></script>
<!-- En lugar del enrutador de AngularJS, usaremos uno de terceros, llamado ui-router-->
<script src="http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js"></script>
<script src="app.js"></script>
<script src="menuCtrl.js"></script>
<script src="cajaCtrl.js"></script>
<script src="movimientosFactory.js"></script>
</body>
</html>

Просмотреть файл

@ -1,26 +1,26 @@
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = campo == 'fecha' && !sentido">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = campo == 'importe' && !sentido">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>
<section name="Lista">
<p class="lead">Estos son tus movimientos recientes.</p>
<br>
<label class="control-label" for="importe">Filtrar:</label>
<input type="text" name="filtro" placeholder="qué buscas?" class="input" ng-model="valorBuscado">
<table class="table">
<thead>
<tr>
<th><a href="" ng-click="campo = 'fecha'; sentido = !sentido ">Fecha</a>
</th>
<th>Tipo</th>
<th>Categoría</th>
<th><a href="" ng-click="campo = 'importe'; sentido = !sentido ">Importe</a>
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="movimiento in caja.movimientos | filter:valorBuscado | orderBy:campo:sentido">
<td class="text-left">{{movimiento.fecha | date}}</td>
<td class="text-left">{{movimiento.tipo}}</td>
<td class="text-left">{{movimiento.categoria}}</td>
<td class="text-left" ng-class="{'text-success': movimiento.tipo=='Ingreso', 'text-danger' : movimiento.tipo=='Gasto'}">{{movimiento.importe | number:2}} €</td>
</tr>
</tbody>
</table>
</section>

Просмотреть файл

@ -1,10 +1,10 @@
(function () {
// Ahora el sercvicio se llama $state
var menuCtrl = function ($state) {
this.isActive = function (estado) {
// Tiene funciones más amigables para consultar
return $state.is(estado);
}
}
angular.module('controlCajaApp').controller('MenuCtrl',menuCtrl);
}());
(function () {
// Ahora el sercvicio se llama $state
var menuCtrl = function ($state) {
this.isActive = function (estado) {
// Tiene funciones más amigables para consultar
return $state.is(estado);
}
}
angular.module('controlCajaApp').controller('MenuCtrl',menuCtrl);
}());

Просмотреть файл

@ -1,27 +1,27 @@
(function () {
var movimientosFactory =   function ()  {
var movimientos = [];
var total = {
ingresos: 0,
gastos: 0
};
var factory  =   {};
factory.getMovimientos =   function ()  {
return movimientos;
};
factory.getTotal =   function ()  {
return total;
};
factory.postMovimiento =   function (movimiento)  {
movimientos.push(movimiento);
total.ingresos += movimiento.esIngreso * movimiento.importe;
total.gastos += movimiento.esGasto * movimiento.importe;
};
return factory;
};
angular.module('controlCajaApp').factory('movimientosFactory', movimientosFactory);
}());
(function () {
var movimientosFactory =   function ()  {
var movimientos = [];
var total = {
ingresos: 0,
gastos: 0
};
var factory  =   {};
factory.getMovimientos =   function ()  {
return movimientos;
};
factory.getTotal =   function ()  {
return total;
};
factory.postMovimiento =   function (movimiento)  {
movimientos.push(movimiento);
total.ingresos += movimiento.esIngreso * movimiento.importe;
total.gastos += movimiento.esGasto * movimiento.importe;
};
return factory;
};
angular.module('controlCajaApp').factory('movimientosFactory', movimientosFactory);
}());

Просмотреть файл

@ -1,3 +1,3 @@
<section name="total">
<h2>No se ha encontrado lo que buscabas</h2>
</section>
</section>

Просмотреть файл

@ -1,52 +1,52 @@
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso==1}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso==0}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto==1}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto==0}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
</section>
<section name="nuevoMovimiento" class="row-fluid">
<form class="form-horizontal text-left">
<fieldset>
<div id="legend">
<legend class="">Introduce tus movimientos</legend>
</div>
<div class="row-fluid">
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="tipo">Tipo</label>
<div class="controls">
<div class="btn-group">
<button type="button" class="btn btn-success" ng-class="{'active':caja.nuevoMovimiento.esIngreso}" ng-click="caja.nuevoMovimiento.esIngreso=1; caja.nuevoMovimiento.esGasto=0">
<span ng-class="{'small':caja.nuevoMovimiento.esGasto}">+ Ingreso</span>
</button>
<button type="button" class="btn btn-danger" ng-class="{'active':caja.nuevoMovimiento.esGasto}" ng-click="caja.nuevoMovimiento.esIngreso=0; caja.nuevoMovimiento.esGasto=1">
<span ng-class="{'small':caja.nuevoMovimiento.esIngreso}">- Gasto</span>
</button>
</div>
</div>
</div>
<div class="control-group">
<label class="control-label" for="categ">Categoría</label>
<div class="controls">
<select ng-show="caja.nuevoMovimiento.esIngreso" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasIngresos"></select>
<select ng-show="caja.nuevoMovimiento.esGasto" name="categoria" ng-model="caja.nuevoMovimiento.categoria" ng-options="categoria for categoria in caja.maestros.categoriasGastos"></select>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6">
<div class="control-group">
<label class="control-label" for="fecha">Fecha</label>
<div class="controls">
<input type="date" name="fecha" placeholder="" class="input" ng-model="caja.nuevoMovimiento.fecha">
</div>
</div>
<div class="control-group">
<label class="control-label" for="importe">Importe</label>
<div class="controls">
<input type="number" name="importe" placeholder="" class="input" ng-model="caja.nuevoMovimiento.importe">
</div>
</div>
</div>
</div>
<div class="text-right">
<button style="margin-top: 20px" type="button" class="btn btn-lg btn-primary" ng-click="caja.guardarMovimiento()">
<span>Guardar {{ caja.tipo(caja.nuevoMovimiento) }}</span>
</button>
</div>
</fieldset>
</form>
</section>

Просмотреть файл

@ -0,0 +1,49 @@
"use strict";
var http = require('http'),
url = require('url'),
path = require('path'),
fs = require('fs');
var mimeTypes = {
"html": "text/html",
"png": "image/png",
"js": "text/javascript",
"css": "text/css"
};
http.createServer(staticServer).listen(3000);
function staticServer(req, res) {
var pathname = url.parse(req.url).pathname;
if (pathname === "/") {
pathname = "index.html";
}
fileServer(res, pathname);
}
function fileServer(res, pathname) {
var filename = path.join(process.cwd(), pathname);
var extension = path.extname(filename).split(".")[1];
if (!extension) {
extension = "html";
filename += "." + extension;
}
fs.exists(filename, function (exists) {
if (!exists) {
notFound(res);
} else {
res.writeHead(200, {
'Content-Type': mimeTypes[extension]
});
fs.createReadStream(filename).pipe(res);
}
});
}
function notFound(res) {
res.writeHead(404, {
'Content-Type': 'text/html'
});
res.write("<html><head><meta charset='utf-8'></head><body><h1>404</h1> Nada por aquí</body></html>");
res.end();
}

Просмотреть файл

@ -1,38 +1,38 @@
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<section name="total">
<!-- Pero se supone un viweModel llamado caja-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>
<!-- Cada sección tendrá su propia plantilla -->
<!-- No se especifíca el controlador, que será asignado por el enrutador -->
<section name="total">
<!-- Pero se supone un viweModel llamado caja-->
<h1>{{ caja.titulo }}</h1>
<p class="lead">Comprueba de dónde viene y a dónde va tu dinero.</p>
<div class="row-fluid">
<div class="row placeholders">
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-success">
{{ caja.total.ingresos | number:2 }} €
</span>
</h1>
<h4>Total ingresos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label label-danger">
{{ caja.total.gastos | number:2 }} €
</span>
</h1>
<h4>Total gastos</h4>
<span class="text-muted">Acumulado</span>
</div>
<div class="col-xs-8 col-sm-4 placeholder">
<h1>
<span class="label " ng-class="{'label-success': caja.balance()>=0 , 'label-danger' : caja.balance()<0}">
{{ caja.balance() | number:2 }} €
</span>
</h1>
<h4>Balance</h4>
<span class="text-muted">Ingresos-Gastos</span>
</div>
</div>
</div>
</section>

Просмотреть файл